text
stringlengths
2.85k
2.55M
label
class label
11 classes
Constrained Submodular Maximization via a Non-symmetric Technique arXiv:1611.03253v1 [cs.DS] 10 Nov 2016 Niv Buchbinder∗ Moran Feldman† November 11, 2016 Abstract The study of combinatorial optimization problems with a submodular objective has attracted much attention in recent years. Such problems are important in both theory and practice because their objective functions are very general. Obtaining further improvements for many submodular maximization problems boils down to finding better algorithms for optimizing a relaxation of them known as the multilinear extension. In this work we present an algorithm for optimizing the multilinear relaxation whose guarantee improves over the guarantee of the best previous algorithm (which was given by Ene and Nguyen (2016)). Moreover, our algorithm is based on a new technique which is, arguably, simpler and more natural for the problem at hand. In a nutshell, previous algorithms for this problem rely on symmetry properties which are natural only in the absence of a constraint. Our technique avoids the need to resort to such properties, and thus, seems to be a better fit for constrained problems. ∗ Department of Statistics and Operations Research, School of Mathematical Sciences, Tel Aviv university, Israel. Email: niv.buchbinder@gmail.com. † Depart. of Mathematics and Computer Science, The Open University of Israel. Email: moranfe@openu.ac.il. 1 Introduction The study of combinatorial optimization problems with a submodular objective has attracted much attention in recent years. Such problems are important in both theory and practice because their objective functions are very general—submodular functions generalize, for example, cuts functions of graphs and directed graphs, the mutual information function, matroid weighted rank functions and log-determinants. More specifically, from a theoretical perspective, many well-known problems in combinatorial optimization are in fact submodular maximization problems, including: Max-Cut [30, 33, 38, 40, 56], Max-DiCut [20, 30, 31], Generalized Assignment [10, 14, 22, 27], Max-k-Coverage [19, 41], Max-Bisection [3, 28] and Facility Location [1, 16, 17]. From a practical perspective, submodular maximization problems have found uses in social networks [32, 39], vision [5, 36], machine learning [43, 44, 45, 49, 50] and many other areas (the reader is referred, for example, to a comprehensive survey by Bach [4]). The techniques used by approximation algorithms for submodular maximization problems usually fall into one of two main approaches. The first approach is combinatorial in nature, and is mostly based on local search techniques and greedy rules. This approach has been used as early as the late 70’s for maximizing a monotone submodular function subject to a matroid constraint (some of these works apply only to specific types of matroids) [15, 26, 34, 35, 37, 42, 53, 54]. Later works used this approach to handle also problems with non-monotone submodular objective functions and different constraints [6, 21, 25, 47, 48], yielding in some cases optimal algorithms [6, 55]. However, algorithms based on this approach tend to be highly tailored for the specific structure of the problem at hand, making extensions quite difficult. The second approach used by approximation algorithms for submodular maximization problems overcomes the above obstacle. This approach resembles a common paradigm for designing approximation algorithms and involves two steps. In the first step a fractional solution is found for a relaxation of the problem, known as the multilinear relaxation. In the second step the fractional solution is rounded to obtain an integral one while incurring a bounded loss in the objective. This approach has been used to obtain improved approximations for many problems [8, 11, 12, 24, 46]. Various techniques have been developed for rounding the fractional solution. These techniques tend to be quite flexible, and usually can extend to many related problem. In particular, the Contention Resolution Schemes framework of [12] yields a rounding procedure for every constraint which can be presented as the intersection of a few basic constraints such as knapsack constraints, matroid constraints and matching constraints. Given this wealth of rounding procedures, obtaining further improvements for many important submodular maximization problems (such as maximizing a submodular function subject to a matroid or knapsack constraint) boils down to obtaining improved algorithms for finding a good fractional solution, i.e., optimizing the multilinear relaxation. 1.1 Maximizing the Multilinear Relaxation At this point we would like to present some terms more formally. A submodular function is a set function f : 2N → R obeying f (A) + f (B) ≥ f (A ∪ B) + f (A ∩ B) for any sets A, B ⊆ N . A submodular maximization problem is the problem of finding a set S ⊆ N maximizing f subject to some constraint. Formally, let I be the set of subsets of N obeying the constraint. Then, we are interested in the following problem. max f (A) s.t. A ∈ I ⊆ 2N A relaxation of the above problem replaces I with a polytope P ⊆ [0, 1]N containing the 1 characteristic vectors of all the sets of I. In addition, a relaxation must replace the function f with an extension function F : [0, 1]N → R. Thus, a relaxation is a fractional problem of the following format. max F (x) s.t. x ∈ P ⊆ [0, 1]N Defining the “right” extension function, F , for the relaxation is a challenge, as, unlike the linear case, there is no single natural candidate. The objective that turned out to be useful, and is, thus, used by multilinear relaxation is known as the multilinear extension (first introduced by [8]). The value F (x) of this extension for any vector x ∈ [0, 1]N is defined as the expected value of f over a random subset R(x) ⊆ N containing every element u ∈ N independently with probability xu . Formally, for every x ∈ [0, 1]N , Y X Y (1 − xu ) . F (x) = E[R(x)] = f (S) xu S⊆N u∈S u∈S / The first algorithm for optimizing the multilinear relaxation was the Continuous Greedy algorithm designed by Calinescu et al. [8]. When the submodular function f is non-negative and monotone1 and P is solvable2 this algorithm finds a vector x ∈ P such that E[F (x)] ≥ (1 − 1/e − o(1)) · f (OP T ) (where OP T is the set maximizing f among all sets whose characteristic vectors belongs to P ). Interestingly, the guarantee of Continuous Greedy is optimal for monotone functions even when P is a simple cardinality constraint [8, 53]. Optimizing the multilinear relaxation when f is not necessarily monotone proved to be a more challenging task. Initially, several algorithms for specific polytopes were suggested [29, 47, 57]. Later on, improved general algorithms were designed that work whenever f is non-negative and P is down-closed3 and solvable [13, 24]. Designing algorithms that work in this general setting is highly important as many natural constraints fall into this framework. Moreover, the restriction of the algorithms to down-closed polytopes is unavoidable as Vondrák [57] proved that no algorithm can produce a vector x ∈ P obeying E[F (x)] ≥ c · f (OP T ) for any constant c > 0 when P is solvable but not down-closed. Up until recently, the best algorithm for this general setting was called Measured Continuous Greedy [24]. It guaranteed to produce a vector x ∈ P obeying E[F (x)] ≥ (1/e − o(1)) · f (OP T ) ≈ 0.367 · f (OP T ) [24]. The natural feel of the guarantee of Measured Continuous Greedy and the fact that it was not improved for a few years made some people suspect that it is optimal. Recently, an evidence against this conjecture was given by [7], which described an algorithm for the special case of a cardinality constraint with an improved approximation guarantee of 0.371. Even more recently, Ene and Nguyen [18] shuttered the conjecture completely. By extending the technique used by [7], they showed that one can get an approximation guarantee 0.372 for every down-closed and solvable polytope P . On the inapproximability side, Oveis Gharan and Vondrák [29] proved that no algorithm can achieve approximation better than 0.478 even when P is the matroid polytope of a partition matroid. Closing the gap between the best algorithm and inapproximability result for this fundamental problem remains an important open problem. 1 A A 3 A upper 2 set function f : 2N → R is monotone if f (A) ≤ f (B) for every A ⊆ B ⊆ N . polytope is solvable if one can optimize linear functions over it. polytope P ⊆ [0, 1]N is down-closed if y ∈ P implies that every vector x ∈ [0, 1]N which is coordinate-wise bounded by y must belong to P as well. 2 1.2 Our Contribution Our main contribution is an algorithm with an improved guarantee for maximizing the multilinear relaxation. Theorem 1.1. There exists a polynomial time algorithm that given a non-negative submodular function f : 2N → R≥0 and a solvable down-closed polytope P ⊆ [0, 1]N finds a vector x ∈ P obeying F (x) ≥ 0.385 · f (OP T ), where OP T = arg max{f (S) : 1S ∈ P } and F is the multilinear extension of f . Admittedly, the improvement in the guarantee obtained by our algorithm compared to the 0.372 guarantee of [18] is relatively small. However, the technique underlying our algorithm is very different, and, arguably, much cleaner, than the technique underlying the previous results improving over the natural guarantee of 1/e [7, 18]. Moreover, we believe our technique is more natural for the problem at hand, and thus, is likely to yield further improvements in the future. In the rest of this section we explain the intuition on which we base this belief. The results of [7, 18] are based on the observation that the guarantee of Measured Continuous Greedy improves when the algorithm manages to increase all the coordinates of its solution at a slow rate. Based on this observation, [7, 18] run an instance of Measured Continuous Greedy (or a discretized version of it), and force it to raise the coordinates slowly. If this extra restriction does not affect the behavior of the algorithm significantly, then it produces a solution with an improved guarantee. Otherwise, [7, 18] argue that the point in which the extra restriction affect the behavior of Measured Continuous Greedy reveals a vector x ∈ P which contains a significant fraction of OP T . Once x is available, one can use the technique of unconstrained submodular maximization, described by [6], that has higher approximation guarantee of 1/2 > 1/e, to extract from x a vector 0 ≤ y ≤ x of large value. The down-closeness of P guarantees that y belongs to P as well. Unfortunately, the use of the unconstrained submodular maximization technique in the above approach is very problematic for two reasons. First, this technique is based on ideas that are very different from the ideas used by the analysis of Measured Continuous Greedy. This makes the combination of the two quite involved. Second, on a more abstract level, the unconstrained submodular maximization technique is based on a symmetry which exists in the absence of a constraint since f¯(S) = f (N \ S) is non-negative and submodular whenever f has these properties. However, this symmetry breaks when a constraint is introduced, and thus, the unconstrained submodular maximization technique does not seem to be a good fit for a constrained problem. Our algorithm replaces the symmetry based unconstrained submodular maximization technique with a local search algorithm. More specifically, it first executes the local search algorithm. If the output of the local search algorithm is good, then our algorithm simply returns it. Otherwise, we observe that the poor value of the output of the local search algorithm guarantees that it is also far from OP T in some sense. Our algorithm then uses this far from OP T solution to guide an instance of Measured Continuous Greedy, and help it avoid bad decisions. As it turns out, the analysis of Measured Continuous Greedy and the local search algorithm use similar ideas and notions. Thus, the two algorithms combine quite cleanly, as can be observed from Section 3. 3 2 Preliminaries Our analysis uses another useful extension of submodular functions. Given a submodular function f : 2N → R, its Lovász extension is a function fˆ: [0, 1]N → R defined by fˆ(x) = Z 1 f (Tλ (x))dλ , 0 where Tλ (x) = {u ∈ N : xu < λ}. The Lovász extension has many important applications (see, e.g., [9, 52]), however, in this paper we only use it in the context of the following known result (which is an immediate corollary of the work of [51]). Lemma 2.1. Given the multilinear extension F and the Lovász extension fˆ of a submodular function f : 2N → R, it holds that F (x) ≥ fˆ(x) for every vector x ∈ [0, 1]N . We now define some additional notation that we use. Given a set S ⊆ N and an element u ∈ N , we denote by 1S and 1u the characteristic vectors of the sets S and {u}, respectively, and by S + u and S − u the sets S ∪ {u} and S \ {u}, respectively. Given two vectors x, y ∈ [0, 1]N , we denote by x ∨ y, x ∧ y and x ◦ y the coordinate-wise maximum, minimum and multiplication, respectively, of x and y.4 Finally, given a vector x ∈ [0, 1]N and an element u ∈ N , we denote by ∂u F (x) the derivative of F with respect to u at the point x. The following observation gives a simple formula for ∂u F (x). This observation holds because F is a multilinear function. Observation 2.2. Let F (x) be the multilinear extension of a submodular function f : 2N → R. Then, for every u ∈ N and x ∈ [0, 1]N , (1 − xu ) · ∂u F (x) = F (x ∨ 1u ) − F (x) . In the rest of the paper we assume, without loss of generality, that 1u ∈ P for every element u ∈ N and that n is larger than any given constant. The first assumption is justified by the observation that every element u violating this assumption can be safely removed from N since it cannot belong to OP T . The second assumption is justified by the observation that it is possible to find a set S obeying 1S ∈ P and f (S) = f (OP T ) in constant time when n is a constant. Another issue that needs to be kept in mind is the representation of submodular functions. We are interested in algorithms whose time complexity is polynomial in |N |. However, the representation of the submodular function f might be exponential in this size; thus, we cannot assume that the representation of f is given as part of the input for the algorithm. The standard way to bypass this difficulty is to assume that the algorithm has access to f through an oracle. We assume the standard value oracle that is used in most of the previous works on submodular maximization. This oracle returns, given any subset S ⊆ N , the value f (S). 3 Main Algorithm In this section we present the algorithm used to prove Theorem 1.1. This algorithm uses two components. The first component is a close variant of a fractional local search algorithm suggested by Chekuri et al. [13] which has the following properties. 4 More formally, for every element u ∈ N , (x ∨ y)u = max{xu , yu }, (x ∧ y)u = min{xu , yu } and (x ◦ y)u = xu · yu . 4 Lemma 3.1 (Follows from Chekuri et al. [13]). There exists a polynomial time algorithm which returns vector x ∈ P such that, with high probability, for every vector y ∈ P , 1 1 F (x) ≥ F (x ∧ y) + F (x ∨ y) − o(1) · f (OP T ) . 2 2 (1) Proof. Let M = max{f (u), f (N − u) : u ∈ N }, and let a be an arbitrary constant larger than 3. Then, Lemmata 3.7 and 3.8 of Chekuri et al. [13] imply that, with high probability, the fractional local search algorithm they suggest terminates in polynomial time and outputs a vector x ∈ P obeying, for every vector y ∈ P , 2F (x) ≥ F (x ∧ y) + F (x ∨ y) − 5M . na−2 Moreover, the output vector x is in P whenever the fractional local search algorithm terminates. Our assumption that 1u ∈ P for every element u ∈ N implies, by submodularity, that f (S) ≤ n · f (OP T ) for every set S ⊆ N . Since M is the maximum over values of f , we get also M ≤ n · f (OP T ). Using this observation, and plugging a = 4, we get that there exists an algorithm which, with high probability, terminates after T (n) operations (for some polynomial function T (n)) T) for every vector y ∈ P . and outputs a vector x ∈ P obeying 2F (x) ≥ F (x ∧ y) + F (x ∨ y) − 5·f (OP n Moreover, the output vector x belongs to P whenever the algorithm terminates. To complete the lemma, we consider a procedure that executes the above algorithm for T (n) operations, and return its output if it terminates within this number of operations. If the algorithm fails to terminate within this number of operations, which happens with a diminishing probability, then the procedure simply returns 1∅ (which always belongs to P since P is down-closed). One can observe that this procedure has all the properties guaranteed by the lemma. The second component of our algorithm is a new auxiliary algorithm which we present and analyze in Section 4. This auxiliary algorithm is the main technical contribution of this paper, and its guarantee is given by the following theorem. Theorem 3.2. There exists a polynomial time algorithm that given a vector z ∈ [0, 1]N and a value ts ∈ [0, 1] outputs a vector x ∈ P obeying E[F (x)] ≥ ets −1 · [(2 − ts − e−ts − o(1)) · f (OP T ) − (1 − e−ts ) · F (z ∧ 1OP T ) −ts − (2 − ts − 2e (2) ) · F (z ∨ 1OP T )] . Our main algorithm executes the algorithms suggested by Lemma 3.1 followed by the algorithm suggested by Theorem 3.2. Notice that the second of these algorithms has two parameters in addition to f and P : a parameter z which is set to be the output of the first algorithm, and a parameter ts which is set to be a constant to be determined later. After the two above algorithms terminate, our algorithm returns the output of the first algorithm with probability p, for a constant p to be determined later, and with the remaining probability it returns the output of the second algorithm.5 A formal description of our algorithm is given as Algorithm 1. Observe that Lemma 3.1 and Theorem 3.2 imply together that Algorithm 1 is a polynomial time algorithm which always outputs a vector in P . To prove Theorem 1.1, it remains to analyze the quality of the solution produced by Algorithm 1. 5 Clearly it is always better to return the better of the two solution instead of randomizing between them. However, doing so will require the algorithm to either have an oracle access to F or estimate the values of the solutions using sampling (the later can be done using standard techniques—see, e.g., [8]). For the sake of simplicity, we chose here the easier to analyze approach of randomizing between the two solutions. 5 Algorithm 1: Main Algorithm(f, P ) 1 2 3 Execute the algorithm suggested by Lemma 3.1, and let x1 ∈ P be its output. Execute the algorithm suggested by Theorem 3.2 with z = x1 , and let x2 be its output. return with probability p the solution x1 , and the solution x2 otherwise. Lemma 3.3. When its parameters are set to ts = 0.372 and p = 0.23, Algorithm 1 produces a solution whose expected value is at least 0.385 · f (OP T ). Proof. Let E be the event that x1 , the output of the algorithm suggested by Lemma 3.1, satisfies Inequality (1). Since E is a high probability event, it is enough to prove that, conditioned on E, Algorithm 1 produces a solution whose expected value is at least c · f (OP T ) for some constant c > 0.385. The rest of the proof of the lemma is devoted to proving the last claim. Throughout it, everything is implicitly conditioned on E. As we are conditioning on E, we can plug y = 1OP T and, respectively, y = x1 ∧ 1OP T into Inequality (1) to get 1 1 F (x1 ) ≥ F (x1 ∧ 1OP T ) + F (x1 ∨ 1OP T ) − o(1) · f (OP T ) (3) 2 2 and F (x1 ) ≥ F (x1 ∧ 1OP T ) − o(1) · f (OP T ) , (4) where the last inequality follows by noticing that x1 ∨ (x1 ∧ 1OP T ) = x1 . Next, let E[F (x2 ) | x1 ] denote the expected value of F (x2 ) conditioned on the given value of x1 . Inequality (2) guarantees that E[F (x2 ) | x1 ] ≥ ets −1 · [(2 − ts − e−ts − o(1)) · f (OP T ) − (1 − e−ts ) · F (x1 ∧ 1OP T ) −ts − (2 − ts − 2e (5) ) · F (x1 ∨ 1OP T )] . Recall that Algorithm 1 returns x1 with probability p, and x2 otherwise. Hence, the expected value of its output is E[p · F (x1 ) + (1 − p) · E[F (x2 ) | x1 ]] , (6) where the expectation is over x1 . Optimizing the constants. We would like to derive from Inequalities (3), (4) and (5) the best lower bound we can get on (6). To this end, let p1 and p2 be two non-negative numbers such that p1 + p2 = p, and let p3 = 1 − p. Using the above inequalities and this notation, (6) can now be lower bounded by   1 1 p1 · E[F (x1 ∧ 1OP T )] + E[F (x1 ∨ 1OP T )] − o(1) · f (OP T ) 2 2 + p2 · [E[F (x1 ∧ 1OP T )] − o(1) · f (OP T )] + p3 · ets −1 · [(2 − ts − e−ts − o(1)) · f (OP T ) − (1 − e−ts ) · E[F (x1 ∧ 1OP T )] − (2 − ts − 2e−ts ) · E[F (x1 ∨ 1OP T )]] , which can be rewritten as p  + p2 − p3 · ets −1 (1 − e−ts ) · E[F (x1 ∧ 1OP T )]   p2 1 − p3 · ets −1 (2 − ts − 2e−ts ) · E[F (x1 ∨ 1OP T )] + 2 + p3 · ets −1 (2 − ts − e−ts ) · f (OP T ) − o(1) · f (OP T ) . 1 6 To get the most out of this lower bound we need to maximize the coefficient of f (OP T ) while keeping the coefficients of E[F (x1 ∧ 1OP T )] and E[F (x1 ∨ 1OP T )] non-negative (so that they can be ignored due to non-negativity of f ). This objective is formalized by the following non-convex program. max p3 · ets −1 (2 − ts − e−ts ) s.t. p1 /2 + p2 − p3 · ets −1 (1 − e−ts ) p1 /2 − p3 · ets −1 (2 − ts − 2e−ts ) p1 + p2 + p3 p 1 , p 2 , p 3 , ts ≥0 ≥0 =1 ≥0 Solving the program, we get that the best solution is approximately p1 = 0.205, p2 = 0.025, p3 = 0.770 and ts = 0.372, and the objective function value corresponding to this solution is at least 0.3856. Hence, we have managed to lower bound (6) (and thus, also the expected value of the output of Algorithm 1) by 0.3856 · f (OP T ) for p = 0.23 and ts = 0.372, which completes the proof of the lemma. 4 Aided Measured Continuous Greedy In this section we present the algorithm used to prove Theorem 3.2. Proving the above theorem directly is made more involved by the fact that the vector z might be fractional. Instead, we prove the following simplified version of Theorem 3.2 for integral values, and show that the simplified version implies the original one. Theorem 4.1. There exists a polynomial time algorithm that given a set Z ⊆ N and a value ts ∈ [0, 1] outputs a vector x ∈ P obeying E[F (x)] ≥ ets −1 · [(2 − ts − e−ts − o(1)) · f (OP T ) − (1 − e−ts ) · f (Z ∩ OP T ) − (2 − ts − 2e−ts ) · f (Z ∪ OP T )] . Next is the promised proof that Theorem 4.1 implies Theorem 3.2. Proof of Theorem 3.2 given Theorem 4.1. Consider an algorithm ALG that given the z and ts arguments specified by Theorem 3.2 executes the algorithm guaranteed by Theorem 4.1 with the same value ts and with a random set Z distributed like R(z). The output of ALG is then the output produced by the algorithm guaranteed by Theorem 4.1. Let us denote this output by x. Theorem 4.1 guarantees that, for every given Z, E[F (x) | Z] ≥ ets −1 · [(2 − ts − e−ts − o(1)) · f (OP T ) − (1 − e−ts ) · f (Z ∩ OP T ) − (2 − ts − 2e−ts ) · f (Z ∪ OP T )] . To complete the proof we take the expectation over Z over the two sides of the last inequality and observe that E[f (Z ∩ OP T )] = E[f (R(z) ∩ OP T )] = E[f (R(z ∧ 1OP T ))] = F (z ∧ 1OP T ) and E[f (Z ∪ OP T )] = E[f (R(z) ∪ OP T )] = E[f (R(z ∨ 1OP T ))] = F (z ∨ 1OP T ) . 7 In the rest of this section we give a non-formal proof of Theorem 4.1. This proof explains the main ideas necessary for proving the theorem, but uses some non-formal simplifications such as allowing a direct oracle access to the multilinear extension F and giving the algorithm in the form of a continuous time algorithm (which cannot be implemented on a discrete computer). There are known techniques for getting rid of these simplifications (see, e.g., [8]), and a formal proof of Theorem 4.1 based on these techniques is given in Appendix A. The algorithm we use for the non-formal proof of Theorem 4.1 is given as Algorithm 2. This algorithm starts with the empty solution y(0) = 1∅ at time 0, and grows this solution over time until it reaches the final solution y(1) at time 1. The way the solution grows varies over time. During the time range [ts , 1) the solution grows like in the Measured Continuous Greedy algorithm of [24]. On the other hand, during the earlier time range of [0, ts ) the algorithm pretends that the elements of Z do not exist (by giving them negative marginal profits), and grows the solution in the way Measured Continuous Greedy would have grown it if it was given the ground set N \ Z. The value ts is the time in which the algorithm switches between the two ways it uses to grow its solution, thus, the s in the notation ts stands for “switch”. Algorithm 2: Aided Measured Continuous Greedy (non-formal)(f, P, Z, ts ) 1 2 3 4 5 6 Let y(0) ← 1∅ . foreach t ∈ [0, 1) do For each u ∈ N let wu (t) ← F (y(t) ∨ 1u ) − F (y(t)). P P  arg maxx∈P { u∈N \Z wu (t) · xu (t) − u∈Z xu (t)} if t ∈ [0, ts ) , P Let x(t) ← arg maxx∈P if t ∈ [ts , 1) . u∈N wu (t) · xu (t) Increase y(t) at a rate of dy(t) dt = (1N − y(t)) ◦ x(t). return y(1). We first note that algorithm outputs a vector in P . Observation 4.2. y(1) ∈ P . Proof. Observe that x(t) ∈ P at eachR time t, which implies that (1N − y(t)) · x(t) is also in P since 1 P is down-closed. Therefore, y(1) = 0 (1N − y(t)) · x(t)dt is a convex combination of vectors in P , and thus, belongs to P . The following lemma lower bounds the increase in F (y(t)) as a function of t. Lemma 4.3. For every t ∈ [0, 1), ( F (y(t) ∨ 1OP T \Z ) − F (y(t)) dF (y(t)) ≥ dt F (y(t) ∨ 1OP T ) − F (y(t)) if t ∈ [0, ts ) , if t ∈ [ts , 1) . Proof. By the chain rule, ! ! X X dyu (t) ∂F (y) ∂F (y) dF (y(t)) = (1 − yu (t)) · xu (t) · = · dt dt ∂yu y=y(t) ∂yu y=y(t) u∈N u∈N X X = (xu (t) · [F (y(t) ∨ 1u ) − F (y(t))]) = xu (t) · wu (t) = x(t) · w(t) . u∈N (7) u∈N Consider first the case this time period Algorithm 2 chooses x(t) as the P t ∈ [0, ts ). During P vector in P maximizing u∈N \Z wu (t) · xu (t) − u∈Z xu (t). Since P is down-closed x(t) = 1OP T \Z 8 is in P and has value 1OP T \Z · w(t) and thus, we have x(t) · w(t) ≥ 1OP T \Z · w(t). Plugging this observation into Equality (7) yields dF (y(t)) = x(t) · w(t) ≥ 1OP T \Z · w(t) = dt ≥ F (y(t) ∨ 1OP T \Z ) − F (y(t)) , X [F (y(t) ∨ 1u ) − F (y(t))] u∈OP T \Z where the last inequality holds by the submodularity of f . Similarity, when t ∈ [ts , 1) Algorithm 2 chooses x(t) as the vector in P maximizing x(t) · w(t). Since 1OP T ∈ P , we get this time x(t) · w(t) ≥ 1OP T · w(t). Plugging this observation into Equality (7) yields X dF (y(t)) = x(t) · w(t) ≥ 1OP T · w(t) = [F (y(t) ∨ 1u ) − F (y(t))] dt u∈OP T ≥ F (y(t) ∨ 1OP T ) − F (y(t)) , where the last inequality holds again by the submodularity of f . Lemma 4.4. For every time t ∈ [0, 1) and set A ⊆ N it holds that   F (y(t) ∨ 1A ) ≥ e− max{0,t−ts } − e−t max {0, f (A) − f (A ∪ Z)} + e−t · f (A) . Proof. First, we note that for every time t ∈ [0, 1] and element u ∈ N , ( 1 − e−t if u 6∈ Z , yu (t) ≤ − max{0,t−t s} 1−e if u ∈ Z . (8) This follows for the following reason. Since x(t) is always in P ⊆ [0, 1]N , yu (t) obeys the differential inequality dy(t) = (1 − yu (t)) · x(t) ≤ (1 − yu (t)) . dt Using the initial condition yu (0) = 0, the solution for this differential inequality is yu (t) ≤ 1 − e−t . To get the tighter bound for u ∈ Z, we note that at every time t ∈ [0, ts ) Algorithm 2 chooses as x(t) a vector maximizing a linear function in P which assigns a negative weight to elements of Z. Since P is down-closed this maximum must have xu (t) = 0 for every element u ∈ Z. This means that yu (t) = 0 whenever u ∈ Z and t ∈ [0, ts ]. Moreover, plugging the improved initial condition yu (ts ) = 0 into the above differential inequality yields the promised tighter bound also for the range (ts , 1]. Next, let fˆ be the Lovász extension of f . Then, by Lemma 2.1, Z 1 ˆ f (Tλ (y(t) ∨ 1A ))dλ F (y(t) ∨ 1A ) ≥ f (y(t) ∨ 1A ) = 0 ≥ Z 1−e−t 1−e− max{0,t−ts } Z 1−e−t f (Tλ (y(t) ∨ 1A ))dλ + Z 1 1−e−t f (Tλ (y(t) ∨ 1A ))dλ f (Tλ (y(t) ∨ 1A ))dλ + e−t · f (A)   ≥ e− max{0,t−ts } − e−t max {0, f (A) − f (A ∪ Z)} + e−t · f (A) . = (9) (10) 1−e− max{0,t−ts } 9 (11) Inequality (9) follows by the non-negativity of f . Equality (10) follows since, for λ ∈ [1 − e−t , 1), Inequality (8) guarantees that yu (t) ≤ λ for every u ∈ N , and thus, Tλ (y(t) ∨ 1A ) = A. Finally Inequality (11) follows since, for λ ∈ [1 − e− max{0,t−ts } , 1 − e−t ), Inequality (8) guarantees that yu (t) ≤ λ for every u ∈ Z, and thus, Tλ (y(t) ∨ 1A ) = B(λ) ∪ A for some B(λ) ⊆ N \ Z. By the non-negativity of f , f (B(λ) ∪ A) ≥ 0. Also, by the submodularity and non-negativity of f , for every such set B(λ) f (B(λ) ∪ A) ≥ f (A) + f (B(λ) ∪ Z ∪ A) − f (Z ∪ A) ≥ f (A) − f (Z ∪ A) . Plugging the results of Lemma 4.4 into the lower bound given by Lemma 4.3 on the improvement in F (y(t)) as a function of t yields immediately the useful lower bound given by the next corollary.6 Corollary 4.5. For every t ∈ [0, 1), ( f (OP T \ Z) − (1 − e−t ) · f (Z ∪ OP T ) − F (y(t)) dF (y(t)) ≥ dt ets −t · f (OP T ) − (ets −t − e−t ) · f (Z ∪ OP T ) − F (y(t)) if t ∈ [0, ts ) , if t ∈ [ts , 1) . Using the last corollary we can complete the proof of Theorem 4.1. Proof of Theorem 4.1. We have already seen that y(1)—the output of Algorithm 2—belongs to P . It remains to show that F (y(1)) ≥ ets −1 · [(2 − ts − e−ts ) · f (OP T ) − (1 − e−ts ) · f (Z ∩ OP T ) − (2 − ts − 2e−ts ) · f (Z ∪ OP T )] . Corollary 4.5 describes a differential inequality for F (y(t)). Given the boundary condition F (y(0)) ≥ 0, the solution for this differential inequality within the range t ∈ [0, ts ] is F (y(t)) ≥ (1 − e−t ) · f (OP T \ Z) − (1 − e−t − te−t ) · f (Z ∪ OP T ) . Plugging t = ts into the last inequality, we get F (y(ts )) ≥ (1 − e−ts ) · f (OP T \ Z) − (1 − e−ts − ts e−ts ) · f (Z ∪ OP T ) . Let v = (1 − e−ts ) · f (OP T \ Z) − (1 − e−ts − ts e−ts ) · f (Z ∪ OP T ) be the right hand side of the last inequality. Next, we solve again the differential inequality given by Corollary 4.5 for the range t ∈ [ts , 1] with the boundary condition F (y(ts )) ≥ v. The resulting solution is    F (y(t)) ≥ e−t (t − ts ) ets · f (OP T ) − (ets − 1) · f (Z ∪ OP T ) + vets Plugging t = 1 and the value of v we get    F (y(1)) ≥ e−1 (1 − ts ) ets · f (OP T ) − (ets − 1) · f (Z ∪ OP T ) + vets  1 − ts ts e · f (OP T ) − (ets − 1) · f (Z ∪ OP T ) (12) ≥ e + ets −1 · {(1 − e−ts ) · [f (OP T ) − f (OP T ∩ Z)] − (1 − e−ts − ts e−ts ) · f (Z ∪ OP T )} = ets −1 · [(2 − ts − e−ts ) · f (OP T ) − (1 − e−ts ) · f (Z ∩ OP T ) − (2 − ts − 2e−ts ) · f (Z ∪ OP T )] , where Inequality (12) follows since, by the submodularity and non-negativity of f , f (OP T \ Z) ≥ f (OP T ) − f (OP T ∩ Z) + f (∅) ≥ f (OP T ) − f (OP T ∩ Z) . 6 Note that Corollary 4.5 follows from a weaker version of Lemma 4.4 which only guarantees F (y(t) ∨ 1A ) ≥ (e − e−t ) · [f (A) − f (A ∪ Z)] + e−t · f (A). We proved the stronger version of the lemma above because it is useful in the formal proof of Theorem 4.1 given in Appendix A. − max{0,t−ts } 10 References [1] A. A. Ageev and M. I. Sviridenko. An 0.828 approximation algorithm for the uncapacitated facility location problem. Discrete Appl. Math., 93:149–156, July 1999. [2] Noga Alon and Joel H. Spencer. The Probabilistic Method. Wiley Interscience, second edition, 2000. [3] Per Austrin, Siavosh Benabbas, and Konstantinos Georgiou. Better balance by being biased: A 0.8776-approximation for max bisection. In SODA, pages 277–294, 2013. [4] Francis Bach. Learning with submodular functions: A convex optimization perspective. Foundations and Trends in Machine Learning, 6(2-3):145–373, 2013. [5] Y. Y. Boykov and M. P. Jolly. Interactive graph cuts for optimal boundary & region segmentation of objects in N-D images. In ICCV, volume 1, pages 105–112, 2001. [6] Niv Buchbinder, Moran Feldman, Joseph (Seffi) Naor, and Roy Schwartz. A tight linear time (1/2)-approximation for unconstrained submodular maximization. In FOCS, pages 649–658, 2012. [7] Niv Buchbinder, Moran Feldman, Joseph (Seffi) Naor, and Roy Schwartz. Submodular maximization with cardinality constraints. In SODA, pages 1433–1452, 2014. [8] Gruia Călinescu, Chandra Chekuri, Martin Pál, and Jan Vondrák. Maximizing a monotone submodular function subject to a matroid constraint. SIAM J. Comput., 40(6):1740–1766, 2011. [9] Chandra Chekuri and Alina Ene. Approximation algorithms for submodular multiway partition. In FOCS, pages 807–816, 2011. [10] Chandra Chekuri and Sanjeev Khanna. A polynomial time approximation scheme for the multiple knapsack problem. SIAM J. Comput., 35(3):713–728, September 2005. [11] Chandra Chekuri, Jan Vondrák, and Rico Zenklusen. Dependent randomized rounding via exchange properties of combinatorial structures. In FOCS, pages 575–584, 2010. [12] Chandra Chekuri, Jan Vondrák, and Rico Zenklusen. Submodular function maximization via the multilinear relaxation and contention resolution schemes. In STOC, pages 783–792, 2011. [13] Chandra Chekuri, Jan Vondrák, and Rico Zenklusen. Submodular function maximization via the multilinear relaxation and contention resolution schemes. SIAM J. Comput., 43(6):1831– 1879, 2014. [14] Reuven Cohen, Liran Katzir, and Danny Raz. An efficient approximation for the generalized assignment problem. Information Processing Letters, 100(4):162–166, 2006. [15] M. Conforti and G. Cornuèjols. Submodular set functions, matroids and the greedy algorithm. tight worstcase bounds and some generalizations of the radoedmonds theorem. Disc. Appl. Math., 7(3):251–274, 1984. [16] G. Cornuejols, M. L. Fisher, and G. L. Nemhauser. Location of bank accounts to optimize float: an analytic study of exact and approximate algorithms. Management Sciences, 23:789–810, 1977. 11 [17] G. Cornuejols, M. L. Fisher, and G. L. Nemhauser. On the uncapacitated location problem. Annals of Discrete Mathematics, 1:163–177, 1977. [18] Alina Ene and Huy L. Nguyen. Constrained submodular maximization: Beyond 1/e. In FOCS, 2016. [19] Uriel Feige. A threshold of ln n for approximating set cover. J. ACM, 45(4):634–652, 1998. [20] Uriel Feige and Michel X. Goemans. Aproximating the value of two prover proof systems, with applications to max 2sat and max dicut. In ISTCS, pages 182–189, 1995. [21] Uriel Feige, Vahab S. Mirrokni, and Jan Vondrák. Maximizing non-monotone submodular functions. SIAM Journal on Computing, 40(4):1133–1153, 2011. [22] Uriel Feige and Jan Vondrák. Approximation algorithms for allocation problems: Improving the factor of 1 − 1/e. In FOCS, pages 667–676, 2006. [23] Moran Feldman. Maximization Problems with Submodular Objective Functions. PhD thesis, Technion – Israel Institute of Technology, June 2013. [24] Moran Feldman, Joseph Naor, and Roy Schwartz. A unified continuous greedy algorithm for submodular maximization. In FOCS, pages 570–579, 2011. [25] Moran Feldman, Joseph (Seffi) Naor, Roy Schwartz, and Justin Ward. Improved approximations for k-exchange systems. In ESA, pages 784–798, 2011. [26] M. L. Fisher, G. L. Nemhauser, and L. A. Wolsey. An analysis of approximations for maximizing submodular set functions – ii. In Polyhedral Combinatorics, volume 8 of Mathematical Programming Studies, pages 73–87. Springer Berlin Heidelberg, 1978. [27] Lisa Fleischer, Michel X. Goemans, Vahab S. Mirrokni, and Maxim Sviridenko. Tight approximation algorithms for maximum general assignment problems. In SODA, pages 611–620, 2006. [28] Alan M. Frieze and Mark Jerrum. Improved approximation algorithms for max k-cut and max bisection. In IPCO, pages 1–13, 1995. [29] Shayan Oveis Gharan and Jan Vondrák. Submodular maximization by simulated annealing. In SODA, pages 1098–1117, 2011. [30] Michel X. Goemans and David P. Williamson. Improved approximation algorithms for maximum cut and satisfiability problems using semidefinite programming. Journal of the ACM, 42(6):1115–1145, 1995. [31] Eran Halperin and Uri Zwick. Combinatorial approximation algorithms for the maximum directed cut problem. In SODA, pages 1–7, 2001. [32] Jason Hartline, Vahab Mirrokni, and Mukund Sundararajan. Optimal marketing strategies over social networks. In WWW, pages 189–198, 2008. [33] Johan Hȧstad. Some optimal inapproximability results. J. ACM, 48:798–859, July 2001. [34] D. Hausmann and B. Korte. K-greedy algorithms for independence systems. Oper. Res. Ser. A-B, 22(1):219–228, 1978. 12 [35] D. Hausmann, B. Korte, and T. Jenkyns. Worst case analysis of greedy type algorithms for independence systems. Math. Prog. Study, 12:120–131, 1980. [36] S. Jegelka and J. Bilmes. Submodularity beyond submodular energies: Coupling edges in graph cuts. 2012 IEEE Conference on Computer Vision and Pattern Recognition, 0:1897–1904, 2011. [37] T. Jenkyns. The efficacy of the greedy algorithm. Cong. Num., 17:341–350, 1976. [38] Richard M. Karp. Reducibility among combinatorial problems. In R. E. Miller and J. W. Thatcher, editors, Complexity of Computer Computations, pages 85–103. Plenum Press, 1972. [39] David Kempe, Jon Kleinberg, and Éva Tardos. Maximizing the spread of influence through a social network. In SIGKDD, pages 137–146, 2003. [40] Subhash Khot, Guy Kindler, Elchanan Mossel, and Ryan O’Donnell. Optimal inapproximability results for max-cut and other 2-variable csps? SIAM J. Comput., 37:319–357, April 2007. [41] S. Khuller, A. Moss, and J. Naor. The budgeted maximum coverage problem. Information Processing Letters, 70(1):39–45, 1999. [42] B. Korte and D. Hausmann. An analysis of the greedy heuristic for independence systems. Annals of Discrete Math., 2:65–74, 1978. [43] Andreas Krause, AjitSingh, and Carlos Guestrin. Near-optimal sensor placements in gaussian processes: Theory, efficient algorithms and empirical studies. J. Mach. Learn. Res., 9:235–284, January 2008. [44] Andreas Krause and Carlos Guestrin. Near-optimal nonmyopic value of information in graphical models. In UAI, page 5, 2005. [45] Andreas Krause, Jure Leskovec, Carlos Guestrin, Jeanne VanBriesen, and Christos Faloutsos. Efficient sensor placement optimization for securing large water distribution networks. Journal of Water Resources Planning and Management, 134(6):516–526, November 2008. [46] Ariel Kulik, Hadas Shachnai, and Tami Tamir. Approximations for monotone and nonmonotone submodular maximization with knapsack constraints. Math. Oper. Res., 38(4):729–739, 2013. [47] Jon Lee, Vahab S. Mirrokni, Viswanath Nagarajan, and Maxim Sviridenko. Maximizing nonmonotone submodular functions under matroid or knapsack constraints. SIAM Journal on Discrete Mathematics, 23(4):2053–2078, 2010. [48] Jon Lee, Maxim Sviridenko, and Jan Vondrák. Submodular maximization over multiple matroids via generalized exchange properties. In APPROX, pages 244–257, 2009. [49] Hui Lin and Jeff Bilmes. Multi-document summarization via budgeted maximization of submodular functions. In North American chapter of the Association for Computational Linguistics/Human Language Technology Conference (NAACL/HLT-2010), Los Angeles, CA, June 2010. [50] Hui Lin and Jeff Bilmes. A class of submodular functions for document summarization. In HLT, pages 510–520, 2011. 13 [51] László Lovász. Submodular functions and convexity. In A. Bachem, M. Grötschel, and B. Korte, editors, Mathematical Programming: the State of the Art, pages 235–257. Springer, 1983. [52] L. Lovász M. Grötschel and A. Schrijver. The ellipsoid method and its consequences in combinatorial optimization. Combinatoria, 1(2):169–197, 1981. [53] G. L. Nemhauser and L. A. Wolsey. Best algorithms for approximating the maximum of a submodular set function. Mathematics of Operations Research, 3(3):177–188, 1978. [54] G. L. Nemhauser, L. A. Wolsey, and M. L. Fisher. An analysis of approximations for maximizing submodular set functionsi. Mathematical Programming, 14:265–294, 1978. [55] Maxim Sviridenko. A note on maximizing a submodular set function subject to knapsack constraint. Operations Research Letters, 32:41–43, 2004. [56] Luca Trevisan, Gregory B. Sorkin, Madhu Sudan, and David P. Williamson. Gadgets, approximation, and linear programming. SIAM J. Comput., 29:2074–2097, April 2000. [57] Jan Vondrák. Symmetry and approximability of submodular maximization problems. SIAM J. Comput., 42(1):265–304, 2013. A A Formal Proof of Theorem 4.1 In this section we give a formal proof of Theorem 4.1. This proof is based on the same ideas used in the non-formal proof of this theorem in Section 4, but employs also additional known techniques in order to get rid of the issues that make the proof from Section 4 non-formal. The algorithm we use to prove Theorem 4.1 is given as Algorithm 3. This algorithm is a discrete variant of Algorithm 2. While reading the algorithm, it is important to observe that the choice of the values δ̄1 and δ̄2 guarantees that the variable t takes each one of the values ts and 1 at some point, and thus, the vectors y(ts ) and y(1) are well defined. Algorithm 3: Aided Measured Continuous Greedy(f, P, Z, ts ) 1 2 3 4 5 6 7 8 9 10 // Initialization Let δ̄1 ← ts · n−4 and δ̄2 ← (1 − ts ) · n−4 . Let t ← 0 and y(t) ← 1∅ . // Growing y(t) while t < 1 do foreach u ∈ N do Let wu (t) be an estimate of E[f (u | R(y(t))] obtained by averaging the values of f (u | R(y(t)) for r = ⌈48n6 ln(2n)⌉ independent samples of R(y(t)). P P  arg maxx∈P { u∈N \Z wu (t) · xu (t) − u∈Z xu (t)} if t ∈ [0, ts ) , P Let x(t) ← if t ∈ [ts , 1) . arg maxx∈P u∈N wu (t) · xu (t) Let δt be δ̄1 when t < ts and δ̄2 when t ≥ ts . Let y(t + δt ) ← y(t) + δt (1N − y(t)) ◦ x(t). Update t ← t + δt . return y(1). 14 We begin the analysis of Algorithm 3 by showing that y(t) remains within the cube [0, 1]N throughout the execution of the algorithm. Without this observation, the algorithm is not welldefined. Observation A.1. For every value of t, y(t) ∈ [0, 1]N . Proof. We prove the observation by induction on t. Clearly the observation holds for y(0) = 1∅ . Assume the observation holds for some time t, then, for every u ∈ N , yu (t + δt ) = yu (t) + δt (1 − yu (t)) · xu (t) ≥ 0 , where the inequality holds since the induction hypothesis implies 1 − yu (t) ∈ [0, 1]. A similar argument also implies yu (t + δt ) = yu (t) + δt (1 − yu (t)) · xu (t) ≤ yu (t) + (1 − yu (t)) = 1 . Using the last observation it is now possible to prove the following counterpart of Observation 4.2. Corollary A.2. Algorithm 3 always outputs a vector in P . Proof. Let T be the set of values t takes P P during the execution of Algorithm 3. We observe that δ = 1, which implies that t∈T \{1} t t∈T \{1} δt · x(t) is a convex combination of the vectors {x(t) : t ∈ T \ {1}}. P As all these vectors belong to P , and P is convex, any convex combination of them, including t∈T \{1} δt · x(t), must be in P . Next, we rewrite the output of Algorithm 3 as X X δt · x(t) . δt (1N − y(t)) ◦ x(t) ≤ y(1) = t∈T \{1} t∈T \{1} By the above discussion the rightmost hand side of this inequality is a vector in P , which implies that y(1) ∈ P since P is down-closed. The next step towards showing that Algorithm 3 proves Theorem 4.1 is analyzing its approximation ratio. We start this analysis by showing that with high probability all the estimations made by the algorithm are quite accurate. Let A be the event that |wu (t)−E[f (u | R(y(t)))]| ≤ n−2 ·f (OP T ) for every u ∈ N and time t. Lemma A.3 (The symmetric version of Theorem A.1.16 in [2]). Let Xi , 1 ≤ i ≤ k, be mutually independent with all E[Xi ] = 0 and all |Xi | ≤ 1. Set S = X1 + · · · + Xk . Then, Pr[|S| > a] ≤ 2 2e−a /2k . Corollary A.4. Pr[A] ≥ 1 − n−1 . Proof. Consider the calculation of wu (t) for a given u ∈ N and time t. This calculation is done by averaging the value of f (u | R(y(t))) for r independent samples of R(y(t)). Let Yi denote the value (u|R(y(t)))] . Then, by definition, of f (u | R(y(t))) obtained for the i-th sample, and let Xi = Yi −E[f 2n·f (OP T ) wu (t) = Pr i=1 Yi r = [2n · f (OP T )] · Pr i=1 Xi r + E[f (u | R(y(t)))] . Since Yi is distributed like f (u | R(y(t))), the definition of Xi guarantees that E[Xi ] = 0 for every 1 ≤ i ≤ r. Additionally, |Xi | ≤ 1 for every such i since the absolute values of both Yi and 15 E[f (u | R(y(t)))] are upper bounded by maxS⊆N f (S) ≤ n · f (OP T ) (the last inequality follows from our assumption that 1u ∈ P for every element u ∈ N ). Thus, by Lemma A.3, # " r X r −3 2 Xi > 3 ≤ 2e−[rn /2] /2r Pr[|wu (t) − E[f (u | R(y(t)))]| > n−2 · f (OP T )] = Pr 2n i=1  6 1 1 −rn−6 /8 −6 ln(2n) = 2e ≤ 2e =2· ≤ 6 . 2n 2n Observe that Algorithm 3 calculates wu (t) for every combination of element u ∈ N and time t < 1. Since there are n elements in N and 2n4 times smaller than 1, the union bound implies that the probability that for at least one such value wu (t) we have |wu (t) − E[f (u | R(y(t)))]| > n−2 · f (OP T ) is upper bounded by  1 1 · n · 2n4 = , 6 2n n which completes the proof of the corollary. Our next step is to give a lower bound on the increase in F (y(t)) as a function of t given A. This lower bound is given by Corollary A.7, which follows from the next two lemmata. The statement and proof of the corollary and the next lemma is easier with the following definition. Let OP Tt′ denote the set OP T \ Z when t < ts , and OP T otherwise. P Lemma A.5. Given A, for every time t < 1, u∈N (1 − yu (t)) · xu (t) · ∂u F (y(t)) ≥ F (y(t) ∨ −1 1OP Tt′ ) − F (y(t)) − O(n ) · f (OP T ). Proof. Let us calculate the weight of OP Tt′ according to the weight function w(t). X X wu (t) ≥ [E[f (u | R(y(t)))] − n−2 · f (OP T )] w(t) · 1OP Tt′ = u∈OP Tt′  ≥ E X u∈OP Tt′ u∈OP Tt′  f (R(y(t)) + u) − f (R(y(t))) − n−1 · f (OP T )  ≥ E f (R(y(t)) ∪ OP Tt′ ) − f (R(y(t))) − n−1 · f (OP T )  = F (y(t) ∨ 1OP T ′t ) − F (y(t)) − n−1 · f (OP T ) , where the first inequality follows from the definition of A, and the last follows from the submodularity of f . Recall that x(t) is the vector in P maximizing some objective function (which depends on t). For t < ts , the objective function maximized by x(t) assigns the value w(t)·1OP T \Z = w(t)·1OP Tt′ to the vector 1OP Tt′ ∈ P . Similarly, for t ≥ ts , the objective function maximized by x(t) assigns the value w(t) · 1OP T = w(t) · 1OP Tt′ to the vector 1OP Tt′ ∈ P . Thus, the definition of x(t) guarantees that in both cases we have w(t) · x(t) ≥ w(t) · 1OP Tt′ ≥ F (y(t) ∨ 1OP Tt′ ) − F (y(t)) − n−1 · f (OP T ) . 16 Hence, X (1 − yu (t)) · xu (t)·∂u F (y(t)) = u∈N X xu (t) · [F (y(t) ∨ 1u ) − F (y(t))] u∈N X = xu (t) · E[f (u | R(y(t)))] u∈N X ≥ xu (t) · [wu (t) − n−2 · f (OP T )] = x(t) · w(t) − n−1 · f (OP T ) u∈N ≥ F (y(t) ∨ 1OP Tt′ ) − F (y(t)) − 2n−1 · f (OP T ) , where the first inequality holds by the definition of A and the second equality holds since F (y(t) ∨ 1u ) − F (y(t)) = E[f (R(y(t)) + u)] − E[f (R(y(t)))] = E[f (u | R(y(t)))] . Lemma A.6 (A rephrased version of Lemma 2.3.7 in [23]). Consider two vectors x, x′ ∈ [0, 1]N P such that |xu − x′u | ≤ δ for every u ∈ N . Then, F (x′ ) − F (x) ≥ u∈N (x′u − xu ) · ∂u F (x) − O(n3 δ2 ) · maxu∈N f ({u}). Corollary A.7. Given A, for every time t < 1, F (y(t + δt )) − F (y(t)) ≥ δt [F (y(t) ∨ 1OP Tt′ ) − F (y(t))] − O(n−1 δt ) · f (OP T ). Proof. Observe that for every u ∈ N , |yu (t + δt ) − yu (t)| = |δt (1 − yu (t))xu (t)| ≤ δt . Hence, by Lemma A.6, X F (y(t + δt )) − F (y(t)) ≥ [yu (t + δt )) − yu (t)] · ∂u F (y(t)) − O(n3 δt2 ) · max f ({u}) u∈N u∈N = X δt (1 − yu (t)) · xu (t) · ∂u F (y(t)) − O(n3 δt2 ) · max f ({u}) . u∈N u∈N (13) Consider the rightmost hand side of the last inequality. By Lemma A.5, the first term on this side can be bounded by X δt (1 − yu (t)) · xu (t) · ∂u F (y(t)) ≥ δt · [F (y(t) ∨ 1OP Tt′ ) − F (y(t)) − O(n−1 ) · f (OP T )] u∈N = δt · [F (y(t) ∨ 1OP Tt′ ) − F (y(t))] − O(n−1 δt ) · f (OP T ) . On the other hand, the second term of (13) can be bounded by O(n3 δt2 ) · max f ({u}) = O(n−1 δt ) · f (OP T ) u∈N since δt ≤ n−4 by definition and maxu∈N f ({u}) ≤ f (OP T ) by our assumption that 1u ∈ P for every u ∈ N . The lower bound given by the last corollary is in terms of F (y(t) ∨ 1OP Tt′ ). To make this lower bound useful, we need to lower bound the term F (y(t) ∨ 1OP Tt′ ). This is done by the following two lemma which corresponds to Lemma 4.4. Lemma A.8. [corresponds to Lemma 4.4] For every time t < 1 and set A ⊆ N it holds that   F (y(t) ∨ 1A ) ≥ e− max{0,t−ts } − e−t − O(n−4 ) · max {0, f (A) − f (A ∪ Z)} + (e−t − O(n−4 )) · f (A) . 17 The proof of this lemma goes along the same lines as the proof of its corresponding lemma in Section 4, except that the bounds on the coordinates of y(t) used by the proof from Section 4 are replaced with the (slightly weaker) bounds given by the following lemma. Lemma A.9. For every time t and element u ∈ N , ( 1 − e−t + O(n−4 ) yu (t) ≤ 1 − e− max{0,t−ts } + O(n−4 ) if u 6∈ Z , if u ∈ Z . Proof. Let ε = n−4 , and observe that δt ≤ ε for every time t. Our first objective is to prove by induction on t that, if yu (τ ) = 0 for some time τ ∈ [0, 1], then yu (t) ≤ 1 − (1 − ε)(t−τ )/ε for every time t ∈ [τ, 1]. For t = τ the claim holds because yu (τ ) = 0 = 1 − (1 − ε)(τ −τ )/ε . Next, assume the claim holds for some t, and let us prove it for t + δt . yu (t + δt ) = yu (t) + δt (1 − yu (t)) · xu (t) ≤ yu (t) + δt (1 − yu (t)) = yu (t)(1 − δt ) + δt ≤ (1 − (1 − ε)(t−τ )/ε )(1 − δt ) + δt = 1 − (1 − δt )(1 − ε)(t−τ )/ε ≤ 1 − (1 − ε)δt /ε (1 − ε)(t−τ )/ε = 1 − (1 − ε)(t+δt −τ )/ε , where the last inequality holds since (1 − x)1/x is a decreasing function for x ∈ (0, 1]. We complete the proof for the case u 6∈ Z by choosing τ = 0 (clearly yu (0) = 0) and observing that, for every time t, 1 − (1 − ε)t/ε ≤ 1 − [e−1 (1 − ε)]t = 1 − e−t (1 − ε)t ≤ 1 − e−t (1 − ε) = 1 − e−t + O(ε) . It remains to prove the lemma for the case u ∈ Z. Note that at every time t ∈ [0, ts ) Algorithm 3 chooses as x(t) a vector maximizing a linear function in P which assigns a negative weight to elements of Z. Since P is down-closed this maximum must have xu (t) = 0 for an element u ∈ Z. This means that yu (t) = 0 for t ∈ [0, ts ]. In addition to proving the lemma for this time range, the last inequality also allows us to choose τ = ts , which gives, for t ∈ [ts , 1], yu (t) ≥ 1 − (1 − ε)(t−ts )/ε ≥ 1 − ets −t + O(ε) . Combining Corollary A.7 with Lemma A.8 gives us the following corollary. Corollary A.10. Given A, for every time t ∈ [0, ts ), F (y(t + δt )) − F (y(t)) ≥ δt [f (OP T \ Z) − (1 − e−t ) · f (Z ∪ OP T ) − F (y(t)))] − O(n−1 δt ) · f (OP T ) and, for every time t ∈ [ts , 1), F (y(t + δt )) − F (y(t)) ≥ δt [e−t · f (OP T ) + (ets −t − e−t ) · max{f (OP T ) − f (Z ∪ OP T ), 0} − F (y(t))] − O(n−1 δt ) · f (OP T ) . Proof. For every time t ∈ [0, ts ), Corollary A.7 and Lemma A.8 imply together F (y(t + δt )) − F (y(t)) ≥ δt [(1 − e−t − O(n−4 )) · max {0, f (OP T \ Z) − f (OP T ∪ Z)} + (e−t − O(n−4 )) · f (OP T \ Z)] − O(n−1 δt ) · f (OP T ) ≥ δt [(1 − O(n−4 )) · f (OP T \ Z) − (1 − e−t ) · f (Z ∪ OP T ) − F (y(t)))] − O(n−1 δt ) · f (OP T ) . 18 We observe that this inequality is identical to the inequality promised for this time range by the corollary, except that it has an extra term of −δt · O(n−4 ) · f (OP T \ Z) on its right hand side. Since f (OP T \ Z) is upper bounded by f (OP T ), due to the down-closeness of P , the absolute value of this extra term is at most δt · O(n−4 ) · f (OP T ) = O(n−1 δt ) · f (OP T ) , which completes the proof for the time range t ∈ [0, ts ). Consider now the time range t ∈ [ts , 1). For this time range Corollary A.7 and Lemma A.8 imply together F (y(t + δt )) − F (y(t)) ≥ δt [(ets −t − e−t − O(n−4 )) · max {0, f (OP T ) − f (OP T ∪ Z)} + (e−t − O(n−4 )) · f (OP T )] − O(n−1 δt ) · f (OP T ) . We observe again that this inequality is identical to the inequality promised for this time range by the corollary, except that it has extra terms of −δt · O(n−4 ) · f (OP T ) and −δt · O(n−4 ) · max{0, f (OP T ) − f (OP T ∪ Z)} on its right hand side. The corollary now follows since the absolute value of both these terms is upper bounded by O(n−1 δt ) · f (OP T ). Corollary A.10 bounds the increase in F (y(t)) in terms of F (y(t)) itself. Thus, it gives a recursive formula which can be used to lower bound F (y(t)). Our remaining task is to solve this formula and get a closed-form lower bound on F (y(t)). Let g(t) be defined as follows. g(0) = 0 and for every time t < 1, g(t+δt ) ( g(t) + δt [f (OP T \ Z) − (1 − e−t ) · f (Z ∪ OP T ) − g(t)] = g(t) + δt [e−t · f (OP T ) + (ets −t − e−t ) · max{f (OP T ) − f (Z ∪ OP T ), 0} − g(t)] if t < ts , if t ≥ ts . The next lemma shows that a lower bound on g(t) yields a lower bound on F (y(t)). Lemma A.11. Given A, for every time t, g(t) ≤ F (y(t)) + O(n−1 ) · t · f (OP T ). Proof. Let c be the larger constant among the constants hiding behind the big O notations in Corollary A.10. We prove by induction on t that g(t) ≤ F (y(t)) + (ct/n) · f (OP T ). For t = 0, this clearly holds since g(0) = 0 ≤ F (y(0)). Assume now that the claim holds for some t, and let us prove it for t + δt . There are two cases to consider. If t < ts , then the induction hypothesis and Corollary A.10 imply, for a large enough n, g(t + δt ) = g(t) + δt [f (OP T \ Z) − (1 − e−t ) · f (Z ∪ OP T ) − g(t)] = (1 − δt )g(t) + δt [f (OP T \ Z) − (1 − e−t ) · f (Z ∪ OP T )] ≤ (1 − δt )[F (y(t)) + (ct/n) · f (OP T )] + δt [f (OP T \ Z) − (1 − e−t ) · f (Z ∪ OP T )] = F (y(t)) + δt [f (OP T \ Z) − (1 − e−t ) · f (Z ∪ OP T ) − F (y(t))] + (ct/n) · (1 − δt ) · f (OP T ) ≤ F (y(t + δt )) + (cδt /n) · f (OP T ) + (ct/n) · (1 − δt ) · f (OP T ) ≤ F (y(t + δt )) + [c(t + δt )/n] · f (OP T ) . Similarly, if t ≥ ts , then we get g(t + δt ) = g(t) + δt [e−t · f (OP T ) + (ets −t − e−t ) · max{f (OP T ) − f (Z ∪ OP T ), 0} − g(t)] 19 = (1 − δt )g(t) + δt [e−t · f (OP T ) + (ets −t − e−t ) · max{f (OP T ) − f (Z ∪ OP T ), 0}] ≤ (1 − δt )[F (y(t)) + (ct/n) · f (OP T )] + δt [e−t · f (OP T ) + (ets −t − e−t ) · max{f (OP T ) − f (Z ∪ OP T ), 0}] = F (y(t)) + δt [e−t · f (OP T ) + (ets −t − e−t ) · max{f (OP T ) − f (Z ∪ OP T ), 0} − F (y(t))] + (ct/n) · (1 − δt ) · f (OP T ) ≤ F (y(t + δt )) + (cδt /n) · f (OP T ) + (ct/n) · (1 − δt ) · f (OP T ) ≤ F (y(t + δt )) + [c(t + δt )/n] · f (OP T ) . It remains to find a closed-form expression that lower bounds g(t) (and thus, also F (y(t))). Let h1 (t) : [0, ts ] → R and h2 (t) : [ts , 1] → R be defined as follows. h1 (t) = (1 − e−t ) · f (OP T \ Z) − (1 − e−t − te−t ) · f (Z ∪ OP T ) , and h2 (t) = e−t · {(t − ts ) · [f (OP T ) + (ets − 1) · max{f (OP T ) − f (OP T ∪ Z), 0}] + ets · h1 (ts )} . Lemma A.12. For every time t ≤ ts , h1 (t) ≤ g(t). Proof. The proof is by induction on t. For t = 0, g(0) = 0 = (1 − e0 ) · f (OP T \ Z) − (1 − e0 − 0 · e0 ) · f (Z ∪ OP T ) = h1 (0). Assume now that the lemma holds for some t < ts , and let us prove it holds also for t + δt . By the induction hypothesis, Z t+δt h′ (τ )dτ h1 (t + δt ) = h1 (t) + t Z t+δt {e−τ · f (OP T \ Z) − τ e−τ · f (Z ∪ OP T )}dτ = h1 (t) + t ≤ h1 (t) + δt · {e−t · f (OP T \ Z) − te−t · f (Z ∪ OP T )}dτ = (1 − δt )h1 (t) + δt · {f (OP T \ Z) − (1 − e−t ) · f (Z ∪ OP T )} ≤ (1 − δt )g(t) + δt · {f (OP T \ Z) − (1 − e−t ) · f (Z ∪ OP T )} = g(t + δt ) , where the first inequality holds since e−τ is a decreasing function of τ and τ e−τ is an increasing function of τ in the range τ ∈ [0, 1]. Lemma A.13. For every time ts ≤ t ≤ 1, h2 (t) ≤ g(t). Proof. The proof is by induction on t. For t = ts , by Lemma A.12, h2 (ts ) = h1 (ts ) ≤ g(ts ). Assume now that the lemma holds for some ts ≤ t < 1, and let us prove it holds also for t + δt . To avoid repeating complex expressions, let us denote A = f (OP T ) + (ets − 1) · max{f (OP T ) − f (Z ∪ OP T ), 0}. Notice that A is independent of t. Moreover, using this notation we can rewrite h2 (t) as h2 (t) = e−t · {(t − ts ) · A + ets · h1 (ts )}. Thus, for every τ ∈ (ts , 1), h′2 (τ ) = −e−τ · {(τ − ts ) · A + ets · h1 (ts )} + e−τ · A = e−τ · {(1 − τ + ts ) · A − ets · h1 (ts )} . The definition of A and the non-negativity of f imply immediately that A ≥ 0. We would like to prove also that ts · A − ets · h1 (ts ) ≥ 0. There are two cases to consider. First, if f (OP T ) ≥ f (Z ∪ OP T ), then ts · A − ets · h1 (ts ) = ts · f (OP T ) + ts (ets − 1) · max{f (OP T ) − f (Z ∪ OP T ), 0} 20 − (ets − 1) · f (OP T \ Z) + (ets − 1 − ts ) · f (Z ∪ OP T ) ≥ ts ets · f (OP T ) − ts (ets − 1) · f (Z ∪ OP T ) − (ets − 1) · f (OP T ) + (ets − 1 − ts ) · f (Z ∪ OP T ) = (ts ets − ets + 1) · [f (OP T ) − f (Z ∪ OP T )] ≥ 0 . where the inequality uses the fact that f (OP T ) ≥ f (OP T \ Z) because of the down-closure of P . On the other hand, if f (OP T ) < f (Z ∪ OP T ), then ts · A − ets · h1 (ts ) = ts · f (OP T ) − (ets − 1) · f (OP T \ Z) + (ets − 1 − ts ) · f (Z ∪ OP T ) ≥ ts · f (OP T ) − (ets − 1) · f (OP T ) + (ets − 1 − ts ) · f (OP T ) = 0 . Using the above observations and the induction hypothesis, we can now get h2 (t + δt ) = h2 (t) + Z t+δt h′ (τ )dτ = h2 (t) + Z t+δt e−τ · {(1 − τ + ts ) · A − ets · h1 (ts )}dτ t t ≤ h2 (t) + δt · e−t · {(1 − t + ts ) · A − ets · h1 (ts )} = (1 − δt )h2 (t) + δt · e−t · A ≤ (1 − δt )g(t) + δt · e−t · A = g(t + δt ) . The last two lemmata give us the promised closed-form lower bound on g(t), which can be used to lower bound the approximation ratio of Algorithm 3. Corollary A.14. E[F (y(1))] ≥ ets −1 · [(2 − ts − e−ts − O(n−1 )) · f (OP T ) − (1 − e−ts ) · f (Z ∩ OP T ) − (2 − ts − 2e−ts ) · f (Z ∪ OP T )]. Proof. By Lemma A.11, given A, F (y(1)) ≥ g(1) − O(n−1 ) · f (OP T ) . By Lemma A.13, g(1) ≥ h2 (1) = e−1 · {(1 − ts ) · [f (OP T ) + (ets − 1) · max{f (OP T ) − f (Z ∪ OP T ), 0}] + (ets − 1) · f (OP T \ Z) − (ets − 1 − ts ) · f (Z ∪ OP T )} ≥ e−1 · {(1 − ts ) · [ets · f (OP T ) − (ets − 1) · f (Z ∪ OP T )] + (ets − 1) · [f (OP T ) − f (Z ∩ OP T )] − (ets − 1 − ts ) · f (Z ∪ OP T )} = ets −1 · [(2 − ts − e−ts ) · f (OP T ) − (1 − e−ts ) · f (Z ∩ OP T ) − (2 − ts − 2e−ts ) · f (Z ∪ OP T )] , where the second inequality holds since the submodularity and non-negativity of f imply f (OP T \ Z) ≥ f (OP T ) + f (∅) − f (Z ∩ OP T ) ≥ f (OP T ) − f (Z ∩ OP T ) . Combining the above observations we get that, given A, F (y(1)) ≥ ets −1 · [(2 − ts − e−ts − O(n−1 )) · f (OP T ) − (1 − e−ts ) · f (Z ∩ OP T ) − (2 − ts − 2e−ts ) · f (Z ∪ OP T )] . 21 Since F (y(1)) is always non-negative, this implies, by the law of total expectation, E[F (y(1))] ≥ Pr[A] · {ets −1 · [(2 − ts − e−ts − O(n−1 )) · f (OP T ) − (1 − e−ts ) · f (Z ∩ OP T ) − (2 − ts − 2e−ts ) · f (Z ∪ OP T )]} ≥ {ets −1 · [(2 − ts − e−ts − O(n−1 )) · f (OP T ) − (1 − e−ts ) · f (Z ∩ OP T ) − (2 − ts − 2e−ts ) · f (Z ∪ OP T )]} 1 − · ets −1 · (2 − ts − e−ts − O(n−1 )) · f (OP T ) n = ets −1 · [(2 − ts − e−ts − O(n−1 )) · f (OP T ) − (1 − e−ts ) · f (Z ∩ OP T ) − (2 − ts − 2e−ts ) · f (Z ∪ OP T )] , where the second inequality holds since Pr[A] ≥ 1 − n−1 by Corollary A.4. Theorem 4.1 now follows immediately by combining Corollaries A.2 and A.14. 22
8cs.DS
Self Organizing Maps Whose Topologies Can Be Learned With Adaptive Binary Search Trees Using Conditional Rotations arXiv:1506.02750v1 [cs.NE] 9 Jun 2015 César A. Astudillo ∗ † B. John Oommen‡ § Abstract Numerous variants of Self-Organizing Maps (SOMs) have been proposed in the literature, including those which also possess an underlying structure, and in some cases, this structure itself can be defined by the user Although the concepts of growing the SOM and updating it have been studied, the whole issue of using a self-organizing Adaptive Data Structure (ADS) to further enhance the properties of the underlying SOM, has been unexplored. In an earlier work, we impose an arbitrary, user-defined, tree-like topology onto the codebooks, which consequently enforced a neighborhood phenomenon and the so-called tree-based Bubble of Activity (BoA). In this paper, we consider how the underlying tree itself can be rendered dynamic and adaptively transformed. To do this, we present methods by which a SOM with an underlying Binary Search Tree (BST) structure can be adaptively re-structured using Conditional Rotations (CONROT). These rotations on the nodes of the tree are local, can be done in constant time, and performed so as to decrease the Weighted Path Length (WPL) of the entire tree. In doing this, we introduce the pioneering concept referred to as Neural Promotion, where neurons gain prominence in the Neural Network (NN) as their significance increases. We are not aware of any research which deals with the issue of Neural Promotion. The advantages of such a scheme is that the user need not be aware of any of the topological peculiarities of the stochastic data distribution. Rather, the algorithm, referred to as the TTOSOM with Conditional Rotations (TTOCONROT), converges in such a manner that the neurons are ultimately placed in the input space so as to represent its stochastic distribution, and additionally, the neighborhood properties of the neurons suit the best BST that represents the data. These properties have been confirmed by our experimental results on a variety of data sets. We submit that all of these concepts are both novel and of a pioneering sort. Keywords: Adaptive Data Structures, Binary Search Trees, Self-Organizing Maps ∗ Universidad † This de Talca, Merced 437 Curicó, Chile. castudillo@utalca.cl author is Assistant Professor at the Department of Computer Science, with the Universidad de Talca. This work is partially supported by the FONDECYT grant 11121350, Chile. A very preliminary version of this paper was presented at AI’09, the 2009 Australasian Joint Conference on Artificial Intelligence, Melbourne, Australia, in December 2009. That paper won the award of being the Best Paper of the Conference. We are also very grateful for the comments made by the Associate Editor and the anonymous Referees. Their input helped in improving the quality of the final version of this paper. Thank you very much! ‡ School of Computer Science, Carleton University, Ottawa, Canada : K1S 5B6. oommen@scs.carleton.ca § Chancellor’s Professor ; Fellow : IEEE and Fellow : IAPR. This author is also an Adjunct Professor with the University of Agder in Grimstad, Norway. The work of this author was partially supported by NSERC, the Natural Sciences and Engineering Research Council of Canada. 1 1 Introduction This paper is a pioneering attempt to merge the areas of Self-Organizing Maps (SOMs) with the theory of Adaptive Data Structures (ADSs). Put in a nutshell, we can describe the goal of this paper as follows: Consider a SOM with n neurons. Rather than having the neurons merely possess information about the feature space, we also attempt to link them together by means of an underlying Data Structure (DS). This DS could be a singly-linked list, a doubly-linked list or a Binary Search Tree (BST), etc. The intention is that the neurons are governed by the laws of the SOM and the underlying DS. Observe now that the concepts of “neighborhood” and Bubble of Activity (BoA) are not based on the nearness of the neurons in the feature space, but rather on their proximity in the underlying DS. Having accepted the above-mentioned premise, we intent to take this entire concept to a higher level of abstraction and propose to modify this DS itself adaptively using operations specific to it. As far as we know, the combination of these concepts has been unreported in the literature. Before we proceed, to place our results in the right perspective, it is probably wise to see how the concept of neighborhood has been defined in the SOM literature. Kohonen, in his book [36], mentions that it is possible to distinguish between two basic types of neighborhood functions. The first family involves a kernel function (which is usually of a Gaussian nature). The second, is the so-called neighborhood set, also known as the Bubble of Activity (BoA). This paper focuses on the second type of neighborhood function. Even though the traditional SOM is dependent on the neural distance to estimate the subset of neurons to be incorporated into the BoA, this is not always the case for the SOM-variants included in the literature. Indeed, the different strategies described in the state-of-the-art utilize families of schemes to define the BoA. We mainly identify three sub-classes. The first type of BoA uses the concept of the neural distance as in the case of the traditional SOM. Once the Best Matching Unit (BMU) is identified, the neural distance is calculated by traversing the underlying structure that holds the neurons. An important property of the neural distance between two neurons is that it is proportional to the number of connections separating them. Examples of strategies that use the neural distance to determine the BoA are the Growing Cell Structures (GCS) [24], the Growing Grid (GG) [25], the Incremental Grid Growing (IGG) [13], the Growing SOM (GSOM) [3], the Tree-Structured SOM (TSSOM) [37], the Hierarchical Feature Map (HFM) [43], the Growing Hierarchical SOM (GHSOM) [50], the SelfOrganizing Tree Algorithm (SOTA) [22], the Evolving Tree (ET) [46], the Tree-based Topology Oriented SOM (TTOSOM) [8], among others. A second subset of strategies employ a scheme for determining the BoA that does not depend on the inter-neural connections. Instead, such strategies utilize the distance in the feature space. In these cases, it is possible to distinguish between two types of Neural Networks (NNs). The simplest situation occurs when the BoA only considers the BMU, i.e., it constitutes an instance of hard Competitive Learning (CL), as in the case of the Tree-Structured VQ (TSVQ) [37] and the Self-Organizing Tree Map (SOTM) [27]. A more sophisticated and computationally expensive scheme involves ranking the neurons as per their respective distances to the stimulus. In this scenario, the BoA is determined by selecting a subset of the 2 closest neurons. An example of a SOM variant that uses such a ranking is the Neural Gas (NG) [40]. According to the authors of [46], the SOM-based variants included in the literature attempt to tackle two main goals: They either try to design a more flexible topology, which is usually useful to analyze large datasets, or to reduce the the most time-consuming task required by the SOM, namely, the search for the BMU when the input set has a complex nature. In this paper we focus on the former of the two mentioned goals. In other words, our goal is to enhance the capabilities of the original SOM algorithm so as to represent the underlying data distribution and its structure in a more accurate manner. We also intend to do so by constraining the neurons so that they are related to each other, not just based on their neural indices and stochastic distribution, but also based on a BST relationship. Furthermore, as a long term ambition, we also anticipate methods which can accelerate the task of locating the nearest neuron during the CL phase. This work will present the details of the design and implementation of how an adaptive process applied to the BST, can be integrated into the SOM. Regardless of the fact that numerous variants of the SOM has been devised, few of them possess the ability of modifying the underlying topology [13, 21, 22, 26, 27, 42, 46, 52]. Moreover, only a small subset use a tree as their underlying DS [8, 21, 22, 27, 46, 52]. These strategies attempt to dynamically modify the nodes of the SOM, for example, by adding nodes, which can be a single neuron or a layer of a SOM-grid. However, our hypothesis is that it is also possible to attain to a better understanding of the unknown data distribution by performing structural tree-based modifications on the tree, which although they preserve the general topology, attempt to modify the overall configuration, i.e., by altering the way by which nodes are interconnected, and yet continue as a BST. We accomplish this by dynamically adapting the edges that connect the neurons, by rotating1 the nodes within the BST that holds the whole structure of neurons. As we will explain later, this is further achieved by local modifications to the overall structure in a constant number of steps. Thus, we attempt to use rotations, tree-based neighbors and the feature space to improve the quality of the SOM. 1.1 Motivations Acquiring information about a set of stimuli in an unsupervised manner, usually demands the deduction of its structure. In general, the topology employed by any Artificial Neural Network (ANN) possessing this ability has an important impact on the manner by which it will “absorb” and display the properties of the input set. Consider for example, the following: A user may want to devise an algorithm that is capable of learning a triangle-shaped distribution as the one depicted in Figure 1. The SOM tries to achieve this by defining an underlying grid-based topology and to fit the grid within the overall shape, as shown in Figure 1a (duplicated from [36]). However, from our perspective, a grid-like topology does not naturally fit a triangular-shaped distribution, and thus, one experiences a deformation of the original lattice during the modeling phase. As opposed to this, Figure 1b, shows the result of applying one of the techniques developed by us, namely the TTOSOM [8]. As the reader can observe from Figure 1b, a 3-ary tree seems to be a far more superior choice for representing the particular shape in question. 1 The operation of rotation is the one associated with BSTs, as will be presently explained. 3 (a) The grid learned by the SOM. (b) The tree learned by the TTOSOM. Figure 1: How a triangle-shaped distribution is learned through unsupervised learning. On closer inspection, Figure 1b depicts how the complete tree fills in the triangle formed by the set of stimuli, and further, seems to do it uniformly. The final position of the nodes of the tree suggests that the underlying structure of the data distribution corresponds to the triangle. Additionally, the root of the tree is placed roughly in the center of mass of the triangle. It is also interesting to note that each of the three main branches of the tree, cover the areas directed towards a vertex of the triangle respectively, and their sub-branches fill in the surrounding space around them in a recursive manner, which we identify as being a holograph-like behavior. Of course, the triangle of Figure 1b serves only as a very simple prima facie example to demonstrate to the reader, in an informal manner, how both techniques will try to learn the set of stimuli. Indeed, in real-world problems, these techniques can be employed to extract the properties of high-dimensional samples. One can argue that imposing an initial topological configuration is not in accordance with the founding principles of unsupervised learning, the phenomenon that is supposed to occur without “supervision” within the human brain. As an initial response we argue that this “supervision” is required to enhance the training phase, while the information we provide relates to the initialization phase. Indeed, this is in line with the well-accepted principle [23], that very little can be automatically learned about a data distribution if no assumptions are made! As the next step of motivating this research endeavor, we venture into a world where the neural topology and structure are themselves learned during the training process. This is achieved by the method that we propose in this paper, namely the TTOSOM with Conditional Rotations (TTOCONROT), which, in essence, dynamically extends the properties of the above-mentioned TTOSOM. Again, to accomplish this we need key concepts that are completely new to the field of SOMs, namely those related to tree-based Adaptive Data Structure (ADS). Indeed, as demonstrated by our experiments, the results that we have already obtained have been applauded by the research community2 , and these, to the best of our knowledge, have remained unreported in the literature. Another reason why we are interested in such an inter-area integration, deals with the issue for devising efficient methods that add neurons to the tree. Even though the schemes that we are currently proposing 2 As mentioned earlier, a paper which reported the preliminary results of this study, won the Best Paper Award in a well-known international AI conference [7]. 4 in this paper focus on tree adaptation by means of rotations, we envision another type of dynamism,i.e., one which involves the expansion of the tree structure through the insertion of newly created nodes. The state-of-the-art considers different strategies that expand trees by inserting nodes (which can be a single neuron or a SOM-layer) that essentially are based on a Quantization Error (QE) measure. In some of these strategies, the error measure is based on the “hits”, i.e., the number of times a neuron has been selected as the BMU, c.f., [13, 24, 37, 46]. The strategy that we have chosen for adapting the tree, namely using Conditional Rotations (CONROT), already utilizes this BMU counter, and, distinct to the previous strategies that attempt to search for a node to be expanded (which in the case of tree-based SOMs is usually at the level of the leaves [37, 46]), we foresee and advocate a different approach. Our TTOCONROT method asymptotically positions frequently accessed nodes close to the root, and so, according to this property, it is the root node which should be split. Observe that if we follow such a philosophy, one would not have to search for a node with a higher QE measure. Rather, the CONROT, will be hopefully, able to migrate the candidates closer to the root. Of course, this works with assumption that a larger number of hits indicates that the degree of granularity of a particular neuron justifies refinement. The concept of using the root of the tree for growing a tree-based SOM is, in and of itself, pioneering, as far as we know. 1.2 Contributions of the Paper The contributions of the paper can be summarized as follows: 1. We present an integration of the fields of SOMs and ADS. This, we respectfully, submit as pioneering. 2. The neurons of the SOM are linked together using an underlying tree-based DS, and they are governed by the laws of the TTOSOM tree-based paradigm, and simultaneously the restructuring adaptation provided by CONROT. 3. The definition of distance between the neurons is based on the tree structure, and not in the feature space. This is valid also for the BoA, rendering the migrations distinct from the state-of-the-art. 4. The adaptive nature of the TTOCONROT is unique because adaptation is perceived in two forms: The migration of the codebook vectors in the feature space is a consequence of the SOM update rule, and the rearrangement of the neurons within the tree as a result of the rotations. 1.3 Organization of the Paper The rest of the paper is organized as follows. The next section surveys the relevant literature3 , which involves both the field of SOMs including their tree-based instantiations, and the respective field of BSTs with conditional rotations. After that, in Section 2, we provide an in-depth explanation of the TTOCONROT philosophy, which is our primary contribution. The subsequent section shows the capabilities of the approach through a series of experiments, and finally, Section 5 concludes the paper. 3 For the sake of space the literature review has been considerably condensed. However, given that there is no survey paper on the area of tree-based SOMs reported in the literature, we are currently preparing a paper that summarizes the field. 5 2 Literature Review 2.1 The SOM One of the most important families of ANNs used to tackle clustering problems is the well known SOM [36]. Typically, the SOM is trained using (un)supervised learning, so as to produce a neural representation in a space whose dimension is usually smaller than that in which the training samples lie. Further, the neurons attempt to preserve the topological properties of the input space. The SOM concentrates all the information contained in a set of n input samples belonging to the ddimensional space, say X = {x1 , x2 , . . . , xn }, utilizing a much smaller set of neurons, C = {c1 , c2 , . . . , cm }, each of which is represented as a vector. Each of the m neurons contains a weight vector w = [w1 , w2 , . . . , wd ]t ∈ IRd associated with it. These vectors are synonymously called “weights”, “prototypes” or “codebook” vectors. The vector wi may be perceived as the position of neuron ci in the feature space. During the training phase, the values of these weights are adjusted simultaneously so as to represent the data distribution and its structure. In each training step a stimulus (a representative input sample from the data distribution) x is presented to the network, and the neurons compete between themselves so as to identify which is the “winner”, also known as the Best Matching Unit (BMU). After identifying the BMU, a subset of the neurons “close” to it are considered to be within the so-called Bubble of Activity (BoA), which further depends on a parameter specified to the algorithm, namely, the so-called radius. Thereafter, this scheme performs a migration of the codebooks within that BoA so as to position them closer to the sample being examined. The migration factor by which this update is effected, depends on a parameter known as the learning rate, which is typically expected to be large initially, and which decreases as the algorithm proceeds, and which ultimately results in no migration at all. Algorithm 1 describes the details of the SOM philosophy. In Algorithm 1, the parameters are scheduled by defining a sequence S = hS1 , S2 , . . . , Ss i, where each Si corresponds to a tuple (ηi , ri , ti ) that specifies the learning rate, ηi , and the radius, ri , for a fixed number of training steps, ti . The way in which the parameters decay is not specified in the original algorithm, and some alternatives are, e.g., that the parameters remain fixed, decrease linearly, exponentially, etc. Algorithm 1 SOM(X ,S) Input: i) X , the input sample set. ii) S, the schedule for the parameters. Method: 1: Initialize the weights w1 , w2 , . . . , wm , e.g., by randomly selecting elements from X . 2: repeat 3: Obtain a sample x from X . 4: Find the Winner neuron, i.e., the one which is most similar to x. 5: Determine a subset of neurons close to the winner. 6: Migrate the closest neuron and its neighbors towards x. 7: Modify the learning factor and radius as per the pre-defined schedule. 8: until no noticeable changes are observed. End Algorithm Although the SOM has demonstrated an ability to solve problems over a wide spectrum, it possesses some 6 fundamental drawbacks. One of these drawbacks is that the user must specify the lattice a priori, which has the effect that he must run the ANN a number of times to obtain a suitable configuration. Other handicaps involve the size of the maps, where a lesser number of neurons often represent the data inaccurately. The state-of-the-art approaches attempt to render the topology more flexible, so as to represent complicated data distributions in a better way and/or to make the process faster by, for instance, speeding up the task of determining the BMU. There are a vast number of domain fields where the SOM has demonstrated to be useful; a compendium with all the articles that take advantage of the properties of the SOM is surveyed in [32, 45]. These survey papers classify the publications related to the SOM according to their year of release. The report [32] includes the bibliography published between the year 1981 and 1998, while the report [45] includes the analogous papers published between 1998 and 2001. Further, additional recent references including the related work up to the year 2005 have been collected in a technical report [48]. The more recent literature reports a host of application domains, including Medical Image Processing [2], Human Eye Detection [33], Handwriting Recognition [39], Image Segmentation [56], Information Retrieval [20], Object Tracking [30], etc. 2.2 Tree-Based SOMs Although an important number of variants of the original SOM have been presented through the years, we focus our attention on a specific family of enhancements in which the neurons are inter-connected using a tree topology. The Tree-Structured VQ (TSVQ) algorithm [37] is a tree-based SOM variant, whose topology is defined a priori and which is static. The training first takes place at highest levels of the tree. The TSVQ incorporates the concept of a “frozen” node, which implies that after a node is trained for a certain amount of time, it becomes static. The algorithm then allows subsequent units, i.e., the direct children, to be trained. The strategy utilizes a heuristic search algorithm for rapidly identifying a BMU. It starts from the root and recursively traverses the path towards the leaves. If the unit currently being analyzed is frozen, the algorithm identifies the child which is closest to the stimulus, and performs a recursive call. The algorithm terminates when the node currently being analyzed is not a frozen node (i.e., it is currently being trained), and is returned as the BMU. Koikkalainen and Oja, in the same paper [37] refine the idea of the TSVQ by defining the TSSOM, which inherits all the properties of the TSVQ, but redefines the search procedure and BoA. In the case of the TSSOM, SOM layers of different dimensions are arranged in a pyramidal shape (which can be perceived as a SOM with different degrees of granularity). It differs from the TSVQ, in the sense that, once the BMU is found, the direct proximity is examined to check for the BMU. On the other hand, the BoA differs in that, instead of considering only the BMU, its direct neighbors (in the pyramid) will also be considered. The Self-Organizing Tree Algorithm (SOTA) [22] is a dynamically growing tree-based SOM which, according to their authors, take some analogies from the Growing Cell Structures (GCS) [24]. The SOTA utilizes a binary tree as the underlying structure, and similarly to other strategies (e.g., the TSSOM [37] and the Evolving Tree (ET) [46] explained below), it considers the migration of the neurons only if they 7 correspond to leaf nodes within the tree structure. Its BoA depends on the neural tree and is defined for two cases. The most general case occurs when the parent of the BMU is not the root, i.e., a situation in which the BoA is composed by the BMU, its sibling and its parent node. Otherwise, the BoA constitutes the BMU only. The SOTA triggers a growing mechanism that utilizes a QE to determine the node to be split into two new descendants. In [21] the authors presented a tree-based SOM called the Growing Hierarchical SOM (GHSOM), in which each node corresponds to an independent SOM. The expansion of the structure is dual: The first type of adaptation is conceived by inserting new rows (or columns) to the SOM grid that is currently being trained, while the second type is implemented by adding layers to the hierarchical structure. Both types of dynamism depend on the verification of QE measures. The SOTM [27] is a tree-based SOM which is also inspired by the Adaptive Resonance Theory (ART) [15]. In the SOTM, when the input is within a threshold distance from the BMU, the latter is migrated. Otherwise, a new neuron is added to the tree. Thus, in the SOTM, the subset of neurons to be migrated depends only on the distance in the feature space, and not in the neural distance, as most of the tree-based SOM families. In [46], the authors have proposed a tree-structured NN called the Evolving Tree (ET), which takes advantage of a sub-optimal procedure (adapted from the one utilized by the TSVQ) to identify the BMU in O(log |V |) time, where V is the set of neurons. The ET adds neurons dynamically, and incorporates the concept of a “frozen” neuron (explained above), which is a non-leaf node that does not participate in the training process, and which is thus removed from the BoA. Similar to the TSVQ, the training phase terminates when all the nodes become frozen. The Tree-based Topology Oriented SOM (TTOSOM) [8], which is central to this paper, is a tree-based SOM in which each node can possess an arbitrary number of children. Furthermore, it is assumed that the user has the ability to describe/create such a tree whose topological configuration is preserved through the training process. The TTOSOM uses a particular BoA that includes nodes (leaf and non-leaf ones) that are within a certain neural distance (the so-called “radius”). An interesting property displayed by this strategy is its ability to reproduce the results obtained by Kohonen, when the nodes of the SOM are arranged linearly, i.e., in a list. In this case, the TTOSOM is able to adapt this 1-dimensional grid to a 2-dimensional (or multi-dimensional) object in the same way as the SOM algorithm does [8]. This was a phenomenon that was not possessed by prior hierarchical SOM-based networks reported in the literature4 . Additionally, if the original topology of the tree followed the overall shape of the data distribution, the results reported in [8] (and also depicted in the motivational section) showed that is also possible to obtain a symmetric topology for the codebook vectors. In a more recent work [9], the authors have enhanced the TTOSOM to perform classification in a semi-supervised fashion. The method presented in [9] first learns the data distribution in an unsupervised manner. Once labeled instances become available, the clusters are labeled using the evidence. According to the results presented in [9], the number of neurons required to accurately predict the category 4 The SOM possesses the ability to learn the data distribution by utilizing a unidimensional topology [36], i.e., the neighbors are defined along a grid in each direction. Further, when this is the case, one can encounter that the unidimensional topology forms a so-called Peano curve [47]. The TTOSOM also possesses this interesting property, when the tree topology is linear. The details of how this is achieved is presented in detail in [8], including the explanation of how other tree-based techniques fail to achieve this task. 8 of novel data are only a small portion of the cardinality of the input set. 3 Merging ADS and TTOSOM 3.1 Adaptive Data Structures (ADSs) for BSTs One of the primary goals of the area of ADS is to achieve an optimal arrangement of the elements, placed at the nodes of the structure, as the number of iterations increases. This reorganization can be perceived to be both automatic and adaptive, such that on convergence, the DS tends towards an optimal configuration with a minimum average access time. In most cases, the most probable element will be positioned at the root (head) of the tree (DS), while the rest of the tree is recursively positioned in the same manner. The solution to obtain the optimal BST is well known when the access probabilities of the nodes are known a priori [35]. However, our research concentrates on the case when these access probabilities are not known a priori. In this setting, one effective solution is due to Cheetham et al. and uses the concept of CONROT [16], which reorganizes the BST so as to asymptotically produce the optimal form. Additionally, unlike most of the algorithms that are otherwise reported in the literature, this move is not done on every data access operation – it is performed if and only if the overall Weighted Path Length (WPL) of the resulting BST decreases. A BST may be used to store records whose keys are members of an ordered set A = {A1 , A2 , . . . , AN }. The records are stored in such a way that a symmetric-order traversal of the tree will yield the records in an ascending order. If we are given A and the set of access probabilities Q = {Q1 , Q2 , . . . , QN }, the problem of constructing efficient BSTs has been extensively studied. The optimal algorithm due to Knuth [35], uses dynamic programming and produces the optimal BST using O(N 2 ) time and space. In this paper, we consider the scenario in which Q, the access probability vector, is not known a priori. We seek a scheme which dynamically rearranges itself and asymptotically generates a tree which minimizes the access cost of the keys. The primitive tree restructuring operation used in most BST schemes is the well known operation of Rotation [1]. We describe this operation as follows. Suppose that there exists a node i in a BST, and that it has a parent node j, a left child, iL , and a right child, iR . The function P (i) = j relates node i with its parent j (if it exists). Also, let B(i) = k relate node i with its sibling k, i.e., the node (if it exists) that shares the same parent as i. Consider the case when i is itself a left child (see Figure 2a). A rotation is performed on node i as follows: j now becomes the right child, iR becomes the left child of node j, and all the other nodes remain in their same relative positions (see Figure 2b). The case when node i is a right child is treated in a symmetric manner. This operation has the effect of raising (or promoting) a specified node in the tree structure while preserving the lexicographic order of the elements (refer again to Figure2b). A few memory-less tree reorganizing schemes5 which use this operation have been presented in the literature among which are the Move-to-Root and the simple Exchange rules [4]. In the Move-to-Root Heuristic, each time a record is accessed, rotations are performed on it in an upwards direction until it becomes the 5 This review is necessary brief. A more detailed version is found in [18, 38]. 9 (a) The tree before a rotation is performed. The contents of the nodes are their data values, which in this case are the characters {a, b, c, d, e}. (b) The tree after a rotation is performed on node i. Figure 2: The BST before and after a Rotation is performed. root of the tree. On the other hand, the simple Exchange rule rotates the accessed element one level towards the root. Sleator and Tarjan [54] introduced a technique, which also moves the accessed record up to the root of the tree using a restructuring operation called “Splaying”, which actually is a multi-level generalization of the rotation. Their structure, called the Splay Tree, was shown to have an amortized time complexity of O(log N ) for a complete set of tree operations which included insertion, deletion, access, split, and join. The literature also records various schemes which adaptively restructure the tree with the aid of additional memory locations. Prominent among them is the Monotonic Tree (MT) [12] and Mehlhorn’s D-Tree (DT) [41]. The MT is a dynamic version of a tree structuring method originally suggested by Knuth [35]. In spite of all their advantages, all of the schemes mentioned above have drawbacks, some of which are more serious than others. The memory-less schemes have one major disadvantage, which is that both the Move-to-Root and Splaying rules always move the accessed record up to the root of the tree. This means that if a nearly-optimal arrangement is reached, a single access of a seldomly-used record will disarrange the tree along the entire access path, as the element is moved upwards to the root. As opposed to these schemes, the MT rule does not move the accessed element to the root every time. But, as reported in [16], in practice, it does not perform well. The weakness of the MT lies in the fact that it considers only the frequency counts for the records, which leads to the undesirable property that a single rotation may move a subtree with a relatively large probability weight downwards, thus increasing the cost of the tree. This paper uses a particular heuristic, namely, the Conditional Rotations for a BST (CONROT-BST) [16], which has been shown to reorganize a BST so as to asymptotically arrive at an optimal form. In its optimized version, the scheme, referred to Algorithm CONROT-BST, requires the maintenance of a single memory location per record, which keeps track of the number of accesses to the subtree rooted at that record. The CONROT-BST algorithm specifies how an accessed element can be rotated towards the root of the tree so as to minimize the overall cost of the entire tree. Finally, unlike most of the algorithms that are currently 10 in the literature, this move is not done on every data access operation. It is performed if and only if the overall WPL of the resulting BST decreases. In essence Algorithm CONROT-BST attempts to minimize the WPL by incorporating the statistical information about the accesses to the various nodes and subtrees rooted at the corresponding nodes. The basic condition for the rotation of a node is that the WPL of the entire tree must decrease as a result of a single rotation. This is achieved by a so-called Conditional Rotation. To define the concept of a Conditional Rotation, we define τi (n) as the total number of accesses to the subtree rooted at node i. One of the biggest advantages of the CONROT-BST heuristic is that it only requires the maintenance and processing of the values stored at a specific node and its direct neighbors, i.e., its parent and both children, if they exist. Algorithm CONROT-BST, formally given in Algorithm 2, describes the process of the conditional rotations for a BST. The algorithm receives two parameters, the first of which corresponds to a pointer to the root of the tree, and the second which corresponds to the key to be searched, which is assumed to be present in the tree. When a node access is requested, the algorithm seeks for the node from the root down towards the leaves. Algorithm 2 CONROT-BST(j,ki) Input: i) j, A pointer to the root of a binary search tree T ii) ki , A search key, assumed to be in T Output: i) The restructured tree T ′ ii) A pointer to the record i containing ki Method: 1: τj ← τj + 1 2: if ki = kj then 3: if is-left-child(j) = TRUE then 4: Ψj ← 2τj − τjR − τP (j) 5: else 6: Ψj ← 2τj − τjL − τP (j) 7: end if 8: if Ψj > 0 then 9: rotate-upwards(j) 10: recalculate-tau(j) 11: recalculate-tau(P (j)) 12: end if 13: return record j 14: else 15: if ki < kj then 16: CONROT-BST( left-child(j) , ki ) 17: else 18: CONROT-BST( right-child(j) , ki ) 19: end if 20: end if End Algorithm The first task accomplished by the Algorithm CONROT-BST is the updating of the counter τ for the present node along the path traversed. After that, the next step consists of determining whether or not the 11 node with the requested key has been found. When this occurs, the quantities defined by Equations (1) and (2) are computed to determine the value of a quantity referred to as Ψ, where: Ψj = 2τj − τjR − τP (j) (1) when j is the left child of its parent, P (j), and Ψj = 2τj − τjL − τP (j) (2) when j is a right descendant of P (j). When Ψ is less than zero, an upward rotation is performed. The authors of [16] have shown that this single rotation leads to a decrease in the overall WPL of the entire tree. This occur in line 9 of the algorithm, in which the method rotate-upwards is invoked. The parameter to this method is a pointer to the node j. The method does the necessary operations required to rotate the node upwards, which means that if the node j is the left child of the parent, then this is equivalent to performing a right rotation over P (j), the parent of j. Analogously, when j is the right child of its parent, the parent of j is left-rotated instead. Once the rotation takes place, it is necessary to update the corresponding counters, τ . Fortunately this task only involve the updating of τi , for the rotated node, and the counter of its parent, τP (i) . The last part of the algorithm, namely lines 14–19, deals with the further search for the key, which in this case is achieved recursively. The reader will observe that all the tasks invoked in the algorithm are performed in constant time, and in the worst case, the recursive call is done from the root down to the leaves, leading to a O(h) running complexity, where h is the height of the tree. 3.2 The TTOSOM with Conditional Rotations (TTOCONROT) This section concentrates on the details of the integration between the fields of ADS and the SOM, and in particular, the TTOSOM. Although merging ADS and the SOM is relevant to a wide spectrum of DSs, we focus our scope by considering only tree-based structures. More specifically we shall concentrate on the integration of the CONROT-BST heuristic [16] into a TTOSOM [8], both of which were explained in the preceding sections. We can conceptually distinguish our method, namely, the Tree-based Topology Oriented SOM with Conditional Rotations (TTOCONROT) from its components and properties. In terms of components, we detect five elements. First of all, the TTOCONROT has a set of neurons, which, like all SOM-based methods, represents the data space in a condensed manner. Secondly, the TTOCONROT possesses a connection between the neurons, where the neighbor of any specific neuron is based on a nearness measure that is tree-based. The third and fourth components involve the migration of the neurons. Similar to the reported families of SOMs, a subset of neurons closest to the winning neuron are moved towards the sample point using a Vector Quantization (VQ) rule. However, unlike the reported families of SOMs, the identity of the neurons that are moved is based on the tree-based proximity and not on 12 the feature-space proximity. Finally, the TTOCONROT possesses tree-based mutating operations, namely the above-mentioned conditional rotations. With respect to the properties of the TTOCONROT, we mention the following. First of all, it is adaptive, with regard to the migration of the points. Secondly, it is also adaptive with regard to the identity of the neurons moved. Thirdly, the distribution of the neurons in the feature space mimics the distribution of the sample points. Finally, by virtue of the conditional rotations, the entire tree is optimized with regard to the overall accesses, which is a unique phenomenon (when compared to the reported family of SOMs) as far as we know. As mentioned in the introductory section, the general dynamic adaptation of SOM lattices reported in the literature considers essentially adding (and in some cases deleting) nodes/edges. However the concept of modifying the underlying structure’s shape itself has been unrecorded. Our hypothesis is that this is advantageous by means of a repositioning of the nodes and the consequent edges, as seen when one performs rotations on a BST. In other words, we place our emphasis on the self-arrangement which occurs as a result of restructuring the DS representing the SOM. In this case, as alluded to earlier, the restructuring process is done between the connections of the neurons so as to attain an asymptotically optimal configuration, where nodes that are accessed more frequently will tend to be placed close to the root. We thus obtain a new species of tree-based SOMs which is self-arranged by performing rotations conditionally, locally and in a constant number of steps. The primary goal of the field of ADS is to have the structure and its elements attain an optimal configuration as the number of iterations increases. Particularly, among the ADSs that use trees as the underlying topology, the common goal is to minimize the overall access cost, and this roughly means that one places the most frequently accessed nodes close to the root, which is also what CONROT-BST moves towards. Although such an adaptation can be made on any SOM paradigm, the CONROT is relevant to a tree structure, and thus to the TTOSOM. This further implies that some specific settings/modifications must be applied to achieve the integration between the two paradigms. We start by defining a Binary Search Tree SOM (BSTSOM) as a special instantiation of a SOM which uses a BST as the underlying topology. An Adaptive BSTSOM (ABSTSOM) is a further refinement of the BSTSOM which, during the training process, employs a technique that automatically modifies the configuration of the tree. The goal of this adaptation is to facilitate and enhance the search process. This assertion must be viewed from the perspective that for a SOM, neurons that represent areas with a higher density, will be queried more often. Every ABSTSOM is characterized by the following properties. First, it is adaptive, where, by virtue of the BST representation this adaptation is done by means of rotations, rather than by merely deleting or adding nodes. Second, the neural network corresponds to a BST. The goal is that the NN maintains the essential stochastic and topological properties of the SOM. 3.2.1 Neural Distance As in the case of the TTOSOM [8], the Neural Distance, dN , between two neurons depends on the number of unweighted connections that separate them in the user-defined tree. It is consequently the number of edges 13 in the shortest path that connects the two given nodes. More explicitly, the distance between two nodes in the tree, is defined as the minimum number of edges required to go from one to the other. In the case of trees, the fact that there is only a single path connecting two nodes implies the uniqueness of the shortest path, and permits the efficient calculation of the distance between them by a node traversal algorithm. Note however, that in the case of the TTOSOM, since the tree itself was static, the inter-node distances can be pre-computed a priori, simplifying the computational process. The situation changes when the tree is dynamically modified as we shall explain below. The implications of having the tree which describes the SOM to be dynamic, are three-fold. First of all, the siblings of any given node may change at every time instant. Secondly, the parents and ancestors of the node under consideration could also change at every instant. But most importantly, the structure of the tree itself could change, implying that nodes that were neighbors at any time instant may not continue to be neighbors at the next. Indeed, in the extreme case, if a node was migrated to become the root, the fact that it had a parent at a previous time instant is irrelevant at the next. This, of course, changes the entire landscape, rendering the resultant SOM to be unique and distinct from the state-of-the-art. An example will clarify this. Consider Figure 3, which illustrates the computation of the neural distance for various scenarios. First, in Figure 3a, we present the scenario when the node accessed is B. Observe that the distances are depicted with dotted arrows, with an adjacent numeric index specifying the current distance from node B. In the example, prior to an access, nodes H, C and E are all at a distance of 2 from node B, even though they are at different levels in the tree. The reader should be aware that non-leaf nodes may also be involved in the calculation, as in the case of node H. Figures 3b and 3c show the process when node B is queried, which in turn triggers a rotation of node B upwards. Observe that the rotation itself only requires local modifications, leaving the rest of the tree untouched. For the sake of simplicity and explicitness, unmodified areas of the tree are represented by dashed lines. Finally, Figure 3d depicts the configuration of the tree after the rotation is performed. At this time instant, C and E are both at distance of 3 from B, which means that they have increased their distance to B by unity. Moreover, although node H has changed its position, its distance to B remains unmodified. Clearly, the original distances are not necessarily preserved as a consequence of the rotation. Generally speaking, there are four regions of the tree that remain unchanged. These are, namely, the portion of the tree above the parent of the node being rotated, the portion of tree rooted at the right child of the node being rotated, the portion of tree rooted at the left child of the node being rotated, and the portion of tree rooted at the sibling of the node being rotated. Even though these four regions remain unmodified, the neural distance in these regions are affected, because the rotation could lead to a modification of the distances to the nodes. Another consequence of this operation that is worth mentioning is the following: The distance between any two given nodes that belong to the same unmodified region of the tree is preserved after a rotation is performed. The proof of this assertion is obvious, inasmuch as the fact remains that every path between nodes in any unmodified sub-tree remains with the same sub-tree. This property is interesting because it has the potential to accelerate the computation of the respective neural distances. 14 (a) (b) (c) (d) Figure 3: Example of the neural distance before and after a rotation. In Figure 3a nodes H, C and E are equidistant from B even though they are at different levels in the tree. Figures 3b and 3c show the process of rotating node A upwards. Finally, Figure 3d depicts the state of the tree after the rotation when only C and E are equidistant from B, and their distance to B has increased by unity. On the other hand, although H has changed its position, its distance to B remains the same. 3.2.2 The Bubble of Activity A concept closely related to the neural distance, is the one referred to as the Bubble of Activity (BoA) which is the subset of nodes within a distance of r away from the node currently examined. Those nodes are in essence those which are to be migrated toward the signal presented to the network. This concept is valid for all SOM-like NNs, and in particular for the TTOSOM. We shall now consider how this bubble is modified in the context of rotations. The concept of the bubble involves the consideration of a quantity, the so-called radius, which establishes how big the BoA is, and which therefore has a direct impact on the number of nodes to be considered. The BoA can be formally defined as [8] B(vi ; T, r) = {v|dN (vi , v; T ) ≤ r}, (3) where vi is the node currently being examined, and v is an arbitrary node in the tree T , whose nodes are V . Note that B(vi , T, 0) = {vi }, B(vi , T, i) ⊇ B(vi , T, i − 1) and B(vi , T, |V |) = V which generalizes the special case when the tree is a (simple) directed path. To clarify how the bubble changes in the context of rotations, we first describe the context when the tree is static. As presented in [8], the function TTOSOM Calculate Neighborhood (see Algorithm 3) specifies the steps involved in the calculation of the subset of neurons that are part of the neighborhood of the BMU. This computation involves a collection of parameters, including B, the current subset of neurons in the proximity of the neuron being examined, v, the BMU itself, and r ∈ IN the current radius of the neighborhood. When the function is invoked for the first time, the set B contains only the BMU marked as the current node, and 15 Algorithm 3 TTOSOM Calculate Neighborhood(B,v,r) Input: i) B, the set of the nodes in the bubble of activity identified so far. ii) v, the node from where the bubble of activity is calculated. iii) r, the current radius of the bubble of activity. Output: i) The set of nodes in the bubble of activity. Method: 1: if r ≤ 0 then 2: return 3: else 4: for all child ∈ v.getChildren() do 5: if child ∈ / B then 6: B ← B + {child } 7: TTOSOM Calculate Neighborhood(B,child , r − 1) 8: end if 9: end for 10: parent =v.getParent(); 11: if parent 6= NULL and parent ∈ / B then 12: B ← B + {parent } 13: TTOSOM Calculate Neighborhood(B,parent , r − 1) 14: end if 15: end if End Algorithm through a recursive call, B will end up storing the entire set of units within a radius r of the BMU. The tree is recursively traversed for all the direct topological neighbors of the current node, i.e., in the direction of the direct parent and children. Every time a new neuron is identified as part of the neighborhood, it is added to B and a recursive call is made with the radius decremented by one unit6 , marking the recently added neuron as the current node. The question of whether or not a neuron should be part of the current bubble, depends on the number of connections that separate the nodes rather than the distance that separate the networks in the solution space (for instance, the Euclidean distance). Figure 4 depicts how the BoA differs from the one defined by the TTOSOM as a result of applying a rotation. Figure 4a shows the BoA around the node B, using the same configuration of the tree as in Figure 3a, i.e., before the rotation takes place. Here, the BoA when r = 1 involves the nodes {B, A, D, F }, and when r = 2 the nodes contained in the bubble are {B, A, D, F, C, E, H}. Subsequently, considering a radius equal to 3, the resulting BoA contains the nodes {B, A, D, F, C, E, H, G, I}. Finally, the r = 5 case leads to a BoA which includes the whole set of nodes. Now, observe the case presented in Figure 4b, which corresponds to the BoA around B after the rotation upwards has been effected, i.e., the same configuration of the tree used in Figure 3d. In this case, when the radius is unity, nodes {B, A, F } are the only nodes within the bubble, which is different from the corresponding bubble before the rotation is invoked. Similarly, when r = 2, we obtain a set different from the analogous pre-rotation case, which in this case is {B, A, F, D, H}. Note that coincidentally, for the case of a radius equal to 3, the bubbles are identical before and after the rotation, i.e., they invoke the nodes {B, A, D, F, G, I}. Trivially, again, when r = 5, the BoA invokes the entire tree. 6 This fact will ensure that the algorithm reaches the base case when r = 0. 16 (a) Before. (b) After. Figure 4: The BoA associated with the TTOSOM before and after a rotation is invoked at node B. As explained, Equation (3) describes the criteria for a BoA calculated on a static tree. It happens that, as a result of the conditional rotations, the tree will be dynamically adapted, and so the entire phenomenon has to be re-visited. Consequently, the BoA around a particular node becomes a function of time, and, to reflect this fact, Equation (3) should be reformulated as: B(vi ; T, r, t) = {v|dN (vi , v; T, t) ≤ r}, (4) where t is the discrete time index. The algorithm to obtain the BoA for a specific node in such a setting is identical to Algorithm 3, except that the input tree itself dynamically changes. Further, even though the formal notation includes the time parameter, “t”, it happens that, in practice, the latter is needed only if the user/application requires a history of the BoA for any or all the nodes. Storing the history of BoAs will require the maintenance of a DS that will primarily store the changes made to the tree itself. Although storing the history of changes made to the tree can be done optimally [31], the question of explicitly storing the entire history of the BoAs for all the nodes in the tree remains open. 3.2.3 Enforcing the BST Property The CONROT-BST heuristic [16] requires that the tree should possess the BST property [18]: Let x be a node in a BST. If y is a node in the left subtree of x, then key[y] ≤ key[x]. Further, if y is a node in the right subtree of x, then key[x] ≤ key[y]. To satisfy the BST property, first of all we see that, the tree must be binary7 . As a general TTOSOM utilizes an arbitrary number of children per node, one possibility is to bound the value of the branching factor to be 2. In other words, the tree trained by the TTOSOM is restricted to contain at most two children per node. Additionally, the tree must implicitly involve a comparison operator between the two children so as to discern between the branches and thus perform the search process. This comparison can be achieved by defining a unique key that must be maintained for each node in the tree, and which will, in turn, allow a 7 Of course, this is a severe constraint. But we are forced to require this, because the phenomenon of achieving conditional rotations for arbitrary k-ary trees is unsolved. This research, however, is currently being undertaken. 17 lexicographical arrangement of the nodes. This leads to a different, but closely related concept, which concerns the preservation of the topology of the SOM. During the training process, the configuration of the tree will change as the tree evolves, positioning nodes that are accessed more often closer to the root. This probability-based ordering, will hopefully, be preserved by the rotations. A particularly interesting case occurs when the imposed tree corresponds to a list of neurons, i.e., a 1-ary tree. If the TTOSOM is trained using such a tree where each node has at most two children, then the adaptive process will alter the original list. The rotations will then modify the original configuration, generating a new state, where the non-leaf nodes might have one or two children each. In this case the consequence of incorporating ADS-based enhancements to the TTOSOM will imply that the results obtained will be significantly different from those shown in [8]. As shown in [35], an optimal arrangement of the nodes of the tree can be obtained using the probabilities of accesses. If these probabilities are not known a priori, then the CONROT-BST heuristic offers a solution, which involves a decision of whether or not to perform a single rotation towards the root. It happens that the concept of the “just accessed” node in the CONROT-BST is compatible with the corresponding BMU defined for the CL model. In CL, a neuron may be accessed more often than others and some techniques take advantage of this phenomenon through the inclusion of strategies that add or delete nodes The CONROT-BST implicitly stores the information acquired by the currently accessed node by incrementing a counter for that node. This is (in a distant sense) akin to the concept of a BMU counter which adds or delete nodes in competitive networks. During the training phase, when a neuron is a frequent winner of the CL, it gains prominence in the sense that it can represent more points from the original data set. This phenomenon is registered by increasing the BMU counter for that neuron. We propose that during the training phase, we can verify if it is worth modifying the configuration of the tree by moving this neuron one level up towards the root as per the CONROT-BST algorithm, and consequently explicitly recording the relevant role of the particular node with respect to its nearby neurons. CONROT-BST achieves this by performing a local movement of the node, where only its direct parent and children are aware of the neuron promotion. Neural Promotion is the process by which a neuron is relocated in a more privileged position8 in the network with respect to the other neurons in the NN. Thus, while all “all neurons are born equal”, their importance in the society of neurons is determined by what they represent. This is achieved, by an explicit advancement of its rank or position. Given this premise, the nodes in the tree will be adapted in such a way that neurons that have been BMUs more frequently, will tend to move towards the root if an only if a reduction in the overall WPL is obtained as a consequence of such a promotion. The properties of CONROT-BST guarantee this. Once the SOM and BST are “tied” together in a symbiotic manner (where one enhances the other and vice versa), the adaptation can be achieved by affecting the configuration of the BST. This task will be performed every time a training step of the SOM is performed. Clearly, it is our task to achieve an integration of the 8 As far as we know, we are not aware of any research which deals with the issue of Neural Promotion. Thus, we believe that this concept, itself, is pioneering. 18 BST and the SOM, and Figure 5 depicts the main architecture used to accomplish this. It transforms the structure of the SOM by modifying the configuration of the BST that, in turn, holds the structure of the neurons. Figure 5: Architectural view of an Adaptive Tree-Based SOM. As this work constitutes the first attempt to constraint a tree-based SOM using a BST, our focus is placed on the self-adaptation of the nodes. In this sense, the unique identifiers of the nodes are employed to maintain the BST structure and to promote nodes that are frequently accessed towards the root. We are currently examining ways to enhance this technique so as to improve the time required to identify the BMU as well. 3.2.4 Initialization Initialization, in the case of the BST-based TTOSOM, is accomplished in two main steps which involve defining the initial value of each neuron and the connections among them. The initialization of the codebook vectors are performed in the same manner as in the basic TTOSOM. The neurons can assume a starting value arbitrarily, for instance, by placing them on randomly selected input samples. On the other hand, a major enhancement with respect to the basic TTOSOM lays in the way the neurons are linked together. The basic definition of the TTOSOM utilizes connections that remain static through time. The beauty of such an arrangement is that it is capable of reflecting the user’s perspective at the time of describing the topology, and it is able to preserve this configuration until the algorithm reaches convergence. The inclusion of the rotations renders this dynamic. 3.2.5 The Required Local Information In our proposed approach, the codebooks of the SOM correspond to the nodes of a BST. Apart from the information regarding the codebooks themselves in the feature space, each neuron requires the maintenance of additional fields to achieve the adaptation. Besides this, each node inherits the properties of a BST Node, and it thus includes a pointer to the left and right children, as well as (to make the implementation easier), a pointer to its parent. Each node also contains a label which is able to uniquely identify the neuron when it is in the “company” of other neurons. This identification index constitutes the lexicographical key used to sort the nodes of the tree and remains static as time proceeds. Figure 6 depicts all the fields included in a 19 neuron of a BST-based SOM. Figure 6: Fields included in a BST-based SOM neuron. 3.2.6 The Neural State The different states that a neuron may assume during its lifetime are illustrated in Figure 7. At first, when the node is created, it is assigned a unique identifier, and the rest of the data fields are populated with their initial values. Here, the codebook vector assumes a starting value in the feature space, and the pointers are configured so as to appropriately link the neuron with the rest of the neurons in the tree in a BST configuration. Next, during the most significant portion of the algorithm, the NN enters a main loop, where training is effected. This training phase, involves adjusting the codebooks and may also trigger optional modules that affect the neuron. Once the BMU is identified, the neuron might assume the “restructured” state, which means that a restructuring technique, such as the CONROT algorithm, will be applied. Alternatively, the neuron might be ready to accept queries, i.e., be part of the CL process in the mapping mode. Additionally, an option that we are currently investigating, involves the case when a neuron is no longer necessary and may thus be eliminated from the main neural structure. We refer to this state as the so-called “deleted” state, and it is depicted using dashed lines. Finally, we foresee an alternative state referred to as the “frozen” state, in which the neuron does not participate in the CL during the training mode although it may continue to be part of the overall NN structure. Figure 7: Possible states that a neuron may assume. 3.2.7 The Training Step of the TTOCONROT The training module of the TTOCONROT is responsible of determining the BMU, performing restructuring, calculating the BoA and migrating the neurons within the BoA. Basically, what has to be done, is to integrate the CONROT algorithm into the sequence of steps responsible for the training phase of the TTOSOM. 20 Algorithm 4 describes the details of how this integration is accomplished. Line 1 performs the first task of the algorithm, which involves determining the BMU. After that, line 2 invokes the CONROT procedure. The rationale for following this sequence of steps is that the parameters needed to perform the conditional rotation, as specified in [16], includes the “key” of the element queried, which, in the present context, corresponds to the identity of the BMU. At this stage of the algorithm, the BMU may be rotated or not depending on the optimizing criterion given by equations (1) and (2), and the BoA is determined after this restructuring is done. These are performed in lines 3 and 4 of the algorithm respectively. Finally, lines 5 to 7, are responsible for the neural migration itself, and oversee the movement of the neurons within the BoA towards the input sample. Algorithm 4 TTOCONROT-BST train(x,p) Input: i) x, a sample signal. ii) p, the pointer to the tree. Method: 1: v ← TTOSOM Find BMU(x,p) 2: cond-rot-bst(p,v.getID()) 3: B ← {v} 4: TTOSOM Calculate Neighborhood(B,v,radius) 5: for all b ∈ B do 6: update rule(b.getCodebook(),x) 7: end for End Algorithm 3.2.8 Alternative Restructuring Techniques Even though, we have explained the advantages of the CONROT algorithm, the architecture that we are proposing allows the inclusion of alternative restructuring modules other than the CONROT. Potential candidates which can be used to perform the adaptation are the ones mentioned in Section 3.1 and include the splay and the MT algorithms, among others. 4 Experimental Results To illustrate the capabilities of our method, the experiments reported in the present work are primarily focused in lower dimensional feature spaces. This will help the reader in geometrically visualizing the results we have obtained. However, it is important to remark that the algorithm is also capable of solving problems in higher dimensions, although a graphical representation of the results will not be as illustrative. We know that, as per the results obtained in [8], the TTOSOM is capable of inferring the distribution and structure of the data. However, in this present setting, we are interested in investigating the effects of applying the neural rotation as part of the training process. To render the results comparable, the experiments in this section use the same schedule for the learning rate and radius, i.e., no particular refinement of the parameters has been done for any specific data set. Additionally, the parameters follow a rather “slow” decrement of the so-called decay parameters, allowing us to understand how the prototype vectors are moved as convergence 21 takes place. When solving practical problems, we recommend a further refinement of the parameters so as to increase the speed of the convergence process. 4.1 TTOCONROT’s Structure Learning Capabilities We shall describe the performance of TTOCONROT with data sets in 1, 2 and 3 dimensions, as well as experiments in the multidimensional domain. The specific advantages of the algorithm for various scenarios will also be highlighted. 4.1.1 One Dimensional Objects Since our entire learning paradigm assumes that the data has a tree-shaped model, our first attempt was to see how the philosophy is relevant to a unidimensional object (i.e., a curve), which really possesses a “linear” topology. Thus, as a prima facie case, we tested the strength of the TTOCONROT to infer the properties of data sets generated from linear functions in the plane. Figure 8 shows different snapshots of how the TTOCONROT learns the data generated from a curve. Random initialization was used by uniformly drawing points from the unit square. Observe that the original data points do not lie in the curve. Our aim here was to show how our algorithm could learn the structure of the data using arbitrary (initial and “non-realistic”) values for the codebook vectors. Figures 8b and 8c depict the middle phase of the training process, where the edges connecting the neurons are omitted for simplicity. It is interesting to see how, after a few hundred training steps, the original chaotic placement of the neurons are rearranged so as to fall within the line described by the data points. The final configuration is shown in Figure 8d. The reader should observe that after convergence has been achieved, the neurons are placed almost equidistantly along the curve. Even though the codebooks are not sorted in and increasing numerical order, the hidden tree and its root, denoted by two concentric squares, are configured in such a way that nodes that are queried more frequently will tend to be closer to the root. In this sense, the algorithm is not only capturing the essence of the topological properties of the data set, but at the same time rearranging the internal order of the neurons according to their importance in terms of their probabilities of access. 4.1.2 Two Dimensional Data Points To demonstrate the power of including ADS in SOMs, we shall now consider the same two-dimensional data sets studied in [8]. First we consider the data generated from a triangular-spaced distribution, as shown in Figures 9a-9d. In this case, the initial tree topology is unidirectional, i.e., a list, although, realistically, this is quite inadvisable considering the true (unknown) topology of the distribution. In other words, we assume that the user has no a priori information about the data distribution. Thus, for the initialization phase, a 1-ary tree is employed as the tree structure, and the respective keys are assigned in an increasing order. Observe that in this way we are providing minimal information to the algorithm. The root of the tree is marked with two concentric squares, i.e., the neuron labeled with the index 0 in Figure 9a. Also, with regards to the feature space, the prototype vectors are initially randomly placed. In the first iteration, the linear topology is lost, which is attributable to the randomness of the data points. As the prototypes are migrated 22 1 9 5 8 7 3 4 3 2 0 7 6 9 0 5 2 1 8 4 6 (a) After 0 iterations (b) After 1,000 iterations 7 6 7 6 8 8 4 4 9 3 0 9 3 5 5 0 2 1 1 (c) After 3,000 iterations 2 (d) After 5,000 iterations Figure 8: A 1-ary tree, i.e., a list topology, learns a curve. For the sake of simplicity, the edges are ommitted. and reallocated (see Figures 9b and 9c ), the 1-ary tree is modified as a consequence of the rotations. Such a transformation is completely novel to the field of SOMs. Finally, Figure 9d depicts the case after convergence has taken place. Here, the tree nodes are uniformly distributed over the entire triangular domain. The BST property is still preserved, and further rotations are still possible if the training process continues. This experiment serves as an excellent example to show the differences between our current method and the original TTOSOM algorithm [8], where the same data set with similar settings was utilized. In the case of the TTOCONROT the points effectively represent the entire data set. However, the reader must observe that we do not have to provide the algorithm with any particular a priori information about the structure of the data distribution – this is learned during the training process, as shown in Figure 9d. Thus, the specification of the initial “user-defined” tree topology (representing his perspective of the data space) required by the TTOSOM is no longer mandatory, and an alternative specification which only requires the number of nodes in the initial 1-ary tree is sufficient. A second experiment involves a Gaussian distribution. Here a 2-dimensional Gaussian ellipsoid is learned using the TTOCONROT algorithm. The convergence of the entire training execution phase is displayed in Figure 10. This experiment considers a complete BST of depth 4, i.e., containing 15 nodes. For simplicity the labels of the nodes have been removed. In Figure 10, the tree structure generated by the neurons suggest an ellipsoidal structure for the data distribution. This experiment is a good example to show how the nodes close to the root represent dense areas of the ellipsoid, and at the same time, those node that are far from the root (in tree space) occupy regions with low density, e.g., in the “extremes” of the ellipse. The TTOCONROT infers this structure without receiving any a priori information about the distribution or its structure. The experiment shown in Figures 11a-11d considers data generated from an irregular shape with a concave surface. Again, as in the case of the experiments described earlier, the original tree includes 15 neurons arranged unidirectionally, i.e., as in a list. As a result of the training, the distribution is learned and the 23 2 10 14 12 8 4 5 2 7 3 9 1 0 0 3 89 10 7 1 6 4 13 14 12 11 13 6 5 11 (a) After 0 iterations (b) After 1,000 iterations 2 2 6 6 3 3 9 1 1 0 7 4 10 12 11 8 0 9 10 7 14 13 5 11 (c) After 3,000 iterations 8 4 12 14 13 5 (d) After 5,000 iterations Figure 9: A 1-ary tree, i.e., a list topology, learns a triangular distribution. The DS is self-adapted so that nodes accessed more frequently are moved closer to the root conditionally. The BST property is also preserved. Figure 10: A tree learns a Gaussian distribution. The neurons that are accessed more frequently are promoted closer to the root. tree is adapted accordingly, as illustrated in Figure 11d. Observe that the random initialization is performed by randomly selecting points from the unit square, and this points thus do not necessarily fall within the concave boundaries. Although this initialization scheme is responsible of placing codebook vectors outside 24 of the irregular shape, the reader should observe that in a few training steps, they are repositioned inside the contour. It is important to indicate that, even though after the convergence of the algorithm, a line connecting two points passes outside the overall “unknown” shape, one must take into account that the TTOCONROT tree attempts to mimic the stochastic properties in terms of access probabilities. When the user desires the topological mimicry in terms of skeletal structure, we recommend the use of the TTOSOM instead. The final distribution of the points is quite amazing! 6 138 7 4 7 9 10 8 10 0 6 7 8 8 3 9 6 6 9 9 10 10 0 0 1 1 5 11 5 12 13 11 12 7 14 5 11 2 3 14 1 10 (a) After 0 iterations 12 14 4 2 (b) After 1,000 iterations 2 11 13 12 4 13 2 5 3 (c) After 3,000 iterations 14 4 3 (d) After 5,000 iterations Figure 11: A 1-ary tree, i.e., a list topology, learns different distributions from a concave object using the TTOCONROT algorithm. The set of parameters is the same as in the other examples. 4.1.3 Three Dimensional Data Points We will now explain the results obtained when applying the algorithm with and without CONROT. To do this we opt to consider three-dimensional objects. The experiments utilize the data generated from the contour of the unit sphere. It also initially involves an uni-dimensional chain of 31 neurons. Additionally, in order to show the power of the algorithm, both cases initialize the codebooks by randomly drawing points from the unit cube, which thus initially places the points outside the sphere itself. Figure 12 presents the case when the basic TTO algorithm (without CONROT) learns the unit sphere without performing conditional rotations. The illustration presented in Figure 12a show the state of the neurons before the first iteration is completed. Here, as shown, the codebooks lie inside the unit cube, although some of the neurons are positioned outside the boundary of the respective circumscribed sphere, which is the one we want to learn. Secondly, Figures 12b and 12c depict intermediate steps of the learning phase. As the algorithm processes the information provided by the sample points and the neurons are repositioned, the chain of neurons is constantly “twisted” so as to adequately represent the entire manifold. Finally, Figure 12d illustrates the case when the convergence is reached. In this case, the one-dimensional list of neurons is evenly distributed over the sphere, preserving the original properties of the 3-dimensional object and also presenting a shape which reminds the viewer of the so-called Peano curve [47]. A complimentary set of experiments which involved the learning of the same unit sphere where the TTO scheme was augmented by conditional rotations (i.e., CONROT) was also conducted. Figure 13a shows the initialization of the codebooks. Here, the starting positions of the neurons fall within the unit cube as in the case displayed in Figure 12a. Figures 13b and 13c show snapshots after 1, 000 and 3, 000 iterations respectively. In this case the tree configuration obtained in the intermediate phases differ significantly from those obtained by the corresponding configurations shown in Figure 12, i.e., those that involved no rotations. In this case, the list rearranges itself as per CONROT, modifying the original chain structure to yield a more25 14 7 7 19 10 8 26 28 24 22 15 25 28 1 17 27 12 4 26 31 21 121718 16 15 14 13 23 22 21 20 19 22 28 13 3 16 26 6 4 21 5 19 30 29 31 9 10 4 5 6 7 89 2 18 3 2 11 11 29 24 23 5 24 17 31 30 0 27 11 6 0 29 6 25 910 30 23 7 25 20 0 1 2 3 24 20 15 27 1 14 15 0 3 2 16 18 8 22 13 18 20 12 5 23 21 14 17 1 4 19 12 11 10 9 29 28 27 26 25 31 30 8 13 16 (a) After 0 iterations (b) After 1,000 iter. (c) After 3,000 iter. (d) After 5,000 iter. Figure 12: A 1-ary tree, i.e., a list topology, learns a sphere distribution when the algorithm does not utilize any conditional rotation. or-less balanced tree. Finally, from the results obtained after convergence, and illustrated in Figure 13d, it is possible to compare both scenarios. In both cases, we see that the tree is accurately learned. However, in the first case, the structure of the nodes is maintained as a list throughout the learning phase, while, in the case when CONROT is applied, the configuration of the tree is constantly revised, promoting those neurons that are queried more frequently. Additionally, the experiments show us how the dimensionality reduction property evidenced in the traditional SOM, is also present in the TTOCONROT. Here, an object in the 3-dimensional domain is successfully learned by our algorithm, and the properties of the original manifold are captured from the perspective of a tree. 13 24 25 9 9 11 7 25 18 9 10 30 30 10 24 11 4 6 27 12 8 20 23 19 8 14 1 02 3 15 14 27 19 6 24 12 16 14 15 13 30 18 17 15 17 21 20 21 13 22 13 22 26 29 30 28 27 11 14 0 20 17 21 15 28 22 8 5 11 10 20 3 16 16 25 23 5 7 2421 22 23 16 4 23 26 2 4 25 5 7 29 98 29 12 27 26 2 29 26 10 18 18 6 28 0 4 17 12 75 6 19 0 28 3 19 3 1 1 1 2 (a) After 0 iterations (b) After 1,000 iter. (c) After 3,000 iter. (d) After 5,000 iter. Figure 13: A 1-ary tree, i.e., a list topology, learns a sphere distribution. 4.1.4 Multidimensional Data Points The well known Iris dataset was chosen for showing the power of our scheme in a scenario when the dimensionality is increased. This data set gives the measurements (in centimeters) of the variables which are the sepal length, sepal width, petal length and petal width, respectively, for 50 flowers from each of 3 species of the iris family. The species are the Iris Setosa, Versicolor, and Virginica. In this set of experiments, the Iris data set was learned under three different configurations, using a fixed schedule for the learning rate and radius but with a distinct tree configuration. The results of the experiments are depicted in Figure 14 and involve a complete binary tree of depth 3, 4 and 5, respectively. Taking into 26 account that the dataset possesses a high dimensionality, we present the projection in the 2-dimensional space to facilitate the visualization. We also removed the labels from the nodes in Figure 14c to improve understandability. (a) Using 7 nodes. (b) Using 15 nodes. (c) Using 31 nodes. Figure 14: Three different experiments where the TTOCONROT effectively captures the fundamental structure of the iris dataset (2-dimensional projection of the data is shown). The experiment utilizes a underlying tree topology of a complete binary tree with different levels of depth. By this we attempt to show examples of how exactly the same parameters of the TTOCONROT, can be utilized to learn the structure from data belonging to the 2-dimensional, 3-dimensional and also 4-dimensional spaces. After executing the TTO-SOM, each of the main branches of the tree were migrated towards the center of mass of the cloud of points in the hyper-space belonging to each of the three categories of flowers, respectively. Since the TTOCONROT is an unsupervised learning algorithm, it performs learning without knowing the true labels of the samples. However, when these labels are available, one can use them to evaluate the quality of the tree. To do so, each sample is assigned to its closest neuron, and tagging the neuron with the class which is most frequent. Table 1 presents the evaluation for the tree in Figure 14a. Assigned to neuron → Iris-setosa Iris-versicolor Iris-virginica 1 0 0 12 2 0 0 22 3 0 20 0 4 0 7 0 5 0 20 1 6 50 0 0 7 0 3 15 Table 1: “Cluster to class” evaluation for the tree in Figure 14a. Using the simple voting scheme explained above, it is possible to see from Table 1, that only 4 instances are incorrectly classified, i.e., 97.3% of the instances are correctly classified. Additionally, observe that node 6 contains all the 50 instances corresponding to the class Iris-setosa. It is well known that the Iris-setosa class is linearly separable from the other two classes, and our algorithm was able to discover this without providing it with the labels. We find this result quite fascinating! The experimental results shown in Table 1, not only demonstrate the potential capabilities of the TTOCONROT for performing clustering, but also suggest the possibilities of using it for pattern classification. According to [23], there are several reasons for performing pattern classification using an unsupervised approach. We are currently investigating such a classification strategy. 27 4.2 Skeletonization In general, the main objective of skeletonization consists of generating a simpler representation of the shape of an object. The authors of [44] refer to skeletonization in the plane as the process by which a 2-dimensional shape is transformed into a 1-dimensional one, similar to a “stick” figure. The applications of skeletonization are diverse, including the fields of Computer Vision and Pattern Recognition. As explained in [8], the traditional methods for skeletonization assume the connectivity of the data points and when this is not the case, more sophisticated methods are required. Previous efforts involving SOM variants to achieve skeletonization has been proposed [8, 19, 53]. We remark that the TTOSOM [8] is the only one which uses a tree-based structure. The TTOSOM assumed that the shape of the object is not known a priori. Rather, this is learned by accessing a single point of the entire shape at any time instant. Our results reported in [8] confirm that this is actually possible, and we now focus on how the conditional rotations will affect such a skeletonization. Figure 15 shows how the TTOCONROT learned the skeleton of different objects in the 2-dimensional and the 3-dimensional domain. In all the cases the same schedule of parameters were used, and only the number of neurons employed was chosen proportionally to the number of data points contained in the respective data sets. It is important to remark that we did not invoke any post-processing of the edges, e.g., minimum spanning tree, and that the skeleton observed was exactly what our BSTSOM learned. Firstly, Figures 15a-15d illustrate the shapes of the silhouette of a human, a rhinoceros, a 3d representation of a head, and a 3d representation of a woman. The figures also show the trees learned from the respective data sets. Additionally figures 15e-15h display only the data points, which in our opinion are capable of representing the fundamental structure of the four objects in a 1-dimensional way effectively. As a final comment, we stress that all the shapes employed in the experiments involve the learning of the “external” structure of the objects. For the case of solid objects, if the internal data points are also provided, the TTOCONROT is able to give an approximation of the so-called endo-skeleton, i.e., a representation in which the skeleton is built inside the solid object. 4.3 Theoretical Analysis According to Kiviluoto [34], there are three different criteria for evaluating the quality of a map. The first criterion indicates how continuous the mapping is, implying that input signals that are close (in the input space) should be mapped to codebooks that are close in the output space as well. A second criterion involves the resolution of the mapping. Maps with high resolution possess the additional property that input signals that are distant in the input space should be represented by distant codebooks in the output space. A third criterion imposed on the accuracy of the mapping is aimed to reflect the probability distribution of the input set. There exist a variety of measures for quantifying the quality of the topology preservation [5]. The author of [49] surveys a number of relevant measures for the quality of maps, and these include the Quantization Error, the Topographic Product [11], the Topographic Error [34] and the Trustworthiness and Neighborhood Preservation [55]. Although we are currently investigating [6] how the quality of any tree-based SOM (not just our scheme) can be quantified using these metrics. The following arguments are pertinent. 28 (a) (b) (c) (d) (e) (f) (g) (h) Figure 15: TTOCONROT effectively captures the fundamental structure of four objects in a 1-dimensional way. Figures 15a-15d show the silhouette of a human, a rhinoceros, a 3d representation of a head, and a 3d representation of a woman, as well as the respective trees learned. Figures 15e-15h show only the respective data points. The ordering of the weights (with respect to the position) of the neurons of the SOM has been proved for unidimensional topologies [17, 36, 51]. Extending these results to higher dimensional configurations or topologies leads to numerous unresolved problems. First of all, the question of what one means by “ordering” in higher dimensional spaces has to be defined. Further, the issue of the “absorbing” nature of the “ordered state” is open. Budinich, in [14], explains intuitively the problems related to the ordering of neurons in higher dimensional configurations. Huang et al. [29] introduce a definition of the ordering and show that even though the position of the codebook vectors of the SOM have been ordered, there is still the possibility that a sequence of stimuli will cause their disarrangement. Some statistical indexes of correlation between the measures of the weights and distances of the related positions have been introduced in [10]. With regard to the topographic product, the authors of [11] have shown the power of the metric by applying it on different artificial and real-world data sets, and also compared it with different measures to quantify the topology [10]. Their study concentrates on the traditional SOM, implying that the topologies evaluated were of a “linear” nature, with the consequential extension to 2-dimensions and 3-dimensions by means of grids only. In [28], Haykin mention that the Topographic Product may be employed to compare the quality of different maps, even when these maps possess different dimensionality. However, he also noted that this measurement is only possible when the dimensionality of the topological structure is the same as the dimensionality of the feature space. Further, tree-like topologies were not considered in their study. To be more precise, most of the effort towards determining the concept of topology preservation for dimensions greater than unity are specifically focused on the SOM [11, 17, 36, 14, 29, 10], and do not define how a treelike topology should be measured nor how to define the order in topologies which are not grid-based. Thus, we believe that even the tools to analyze the TTOCONROT are currently not available. The experimental 29 results obtained in our paper, suggest that the TTOCONROT is able to train the NN so as to preserve the stimuli. However, in order to quantify the quality of this topology, the matter of defining a concept of ordering on tree-based structure has yet to be resolved. Although this issue is of great interest to us, this rather ambitious task lies beyond the scope of our present manuscript. 5 Conclusions and Discussions 5.1 Concluding Remarks In this paper, we have proposed a novel integration between the areas of Adaptive Data Structures (ADSs) and the Self-Organizing Maps (SOMs). In particular we have shown how a tree-based SOM can be adaptively transformed by the employment of an underlying Binary Search Tree (BST) structure and subsequently, restructured using rotations that are performed conditionally. These rotations on the nodes of the tree are local, can be done in constant time, and performed so as to decrease the Weighted Path Length (WPL) of the entire tree. One of the main advantages of the algorithm, is that the user does not need to have a priori knowledge about the topology of the input data set. Instead, our proposed method, namely the TTOSOM with Conditional Rotations (TTOCONROT), infers the topological properties of the stochastic distribution, and at the same time, attempt to build the best BST that represents the data set. Incorporating the data structure’s constraints in this ways has not being achieved by any of the related approaches included in the state-of-the-art. Our premise is that regions of the hyper-space that are accessed more often should be promoted to preferential spots in the tree representation, which yields to an improved stochastic representation. As our experimental results suggest, the TTOCONROT tree is indeed able to absorb the stochastic properties of the input manifold. It is also possible to obtain a tree configuration that can learn both, the stochastic properties in terms of access probabilities and at the same time preserve the topological properties in terms of its skeletal structure. 5.2 Discussions and Future Work As explained in Section 4.3, the work associated with measuring the topology preservation of the SOM, including the proof of its convergence for the unidimensional case, has been performed for the traditional SOM only. The questions are unanswered for how a tree-like topology should be measured, and for defining the order in topologies which are not grid-based. Thus, we believe that even the tools for formally analyzing the TTOCONROT are currently not available. The experimental results obtained in our paper, suggest that the TTOCONROT is able to train the Neural Network (NN) so as to preserve the stimuli for which the concept of ordering on tree-based structures has yet to be resolved. Even though our principal goal was to obtain a more accurate representation of the stochastic distribution, our results also suggest that the special configuration of the tree obtained by the TTOCONROT can be further exploited so as to improve the time required for identifying the Best Matching Unit (BMU). The state-ofthe-art includes different strategies that expand trees by inserting nodes (which can be a single neuron or a 30 SOM-layer) that essentially are based on a Quantization Error (QE) measure. In some of these strategies, the error measure is based on the “hits”, i.e., the number of times a neuron has been selected as the BMU, which is, in principle, the same type of counter utilized by the Conditional Rotations (CONROT). Our strategy, TTOCONROT, which asymptotically positions frequently accessed nodes close to the root, might incorporate a module, that taking advantage of the “optimal” tree and the BMU counters already present in the TTOCONROT, splits the node at the root level. Thus, the splitting operation will occur without the necessity of searching for the node with the largest QE, under the assumption that a higher number of hits indicates that the degree of granularity of a particular neuron is lacking refinement. The concept of using the root of the tree for growing a tree-based SOM is itself pioneering, as far as we know, and the design and implementation details of this are currently being investigated. References [1] M. Adelson-Velskii and M. E. Landis. An algorithm for the organization of information. Sov. Math. DokL, 3:1259–1262, 1962. [2] M. U. Akram, S. Khalid, and S. A. Khan. Identification and classification of microaneurysms for early detection of diabetic retinopathy. Pattern Recognition, 46(1):107–116, 2013. [3] D. Alahakoon, S. K. Halgamuge, and B. Srinivasan. Dynamic self-organizing maps with controlled growth for knowledge discovery. IEEE Transactions on Neural Networks, 11(3):601–614, 2000. [4] B. Allen and I. Munro. Self-organizing binary search trees. J. ACM, 25(4):526–535, 1978. [5] E. Arsuaga Uriarte and F. Dı́az Martı́n. Topology preservation in SOM. International Journal of Applied Mathematics and Computer Sciences, 1(1):19–22, 2005. [6] C. A. Astudillo. Self Organizing Maps Constrained by Data Structures. PhD thesis, Carleton University, 2011. [7] C. A. Astudillo and B. J. Oommen. On using adaptive binary search trees to enhance self organizing maps. In A. Nicholson and X. Li, editors, 22nd Australasian Joint Conference on Artificial Intelligence (AI 2009), pages 199–209, 2009. [8] C. A. Astudillo and B. J. Oommen. Imposing tree-based topologies onto self organizing maps. Information Sciences, 181(18):3798–3815, 2011. [9] C. A. Astudillo and B. J. Oommen. On achieving semi-supervised pattern recognition by utilizing tree-based SOMs. Pattern Recognition, 46(1):293 – 304, 2013. [10] H. U. Bauer, M. Herrmann, and T. Villmann. Neural maps and topographic vector quantization. Neural Networks, 12(4-5):659 – 676, 1999. [11] H. U. Bauer and K. R. Pawelzik. Quantifying the neighborhood preservation of self-organizing feature maps. Neural Networks, 3(4):570–579, July 1992. 31 [12] J. R. Bitner. Heuristics that dynamically organize data structures. SIAM J. Comput., 8:82–110, 1979. [13] J. Blackmore. Visualizing high-dimensional structure with the incremental grid growing neural network. Master’s thesis, University of Texas at Austin, 1995. [14] M. Budinich. On the ordering conditions for self-organizing maps. Neural Computation, 7(2):284–289, 1995. [15] G. A. Carpenter and S. Grossberg. The art of adaptive pattern recognition by a self-organizing neural network. Computer, 21(3):77–88, 1988. [16] R. P. Cheetham, B. J. Oommen, and D. T. H. Ng. Adaptive structuring of binary search trees using conditional rotations. IEEE Trans. on Knowl. and Data Eng., 5(4):695–704, 1993. [17] P. L. Conti and L. De Giovanni. On the mathematical treatment of self organization: extension of some classical results. In Artificial Neural Networks - ICANN 1991, International Conference, volume 2, pages 1089–1812, 1991. [18] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to Algorithms, Second Edition. McGraw-Hill Science/Engineering/Math, July 2001. [19] A. Datta, S. M. Parui, and B. B. Chaudhuri. Skeletal shape extraction from dot patterns by selforganization. Pattern Recognition, 1996., Proceedings of the 13th International Conference on, 4:80–84 vol.4, Aug 1996. [20] D. Deng. Content-based image collection summarization and comparison using self-organizing maps. Pattern Recognition, 40(2):718 – 727, 2007. [21] M. Dittenbach, D. Merkl, and A. Rauber. The growing hierarchical self-organizing map. In Neural Networks, 2000. IJCNN 2000, Proceedings of the IEEE-INNS-ENNS International Joint Conference on, volume 6, pages 15–19 vol.6, 2000. [22] J. Dopazo and J. M. Carazo. Phylogenetic reconstruction using an unsupervised growing neural network that adopts the topology of a phylogenetic tree. Journal of Molecular Evolution, 44(2):226–233, February 1997. [23] R. Duda, P. E. Hart, and D. G. Stork. Pattern Classification (2nd Edition). Wiley-Interscience, 2000. [24] B. Fritzke. Growing Cell Structures – a self-organizing network for unsupervised and supervised learning. Neural Networks, 7(9):1441–1460, 1994. [25] B. Fritzke. Growing Grid - a self-organizing network with constant neighborhood range and adaptation strength. Neural Processing Letters, 2(5):9–13, 1995. [26] B. Fritzke. A growing neural gas network learns topologies. In G. Tesauro, D. S. Touretzky, and T. K. Leen, editors, Advances in Neural Information Processing Systems 7, pages 625–632, Cambridge MA, 1995. MIT Press. 32 [27] L. Guan. Self-organizing trees and forests: A powerful tool in pattern clustering and recognition. In Image Analysis and Recognition, Third International Conference, ICIAR 2006, Póvoa de Varzim, Portugal, September 18-20, 2006, Proceedings, Part I, pages I: 1–14, 2006. [28] S. Haykin. Neural Networks and Learning Machines. Prentice Hall, 3rd edition edition, 2008. [29] G. Huang, H. A. Babri, and H. Li. Ordering of self-organizing maps in multi-dimensional cases. Neural Computation, 10:19–24, 1998. [30] H.-G. Kang and D. Kim. Real-time multiple people tracking using competitive condensation. Pattern Recognition, 38(7):1045 – 1058, 2005. [31] H. Kaplan. Handbook of Data Structures and Applications, chapter 31: Persistent Data Structures, pages 31.1 – 31.26. Chapman and Hall/CRC, 2004. [32] S. Kaski, J. Kangas, and T. Kohonen. Bibliography of self-organizing map (SOM) papers: 1981–1997. Neural Computing Surveys, 1:102–350, 1998. [33] M. H. Khosravi and R. Safabakhsh. Human eye sclera detection and tracking using a modified timeadaptive self-organizing map. Pattern Recognition, 41(8):2571–2593, 2008. [34] K. Kiviluoto. Topology preservation in self-organizing maps. In P. IEEE Neural Networks Council, editor, Proceedings of International Conference on Neural Networks, ICNN’96, volume 1, pages 294–299, New Jersey, USA, 1996. [35] D. E. Knuth. The art of computer programming, volume 3: (2nd ed.) sorting and searching. Addison Wesley Longman Publishing Co., Inc., Redwood City, CA, USA, 1998. [36] T. Kohonen. Self-Organizing Maps. Springer-Verlag New York, Inc., Secaucus, NJ, USA, 1995. [37] P. Koikkalainen and E. Oja. Self-organizing hierarchical feature maps. IJCNN International Joint Conference on Neural Networks, 2:279–284, June 1990. [38] T. W. H. Lai. Efficient maintenance of binary search trees. PhD thesis, University of Waterloo, Waterloo, Ont., Canada, 1990. [39] Y. Liang, M. C. Fairhurst, and R. M. Guest. No titlea synthesised word approach to word retrieval in handwritten documents. Pattern Recognition, 45(12):4225–4236, 2012. [40] M. Martinetz and K. J. Schulten. A “neural-gas” network learns topologies. In in Proceedings of International Conference on Articial Neural Networks, volume I, pages 397–402, North-Holland, Amsterdam, 1991. [41] K. Mehlhorn. Dynamic binary search. SIAM Journal on Computing, 8(2):175–198, 1979. [42] D. Merkl, S. Hui-He, M. Dittenbach, and A. Rauber. Adaptive hierarchical incremental grid growing: An architecture for high-dimensional data visualization. In In Proceedings of the 4th Workshop on Self-Organizing Maps, Advances in Self-Organizing Maps, pages 293–298, 2003. 33 [43] R. Miikkulainen. Script recognition with hierarchical feature maps. Connection Science, 2(1&2):83–101, 1990. [44] R. L. Ogniewicz and O. Kübler. Hierarchic voronoi skeletons. Pattern Recognition, 28(3):343–359, 1995. [45] M. Oja, S. Kaski, and T. Kohonen. Bibliography of self-organizing map (SOM) papers: 1998-2001 addendum. Neural Computing Surveys, 3:1–156, 2003. [46] J. Pakkanen, J. Iivarinen, and E. Oja. The Evolving Tree — a novel self-organizing network for data analysis. Neural Processing Letters, 20(3):199–211, December 2004. [47] G. Peano. Sur une courbe, qui remplit toute une aire plane. Mathematische Annalen, 36(1):157–160, 1890. [48] M. Pöllä, T. Honkela, and T. Kohonen. Bibliography of self-organizing map (SOM) papers: 20022005 addendum. Technical Report TKK-ICS-R23, Helsinki University of Technology, Department of Information and Computer Science, Espoo, Finland, December 2009. [49] G. Pölzlbauer. Survey and comparison of quality measures for self-organizing maps. In Ján Paralič, Georg Pölzlbauer, and Andreas Rauber, editors, Proceedings of the Fifth Workshop on Data Analysis (WDA’04), pages 67–82, Sliezsky dom, Vysoké Tatry, Slovakia, June 24–27 2004. Elfa Academic Press. [50] A. Rauber, D. Merkl, and M. Dittenbach. The Growing Hierarchical Self-Organizing Map: exploratory analysis of high-dimensional data. IEEE Transactions on Neural Networks, 13(6):1331–1341, 2002. [51] R. Rojas. Neural networks: a systematic introduction. Springer-Verlag New York, Inc., New York, NY, USA, 1996. [52] E. V. Samsonova, J. N. Kok, and A. P. IJzerman. Treesom: Cluster analysis in the self-organizing map. Neural Networks, 19(6–7):935 – 949, 2006. Advances in Self Organising Maps - WSOM’05. [53] R. Singh, V. Cherkassky, and N. Papanikolopoulos. Self-Organizing Maps for the skeletonization of sparse shapes. Neural Networks, IEEE Transactions on, 11(1):241–248, Jan 2000. [54] D. D. Sleator and R. E. Tarjan. Self-adjusting binary search trees. J. ACM, 32(3):652–686, 1985. [55] J. Venna and S. Kaski. Neighborhood preservation in nonlinear projection methods: An experimental study. In Georg Dorffner, Horst Bischof, and Kurt Hornik, editors, ICANN, volume 2130 of Lecture Notes in Computer Science, pages 485–491. Springer, 2001. [56] K. C. Yao, M. Mignotte, C. Collet, P. Galerne, and G. Burel. Unsupervised segmentation using a selforganizing map and a noise model estimation in sonar imagery. Pattern Recognition, 33(9):1575 – 1584, 2000. 34
9cs.NE
Robust Satisfaction of Temporal Logic Specifications via Reinforcement Learning arXiv:1510.06460v1 [cs.SY] 22 Oct 2015 Austin Jones1 , Derya Aksaray2 , Zhaodan Kong3 , Mac Schwager4 , and Calin Belta2,5 Abstract— We consider the problem of steering a system with unknown, stochastic dynamics to satisfy a rich, temporallylayered task given as a signal temporal logic formula. We represent the system as a Markov decision process in which the states are built from a partition of the statespace and the transition probabilities are unknown. We present provably convergent reinforcement learning algorithms to maximize the probability of satisfying a given formula and to maximize the average expected robustness, i.e., a measure of how strongly the formula is satisfied. We demonstrate via a pair of robot navigation simulation case studies that reinforcement learning with robustness maximization performs better than probability maximization in terms of both probability of satisfaction and expected robustness. I. I NTRODUCTION We consider the problem of controlling a system with unknown, stochastic dynamics, i.e., a “black box”, to achieve a complex, time-sensitive task. An example is controlling a noisy aerial vehicle with partially known dynamics to visit a pre-specified set of regions in some desired order while avoiding hazardous areas. We consider tasks given as temporal logic (TL) formulae [2], an extension of first order Boolean logic that can be used to reason about how the state of a system evolves over time. When a stochastic dynamical model is known, there exist algorithms to find control policies for maximizing the probability of achieving a given TL specification [18], [17], [23], [13] by planning over stochastic abstractions [12], [1], [17]. However, only a handful of papers have considered the problem of enforcing TL specifications to a system with unknown dynamics. Passive [3] and active [21], [9] reinforcement learning has been used to find a policy that maximizes the probability of satisfying a given linear temporal logic formula. In this paper, in contrast to the above works on reinforcement learning which use propositional temporal logic, we use signal temporal logic (STL), a rich predicate logic that can be used to describe tasks involving bounds on physical parameters and time intervals [7]. An example of such a *This work was partially supported at Boston University by ONR grant number N00014-14-1-0554 and by the NSF under grant numbers NRI1426907, CMMI-1400167, and CNS-1035588. 1 Author is with Mechanical Engineering and Electrical Engineering, Georgia Institute of Technology, Atlanta, GA, USA. austinjones@gatech.edu 2 Authors are with Mechanical Engineering, Boston University, Boston, MA, USA. {cbelta,daksaray}@bu.edu 3 Author is with Mechanical and Aerospace Engineering, University of California Davis, Davis, CA, USA. zdkong@ucdavis.edu 4 Author is with Aeronautics and Astronautics, Stanford University, Stanford, CA, USA. schwager@stanford.edu 5 Author is with Systems Engineering, Boston University, Boston, MA, USA. property is “Within t1 seconds, a region in which y is less than π1 is reached, and regions in which y is larger than π2 are avoided for t2 seconds.” STL admits a continuous measure called robustness degree that quantifies how strongly a given sample path exhibits an STL property as a real number rather than just providing a yes or no answer [8], [7]. This measure enables the use of continuous optimization methods to solve inference (e.g., [10], [11], [14]) or formal synthesis problems (e.g., [20]) involving STL. One of the difficulties in solving problems with TL formulae is the history-dependence of their satisfaction. For instance, if the specification requires visiting region A before region B, whether or not the system should steer towards region B depends on whether or not it has previously visited region A. For linear temporal logic (LTL) formulae with time-abstract semantics, this history-dependence can be broken by translating the formula to a deterministic Rabin automaton (DRA), a model that automatically takes care of the history-dependent “book-keeping” [4], [21]. In the case of STL, such a construction is difficult due to the timebounded semantics. We circumvent this problem by defining a fragment of STL such that the progress towards satisfaction is checked with some finite number τ of state measurements. We thus define an MDP, called the τ-MDP whose states correspond to the τ-step history of the system. The inputs to the τ-MDP are a finite collection of control actions. We use a reinforcement learning strategy called Q-learning [24], in which a policy is constructed by taking actions, observing outcomes, and reinforcing actions that improve a given reward. Our algorithms either maximize the probability of satisfying a given STL formula, or maximize the expected robustness with respect to the given STL formula. These procedures provably converge to the optimal policy for each case. Furthermore, we propose that maximizing expected robustness is typically more effective than maximizing probability of satisfaction. We prove that in certain cases, the policy that maximizes expected robustness also maximizes the probability of satisfaction. However, if the given specification is not satisfiable, the probability maximization will return an arbitrary policy, while the robustness maximization will return a policy that gets as close to satisfying the policy as possible. Finally, we demonstrate through simulation case studies that the policy that maximizes expected robustness in some cases gives better performance in terms of both probability of satisfaction and expected robustness when fewer training episodes are available. II. S IGNAL T EMPORAL L OGIC (STL) STL is defined with respect to continuously valued signals. Let F (A, B) denote the set of mappings from A to B and define a signal as a member of F (N, Rn ). For a signal s, we denote st as the value of s at time t and st1 :t2 as the sequence of values st1 st1 +1 . . . st2 . Moreover, we denote s[t] as the suffix 0 from time t, i.e., s[t] = {st |t 0 ≥ t}. In this paper, the desired mission specification is described by an STL fragment with the following syntax : φ ψ := F[0,T ] ψ|G[0,T ] ψ, := f (s) ≤ d|¬ϕ|ϕ1 ∧ ϕ2 |ϕ1U[a,b) ϕ2 , (1) where T is a finite time bound, φ , ψ, and ϕ are STL formulae, a and b are non-negative real-valued constants, and f (s) < d is a predicate where s is a signal, f ∈ F (Rn , R) is a function, and d ∈ R is a constant. The Boolean operators ¬ and ∧ are negation (“not”) and conjunction (“and”), respectively. The other Boolean operators are defined as usual. The temporal operators F, G, and U stand for “Finally (eventually)” , “Globally (always)”, and “Until”, respectively. Note that in this paper, we use a discrete-time version of STL rather than the typical continuous-time formulation. The semantics of STL is recursively defined as s[t] |= ( f (s) < d) s[t] |= φ1 ∧ φ2 s[t] |= φ1 ∨ φ2 s[t] |= G[a,b) φ iff iff iff iff s[t] |= F[a,b) φ iff s[t] |= φ1U[a,b) φ2 iff f (st ) < d s[t] |= φ1 and s[t] |= φ2 s[t] |= φ1 or s[t] |= φ2 s[t 0 ] |= φ ∀t 0 ∈ [t + a,t + b) ∃t 0 ∈ [t + a,t + b) s.t. s[t 0 ] |= φ ∃t 0 ∈ [t + a,t + b) s.t. s[t 00 ] |= φ1 ∀t 00 ∈ [t,t 0 ) and s[t 0 ] |= φ2 . In plain English, F[a,b) φ means “within a and b time units in the future, φ is true,” G[a,b) φ means “for all times between a and b time units in the future φ is true,” and φ1U[a,b) φ2 means “There exists a time c between a and b time units in the future such that φ1 is true until c and φ2 is true at c.” STL is equipped with a robustness degree [8], [7] (also called “degree of satisfaction”) that quantifies how well a given signal s satisfies a given formula φ . The robustness is calculated recursively according to the quantitative semantics r(s, ( f (s) < d),t) r(s, φ1 ∧ φ2 ,t) r(s, φ1 ∨ φ2 ,t) r(s, G[a,b) φ ,t) = d − f (st )  = min r(s, φ1 ,t), r(s, φ2 ,t)  = max r(s, φ1 ,t), r(s, φ2 ,t) = min r(s, φ ,t 0 ) t 0 ∈[t+a,t+b) r(s, φ ,t 0 ),  r(s, φ1U[a,b) φ2 ,t) = supt 0 ∈[t+a,t+b] min r(φ2 , s,t 0 ),  inft 00 ∈[t,t 0 ] r(φ1 , s,t 00 ) . r(s, F[a,b) φ ,t) = Similar to [6], let hrz(φ ) denote the horizon length of an STL formula φ . The horizon length is the required number of samples to resolve any (future or past) requirements of φ . The horizon length can be computed recursively as hrz(p) hrz(¬φ ) hrz(φ1 ∨ φ2 ) hrz(φ1 ∧ φ2 ) hrz(φ1U[a,b] φ2 ) = 0, = hrz(φ ), = max{hrz(φ1 ), hrz(φ2 )}, = max{hrz(φ1 ), hrz(φ2 )}, = max{hrz(φ1 ) + b − 1, hrz(φ2 ) + b}, (2) where φ , φ1 , φ2 are STL formulae. Example 1: Consider the robot navigation problem illustrated in Figure 1(a). The specification is “Visit Regions A or B and visit Regions C or D every 4 time unitsalong a mission T horizon of 100 units.” Let s(t) = x(t) y(t) , where x and y are the x− and y− components of the signal s. This task can be formulated in STL as φ= G[0,100)  F[0,4) ψ= ∧F[0,4) ψ (x > 2 ∧ x < 3 ∧ y > 2 ∧ y < 3)  ∨(x > 4 ∧ x < 5 ∧ y > 4 ∧ y < 5) (x > 2 ∧ x < 3 ∧ y > 4 ∧ y < 5)   ∨(x > 4 ∧ x < 5 ∧ y > 2 ∧ y < 3) . (3) Figure 1(a) shows two trajectories of the system beginning at the initial location of R and ending in region C that each satisfies the inner specification ψ given in (3). Note that s2 barely satisfies ψ, as it only slightly penetrates region A, while s1 appears to satisfy it strongly, as it passes through the center of region A and the center of region C. The robustness degrees confirm this: r(s1 , ψ) = 0.3 while r(s2 , ψ) = 0.05. The horizon length of the inner specification ψ of (3) is  hrz(ψ) = max 4 + max(0, 0), 4 + max(0, 0) = 4. III. M ODELS FOR R EINFORCEMENT L EARNING For a system with unknown and stochastic dynamics, a critical problem is how to synthesize control to achieve a desired behavior. A typical approach is to discretize the state and action spaces of the system and then use a reinforcement learning strategy, i.e., by learning how to take actions through trial and error interactions with an unknown environment [22]. In this section, we present models of systems that are amenable for reinforcement learning to enforce temporal logic specifications. We start with a discussion on the widely used LTL before introducing the particular model that we will use for reinforcement learning with STL. max t 0 ∈[t+a,t+b) We use r(s, φ ) to denote r(s, φ , 0). If r(s, φ ) is large and positive, then s would have to change by a large deviation in order to violate φ . Similarly, if r(s, φ ) is large in absolute value and negative, then s strongly violates φ . A. Reinforcement Learning with LTL One approach to the problem of enforcing LTL satisfaction in a stochastic system is to partition the statespace and design control primitives that can (nominally) drive the system from one region to another. These controllers, the stochastic dynamical model of the system, and the quotient obtained from the partition are used to construct a Markob decision process (MDP), called a bounded parameter MDP or BMDP, whose transition probabilities are interval-valued [1]. These BMDPs can then be composed with a DRA constructed from a given LTL formula to form a product BMDP. Dynamic programming (DP) can then be applied over this product MDP to generate a policy that maximizes the probability of satisfaction. Other approaches to this problem include aggregating the states of a given quotient until an MDP can be constructed such that the transition probability can be considered constant (with bounded error) [16]. The optimal policy can be computed over the resulting MDP using DP [15] or approximate DP, e.g., actor-critic methods [5]. Thus, even when the stochastic dynamics of a system are known and the logic that encodes constraints has timeabstract semantics, the problem of constructing an abstraction of the system that is amenable to control policy synthesis is difficult and computationally intensive. Reinforcement learning methods for enforcing LTL constraints make the assumption that the underlying model under control is an MDP [3], [21], [9]. Implicitly, these procedures compute a frequentist approximation of the transition probabilities that asymptotically approaches the true (unknown) value as the number of observed sample paths increases. Since this algorithm doesn’t explicitly rely on any a priori knowledge of the transition probability, it could be applied to an abstraction of a continuous-space system that is built from a propositionpreserving partition. In this case, the uncertainty on the motion described by intervals in the BMDP that is reduced via computation would instead be described by complete ignorance that is reduced via learning. The resulting policy would map regions of the statespace to discrete actions that will optimally drive the real-valued state of the system to satisfy the given LTL specification. Different partitions will result in different policies. In the next section, we extend the above observation to derive a discrete model that is amenable for reinforcement learning for STL formulae. B. Reinforcement learning with STL: τ-MDP In order to reduce the search space of the problem, we partition the statespace of the system to form the quotient graph G = (Σ, E), where Σ is a set of discrete states corresponding to the regions of the statespace and E corresponds to the set of edges. An edge between two states σ and σ 0 exists in E if and only if σ and σ 0 are neighbors (share a boundary) in the partition. In our case, since STL has time-bounded semantics, we cannot use an automaton with a time-abstract acceptance condition (e.g., a DRA) to check its satisfaction. In general, whether or not a given trajectory s0:T satisfies an STL formula would be determined by directly using the qualitative semantics. The STL fragment (1) consists of a sub-formula ψ with horizon length hrz(ψ) = τ that is modified by either a F[0,T ) or G[0,T ) temporal operator. This means that in order to update at time t whether or not the given formula φ has been satisfied or violated, we can use the τ previous state values st−τ+1:t For this reason, we choose to learn policies over an MDP with finite memory, called a τ-MDP, whose states correspond to sequences of length τ of regions in the defined partition. Example 1 (cont’d): Let the robot evolve according to the discrete-time Dubins dynamics xt+1 = xt + vδ t cos θ t yt+1 = yt + vδ t sin θ t , (4) where xt and yt are the x and y coordinates of the robot at time t, v is its forward speed, δ t is a time interval, and the robot’s orientation is given by θ t . The control primitives in this case are given by Act = {up, down, le f t, right} which correspond to the directions on the grid. Each (noisy) control primitive induces a distribution with support θdes ± ∆θ , where θdes is the orientation where the robot is facing the desired cell. When a motion primitive is enacted, the robot rotates to an angle θ t drawn from the distribution and moves along that direction for δ t time units. The partition of the statespace and the induced quotient G are shown in Figures 1(b) and 1(c), respectively. A state σ(i, j) in the quotient (Figure 1(c)) represents the region in the partition of the statespace (Figure 1(b)) with the point (i, j) in the lower left hand corner. Definition 1: Given a quotient of a system G = (Σ, E) and a finite set of actions Act, a τ-Markov Decision Process (τMDP) is a tuple Mτ = hS , Act, Pi, where • S ⊆ (Σ ∪ ε)τ is the set of finite states, where ε is the empty string. Each state στ ∈ S corresponds to a τ−horizon (or shorter) path in G . Shorter paths of length n < τ (representing the case in which the system has not yet evolved for τ time steps) have ε prepended τ − n times. • P : S × Act × S → [0, 1] is a probabilistic transition relation. P(στ , a, στ0 ) can be positive only if the first τ − 1 states of στ0 are equal to the last τ − 1 states of στ and there exists an edge in G between the final state of στ and the final state of στ0 . We denote the state of the τ-MDP at time t as στt . Definition 2: Given a trajectory st−τ+1:t of the original system, we define its induced trace in the τ-MDP Mτ as Tr(st−τ+1:t ) = σ t−τ+1:t = στt . That is, στt corresponds to the previous τ regions of the statespace that the state has resided in from time t − τ + 1 to time t. The construction of a τ-MDP from a given quotient and set of actions is straightforward. The details are omitted due to length constraints. We make the following key assumptions on the quotient and the resulting τ-MDP: • The defined control actions Act will drive the system either to a point in the current region or to a point in a neighboring region of the partition, e.g.,no regions are “skipped”. • The transition relation P is Markovian. For every τ state στt , there exists a continuous set of sample paths {st−τ+1:t } whose traces could be that state. The dynamics of the underlying system produces an unknown distribution p(st−τ+1:t |Tr(st−τ+1:t ) = στt ). Since the robustness degree is a function of sample paths of length τ and an STL formula ψ, we can define a distribution p(r(st−τ+1:t , ψ)|Tr(st−τ+1:t ) = στt ). 6 s2 5 C 5 B 4 y (m) y (m) 6 s1 3 C B A D 4 3 A D 2 2 R 1 1 R 2 3 4 5 6 1 1 2 x (m) 3 4 5 6 x (m) (a) (b) (c) Fig. 1: (a) Example of robot navigation problem. (b) Partitioned space. (c) Subsection of the quotient. Example 1 (cont’d): Figure 2 shows a portion of the τMDP constructed from Figure 1. The states in M4 are labeled with the corresponding sample paths of length 4 in G . The green and blue σ ’s in the states in M4 correspond to green and blue regions from Figure 1. IV. P ROBLEM F ORMULATION In this paper, we address the following two problems. Problem 1 (Maximizing Probability of Satisfaction): Let Mτ be a τ-MDP as described in the previous section. Given an STL formula φ with syntax (1), find a policy ∗ ∈ F (S × N, Act) such that µmp ∗ µmp = arg max Prs0:T [s0:T |= φ ] (5) Problem 2 (Maximizing Average Robustness): Let Mτ be as defined in Problem 1. Given an STL formula φ with syntax ∗ ∈ F (S , Act) such that (1), find a policy µmr ∗ = µmr µ∈F (S ×N,Act) arg max Es0:T [r(s0:T , φ )] µ∈F (S ×N,Act) (6) ∗ . Furthermore, if φ same probability of satisfaction as µmp is not satisfiable, any arbitrary policy could be a solution to Problem 1, as all policies will result in a satisfaction probability of 0. If φ is unsatisfiable, Problem 2 yields a solution that attempts to get as close as possible to satisfying the formula, as the optimal solution will have an average robustness value that is least negative. The forms of the objective functions differ for the two different types of formula, φ = F[0,T ) ψ and φ = G[0,T ) ψ. Case 1: Consider an STL formula φ = F[0,T ) ψ. In this case, the objective function in (5) can be rewritten as Prs0:T [∃t = τ, . . . , T − τ s.t. st−τ+1:t |= ψ], (7) and the objective function in (6) can be rewritten as Es0:T [ max r(st−τ+1:t , ψ)]. t=τ,...,T −τ (8) Case 2: Now, consider an STL formula φ = G[0,T ) ψ. The objective function in (5) can be rewritten as Prs0:T [∀t = τ, . . . , T − τ, st−τ:t |= ψ], (9) and the objective function in (6) can be rewritten as Es0:T [ min t=τ,...,T −τ Fig. 2: Part of the τ-MDP constructed from the robot navigation MDP shown in Figure 1 Problems 1 and 2 are two alternate solutions to enforce a given STL specification. The policy found by Problem 1, ∗ , maximizes the chance that φ will be satisfied, while i.e. µmp ∗ , drives the system the policy found by Problem 2, i.e. µmr to satisfy φ as strongly as possible on average. Problems similar to (5) have already been considered in the literature (e.g., [9], [21]). However, Problem 2 is a novel formulation that provides some advantages over Problem 1. As we show ∗ achieves the in Section V, for some special systems, µmr r(st−τ+1:t , ψ)]. (10) V. M AXIMIZING E XPECTED ROBUSTNESS VS . M AXIMIZING P ROBABILITY OF S ATISFACTION Here, we demonstrate that the solution to (6) subsumes the solution to (5) for a certain class of systems. Due to space limitations, we only consider formulae of the type φ = F[0,t) ψ. Let Mτ = (Sτ , Pτ , Act) be a τ-MDP. For simplicity, we make the following assumption on Sτ . Assumption 1: For every state στ ∈ Sτ , either every trajectory st+τ−1:t whose trace is στ satisfies ψ, denoted στ |= ψ, or every trajectory that passes through the sequence of regions associated with στ does not satisfy ψ, denoted στ 6|= ψ. Assumption 1 can be enforced in practice during partitioning. We define the set A = {στ ∈ Sτ |στ |= ψ}. (11) Definition 3: The signed graph distance of a τ−state στi ∈ S to a set X ⊆ S is  l(στi , στj ) στi 6∈ X   min j σ ∈X τ (12) d(στi , X) = j i i   − j min l(στ , στ ) στ ∈ X στ ∈Sτ \X where l(στi , στj ) is the length of the shortest path from στi to στj . We also make the following two assumptions. Assumption 2: For any signal st−τ+1:t such that Tr(st−τ+1:t ) ∈ Sτ , let r(st−τ+1:t , ψ) be bounded from below by Rmin and from above by Rmax . Assumption 3: Let Dστ (δ ) = Pr[r(st:t+τ , ψ) > t:t+τ δ |Tr(s ) = στ ]. For any two states, d(στi , A) < d(στj , A) ⇒ Dστi (δ ) ≥ Dσ j (δ ) ∀δ ∈ [Rmin , Rmax ] τ (13) ∗ and µ ∗ over M as Now we define the policies µmp τ mr h i ∗ = µmp arg max Prστ0:T ∃t ∈ [0, T ] s.t. στt |= ψ (14) µ∈F (S ×N,Act) ∗ = µmr arg max Eστ0:T h µ∈F (S ×N,Act) i max r(στt , ψ) t=0,...,T (15) Proposition 1: If Assumptions 1,2, and 3 hold, then the ∗ maximizes the expected probability of satisfacpolicy µmr tion. Proof: Given any policy µ, its associated reachability probability can be defined as " # Prµ (στ ) = Prµ στ = arg min d(στ , A) . (16) στ0 ,...,στT −τ Let I(.) be the indicator function such that I(B) is 1 if B is true and 0 if B is false. By definition, the expected probability of satisfaction for a given policy µ is   EPS(µ) = E I(∃0 < k < T − τ s.t. στk |= ψ) = ∑ Prµ (στ )I(στ ∈ A) (17) στ ∈Sτ = ∑ Prµ (στ ). στ ∈A Also, the expected robustness of policy µ becomes   ER(µ) = E max r(στk , ψ)  −τ  R k=0,...,T = 0Rmax Pr max r(στk , ψ) > x dx+ k=0,...,T −τ   R0 max r(στk , ψ) > x dx Rmin 1 − Pr  k=0,...T −τ  R = 0Rmax Pr max r(στk , ψ) > x dx−  k=0,...,T −τ k  R0 max r(στ , ψ) > x dx − Rmin Rmin Pr k=0,...,T −τ = R Rmax 0 R0 Rmin = ∑ Prµ (στ )Dστ (x)dx− στ ∈Sτ ∑ Prµ (στ )Dστ (x)dx − Rmin στ ∈Sτ ∑ Prµ (στ ) R Rmax ∑ Prµ (στ ) R0 στ ∈A στ 6∈A 0 Dστ (x)dx− Rmin Dστ (x)dx − Rmin . (18) Since Rmin is constant, maximizing (18) is equivalent to  R max ∑ Prµ (στ ) 0Rmax Dστ (x)dx µ στ ∈A  (19) R − ∑ Prµ (στ ) R0min Dστ (x)dx στ 6∈A Let p be the satisfaction probability such that p = ∑ Prµ (στ ). Then, we can rewrite the objective in (19) as στ ∈A   p ∑ Prµ στ = arg min d(στ , A)|στ ∈ A J(µ) = στ ∈A στ0 ,...,στT −τ R Rmax × 0 Dστ (x)dx  −(1 − p)Prµ στ = arg min d(στ , A)|στ στ0 ,...,στT −τ R × R0min Dστ (x)dx.  6∈ A (20) Now, ∂ J(µ) ∂p   ∑ Prµ στ = arg min d(στ , A)|στ ∈ A = στ ∈A στ0 ,...,στT −τ R Rmax × 0  Dστ (x)dx +Prµ στ = arg min d(στ , A)|στ στ0 ,...,στT −τ R0 × Rmin Dστ (x)dx  6∈ A > 0 (21) Thus, any policy µ increasing J(µ) also leads to an increase in p. Since increasing J(µ) is equivalent to increasing ER(µ), then we can conclude that the policy that maximizes the robustness also achieves the maximum satisfaction probability. VI. C ONTROL S YNTHESIS TO M AXIMIZE ROBUSTNESS A. Policy Generation through Q-Learning Since we do not know the dynamics of the system under control, we cannot a priori predict how a given control action will affect the evolution of the system and hence its progress towards satisfying/dissatisfying a given specification. Thus, we use the well-known paradigm of reinforcement learning to learn policies to solve Problems 1 and 2. In reinforcement learning, the system takes actions and records the rewards associated with the state-action pair. These rewards are then used to update a feedback policy that maximizes the expected gathered reward. In our cases, the rewards that we collect over Mτ are related to whether or not ψ is satisfied (Problem 1) or how robustly ψ is satisfied/violated (Problem 2). Our solutions to these problems rely on a Q-learning formulation [24]. Let R(στt , a) be the reward collected when action a ∈ Act was taken in state στt ∈ S . Define the function Q : S × Act × N as Q(στT −t , a,t) = R(στT −t , a)+  max E ∑Tl=T −t−1 R(στl , µl (στl )) = {µl ∈}Tl=T −t−1 R(στT −t , a) + max Q(στT −t+1 , a0 ,t − 1). a0 ∈Act (22) For an optimization problem with a cumulative objective function of the form ∑ R(στl , al ), (23) l=τ:T the optimal policy µ ∗ ∈ F (S , Act) can be found by µ ∗ (στt , T − t) = arg maxQ(στt , a, T − t). a∈Act (24) Applying the update rule C. Convergence of Batch Q-learning Qt+1 (στt , at , T − t) = Given a formula of the form φ = F[0,T ) ψ and an objective of maximizing the expected robustness (Problem 2), we will show that applying Algorithm 1 converges to the optimal solution. The other three cases discussed in Section IV can be proven similarly. The following analysis is based on [19]. The optimal Q function derived from (8) is (1 − αt )Qt (στt , at , T − t)+ αt [R(στt , at ) + γ max Qt (στt+1 , a0 )] a0 ∈A (25) where 0 < γ < 1 will cause Qt converges to Q w.p. 1 as t goes to infinity [24]. B. Batch Q-learning We cannot reformulate Problems 1 and 2 into the form (23) (see Section IV). Thus, we propose an alternate Q−learning formulation, called batch Q-learning , to solve these problems. Instead of updating the Q-function after each action is taken, we wait until an entire episode s[0:T ) is completed before updating the Q-function. The batch Q-learning procedure is summarized in Algorithm 1. Algorithm 1 The Batch Q learning algorithm. function BatchQLearn(Sys,probType,Nep ,φ ) Q ← RandomInitialization µ ← InitializePolicy(Q) for n = 1 to Nep do s[0,T ) ←Simulate(Sys, µ) Q ← UpdateQFunction(Q,µ,s0:T ,φ ,probType) µ ← UpdatePolicy(µ, Q) return Q,µ Algorithm 2 Function used to update Q function used in Algorithm 1. function UpdateQFunction(Q,µ,s0:T ,φ ,γ,probType) for n = T − τ − 1 to τ do if probType is MaximumProbability then Qtmp (στn , µ(στn , T − n)) ← max(I(sn−τ+1:n |= φ ), γQtmp (στn+1 , µ(στn+1 , T − n − 1)) else Qtmp (στn , µ(στn , T − n)) ← max(r(sn−τ+1:n , φ ), γQtmp (στn+1 , µ(στn+1 , T − n − 1)) Qnew (στn , µ(στn , T − n) ← (1 − α)Qtmp (στn , µ(στn , T − n) +αQ(στn , µ(στn , T − n) return Qnew The Q function is initialized to random values and µ is computed from the initial Q values. Then, for Nep episodes, the system is simulated using µ. Randomization is used to encourage exploration of the policy space. The observed trajectory is then used to update the Q function according to Algorithm 2. The new value of the Q function is used to update the policy µ. For compactness, Algorithm 2 as written only covers the case φ = F[0,T ) ψ. The case in which φ = G[0,T ) ψ can be addressed similarly. Q∗ (στk , a, T − k) = ∑σ t+1 P(στt , a, σ t+1 ) max(r(στt , ψ), τ max γQ∗ (στt+1 , b, T − t − 1)). b∈Act (26) This gives the following convergence result. Proposition 2: The Q-learning rule given by Qk+1 (στt , at , T − t) = (1 − αk )Qk (στt , at , T − t) +αk max(r(στt , ψ), max γQk (στt+1 , b, T − t − 1)), b∈Act (27) converges to the optimal Q function (26) if the sequence ∞ ∞ 2 {αk }∞ k=0 is such that ∑k=0 αk = ∞ and ∑k=0 (αk ) < ∞. Proof: (Sketch) The proof of Proposition 2 relies primarily on Proposition 3. Once this is established, the rest of the proof varies only slightly from the presentation in [19]. Note that in this case, k ranges over the number of episodes and t ranges over the time coordinate of the signal. Proposition 3: The optimal Q-function given by (26) is a fixed point of the contraction mapping H where (Hq)(στt , a, T − t) = ∑σ t+1 P(στt , a, σ t+1 ) max(r(στt , ψ), τ γ max q(στt+1 , b, T − t − 1)). b∈Act (28) Proof: By (26), if H is a contraction mapping, then Q∗ is a fixed point of H. Consider = max ∑ P(στ , a, στ0 )(max(r(στ , ψ), ||Hq1 − Hq2 ||∞ στ ,a σ 0 τ γ max q1 (στ0 , b, T − t − 1)) b∈Act − max(r(στ , ψ), γ q2 (στ0 , b, T − t − 1)). b∈Act (29) Define q∗j (t) = max γq1 (στ0 , b,t). b∈Act (30) WOLOG let q∗1 (T − t − 1) > q∗2 (T − t − 1). Define R(στ0 ) = (max(r(στ , ψ), q∗1 (T − t − 1) − max(r(στ , ψ), q∗2 (T − t − 1)) (31) There exist 3 possibilities for the value of R(στ ). r(στ , ψ) > q∗1 (T − t − 1) > q∗2 (T − t − 1) . ⇒ R(στ0 ) = 0 (32a) q∗1 (T − t − 1) > r(στ , ψ) > q∗2 (T − t − 1) ⇒ R(στ0 ) = ||q∗1 (T − t − 1) − r||∞ < γ||q1 − q2 ||∞ (32b) q∗1 (T − t − 1) > q∗2 (T − t − 1) > r(στ , ψ) ⇒ R(στ0 ) < γ||q1 − q2 ||∞ . (32c) Trained Performance, µmp Trained Performance, µmr Trained Performance, µmp Trained Performance, µmr 80 80 80 80 60 60 60 60 40 20 20 0 0 40 0.1 0 0 0.2 0.3 0.4 Robustness Count 100 Count 100 Count 100 40 0.1 (a) 0 −1 0.2 0.3 0.4 Robustness −0.5 0 Robustness (b) 0 −1 0.5 (b) 5 5 4 4 4 4 3 3 3 3 y y y 5 2 2 2 2 1 1 1 1 0 0 0 0 0 0 2 x 3 4 5 1 (c) 2 x 3 4 5 (d) Thus, this means that R(στ0 ) ≤ γ||q1 − q2 ||∞ ∀στ0 . Hence, = maxστ ,a ∑στ0 P(στ , a, στ0 )R(στ0 ) ≤ maxστ ,a ∑στ0 P(στ , a, στ0 )γ||q1 − q2 ||∞ ≤ γ||q1 − q2 ||∞ . (33) Therefore, H is a contraction mapping. ||Hq1 − Hq2 ||∞ VII. C ASE S TUDY We implemented the batch-Q learning algorithm (Algorithm 1) and applied it to two case studies that adapt the robot navigation model from Example 1. For each case study, we solved Problems 1 and 2 and compared the performance of the resulting policies. All simulations were implemented in Matlab and performed on a PC with a 2.6 GHz processor and 7.8 GB RAM. A. Case Study 1: Reachability First, we consider a simple reachability problem. The given STL specification is φcs1 = F[0,20) (F[0,1) ϕblue ∧ G[1,4) ¬ϕblue ), 1 2 x 3 4 5 0 0 1 (c) Fig. 3: Comparison of Policies for Case Study 1. Histogram of robustness values for trained policies for solution to (a) Problem 1 and (b) Problem 2. Trajectory generated from policies for solution to (c) Problem 1 and (d) Problem 2. 0.5 Example Trajectory, µmr Example Trajectory, µmp 5 1 −0.5 0 Robustness (a) Example Trajectory, µmr Example Trajectory, µmp 40 20 20 y Count 100 2 x 3 4 5 (d) Fig. 4: Comparison of Policies for Case Study 2.. The subplots have the same meaning as in Figure 3. generated from the system simulated using each of the trained policies after learning has completed, i.e. without the randomization that is used during the learning phase. Note that both trained policies satisfied the specification with probability 1. The performance of the two algorithms are very similar, as the mean robustness is 0.2287 with standard deviation 0.1020 for probability maximization and 0.2617 and 0.1004,resp., for robustness maximization. In the second row, we see trajectories simulated by each of the trained policies. The similarity of the solutions in this case study is not surprising. If the state of the system is deep within A or B, then the probability that it will remain inside that region in the next 3 time steps (satisfy φ ) is higher than if it is at the edge of the region. Trajectories that remain deeper in the interior of region A or B also have a high robustness value. Thus, for this particular problem, there is an inherent coupling between the policies that satisfy the formula with high probability and those that satisfy the formula as robustly as possible on average. B. Case Study 2: Repeated Satisfaction (34) where ϕblue is the STL subformula corresponding to being in a blue region. In plain English, (34) can be stated as “Within 20 time units, reach a blue region and then don’t revisit a blue region for 4 time units.” The results from applying Algorithm 1 are summarized in Figure 3. We used the parameters γ = 1, αt = 0.95, Nep = 300 and ε t = 0.995t , where ε t is the probability at iteration t of selecting an action at random 1 . Constructing the τ-MDP took 17.2s. Algorithm 1 took 161s to solve Problem 1 and 184s to solve Problem 2. The two approaches perform very similarly. In the first row, we show a histogram of the robustness of 500 trials 1 Although the conditions γ < 1 and ∞ α 2 < ∞ are technically required ∑k=0 k to prove convergence, in practice these conditions can be relaxed without having adverse effects on learning performance In this second case study, we look at a problem involving repeatedly satisfying a condition finitely many times. The specification of interest is φcs2 = G[0,12) (F[0,4) (ϕblue ) ∧ F[0,4) (ϕgreen )), (35) In plain English, (35) is “Ensure that every 4 time units over a 12 unit interval, a green region and a blue region is entered.” Results from this case study are shown in Figure 4. We used the same parameters as listed in Section VII-A, except Ne p = 1200,α = 0.4, and ε t = 0.9t . Constructing the τ-MDP took 16.5s. Applying Algorithm 1 took 257.7s for Problem 1 and 258.3s for Problem 2. In the first row, we see that the solution to Problem 1 satisfies the formula with probability 0 while the solution to Problem 2 satisfies the formula with probability 1. At first, this seems counterintuitive, as Proposition 2 indicates that a policy that maximizes probability would achieve a probability of satisfaction at least as high as the policy that maximizes the expected robustness. However, this is only guaranteed with an infinite number of learning trials. The performance in terms of robustness is obviously better for the robustness maximization (mean 0.1052, standard deviation 0.0742) than for the probability maximization (mean -0.6432, standard deviation 0.2081). In the second row, we see that the maximum robustness policy enforces convergence to a cycle between two regions, while the maximum probability policy deviates from this cycle. The discrepancy between the two solutions can be explained by what happens when trajectories that almost satisfy (35) occur. If a trajectory that almost oscillates between a blue and green region every four seconds is encountered when solving Problem 1, it collects 0 reward. On the other hand, when solving Problem 2, the policy that produces the almost oscillatory trajectory will be reinforced much more strongly, as the resulting robustness is less negative. However, since the robustness degree gives “partial credit” for trajectories that are close to satisfying the policy, the reinforcement learning algorithm performs a directed search to find policies that satisfy the formula. Since probability maximization gives no partial credit, the reinforcement learning algorithm is essentially performing a random search until it encounters a trajectory that satisfies the given formula. Therefore, if the family of policies that satisfy the formula with positive probability is small, it will on average take the Q-learning algorithm solving Problem 1 a longer time to converge to a solution that enforces formula satisfaction. VIII. C ONCLUSIONS AND F UTURE W ORK In this paper, we presented a new reinforcement learning paradigm to enforce temporal logic specifications when the dynamics of the system are a priori unknown. In contrast to existing works on this topic, we use a logic (signal temporal logic) whose formulation is directly related to a system’s statespace. We present a novel, convergent Q-learning algorithm that uses the robustness degree, a continuous measure of how well a trajectory satisfies a formula, to enforce the given specification. In certain cases, robustness maximization subsumes the established paradigm of probability maximization and, in certain cases, robustness maximization performs better in terms of both probability and robustness under partial training. Future research includes formally connecting our approach to abstractions of linear stochastic systems. R EFERENCES [1] A. Abate, A. D’Innocenzo, and M. Di Benedetto. Approximate abstractions of stochastic hybrid systems. Automatic Control, IEEE Transactions on, 56(11):2688–2694, Nov 2011. [2] C. Baier and J.-P. Katoen. Principles of model checking, volume 26202649. MIT press Cambridge, 2008. [3] T. Brazdil, K. Chatterjee, M. Chmelik, M.k, V. Forejt, J. Kretinsky, M. Kwiatkowska, D. Parker, and M. Ujma. Verification of markov decision processes using learning algorithms. In F. Cassez and J.-F. Raskin, editors, Automated Technology for Verification and Analysis, volume 8837 of Lecture Notes in Computer Science, pages 98–114. Springer International Publishing, 2014. [4] X. C. Ding, S. L. Smith, C. Belta, and D. Rus. Optimal control of markov decision processes with linear temporal logic constraints. IEEE Transactions on Automatic Control, 59(5):1244–1257, 2014. [5] X. C. Ding, J. Wang, M. Lahijanian, I. Paschalidis, and C. Belta. Temporal logic motion control using actor-critic methods. In Robotics and Automation (ICRA), 2012 IEEE International Conference on, pages 4687–4692, May 2012. [6] A. Dokhanchi, B. Hoxha, and G. Fainekos. On-line monitoring for temporal logic robustness. In Runtime Verification, pages 231–246. Springer, 2014. [7] A. Donzé and O. Maler. Robust satisfaction of temporal logic over real-valued signals. Formal Modeling and Analysis of Timed Systems, pages 92–106, 2010. [8] G. E. Fainekos and G. J. Pappas. Robustness of temporal logic specifications for continuous-time signals. Theoretical Computer Science, 410(42):4262–4291, 2009. [9] J. Fu and U. Topcu. Probably approximately correct MDP learning and control with temporal logic constraints. CoRR, abs/1404.7073, 2014. [10] X. Jin, A. Donze, J. V. Deshmukh, and S. A. Seshia. Mining requirements from closed-loop control models. In Proceedings of the 16th international conference on Hybrid systems: computation and contro, pages 43–52, 2013. [11] A. Jones, Z. Kong, and C. Belta. Anomaly detection in cyber-physical systems: A formal methods approach. In IEEE Conference on Decision and Control (CDC), pages 848–853, 2014. [12] A. Julius and G. Pappas. Approximations of stochastic hybrid systems. Automatic Control, IEEE Transactions on, 54(6):1193–1203, June 2009. [13] M. Kamgarpour, J. Ding, S. Summers, A. Abate, J. Lygeros, and C. Tomlin. Discrete time stochastic hybrid dynamic games: Verification and controller synthesis. In Proceedings of the 50th IEEE Conference on Decision and Control and European Control Conference, pages 6122–6127, 2011. [14] Z. Kong, A. Jones, A. Medina Ayala, E. Aydin Gol, and C. Belta. Temporal logic inference for classification and prediction from data. In Proceedings of the 17th international conference on Hybrid systems: computation and control, pages 273–282. ACM, 2014. [15] M. Lahijanian, S. Andersson, and C. Belta. Temporal logic motion planning and control with probabilistic satisfaction guarantees. Robotics, IEEE Transactions on, 28(2):396–409, April 2012. [16] M. Lahijanian, S. B. Andersson, and C. Belta. Approximate markovian abstractions for linear stochastic systems. In Proc. of the IEEE Conference on Decision and Control, pages 5966–5971, Maui, HI, USA, Dec. 2012. [17] M. Lahijanian, S. B. Andersson, and C. Belta. Formal verification and synthesis for discrete-time stochastic systems. IEEE Transactions on Automatic Control, 6(8):2031–2045, 2015. [18] R. Luna, M. Lahijanian, M. Moll, and L. E. Kavraki. Asymptotically optimal stochastic motion planning with temporal goals. In Workshop on the Algorithmic Foundations of Robotics, Istanbul, Turkey, 03/08/2014 2014. [19] F. S. Melo. Convergence of q-learning: a simple proof. http://users.isr.ist.utl.pt/ mtjspaan/readingGroup/ProofQlearning.pdf. [20] V. Raman, A. Donze, M. Maasoumy, R. M. Murray, A. SangiovanniVincentelli, and S. A. Seshia. Model predictive control with signal temporal logic specifications. In Proceedings of IEEE Conference on Decision and Control (CDC), pages 81–87, 2014. [21] D. Sadigh, E. S. Kim, S. Coogan, S. S. Sastry, and S. A. Seshia. A learning based approach to control synthesis of markov decision processes for linear temporal logic specifications. CoRR, abs/1409.5486, 2014. [22] R. S. Sutton and A. G. Barto. Reinforcement learning: An introduction, volume 1. MIT press Cambridge, 1998. [23] M. Svorenova, J. Kretı́nský, M. Chmelik, K. Chatterjee, I. Cerná, and C. Belta. Temporal logic control for stochastic linear systems using abstraction refinement of probabilistic games. In Hybrid Systems Computation and Control (HSCC) 2015, volume abs/1410.5387, 2015. (To appear). [24] J. N. Tsitsiklis. Asynchronous stochastic approximation and qlearning. Machine Learning, 16(3):185–202, 1994.
3cs.SY
BATCHED QR AND SVD ALGORITHMS ON GPUS WITH APPLICATIONS IN HIERARCHICAL MATRIX COMPRESSION arXiv:1707.05141v1 [cs.MS] 13 Jul 2017 WAJIH HALIM BOUKARAM1 , GEORGE TURKIYYAH2 , HATEM LTAIEF1 , AND DAVID E. KEYES1 Abstract. We present high performance implementations of the QR and the singular value decomposition of a batch of small matrices hosted on the GPU with applications in the compression of hierarchical matrices. The one-sided Jacobi algorithm is used for its simplicity and inherent parallelism as a building block for the SVD of low rank blocks using randomized methods. We implement multiple kernels based on the level of the GPU memory hierarchy in which the matrices can reside and show substantial speedups against streamed cuSOLVER SVDs. The resulting batched routine is a key component of hierarchical matrix compression, opening up opportunities to perform H-matrix arithmetic efficiently on GPUs. 1. Introduction The singular value decomposition (SVD) is a factorization of a general m × n matrix A of the form A = U ΣV ∗ . U is an m × m orthonormal matrix whose columns Ui are called the left singular vectors. Σ is an m × n diagonal matrix whose diagonal entries σi are called the singular values and are sorted in decreasing order. V is an n × n orthonormal matrix whose columns Vi are called the right singular vectors. When m > n, we can compute a reduced form A = Û Σ̂V ∗ where Û is an m × n matrix and Σ̂ is an n × n diagonal matrix. One can easily obtain the full form from the reduced one by extending Û with (m − n) orthogonal vectors and Σ̂ with an (m − n) zero block row. Without any loss of generality, we will focus on the reduced SVD of real matrices in our discussions. The SVD of a matrix is a crucial component in many applications in signal processing and statistics as well as matrix compression, where truncating the (n − k) singular values that are smaller than some threshold gives us a rank-k approximation à of the matrix A. This matrix is the unique minimizer of the function fk (B) = ||A − B||F . In the context of hierarchical matrix operations, effective compression relies on the ability to perform the computation of large batches of independent SVDs of small matrices of low numerical rank. Randomized methods [1] are well suited for computing a truncated SVD of these types of matrices and are built on three computational kernels: the QR factorization, matrix-matrix multiplications and SVDs of smaller k × k matrices. Motivated by this task, we discuss the implementation of high performance batched QR and SVD kernels on the GPU, focusing on the more challenging SVD tasks. The remainder of this paper is organized as follows. Section 2 presents different algorithms used to compute the QR factorization and the SVD as well as some considerations when optimizing 1 Extreme Computing Research Center (ECRC), King Abdullah University of Science and Technology (KAUST), Thuwal 23955, Saudi Arabia. 2 Department of Computer Science, American University of Beirut (AUB), Beirut, Lebanon. E-mail addresses: wajihhalim.boukaram@kaust.edu.sa, gt02@aub.edu.lb, hatem.ltaief@kaust.edu.sa, david.keyes@kaust.edu.sa. 1 2 BATCHED QR AND SVD ALGORITHMS Algorithm 1 Householder QR procedure QR(A, Q, R) [Q, R] = [I, A] for i = 1 → A.n do v = house(R(i)) 5: R = (I − 2vv T )R 6: Q = Q(I − 2vv T ) 1: 2: 3: 4: for GPUs. Section 3 discusses the batched QR factorization and compares its performance with existing libraries. Sections 4, 5 and 6 discuss the various implementations of the SVD based on the level of the memory hierarchy in which the matrices can reside. Specifically, Section 4 describes the implementation for very small matrix sizes that can fit in registers, Section 5 describes the implementation for matrices that can reside in shared memory, and Section 6 describes the block Jacobi implementation for larger matrix sizes that must reside in global memory. Section 7 details the implementation of the batched randomized SVD routine. We then discuss some details of the application to hierarchical matrix compression in Section 8. We conclude and discuss future work in Section 9. 2. Background In this section we give a review of the most common algorithms used to compute the QR factorization and the SVD of a matrix as well as discuss some considerations when optimizing on the GPU. 2.1. QR Factorization The QR factorization decomposes an m × n matrix A into the product of an orthogonal m × m matrix Q and an upper triangular m × n matrix R [2]. We can also compute a reduced form of the decomposition where Q is an m × n matrix and R is n × n upper triangular. The most common QR algorithm is based on transforming A into an upper triangular matrix using a series of orthogonal transformations generated using Householder reflectors. Other algorithms such as the Gram-Schmidt or Modified Gram-Schmidt can produce the QR factorization by orthogonalizing a column with all previous columns; however, these methods are less stable than the Householder orthogonalization and the orthogonality of the resulting Q factor suffers with the condition number of the matrix. Another method is based on Givens rotations, where entries in the subdiagonal part of the matrix are zeroed out to form the triangular factor and the rotations are accumulated to form the orthogonal factor. This method is very stable and has more parallelism than the Householder method; however it is more expensive, doing about 50% more work, and it is more challenging to extract the parallelism efficiently on the GPU. For our implementation, we rely on the Householder method due to its numerical stability and simplicity. The method is described in pseudo-code in Algorithm 1. 2.2. SVD Algorithms Most implementations of the SVD are based on the two-phase approach popularized by Trefethen et al. [3], where the matrix A first undergoes bidiagonalization of the form A = QU BQTV where QU and QV are orthonormal matrices and B is a bidiagonal matrix. The matrix B is then diagonalized using some variant of the QR algorithm, the divide and conquer method or a combination of both to produce a decomposition B = UB ΣVBT . The complete SVD is then determined BATCHED QR AND SVD ALGORITHMS 3 as A = (QU UB )Σ(QV VB )T during the backward transformation. These methods require significant algorithmic and programming effort to become robust and efficient while still suffering from a loss of relative accuracy [4]. An alternative is the one-sided Jacobi method where all n(n−1)/2 pairs of columns are repeatedly orthogonalized in sweeps using plane rotations until all columns are mutually orthogonal. When the process converges (i.e., all columns are mutually orthogonal up to machine precision), the left singular vectors are the normalized columns of the modified matrix with the singular values as the norms of those columns. The right singular vectors can be computed either by accumulating the rotations or by solving a system of equations. Our application does not need the right vectors, so we omit the details of computing them. Algorithm 2 describes the one-sided Jacobi method. Since each pair of columns can be orthogonalized independently, the method is also easily parallelized. The simplicity and inherent parallelism of the method make it an attractive first choice for an implementation on the GPU. 2.3. GPU Optimization Considerations GPU kernels are launched by specifying a grid configuration which lets us organize threads into blocks and blocks into a grid. Launching a GPU kernel causes a short stall (as much as 10 microseconds) as the kernel is prepared for execution. This kernel launch overhead prevents kernels that complete their work faster than the overhead from executing in parallel, essentially serializing them. To overcome this limitation when processing small workloads, the work is batched into a single kernel call when possible [5, 6]. All operations can then be executed in parallel without incurring the kernel launch overhead, with the grid configuration used to determine thread work assignment. A warp is a group of threads (32 threads in current generation GPUs, such as the NVIDIA K40) within a block that executes a single instruction in lockstep, without requiring any explicit synchronization. The occupancy of a kernel tells us the ratio of active warps to the maximum number of warps that a multiprocessor can host. This metric is dependent on the amount of resources that a kernel uses, such as register and shared memory usage and kernel launch configuration, as well as the compute capability of the card ([7] for more details). While not a requirement for good performance [8], it is generally a good idea to aim for high occupancy. Memory on the GPU is organized into a hierarchy of memory spaces as shown in Figure 1. At the bottom, we have global memory which is accessible by all threads and is the most plentiful but the slowest memory. The next space of interest is the shared memory which is accessible only by threads within the same block and is configurable with the L1 cache to be at most 48KB per thread block on current generation GPUs. Shared memory is very fast and acts as a programmer controllable cache. Finally, we have the registers which are local to the threads. Registers are the fastest of all memory, but the total number of registers usable by a thread without performance implications is limited. If a kernel needs more registers than the limit, then registers are spilled to “local” memory, which is in the slow but cached global memory. Making good use of the faster memories and avoiding excessive Algorithm 2 One-sided Jacobi SVD while not converged do for each pair of columns Aij = [Ai , Aj ] do 3: G = ATij Aij 4: R = rot(G) 5: Aij = Aij R 1: 2: 4 BATCHED QR AND SVD ALGORITHMS Registers Shared Memory L1 Cache Read-Only Cache On-chip L2 Cache Global memory Off-chip Figure 1. The memory hierarchy of a modern GPU. accesses to the slower ones is key to good performance on the GPU. As such, it is common to use blocking techniques in many algorithms, where a block of data is brought in from global memory and processed in one of the faster memories. 2.4. Related Work Batched GPU routines for LU, Cholesky and QR factorizations have been developed in [5, 6, 9] using a block recursive approach which increases data reuse and leads to very good performance for relatively large matrix sizes. GPU routines optimized for computing the QR decomposition of very tall and skinny matrices are presented in [10] where they develop an efficient transpose matrix-vector computation that is employed with some minor changes in this work. GPU-CPU hybrid algorithms for batched SVD using Jacobi and bidiagonalization methods are introduced in [11] where pair generation for the Jacobi method and the solver phase of the bidiagonalization are handled on the CPU. The work in [12] employs the power method to construct a rank 1 approximation for 2D filters in convolutional neural networks. Routines to handle the SVD of many matrices on GPUs is presented in [13] where each thread within a warp computes the SVD of a single matrix. 3. Batched QR Decomposition In this section, we discuss implementation details of our batched QR kernel and compare it with other implementations from the MAGMA 2.2 [14] and CUBLAS 8 [15] libraries. 3.1. Implementation One benefit of the Householder algorithm is that the application of reflectors to the trailing matrix (line 5 of the algorithm) can be blocked together and expressed as a matrix-matrix multiplication (Level 3 BLAS) instead of multiple matrix-vector multiplications (Level 2 BLAS). The increased arithmetic intensity typically allows performance to improve when the trailing matrix is large. However, for small matrix blocks, the overhead of generating the blocked reflectors from their vector form as well as the lower performance of the matrix-matrix multiplication for small matrices hinder performance. We can obtain better performance by applying multiple reflectors in their vector form and performing the transpose matrix-vector multiplication efficiently within a thread block [10]. First, we perform the regular factorization on a column block P (called a panel). The entire panel is stored in registers, with each thread storing one row of the panel, and the transpose matrix-vector product is computed using a series of reductions using shared memory and warp shuffles [16] which BATCHED QR AND SVD ALGORITHMS Registers 5 ShueXOR Lane 1 Lane 1 Lane 2 Lane 2 Lane 3 Lane 3 Lane 4 Lane 4 Lane 5 Lane 5 Lane 6 Lane 6 Lane 7 Lane 7 Lane 8 Lane 8 Warp Figure 2. Left: matrix rows allocated to thread registers in a warp. Right: parallel warp reduction using shuffles within registers. allow threads within a warp to read each other’s registers. Figure 2 shows the data layout for a theoretical warp of size 8 with 4 columns in registers and a warp reduction using shuffles. Once we factor the panel, we can apply the reflectors to the trailing sub-matrix in a separate kernel that is optimized for performing the core matrix-vector product in the update. In this second kernel, we load both the factored panel P and a panel Mi of the trailing sub-matrix M to registers and apply the reflectors one at a time, updating the trailing panel in registers. Let us take an example of a 32 × 8 trailing panel Mi . For each reflector, we compute the matrix-vector product MiT v by flattening the 32×8 product into a reduction of a 256 vector in shared memory that has been padded to avoid bank conflicts. The reduction can then be serialized until it reaches a size of 32, where a partial reduction to a vector of size 8 can take place in 2 steps. This final vector is the product MiT v which can then be quickly applied to the registers storing Mi . This process is repeated for each trailing panel within the same kernel to maximize the use of the reflectors which have been stored in registers. Figure 3 shows one step of a panel factorization and the application of its reflectors to the trailing submatrix. Since threads are limited to 1024 per block on current architectures, we use the approach developed in [17] to factorize larger matrices. We first factorize panels up to the thread block limit in a single kernel call. The panels below the first are then factorized by first loading the triangular factor into shared memory and then proceeding with the panel factorization as before, taking the triangular portion into consideration when computing reflectors and updates. To keep occupancy up for the small matrices on devices where the resident block limit could be reached before the thread limit, we assign multiple operations to a single thread block. For a batch of N matrices of dimensions m × n, kernels can be launched using N/b thread blocks of size m × b, where each thread block handles b operations. 3.2. Performance Figures 4a and 4b show the performance of our batched QR for 1000 square and rectangular matrices with a panel width of 16, tuned for the P100 GPU. We compare against the vendor implementation in CUBLAS as well as the high performance library MAGMA. We can see that our proposed version performs well for rectangular matrices with column size of 32 and starts losing ground against MAGMA for the larger square matrix sizes where the blocked algorithm starts to 6 BATCHED QR AND SVD ALGORITHMS R R0 V P M V0 M0 Figure 3. One step of the QR factorization where a panel P is factored to produce a triangular factor R and reflectors V which are used to update the trailing submatrix M. Our QR DP MAGMA QR DP CUBLAS QR DP Our QR SP MAGMA QR SP CUBLAS QR SP Our QR DP MAGMA QR DP CUBLAS QR DP Our QR SP MAGMA QR SP CUBLAS QR SP 1,000 400 300 600 Gflop/s Gflop/s 800 400 200 100 200 0 0 5 2 6 2 7 2 Matrix Size 2 8 9 2 (a) Batched QR kernel performance for square matrices. 25 26 27 28 29 Matrix Rows 210 211 (b) Batched QR kernel performance for rectangular matrices with a fixed column size of 32. Figure 4. Comparing batched QR kernels for 1000 matrices of varying size on a P100 GPU in single and double precision. show its performance benefits. A nested implementation where our kernel can be used to factor relatively large panels in a blocked algorithm will likely show some additional performance improvements for the large square matrices, but we leave that as future work. 4. Register Memory One-Sided Jacobi In this section we will discuss the first batched SVD kernel where the matrix data is hosted in registers and analyze the performance of the resulting kernel. 4.1. Implementation In this implementation, to avoid repeated global memory accesses, we attempt to fit the matrix in register memory using the same layout as the panel in the QR factorization, i.e. one row per BATCHED QR AND SVD ALGORITHMS 0.35 DP Performance SP Performance 200 7 0.3 Occupancy Gflop/s 150 100 0.25 0.2 50 0.15 DP Occupancy SP Occupancy 0 0 5 10 15 20 Matrix Size 25 30 35 (a) Kernel performance in GFLOP/s and achieved occupancy. 0.1 0 5 10 15 20 Matrix Size 25 30 35 (b) The effect of increasing the matrix size on the occupancy of the register kernel. Figure 5. Performance of the batched register memory SVD on a P100 GPU for 1000 matrices of varying size in single and double precision arithmetics. thread; however, the number of registers that a thread uses has an impact on occupancy which can potentially lead to lower performance. In addition, once the register count exceeds the limit set by the GPU’s compute capability, the registers spill into “local” memory which resides in cached slow global memory. Since we store an entire matrix row in the registers of one thread, we use the serial one-sided Jacobi algorithm to compute the SVD where column pairs are processed by the threads one at a time. The bulk of the work lies in the computation of the Gram matrix G = ATij Aij (line 3 of Algorithm 2) and in the update of the columns (line 5). Since the Gram matrix is symmetric, this boils down to three dot products which are executed as parallel reductions within the warp using warp shuffles. The computation of the 2 × 2 rotation matrix as well as the convergence test is performed redundantly in each thread. Finally, the column update is done in parallel by each thread on its own register data. As with the QR kernel, we keep occupancy up for the smaller matrix sizes by assigning multiple SVD operations to a single block of threads with each operation assigned to a warp to avoid unnecessary synchronizations. 4.2. Performance We generate batches of 1000 test matrices with varying condition numbers using the latms LAPACK routine and calculate performance based on the total number of rotations needed for convergence. Figures 5a and 5b show the performance on a P100 GPU of the register-based batched SVD kernel and the effect increased register usage has on occupancy. Profiling the kernel, we see that the Gram matrix computation takes about 500 cycles, column rotations take about 240 cycles, and the redundantly computed convergence test and rotation matrices dominate at 1900 cycles. The fact that the redundant portion of the computation dominates means that it is preferable to assign as few threads as possible when processing column pairs. Due to the low occupancy for the larger matrix sizes and the register spills to local memory for matrices larger than 30, it is obvious that the register approach will not suffice for larger matrix sizes. This leads us to our next implementation based on the slower but more parallel-friendly shared memory. 6 8 5 3 1 8 7 6 4 2 3 1 2 8 5 7 6 4 1 2 4 8 3 5 7 6 Warp 4 4 Warp 3 2 Step 1: Warp 2 BATCHED QR AND SVD ALGORITHMS Warp 1 8 Step 5: 1 3 5 7 4 6 7 8 Step 2: Step 6: 2 1 3 5 6 7 5 8 Step 3: Step 7: 4 2 1 3 7 5 3 8 6 4 2 1 Step 4: Figure 6. Distribution of column pairs to warps at each step of a sweep. 5. Shared Memory One-Sided Jacobi While the register based SVD performs well for very small matrix sizes, we need a kernel that can handle larger sizes and maintain reasonably high occupancy. This leads us to building a kernel based on shared memory, the next level of the GPU memory hierarchy. This section discusses the implementation details of this kernel and analyze its performance when compared with the register kernel. 5.1. Implementation In this version, the matrix is stored entirely in shared memory, which is limited to at most 48 KB per thread block on current generation GPUs. Using the same thread assignment as the register based kernel would lead to very poor occupancy due to the high shared memory consumption, where potentially only a few warps will be active in a multiprocessor. Instead, we exploit the inherent parallelism of the one-sided Jacobi to assign a warp to a pair of columns, i.e., there are n/2 warps processing an m×n matrix stored in shared memory. There are a total of n(n−1)/2 pairs of columns, so we must generate all pairings in n − 1 steps, with each step processing n/2 pairs in parallel. There are many ways of generating these pairs, including round robin, odd-even, and ring ordering [18, 19]. We implement the round robin ordering using shared memory to keep track of the column indexes of the pairs with the first warp in the block responsible for updating the index list after each step. Figure 6 shows this ordering for a matrix with 8 columns. When the number of matrix rows exceeds the size of the warp, the thread-per-row assignment no longer allows us to use fast warp reductions, which would force us to use even more resources, as the reductions would now have to be done in shared memory. Instead, we assign multiple rows to a thread, serializing a portion of the reduction over those rows until warp reductions can be used. This follows our observation in Section 4.2 to assign as few threads as possible to process column pairs, frees up valuable resources and increases the overall performance of the reduction. Row padding is used to keep the rows at multiples of the warp size, and column padding is used to keep the number of columns even. Kernels can then be launched using 32 × n/2 threads to process each matrix. Figures 7a and 7b show examples of the thread allocation and reductions for a 8 × 8 matrix using a theoretical warp size of 4. BATCHED QR AND SVD ALGORITHMS 9 Shared Memory Serial Reduction ShuffleXOR Lane 1 Lane 1 Lane 2 Lane 2 Lane 3 Lane 3 Lane 4 Lane 4 Lane 1 Lane 2 Lane 1 Lane 3 Lane 2 Lane 4 Lane 3 Warp 1 Warp 2 Warp 3 Warp 4 (a) Matrix columns assigned in pairs to multiple warps and stored in shared memory. Lane 4 (b) Parallel reduction of a column of data in shared memory using register shuffles after an initial serial reduction step. Figure 7. Shared memory kernel implementation details. 5.2. Performance Figures 8a and 8b show the performance of the parallel shared SVD kernel compared to the serial register SVD kernel on a P100 GPU. We can see the improved growth in performance in the shared memory kernel due to the greater occupancy as well as the absence of any local memory transactions. Looking at the double precision occupancy, we notice two dips in occupancy at matrix sizes 22 and 32 as the number of resident blocks become limited by the registers/block limits of the device, dropping to 2 and then 1 resident blocks. Performance increases steadily from there as we increase the number of threads assigned to the operation until we reach a matrix size of 64 × 64 where we reach the block limit of 1024 threads. To handle larger sizes, we must use a blocked version of the algorithm or the randomized SVD as we see in Sections 6 and 7, respectively. 6. Global Memory One-Sided Block Jacobi When we can no longer store the entire matrix in shared memory, we have to operate on the matrix in the slower global memory. Instead of repeatedly reading and updating the columns one at a time, block algorithms that facilitate cache reuse have been developed [20, 21, 22]. The main benefit of the block Jacobi algorithm is its high degree of parallelism; however, since we implement a batched routine for independent operations, we will use the serial block Jacobi algorithm for individual matrices and rely on the parallelism of the batch processing. The parallel version, where multiple blocks are processed simultaneously, can still be used when the batch size is very small, but we will focus on the serial version. In this section we will discuss the implementation details for two global memory block Jacobi algorithms that differ only in the way block columns are orthogonalized and compare their performance with parallel streamed calls to the cuSOLVER 8 [23] library routines. 6.1. Gram Matrix Block Jacobi SVD The block Jacobi algorithm is very similar to the vector Algorithm 2, orthogonalizing pairs of blocks columns instead of vectors. The first method of orthogonalizing pairs of block columns is based (p) on the SVD of their Gram matrix. During the p-th sweep, each pair of m × k block columns Ai and 10 BATCHED QR AND SVD ALGORITHMS REG DP Occupancy REG SP Occupancy DP Register Kernel DP SMEM Kernel SP Register Kernel SP SMEM Kernel 0.6 Occupancy Gflop/s 600 SMEM DP Occupancy SMEM SP Occupancy 400 200 0.4 0.2 0 0 10 20 30 40 Matrix Size 50 0 60 (a) Shared memory kernel performance in GFLOPs/s compared to the register kernel. 10 20 30 40 Matrix Size 50 60 70 (b) Comparison of the occupancy achieved by the register and shared memory kernels. Figure 8. Performance of the batched shared memory SVD on a P100 GPU for 1000 matrices of varying size in single and double precision arithmetics. (p) Aj (p) (p) (p) T (p) (p) (p) T (p) Aij (p) singular vectors of Gij (or (p) Updating Ap+1 = Apij Uij ij is orthogonalized by forming a 2k × 2k Gram matrix Gij = [Ai Aj ] [Ai Aj ] = Aij and generating a block rotation matrix (p) Uij , computed as the left equivalently its eigenvectors, since it is symmetric positive definite). orthogonalizes the block columns, since we have T (p) T Ap+1 Ap+1 = Uij ij ij T (p) (p) T Apij Apij Uij = Uij (p) (p) Gij Uij = Λpij , (p) where Λpij is a diagonal matrix of the singular values of Gij . Orthogonalizing all pairs of block columns until the entire matrix is orthogonal will give us the left singular vectors as the normalized columns and the singular values as the corresponding column norms. If the right singular vectors are needed, we can accumulate the action of the block rotation matrices on the identity matrix. For our batched implementation, we use highly optimized batched syrk and gemm routines from MAGMA to compute G and to apply the block rotations, while the SVD is computed by our shared memory batched kernel. Since different matrices will converge in different numbers of sweeps, we keep track of the convergence of each operation l by computing the norm el of the off-diagonal entries of G scaled by its diagonal entries. While this term is an inexact approximation of the off-diagonal terms of the full matrix in each sweep, it is still a good indication of convergence and will cost us at most an extra cheap sweep, since the final sweep will not actually perform any rotations within the SVD of G. The entire batched operation will then converge when e = max el < , where  is our convergence tolerance. This gives us the Gram matrix path of the batched block Jacobi Algorithm 3 to compute the SVD of a batch of matrices in global memory. It is worth noting that the computation of the Gram matrix can be optimized by taking advantage of the special structure of G, but since the bulk of the computation is in the SVD of G, it will not result in any significant performance gains. 6.2. Direct Block Jacobi SVD The Gram matrix method is an indirect way of orthogonalizing block columns and may fail to converge if the matrix is very ill-conditioned. Ill-conditioned matrices can be handled by directly BATCHED QR AND SVD ALGORITHMS 11 Algorithm 3 Batched One-sided block Jacobi SVD 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: while e >  do el = 0 for each pair of block columns Aij = [Ai , Aj ] do if method = GRAM then G = batchSyrk(Aij ) else [Aij , G] = batchQR(Aij ) el = max(el , scaledOffdiag(G)) U = batchSvd(G) Aij = batchGemm(Aij , U ) e = max(el ) orthogonalizing the columns using their SVD. Since the block columns are rectangular, we first compute their QR decomposition followed by the SVD of the triangular factor R. Overwriting the block column Apij by the orthogonal factor Q and multiplying it by the left singular vectors of R scaled by the singular values will give us the new block column Ap+1 ij :  T p p p pT Apij = Qpij Rij = Qpij Uij Σij Vijp = Ap+1 ij Vij . If the right singular vectors are needed, we can accumulate the action of Vijp on the identity matrix. For our batched implementation, we use the batch QR routine developed in Section 3 and gemm routines from MAGMA to multiply the orthogonal factor by the left singular vectors, while the SVD is computed by our shared memory batched kernel. The same convergence test used in the Gram matrix method can be used on the triangular factor, since the triangular factor should be close to a diagonal matrix if a pair of block columns are orthogonal. This gives us the direct path of the batched block Jacobi Algorithm 3 to compute the SVD of a batch of matrices in global memory. 6.3. Performance Figures 9a and 9a show the profiling of the different computational kernels involved in the batched block algorithms with a block width of 32, specifically percentages of total execution time for determining convergence and memory operations, matrix multiplications, QR decompositions and the SVD of the Gram matrix. For the Gram matrix approach, the SVD is the most costly phase, even for the larger operations, while the QR and SVD decompositions take almost the same time for the larger matrices in the direct approach. Figure 10a shows the performance of the batched block Jacobi SVD of 200 matrices using both methods and Figure 10b compares the performance of our batched SVD routine with a batched routine that uses the cuSOLVER SVD routine using 20 concurrent streams on a P100 GPU. Increasing the number of streams for cuSOLVER showed little to no performance benefits, highlighting the performance limitations of routines that are bound by kernel launch overhead. The matrices are generated randomly using the latms LAPACK routine with a condition number of 107 . The Gram matrix approach fails to converge in single precision for these types of matrices, whereas the direct approach always converges; however the Gram matrix approach performs better when it is applicable for the larger matrices due to the strong performance of the matrix-matrix multiplcations. The performance of the block algorithm can be improved by preprocessing the matrix using QR and LQ decompositions to decrease the number of sweeps required for convergence [24] as well as by adaptively selecting pairs of block columns based on the 12 BATCHED QR AND SVD ALGORITHMS 100 80 80 Misc. 40 GEMM SVD 60 Misc. 40 GEMM SVD 20 20 0 0 QR 96 128 160 192 224 256 288 320 352 384 416 448 480 512 60 % total time 100 96 128 160 192 224 256 288 320 352 384 416 448 480 512 % total time computed offdiagonal norms of their Gram matrices. These changes are beyond the scope of this paper and will be the focus of future work. Matrix size Matrix size (a) Gram Matrix batched block Jacobi SVD profile. (b) Direct batched block Jacobi SVD profile. Figure 9. Profile of the different phases of the block Jacobi SVD for 200 matrices of varying size on a P100 GPU in double precision. Single precision exhibits similar behavior. 7. Randomized SVD As mentioned in Section 1, we are often interested in a rank-k approximation of a matrix A ≈ Ũ S̃ Ṽ . We can compute this approximation by first determining the singular value decomposition of the full m × n matrix A and then truncating the n − k smallest singular values with their corresponding singular vectors; however, when the matrix has low numerical rank k, we can obtain the approximation using very fast randomization methods [1]. This section will discuss some details DP Gram DP Direct SP Direct 500 102 Time Gflop/s 101 400 100 Streamed DP CUSolver Streamed SP CUSolver Batched DP Direct Batched SP Direct Batched DP Gram 10−1 300 100 200 300 400 Matrix Size 500 (a) Batched block Jacobi SVD performance. 100 200 300 400 Matrix Size 500 (b) Comparison between streamed cuSOLVER and the batched block Jacobi. Figure 10. Batched block Jacobi performance for 200 matrices of varying size on a P100 GPU in single and double precision arithmetics. BATCHED QR AND SVD ALGORITHMS 13 Algorithm 4 Batched Randomized SVD 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: procedure RSVD(A, k, p) [m, n] = size(A) Ω = Rand(n, k + p) Y = batchGemm(A, Ω) [Q, Ry ] = batchQR(Y ) B = batchGemm(QT , A) [QB , RB ] = batchQR(B T ) T [UR , S, VR ] = batchSvd(RB ) U = batchGemm(Q, UR ) V = batchGemm(QB , VR ) of the algorithm and compare its performance with the full SVD using our one-sided block Jacobi kernel. 7.1. Implementation When the singular values of a matrix decay rapidly, we can compute an approximate SVD using a simple two phase randomization method: (1) The first phase determines an approximate orthogonal basis Q for the columns of A ensuring that A ≈ QQT A. When the numerical rank k of A is low, we can be sure that Q has a small number of columns as well. In [1] we see that by drawing k + p sample vectors y = Aw from random input vectors w, we can obtain a reliable approximate basis for A which can then be orthogonalized. This boils down to computing a matrix Y = AΩ, where Ω is a n × (k + p) random Gaussian sampling matrix, and then computing the QR decomposition of Y = QRy , where Q is the desired approximate orthogonal basis. (2) The second phase uses the fact that A ≈ QQT A to compute a matrix B = QT A so that we now have A ≈ QB. Forming the SVD of B = UB SV T , we finalize our approximation A ≈ QUB SV T = U SV T . For the wide (k + p) × n matrix B, we can first compute a QR decomposition of its transpose, followed by the SVD of the upper triangular factor. Algorithm 4 shows that the core computations for the randomized method are matrix-matrix multiplications, QR decompositions, and the singular value decompositions of small matrices. Using the batched routines from the previous sections, it is straightforward to form the required randomized batched SVD. More robust randomized SVD algorithms would employ randomized subspace iteration methods to obtain a better basis Q for the columns of A and rely on these same core kernels, but will not be further discussed here. 7.2. Performance Figure 11 shows the profiling of the different kernels used in the randomized batched routine for determining the top 64 singular values and vectors of randomly generated low rank matrices using the latms LAPACK routine. The miscellaneous portion includes random number generation using the CURAND library’s default random number generator and a Gaussian distribution, batched transpose operations and memory operations. We can see that the performance of all kernels play almost equally important roles in the performance of the randomized routine as the matrix size grows while keeping the computed rank the same. Figure 12a shows the performance of the batched 14 BATCHED QR AND SVD ALGORITHMS randomized SVD of 200 operations and Figure 12b compares the runtimes of the direct block onesided Jacobi routine with the randomized SVD on a P100 GPU for the same set of matrices, showing that significant time savings can be achieved even for relatively small blocks. 100 % total time 80 60 Misc. 40 GEMM SVD QR 0 96 128 160 192 224 256 288 320 352 384 416 448 480 512 20 Matrix size Figure 11. Profile of the different phases of the batched randomized SVD for 200 matrices of varying size on a P100 GPU in double precision. Single precision exhibits similar behavior. 8. Application to Hierarchical Matrix Compression As an application of the batched kernels presented, we consider the problem of compressing/recompressing hierarchical matrices. This is a problem of significant importance for building hierarchical matrix algorithms and in fact was our primary motivation for the development of the batched kernels. Hierarchical matrices [25, 26, 27] have received substantial attention in recent years because of their ability to store and perform algebraic operations in near linear complexity rather than the O(n2 ) and O(n3 ) that regular dense matrices require. The effectiveness of hierarchical matrices comes from 101 DP Randomized SVD SP Randomized SVD 1,000 100 Time Gflop/s 800 600 DP Randomized SVD DP Direct Block SVD SP Randomized SVD SP Direct Block SVD 10−1 400 200 10−2 100 200 300 400 Matrix Size 500 (a) Batched randomized SVD performance. 100 200 300 400 Matrix Size 500 (b) Comparison between the batched block Jacobi and the batched randomized SVD. Figure 12. Batched randomized SVD performance for 200 matrices of varying size on a P100 GPU in single and double precision for the first 64 singular values and vectors. BATCHED QR AND SVD ALGORITHMS U11 15 2 A212 = U12 S12 U22 E12 T E22 U12 U22 E13 E23 E33 E43 U13 U23 U33 U43 (a) Basis tree U of an H2 -matrix. Leaf nodes are stored explicitly, whereas inner nodes are represented implicitly using the transfer matrices E. (b) Leaves of matrix tree for a simple hierarchical matrix. Red blocks represent dense leaves and green blocks are low rank leaves. Figure 13. The basis tree and matrix tree leaves of a simple H2 -matrix. the fact they can approximate a matrix by a (quad)-tree of blocks where many of the blocks in the off-diagonal regions have a rapidly decaying spectrum and can therefore be well-approximated by numerically low rank representations. It is these low rank representations, at different levels of the hierarchical tree, that reduce the memory footprint and operations complexity of the associated matrix algorithms. Hackbush [28] shows that many of the large dense matrices that appear in scientific computing, such as from the discretization of integral operators, Schur complements of discretized PDE operators, and covariance matrices, can be well approximated by these hierarchical representations. Reviewing and analyzing hierarchical matrix algorithms is beyond the scope of this paper. Here we focus on the narrow task of compressing hierarchical matrices. This compression task may be viewed as a generalization of the well-known compression (i.e., low rank approximation) of large dense matrices to the case of hierarchical matrices. For large dense matrices, one way to perform the compression is to generate a single exact or approximate SVD (U ΣV T ) and truncate the spectrum Σ to the desired tolerance, to produce a truncated or “compressed” representation (Ū Σ̄V̄ T ). For hierarchical matrices, the equivalent operations involve batched SVDs on small blocks, with one batched kernel call per level of the tree in the hierarchical representation. The size of the batch in every such call is the number of nodes at the corresponding level in the tree. Compression algorithms with controllable accuracy are important practically, because it is often the case that the hierarchical matrices generated by analytical methods can be compressed with no significant loss of accuracy. Even more importantly, when performing matrix operations such as additiona and multiplication, the apparent ranks of the blocks often grow and have to be recompressed regularly during the operations to prevent superlinear growth in memory requirements. 8.1. H2 -matrix representation For our application, we use the memory efficient H2 variant of hierarchical matrices which exhibit linear complexity in time and space for many of its core operations. In the H2 -matrix format, a hierarchical matrix is actually represented by three trees: 16 BATCHED QR AND SVD ALGORITHMS • Row and column basis column trees U and V that organize the row and column indices of the matrix hierarchically. Each node represents a set of basis vectors for the row and column spaces of the blocks of A. Nodes at the leaves of the tree store these vectors explicitly, while inner nodes store only transfer matrices that allow us to implicitly represent basis vectors in terms of their children. A basis tree with this parent-child relationship of the nodes is called a nested basis. For example, in a binary row basis tree U with transfer matrices E, we can explicitly compute the basis vectors for a node i with children i1 and i2 at level l as:  l   l Ei1 Ui1 l−1 . Ui = Uil2 Eil2 Figure 13a shows an example of a binary basis tree. • A matrix tree for the hierarchical blocking of A formed by a dual traversal of the nodes of the two basis trees. A leaf is determined when the block is either small enough and stored as an m × m dense matrix, or when a low rank approximation of the block meets a specified accuracy tolerance. For the latter case, the node is stored as a kl × kl coupling matrix S at each level l of the tree, where kl is the rank at level l. The block Ats of the matrix, where t is the index set of a node in the row basis tree U and s is the index set of a node in the column basis V , is then approximated as Ats ≈ Ut Sts VsT . Figure 13b shows the leaves of the matrix quadtree of a simple hierarchical matrix. For the case of symmetric matrices, the U and V trees are identical. Our numerical results below are from a symmetric covariance matrix. 8.2. Compression The compression of a symmetric H2 -matrix AH , represented by the two trees U (with its transfer e (with its transfer matrices E) e in matrices E) and S, involves generating a new optimal basis tree U a truncation phase, and a new Se that expresses the contents of the matrix blocks in this new basis in a projection phase. e , E] e We present a version of the truncation algorithm that generates a memory efficient basis [U from a representation of the matrix in a given [U, E] basis. More sophisticated algebraic compression algorithms that involve the use of S in the truncation phase in order to generate a more efficient basis will be the subject of future work. The truncation phase computes the SVD of the nodes of the basis tree U level by level, with e . We have an explicit all nodes in a level being processed in parallel to produce the new basis U representation of the basis vectors at the leaves, so we can compute the SVD of all leaf nodes in parallel with our batched kernels and truncate the singular vectors whose singular values are lower than our relative compression threshold . Truncating the node to the relative threshold using the e ||F −U SVD will give us an approximation of the leaf such that ||U||U ≤ . With the new leaf nodes, we ||F T fd U d and d is the leaf level. can compute projection matrices in a tree T , where each node i, Tid = U i i Sweeping up the tree, we process the inner nodes while preserving the nested basis property. Using the parent-child relationship of a node i with children i1 and i2 at level l, we have: # #  l  l  " l  " l l l e e U E U T E U i1 i1 i1 i1 i1 Uil−1 = i1 ≈ = el e l T Ei Uil2 Eil2 Til2 Eil2 U U i2 i2 After forming the T E matrices using batched matrix-matrix multiplication, we compute their SVD T E = QSW T using the batched SVD kernel and truncate as we did for the leaves to form the BATCHED QR AND SVD ALGORITHMS 17 g truncated T E matrices as: " #   el T g e i Sei W fi = Ei1 T l−1 T Ei = Q i el E i2 e l , the block rows of Q, e are the new transfer matrices at level l of our compressed nested where E basis and T l−1 are the projection matrices for level (l − 1). The key computations involved in this truncation phase consist then of one batched SVD involving the leaves of the tree, followed by a sequence of batched SVDs, one per level of the tree, involving the transfer matrices and data from the lower levels. The projection phase consists of transforming the coupling matrices in the matrix tree using the generated projection matrices of the truncation phase. For each coupling matrix Sts , we compute a new coupling matrix Sets = Tt Sts TsT using batched matrix-matrix multiplications. This phase of the operation consumes much less time than the truncation phase on GPUs, because of substantial efficiencies in executing regular arithmetically intensive operations on them. 8.3. Results As an illustration of the effectiveness of the algebraic compression procedure, we generate covariance matrices of various sizes for a spatial Gaussian process with n observation points placed on a random perturbation of a regular discretization of the unit square [0, 1] × [0, 1] and an isotropic exponential kernel with correlation length of 0.1. Hierarchical representations of the formally dense n × n covariance matrices are formed analytically by first clustering the points in a KD-tree using a mean split giving us the hierarchical index sets of the basis tree. The basis vectors and transfer nodes are generated using Chebyshev interpolation [29]. The matrix tree is constructed using a dual traversal of the basis tree [25, 30], and the coupling matrices are generated by evaluating the kernel at the interpolation points. The approximation error of the constructed matrix is then controlled by varying the number of interpolation points and by varying the leaf admissibility condition during the dual tree traversal. An approximation error of 10−7 has been used in the following tests e H −AH ||F ≤ 10−7 has been used to maintain the accuracy of and a relative truncation error  = ||A||A H ||F the compressed matrices. Figure 14a shows the memory consumption before and after compression of hierachical covariance matrices with leaf size 64 and initial rank 64 (corresponding to an 8 × 8 Chebyshev grid). The dense part remains untouched, while the low rank part of the representation sees a substantial decrease in memory consumption after compression with minimal loss of accuracy. Figure 14b shows the expected asymptotic linear growth in time of the compression algorithm and shows the effect of using the randomized SVD with 32 samples instead of the full SVD as computed by the shared memory kernel. Figure 15 shows another example where the admissibility condition is weakened to generate a coarser matrix tree with an increased rank of 121 (corresponding to an 11 × 11 Chebyshev grid) and the randomized SVD with 64 samples also reduces compression time when compared to the full SVD using the direct block Jacobi kernels. 9. Conclusions and Future Work In this paper, we described the implementation of efficient batched kernels for the QR decomposition and randomized singular value decomposition of low rank matrices hosted on the GPU. Our batched QR kernel provides significant performance improvements for small matrices over existing state of the art libraries, and our batched SVD routines are the first of their kind on the GPU, with performance exceeding 800/400 GFLOP/s on a batch of 1000 matrices of size 512 × 512 in 18 BATCHED QR AND SVD ALGORITHMS DP Dense portion DP Original low rank DP Compressed low rank SP Dense portion SP Original low rank SP Compressed low rank DP Full SVD SP Full SVD 20 Compression Time(s) Memory Consumption (GB) 23 DP Randomized SVD SP Randomized SVD 21 2−1 2−3 2−1 2−2 2−3 −5 2 214 215 216 217 Problem Size 218 219 214 (a) Memory savings. 215 216 217 Problem Size 218 219 (b) Compression time using randomized SVD with 32 samples and the full SVD using the shared memory kernel. Figure 14. Compression results for sample covariance matrices generated from 2D spatial statistics on a P100 GPU in single and double precision, using a relative Frobenius norm threshold of 10−7 and initial rank 64. DP Full SVD SP Full SVD DP Randomized SVD SP Randomized SVD Compression Time(s) 21 20 2−1 2−2 214 215 216 217 Problem Size 218 219 Figure 15. Compression time for a coarser matrix tree with initial rank 121 comparing the randomized SVD with 64 samples and the full SVD. single/double precision. We illustrated the power of these kernels on a problem involving the algebraic compression of hierarchical matrices stored entirely in GPU memory, and demonstrated a high-performance compression algorithm yielding significant memory savings on practical problems. In the future, we plan to investigate alternatives to the one-sided Jacobi algorithm for the SVD of the small blocks in the randomized algorithm and improve the performance of the blocked algorithms using preconditioning and adaptive block column pair selection. We also plan to develop a suite of hierarchical matrix operations suited for execution on modern GPU and manycore architectures. BATCHED QR AND SVD ALGORITHMS 19 Acknowledgments We thank the NVIDIA Corporation for providing access to the P100 GPU used in this work. References [1] N. Halko, P.-G. Martinsson, and J. A. Tropp, “Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions,” SIAM Review, vol. 53, no. 2, pp. 217–288, 2011. [2] G. Golub and C. Van Loan, Matrix Computations. Johns Hopkins University Press, 2013. [3] L. Trefethen and D. Bau, Numerical Linear Algebra. Society for Industrial and Applied Mathematics, 1997. [4] J. Demmel and K. Veselic, “Jacobi’s method is more accurate than QR,” SIAM Journal on Matrix Analysis and Applications, vol. 13, no. 4, pp. 1204–1245, 1992. [5] A. Haidar, T. T. Dong, S. Tomov, P. Luszczek, and J. Dongarra, “A framework for batched and GPU-resident factorization algorithms applied to block Householder transformations.” in ISC, ser. Lecture Notes in Computer Science, J. M. Kunkel and T. Ludwig, Eds., vol. 9137. Springer, 2015, pp. 31–47. [6] A. Haidar, T. Dong, P. Luszczek, S. Tomov, and J. Dongarra, “Optimization for performance and energy for batched matrix computations on GPUs,” in Proceedings of the 8th Workshop on General Purpose Processing Using GPUs, ser. GPGPU-8. New York, NY, USA: ACM, 2015, pp. 59–69. [7] N. Wilt, The CUDA Handbook: A Comprehensive Guide to GPU Programming. Pearson Education, 2013. [8] V. Volkov, “Better performance at lower occupancy,” Proceedings of the GPU technology conference, GTC, vol. 10, 2010. [9] A. Charara, D. E. Keyes, and H. Ltaief, “Batched Triangular Dense Linear Algebra Kernels for Very Small Matrix Sizes on GPUs,” Submitted to ACM Transactions on Mathematical Software. [Online]. Available: http://hdl.handle.net/10754/622975 [10] M. Anderson, G. Ballard, J. Demmel, and K. Keutzer, “Communication-avoiding QR decomposition for GPUs,” in Parallel Distributed Processing Symposium (IPDPS), 2011 IEEE International, May 2011, pp. 48–58. [11] C. Kotas and J. Barhen, “Singular value decomposition utilizing parallel algorithms on graphical processors,” in OCEANS’11 MTS/IEEE KONA, Sept 2011, pp. 1–7. [12] H.-P. Kang and C.-R. Lee, Improving Performance of Convolutional Neural Networks by Separable Filters on GPU. Berlin, Heidelberg: Springer Berlin Heidelberg, 2015, pp. 638–649. [13] I. Badolato, L. d. Paula, and R. Farias, “Many svds on gpu for image mosaic assemble,” in 2015 International Symposium on Computer Architecture and High Performance Computing Workshop (SBAC-PADW), Oct 2015, pp. 37–42. [14] S. Tomov, R. Nath, H. Ltaief, and J. Dongarra, “Dense linear algebra solvers for multicore with GPU accelerators,” in Proc. of the IEEE IPDPS’10. Atlanta, GA: IEEE Computer Society, April 19-23 2010, pp. 1–8, DOI: 10.1109/IPDPSW.2010.5470941. [15] NVIDIA, CUBLAS Library User Guide, v8.0 ed., http://docs.nvidia.com/cuda/cublas, NVIDIA, 2017. [Online]. Available: http://docs.nvidia.com/cuda/cublas [16] J. Cheng, M. Grossman, and T. McKercher, Professional CUDA C Programming, ser. EBL-Schweitzer. Wiley, 2014. [17] J. Kurzak, H. Ltaief, J. Dongarra, and R. M. Badia, “Scheduling dense linear algebra operations on multicore processors,” Concurrency and Computation: Practice and Experience, vol. 22, no. 1, pp. 15–44, 2010. [Online]. Available: http://dx.doi.org/10.1002/cpe.1467 [18] B. B. Zhou and R. P. Brent, “On parallel implementation of the one-sided Jacobi algorithm for singular value decompositions,” in Parallel and Distributed Processing, 1995. Proceedings. Euromicro Workshop on, Jan 1995, pp. 401–408. [19] B. Zhou and R. Brent, “A parallel ring ordering algorithm for efficient one-sided Jacobi SVD computations,” Journal of Parallel and Distributed Computing, vol. 42, no. 1, pp. 1 – 10, 1997. [20] M. BEČKA and M. Vajteršic, “Block-Jacobi SVD algorithms for distributed memory systems I: Hypercubes and rings*,” Parallel Algorithms and Applications, vol. 13, no. 3, pp. 265–287, 1999. [21] ——, “Block-jacobi svd algorithms for distributed memory systems II: Meshes,” Parallel Algorithms and Applications, vol. 14, no. 1, pp. 37–56, 1999. [22] M. Bečka, G. Okša, and M. Vajteršic, “New dynamic orderings for the parallel one–sided block-Jacobi SVD algorithm,” Parallel Processing Letters, vol. 25, no. 02, p. 1550003, 2015. [23] NVIDIA, cuSOLVER Library User Guide, v8.0 ed., http://docs.nvidia.com/cuda/cusolver/, NVIDIA, 2017. [Online]. Available: http://docs.nvidia.com/cuda/cusolver 20 BATCHED QR AND SVD ALGORITHMS [24] G. Okša and M. Vajteršic, “Efficient pre-processing in the parallel block-Jacobi SVD algorithm,” Parallel Comput., vol. 32, no. 2, pp. 166–176, Feb. 2006. [Online]. Available: http://dx.doi.org/10.1016/j.parco.2005.06. 006 [25] W. Hackbusch and B. N. Khoromskij, “A sparse H-matrix arithmetic. Part II: Application to multi-dimensional problems,” Computing, vol. 64, no. 1, pp. 21–47, 2000. [26] W. Hackbusch, B. Khoromskij, and S. Sauter, “On H2 -matrices,” in Lectures on Applied Mathematics, H.-J. Bungartz, R. Hoppe, and C. Zenger, Eds. Springer Berlin Heidelberg, 2000, pp. 9–29. [27] W. Hackbusch, “A sparse matrix arithmetic based on H-matrices. Part I: Introduction to H-matrices,” Computing, vol. 62, no. 2, pp. 89–108, 1999. [28] ——, Hierarchical matrices : Algorithms and Analysis, ser. Springer series in computational mathematics. Berlin: Springer, 2015, vol. 49. [29] S. Börm and J. Garcke, “Approximating gaussian processes with H2 -matrices,” in European Conference on Machine Learning. Springer, 2007, pp. 42–53. [30] L. Grasedyck and W. Hackbusch, “Construction and arithmetics of H-matrices,” Computing, vol. 70, no. 4, pp. 295–334, 2003.
8cs.DS
Analytical and simplified models for dynamic analysis of short skew bridges under moving loads arXiv:1704.07285v2 [cs.CE] 12 Feb 2018 K. Nguyena,∗, J.M. Goicoleaa a Group of Computational Mechanic, School of Civil Engineering, UPM, Spain Abstract Skew bridges are common in highways and railway lines when non perpendicular crossings are encountered. The structural effect of skewness is an additional torsion on the bridge deck which may have a considerable effect, making its analysis and design more complex. In this paper, an analytical model following 3D beam theory is firstly derived in order to evaluate the dynamic response of skew bridges under moving loads. Following, a simplified 2D model is also considered which includes only vertical beam bending. The natural frequencies, eigenmodes and orthogonality relationships are determined from the boundary conditions. The dynamic response is determined in time domain by using the “exact” integration. Both models are validated through some numerical examples by comparing with the results obtained by 3D FE models. A parametric study is performed with the simplified model in order to identify parameters that significantly influence the vertical dynamic response of the skew bridge under traffic loads. The results show that the grade of skewness has an important influence on the vertical displacement, but hardly on the vertical acceleration of the bridge. The torsional stiffness really has effect on the vertical displacement when the skew angle is large. The span length reduces the skewness effect on the dynamic behavior of the skew bridge. Keywords: skew bridge, bridge modelling, modal analysis, moving load ∗ Corresponding author Email addresses: khanh@mecanica.upm.es (K. Nguyen), jose.goicolea@upm.es (J.M. Goicolea) Preprint submitted to Engineering Structures February 13, 2018 1. Introduction Skew bridges are common in highways and railway lines when non perpendicular crossings are encountered. The structural effect of the skewness is an additional torsion on the bridge deck [1, 2] which may have a considerable effect, making its analysis and design more complex. A large research effort using the analytical, numerical as well as experimental approaches have been made during the last decades in order to better understand the behavior of this type of bridge under the static and dynamic loadings. Special attention is given in researches related to the highway skew bridge subjected to earthquake loadings. In fact, the first work on this subject was reported in 1974 by Ghobarah and Tso [3], in which a closed-form solution based on the beam model capable of capturing both flexural and torsional modes was proposed to study the dynamic response of the skewed highway bridges with intermediate supports. Maragakis and Jennings [4] obtained the earthquake response of the skew bridge, modelling the bridge deck as a rigid body. Using the Finite Element (FE) Models, the socalled stick model is firstly introduced by Wakefield et al. [5]. The stick model consists of a beam element representing the bridge deck, rigid or flexible beam elements for the cap-beam and an array of translational and rotational springs for the substructure of the bridge. This type of model is then successfully used in the later works [6, 7, 8, 9, 10, 11]. Despite its simplicity, the stick model can provide reasonably good approximations for the preliminary assessment. More sophisticated 3D models using the shell and beam elements are also proposed to study this subject [6, 12, 9, 13, 14, 15]. Regarding the behavior of the skew bridges under the traffic loads, the most of the work about this subject has been performed on the FE models using the combination of shell and beam elements and assisted by experimental testing [16, 17, 18, 19, 20, 21]. The FE models give a good approximation but require the end user more effort to introduce information in modelling the structure such as element types and sizes, dimension, material properties, connection types, etc. Therefore, its use is limited in determined case studies and challenged for a parametric study as Monte Carlo 2 simulations or large number of case studies. A possible alternative is to develop an analytical solution that is able to capture the behavior of the skew bridge and to give a sufficient accuracy. The advantage of the analytical solution is that the data input is much simpler (general information of structure such as mass, span length, flexural and torsional stiffness) and, therefore, its use is more easy for the end user and ,of course, is able for parametric study. In this context, the main objective of this work is to derive an analytical solution based on the beam theory for the simply-supported skew bridge under the moving loads. After that, a simplified 2D model is proposed in order to assimilate the effect of the skewness of the support on the vertical vibration of the bridge. An ”exact” integration in the time domain is used to solve the differential equations. Both models are validated through some numerical examples by comparing with the results obtained by 3D FE models. A parametric study is performed with the simplified model in order to identify parameters that significantly influence the vertical dynamic response of the skew bridge under traffic loads 2. Formulation of problem A simply-supported skew bridge as shown in Fig. 1 is considered to study in this work. The line of abutment support forms with the orthogonal line of the centreline an angle α defined as angle of skewness. The length of bridge is taken as the clear-span length L. The bridge is idealized using following assumptions: • The bridge deck is modelled as 3D Euler-Bernoulli beam supported at the ends and has a linear elastic behavior. • The bridge deck is very stiff in the horizontal XY plane, so the flexural deflection in Y direction will be neglected. • The bending stiffness EI, torsional stiffness GJ and mass per unit length m are constant over the length L. 3 • Warping and distortion effects in the torsion of the bridge deck is small enough to be neglected. y α y′ x Longitudinal axis x′ Deck width: B Abutment α m, r, EI, GJ, α Bridge clear-span: L Figure 1: A simply-supported skew bridge: in plane view and bridge model’s sketch With these assumptions, the bending of the bridge in XZ plane and its twisting about the X axis are the principal types of deformation of the bridge deck. The governing equations of motion for transverse and torsional vibration under transverse and torsional loads are: ∂4u = p(x, t) ∂x4 ∂2θ mr2 θ̈ − GJ 2 = mt (x, t) ∂x mü + cu̇ + EI (1a) (1b) where r is the radius of gyration; u(x, t) and θ(x, t) are the transverse deflection and torsional rotation of the bridge deck; p(x, t) and mt (x, t) are the transverse and torsional loads applied on the bridge at distance x and at time t, respectively. The external damping mechanism is introduced by the familiar term cu̇ and is assumed to be proportional to the mass (c = 2mξn ωn ) 2.1. Natural frequencies and mode shapes Using the modal superposition technique, the solution for free vibrations of the bridge deck can be decoupled into an infinite set of modal generalized 4 coordinates and mode shapes as: u(x, t) = θ(x, t) = ∞ X n=1 ∞ X qn (t)φn (x) (2a) pn (t)ϕn (x) (2b) n=1 in which φn (x) and ϕn (x) the nth flexural and torsional mode shape, and qn (t) and pn (t) are the generalized flexural and torsional coordinates at nth mode shape and are assumed to be eiωn t . The governing equations for free vibrations can be rewritten for each mode of vibration as: 1 d4 φn (x) mωn2 = φn (x) dx4 EI mr2 ωn2 1 d2 ϕn (x) = − ϕn (x) dx2 GJ (3a) (3b) The solutions of the above equations can found in many textbooks on dynamic, and can be expressed in the following form: φn (x) = Cn,1 sin(βn x) + Cn,2 cos(βn x) + Cn,3 sinh(βn x) + Cn,4 cosh(βn x) (4a) ϕn (x) = Cn,5 sin(λn x) + Cn,6 cos(λn x) (4b) where βn4 = mωn2 /EI and λ2n = mr2 ωn2 /GJ; Cn,1 , Cn,2 , Cn,3 , Cn,4 , Cn,5 , Cn,6 are six constants that are determined by the boundary conditions. The boundary conditions for the problem are shown in Fig. 1. The bridge is simply-supported at the ends by abutments. Therefore, at the support lines, there are not the vertical displacement (u(0, t) = u(L, t) = 0), rotation about the X ′ axis (θx′ (0, t) = θx′ (L, t) = 0) and bending moment in X ′ axis (My′ (0, t) = My′ (L, t) = 0). Using the change of coordinates as shown in Fig. 2, the following relationships are obtained: 5 Figure 2: Coordinate systems θx′ = θ cos(α) − ∂u sin(α) ∂x (5a) My′ = Mx sin(α) + My cos(α) = GJ ∂2u ∂θ sin(α) + EI 2 cos(α) ∂x ∂x (5b) Hence, the boundary conditions for the problem can be written as: φ(0) = φ(L) = 0 d φ(0) sin(α) = 0 dx d φ(L) sin(α) = 0 ϕ(L) cos(α) − dx d2 d GJ ϕ(0) sin(α) + EI 2 φ(0) cos(α) = 0 dx dx d d2 GJ ϕ(L) sin(α) + EI 2 φ(L) cos(α) = 0 dx dx ϕ(0) cos(α) − (6a) (6b) (6c) (6d) (6e) From these six conditions, a homogeneous system of equations is obtained as: AX = 0 (7) where X = [Cn,1 , Cn,2 , Cn,3 , Cn,4 , Cn,5 , Cn,6 ]T is the vector of six constants 6 to be determined, and the matrix A is expressed as:  0 1 0 1    sin(βL) cos(βL) sinh(βL) cosh(βL)    −a1 0 −a1 0 A=  −a1 cos(βL) a1 sin(βL) −a1 cosh(βL) −a1 sinh(βL)    0 −a2 0 a2  −a2 sin(βL) −a2 cos(βL) a2 sinh(βL) a2 cosh(βL) 0 0 0 sin(λL) cos(α) a3 a3 cos(λL) (8) with a1 = β sin(α), a2 = EIβ 2 cos(α) and a3 = GJλ sin(α). The eigenvalues are calculated by solving det(A) = 0. It is noted that the determinant of the matrix p A can be expressed in a function of unique variable β (λ = rβ 2 EI/GJ). The extraction of the eigenvalues can be performed by using any symbolic mathe- matical program (e.g. Maple or Matlab). In fact, in this study the symbolic calculation implemented in Matlab is used to extract the values of β for desired modes used in the dynamic calculation. The eigenvector corresponding to the nht mode is obtained by applying singular value decomposition to the matrix A. 2.2. Orthogonality Relationship In order to apply the modal superposition technique for solving the forced vibration problems in the skew bridges, it is necessary to determine the orthogonality relationship between the mode shapes. On the basis of the equations (3), these equations can be reformulated by multiplying both sides of these by an arbitrary mode φm (x) and ϕm (x), respectively, and integrating with respect to x over the length L, one obtains Z L 0 Z 0 ′′′′ EIφn (x)φm (x)dx − mωn2 L ′′ GJϕn (x)ϕm (x) + mr2 ωn2 7 Z L 0 Z L 0       cos(α)   cos(λL) cos(α)    0  −a3 sin(λL) 0 0 φn (x)φm (x)dx = 0 (9a) ϕn (x)ϕm (x)dx = 0 (9b)  By means of using the integration by parts of the left-hand side of the equations (9) (twice for Eq. (9a) and once for Eq. 9b) and applying the boundary conditions derived for the problem, gives: EI Z 0 L ′′ ′′ ′ ′ ′ ′ φn (x)φm (x)dx + GJ tan(α)[ϕn (L)φm (L) − ϕn (0)φm (0)] − mωn2 " ′ ′ ′ ′ GJ tan(α)[ϕm (L)φm (L) − ϕm (0)φm (0)] − Z 0 Z L φn (x)φm (x)dx = 0 0 (10a) Z L L ′ ′ ϕn (x)ϕm (x)dx = 0 ϕn (x)ϕm (x)dx + mr2 ωn2 # 0 (10b) Interchanging the indices n by m in the equation (10) and subtracting from its original form, which gives the following relations for any n 6= m: ′ ′ ′ ′ ′ ′ ′ ′ GJ tan(α)[ϕn (L)φm (L) − ϕn (0)φm (0) − ϕm (L)φn (L) + ϕm (0)φn (0)] Z L 2 2 −m(ωn − ωm ) φn (x)φm (x)dx = 0 (11a) 0 ′ ′ ′ ′ ′ ′ ′ ′ GJ tan(α)[ϕn (L)φm (L) − ϕn (0)φm (0) − ϕm (L)φn (L) + ϕm (0)φn (0)] Z L 2 mr2 (ωn2 − ωm ) ϕn (x)ϕm (x)dx = 0 (11b) 0 Next, subtracting the equation (11a) from the equation (11b) gives rise to: (ωn2 − 2 ωm ) m Z L φn (x)φm (x)dx + mr 0 2 Z ! L ϕn (x)ϕm (x)dx 0 Due to the fact that ωn 6= ωm and RL 0 φn (x)φm (x)dx ≥ 0 and RL 0 =0 (12) ϕn (x)ϕm (x)dx ≥ 0 for any n 6= m, the condition established in Eq. (12) will be fulfilled when: m mr2 Z L 0 Z L φn (x)φm (x)dx = 0 (13a) ϕn (x)ϕm (x)dx = 0 (13b) 0 8 which corresponds to the orthogonality relationship of the simply-supported skew bridge. 2.3. Vibration induced by a moving load and a convoy of moving loads Once the natural frequencies and the associated mode shapes are found, and the orthogonality relationship between the modes is known, it is possible to apply the modal superposition technique for obtaining the response of the skew bridge due to a moving load. The vertical load and the twisting moment apply on the bridge deck can be determined as: p(x, t) = P δ(x − vt) (14a) 2 mt (x, t) = P δ(x − vt)L(ǫ − ǫ ) cot(α) + P δ(x − vt)e 2(1 + K cot2 (α)) (14b) where P is the magnitude of the moving load, δ is the Dirac delta function, ǫ = vt/L, K = EI/GJ and e is the load eccentricity respect to the mass centre of the bridge deck section. The first part of the right side of Eq. (14b) is due to the skewness of the bridge [1, 2], and the second part is due to the load eccentricity. Using the modal superposition technique and applying the orthogonality relationship, the differential equations in the generalized coordinates are uncoupled: q̈n (t) + 2ξωn q̇n (t) + ωn2 qn (t) = R L 0 p̈n (t) + ωn2 pn (t) = R L 0 P φn (vt) (15a) mφn (x)2 dx  P L(ǫ − ǫ2 ) cot(α) + P e ϕn (vt) 2 mr2 ϕn (x)2 dx 2(1 + K cot (α)) 1  (15b) In order to solve the differential equations (15), several techniques can be applied. In this work, the solution of Eq. (15) is obtained by using the integration method based on the interpolation of excitation [22], which has the advantage that it gives an exact solution and a highly efficient numerical procedure. The 9 solution of Eq. (15) at time i + 1 can be determined as: wi+1 = Awi + B ẇi + CQi + DQi+1 (16) and its velocity is given by ẇi+1 = A′ wi + B ′ ẇi + C ′ Qi + D′ Qi+1 (17) i h φn (vt) P L(ǫ−ǫ2 ) cot(α) 1 RL where w = [qn , pn ]T , Q = [ R L Pmφ + P e ϕn (vt)]T , , 2 (x)2 dx mr 2 ϕ (x)2 dx 2(1+K cot (α)) n 0 0 n ′ and A, B, C, ..., D are the coefficients that depend on the structure parameters ωn , ξn and on the time step ∆t (detail formulations can be found in Appendix A) (a) a moving load (b) a convoy of moving loads Figure 3: Moving loads For the case that the bridge is forced by a convoy of moving loads as shown in Fig. 3(b), the uncoupled differential equations in the generalized coordinates for each mode of vibration n are given as nP X Pk φn (vt − dk ) (18a) RL 2 k=1 0 mφn (x) dx   nP X ϕn (vt − dk ) Pk L(ǫk − ǫ2k ) cot(α) 2 p̈n (t) + ωn pn (t) = + Pk e RL 2 2 2(1 + K cot2 (α)) k=1 0 mr ϕn (x)dx q̈n (t) + 2ξωn q̇n (t) + ωn2 qn (t) = (18b) where nP is the number of moving loads, dk is the distance between the first load and the k th load, Pk is the magnitude of the k th load, and ǫk = (vt−dk )/L. 10 The solution of Eq. (18) is obtained in similar way as in the case of a moving load. Attention needs to be paid in the determination of the modal loads in the right side of Eq. (18). For the loads that do not enter the bridge (vt − dk < 0) or leave the bridge (vt − dk > L) the modal loads associated with those loads are zero. 3. A simplified model In this part of the work, a simplified 2D model is developed in order to assimilate the effect of the skewness of the support on the vertical vibration of the simply-supported skew bridges. It is well known that the skewness of the supports causes the torsional moment on the bridge even for the vertical, centric loads. Those torsional moments in turn have a certain influence on the bending moment. In particular, a negative bending moment is introduced at the supports as shown in Fig. 4a [1, 2], making that for the purpose of vertical flexure the simply-supported skew beam behaves like as an elastically-fixed beam, or in other words, as a beam with rotational support with stiffness kθ as shown in Fig. 4b. It is noted that the negative bending moments at the supports change with the load position on the bridge. Therefore, the stiffness of the rotational support is also changed and can be different at different supports. In order to simplify the calculation the stiffness of the rotational support are considered the same in both supports. With this assumption, the stiffness of the rotational support can be determined as: kθ1 = kθ2 = kθ = 2GJ L cot2 (α) (19) In additions to the previously adopted assumptions, the following additional assumptions are used for the simplified model: • Only the vertical vibration is taken into account in the model. The load eccentricity is not considered. • The bridge deck is modelled by the 2D Euler-Bernoulli beam theory. 11 Figure 4: a) Diagram of bending moment of a skew bridge under a static load, b) Simplified model adopted for simply-supported skew bridge 3.1. Natural frequencies and mode shapes The governing equation for the free vibration of the simplified model is similar to Eq. (3a). The solution of this equation is given in (4a). The determination of the frequencies and its correspondent mode shapes is solving the homogeneous system of equations: BJ = 0 (20) where J = [C1 , C2 , C3 , C4 ]T is a vector containing the four mode shape coefficients, B is the characteristic matrix that can be determined by applying the boundary conditions. For the simplified model proposed in this study, the boundary conditions are: • There is not vertical displacement at the supports u(0, t) = u(L, t) = 0 =⇒ φn (0) = φn (L) = 0 12 (21) • Equilibrium of moments at the supports: EI EI ∂2u ∂x2 ∂2u ∂x2 = kθ 0 ∂u ∂x = −kθ L =⇒ EIφ′′n (0) = kθ φ′n (0) (22) =⇒ EIφ′′n (L) = −kθ φ′n (L) (23) 0 ∂u ∂x L Therefore, the characteristic matrix B is obtained as  in which 0 1 0   sin(βL) cos(βL) B=   −kθ β −EIβ 2  a41 a42 a41 = kθ β cos(βL) − EIβ 2 sin(βL);  1   sinh(βL) cosh(βL)   −kθ β EIβ 2   a43 a44 (24) a42 = −kθ β sin(βL) − EIβ 2 cos(βL); (25) a43 = kθ β cosh(βL) + EIβ 2 sinh(βL); a44 = kθ β sinh(βL) + EIβ 2 cosh(βL) (26) The procedure to obtain the eigenvalues and eigenvector is similar to the previously described in section 2.1. 3.2. Orthogonality relationship Similar to the analysis in section 2.2, the equation (3a) can be rewritten, using the boundary conditions of the simplified model, as: EI Z 0 L φ′′n (x)φ′′m (x)dx+kθ [φ′n (0)φ′m (0)+φ′n (L)φ′m (L)]−mωn2 Z 0 L φn (x)φm (x)dx = 0 (27) Interchanging the indices n and m in Eq. (27) and subtracting the resulting equation from its original form gives Z Z L 2 φn (x)φm (x)dx = 0 or m m(ωn2 − ωm ) 0 0 L φn (x)φm (x)dx = 0 (ωn 6= ωm ) (28) which is the orthogonality relationship between the mode shapes for the simplified model. 13 3.3. Vibration-induced by a moving load and a convoy of moving loads The dynamic response of the bridge under moving loads is obtained by using the same way described for the analytical model in section 2.3. The only difference is that the torsional response is eliminated in the calculation. 4. Numerical validations Two numerical examples are used in order to validate the proposed models. The results obtained by proposed models are compared with those obtained by Finite Element (FE) simulations. For each example, a FE model is developed in the program FEAP [23], built with 3D Euler-Bernoulli beam element (stick model). A moving load or a convoy of moving loads is applied to the nodal forces along the centreline axis, using time-dependent amplitude functions. The dynamic responses in FE models are obtained by solving in the time domain using the modal superposition technique with a time step of 0.001 s. For all examples, the first five modes of vibration are considered in the calculation and a constant damping ratio is assumed for all considered modes (ξn = ξ). Attention should be paid to select the total number of modes of vibration considered in the FE models, since the first five modes of vibration obtained by FE model are not always corresponding to the first five modes obtained by analytical and simplified models. (a) (b) Figure 5: Cross sections: a) for example 1, b) for example 2 4.1. Example 1: a simply-supported skew slab bridge under a moving load A simply-supported skew slab bridge is considered in this example. The skew angle of the bridge is 20o . The bridge clear-span is 15.0 m. The cross section 14 of the bridge is shown in Fig. 5(a) and the following geometric and mechanical characteristics are used in the calculation: • Elastic modulus E is 3.2e10 N/m2 with Poisson coefficient ν = 0.25. • Properties of the cross section: I = 0.4987 m4 , J = 1.7067 m4 , m = 22.5 t/m and r = 0.2354 m. • Damping ratio ξ is 2%. The bridge is subjected to the action of a moving load of 170 kN with a constant speed of 100 km/h. The frequencies of the first five modes considered in the calculation are extracted and listed in Table 1 for all models. It can be noted that there is a very good agreement in the natural frequency between the analytical, simplified and FE models. In fact, the maximum difference in the frequency between models does not exceed 2%. The similar agreement is also observed with the dynamic responses in terms of vertical displacement and acceleration at the mid-span for three models, as shown in Fig. 6. From this result it can be remarked that the proposed simplified model is enable to simulate the vertical dynamic response of the simply-supported skew bridge. Table 1: Frequencies of first five modes of vibration of different models (in Hz) Modes Anal. Model Simpl. Model FE Model Description st 1 6.259 6.259 6.259 1 mode in FE model 2 23.548 23.910 23.518 2nd mode in FE model 3 53.361 53.312 53.312 3rd mode in FE model 4 94.423 94.471 94.072 4th mode in FE model 5 147.716 147.387 147.387 6th mode in FE model 4.2. Example 2: a simply-supported skew box-slab bridge under a convoy of moving loads This example attempts to simulate the dynamic response of a railway bridge under an HSLM A1 train [24] which is the desired application of the proposed 15 Displacement (mm) 0.2 0.0 −0.2 −0.4 Anal. model Simpl. model FE model −0.6 −0.8 0.0 0.2 0.4 0.6 0.8 1.0 Times (s) (a) Acceleration (m/s2 ) 0.2 0.1 0.0 −0.1 −0.2 0.0 Anal. model Simpl. model FE model 0.2 0.4 0.6 0.8 1.0 Times (s) (b) Figure 6: Dynamic responses at the mid-span under a moving load: a) displacement, b) acceleration analytical and simplified methods presented in this paper. The studied bridge is a typical box-slab bridge designed for single-track and has a cross section as shown in Fig. 5(b). A skew angle of 10o is considered. The bridge clear-span is 24.0 m. The geometric and mechanical properties of the bridge’s cross section used in the calculation are: • Elastic modulus E = 3.2e10 n/m2 with Poisson coefficient of 0.25. • I = 1.3921 m4 , J = 2.6741 m4 , m = 9.774 t/m and r = 0.5967 m. • Damping ratio ξ is 1%. The HSLM-A1 train consists of 18 intermediate coaches, a power coach and a 16 end coach on either sides of the train. In total, the train has 50 axles with a load of 170 kN/axle. The dynamic analysis are carried out for different train speeds ranging from 100 km/h to 300 km/h in increment of 5 km/h. The vertical displacement and acceleration at the mid-span are obtained and compared between the models. The envelope of maximum vertical displacement and acceleration are also depicted for all models in order to validate the proposed analytical and simplified model presented in this paper. Table 2 gives the natural frequencies of the first five modes of vibration considered in the calculation. It is known that for the simply-supported bridge the train velocities of resonance can be estimated using the following formula [24]: vi = f0 D with i = 1, 2, 3, ..., ∞ i (29) where f0 is the fundamental frequency; D is the regular distance between load axles and is 18 m for the HSLM-A1 train. According with this Eq. (29), the first three resonance peaks occur at train velocities of almost 382 km/h, 191 km/h and 127 km/h. The dynamic response at the train speed of 190 km/h is shown in Fig. 7. It can be observed that at this train speed (near the second critical speed) the responses are amplified by each axle passing the bridge. The envelope curves for the maximum vertical displacement and acceleration at the mid-span are shown in Fig. 8. It can be noted in Fig. 8 that in the considered range of train velocities two peaks of response (both displacement and acceleration) occur at speeds of 190 km/h and 125 km/h which are closed to the predicted critical trains. Therefore, it can be remarked that the estimation of the train velocities of resonance proposed by [24] is still valid for the skew bridge. Furthermore, from both Figs. 7 and 8 it can be concluded that the results obtained using the analytical and simplified model agree well with the ones obtained using the FE model. It should be noted that the time consumed for the calculation using the analytical or simplified model is approximately 50 times faster than the ones using the FE model: the CPU time required for completing a analysis using the 17 analytical model was 1.9 s while 130.5 s was the time for FE model in a standard PC equipped with Intel Xeon processor of 2.33 GHz and 4 GB of RAM. Table 2: Frequencies of first five modes of vibration of different models (in Hz) Modes Anal. Model Simpl. Model FE Model Description 1 5.878 5.878 5.878 1st mode in FE model 2 23.305 23.344 23.288 2nd mode in FE model 3 52.482 52.455 52.455 4th mode in FE model 4 93.276 93.209 93.153 6th mode in FE model 5 145.748 145.608 145.642 8th mode in FE model 5. Parametric study In this part of the paper, three parametric studies are performed using the simplified model in order to identify parameters that influence significantly the vertical dynamic response of the simply-supported skew bridge under the moving loads. In each study, the value of the studied parameter are changed. The dynamic responses under the HSLM-A1 train corresponding to each value of the parameter are obtained and depicted in function of the studied parameter. The basic properties of the skew bridge in Example 2 are adopted in this section. 5.1. Effect of skew angle Figure 9 shows how the maximum dynamic responses vary with the skew angle when the bridge is forced by the HSLM-A1 train. It can be observed from Fig. 9 that the skewness has an important influence on the maximum vertical displacement at the mid-span of the bridge: in general the displacement decreases as the skew angle increases. A sharp change in slope can be observed at the skew angle of 15◦ . From this value of the skew angle, the displacement decreases more quickly. Furthermore, the changing in the train velocity of resonance is also observed when the skewness is changed. In fact, the train velocity 18 Anal. model Simpl. model FE model Displacement (mm) 2 0 −2 −4 −6 0 1 2 3 4 5 Times (s) 6 7 8 9 6 7 8 9 (a) 4 Anal. model Simpl. model FE model Acceleration (m/s2 ) 3 2 1 0 −1 −2 −3 −4 0 1 2 3 4 5 Times (s) (b) Figure 7: Dynamic responses at the mid-span under the HSLM-A1 train at velocity of 190 km/h: a) displacement, b) acceleration of resonance increases as the skewness increases. Regarding the maximum acceleration at the mid-span, the skew angle does not has pronounced influence on it: the acceleration hardly increases when the skew angle grows. 5.2. Effect of torsional to flexural stiffness ratio For this study, the torsional stiffness (GJ) is changed with respect to the flexural stiffness (EI) such that the ratio between GJ and EI varies in a range from 0.5 to 1.5. Figure 10 shows the variation of the maximum dynamic responses at the mid-span as a function of the torsional to flexural stiffness ratio. It can be observed that the maximum vertical displacement increases slightly 19 Displacement (mm) 7 Anal. model Simpl. model FE model 6 5 4 3 100 120 140 160 180 200 220 Velocity (km/h) 240 260 280 300 (a) Acceleration (m/s2 ) 4 Anal. model Simpl. model FE model 3 2 1 0 100 120 140 160 180 200 220 Velocity (km/h) 240 260 280 300 (b) Figure 8: Envelope of the maximum response at the mid-span under the HSLM-A1 train: a) displacement, b) acceleration as the ratio increases, while the maximum acceleration is barely changed. It should be noted that the skew angle used for this study is constant and is 10◦ . This skew angle is in a range from 0◦ to 15◦ in which the skewness has small influence on the dynamic response of the bridge as mentioned in the preceding section and shown in Fig. 9(a). As a result of this, the torsional stiffness does not have a pronounced influence in the vertical deflection for small skew angles. For larger skew angle, 30◦ for example, the torsional stiffness has a noticeable effect on the maximum vertical displacement, as shown in Fig. 11(a). The maximum acceleration is almost completely unaffected by the torsional stiffness for 20 0 Acceleration (m/s2) Displacement (mm) 6.0 5.5 5.0 4.5 4.0 3.5 3.0 3.0 2.5 2.0 1.5 1.0 0.5 300 250 /h) m 200 (k y 5 10 150 ocit 15 20 Skew l e angle 25◦ 30 () 35 40 100 V 0 300 250 /h) m 200 (k y 5 10 150 ocit 15 20 Skew l e angle 25◦ 30 () 35 40 100 V (a) (b) Figure 9: Effect of skewness on the dynamic responses: a) displacement, b) acceleration both skew angles selected (see Fig. 10(b) and 11(b)). Displacement (mm) Acceleration (m/s2) 3.5 6.0 3.0 2.5 5.5 2.0 5.0 1.5 4.5 1.0 4.0 0.6 0.8 GJ1.0 /EI 1.2 1.4 0.5 300 250 /h) 200 (km y 150 ocit el 100 V 0.6 (a) 0.8 GJ1.0 /EI 1.2 1.4 100 300 250 /h) 200 (km y 150 ocit l Ve (b) Figure 10: Effect of torsional to flexural stiffness ratio on the dynamic responses for a skew angle of 10◦ : a) displacement, b) acceleration 5.3. Effect of the span length In this part of the paper, the influence of the span length on the dynamic response of the simply-support skew bridge is carried out. The span length is changed from 15 m to 35 m in increment of 5 m. In order to obtain a consistent comparison between the results obtained from the parametric study, the cross section of the bridge is redesigned for each span length, using the design criteria that the ratio between the depth of the cross section (h) and the span length 21 3.0 2.5 4.5 2.0 4.0 1.5 1.0 3.5 0.6 0.8 GJ1.0 /EI 1.2 1.4 Acceleration (m/s2) Displacement (mm) 5.5 5.0 0.5 3.0 300 250 /h) 200 (km y 150 ocit el 100 V 0.6 0.8 (a) GJ1.0 /EI 1.2 1.4 300 250 /h) m 200 (k y 150 ocit l e 100 V (b) Figure 11: Effect of torsional to flexural stiffness ratio on the maximum dynamic responses for a skew angle of 30◦ : a) displacement, b) acceleration (L) is constant and is 1/14. This ratio is usually applied in the railway bridge design. The depth of the cross section will be changed with the bridge’s length. The other dimensions of the cross section are considered as unmodified. The basic properties of the cross section needed for the parametric study are listed in Table 3. Table 3: Principal properties of the bridge for the parametric study L (m) h (m) EI (N.m2 ) GJ (N.m2 ) m (t/m) h/L 15.0 1.07 11.66e09 9.75e09 9.092 1/14 20.0 1.42 28.70e09 22.61e09 9.616 1/14 25.0 1.78 50.85e09 36.26e09 10.101 1/14 30.0 2.14 80.40e09 53.21e09 10.603 1/14 35.0 2.50 117.91e09 71.34e09 11.116 1/14 The first natural frequency corresponding to each span length is obtained and depicted in Fig. 12(a) for different skew angles varying from 0◦ to 40◦ and the variation of magnitude of the first natural frequency between the skew angle of 0◦ and 40◦ for each span length is also obtained and shown in Fig. 12(b). It can be observed that the variation of frequency for each span length is generated by the skewness effect. This variation is greater when the span length is shorter 22 and decreases almost linearly with span length. Therefore, it can be remarked that the span length decreases the skewness effect on the bridge in term of the natural frequency. 20 α = 0◦ α = 40◦ 9 15 Variation (%) First natural frequency (Hz) 10 8 7 6 10 5 5 4 15 20 25 30 Span length (m) 0 35 15.0 (a) 17.5 20.0 22.5 Span length (m) 25.0 (b) Figure 12: Influence of the span length on the natural frequency of the simply-supported skew bridge: a) first natural frequency, b) variation of frequency It is well known that the dynamic response of a bridge under the traffic loads depends on the properties of the vehicle traveling on the bridge and on the proper characteristics of the bridge. In this parametric study, the traffic loads are unmodified, but the characteristics of the bridge are changed with the span length. Therefore, the comparison of dynamic responses in term of displacement and acceleration in time-history at the determined train velocity is not consistent. For a consistent comparison, the peak corresponding to the second train velocity of resonance for each span length is compared, in particular, the dynamic amplification factor (DAF) of the vertical displacement and the maximum vertical acceleration at mid-span are used to compare and are depicted in Fig. 13. It can be observed that the DAF decreases as the span length increases. There is not a reduction of variation of magnitude of DAF of the displacement for different skew angles when the span length increases. However, the reduction of variation of magnitude of the maximum acceleration can be observed for different skew angles, for which it can be remarked that the span length reduces the skewness effect on the dynamic response of the bridge 23 in term of the vertical acceleration. 2.5 Acceleration (m/s2 ) 10 DAF 2.0 1.5 8 6 4 2 1.0 15 20 25 30 Span length (m) 35 15 (a) 20 25 30 Span length (m) 35 (b) Figure 13: Maximum dynamic responses at mid-span of the skew bridge at the peak corresponding to the second velocity of resonance for different skew angles: a) dynamic amplification factor of displacement, b) acceleration 6. Conclusions In this paper, an analytical model for determining the dynamic response of the simply-supported skew bridge under the moving loads is presented and a simplified model is also proposed. The modal superposition technique is used in both models to decompose the differential equation of motions. The natural frequencies and mode shapes and the orthogonality relationship are determined from the boundary conditions. The time-dependent modal equations are solved by the exact integration, and therefore, the both models are highly accurate, robust and computationally efficient. The proposed models have been validated with results obtained from the FE models using the same modal superposition method. Furthermore, from the results obtained in this paper, the following conclusions are made: • The estimation of the train velocities of resonance proposed by [24] is still valid for the simply-supported skew bridge. • The grade of skewness of the bridge plays important role in the dynamic behavior of the bridge in term of the vertical displacement. The maximum 24 vertical displacement decreases as the skew angle increases. The vibration of bridge in term of the vertical acceleration is hardly affected by the skewness. • There is a critical skew angle from which the effect of the skewness is more noticeable. For the cross section used in the parametric study, the critical skew angle is 15◦ . • The torsional stiffness really has important influence on the vibration of the bridge in term of the vertical displacement when the skew angle is larger than the critical skew angle. The vertical acceleration is unaffected by the torsional stiffness. • The span length reduces the skewness effect on the dynamic behavior of the skew bridge in term of the natural frequency and acceleration. 25 Appendix A. Parameters for the exact integration ! ξn p A=e sin ωD ∆t + cos ωD ∆t (A.1) 1 − ξn2   1 B = e−ξn ωn ∆t sin ωD ∆t (A.2) ωD ( " #) !   1 2ξn ξn 1 − 2ξn2 2ξn −ξn ωn ∆t C= 2 +e −p cos ωD ∆t sin ωD ∆t − 1 + ωn ωn ∆t ωD ∆t ωn ∆t 1 − ξn2 −ξn ωn ∆t (A.3) D=  2ξn 1 1− + e−ξn ωn ∆t ωn2 ωn ∆t  2ξn2 − 1 2ξn sin ωD ∆t + cos ωD ∆t ωD ∆t ωn ∆t  (A.4) A′ = −e−ξn ωn ∆t ωn p sin ωD ∆t 1 − ξn2 ! (A.5)  ξn sin ωD ∆t (A.6) B =e 1 − ξn2 " ( #) ! 1 1 ωn ξn 1 ′ −ξn ωn ∆t p C = 2 − +e cos ωD ∆t +p sin ωD ∆t + ωn ∆t ∆t 1 − ξn2 1 − ξn2 −ξn ωn ∆t ′  cos ωD ∆t − (A.7) D′ = " 1 1 − e−ξn ωn ∆t ωn2 ∆t where ωD = ωn p 1 − ξn2 ξ p n sin ωD ∆t + cos ωD ∆t 1 − ξn2 !# (A.8) Acknowledgement The authors are grateful to the support of MINECO of Spanish Government through the project EDINPF (Ref. BIA2015-71016-R) and to the support provided by the Technical University of Madrid, Spain. References [1] C. F. Kollbrunner, K. Basler, Torsion in Strucutres: an engineering approach, Springer-Verlag, Berlin, 1969. 26 [2] J. Manterola, Bridges: design, calculation and construction (in Spanish), Colegio de Ingenieros de Caminos, Canales y Puertos, Madrid, Spain, 2006. [3] A. A. Ghobarah, W. K. Tso, Seismic analysis of skewed highway bridges with intermediate supports, Earthquake Engineering & Structural Dynamics 2 (3) (1974) 235–248. [4] E. A. Maragakis, P. C. Jennings, Analytical models for the rigid body motions, Earthquake Engineering & Structural Dynamics 15 (January) (1987) 923–944. [5] R. R. Wakefield, A. S. Nazmy, D. P. Billington, ANALYSIS OF SEISMIC FAILURE IN SKEW RC BRIDGE, Journal of Structural Engineering 117 (3) (1991) 972–986. [6] J. Y. Meng, E. M. Lui, Seismic analysis and assessment of a skew highway bridge, Engineering Structures 22 (11) (2000) 1433–1452. [7] J. Y. MENG, E. M. LUI, Y. LIU, Dynamic Response of Skew Highway Bridges, Journal of Earthquake Engineering 5 (2) (2001) 205–223. [8] B. G. Nielson, R. DesRoches, Analytical seismic fragility curves for typical bridges in the central and southeastern United States, Earthquake Spectra 23 (3) (2007) 615–633. [9] A. Abdel-Mohti, G. Pekcan, Seismic response of skewed RC box-girder bridges, Earthquake Engineering and Engineering Vibration 7 (4) (2008) 415–426. [10] P. Kaviani, F. Zareian, E. Taciroglu, Seismic behavior of reinforced concrete bridges with skew-angled seat-type abutments, Engineering Structures 45 (2012) 137–150. [11] C. S. W. Yang, S. D. Werner, R. DesRoches, Seismic fragility analysis of skewed bridges in the central southeastern United States, Engineering Structures 83 (2015) 116–128. 27 [12] J.-Y. Meng, E. M. Lui, Refined stick model for dynamic analysis of skew highway bridges, Journal of Bridge Engineering 7 (3) (2002) 184–194. [13] G. Nouri, Z. Ahmadi, Influence of Skew Angle on Continuous Composite Girder Bridge, Journal of Bridge Engineering 17 (4) (2012) 617–623. [14] Y. Deng, B. M. Phares, L. Greimann, G. L. Shryack, J. J. Hoffman, Behavior of curved and skewed bridges with integral abutments, Journal of Constructional Steel Research 109 (2015) 115–136. [15] M. Mallick, P. Raychowdhury, Seismic analysis of highway skew bridges with nonlinear soil-pile interaction, Transportation Geotechnics 3 (2015) 36–47. [16] A. G. Bishara, M. C. Liu, N. D. El-Ali, Skew I-Beam Composite Bridges, Journal of Structural Engineering 119 (2) (1993) 399–419. [17] A. Helba, J. B. Kennedy, Skew composite bridges ultimate load, Canadian Journal of Civil Engineering 22 (1995) 1092–1103. [18] A. R. Khaloo, H. Mirzabozorg, Load Distribution Factors in Simply Supported Skew Bridges, Journal of Bridge Engineering 8 (4) (2003) 241–244. [19] C. Menassa, M. Mabsout, K. Tarhini, G. Frederick, Influence of skew angle on reinforced concrete slab bridges, Journal of Bridge Engineering 12 (2) (2007) 205–214. [20] D. B. Ashebo, T. H. T. Chan, L. Yu, Evaluation of dynamic loads on a skew box girder continuous bridge Part I: Field test and modal analysis, Engineering Structures 29 (6) (2007) 1052–1063. [21] X. H. He, X. W. Sheng, A. Scanlon, D. G. Linzell, X. D. Yu, Skewed concrete box girder bridge static and dynamic testing and analysis, Engineering Structures 39 (2012) 38–49. [22] A. K. Chopra, Dynamics of Structures: Theory and Applications to Earthquake Engineering, 4th Edition, Prentice Hall, 2012. 28 [23] R. Taylor, FEAP-finite element analysis program (2014). URL http://www.ce.berkeley/feap [24] CEN, EN 1991-2:2003 Actions on Structures - Part 2: Traffic loads on bridges, rue de Stassart, 36B-1050 Brussels (2003). 29
5cs.CE
Efficient PAC Learning from the Crowd arXiv:1703.07432v2 [cs.LG] 13 Apr 2017 Pranjal Awasthi∗ Avrim Blum† Nika Haghtalab‡ Yishay Mansour§ Abstract In recent years crowdsourcing has become the method of choice for gathering labeled training data for learning algorithms. Standard approaches to crowdsourcing view the process of acquiring labeled data separately from the process of learning a classifier from the gathered data. This can give rise to computational and statistical challenges. For example, in most cases there are no known computationally efficient learning algorithms that are robust to the high level of noise that exists in crowdsourced data, and efforts to eliminate noise through voting often require a large number of queries per example. In this paper, we show how by interleaving the process of labeling and learning, we can attain computational efficiency with much less overhead in the labeling cost. In particular, we consider the realizable setting where there exists a true target function in F and consider a pool of labelers. When a noticeable fraction of the labelers are perfect, and the rest behave arbitrarily, we show that any F that can be efficiently learned in the traditional realizable PAC model can be learned in a computationally efficient manner by querying the crowd, despite high amounts of noise in the responses. Moreover, we show that this can be done while each labeler only labels a constant number of examples and the number of labels requested per example, on average, is a constant. When no perfect labelers exist, a related task is to find a set of the labelers which are good but not perfect. We show that we can identify all good labelers, when at least the majority of labelers are good. 1 Introduction Over the last decade, research in machine learning and AI has seen tremendous growth, partly due to the ease with which we can collect and annotate massive amounts of data across various domains. This rate of data annotation has been made possible due to crowdsourcing tools, such as Amazon Mechanical TurkTM , that facilitate individuals’ participation in a labeling task. In the context of classification, a crowdsourced model uses a large pool of workers to gather labels for a given training data set that will be used for the purpose of learning a good classifier. Such learning environments that involve the crowd give rise to a multitude of design choices that do not appear in traditional learning environments. These include: How does the goal of learning from the crowd differs from the goal of annotating data by the crowd? What challenges does the high amount of noise typically found in curated data sets [Wais et al., 2010, Kittur et al., 2008, Ipeirotis et al., 2010] pose to the learning algorithms? How do learning and labeling processes interplay? How many labels are we willing to take per example? And, how much load can a labeler handle? ∗ Rutgers University, pranjal.awasthi@rutgers.edu Carnegie Mellon University, avrim@cs.cmu.edu. Supported in part by NSF grants CCF-1525971 and CCF-1535967. This work was done in part while the author was visiting the Simons Institute for the Theory of Computing. ‡ Carnegie Mellon University, nhaghtal@cs.cmu.edu. Supported in part by NSF grants CCF-1525971 and CCF-1535967 and a Microsoft Research Ph.D. Fellowship. This work was done in part while the author was visiting the Simons Institute for the Theory of Computing. § Blavatnik School of Computer Science, Tel-Aviv University, mansour@tau.ac.il. This work was done while the author was at Microsoft Research, Herzliya. Supported in part by a grant from the Science Foundation (ISF), by a grant from United States-Israel Binational Science Foundation (BSF), and by The Israeli Centers of Research Excellence (I-CORE) program (Center No. 4/11). † 1 In recent years, there have been many exciting works addressing various theoretical aspects of these and other questions [Slivkins and Vaughan, 2014], such as reducing noise in crowdsourced data [Dekel and Shamir, 2009], task assignment [Badanidiyuru et al., 2013, Tran-Thanh et al., 2014] in online or offline settings [Karger et al., 2014], and the role of incentives [Ho et al., 2013]. In this paper we focus on one such aspect, namely, how to efficiently learn and generalize from the crowd with minimal cost? The standard approach is to view the process of acquiring labeled data through crowdsourcing and the process of learning a classifier in isolation. In other words, a typical learning process involves collecting data labeled by many labelers via a crowdsourcing platform followed by running a passive learning algorithm to extract a good hypothesis from the labeled data. As a result, approaches to crowdsourcing focus on getting high quality labels per example and not so much on the task further down in the pipeline. Naive techniques such as taking majority votes to obtain almost perfect labels have a cost per labeled example that scales with the data size, namely log( m δ ) queries per label where m is the training data size and δ is the desired failure probability. This is undesirable in many scenarios when data size is large. Furthermore, if only a small fraction of the labelers in the crowd are perfect, such approaches will inevitably fail. An alternative is to feed the noisy labeled data to existing passive learning algorithms. However, we currently lack computationally efficient PAC learning algorithms that are provably robust to high amounts of noise that exists in crowdsourced data. Hence separating the learning process from the data annotation process results in high labeling costs or suboptimal learning algorithms. In light of the above, we initiate the study of designing efficient PAC learning algorithms in a crowdsourced setting where learning and acquiring labels are done in tandem. We consider a natural model of crowdsourcing and ask the fundamental question of whether efficient learning with little overhead in labeling cost is possible in this scenario. We focus on the classical PAC setting of Valiant [1984] where there exists a true target classifier f ∗ ∈ F and the goal is to learn F from a finite training set generated from the underlying distribution. We assume that one has access to a large pool of labelers that can provide (noisy) labels for the training set. We seek algorithms that run in polynomial time and produce a hypothesis with small error. We are especially interested in settings where there are computationally efficient algorithms for learning F in the consistency model, i.e. the realizable PAC setting. Additionally, we also want our algorithms to make as few label queries as possible, ideally requesting a total number of labels that is within a constant factor of the amount of labeled data needed in the realizable PAC setting. We call this O(1) overhead or cost per labeled example. Furthermore, in a realistic scenario each labeler can only provide labels for a constant number of examples, hence we cannot ask too many queries to a single labeler. We call the number of queries asked to a particular labeler the load of that labeler. Perhaps surprisingly, we show that when a noticeable fraction of the labelers in our pool are perfect all of the above objectives can be achieved simultaneously. That is, if F can be efficiently PAC learned in the realizable PAC model, then it can be efficiently PAC learned in the noisy crowdsourcing model with a constant cost per labeled example. In other words, the ratio of the number of label requests in the noisy crowdsourcing model to the number of labeled examples needed in the traditional PAC model with a perfect labeler is a constant and does not increase with the size of the data set. Additionally, each labeler is asked to label only a constant number of examples, i.e., O(1) load per labeler. Our results also answer an open question of Dekel and Shamir [2009] regarding the possibility of efficient noise robust PAC learning by performing labeling and learning simultaneously. When no perfect labelers exist, a related task is to find a set of the labelers which are good but not perfect. We show that we can identify the set of all good labelers, when at least the majority of labelers are good. 1.1 Overview of Results We study various versions of the model described above. In the most basic setting we assume that a large percentage, say 70% of the labelers are perfect, i.e., they always label according to the target function f ∗ . 2 The remaining 30% of the labelers could behave arbitrarily and we make no assumptions on them. Since the perfect labelers are in strong majority, a straightforward approach is to label each example with the majority vote over a few randomly chosen labelers, to produce the correct label on every instance with high probability. However, such an approach leads to a query bound of O(log m δ ) per labeled example, where m is the size of the training set and δ is the acceptable probability of failure. In other words, the cost per labeled example is O(log m δ ) and scales with the size of the data set. Another easy approach is to pick a few labelers at random and ask them to label all the examples. Here, the cost per labeled example is a constant but the approach is infeasible in a crowdsourcing environment since it requires a single or a constant number of labelers to label the entire data set. Yet another approach is to label each example with the majority vote of O(log 1ǫ ) labelers. While the labeled sample set created in this way only has error of ǫ, it is still unsuitable for being used with PAC learning algorithms as they are not robust to even small amounts of noise, if the noise is heterogeneous. So, the computational challenges still persist. Nevertheless, we introduce an algorithm that performs efficient learning with O(1) cost per labeled example and O(1) load per labeler. Theorem 4.3 (Informal) Let F be a hypothesis class that can be PAC learned in polynomial time to ǫ error with probability 1 − δ using mǫ,δ samples. Then F can be learned in polynomial time using O(mǫ,δ ) samples in a crowdsourced setting with O(1) cost per labeled example, provided a 21 + Θ(1) fraction of the labelers are perfect. Furthermore, every labeler is asked to label only 1 example. Notice that the above theorem immediately implies that each example is queried only O(1) times on average as opposed to the data size dependent O(log( m δ )) cost incurred by the naive majority vote style procedures. We next extend our result to the setting where the fraction of perfect labelers is significant but might be less than 12 , say 0.4. Here we again show that F can be efficiently PAC learned using O(mǫ,δ ) queries provided we have access to an “expert” that can correctly label a constant number of examples. We call such queries that are made to an expert golden queries. When the fraction of perfect labelers is close to 1 2 , say 0.4, we show that just one golden query is enough to learn. More generally, when the fraction of the perfect labelers is some α, we show that O(1/α) golden queries is sufficient to learn a classifier efficiently. We describe our results in terms of α, but we are particularly interested in regimes where α = Θ(1). Theorem 4.13 (Informal) Let F be a hypothesis class that can be PAC learned in polynomial time to ǫ error with probability 1 − δ using mǫ,δ samples. Then F can be learned in polynomial time using O(mǫ,δ ) samples in a crowdsourced setting with O( α1 ) cost per labeled example, provided more than an α fraction of the labelers are perfect for some constant α > 0. Furthermore, every labeler is asked to label only O( α1 ) examples and the algorithm uses at most α2 golden queries. The above two theorems highlight the importance of incorporating the structure of the crowd in algorithm design. Being oblivious to the labelers will result in noise models that are notoriously hard. For instance, if one were to assume that each example is labeled by a single random labeler drawn from the crowd, one would recover the Malicious Misclassification Noise of Rivest and Sloan [1994]. Getting computationally efficient learning algorithms even for very simple hypothesis classes has been a long standing open problem in this space. Our results highlight that by incorporating the structure of the crowd, one can efficiently learn any hypothesis class with a small overhead. Finally, we study the scenario when none of the labelers are perfect. Here we assume that the majority of the labelers are “good”, that is they provide labels according to functions that are all ǫ-close to the target function. In this scenario generating a hypothesis of low error is as hard as agnostic learning1 . Nonetheless, we show that one can detect all of the good labelers using expected O( 1ǫ log(n)) queries per labeler, where n is the target number of labelers desired in the pool. Theorem 5.1 (Informal) Assume we have a target set of n labelers that are partitioned into two sets, good and bad. Furthermore, assume that there are at least n2 good labelers who always provide labels according to 1 This can happen for instance when all the labelers label according to a single function f that is ǫ-far from f ∗ . 3 functions that are ǫ-close to a target function f ∗ . The set of bad labelers always provide labels according to functions that are at least 4ǫ away from the target. Then there is a polynomial time algorithm that identifies, with probability at least 1−δ, all the good labelers and none of the bad labelers using expected O( 1ǫ log( nδ )) queries per labeler. 1.2 Related Work Crowdsourcing has received significant attention in the machine learning community. As mentioned in the introduction, crowdsourcing platforms require one to address several questions that are not present in traditional modes of learning. The work of Dekel and Shamir [2009] shows how to use crowdsourcing to reduce the noise in a training set before feeding it to a learning algorithm. Our results answer an open question in their work by showing that performing data labeling and learning in tandem can lead to significant benefits. A large body of work in crowdsourcing has focused on the problem of task assignment. Here, workers arrive in an online fashion and a requester has to choose to assign specific tasks to specific workers. Additionally, workers might have different abilities and might charge differently for the same task. The goal from the requester’s point of view is to finish multiple tasks within a given budget while maintaining a certain minimum quality [Ho et al., 2013, Tran-Thanh et al., 2014]. There is also significant work on dynamic procurement where the focus is on assigning prices to the given tasks so as to provide incentive to the crowd to perform as many of them as possible within a given budget [Badanidiyuru et al., 2012, 2013, Singla and Krause, 2013]. Unlike our setting, the goal in these works is not to obtain a generalization guarantee or learn a function, but rather to complete as many tasks as possible within the budget. The work of Karger et al. [2011, 2014] also studies the problem of task assignment in offline and online settings. In the offline setting, the authors provide an algorithm based on belief propagation that infers the correct answers for each task by pooling together the answers from each worker. They show that their approach performs better than simply taking majority votes. Unlike our setting, their goal is to get an approximately correct set of answers for the given data set and not to generalize from the answers. Furthermore, their model assumes that each labeler makes an error at random independently with a certain probability. We, on the other hand, make no assumptions on the nature of the bad labelers. Another related model is the recent work of Steinhardt et al. [2016]. Here the authors look at the problem of extracting top rated items by a group of labelers among whom a constant fraction are consistent with the true ratings of the items. The authors use ideas from matrix completion to design an algorithm that can recover the top rated items with an ǫ fraction of the noise provided every labeler rates ∼ ǫ14 items and one has access to ∼ ǫ12 ratings from a trusted expert. Their model is incomparable to ours since their goal is to recover the top rated items and not to learn a hypothesis that generalizes to a test set. Our results also shed insights into the notorious problem of PAC learning with noise. Despite decades of research into PAC learning, noise tolerant polynomial time learning algorithms remain elusive. There has been substantial work on PAC learning under realistic noise models such as the Massart noise or the Tsybakov noise models [Bousquet et al., 2005]. However, computationally efficient algorithms for such models are known in very restricted cases [Awasthi et al., 2015, 2016]. In contrast, we show that by using the structure of the crowd, one can indeed design polynomial time PAC learning algorithms even when the noise is of the type mentioned above. More generally, interactive models of learning have been studied in the machine learning community [Cohn et al., 1994, Dasgupta, 2005, Balcan et al., 2006, Koltchinskii, 2010, Hanneke, 2011, Zhang and Chaudhuri, 2015, Yan et al., 2016]. We describe some of these works in Appendix A. 4 2 Model and Notations Let X be an instance space and Y = {+1, −1} be the set of possible labels. A hypothesis is a function f : X → Y that maps an instance x ∈ X to its classification y. We consider the realizable setting where there is a distribution over X × Y and a true target function in hypothesis class F. More formally, we consider a distribution D over X × Y and an unknown hypothesis f ∗ ∈ F, where errD (f ∗ ) = 0. We denote the marginal of D over X by D|X . The error of a hypothesis f with respect to distribution D is defined as errD (f ) = Pr(x,f ∗ (x))∼D [f (x) 6= f ∗ (x)]. In order to achieve our goal of learning f ∗ well with respect to distribution D, we consider having access to a large pool of labelers, some of whom label according to f ∗ and some who do not. Formally, labeler i is defined by its corresponding classification function gi : X → Y. We say that gi is perfect if errD (gi ) = 0. We consider a distribution P that is uniform over all labelers and let α = Pri∼P [errD (gi ) = 0] be the fraction of perfect labelers. We allow an algorithm to query labelers on instances drawn from D|X . Our goal is to design learning algorithms that efficiently learn a low error classifier while maintaining a small overhead in the number of labels. We compare the computational and statistical aspects of our algorithms to their PAC counterparts in the realizable setting. In the traditional PAC setting with a realizable distribution, mǫ,δ denotes the number of samples needed for learning F. That is, mǫ,δ is the total number of labeled samples drawn from the realizable distribution D needed to output a classifier f that has errD (f ) ≤ ǫ, with probability 1 − δ. We know from the VC theory [Anthony and Bartlett, 1999], that for  a hypothesis  class F with VC-dimension d and no additional . Furthermore, we assume that efficient algorithms assumptions on F, mǫ,δ ∈ O ǫ−1 d ln 1ǫ + ln 1δ for the realizable setting exist. That is, we consider an oracle OF that for a set of labeled instances S, returns a function f ∈ F that is consistent with the labels in S, if one such function exists, and outputs “None” otherwise. Given an algorithm in the noisy crowd-sourcing setting, we define the average cost per labeled example of the algorithm, denoted by Λ, to be the ratio of the number of label queries made by the algorithm to the number of labeled examples needed in the traditional realizable PAC model, mǫ,δ . The load of an algorithm, denoted by λ, is the maximum number of label queries that have to be answered by an individual labeler. In other words, λ is the maximum number of labels queried from one labeler, when P has an infinitely large support. 2 When the number of labelers is fixed, such as in Section 5, we define the load to simply be the number of queries answered by a single labeler. Moreover, we allow an algorithm to directly query the target hypothesis f ∗ on a few, e.g., O(1), instances drawn from D|X . We call these “golden queries” and denote their total number by Γ. Given a set of labelers L and an instance x ∈ X , we define MajL (x) to be the label assigned to x by the majority of labelers in L. Moreover, we denote by Maj-sizeL (x) the fraction of the labelers in L that agree with the label MajL (x). Given a set of classifiers H, we denote by MAJ (H) the classifier that for each x returns prediction MajH (x). Given a distribution P over labelers and a set of labeled examples S, we denote by P|S the distribution P conditioned on labelers that agree with labeled samples (x, y) ∈ S. We consider S to be small, typically of size O(1). Note that we can draw a labeler from P|S by first drawing a labeler according to P and querying it on all the labeled instances in S. Therefore, when P has infinitely large support, the load of an algorithm is the maximum size of S that P is ever conditioned on. 2 The concepts of total number of queries and load may be seen as analogous to work and depth in parallel algorithms, where work is the total number of operations performed by an algorithm and depth is the maximum number of operations that one processor has to perform in a system with infinitely many processors. 5 3 A Baseline Algorithm and a Road-map for Improvement In this section, we briefly describe a simple algorithm and the approach we use to improve over it. Consider a very simple baseline algorithm for the case of α > 21 : BASELINE: Draw a sample of size m = mǫ,δ from D|X and label each x ∈ S by MajL (x),  where L ∼ P k for k = O (α − 0.5)−2 ln m is a set of randomly drawn labelers. Return δ classifier OF (S). That is, the baseline algorithm queries enough labelers on each sample such that with probability 1 − δ all the labels are correct. Then, it learns a classifier using this labeled set. It is clear that the performance of BASELINE is far from being desirable. First, this approach takes log(m/δ) more labels than it requires samples, leading to an average cost per labeled example that increases with the size of the sample set. Moreover, when perfect labelers form a small majority of the labelers, i.e., α = 12 + o(1), the number of labels needed to correctly label an instance increases drastically. Perhaps even more troubling is that if the perfect labelers are in minority, i.e., α < 21 , S may be mislabeled and OF (S) may return a classifier that has large error, or no classifier at all. In this work, we improve over BASELINE in both aspects. In Section 4, we improve the log(m/δ) average cost per labeled example by interleaving the two processes responsible for learning a classifier and querying labels. In particular, BASELINE first finds high quality labels, i.e., labels that are correct with high probability, and then learns a classifier that is consistent with those labeled samples. However, interleaving the process of learning and acquiring high quality labels can make both processes more efficient. At a high level, for a given classifier h that has a larger than desirable error, one may be able to find regions where h performs particularly poorly. That is, the classifications provided by h may differ from the correct label of the instances. In turn, by focusing our effort for getting high quality labels on these regions we can output a correctly labeled sample set using less label queries overall. These additional correctly labeled instances from regions where h performs poorly can help us improve the error rate of h in return. In Section 4, we introduce an algorithm that draws on ideas from boosting and a probabilistic filtering approach that we develop in this work to facilitate interactions between learning and querying. In Section 4.1, we remove the dependence of label complexity on (α − 0.5)−2 using O(1/α) golden queries. At a high level, instances where only a small majority of labelers agree are difficult to label using queries asked from labelers. But, these instances are great test cases that help us identify a large fraction of imperfect labelers. That is, we can first ask a golden query on one such instance to get its correct label and from then on only consider labelers that got this label correctly. In other words, we first test the labelers on one or very few tests questions, if they pass the tests, then we ask them real label queries for the remainder of the algorithm, if not, we never consider them again. 4 An Interleaving Algorithm In this section, we improve over the average cost per labeled example of the BASELINE algorithm, by interleaving the process of learning and acquiring high quality labels. Our Algorithm 2 facilitates the interactions between the learning process and the querying process using ideas from classical PAC learning and adaptive techniques we develop in this work. For ease of presentation, we first consider the case where α = 12 +Θ(1), say α ≥ 0.7, and introduce an algorithm and techniques that work in this regime. In Section 4.1, we show how our algorithm can be modified to work with any value of α. For convenience, we assume in the analysis below that distribution D is over a discrete space. This is in fact without loss of generality, since using uniform convergence one can instead work with the uniform distribution over an unlabeled sample multiset of size O( ǫd2 ) drawn from D|X . Here, we provide an overview of the techniques and ideas used in this algorithm. 6 Boosting: In general, boosting algorithms [Schapire, 1990, Freund, 1990, Freund and Schapire, 1995] provide a mechanism for producing a classifier of error ǫ using learning algorithms that are only capable of producing classifiers with considerably larger error rates, typically of error p = 12 − γ for small γ. In particular, early work of Schapire [1990] in this space shows how one can combine 3 classifiers of error p to get a classifier of error O(p2 ), for any p > 0. Theorem 4.1 (Schapire [1990]). For any p > 0 and distribution D, consider three classifiers: 1) classifier h1 such that errD (h1 ) ≤ p; 2) classifier h2 such that errD2 (h2 ) ≤ p, where D2 = 12 DC + 21 DI for distributions DC and DI that denote distribution D conditioned on {x | h1 (x) = f ∗ (x)} and {x | h1 (x) 6= f ∗ (x)}, respectively; 3) classifier h3 such that errD3 (h3 ) ≤ p, where D3 is D conditioned on {x | h1 (x) 6= h2 (x)}. Then, errD (MAJ (h1 , h2 , h3 )) ≤ 3p2 − 2p3 . As opposed to the main motivation for boosting where the learner only has access to a learning algorithm of error p = 12 − γ, in our setting we can learn a classifier to any desired error rate p as long as we have a sample set of mp,δ correctly labeled instances. The larger the error rate p, the smaller the total number of label queries needed for producing a correctly labeled set of the appropriate size. We use this idea in √ Algorithm 2. In particular, we learn classifiers of error O( ǫ) using sample sets of size O(m√ǫ,δ ) that are labeled by majority vote of O(log(m√ǫ,δ )) labelers, using fewer label queries overall than BASELINE. Probabilistic Filtering: Given classifier h1 , the second step of the classical boosting algorithm requires distribution D to be reweighed based on the correctness of h1 . This step can be done by a filtering process as follows: Take a large set of labeled samples from D and divide them to two sets depending on whether or not the instances are mislabeled by h1 . Distribution D2 , in which instances mislabeled by h1 make up half of the weight, can be simulated by picking each set with probability 12 and taking an instance from that set uniformly at random. To implement filtering in our setting, however, we would need to first get high quality labels for the set of instances used for simulating D2 . Furthermore, this sample set is typically large, since at least 1p mp,δ random samples from D are needed to simulate D2 that has half of its weight on the points that √ h1 mislabels (which is a p fraction of the total points). In ourcase where p = O( ǫ), getting high quality m labels for such a large sample set requires O mǫ,δ ln δǫ,δ label queries, which is as large as the total number of labels queried by BASELINE. Algorithm 1 F ILTER(S, h)  Let SI = ∅ and N = log 1ǫ . for x ∈ S do for t = 1, . . . , N do Draw a random labeler i ∼ P and let yt = gi (x) If t is odd and Maj(y1:t ) = h(x), then break. end Let SI = SI ∪ {x}. // Reaches this step when for all t, Maj(y1:t ) 6= h(x) end return SI In this work, we introduce a probabilistic filtering approach, called F ILTER, that only requires O (mǫ,δ ) label queries, i.e., O(1) cost per labeled example. Given classifier h1 and an unlabeled sample set S, F ILTER (S, h1 ) returns a set SI ⊆ S such that for any x ∈ S that is mislabeled by h1 , x ∈ SI with probability at least Θ(1). Moreover, any x that is correctly labeled by h1 is most likely not included in SI . This procedure is described in detail in Algorithm 1. Here, we provide a brief description of its working: For any x ∈ S, F ILTER queries one labeler at a time, drawn at random, until the majority of the labels it has 7 acquired so far agree with h1 (x), at which point F ILTER removes x from consideration. On the other hand, if the majority of the labels never agree with h1 (x), F ILTER adds x to the output set SI . Consider x ∈ S that is correctly labeled by h. Since each additional label agrees with h1 (x) = f ∗ (x) with probability ≥ 0.7, with high probability the majority of the labels on x will agree with f ∗ (x) at some point, in which case F ILTER stops asking for more queries and removes x. As we show in Lemma 4.9 this happens within O(1) queries most of the time. On the other hand, for x that is mislabeled by h, a labeler agrees with h1 (x) with probability ≤ 0.3. Clearly, for one set of random labelers —one snapshot of the labels queried by F ILTER— the majority label agrees with h1 (x) with a very small probability. As we show in Lemma 4.6, even when considering the progression of all labels queried by F ILTER throughout the process, with probability Θ(1) the majority label never agrees with h1 (x). Therefore, x is added to SI with probability Θ(1). Super-sampling: Another key technique we use in this work is super-sampling. In short, this means that as long as we have the correct label of the sampled points and we are in the realizable setting, more samples never hurt the algorithm. Although this seems trivial at first, it does play an important role in our approach. In particular, our probabilistic filtering procedure does not necessarily simulate D2 but a distribution D ′ , such that Θ(1)d2 (x) ≤ d′ (x) for all x, where d2 and d′ are the densities of D2 and D ′ , respectively. At a high level, sampling Θ(m) instances from D ′ simulates a super-sampling process that samples m instances from D2 and then adds in some arbitrary instances. This is formally stated below and is proved in Appendix B. Lemma 4.2. Given a hypothesis class F consider any two discrete distributions D and D ′ such that for all x, d′ (x) ≥ c · d(x) for an absolute constant c > 0, and both distributions are labeled according to f ∗ ∈ F. There exists a constant c′ > 1 such that for any ǫ and δ, with probability 1 − δ over a labeled sample set S of size c′ mǫ,δ drawn from D ′ , OF (S) has error of at most ǫ with respect to distribution D. With these techniques at hand, we present Algorithm 2. At a high level, the algorithm proceeds in three phases, one for each classifier used by Theorem 4.1. In Phase 1, the algorithm learns h1 such that √ errD (h1 ) ≤ 12 ǫ. In Phase 2, the algorithm first filters a set of size O(mǫ,δ ) into the set SI and takes an m additional set SC of Θ(m√ǫ,δ ) samples. Then, it queries O(log( δǫ,δ )) labelers on each instance in SI and SC to get their correct labels with high probability. Next, it partitions these instances to two different sets based on whether or not h1 made a mistake on them. It then learns h2 on a sample set W that is drawn by √ weighting these two sets equally. As we show in Lemma 4.8, errD2 (h2 ) ≤ 12 ǫ. In phase 3, the algorithm learns h3 on a sample set S3 drawn from D|X conditioned on h1 and h2 disagreeing. Finally, the algorithm returns MAJ (h1 , h2 , h3 ). + Θ(1) case). Algorithm 2 uses oracle OF , runs in time poly(d, 1ǫ , ln( 1δ )) and with  √  m√  ǫ,δ + 1 cost per labeled probability 1 − δ returns f ∈ F with errD (f ) ≤ ǫ, using Λ = O ǫ log δm√  ǫ,δ example, Γ = 0 golden queries, and λ = 1 load. Note that when √1ǫ ≥ log , the above cost per δ labeled sample is O(1). Theorem 4.3 (α = 1 2 We start our analysis of Algorithm 2 by stating that C ORRECT-L ABEL (S, δ) labels S correctly, with probability 1 − δ. This is direct application of the Hoeffding bound and its proof is omitted. Lemma 4.4. For any unlabeled sample set S, δ > 0, and S = C ORRECT-L ABEL (S, δ), with probability 1 − δ, for all (x, y) ∈ S, y = f ∗ (x). √ Note that as a direct consequence of the above lemma, Phase 1 of Algorithm 2 achieves error of O( ǫ). √ Lemma 4.5. In Algorithm 2, with probability 1 − 3δ , errD (h1 ) ≤ 12 ǫ. 8 Algorithm 2 I NTERLEAVING : B OOSTING B Y P ROBABILISTIC F ILTERING FOR α = 21 + Θ(1) Input: Given a distribution D|X , a class of hypotheses F, parameters ǫ and δ. Phase 1: Let S1 = C ORRECT-L ABEL (S1 , δ/6), for a set of sample S1 of size 2m√ǫ,δ/6 from D|X . Let h1 = OF (S1 ). Phase 2: Let SI = F ILTER (S2 , h1 ), for a set of samples S2 of size Θ(mǫ,δ ) drawn from D|X . Let SC be a sample set of size Θ(m√ǫ,δ ) drawn from D|X . Let SAll = C ORRECT-L ABEL (SI ∪ SC , δ/6). Let WI = {(x, y) ∈ SAll | y 6= h1 (x)} and Let WC = SAll \ WI . Draw a sample set W of size Θ(m√ǫ,δ ) from a distribution that equally weights WI and WC . Let h2 = OF (W ). Phase 3: Let S3 = C ORRECT-L ABEL (S3 , δ/6), for a sample set S3 of size 2m√ǫ,δ/6 drawn from D|X conditioned on h1 (x) 6= h2 (x). Let h3 = OF (S3 ). return Maj(h1 , h2 , h3 ). C ORRECT-L ABEL(S, δ): for x ∈ S do Let L ∼ P k for a set of k = O(log( |S| δ )) labelers drawn from P and S ← S ∪ {(x, Maj L (x))}. end return S. Next, we prove that F ILTER removes instances that are correctly labeled by h1 with good probability and retains instances that are mislabeled by h1 with at least a constant probability. Lemma 4.6. Given any sample set S and classifier h, for every x ∈ S √ 1. If h(x) = f ∗ (x), then x ∈ F ILTER (S, h) with probability < ǫ. 2. If h(x) 6= f ∗ (x), then x ∈ F ILTER (S, h) with probability ≥ 0.5. Proof. For the first claim, note that x ∈ SI only if Maj(y1:t ) 6= h(x) for all t ≤ N . Consider t = N time step. Since each random query agrees with f ∗ (x) = h(x) with probability ≥ 0.7 independently, majority of √ √ N = O(log(1/ ǫ)) labels are correct with probability at least 1 − ǫ. Therefore, the probability that the √ majority label disagrees with h(x) = f ∗ (x) at every time step is at most ǫ. In the second claim, we are interested in the probability that there exists some t ≤ N , for which Maj(y1:t ) = h(x) 6= f ∗ (x). This is the same as the probability of return in biased random walks, also called the probability of ruin in gambling [Feller, 2008], where we are given a random walk that takes a step to the right with probability ≥ 0.7 and takes a step to the left with the remaining probability and we are interested in the probability that this walk ever crosses the origin to the left while taking N or even infinitely E.1), the probability that many steps. Using the probability of return for biased random (see Theorem   walks  N N +1   0.7 0.7 Maj(y1:t ) 6= f ∗ (x) ever is at most 1 − 1−0.7 / 1 − 1−0.7 < 37 . Therefore, for each x such that h(x) 6= f ∗ (x), x ∈ SI with probability at least 4/7. √ In the remainder of the proof, for ease of exposition we assume that not only errD (h1 ) ≤ 12 ǫ as per √ Lemma 4.5, but in fact errD (h1 ) = 21 ǫ. This assumption is not needed for the correctness of the results but it helps simplify the notation and analysis. As a direct consequence of Lemma 4.6 and application of the 9 Chernoff bound, we deduce that with high probability W I , W C , and SI all have size Θ(m√ǫ,δ ). The next lemma, whose proof appears in Appendix C, formalizes this claim. Lemma 4.7. With probability 1 − exp(−Ω(m√ǫ,δ )), W I , W C , and SI all have size Θ(m√ǫ,δ ). The next lemma combines the probabilistic filtering and super-sampling techniques to show that h2 has √ the desired error O( ǫ) on D2 . Lemma 4.8. Let DC and DI denote distribution D when it is conditioned on {x | h1 (x) = f ∗ (x)} and √ {x | h1 (x) 6= f ∗ (x)}, respectively, and let D2 = 12 DI + 21 DC . With probability 1−2δ/3, errD2 (h2 ) ≤ 12 ǫ. Proof. Consider distribution D ′ that has equal probability on the distributions induced by WI and WC and let d′ (x) denote the density of point x in this distribution. Relying on our super-sampling technique (see Lemma 4.2), it is sufficient to show that for any x, d′ (x) = Θ(d2 (x)). √ For ease of presentation, we assume that Lemma 4.5 holds with equality, i.e., errD (h1 ) is exactly 12 ǫ with probability 1 − δ/3. Let d(x), d2 (x), dC (x), and dI (x) be the density of instance x in distributions D, D2 , DC , and DI , respectively. Note that, for any x such that h1 (x) = f ∗ (x), we have d(x) = dC (x)(1 − 1√ 1√ ∗ 2 ǫ). Similarly, for any x such that h1 (x) 6= f (x), we have d(x) = dI (x) 2 ǫ. Let NC (x), NI (x), MC (x) and MI (x) be the number of occurrences of x in the sets SC , SI , WC and WI , respectively. For any x, there are two cases: If h1 (x) = f ∗ (x): Then, there exist absolute constants c1 and c2 according to Lemma 4.7, such that   E[NC (x)] |SC | · d(x) E[MC (x)] 1 MC (x) ′ ≥ = ≥ d (x) = E √ √ 2 c · m c · m c1 · m√ǫ,δ |WC | 1 1 ǫ,δ ǫ,δ √ |SC | · dC (x) · (1 − 12 ǫ) c2 d2 (x) ≥ c2 dC (x) = = , √ c1 · m ǫ,δ 2 where the second and sixth transitions are by the sizes of WC and |SC | and the third transition is by the fact that if h(x) = f ∗ (x), MC (x) > NC (x). If h1 (x) 6= f ∗ (x): Then, there exist absolute constants c′1 and c′2 according to Lemma 4.7, such that   4 E[NI (x)] 1 E[MI (x)] MI (x) 7 d(x)|S2 | ≥ ≥ d (x) = E ≥ ′ 2 c1 · m√ǫ,δ c′1 · m√ǫ,δ c′1 · m√ǫ,δ |WI | 1√ 4 c′2 d2 (x) ′ 7 dI (x) 2 ǫ · |S2 | ≥ c d (x) = = , I 2 ′ c1 · m√ǫ,δ 2 ′ where the second and sixth transitions are by the sizes of WI and |S2 |, the third transition is by the fact that if h(x) 6= f ∗ (x), MI (x) > NI (x), and the fourth transition holds by part 2 of Lemma 4.6. √ Using the super-sampling guarantees of Lemma 4.2, with probability 1 − 2δ/3, errD2 (h2 ) ≤ ǫ/2. The next claim shows that the probabilistic filtering step queries a few labels only. At a high level, this is achieved by showing that any instance x for which h1 (x) = f ∗ (x) contributes only O(1) queries, with high probability. On the other hand, instances that h1 mislabeled may each get log( 1ǫ ) queries. But, because there are only few such points, the total number of queries these instances require is a lower order term. √ Lemma 4.9. Let S be a sample set drawn from distribution D and let h be such that errD (h) ≤ ǫ. With √ probability 1 − exp(−Ω(|S| ǫ)), F ILTER (S, h) makes O(|S|) label queries. 10 √ Proof. Using Chernoff bound, with probability 1 − exp (−|S| ǫ) the total number of points in S where h √ √ disagrees with f ∗ is O(|S| ǫ). The number of queries spent on these points is at most O (|S| ǫ log(1/ǫ)) ≤ O(|S|). Next, we show that for each x such that h(x) = f ∗ (x), the number of queries taken until a majority of them agree with h(x) is a constant. Let us first show that this is the case in expectation. Let Ni be the expected number of labels queried until we have i more correct labels than incorrect ones. Then N1 ≤ 0.7(1) + 0.3(N2 + 1), since with probability at least α ≥ 0.7, we receive one more correct label and stop, and with probability ≤ 0.3 we get a wrong label in which case we have to get two more correct labels in future. Moreover, N2 = 2N1 , since we have to get one more correct label to move from N2 to N1 and then one more. Solving these, we have that N1 ≤ 2.5. Therefore, the expected total number of queries is at most O(|S|). Next, we show that this random variable is also well-concentrated. Let Lx be a random variable that indicates the total number of queries on x before we have one more correct label than incorrect labels. Note that Lx is an unbounded random variable, therefore concentration bounds such as Hoeffding or Chernoff do not work here. Instead, to show that Lx is well-concentrated, we prove that the Bernstein inequality (see Theorem E.2) holds. That is, as we show in Appendix D, for any x, the Bernstein inequality is statisfied by the fact that for any i > 1, E[(Lx − E[Lx ])i ] ≤ 50(i + 1)! e4i . Therefore, over all instances P in S, x∈S Lx ∈ O(|S|) with probability 1 − exp(−|S|). Finally, we have all of the ingredients needed for proving our main theorem. Proof of Theorem 4.3. We first discuss the number of label queries Algorithm 2 makes. The total number of labels queried by Phases 1 and 3 is attributed to the labels  queried by C ORRECT-L ABEL (S1 , δ) and  √ √ C ORRECT-L ABEL (S3 , δ/6), which is O m ǫ,δ log(m ǫ,δ /δ) . By Lemma 4.7, |SI ∪ SC | ≤ O(m√ǫ,δ )   almost surely. Therefore, C ORRECT-L ABEL (SI ∪ SC , δ/6) contributes O m√ǫ,δ log(m√ǫ,δ /δ) labels. Moreover, as we showed in Lemma 4.9, F ILTER (S2 , h1 ) queries O(mǫ,δ) labels,   almost surely. So, the m√ ǫ,δ total number of labels queried by Algorithm 2 is at most O m√ǫ,δ log + mǫ,δ . This leads to δ  √  m√  ǫ,δ + 1 cost per labeled example. Λ=O ǫ log δ It remains to show that MAJ (h1 , h2 , h3 ) has error ≤ ǫ on D. Since C ORRECT-L ABEL (S1 , δ/6) and √ √ C ORRECT-L ABEL (S3 , δ/6) return correctly labeled sets , errD (h1 ) ≤ 21 ǫ and errD3 (h3 ) ≤ 12 ǫ, where √ D3 is distribution D conditioned on {x | h1 (x) 6= h2 (x)}. As we showed in Lemma 4.8, errD2 (h2 ) ≤ 12 ǫ with probability 1 − 2δ/3. Using the boosting technique of Schapire [1990] described in Theorem 4.1, we conclude that MAJ (h1 , h2 , h3 ) has error ≤ ǫ on D. 4.1 The General Case of Any α In this section, we extend Algorithm 2 to handle any value of α, that does not necessarily satisfy α > 1 1 2 + Θ(1). We show that by using O( α ) golden queries, it is possible to efficiently learn any function class with a small overhead. There are two key challenges that one needs to overcome when α < 21 + o(1). First, we can no longer assume that by taking the majority vote over a few random labelers we get the correct label of an instance. Therefore, C ORRECT-L ABEL (S, δ) may return a highly noisy labeled sample set. This is problematic, since efficiently learning h1 , h2 , and h3 using oracle OF crucially depends on the correctness of the input labeled set. Second, F ILTER (S, h1 ) no longer “filters” the instances correctly based on the classification error of h1 . In particular, F ILTER may retain a constant fraction of instances where h1 is in fact correct, and it may throw out instances where h1 was incorrect with high probability. Therefore, the per-instance guarantees of Lemma 4.6 fall apart, immediately. We overcome both of these challenges by using two key ideas outlined below. 11 Pruning: As we alluded to in Section 3, instances where only a small majority of labelers are in agreement are great for identifying and pruning away a noticeable fraction of the bad labelers. We call these instances good test cases. In particular, if we ever encounter a good test case x, we can ask a golden query y = f ∗ (x) and from then on only consider the labelers who got this test correctly, i.e., P ← P|{(x,y)} . Note that if we make our golden queries when Maj-sizeP (x) ≤ 1 − α2 , at least an α2 fraction of the labelers would be pruned. This can be repeated at most O( α1 ) times before the number of good labelers form a strong majority, in which case Algorithm 2 succeeds. The natural question is how would we measure Maj-sizeP (x) using few label queries? Interestingly, C ORRECT-L ABEL (S, δ) can be modified to detect such good test cases by measuring the empirical agreement rate on a set L of O( α12 log( |S| δ )) labelers. This is shown in procedure P RUNE - AND -L ABEL as part Algorithm 3. That is, if Maj-sizeL (x) > 1 − α/4, we take MajL (x) to be the label, otherwise we test and prune the labelers, and then restart the procedure. This ensures that whenever we use a sample set that is labeled by P RUNE - AND -L ABEL , we can be certain of the correctness of the labels. This is stated in the following lemma, and proved in Appendix F.1. Lemma 4.10. For any unlabeled sample set S, δ > 0, with probability 1−δ, either P RUNE - AND -L ABEL (S, δ) prunes the set of labelers or S = P RUNE - AND -L ABEL (S, δ) is such that for all (x, y) ∈ S, y = f ∗ (x). As an immediate result, the first phase of Algorithm 3 succeeds in computing h1 , such that errD (h1 ) ≤ Moreover, every time P RUNE - AND -L ABEL prunes the set of labelers, the total fraction of good labeler among all remaining labelers increase. As we show, after O(1/α) prunings, the set of good labelers is guaranteed to form a large majority, in which case Algorithm 2 for the case of α = 21 + Θ(1) can be used. This is stated in the next lemma and proved in Appendix F.2. 1√ 2 ǫ. Lemma 4.11. For any δ, with probability 1 − δ, the total number of times that Algorithm 3 is restarted as a result of pruning is O( α1 ). Robust Super-sampling: The filtering step faces a completely different challenge: Any point that is a good test case can be filtered the wrong way. However, instances where still a strong majority of the labelers agree are not affected by this problem and will be filtered correctly. Therefore, as a first step we ensure that the total number of good test cases that were not caught before F ILTER starts is small. For this purpose, we start the algorithm by calling C ORRECT-L ABEL on a sample of size O( 1ǫ log( 1δ )), and if no test points were found in this set, then with high probability the total fraction of good test cases in the underlying distribution is at most 2ǫ . Since the fraction of good test cases is very small, one can show that except for √ an ǫ fraction, the noisy distribution constructed by the filtering process will, for the purposes of boosting, satisfy the conditions needed for the super-sampling technique. Here, we introduce a robust version of the √ super-sampling technique to argue that the filtering step will indeed produce h2 of error O( ǫ). Lemma 4.12 (Robust Super-Sampling Lemma). Given a hypothesis class F consider any two discrete distributions D and D ′ such that except for an ǫ fraction of the mass under D, we have that for all x, d′ (x) ≥ c · d(x) for an absolute constant c > 0 and both distributions are labeled according to f ∗ ∈ F. There exists a constant c′ > 1 such that for any ǫ and δ, with probability 1 − δ over a labeled sample set S of size c′ mǫ,δ drawn from D ′ , OF (S) has error of at most 2ǫ with respect to D. By combining these techniques at every execution of our algorithm we ensure that if a good test case is ever detected we prune a small fraction of the bad labelers and restart the algorithm, and if it is never detected, our algorithm returns a classifier of error ǫ. Theorem 4.13 (Any α). Suppose the fraction of the perfect labelers is α and let δ′ = cαδ for small enough constant c > 0. Algorithm 3 uses oracle OF , runs in time poly(d, α1 , 1ǫ , ln( 1δ )), uses a training set of size 12 Algorithm 3 B OOSTING B Y P ROBABILISTIC F ILTERING FOR ANY α Input: Given a distribution D|X and P , a class of hypothesis F, parameters ǫ, δ, and α. Phase 0: If α > 43 , run Algorithm 2 and quit. Let δ′ = cαδ for small enough c > 0 and draw S0 of O( 1ǫ log( δ1′ )) examples from the distribution D. P RUNE - AND -L ABEL (S0 , δ′ ). Phase 1: Let S1 = P RUNE - AND -L ABEL (S1 , δ′ ), for a set of sample S1 of size 2m√ǫ,δ′ from D. Let h1 = OF (S1 ). Phase 2: Let SI = F ILTER (S2 , h1 ), for a set of samples S2 of size Θ(mǫ,δ′ ) drawn from D. Let SC be a sample set of size Θ(m√ǫ,δ′ ) drawn from D. Let SAll = P RUNE - AND -L ABEL (SI ∪ SC , δ′ ). Let WI = {(x, y) ∈ SAll | y 6= h1 (x)} and Let WC = SAll \ WI . Draw a sample set W of size Θ(m√ǫ,δ′ ) from a distribution that equally weights WI and WC . Let h2 = OF (W ). Phase 3: Let S3 = P RUNE - AND -L ABEL (S3 , δ′ ), for a sample set S3 of size 2m√ǫ,δ′ drawn from D conditioned on h1 (x) 6= h2 (x). Let h3 = OF (S3 ). return Maj(h1 , h2 , h3 ). P RUNE - AND -L ABEL(S, δ): for x ∈ S do Let L ∼ P k for a set of k = O( α12 log( |S| δ )) labelers drawn from P . if Maj-sizeL (x) ≤ 1 − α4 then Get a golden query y ∗ = f ∗ (x), Restart Algorithm 3 with distribution P ← P|{(x,y∗ )} and α ← 1−αα . 8 else S ← S ∪ {(x, MajL (x))}. end end return S. O( α1 mǫ,δ′ ) size and with probability 1 − δ returns f ∈ F with errD (f ) ≤ ǫ using O( α1 ) golden queries, load of α1 per labeler, and a total number of queries   m√ǫ,δ′ 1 1 1 1 1 √ ′ O mǫ,δ + log( ′ ) log( ′ ) + 3 m ǫ,δ′ log( ) . α αǫ δ ǫδ α δ′  m√  ǫ,δ 1 Note that when α21√ǫ ≥ log ) < d, the cost per labeled query is O( α1 ). and log( αδ αδ Proof Sketch. Let B = {x | Maj-sizeP (x) ≤ 1 − α/2} be the set of good test cases and let β = D[B] be the total density on such points. Note that if β > 4ǫ , with high probability S0 includes one such point, in which case P RUNE - AND -L ABEL identifies it and prunes the set of labelers. Therefore, we can assume that β ≤ 4ǫ . By Lemma 4.10, it is easy to see that Phase 1 and Phase 3 of Algorithm 3 succeed in producing h1 and √ √ h3 such that errD (h1 ) ≤ 21 ǫ and errD3 (h3 ) ≤ 21 ǫ. It remains to show that Phase 2 of Algorithm 3 also 13 √ produces h2 such that errD2 (h2 ) ≤ 12 ǫ. Consider the filtering step of Phase 2. First note that for any x ∈ / B, the per-point guarantees of F ILTER expressed in Lemma 4.6 still hold. Let D ′ be the distribution that has equal probability on the distributions induced by WI and WC , and is used for simulating D2 . Similarly as in Lemma 4.8 one can show that for √ any x 6∈ B, d′ (x) = Θ(d2 (x)). Since D[B] ≤ 4ǫ , we have that D2 [B] ≤ 41 ǫ. Therefore, D ′ and D2 satisfy the conditions of the robust super-sampling lemma (Lemma 4.12) where the fraction of bad points is at most √ √ ǫ ǫ 4 . Hence, we can argue that errD2 (h2 ) ≤ 2 . The remainder of the proof follows by using the boosting technique of Schapire [1990] described in Theorem 4.1. 5 No Perfect Labelers In this section, we consider a scenario where our pool of labelers does not include any perfect labelers. Unfortunately, learning f ∗ in this setting reduces to the notoriously difficult agnostic learning problem. A related task is to find a set of the labelers which are good but not perfect. In this section, we show how to identify the set of all good labelers, when at least the majority of the labelers are good. We consider a setting where the fraction of the perfect labelers, α, is arbitrarily small or 0. We further assume that at least half of the labelers are good, while others have considerably worst performance. More formally, we are given a set of labelers g1 , . . . , gn and a distribution D with an unknown target classifier f ∗ ∈ F. We assume that more than half of these labelers are “good”, that is they have error of ≤ ǫ on distribution D. On the other hand, the remaining labelers, which we call “bad”, have error rates ≥ 4ǫ on distribution D. We are interested in identifying all of the good labelers with high probability by querying the labelers on an unlabeled sample set drawn from D|X . This model presents an interesting community structure: Two good labelers agree on at least 1 − 2ǫ fraction of the data, while a bad and a good labeler agree on at most 1 − 3ǫ of the data. Note that the rate of agreement between two bad labelers can be arbitrary. This is due to the fact that there can be multiple bad labelers with the same classification function, in which case they completely agree with each other, or two bad labelers who disagree on the classification of every instance. This structure serves as the basis of Algorithm 4 and its analysis. Here we provide an overview of its working and analysis. Algorithm 4 G OOD L ABELER D ETECTION Input: Given n labelers, parameters ǫ and δ Let G = ([n], ∅) be a graph on n vertices with no edges. Take set Q of 16 ln(2)n random pairs of nodes from G. 1 for (i, j) ∈ Q do if DISAGREE (i, j) < 2.5ǫ then add edge (i, j) to G; end 2 Let C be the set of connected components of G each with ≥ n/4 nodes.  S 3 for i ∈ [n] \ C and C ∈ C do C∈C Take one node j ∈ C, if DISAGREE (i, j) < 2.5ǫ add edge (i, j) to G. end return The largest connected component of G DISAGREE (i, j): Take set S ofPΘ( 1ǫ ln( nδ )) samples from D. 1 return |S| x∈S 1(gi (x)6=gj (x)) . 14 Theorem 5.1 (Informal). Suppose that any good labeler i is such that errD (gi ) ≤ ǫ. Furthermore, assume that errD (gj ) 6∈ (ǫ, 4ǫ) for any j ∈ [n]. And let the number of good labelers be at least ⌊ n2 ⌋ + 1. Then, Algorithm  4, returns the set of all good labeler with probability 1 − δ, using an expected load of λ = O 1ǫ ln nδ per labeler. We view the labelers as nodes in a graph that has no edges at the start of the algorithm. In step 1, the algorithm takes O(n) random pairs of labelers  and estimates their level of disagreement by querying them on an unlabeled sample set of size O 1ǫ ln nδ and measuring their empirical disagreement. By an application of Chernoff bound, we know that with probability 1 − δ, for any i, j ∈ [n], D ISAGREE (i, j) − Pr [gi (x) 6= gj (x)] < x∼D|X ǫ . 2 Therefore, for any pair of good labelers i and j tested by the algorithm, D ISAGREE (i, j) < 2.5ǫ, and for any pair of labelers i and j that one is good and the other is bad, D ISAGREE (i, j) ≥ 2.5ǫ. Therefore, the connected components of such a graph only include labelers from a single community. Next, we show that at step 2 of Algorithm 4 with probability 1 − δ there exists at least one connected component of size n/4 of good labelers. To see this we first prove that for any two good labelers i and j, the probability of (i, j) existing is at least Θ(1/n). Let Vg be the set of nodes corresponding to good labelers. For i, j ∈ Vg , we have   2 ln(2) 1 4 ln(2)n 4 ln(2) ≈ ≥ . Pr[(i, j) ∈ G] = 1 − 1 − 2 n n |Vg | By the properties of random graphs, with very high probability there is a component of size β|Vg | in a random graph whose edges exists with probability c/|Vg |, for β + e−βc = 1 [Janson et al., 2011]. Therefore, with probability 1 − δ, there is a component of size |Vg |/2 > n/4 over the vertices in Vg . Finally, at step 3 the algorithm considers smaller connected components and tests whether they join any of the bigger components, by measuring the disagreement of two arbitrary labelers from these components.,At this point, all good labelers form one single connected component of size > n2 . So, the algorithm succeeds in identifying all good labelers. Next, we briefly discuss the expected load per labeler in Algorithm 4. Each labeler participates in O(1) pairs of disagreement tests in expectation, each requiring O( 1ǫ ln(n/δ)) queries. So, in expectation each labeler labels O( 1ǫ ln(n/δ)) instances. References M. Anthony and P. L. Bartlett. Neural Network Learning: Theoretical Foundations. Cambridge University Press, 1999. Pranjal Awasthi, Maria Florina Balcan, Nika Haghtalab, and Ruth Urner. Efficient learning of linear separators under bounded noise. In Proceedings of the 28th Conference on Computational Learning Theory (COLT), pages 167–190, 2015. Pranjal Awasthi, Maria-Florina Balcan, Nika Haghtalab, and Hongyang Zhang. Learning and 1-bit compressed sensing under asymmetric noise. In Proceedings of the 29th Conference on Computational Learning Theory (COLT), pages 152–192, 2016. Ashwinkumar Badanidiyuru, Robert Kleinberg, and Yaron Singer. Learning on a budget: posted price mechanisms for online procurement. In Proceedings of the13thACM Conference on Economics and Computation (EC), pages 128–145. ACM, 2012. 15 Ashwinkumar Badanidiyuru, Robert Kleinberg, and Aleksandrs Slivkins. Bandits with knapsacks: Dynamic procurement for crowdsourcing. In The 3rd Workshop on Social Computing and User Generated Content, co-located with ACM EC, 2013. Maria-Florina Balcan, A. Beygelzimer, and J. Langford. Agnostic active learning. In Proceedings of the23rdInternational Conference on Machine Learning (ICML), pages 65–72. ACM, 2006. O. Bousquet, S. Boucheron, and G. Lugosi. Theory of classification: a survey of recent advances. ESAIM: Probability and Statistics, 9:323–375, 2005. D. Cohn, L. Atlas, and R. Ladner. Improving generalization with active learning. Machine Learning, 15(2), 1994. Sanjoy Dasgupta. Coarse sample complexity bounds for active learning. In Proceedings of the 19th Annual Conference on Neural Information Processing Systems (NIPS), 2005. Ofer Dekel and Ohad Shamir. Vox populi: Collecting high-quality labels from a crowd. In Proceedings of the 22nd Conference on Computational Learning Theory (COLT), 2009. Willliam Feller. An introduction to probability theory and its applications, volume 2. John Wiley & Sons, 2008. Yoav Freund. Boosting a weak learning algorithm by majority. In Proceedings of the 22nd Conference on Computational Learning Theory (COLT), volume 90, pages 202–216, 1990. Yoav Freund and Robert E Schapire. A desicion-theoretic generalization of on-line learning and an application to boosting. In European conference on computational learning theory, pages 23–37. Springer, 1995. S. Hanneke. Rates of convergence in active learning. The Annals of Statistics, 39(1):333–361, 2011. Chien-Ju Ho, Shahin Jabbari, and Jennifer Wortman Vaughan. Adaptive task assignment for crowdsourced classification. Proceedings of the 30th International Conference on Machine Learning (ICML), 2013. Panagiotis G Ipeirotis, Foster Provost, and Jing Wang. Quality management on amazon mechanical turk. In Proceedings of the International Conference on Knowledge Discovery and Data Mining (KDD), pages 64–67. ACM, 2010. Svante Janson, Tomasz Luczak, and Andrzej Rucinski. Random graphs, volume 45. John Wiley & Sons, 2011. David R Karger, Sewoong Oh, and Devavrat Shah. Iterative learning for reliable crowdsourcing systems. In Proceedings of the 25th Annual Conference on Neural Information Processing Systems (NIPS), pages 1953–1961, 2011. David R Karger, Sewoong Oh, and Devavrat Shah. Budget-optimal task allocation for reliable crowdsourcing systems. Operations Research, 62(1):1–24, 2014. Aniket Kittur, Ed H Chi, and Bongwon Suh. Crowdsourcing user studies with mechanical turk. In Proceedings of the SIGCHI conference on human factors in computing systems, pages 453–456. ACM, 2008. V. Koltchinskii. Rademacher complexities and bounding the excess risk in active learning. Journal of Machine Learning Research, 11:2457–2485, 2010. 16 Ronald L Rivest and Robert Sloan. A formal model of hierarchical concept-learning. Information and Computation, 114(1):88–114, 1994. Robert E Schapire. The strength of weak learnability. Machine learning, 5(2):197–227, 1990. Adish Singla and Andreas Krause. Truthful incentives in crowdsourcing tasks using regret minimization mechanisms. In Proceedings of the 22nd international conference on World Wide Web, pages 1167–1178. ACM, 2013. Aleksandrs Slivkins and Jennifer Wortman Vaughan. Online decision making in crowdsourcing markets: Theoretical challenges. ACM SIGecom Exchanges, 12(2):4–23, 2014. Jacob Steinhardt, Gregory Valiant, and Moses Charikar. Avoiding imposters and delinquents: Adversarial crowdsourcing and peer prediction. In Proceedings of the 30th Annual Conference on Neural Information Processing Systems (NIPS), pages 4439–4447, 2016. Long Tran-Thanh, Sebastian Stein, Alex Rogers, and Nicholas R Jennings. Efficient crowdsourcing of unknown experts using bounded multi-armed bandits. Artificial Intelligence, 214:89–111, 2014. L. G. Valiant. A theory of the learnable. Communications of the ACM, 27(11):1134–1142, 1984. Paul Wais, Shivaram Lingamneni, Duncan Cook, Jason Fennell, Benjamin Goldenberg, Daniel Lubarov, David Marin, and Hari Simons. Towards building a high-quality workforce with mechanical turk. Presented at the NIPS Workshop on Computational Social Science and the Wisdom of Crowds, pages 1–5, 2010. Songbai Yan, Kamalika Chaudhuri, and Tara Javidi. Active learning from imperfect labelers. In Proceedings of the 30th Annual Conference on Neural Information Processing Systems (NIPS), pages 2128–2136, 2016. Chicheng Zhang and Kamalika Chaudhuri. Active learning from weak and strong labelers. In Proceedings of the 29th Annual Conference on Neural Information Processing Systems (NIPS), pages 703–711, 2015. 17 A Additional Related Work More generally, interactive models of learning have been studied in the machine learning community. The most popular among them is the area of active learning [Cohn et al., 1994, Dasgupta, 2005, Balcan et al., 2006, Koltchinskii, 2010, Hanneke, 2011]. In this model, the learning algorithm can adaptively query for the labels of a few examples in the training set and use them to produce an accurate hypothesis. The goal is to use as few label queries as possible. The number of labeled queries used is called the label complexity of the algorithm. It is known that certain hypothesis classes can be learned in this model using much fewer labeled queries than predicted by the VC theory. In particular, in many instances the label complexity scales only logarithmically in 1ǫ as opposed to linearly in 1ǫ . However, to achieve computational efficiency, the algorithms in this model rely on the fact that one can get perfect labels for every example queried. This would be hard to achieve in our model since in the worst case it would lead to each labeler answering log( dǫ ) many queries. In contrast, we want to keep the query load of a labeler to a constant and hence the techniques developed for active learning are insufficient for our purposes. Furthermore, in noisy settings most work on efficient active learning algorithms assumes the existence of an empirical risk minimizer (ERM) oracle that can minimize training error even when the instances aren’t labeled according to the target classifier. However, in most cases such an ERM oracle is hard to implement and the improvements obtained in the label complexity are less drastic in such noisy scenarios. Another line of work initiated by Zhang and Chaudhuri [2015] models related notions of weak and strong labelers in the context of active learning. The authors study scenarios where the label queries to the strong labeler can be reduced by querying the weak and potentially noisy labelers more often. However, as discussed above, the model does not yield relevant algorithms for our setting as in the worst case one might end up querying for dǫ high quality labels leading to a prohibitively large load per labeler in our setting. The work of Yan et al. [2016] studies a model of active learning where the labeler abstains from providing a label prediction more often on instances that are closer to the decision boundary. The authors then show how to use the abstentions in order to approximate the decision boundary. Our setting is inherently different, since we make no assumptions on the bad labelers. B Proof of Lemma 4.2 First, notice that because D and D ′ are both labeled according to f ∗ ∈ F, for any f ∈ F we have, X X d′ (x)1f (x)6=f ∗ (x) ≥ c · d(x)1f (x)6=f ∗ (x) = c · errD (f ). errD′ (f ) = x x Therefore, if errD′ (f ) ≤ cǫ, then errD (f ) ≤ ǫ. Let m′ = mcǫ,δ , we have δ> ≥ Pr [∃f ∈ F, s.t. errS ′ (f ) = 0 ∧ errD′ (f ) ≥ cǫ] Pr [∃f ∈ F, s.t. errS ′ (f ) = 0 ∧ errD (f ) ≥ ǫ]. S ′ ∼D ′m′ S ′ ∼D ′m′ The claim follows by the fact that mcǫ,δ = O C 1 c mǫ,δ  . Proof of Lemma 4.7 Let us first consider the expected size of sets SI , W I , and W C . Using Lemma 4.6, we have   √ √ √ 1 1 1 O(m√ǫ,δ ) ≥ ǫ|S2 | + ǫ|S2 | ≥ E[|SI |] ≥ ǫ |S2 | ≥ Ω(m√ǫ,δ ). 2 2 2 18 Similarly, O(m√ 1 ǫ,δ ) ≥ E[SI ] + |SC | ≥ E[W I ] ≥ 2   1√ ǫ |S2 | ≥ Ω(m√ǫ,δ ). 2 Similarly, O(m√ ǫ,δ ) ≥ E[SI ] + |SC | ≥ E[W C ] ≥   1√ 1− ǫ |SC | ≥ Ω(m√ǫ,δ ). 2 The claim follows by the Chernoff bound. D Remainder of the Proof of Lemma 4.9 We prove that the Bernstein inequality holds for the total number of queries y1 , y2 , . . . , made before their majority agrees with f ∗ (x). Let Lx be the random variable denoting the number of queries the algorithm makes on instance x for which h(x) = f ∗ (x). Consider the probability that Lx = 2k +1 for some k. That is, Maj(y1:t ) = f ∗ (x) for the first time when t = 2k + 1. This is at most the probability that Maj(y1:2k−1 ) 6= f ∗ (x). By Chernoff bound, we have that   2 2 ∗ Pr[Lx = 2k + 1] ≤ Pr[Maj(y1:2k−1 ) 6= f (x)] ≤ exp −0.7(2k − 1)( ) /2 7 ≤ exp (−0.02(2k − 1)) . For each i > 1, we have i E[(Lx − E[Lx ]) ] ≤ ≤ ∞ X k=0 ∞ X Pr[Lx = 2k + 1](2k + 1 − E[Lx ])i e−0.02(2k−1) (2k + 1)i k=0 0.04 ≤e ≤ e0.04 ∞ X e−0.02(2k+1) (2k + 1)i k=0 ∞ X e−0.02k ki k=0 ≤ 50(i + 1)! e4i+0.04 , where the last inequality is done by integration. This satisfies the Bernstein condition stated in Theorem E.2. Therefore, # " X Lx − |S| E[Lx ] ≥ O(|S|)] ≤ exp (−|S|) . Pr x∈S Therefore, the total number of queries over all points in x ∈ S where h(x) = f ∗ (x) is at most O(|S|) with very high probability. E Probability Lemmas Theorem E.1 (Probability of Ruin [Feller, 2008]). Consider a player who starts with i dollars against an adversary that has N dollars. The player bets one dollar in each gamble, which he wins with probability p. 19 The probability that the player ends up with no money at any point in the game is  N p 1 − 1−p  N +i . p 1 − 1−p Theorem E.2 (Bernstein Inequality). Let X1 , . . . , Xn be independent random variables with expectation µ. Supposed that for some positive real number L and every k > 1, 1 E[(Xi − µ)k ] ≤ E[(Xi − µ)2 ]Lk−2 k!. 2 Then, v   u n n X uX 1 p E[(Xi − µ)2 ]. Pr  E[(Xi − µ)2 ] < exp(−t2 ), for 0 < t ≤ Xi − nµ ≥ 2tt 2L i=1 F i=1 Omitted Proofs from Section 4.1 In this section, we prove Theorem 4.13 and present the proofs that were omitted from Section 4.1. Theorem 4.13 (restated) Suppose the fraction of the perfect labelers is α and let δ′ = Θ(αδ). Algorithm 3 uses oracle OF , runs in time poly(d, α1 , 1ǫ , ln( 1δ )), uses a training set of size O( α1 mǫ,δ′ ) size and with probability 1 − δ returns f ∈ F with errD (f ) ≤ ǫ using O( α1 ) golden queries, load of α1 per labeler, and a total number of queries   m√ǫ,δ′ 1 1 1 1 √ 1 mǫ,δ′ + log( ′ ) log( ′ ) + 3 m ǫ,δ′ log( ) . O α αǫ δ ǫδ α δ′  m√  ǫ,δ 1 Note that when α21√ǫ ≥ log ) < d, the cost per labeled query is O( α1 ). and log( αδ αδ F.1 Proof of Lemma 4.10 By Chernoff bound, with probability ≥ 1 − δ, for every x ∈ S we have that α |Maj-sizeP (x) − Maj-sizeL (x)| ≤ , 8 where L is the set of labelers P RUNE - AND -L ABEL (S, δ) queries on x. Hence, if x is such that Maj-sizeP (x) ≤ 1 − α2 , then it will be identified and the set of labelers is pruned. Otherwise, MajL (x) agrees with the good labelers and x gets labeled correctly according to the target function. F.2 Proof of Lemma 4.11 Recall that δ′ = c · αδ for some small enough constant c > 0. Each time P RUNE - AND -L ABEL (S, δ′ ) is called, by Hoeffding bound, it is guaranteed that with probability ≥ 1 − δ′ , for each x ∈ S, α |Maj-sizeP (x) − Maj-sizeL (x)| ≤ , 8 ′ where L is the set of labelers P RUNE - AND -L ABEL (S, δ ) queries on x. Hence, when we issue a golden query for x such that Maj-sizeL (x) ≤ 1 − α4 and prune away bad labelers, we are guaranteed to remove at least an α8 fraction of the labelers. Furthermore, no good labeler is ever removed. Hence, the fraction of good labelers increases from α to α/(1 − α8 ). So, in O( α1 ) calls, the fraction of the good labelers surpasses 3 4 and we switch to using Algorithm 2. Therefore, with probability 1 − δ overall, the total number of golden queries is O(1/α). 20 F.3 Proof of Lemma 4.12 Let B be the set of points that do not satisfy the condition that d′ (x) ≥ c · d(x). Notice that because D and D ′ are both labeled according to f ∗ ∈ F, for any f ∈ F we have, X X X d′ (x)1f (x)6=f ∗ (x) + d′ (x)1f (x)6=f ∗ (x) ≥ c · d(x)1f (x)6=f ∗ (x) ≥ c · (errD (f ) − ǫ). errD′ (f ) = x∈B x∈B / x∈B / Therefore, if errD′ (f ) ≤ cǫ, then errD (f ) ≤ 2ǫ. Let m′ = mcǫ,δ , we have δ> ≥ Pr [∃f ∈ F, s.t. errS ′ (f ) = 0 ∧ errD′ (f ) ≥ cǫ] Pr [∃f ∈ F, s.t. errS ′ (f ) = 0 ∧ errD (f ) ≥ 2ǫ]. S ′ ∼D ′m′ S ′ ∼D ′m′ The claim follows by the fact that mcǫ,δ = O F.4 Proof of Theorem 4.13 1 c mǫ,δ  . Recall that δ′ = c · αδ for a small enough constant c > 0. Let B = {x | Maj-sizeP (x) ≤ 1 − α/2} be the set of good test cases and and let β = D[B] be the total density on such points. Note that if β > 4ǫ , with high probability S0 includes one such point, in which case P RUNE - AND -L ABEL identifies it and prunes the set √ of labelers. Therefore, we can assume that β ≤ 4ǫ . By Lemma 4.10, it is easy to see that errD (h1 ) ≤ 12 ǫ. √ We now analyze the filtering step of Phase 2. As in Section 4, our goal is to argue that errD2 (h2 ) ≤ 12 ǫ. Consider distribution D ′ that has equal probability on the distributions induced by WI and WC and let d′ (x) denote the density of point x in this distribution. We will show that for any x ∈ / B we have that ǫ 1√ ′ ′ d (x) = Θ(d2 (x)). Since D[B] ≤ 4 , we have that D2 [B] ≤ 4 ǫ. Therefore, D and D2 satisfy the conditions of the robust super-sampling lemma (Lemma 4.12) where the fraction of bad points is at most √ ǫ 1√ 4 . Hence, errD2 (h2 ) ≤ 2 ǫ. We now show that for any x ∈ B, d′ (x) = Θ(d2 (x)). The proof is identical to the one in Lemma 4.8. √ For ease of representation, we assume that errD (h1 ) is exactly 12 ǫ. Let d(x), d2 (x), dC (x), and dI (x) be the density of instance x in distributions D, D2 , DC , and DI , respectively. Note that, for any x such that √ h1 (x) = f ∗ (x), we have d(x) = dC (x)(1 − 21 ǫ). Similarly, for any x such that h1 (x) 6= f ∗ (x), we have √ d(x) = dI (x) 12 ǫ. Let NC (x), NI (x), MC (x) and MI (x) be the number of occurrences of x in the sets SC , SI , WC and WI , respectively. For any x, there are two cases: If h1 (x) = f ∗ (x): Then, there exist absolute constants c1 and c2 according to Lemma 4.7, such that   |SC | · d(x) MC (x) 1 E[MC (x)] E[NC (x)] ′ = d (x) = E ≥ ≥ √ √ 2 c · m c · m c1 · m√ǫ,δ |WC | 1 1 ǫ,δ ǫ,δ √ |SC | · dC (x) · (1 − 12 ǫ) c2 d2 (x) ≥ c2 dC (x) = = , √ c1 · m ǫ,δ 2 where the second and sixth transitions are by the sizes of WC and |SC | and the third transition is by the fact that if h(x) = f ∗ (x), MC (x) > NC (x). If h1 (x) 6= f ∗ (x): Then, there exist absolute constants c′1 and c′2 according to Lemma 4.7, such that   MI (x) E[MI (x)] E[NI (x)] 0.5 d(x)|S2 | 1 ′ ≥ ′ ≥ ′ ≥ ′ d (x) = E √ √ 2 c1 · m ǫ,δ c1 · m ǫ,δ c1 · m√ǫ,δ |WI | 21 √ 0.5 dI (x) 21 ǫ · |S2 | c′2 d2 (x) ′ , = = c d (x) = I 2 c′1 · m√ǫ,δ 2 where the second and sixth transitions are by the sizes of WI and |S2 |, the third transition is by the fact that if h(x) 6= f ∗ (x), MI (x) > NI (x), and the fourth transition holds by part 2 of Lemma 4.6. √ Finally, we have that errD3 (h3 ) ≤ 21 ǫ, where D3 is distribution D conditioned on {x | h1 (x) 6= h2 (x)}. Using the boosting technique of Schapire [1990] describe in Theorem 4.1, we conclude that MAJ (h1 , h2 , h3 ) has error ≤ ǫ on D. The label complexity claim follows by the fact that we restart Algorithm 3 at most O(1/α) times, take an additional O( 1ǫ log( δ1′ )) high quality labeled set, and each run of Algorithm 3 uses the same label complexity as in Theorem 4.3 before getting restarted. 22
8cs.DS
Automated Identification of Trampoline Skills Using Computer Vision Extracted Pose Estimation Paul W. Connolly, Guenole C. Silvestre and Chris J. Bleakley arXiv:1709.03399v1 [cs.CV] 11 Sep 2017 School of Computer Science, University College Dublin, Belfield, Dublin 4, Ireland. Abstract A novel method to identify trampoline skills using a single video camera is proposed herein. Conventional computer vision techniques are used for identification, estimation, and tracking of the gymnast’s body in a video recording of the routine. For each frame, an open source convolutional neural network is used to estimate the pose of the athlete’s body. Body orientation and joint angle estimates are extracted from these pose estimates. The trajectories of these angle estimates over time are compared with those of labelled reference skills. A nearest neighbour classifier utilising a mean squared error distance metric is used to identify the skill performed. A dataset containing 714 skill examples with 20 distinct skills performed by adult male and female gymnasts was recorded and used for evaluation of the system. The system was found to achieve a skill identification accuracy of 80.7% for the dataset. 1 Introduction Originating in the 1930s, trampolining became a competitive Olympic sport in Sydney 2000. In competition, athletes perform a routine consisting of a series of skills performed over a number of jumps. The skills are scored by human judges according to the Trampoline Code of Points [FIG, 2017]. Although more explicit and objective judging criteria have been introduced in recent years, the scores awarded can still vary between judges leading to highly contentious final decisions. Eliminating human error by means of reliable, automated judging of trampoline routines is desirable. Herein, we describe a first step towards this goal: a novel automated system for identification of trampoline skills using a single video camera. Identification of skills is necessary prior to judging since different skills are scored in different ways. While still a challenging problem, identification of trampoline skills from video has been enabled by recent advances in human pose estimation. In [Andriluka et al., 2014], improved accuracy over model-based approaches was achieved with the introduction of convolutional neural network (ConvNet) based estimation. Estimators such as this rely on new ConvNet algorithms coupled with recent gains in GPU performance. In addition, the introduction of larger, more varied general pose datasets [Sapp and Taskar, 2013, Johnson and Everingham, 2011], leveraging crowd-sourced annotation, has vastly increased the quantity of training data available. To the best of the authors’ knowledge, no previous work has been reported on identification of trampolining skills from video. The closest previous work on identification of trampoline skills required the gymnast to wear a full-body motion capture suit containing inertial sensors [Helten et al., 2011]. Wearing special suits is cumbersome and is not allowed in competition due to the strict rules regarding gymnast attire [FIG, 2017]. Previous work on automated judging of rhythmic gymnastics from video was reported in [Díaz-Pereira et al., 2014]. However, their method differs from the method used in this work. The algorithm proposed herein consists of a number of stages. The bounding box of the gymnast is extracted using conventional image processing techniques. The pose of the athlete is subsequently determined, allowing body orientation and joint angles to be estimated. The angle trajectories over time are compared with those obtained for reference skills. The skill performed is identified as the nearest neighbour in the reference dataset based on a mean square error metric. The system was evaluated using a large number of video recordings capturing the movements of male and female gymnasts performing trampoline routines. A wide variety of skills, lighting conditions, and backgrounds were recorded. The gymnasts did not wear special clothes or markers. The camera was placed side-on to the performance, in the same position as a human judge. The structure of the paper is as follows. In section 2, background information on trampolining is given. In section 3, further detail is provided on approaches to analysis of sporting movement and pose estimation using video recordings. The proposed algorithm is described in section 4. Section 5 discusses the experimental procedure and organisation of the dataset. The experimental results and discussion are provided in section 6. Conclusions, including future work, follow in section 7. 2 Background A trampoline routine consists of a sequence of high, continuous rhythmic rotational jumps performed without hesitation or intermediate straight bounces. The routine should show good form, execution, height, and maintenance of height in all jumps so as to demonstrate control of the body during the flying phase. A competition routine consists of 10 such jumps, referred to, in this work, as skills. For simplicity, a straight bounce is taken to be a skill. A competitor can perform a variable number of straight bounces before the beginning of a routine (so called in-bounces) while an optional straight bounce (out-bounce) can be taken after completing a routine, to control height before the gymnast is required to stop completely. Skills involve take-off and landing in one of four positions: feet, seat, front, or back. Rotations about the body’s longitudinal and lateral axes are referred to as twist and somersault rotations, respectively. Skills combine these rotations with a body shape: tuck, pike, straddle, or straight. These take-off and landing positions and shapes are illustrated in Figure 1. The score for a performance is calculated as the sum of four metrics: degree of difficulty (tariff), execution, horizontal displacement, and time of flight. Degree of difficulty is scored based on the difficulty of the skill performed. For example, a full somersault is awarded more points than a three-quarter somersault. The tariff assigned is found by a simple look-up based on skill identification. Examples of tariff scores can be seen in Table 2. The execution score is allocated based on how well the skill was judged to be performed. The horizontal displacement and the time of flight are measured electronically using force plates on the legs of the trampoline. 3 Related Work One of the problems with the capture of trampoline skills is the large performance space. Elite performers can reach up to 10m in height. Tracking such a large volume is prohibitively difficult for many existing motion capture solutions including RGB-D devices such as the Microsoft Kinect. In [Helten et al., 2011], inertial sensors were used to measure body point acceleration and orientation. The gymnast was required to wear a body suit containing ten inertial measurement units. The sensor data streams were transformed into a feature sequence for classification. For each skill, a motion template was learned. The feature sequence of the unknown trampoline motions were compared with a set of skill templates using a variant of dynamic time warping. The best accuracy achieved was 84.7% over 14 skill types. A survey of vision-based methods for general human motion representation, segmentation and recognition can be found in [Weinland et al., 2011]. In [Díaz-Pereira et al., 2014], judging of rhythmic gymnastics skills from video was investigated. The movement of the gymnast was tracked using optical flow. Velocity field information was extracted across all frames of a skill and projected into a velocity covariance eigenspace. Similar movements were found to trace out unique, but similar, trajectories. New video recordings were classified based on their distance from reference trajectories. The system’s specificity was approximately 85% and the sensitivity was approximately 90% for the 3 skills considered. (a) (b) (c) (d) (e) (f) (g) (h) Figure 1: Take-off and landing positions: (a) feet, (b) seat, (c) front and (d) back. Trampoline shapes: (e) tuck, (f) pike, (g) straddle and (h) straight. Human pose estimation is the process of estimating the configuration of the body, typically from a single image. Robust 2D pose estimation has proven to be a powerful starting point for obtaining 3D pose estimates for human bodies. An overview of the 2D pose estimation problem and proposed methods can be found in [Sigal, 2011, Poppe, 2007]. Model-based methods have been successful for images in which all the limbs of the subject are visible. However, they are unsuitable for the side-on view of a trampoline routine where self-occlusions are inherent. ConvNet based systems do not assume a particular explicit body model since they learn the mapping between image and body pose. These machine learning based techniques provide greater robustness to variations in clothing and accessories than model-based approaches. The MPII benchmark [Andriluka et al., 2014] has been used to access the accuracy of pose estimators. The model-based approach described in [Pishchulin et al., 2013] achieved an accuracy of 44.1% whereas the ConvNet based method proposed in [Newell et al., 2016] achieved 90.9%. The work described herein differs from previous work in that the system performs skill identification for trampolining using a single monocular video camera. The work takes advantage of recently developed, high accuracy, open source ConvNet based pose estimators. The Stacked Hourglass Network [Newell et al., 2016] and MonoCap [Zhou et al., 2016] methods were selected for estimation and filtering of the 2D pose, respectively. In the Stacked Hourglass Network, 2D pose estimates are provided by a ConvNet architecture where features are processed across all scales and consolidated to best capture the spatial relationships of the body parts. Repeated steps of pooling and upsampling, in conjunction with intermediate supervision, out-perform previous methods. In MonoCap, 3D pose is estimated via an expectation-maximization algorithm over a sequence of images with 2D pose predictions. Conveniently, the 2D joint location uncertainties can be marginalized out during inference. 4 Proposed Algorithm The complete algorithm is illustrated in Figure 2. Video is recorded and pre-processed to reduce resolution and remove audio. After pre-processing, the body extraction stage identifies and tracks the convex hull of the athlete over all video frames. The video is segmented according to the detected bounces. The feature extraction stage estimates the pose of the athlete and from this, the body orientation and joint angles in each frame. Based on the extracted feature angles, classification is performed to identify the skill. In our experiments, the accuracy Segment Bounces Record Footage Label Ground Truth Skill Downsample Video Subtract Background Track Gymnast Dim & Blur Background Save Video Frames Estimate Pose Filter Pose Temporally Calculate Angles Identify Skill Annotation Classification Body Extraction Feature Extraction Calculate Accuracy Evaluation Figure 2: Flow chart illustrating the proposed method. of the system was evaluated by comparing the detected skills to manually marked ground truth. The algorithm stages are explained in more detail in the following sections. 4.1 Body Extraction The top of the trampoline is identified based on its hue characteristics and is presented as a best guess on a user interface that allows the position to be fine tuned. The gymnast is tracked by assuming that they are the largest moving object above the trampoline. A background subtractor generates a foreground mask for each frame. All static image components over multiple frames are taken to be part of the background. The camera is assumed to be static without changing focus during the recording. The foreground mask is eroded for one iteration and dilated for ten iterations with a 2 × 2 kernel. The largest segment of this morphed mask is taken to be the silhouette of the gymnast. The method of moments is used to determine the centroid of this silhouette. The video is segmented into individual skills based on the position of this centroid. A peak detection algorithm identifies the local minima of the vertical position of the centroid. These local minima are taken to indicate the start and end frames of a skill. A threshold is applied to peaks between the local minima to identify the start and end jumps of the routine. The convex hull of the silhouette is used to generate a bounding box for the athlete’s image. The bottom of the bounding box is compared to the position of the top of the trampoline to detect the contact phase of a bounce. Examples of the application of this method are shown in Figure 3. Images of the body are saved for frames in which the athlete is not in contact with the trampoline. The maximum size of the bounding box across all frames of the routine is found. Each image is squarely cropped to this size, centred on the centroid of the gymnast. Based on the extracted foreground mask, the background of each image is blurred and darkened. This helps to reduce the number of incorrect pose estimates. (a) (b) (c) (d) Figure 3: Processed images. (a) Original frame. (b) Background model. (c) Foreground mask. (d) Body silhouette and convex hull after erosion and dilation. i θi (t ) 1, 2 R, L Elbow 3, 4 R, L Shoulder 5, 6 R, L Hip 7, 8 R, L Knee 9, 10 R, L Leg 11 Torso 12 Twist Table 1: Feature angles by name and index. 4.2 Feature Extraction The Stacked Hourglass Network and MonoCap are used for 2D pose estimation and filtering, respectively. The 2D pose estimator generates pose predictions for 16 joint locations. The 3D pose estimator is then used to filter the 2D pose predictions across the sequence of images. From the smoothed 2D pose, the 2D joint angles and orientation angles that represent the athlete’s body position are calculated. These feature angles are denoted as θ i for i ∈ [1 . . . M ] where M = 12 is the total number of feature angles. Each of the M feature angles is part of a time series θi (t ), where t is the frame number, t ∈ [1 . . . T ]. The angles are listed in Table 1 and example trajectories can be seen in Figure 4. Twist around the body’s longitudinal axis is estimated from the 2D distance between the pose points labelled as right and left shoulder. The shoulder separation in the image is at a maximum when the gymnast’s back or front is facing the camera and is approximately zero when sideways to the camera. By finding the maximum 2D separation over the whole routine, the separation can be normalised to a value between 0°and 180°. In this way, the angle does not depend on the size of the performer. Right Angle (deg) 180 Torso with Vertical Left Elbow Shoulder Hip Knee Leg with Vertical Twist Angle Torso & Twist 135 90 45 0 0.5 1.0 0.5 1.0 0.5 1.0 0.5 1.0 0.5 1.0 0.5 1.0 Time (s) Figure 4: The motion sequence of a tuck jump with the estimated angles shown beneath. 4.3 Classification The M feature angle trajectories are compared to those in a labelled reference set by calculation of the mean squared error (MSE). The observed skill is identified as equivalent to the reference giving the minimum MSE. The feature angle trajectories of the references θ Ri (t ) are aligned through re-sampling by means of interpolation so as to have the same number of data points T as the observed angle trajectory θO i (t ). MSE = T X M ¡ ¢2 1 X R θO i (t ) − θ i (t ) T M t =1 i =1 (1) 5 5.1 Experimental Procedure Data Acquisition The procedure for data collection was submitted to and approved by the UCD Office of Research Ethics. Videos of routines were recorded at training sessions and competitions of the UCD Trampoline Club. Consent was sought from members of the UCD Trampoline Club prior to recording video for the purposes of the project. Routines were collected in UCD Sports Centre under normal sports hall lighting conditions. The background was not modified, typically consisting of a brick wall or nets. The routines were recorded at a resolution of 1920 × 1080 at 30 frames per second (fps) using a consumer grade camera with a shutter speed of 1/120 to reduce motion blur. The camera was positioned at the typical location and viewing angle of the judging panel. All bounces were within the field of view of the camera. The video was subsequently downsampled to 896 × 504, maintaining a 16:9 aspect ratio, and audio was removed. These steps significantly reduced data file size and processing time while maintaining usable resolution. The videos were manually annotated with ground-truth labels by means of a custom built web interface. 5.2 Datasets The resulting dataset consists of 49 routines by 30 adult athletes, 18 male and 31 female, totalling 23 minutes of video. This contained 28 distinct skills and 771 skill examples. The names and distribution of these skills are summarised in Table 2. The accuracy of the identification algorithm was tested using 10-fold cross validation. The skills with fewer than 10 examples were not included in the test, leaving N = 20 distinct skills. In each iteration of the evaluation, a subset of 10 examples of each skill were randomly selected from the database. Each subset was split evenly to give the number of reference examples S r = 5 and the number of test examples S t = 5. The total size of the reference set was N × S r = 100 skill examples. The test set was of the same size. The average accuracy over 20 iterations of the evaluation is reported herein. 6 Results and Discussion The average accuracy of the system was 80.7% for the 20 distinct skills listed as included in classification in Table 2. The confusion matrix for the experiment is shown in Figure 5. It was noted that subject identification can sometimes incorrectly focus on people in the background, particularly during seat, front and back landings, when the gymnast becomes obscured by the trampoline bed. This causes errors in trampoline contact detection resulting in frames without an obvious subject being presented to the pose estimator. The resulting angles are not representative of the skill performed. This can also cause errors in jump segmentation due to incorrect centroid extraction. Jump segmentation failed in 2 cases. Significant confusion in skill identification occurs between FPF (pike jumps shown in Figure 1f) and FSF (straddle jumps shown in Figure 1g). From a side-on view, it is difficult to distinguish these movements. Another area of confusion is between the tuck and pike shape of the Barani skill (BRI). The features which distinguish these shapes are the angles of the hip and knees. The tuck shape in this skill is often performed loosely. This results in the angle of the hip being similar to that of the pike shape. For identification, the angle of the knees becomes the deciding feature and may be overwhelmed by noise from other features. Use of a support vector machine might improve classification accuracy. For example, the difficulty in estimating the wrist and ankle joints for the 2D pose estimator can lead to noise in the angles for the elbows and knees. Weighting these features as less important might improve overall accuracy. Tariff Occurrences Straight Bounce Tuck Jump Pike Jump Straddle Jump Half Twist Jump Full Twist Jump Seat Drop Half Twist to Seat Drop Seat Half Twist To Seat To Feet from Seat Half Twist to Feet from Seat Front Drop To Feet from Front Back Drop To Feet from Back Half Twist to Feet from Back Front Somersault (Tuck) Front Somersault (Pike) Barani (Tuck) Barani (Pike) Barani (Straight) Crash Dive Back Somersault (Tuck) Back Somersault (Pike) Back Somersault (Straight) Back Somersault to Seat (Tuck) Lazy Back Cody (Tuck) Back Half Barani Ball Out (Tuck) Rudolph / Rudi Full Front Full Back F0F FTF FPF FSF F1F F2F F0S F1S S1S S0F S1F F0R R0F F0B B0F B1F FSSt FSSp BRIt BRIp BRIs CDI BSSt BSSp BSSs BSTt LBK CDYt BHA BBOt RUI FFR FUB 0.0 0.0 0.0 0.0 0.1 0.2 0.0 0.1 0.1 0.0 0.1 0.1 0.1 0.1 0.1 0.2 0.5 0.6 0.6 0.6 0.6 0.3 0.5 0.6 0.6 0.5 0.3 0.6 0.6 0.7 0.8 0.7 0.7 286 58 40 42 18 19 13 10 24 11 24 4† 5† 10 8† 12 4† 7† 24 19 9† 18 28 18 30 10 3† 3† 1† 7† 3† 1† 2† F0F FTF FPF FSF F1F F2F F0S F1S S1S S0F S1F F0B B1F BRIt BRIp CDI BSSt BSSp BSSs BSTt F0F FTF FPF FSF F1F F2F F0S F1S S1S S0F S1F F0B B1F BRIt BRIp CDI BSSt BSSp BSSs BSTt Code Ground Truth Skill Skill Name Identified Skill Figure 5: Confusion matrix showing the relative errors for each skill. This is the average of 20 iterations of 10-fold cross validation. Table 2: Skill dataset. († excluded from classification) It is likely that accuracy could be improved by increasing the amount of data. Current pose estimation algorithms take a single image as input. It seems likely that performance could be improved by tracking pose over a video sequence. Adding a second video camera pointed towards the front of the gymnast would likely improve accuracy by allowing greater discrimination of motion parallel to the axis between the subject and the first camera. However, there are issues regarding the extra user effort in setting up the second camera and in synchronisation of the two devices. Modern trampoline judging systems incorporate force plates for detection of the centrality of landing on the trampoline bed. Fusing such information with the video data could possibly also result in improved accuracy. Body extraction was performed at 15 fps on a 2 core Intel i7–3517U 2.4 GHz CPU. Estimation of pose using the Stacked Hourglass Network ran at 20 fps on an Ubuntu 16.04 with an Nvidia Titan X (Pascal) GPU and a 4 core Intel i7–920 2.67 GHz CPU with default parameter settings. Execution of the MonoCap algorithm ran at 0.3 fps on the same machine also with default parameters. 7 Conclusion A system for identifying trampolining skills using a single monocular video camera was developed. The system incorporated algorithms for background subtraction, erosion and dilation, pose estimation, pose filtering and classification. The system was found to provide 80.7% accuracy in identifying the 20 distinct skills present in a dataset contain 712 skill examples. In future work, we plan to extend the classification algorithms to perform automated execution judging. References [Andriluka et al., 2014] Andriluka, M., Pishchulin, L., Gehler, P., and Schiele, B. (2014). 2D Human Pose Estimation: New Benchmark and State of the Art Analysis. In 2014 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3686–3693. [Díaz-Pereira et al., 2014] Díaz-Pereira, M. P., Gómez-Conde, I., Escalona, M., and Olivieri, D. N. (2014). Automatic recognition and scoring of olympic rhythmic gymnastic movements. Human Movement Science, 34:63–80. [FIG, 2017] FIG (2017). Trampoline Code Of Points. [Accessed 2017-03-30]. [Helten et al., 2011] Helten, T., Brock, H., Müller, M., and Seidel, H.-P. (2011). Classification of trampoline jumps using inertial sensors. Sports Engineering, 14(2):155–164. [Johnson and Everingham, 2011] Johnson, S. and Everingham, M. (2011). Learning effective human pose estimation from inaccurate annotation. In 2011 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1465–1472. [Newell et al., 2016] Newell, A., Yang, K., and Deng, J. (2016). Stacked Hourglass Networks for Human Pose Estimation. CoRR, abs/1603.06937. [Pishchulin et al., 2013] Pishchulin, L., Andriluka, M., Gehler, P., and Schiele, B. (2013). Poselet conditioned pictorial structures. In 2013 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 588–595. [Poppe, 2007] Poppe, R. (2007). Vision-based human motion analysis: An overview. Computer Vision and Image Understanding, 108(1–2):4–18. Special Issue on Vision for Human-Computer Interaction. [Sapp and Taskar, 2013] Sapp, B. and Taskar, B. (2013). MODEC: Multimodal Decomposable Models for Human Pose Estimation. In 2013 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3674–3681. [Sigal, 2011] Sigal, L. (2011). Human pose estimation. [Accessed 2017-03-30]. [Weinland et al., 2011] Weinland, D., Ronfard, R., and Boyer, E. (2011). A survey of vision-based methods for action representation, segmentation and recognition. Computer Vision and Image Understanding, 115(2):224–241. [Zhou et al., 2016] Zhou, X., Zhu, M., Leonardos, S., Derpanis, K. G., and Daniilidis, K. (2016). Sparseness Meets Deepness: 3D Human Pose Estimation from Monocular Video. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4966–4975.
1cs.CV
Parsing methods streamlined arXiv:1309.7584v1 [cs.FL] 29 Sep 2013 Luca Breveglieri Stefano Crespi Reghizzi Angelo Morzenti Dipartimento di Elettronica, Informazione e Bioingegneria (DEIB) Politecnico di Milano Piazza Leonardo Da Vinci 32, I-20133 Milano, Italy email: { luca.breveglieri, stefano.crespireghizzi, angelo.morzenti }@polimi.it This paper has the goals (1) of unifying top-down parsing with shift-reduce parsing to yield a single simple and consistent framework, and (2) of producing provably correct parsing methods, deterministic as well as tabular ones, for extended context-free grammars (EBNF ) represented as state-transition networks. Departing from the traditional way of presenting as independent algorithms the deterministic bottom-up LR (1), the top-down LL (1) and the general tabular (Earley) parsers, we unify them in a coherent minimalist framework. We present a simple general construction method for EBNF ELR (1) parsers, where the new category of convergence conflicts is added to the classical shift-reduce and reduce-reduce conflicts; we prove its correctness and show two implementations by deterministic push-down machines and by vector-stack machines, the latter to be also used for Earley parsers. Then the Beatty’s theoretical characterization of LL (1) grammars is adapted to derive the extended ELL (1) parsing method, first by minimizing the ELR (1) parser and then by simplifying its state information. Through using the same notations in the ELR (1) case, the extended Earley parser is obtained. Since all the parsers operate on compatible representations, it is feasible to combine them into mixed mode algorithms. Categories and Subject Descriptors: parsing [of formal languages]: theory General Terms: language parsing algorithm, syntax analysis, syntax analyzer Additional Key Words and Phrases: extended BNF grammar, EBNF grammar, deterministic parsing, shift-reduce parser, bottom-up parser, ELR (1), recursive descent parser, top-down parser, ELL (1), tabular Earley parser October 1, 2013 0 See Formal Languages and Compilation, S. Crespi Reghizzi, L. Breveglieri, A. Morzenti, Springer, London, 2nd edition, (planned) 2014 2 · Parsing methods streamlined Contents 1 Introduction 3 2 Preliminaries 2.1 Derivation for machine nets . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 Right-linearized grammar . . . . . . . . . . . . . . . . . . . . . 2.2 Call sites, machine activation, and look-ahead . . . . . . . . . . . . . . . 4 8 8 9 3 Shift-reduce parsing 3.1 Construction of ELR (1) parsers . . . . . . . . . . . . . . 3.1.1 Base closure and kernel of a m-state . . . . . . . . 3.2 ELR (1) condition . . . . . . . . . . . . . . . . . . . . . . 3.2.1 ELR (1) versus classical LR (1) definitions . . . . . 3.2.2 Parser algorithm . . . . . . . . . . . . . . . . . . 3.3 Simplified parsing for BNF grammars . . . . . . . . . . . 3.4 Parser implementation using an indexable stack . . . . . . 3.5 Related work on shift-reduce parsing of EBNF grammars. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 11 12 14 14 17 21 23 24 Deterministic top-down parsing 4.1 Single-transition property and pilot compaction . . . . 4.1.1 Merging kernel-identical m-states . . . . . . . 4.1.2 Properties of compact pilots . . . . . . . . . . 4.1.3 Candidate identifiers or pointers unnecessary . 4.2 ELL (1) condition . . . . . . . . . . . . . . . . . . . . 4.2.1 Discussion . . . . . . . . . . . . . . . . . . . 4.3 Stack contraction and predictive parser . . . . . . . . . 4.3.1 Parser control-flow graph . . . . . . . . . . . . 4.3.2 Predictive parser . . . . . . . . . . . . . . . . 4.3.3 Computing left derivations . . . . . . . . . . . 4.3.4 Parser implementation by recursive procedures 4.4 Direct construction of parser control-flow graph . . . . 4.4.1 Equations defining the prospect sets . . . . . . 4.4.2 Equations defining the guide sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 28 30 30 32 36 36 38 38 41 42 43 43 43 44 5 Tabular parsing 5.1 String recognition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Syntax tree construction . . . . . . . . . . . . . . . . . . . . . . . . . . 45 46 50 6 Conclusion 52 7 Appendix 55 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parsing methods streamlined · 3 1. INTRODUCTION In many applications such as compilation, program analysis, and document or natural language processing, a language defined by a formal grammar has to be processed using the classical approach based on syntax analysis (or parsing) followed by syntax-directed translation. Efficient deterministic parsing algorithms have been invented in the 1960’s and improved in the following decade; they are described in compiler related textbooks (for instance [Aho et al. 2006; Grune and Jacobs 2004; Crespi Reghizzi 2009]), and efficient implementations are available and widely used. But research in the last decade or so has focused on issues raised by technological advances, such as parsers for XML-like datadescription languages, more efficient general tabular parsing for context-free grammars, and probabilistic parsing for natural language processing, to mention just some leading research lines. This paper has the goals (1) of unifying top-down parsing with shift-reduce parsing and, to a minor extend, also with tabular Earley parsing, to yield a single simple and consistent framework, and (2) of producing provably correct parsing methods, deterministic and also tabular ones, for extended context-free grammars (EBNF) represented as state-transition networks. We address the first goal. Compiler and language developers, and those who are familiar with the technical aspects of parsing, invariably feel that there ought to be room for an improvement of the classical parsing methods: annoyingly similar yet incompatible notions are used in shift-reduce (i.e., LR (1)), top-down (i.e., LL (1)) and tabular Earley parsers. Moreover, the parsers are presented as independent algorithms, as indeed they were when first invented, without taking advantage of the known grammar inclusion properties (LL (k) ⊂ LR (k) ⊂ context-free) to tighten and simplify constructions and proofs. This may be a consequence of the excellent quality of the original presentations (particularly but not exclusively [Knuth 1965; Rosenkrantz and Stearns 1970; Earley 1970]) by distinguished scientists, which made revision and systematization less necessary. Our first contribution is to conceptual economy and clarity. We have reanalyzed the traditional deterministic parsers on the view provided by Beatty’s [Beatty 1982] rigorous characterization of LL (1) grammars as a special case of the LR (1). This allows us to show how to transform shift-reduce parsers into the top-down parsers by merging and simplifying parser states and by anticipating parser decisions. The result is that only one set of technical definitions suffices to present all parser types. Moving to the second goal, the best known shift-reduce and tabular parsers do not accept the extended form of BNF grammars known as EBNF (or ECFG or also as regular rightpart RRPG) that make use of regular expressions, and are widely used in the language reference manuals and are popular among designers of top-down parsers using recursive descent methods. We systematically use a graphic representation of EBNF grammars by means of state-transition networks (also known as syntax charts. Brevity prevents to discuss in detail the long history of the research on parsing methods for EBNF grammars. It suffices to say that the existing top-down deterministic method is well-founded and very popular, at least since its use in the elegant recursive descent Pascal compiler [Wirth 1975] where EBNF grammars are represented by a network of finite-state machines, a formalism already in use since at least [Lomet 1973]). On the other hand, there have been numerous interesting but non-conclusive proposals for shift-reduce methods for EBNF grammars, which operate under more or less general assumptions and are implemented by various 4 · Parsing methods streamlined types of push-down parsers (more of that in Section 3.5). But a recent survey [Hemerik 2009] concludes rather negatively: What has been published about LR-like parsing theory is so complex that not many feel tempted to use it; . . . it is a striking phenomenon that the ideas behind recursive descent parsing of ECFGs can be grasped and applied immediately, whereas most of the literature on LR-like parsing of RRPGs is very difficult to access. . . . Tabular parsing seems feasible but is largely unexplored. We have decided to represent extended grammars as transition diagram systems, which are of course equivalent to grammars, since any regular expression can be easily mapped to its finite-state recognizer; moreover, transition networks (which we dub machine nets) are often more readable than grammar rules. We stress that all our constructions operate on machine nets that represent EBNF grammars and, unlike many past proposals, do not make restrictive assumptions on the form of regular expressions. For EBNF grammars, most past shift-reduce methods had met with a difficulty: how to formulate a condition that ensures deterministic parsing in the presence of recursive invocations and of cycles in the transition graphs. Here we offer a simple and rigorous formulation that adds to the two classical conditions (neither shift-reduce nor reduce-reduce conflicts) a third one: no convergence conflict. Our shift-reduce parser is presented in two variants, which use different devices for identifying the right part or handle (typically a substring of unbounded length) to be reduced: a deterministic pushdown automaton, and an implementation, to be named vector-stack machine, using unbounded integers as pointers into the stack. The vector-stack device is also used in our last development: the tabular Earley-like parser for EBNF grammars. At last, since all parser types described operate on uniform assumptions and use compatible notations, we suggest the possibility to combine them into mixed-mode algorithms. After half a century research on parsing, certain facts and properties that had to be formally proved in the early studies have become obvious, yet the endemic presence of errors or inaccuracies (listed in [Hemerik 2009]) in published constructions for EBNF grammars, warrants that all new constructions be proved correct. In the interest of readability and brevity, we first present the enabling properties and the constructions semi-formally also relying on significant examples; then, for the properties and constructions that are new, we provide correctness proofs in the appendix. The paper is organized as follows. Section 2 sets the terminology and notation for grammars and transition networks. Section 3 presents the construction of shift-reduce ELR (1) parsers. Section 4 derives top-down ELL (1) parsers, first by transformation of shift-reduce parsers and then also directly. Section 5 deals with tabular Earley parsers. 2. PRELIMINARIES The concepts and terminology for grammars and automata are classical (e.g., see [Aho et al. 2006; Crespi Reghizzi 2009]) and we only have to introduce some specific notations. A BNF or context-free grammar G is specified by the terminal alphabet Σ, the set of nonterminal symbols V , the set of rules P and the starting symbol or axiom S. An element of Σ ∪ V is called a grammar symbol. A rule has the form A → α, where A, the left part, is a nonterminal and α, the right part, is a possibly empty (denoted by ε) string over Parsing methods streamlined · 5 Σ ∪ V . Two rules such as A → α and A → β are called alternative and can be shortened to A → α | β. An Extended BNF (EBNF) grammar G generalizes the rule form by allowing the right part to be a regular expression (r.e.) over Σ ∪ V . A r.e. is a formula that as operators uses union (written “|”), concatenation, Kleene star and parentheses. The language defined by a r.e. α is denoted R (α). For each nonterminal A we assume, without any loss of generality, that G contains exactly one rule A → α. A derivation between strings is a relation u A v ⇒ u w v, with u, w and v possibly empty strings, and w ∈ R (α). The derivation is leftmost (respectively rightmost), if u does not contain a nonterminal (resp. if v does not contain a nonterminal). A series of ∗ ∗ derivations is denoted by ⇒. A derivation A ⇒ A v, with v 6= ε, is called left-recursive. For a derivation u ⇒ v, the reverse relation is named reduction and denoted by v ❀ u. ∗ The language L (G) generated by grammar G is the set L (G) = { x ∈ Σ∗ | S ⇒ x }. ∗ The language L (A) generated by nonterminal A is the set LA (G) = { x ∈ Σ∗ | A ⇒ x }. A language is nullable if it contains the empty string. A nonterminal that generates a nullable language is also called nullable. Following a tradition dating at least to [Lomet 1973], we are going to represent a grammar rule A → α as a graph: the state-transition graph of a finite automaton to be named machine1 MA that recognizes a regular expression α. The collection M of all such graphs for the set V of nonterminals, is named a network of finite machines and is a graphic representation of a grammar (see Fig. 1). This has well-known advantages: it offers a pictorial representation, permits to directly handle EBN F grammars and maps quite nicely on the recursive-descent parser implementation. In the simple case when α contains just terminal symbols, machine MA recognizes the language LA (G). But if α contains a nonterminal B, machine MA has a state-transition edge labeled with B. This can be thought of as the invocation of the machine MB associated to rule B → β; and if nonterminals B and A coincide, the invocation is recursive. It is convenient although not necessary, to assume that the machines are deterministic, at no loss of generality since a nondeterministic finite state machine can always be made deterministic. Definition 2.1. Recursive net of finite deterministic machines. —Let G be an EBN F grammar with nonterminal set V = { S, A, B, . . . } and grammar rules S → σ, A → α, B → β, . . . —Symbols RS , RA , RB , . . . denote the regular languages over alphabet Σ ∪ V , respectively defined by the r.e. σ, α, β, . . . —Symbols MS , MA , MB , . . . are the names of finite deterministic machines that accept the corresponding regular languages RS , RA , RB , . . . . As usual, we assume the machines to be reduced, in the sense that every state is reachable from the initial state and reaches a final state. The set of all machines, i.e., the (machine) net, is denoted by M. —To prevent confusion, the names of the states of any two machines are made different by appending the machine name as subscript. The set of states of machine MA is QA = 1 To avoid confusion we call “machines” the finite automata of grammar rules, and we reserve the term “automaton” for the pushdown automaton that accepts language L (G). 6 · Parsing methods streamlined Machine net M EBNF grammar G T E → T∗ ME → 0E 1E ↓ ↓ T a T → ‘(’ E ‘)’ | a MT → 0T 1T ( 3T → 2T E ) Fig. 1. EBN F grammar G (axiom E) and machine network M = { ME , MT } (axiom ME ) of the running example 2.2; initial (respectively final) states are tagged by an incoming (resp. outgoing) dangling dart. { 0A , . . . , qA , . . . }, the initial state is 0A and the S set of final states is FA ⊆ QA . The state set of the net is the union of all states Q = MA ∈M QA . The transition function of every machine is denoted by the same symbol δ, at no risk of confusion as the state sets are disjoint. —For state qA of machine MA , the symbol R (MA , qA ) or for brevity R (qA ), denotes the regular language of alphabet Σ ∪ V accepted by the machine starting from state qA . If qA is the initial state 0A , language R (0A ) ≡ RA includes every string that labels a path, qualified as accepting, from the initial to a final state. —Normalization disallowing reentrance into initial states. To simplify the parsing algoc rithms, we stipulate that for every machine MA no edge qA −→ 0A exists, where qA ∈ QA and c is a grammar symbol. In words, no edges may enter the initial state. The above normalization ensures that the initial state 0A is not visited again within a computation that stays inside machine MA ; clearly, any machine can be so normalized by adding one state and a few transitions, with a negligible overhead. Such minor adjustment greatly simplifies the reduction moves of bottom-up parsers. For an arbitrary r.e. α, several well-known algorithms such as MacNaughton-Yamada and Berry-Sethi (described for instance in [Crespi Reghizzi 2009]) produce a machine recognizing the corresponding regular language. In practice, the r.e. used in the right parts of grammars are so simple that they can be immediately translated by hand into an equivalent machine. We neither assume nor forbid that the machines be minimal with respect to the number of states. In facts, in syntax-directed translation it is not always desirable to use the minimal machine, because different semantic actions may be required in two states that would be indistinguishable by pure language theoretical definitions. If the grammar is purely BN F then each right part has the form α = α1 | α2 | . . . | αk , where every alternative αi is a finite string; therefore RA is a finite language and any machine for RA has an acyclic graph, which can be made into a tree if we accept to have a non-minimal machine. In the general case, the graph of machine MA representing rule A → α is not acyclic. In any case there is a one-to-one mapping between the strings in language RA and the set of accepting paths of machine MA . Therefore, the net M = { MS , MA , . . . } is essentially a notational variant of a grammar G, as witnessed by the common practice to include both EBN F productions and syntax diagrams in language specifications. We indifferently denote the language as L (G) or as L (M). Parsing methods streamlined · 7 We need also the context-free terminal language defined by the net, starting from a state qA of machine MA possibly other than the initial one: n o ∗ L (MA , qA ) ≡ L (qA ) = y ∈ Σ∗ | η ∈ R (qA ) and η ⇒ y In the formula, η is a string over terminals and nonterminals, accepted by machine MA starting from state qA . The derivations originating from η produce the terminal strings of language L (qA ). In particular, from previous definitions it follows that: L (MA , 0A ) ≡ L (0A ) = LA (G) and L (MS , 0S ) ≡ L (0S ) ≡ L (M) = L (G) Example 2.2. Running example. The EBN F grammar G and machine net M are shown in Figure 1. The language generated can be viewed as obtained from the language of well-parenthesized strings, by allowing character a to replace a well-parenthesized substring. All machines are deterministic and the initial states are not reentered. Most features needed to exercise different aspects of parsing are present: self-nesting, iteration, branching, multiple final states and the nullability of a nonterminal. To illustrate, we list a language defined by its net and component machines, along with their aliases: R (ME , 0E ) = R (0E ) = T ∗  R (MT , 1T ) = R (1T ) = E L (ME , 0E ) = L (0E ) = L (G) = L (M) = { ε, a, a a, ( ), a a a, ( a ), a ( ), ( ) a, ( ) ( ), . . . } L (MT , 0T ) = L (0T ) = LT (G) = { a, ( ), ( a ), ( a a ), ( ( ) ), . . . } To identify machine states, an alternative convention quite used for BN F grammars, relies on marked grammar rules: for instance the states of machine MT have the aliases: 0T ≡ T → • a | • ( E ) 2T ≡ T → ( E • ) 1T ≡ T → ( • E ) 3T ≡ a • | T → ( E ) • where the bullet is a character not in Σ. We need to define the set of initial characters for the strings recognized starting from a given state. Definition 2.3. Set of initials. Ini (qA ) = Ini L (qA )  = { a ∈ Σ | a Σ∗ ∩ L (qA ) 6= ∅ } The set can be computed by applying the following logical clauses until a fixed point is reached. Let a be a terminal, A, B, C nonterminals, and qA , rA states of the same machine. The clauses are: a a ∈ Ini (qA ) if ∃ edge qA −→ rA B a ∈ Ini (qA ) if ∃ edge qA −→ rA ∧ a ∈ Ini (0B ) B a ∈ Ini (qA ) if ∃ edge qA −→ rA ∧ L (0B ) is nullable ∧ a ∈ Ini (rA ) To illustrate, we have Ini (0E ) = Ini (0T ) = { a, ( }. 8 · Parsing methods streamlined 2.1 Derivation for machine nets For machine nets and EBN F grammars, the preceding definition of derivation, which models a rule such as E → T ∗ as the infinite set of BN F alternatives E → ε | T | T T | . . ., has shortcomings because a derivation step, such as E ⇒ T T T , replaces a nonterminal E by a string of possibly unbounded length; thus a multi-step computation inside a machine is equated to just one derivation step. For application to parsing, a more analytical definition is needed to split such large step into a series of state transitions. We recall that a BN F grammar is right-linear (RL) if the rule form is A → a B or A → ε, where a ∈ Σ and B ∈ V . Every finite-state machine can be represented by an equivalent RL grammar that has the machine states as nonterminal symbols. 2.1.1 Right-linearized grammar. Each machine MA of the net can be replaced with an equivalent right linear RL grammar, to be used to provide a rigorous semantic for the derivations constructed by our parsers. It is straightforward to write the RL grammar, named ĜA , equivalent with respect to the regular language R (MA , 0A ). The nonterminals of ĜA are the states of QA , and the axiom is 0A ; there exists a rule pA → X rA if an edge X pA −→ rA is in δ, and the empty rule pA → ε if pA is a final state. Notice that X can be a nonterminal B of the original grammar, therefore a rule of ĜA may have the form pA → B rA , which is still RL since the first symbol of the right part as a “terminal” symbol for grammar ĜA . With this provision, the identity   is viewed L ĜA = R (MA , 0A ) clearly holds. Next, for every RL grammar of the net we replace with 0B each symbol B ∈ V occurring in a rule such as pA → B rA , and thus we obtain rules of the form pA → 0B rA . The resulting BN F grammar, non-RL, is denoted Ĝ and named the right-linearized grammar of the net: it has terminal alphabet Σ, nonterminal set Q and axiom 0S . The right parts have length zero or two, and may contain two nonterminal symbols, thus the grammar is not RL. Obviously, Ĝ and G are equivalent, i.e., they both generate language L (G). Example 2.4. Right-linearized grammar Ĝ of the running example. ĜE : 0E → 0T 1E | ε 1E → 0T 1E | ε ĜT : 0T → a 3T | ( 1T 1T → 0E 2T 2T →) 3T 3T → ε As said, in right-linearized grammars we choose to name nonterminals by their alias states; an instance of non-RL rule is 1T → 0E 2T . Using Ĝ instead of G, we obtain derivations the steps of which are elementary state transitions instead of an entire sub-computation on a machine. An example should suffice. Example 2.5. Derivation. For grammar G the “classical” leftmost derivation: E ⇒ T T ⇒ aT ⇒ a(E ) ⇒ a() G G G G (1) Parsing methods streamlined · 9 is expanded into the series of truly atomic derivation steps of the right-linearized grammar: 0E ⇒ 0T 1E ⇒ a 1E ⇒ a 0T 1E Ĝ Ĝ Ĝ ⇒ a ( 1T 1E ⇒ a ( 0E 2T 1E ⇒ a ( ε 2T 1E Ĝ Ĝ Ĝ ⇒ a ( ) 3T 1E ⇒ a ( ) ε 1E ⇒ a()ε Ĝ Ĝ Ĝ (2) = a() We may also work bottom-up and consider reductions such as a ( 1T 1E ❀ a 0T 1E . As said, the right-linearized grammar is only used in our proofs to assign a precise semantic to the parser steps, but has otherwise no use as a readable specification of the language to be parsed. Clearly, an RL grammar has many more rules than the original EBN F grammar and is less readable than a syntax diagram or machine net, because it needs to introduce a plethora of nonterminal names to identify the machine states. 2.2 Call sites, machine activation, and look-ahead B An edge labeled with a nonterminal, qA −→ rA , is named a call site for machine MB , and rA is the corresponding return state. Parsing can be viewed as a process that at call sites activates a machine, which on its own graph performs scanning operations and further calls until it reaches a final state, then performs a reduction and returns. Initially the axiom machine, MS , is activated by the program that invokes the parser. At any step in the derivation, the nonterminal suffix of the derived string contains the current state of the active machine followed by the return points of the suspended machines; these are ordered from right to left according to their activation sequence. Example 2.6. Derivation and machine return points. ∗ Looking at derivation (2), we find 0E ⇒ a ( 0E 2T 1E : machine ME is active and its current state is 0E ; previously machine MT was suspended and will resume in state 2T ; an earlier activation of ME was also suspended and will resume in state 1E . Upon termination of MB when MA resumes in return state rA , the collection of all the first legal tokens that can be scanned is named the look-ahead set of this activation of MB ; this intuitive concept is made more precise in the following definition of a candidate. By inspecting the next token, the parser can avoid invalid machine call actions. For uniformity, when the input string has been entirely scanned, we assume the next token to be the special character ⊣ (string terminator or end-marker). A 1-candidate (or 1-item), or simply a candidate since we exclusively deal with lookahead length 1, is a pair hqB , ai in Q × ( Σ ∪ {⊣} ). The intended meaning is that token a is a legal look-ahead token for the current activation of machine MB . We reformulate the classical [Knuth 1965] notion of closure function for a machine net and we use it to compute the set of legal candidates. Definition 2.7. Closure functions. The initial activation of machine MS is encoded by candidate h0S , ⊣i. Let C be a set candidates initialized to {h0S , ⊣i}. The closure of C is the function 10 · Parsing methods streamlined defined by applying the following clauses until a fixed point is reached: c ∈ closure (C) h0B , bi ∈ closure (C) if c ∈ C B if ∃ hq, ai ∈ closure (C) and ∃ edge q −→ r in M  and b ∈ Ini L (r) · a (3) Thus closure functions compute the set of machines reachable from a given call site through one or more invocations, without any intervening state transition. For conciseness, we group together the candidates that have the same state and we write q, { a1 , . . . , ak } instead of { hq, a1 i, . . . , hq, ak i }. The collection { a1 , a2 , . . . , ak } is termed look-ahead set and by definition it cannot be empty. We list a few values of closure function for the grammar of Ex. 2.2: function closure h0E , ⊣i h0E , ⊣i 0T , { ⊣, a, ( } h1T , ⊣i h1T , ⊣i 0E , ) 0T , { a, (, ) } 3. SHIFT-REDUCE PARSING We show how to construct deterministic bottom-up parsers directly for EBN F grammars represented by machine nets. As we deviate from the classical Knuth’s method, which operates on pure BN F grammars, we call our method ELR (1) instead of LR (1). For brevity, whenever some passages are identical or immediately obtainable from classical ones, we do not spend much time to justify them. On the other hand, we include correctness proofs of the main constructions because past works on Extended BN F parsers have been found not rarely to be flawed [Hemerik 2009]. At the end of this section we briefly compare our method with older ones. An ELR (1) parser is a deterministic pushdown automaton (DP DA) equipped with a set of states named macrostates (for short m-states) to avoid confusion with net states. An m-state consists of a set of 1-candidates (for brevity candidate). The automaton performs moves of two types. A shift action reads the current input character (i.e., a token) and applies the P DA state-transition function to compute the next m-state; then the token and the next m-state are pushed on the stack. A reduce action is applied when the grammar symbols from the stack top match a recognizing path on a machine MA and the current token is admitted by the look-ahead set. For the parser to be deterministic in any configuration, if a shift is permitted then reduction should be impossible, and in any configuration at most one should be possible. A reduce action grows bottom-up the syntax forest, pops the matched part of the stack, and pushes the nonterminal symbol recognized and the next m-state. The P DA accepts the input string if the last move reduces to the axiom and the input is exhausted; the latter condition can be expressed by saying that the special end-marker character ⊣ is the current token. The presence of convergent paths in a machine graph complicates reduction moves because two such paths may require to pop different stack segments (so-called reduction handles); this difficulty is acknowledged in past research on shift-reduce methods for EBNF grammars, but the proposed solutions differ in the technique used and in generality. To implement such reduction moves, we enrich the stack organization with pointers, which enable the parser to trace back a recognizing path while popping the stack. Such a pointer Parsing methods streamlined · 11 can be implemented in two ways: as a bounded integer offset that identifies a candidate in the previous stack element, or as an unbounded integer pointer to a distant stack element. In the former case the parser still qualifies as DP DA because the stack symbols are taken from a a finite set. Not so in the latter case, where the pointers are unbounded integers; this organization is an indexable stack to be called a vector-stack and will be also used by Earley parsers. 3.1 Construction of ELR (1) parsers Given an EBN F grammar represented by a machine net, we show how to construct an ELR (1) parser if certain conditions are met. The method operates in three phases: (1) From the net we construct a DF A, to be called a pilot automaton.2 A pilot state, named macro-state (m-state), includes a non empty set of candidates, i.e., of pairs of states and terminal tokens (look-ahead set). (2) The pilot is examined to check the conditions for deterministic bottom-up parsing; the check involves an inspection of the components of each m-state and of the transitions outgoing from it. Three types of failures may occur: shift-reduce or reduce-reduce conflicts, respectively signify that in a parser configuration both a shift and a reduction are possible or multiple reductions; a convergence conflict occurs when two different parser computations that share a look-ahead character, lead to the same machine state. (3) If the test is passed, we construct the deterministic P DA, i.e., the parser, through using the pilot DF A as its finite-state control and adding the operations needed for managing reductions of unbounded length. At last, it would be a simple exercise to encode the P DA in a programming language. For a candidate hpA , ρi and a terminal or nonterminal symbol X, the shift3 under X (qualified as terminal/nonterminal depending on X being a terminal or non- ) is: ( X ϑ ( hpA , ρi , X ) = hqA , ρi if edge pA −→ qA exists the empty set otherwise For a set C of candidates, the shift under a symbol X is the union of the shifts of the candidates in C. Algorithm 3.1. Construction of the ELR (1) pilot graph. The pilot is the DF A, named P, defined by: —the set R of m-states —the pilot alphabet is the union Σ ∪ V of the terminal and nonterminal alphabets —the initial m-state I0 is the set: I0 = closure (h0S , ⊣i) —the m-state set R = { I0 , I1 , . . . } and the state-transition function4 ϑ : R × (Σ ∪ V ) → R are computed starting from I0 by the following steps: R′ := { I0 } do 2 Its traditional lengthy name is “recognizer of viable LR (1) prefixes”. known as “go to” function. 4 Named theta, ϑ, to avoid confusion with the traditional name delta, δ, of the transition function of the net. 3 Also 12 · Parsing methods streamlined R := R′  for all the m-states I ∈ R and symbols X ∈ Σ ∪ V do I ′ := closure  ϑ (I, X) ′ if I 6= ∅ then X add the edge I −→ I ′ to the graph of ϑ if I ′ 6∈ R then add the m-state I ′ to the set R′ end if end if end for  while R 6= R′ 3.1.1 Base closure and kernel of a m-state. For every m-state I the set of candidates is partitioned into two subsets: base and closure. The base includes the non-initial candidates: I|base = { hq, πi ∈ I | q is not an initial state } ′ Clearly, for the m-state I ′ computed at line 3 of the algorithm, the base I|base coincides with the pairs computed by ϑ (I, X). The closure contains the remaining candidates of m-state I: I|closure = { hq, π i ∈ I | q is an initial state } The initial m-state I0 has an empty base by definition. All other m-states have a non-empty base, while the closure may be empty. The kernel of a m-state is the projection on the first component: I|kernel = { q ∈ Q | hq, πi ∈ I } A particular condition that may affect determinism occurs when, for two states that belong to the same m-state I, the outgoing transitions are defined under the same grammar symbol. Definition 3.2. Multiple Transition Property and Convergence. A pilot m-state I has the multiple transition property (M T P ) if it includes two candidates hq, πi and hr, ρi, such that for some grammar symbol X both transitions δ (q, X) and δ (r, X) are defined. Such a m-state I and the pilot transition ϑ (I, X) are called convergent if δ (q, X) = δ (r, X). A convergent transition has a convergence conflict if the look-ahead sets overlap, i.e., if π ∩ ρ 6= ∅. To illustrate, we consider two examples. Example 3.3. Pilot of the running example. The pilot graph P of the EBN F grammar and net of Example 2.2 (see Figure 1) is shown in Figure 2. In each m-state the top and bottom parts contain the base and the closure, respectively; when either part is missing, the double-line side of the m-state shows which part is present (e.g., I0 has no base and I2 has no closure); the look-ahead tokens are grouped by state; and final states are evidenced by encircling. None of the edges of the graph is convergent. Parsing methods streamlined T 0E ⊣ 0T a(⊣ 1E ⊣ 0T a(⊣ T ( a a ( I3 13 I1 I0 P → · 1T a(⊣ 0E ) 0T a() 2T a ( ⊣ E a ( ⊣ I2 3T ) I8 T I4 1E ) 0T a() ( T ( a a T a I6 1T a() 0E ) 0T a() E 2T a ( ) 3T ) a ( ) I5 I7 ( Fig. 2. ELR (1) pilot graph P of the machine net in Figure 1. Two m-states, such as I1 and I4 , having the same kernel, i.e., differing just for some look-ahead sets, are called kernel-equivalent. Some simplified parser constructions to be later introduced, rely on kernel equivalence to reduce the number of m-states. We observe that for any two kernel-equivalent m-states I and I ′ , and for any grammar symbol X, the m-states ϑ (I, X) and ϑ (I ′ , X) are either both defined or neither one, and are kernelequivalent. To illustrate the notion of convergent transition with and without conflict, we refer to Figure 4, where m-states I10 and I11 have convergent transitions, the latter with a conflict. 14 · Parsing methods streamlined 3.2 ELR (1) condition The presence of a final candidate in a m-state tells the parser that a reduction move ought to be considered. The look-ahead set specifies which tokens should occur next, to confirm the decision to reduce. For a machine net, more than one reduction may be applied in the same final state, and to choose the correct one, the parser stores additional information in the stack, as later explained. We formalize the conditions ensuring that all parser decisions are deterministic. Definition 3.4. ELR (1) condition. A grammar or machine net meets condition ELR (1) if the corresponding pilot satisfies the following conditions: Condition 1 . Every m-state I satisfies the next two clauses: no shift-reduce conflict: a for all candidates hq, πi ∈ I s.t. q is final and for all edges I −→ I ′ : a 6∈ π (4) no reduce-reduce conflict: for all candidates hq, πi, hr, ρi ∈ I s.t. q and r are final : π ∩ ρ = ∅ (5) Condition 2 . No transition of the pilot graph has a convergence conflict. The pilot in Figure 2 meets conditions (4) and (5), and no edge of ϑ is convergent. 3.2.1 ELR (1) versus classical LR (1) definitions. First, we discuss the relation between this definition and the classical one [Knuth 1965] in the case that the grammar is BN F , i.e., each nonterminal A has finitely many alternatives A → α | β | . . .. Since the alternatives do not contain star or union operations, a straightforward (nondeterministic) N F A machine, NA , has an acyclic graph shaped as a tree with as many legs originating from the initial state 0A as there are alternative rules for A. Clearly the graph of NA satisfies the no reentrance hypothesis for the initial state. In general NA is not minimal. No m-state in the classical LR (1) pilot machine can exhibit the multiple transition property, and the only requirement for parser determinism comes from clauses (4) and (5) of Def. 3.4. In our representation, machine MA may differ from NA in two ways. First, we assume that machine MA is deterministic, out of convenience not of necessity. Thus consider a nonterminal C with two alternatives, C → if E then I | if E then I else I. Determinization has the effect of normalizing the alternatives by left factoring the longest common prefix, i.e., of using the equivalent EBN F grammar C → if E then I ( ε | else I ). Second, we allow (and actually recommend) that the graph of MA be minimal with respect to the number of states. In particular, the final states of NA are merged together by state reduction if they are undistinguishable for the DF A MA . Also a non-final state of MA may correspond to multiple states of NA . Such state reduction may cause some pilot edges to become convergent. Therefore, in addition to checking conditions (4) and (5), Def. 3.4 imposes that any convergent edge be free from conflicts. Since this point is quite subtle, we illustrate it by the next example. Example 3.5. State-reduction and convergent transitions. Consider the equivalent BN F and EBN F grammars and the corresponding machines in Fig. 3. After determinizing, the states 31 S , 32 S , 33 S , 34 S of machine NS are equivalent Parsing methods streamlined · 15 Grammars BNF EBNF S → abc | abd | bc | Ae S → ab (c | d) | bc | Ae A → aS A → aS Machine nets b 1S a c 2S 31S → a a NS → 0S 1′S b 2′S d MS → 0S 4S c 33S → e 4S 3S → c A 5S A 5S c, d 2S 32S → b b b 1S e 34S → Net Common Part a NA ≡ MA → 0A S 1A 2A → Fig. 3. BN F and EBN F grammars and networks { NS , NA } and { MS , MA ≡ NA }. and are merged into the state 3S of machine MS . Turning our attention to the LR and ELR conditions, we find that the BN F grammar has a reduce-reduce conflict caused by the derivations below: S⇒Ae⇒aSe⇒abce and S ⇒ A e ⇒ a S e ⇒ a a b c e On the other hand, for the EBN F grammar the pilot P{ MS , MA } , shown in Fig. 4, has the two convergent edges highlighted as double-line arrows, one with a conflict and the c other without. Arc I8 → I11 violates the ELR (1) condition because the look-aheads of 2S and 4S in I8 are not disjoint. Notice in Fig.4 that, for explanatory purposes, in m-state I10 the two candidates h3S , ⊣i and h3S , ei deriving from a convergent transition with no conflict, have been kept separate and are not depicted as only one candidate with a single look-ahead, as it is usually done with candidates that have the same state. We observe that in general a state-reduction in the machines of the net has the effect, in the pilot automaton, to transform reduce-reduce violations into convergence conflicts. Next, we prove the essential property that justifies the practical value of our theoretical development: an EBN F grammar is ELR (1) if, and only if, the equivalent rightlinearized grammar (defined in Sect. 2.1.1) is LR (1). T HEOREM 3.6. Let G be an EBN F grammar represented by a machine net M and let Ĝ be the equivalent right-linearized grammar. Then net M meets the ELR (1) condition if, and only if, grammar Ĝ meets the LR (1) condition. The proof is in the Appendix. · 16 Parsing methods streamlined a I1 I0 a 0S 0A b A a 1A 0S e 0A b 4S e 2S I5 4S c convergent 3S ⊣ S 2A e I7 e e ⊣ e I8 c conflictual d 3S I10 e b 2S ⊣ d 4S ⊣ c I9 1S 1A e 0A e I2 I4 1S ⊣ 0S ⊣ S 3S e I11 A e 5S ⊣ I3 A I6 5S e e Fig. 4. Pilot graph of machine net { MS , MA } in Fig. 3; the double-line edges are convergent. Although this proposition may sound intuitively obvious to knowledgeable readers, we believe a formal proof is due: past proposals to extend LR (1) definitions to the EBN F (albeit often with restricted types of regular expressions), having omitted formal proofs, have been later found to be inaccurate (see Sect. 3.5). The fact that shift-reduce conflicts are preserved by the two pilots is quite easy to prove. The less obvious part of the proof concerns the correspondence between convergence conflicts in the ELR (1) pilot and reduce-reduce conflicts in the right-linearized grammar. To have a grasp without reading the proof, the convergence conflict in Fig. 4 corresponds to the reduce-reduce conflict in the m-state I11 of Fig. 21. We address a possible criticism to the significance of Theorem 3.6: that, starting from an EBN F grammar, several equivalent BN F grammars can be obtained by removing the regular expression operations in different ways. Such grammars may or may not be LR (1), a fact that would seem to make somewhat arbitrary our definition of ELR (1), which is based on the highly constrained left-linearized form. We defend the significance and generality of our choice on two grounds. First, our original grammar specification is not a set of r.e.’s, but a set of machines (DF A), and the choice to transform the DF A into a right-linear grammar is standard and almost obliged because, as already shown by [Heilbrunner 1979], the other standard form - left-linear - would exhibit conflicts in most cases. Second, the same author proves that if a right-linearized grammar equivalent to G is LR (1), then every right-linearized grammar equivalent to G, provided it is not ambiguous, is LR (1); besides, he shows that this definition of ELR (1) grammar dominates all the Parsing methods streamlined · 17 preexisting alternative definitions. We believe that also the new definitions of later years are dominated by the present one. To illustrate the discussion, it helps us consider a simple example where the machine net is ELR (1), i.e., by Theorem 3.6 Ĝ is LR (1), yet another equivalent grammar obtained by a very natural transformation, has conflicts. Example 3.7. A phrase S has the structure E ( s E)∗ , where a construct E has either the form b+ bn en or bn en e with n ≥ 0. The language is defined by the ELR (1) net below: s E MS → 0S 1S ↓ 2S E b 4E ↓ e 3E F ME ↓ 0E b 1E F MF ↓ 2E ↓ 0F ↓ b 1F F 2F e 3F ↓ On the contrary, there is a conflict in the equivalent grammar: S → E sS | E E →BF | F e F → bEf | ε B → bB | b caused by the indecision whether to reduce b+ to B or shift. The right-linearized grammar postpones any reduction decision as long as possible and avoids conflicts. 3.2.2 Parser algorithm. Given the pilot DF A of an ELR (1) grammar or machine net, we explain how to obtain a deterministic pushdown automaton DP DA that recognizes and parses the sentences. At the cost of some repetition, we recall the three sorts of abstract machines involved: the net M of DF A’s MS , MA , . . . with state set Q = { q, . . . } (states are drawn as circular nodes); the pilot DF A P with m-state set R = { I0 , I1 , . . . } (states are drawn as rectangular nodes); and the DP DA A to be next defined. As said, the DP DA stores in the stack the series of m-states entered during the computation, enriched with additional information used in the parsing steps. Moreover, the m-states are interleaved with terminal or nonterminal grammar symbols. The current m-state, i.e., the one on top of stack, determines the next move: either a shift that scans the next token, or a reduction of a topmost stack segment (also called reduction handle) to a nonterminal identified by a final candidate included in the current m-state. The absence of shift-reduce conflicts makes the choice between shift and reduction operations deterministic. Similarly, the absence of reduce-reduce conflicts allows the parser to uniquely identify the final state of a machine. However, this leaves open the problem to determine the stack segment to be reduced. For that two designs will be presented: the first uses a finite pushdown alphabet; the second uses unbounded integer pointers and, strictly speaking, no longer qualifies as a pushdown automaton. First, we specify the pushdown stack alphabet. Since for a given net M there are finitely many different candidates, the number of m-states is bounded and the number of candidates in any m-state is also bounded by CMax = |Q| × ( |Σ| + 1 ). The DP DA stack elements 18 · Parsing methods streamlined are of two types: grammar symbols and stack m-states (sms). An sms, denoted by J, contains an ordered set of triples of the form (state, look-ahead, candidate identifier (cid)), named stack candidates, specified as: hqA , π, cidi where qA ∈ Q, π ⊆ Σ ∪ { ⊣ } and 1 ≤ cid ≤ CMax or cid = ⊥ For readability, a cid value will be prefixed by a ♯ marker. The parser makes use of a surjective mapping from the set of sms to the set of m-states, denoted by µ, with the property that µ(J) = I if, and only if, the set of stack candidates of J, deprived of the candidate identifiers, equals the set of candidates of I. For notational convenience, we stipulate that identically subscripted symbols Jk and Ik are related by µ(Jk ) = Ik . As said, in the stack the sms are interleaved with grammar symbols. Algorithm 3.8. ELR (1) parser as DP DA A. Let J[0] a1 J[1] a2 . . . ak J[k] be the current stack, where ai is a grammar symbol and the top element is J[k]. Initialization. The analysis starts by pushing on the stack the sms: J0 = { s | s = hq, π, ⊥i for every candidate hq, πi ∈ I0 } (thus µ(J0 ) = I0 , the initial m-state of the pilot). Shift move. Let the top sms be J, I = µ(J) and the current token be a ∈ Σ. Assume that, by inspecting I, the pilot has decided to shift and let ϑ (I, a) = I ′ . The shift move does: (1) push token a on stack and get next token (2) push on stack the sms J ′ computed as follows: o n a (6) J ′ = hqA ′ , ρ, ♯ii | hqA , ρ, ♯ji is at position i in J ∧ qA → qA ′ ∈ δ o n ′ (7) ∪ h0A , σ, ⊥i | h0A , σi ∈ I|closure (thus µ(J ′ ) = I ′ ) Notice that the last condition in (6) implies that qA ′ is a state of the base of I ′ . Reduction move (non-initial state). The stack is J[0] a1 J[1] a2 . . . ak J[k] and let the corresponding m-states be I[i] = µ ( J[i] ) with 0 ≤ i ≤ k. Assume that, by inspecting I[k], the pilot chooses the reduction candidate c = hqA , πi ∈ I[k], where qA is a final but non-initial state. Let tk = hqA , ρ, ♯ik i ∈ J[k] be the (only) stack candidate such that the current token a ∈ ρ. From ik , a cid chain starts, which links tk to a stack candidate tk−1 = hpA , ρ, ♯ik−1 i ∈ J[k − 1], and so on until a stack candidate th ∈ J[h] is reached that has cid = ⊥ (therefore its state is initial) th = h0A , ρ, ⊥i The reduction move does: (1) grow the syntax forest by applying reduction ah+1 ah+2 . . . ak ❀ A (2) pop the stack symbols in the following order: J[k] ak J[k − 1] ak−1 . . . J[h + 1] ah+1 (3) execute the nonterminal shift move ϑ ( I[h], A ) (see below). Reduction move (initial state). It differs from the preceding case in that the chosen candidate is c = h0A , π, ⊥i. The parser move grows the syntax forest by the reduction ε ❀ A and performs the nonterminal shift move corresponding to ϑ ( I[k], A ). Parsing methods streamlined Machine MA Pilot: I ′ = ϑ (I, a) · 19 Pushdown stack: . . . J a J ′ a ′ qA qA ... B ′′ qA ′ , πi hqA ... a 1 ... −→ ... ... hqA , πi h0B , σi ... ... i hqA ′ , ρ, ♯ii ... ... a hqA , ρ, ♯ji h0B , σ, ⊥i ... ... a ′ (plus completion) in the parser stack with pointers. Fig. 5. Schematization of the shift move qA → qA Nonterminal shift move. It is the same as a shift move, except that the shifted symbol, A, is a nonterminal. The only difference is that the parser does not read the next input token at line (1) of Shift move. Acceptance. The parser accepts and halts when the stack is J0 , the move is the nonterminal shift defined by ϑ ( I0 , S ) and the current token is ⊣. For shift moves, we note that the m-states computed by Alg. 3.1, may contain multiple stack candidates that have the same state; this happens whenever edge I → θ (I, a) is convergent. It may help to look at the situation of a shift move (eq. (6) and (7)) schematized in Figure 5. Example 3.9. Parsing trace. The step by step execution of the parser on input string ( ( ) a ) produces the trace shown in Figure 6. For clarity there are two parallel tracks: the input string, progressively replaced by the nonterminal symbols shifted on the stack; and the stack of stack m-states. The stack has one more entry than the scanned prefix; the suffix yet to be scanned is to the right of the stack. Inside a stack element J[k], each 3-tuple is identified by its ordinal position, starting from 1 for the first 3-tuple; a value ♯i in a cid field of element J[k + 1] encodes a pointer to the i-th 3-tuple of J[k]. To ease reading the parser trace simulation, the m-state number appears framed in each stack element, e.g., I0 is denoted 0 , etc.; the final candidates are encircled, e.g., 1E , etc.; and to avoid clogging, look-ahead sets are not shown as they are only needed for convergent transitions, which do not occur here. But the look-aheads can always be found by inspecting the pilot graph. Fig. 6 highlights the shift moves as dashed forward arrows that link two topmost stack ( candidates. For instance, the first (from the Figure top) terminal shift, on (, is h0T , ⊥i → E h1T , ♯2i. The first nonterminal shift is the third one, on E, i.e., h1T , ♯3i → h2T , ♯1i, after the null reduction ε ❀ E. Similarly for all the other shifts. Fig. 6 highlights the reduction handles, by means of solid backward arrows that link the candidates involved. For instance, see reduction ( E ) ❀ T : the stack configuration above shows the chain of three pointers ♯1, ♯1 and ♯3 - these three stack elements form the handle and are popped - and finally the initial pointer ⊥ - this stack element is the reduction origin and is not popped. The initial pointer ⊥ marks the initial candidate h0T , ⊥i, which is obtained by means of a closure operation applied to candidate h0E , ⊥i in the same stack element, see the dotted arrow that links them, from which the subsequent shift on T starts, see the dashed arrow in the stack configuration below. The solid self-loop on candidate · 20 Parsing methods streamlined string to be parsed (with end-marker) and stack contents stack base effect after 1 2 3 4 5 ( ( ) a ) ⊣ initialisation of the stack ( 3 ( 1T ♯2 0E ⊥ 0T ⊥ ( 1T ♯2 0E ⊥ 0T ⊥ 6 ( 3 ♯2 0E ⊥ 0T ⊥ 6 ( 3 ) 1T ♯3 0E ⊥ 0T ⊥ ( 1T ♯2 0E ⊥ 0T ⊥ ♯3 0E ⊥ 0T ⊥ 6 0 ⊥ 0T ⊥ 3 ♯3 0E ⊥ 0T ⊥ ♯2 0E ⊥ 0T ⊥ 4 ♯2 0E ⊥ 0T ⊥ 4 ( 3 ) 1E ♯2 0T ⊥ ♯2 0T ⊥ ♯2 0E ⊥ 0T ⊥ 4 ) ♯2 0T ⊥ ) 5 3T 4 ♯2 0E ⊥ 0T ⊥ shift on a ) 1E ♯1 0T ⊥ ♯2 0E ⊥ 0T ⊥ ⊣ reduction a ❀ T and shift on T ) ⊣ reduction T T ❀ E and shift on E 8 2T ♯1 ) E 1T ⊣ ♯2 E 1T ⊣ reduction ( E ) ❀ T and shift on T T 1E ( 3 shift on ) a 1E ⊣ ♯1 a ( 3 3T 5 T 1T ⊣ ) a T 1T ) a T 1T ⊣ reduction ε ❀ E and shift on E 7 2T ♯1 ( 3 ) E 1T ) a 7 2T ♯1 ( 0E ⊣ shift on ( E 1T ( 1T ) a shift on ( ( 3 ) 8 2T ♯1 1E ♯1 0T ⊥ E 3T ♯1 shift on ) ⊣ T 1 2 ⊣ reduction ( E ) ❀ T and shift on T ⊣ reduction T ❀ E and accept without shifting on E Fig. 6. Parsing steps for string ( ( ) a ) (grammar and ELR (1) pilot in Figures 1 and 2); the name Jh of a sms maps onto the corresponding m-state µ(Jh ) = Ih . h0E , ⊥i (at the 2nd shift of token ( - see the effect on the line below) highlights the null reduction ε ❀ E, which does not pop anything from the stack and is immediately followed by a shift on E. We observe that the parser must store on stack the scanned grammar symbols, because Parsing methods streamlined · 21 in a reduction move, at step (2), they may be necessary for selecting the correct reduction handle and build the subtree to be added to the syntax forest. Returning to the example, the execution order of reductions is: ε❀E (E ) ❀ T a❀T (E ) ❀ T TT ❀E T ❀E Pasting together the reductions, we obtain this syntax tree, where the order of reductions is displayed: E 6 T 5 ( ) E 4 T T 2 ( 3 E ) a 1 ε Clearly, the reduction order matches a rightmost derivation but in reversed order. It is worth examining more closely the case of convergent conflict-free edges. Returning to Figure 5, notice that the stack candidates linked by a cid chain are mapped onto m′ state candidates that have the same machine state (here the stack candidate hqA , ρ, ♯ii is linked via ♯i to hqA , ρ, ♯ji): the look-ahead set π of such m-state candidates is in general a superset of the set ρ included in the stack candidate, due to the possible presence of convergent transitions; the two sets ρ and π coincide when no convergent transition is taken on the pilot automaton at parsing time. An ELR(1) grammar with convergent edges is studied next. Example 3.10. The net, pilot graph and the trace of a parse are shown in Figure 7, where, for readability, the cid values in the stack candidates are visualized as backward pointing arrows. Stack m-state J3 contains two candidates which just differ in their lookahead sets. In the corresponding pilot m-state I3 , the two candidates are the targets of a convergent non-conflictual m-state transition (highlighted double-line in the pilot graph). 3.3 Simplified parsing for BNF grammars For LR (1) grammars that do not use regular expressions in the rules, some features of the ELR (1) parsing algorithm become superfluous. We briefly discuss them to highlight the differences between extended and basic shift-reduce parsers. Since the graph of every machine is a tree, there are no edges entering the same machine state, which rules out the presence of convergent edges in the pilot. Moreover, the alternatives of a nonterminal, A → α | β | . . ., are recognized in distinct final states qα, A , qβ, A , . . . of machine MA . Therefore, if the candidate chosen by the parser is qα, A , the DP DA simply pops 2 × |α| stack elements and performs the reduction α ❀ A. Since pointers to a preceding stack candidate are no longer needed, the stack m-states coincide with the pilot ones. Second, for a related reason the interleaved grammar symbols are no longer needed on the stack, because the pilot of an LR (1) grammar has the well-known property that all the edges entering an m-state carry the same terminal/nonterminal label. Therefore the reduction handle is uniquely determined by the final candidate of the current m-state. 22 · Parsing methods streamlined Machine Net 2S A MS → 0S a e d 4S → 1S MA → 0A 1A b e 2A → A b 3S Pilot Graph I2 I1 I0 a 0S ⊣ 1S ⊣ I3 3S ⊣ b e 2A 1A d 0A d convergent edge 0A ⊣ A d ⊣ A 4S 2S ⊣ ⊣ d I4 I5 Parse Traces J0 a J1 b J0 J1 1S ⊣ 0S ⊣ 1A d 0A d a e 3S ⊣ 1S ⊣ 0S ⊣ J2 J3 d 2A d 2A ⊣ 0A ⊣ A J4 2S ⊣ d ⊣ J5 4S ⊣ 0A d reductions b e ❀ A (above) and a A d ❀ S (below) Fig. 7. ELR (1) net, pilot with convergent edges (double line) and parsing trace of string a b e d ⊣. ⊣ Parsing methods streamlined · 23 The simplifications have some effect on the formal notation: for BN F grammars the use of machine nets and their states becomes subjectively less attractive than the classical notation based on marked grammar rules. 3.4 Parser implementation using an indexable stack Before finishing with bottom-up parsing, we present an alternative implementation of the parser for EBN F grammars (Algorithm 3.8, p. 18), where the memory of the analyzer is an array of elements such that any element can be directly accessed by means of an integer index, to be named a vector-stack. The reason for presenting the new implementation is twofold: this technique is compatible with the implementation of non-deterministic tabular parsers (Sect. 5) and is potentially faster. On the other hand, a vector-stack as data-type is more general than a pushdown stack, therefore this parser cannot be viewed as a pure DP DA. As before, the elements in the vector-stack are of two alternating types: vector-stack m-states vsms and grammar symbols. A vsms, denoted by J, is a set of triples, named vector-stack candidates, the form of which hqA , π, elemidi simply differs from the earlier stack candidates because the third component is a positive integer named element identifier instead of a cid. Notice also that now the set is not ordered. The surjective mapping from vector-stack m-states to pilot m-states is denoted µ, as before. Each elemid points back to the vector-stack element containing the initial state of the current machine, so that, when a reduction move is performed, the length of the string to be reduced - and the reduction handle - can be obtained directly without inspecting the stack elements below the top one. Clearly the value of elemid ranges from 1 to the maximum vector-stack height. Algorithm 3.11. ELR(1) parser automaton A using a vector-stack. Let J[0] a1 J[1] a2 . . . ak J[k] be the current stack, where ai is a grammar symbol and the top element is J[k]. Initialization. The analysis starts by pushing on the stack the sms: J0 = { s | s = hq, π, 0i for every candidate hq, πi ∈ I0 } (thus µ(J0 ) = I0 , the initial m-state of the pilot). Shift move. Let the top vsms be J, I = µ(J) and the current token be a ∈ Σ. Assume that, by inspecting I, the pilot has decided to shift and let ϑ (I, a) = I ′ . The shift move does: (1) push token a on stack and get next token (2) push on stack the sms J ′ (more precisely, k := k + 1 and J[k] := J ′ ) computed as follows: o n a (8) J ′ = hqA ′ , ρ, ji | hqA , ρ, ji is in J ∧ qA → qA ′ ∈ δ o n ′ (9) ∪ h0A , σ, ki | h0A , σi ∈ I|closure (thus µ(J ′ ) = I ′ ) Reduction move (non-initial state). The stack is J[0] a1 J[1] a2 . . . ak J[k] and let the corresponding m-states be I[i] = µ ( J[i] ) with 0 ≤ i ≤ k. Assume that, by inspecting I[k], the pilot chooses the reduction candidate c = hqA , πi ∈ I[k], where qA is a final but non-initial state. Let tk = hqA , ρ, hi ∈ J[k] be the (only) stack candidate such that the current token a ∈ ρ. 24 · Parsing methods streamlined The reduction move does: (1) grow the syntax forest by applying reduction ah+1 ah+2 . . . ak ❀ A (2) pop the stack symbols in the following order: J[k] ak J[k − 1] ak−1 . . . J[h + 1] ah+1 (3) execute the nonterminal shift move ϑ ( I[h], A ) (see below). Reduction move (initial state). It differs from the preceding case in that the chosen candidate is c = h0A , π, ki. The parser move grows the syntax forest by the reduction ε ❀ A and performs the nonterminal shift move corresponding to ϑ ( I[k], A ). Nonterminal shift move. It is the same as a shift move, except that the shifted symbol, A, is a nonterminal. The only difference is that the parser does not read the next input token at line (1) of Shift move. Acceptance. The parser accepts and halts when the stack is J0 , the move is the nonterminal shift defined by ϑ ( I0 , S ) and the current token is ⊣. Although the algorithm uses a stack, it cannot be viewed as a P DA because the stack alphabet is unbounded since a vsms contains integer values. Example 3.12. Parsing trace. Figure 8, to be compared with Figure 6, shows the same step by step execution of the parser as in Example 3.9, on input string ( ( ) a ); the graphical conventions are the same. In every stack element of type vsms the second field of each candidate is the elemid index, which points back to some inner position of the stack; elemid is equal to the current stack position for all the candidates in the closure part of a stack element, and points to some previous position for the candidates of the base. As in Figure 6, the reduction handles are highlighted by means of solid backward pointers, and by a dotted arrow to locate the candidate to be shifted soon after reducing. Notice that now the arrows span a longer distance than in Figure 6, as the elemid goes directly to the origin of the reduction handle. The forward shift arrows are the same as those in Fig. 6 and are here not shown. The results of the analysis, i.e., the execution order of the reductions and the obtained syntax tree, are identical to those of Example 3.9. We illustrate the use of the vector-stack on the previous example of a net featuring a convergent edge (net in Figure 7): the parsing traces are shown in Figure 9, where the integer pointers are represented by backward pointing solid arrows. 3.5 Related work on shift-reduce parsing of EBNF grammars. Over the years many contributions have been published to extend Knuth’s LR (k) method to EBN F grammars. The very number of papers, each one purporting to improve over previous attempts, testifies that no clear-cut optimal solution has been found. Most papers usually start with critical reviews of related proposals, from which we can grasp the difficulties and motivations then perceived. The following discussion particularly draws from the later papers [Morimoto and Sassa 2001; Kannapinn 2001; Hemerik 2009]. The first dichotomy concerns which format of EBN F specification is taken as input: either a grammar with regular expressions in the right parts, or a grammar with finiteautomata (F A) as right parts. Since it is nowadays perfectly clear that r.e. and F A are interchangeable notations for regular languages, the distinction is no longer relevant. Yet some authors insisted that a language designer should be allowed to specify syntax constructs by arbitrary r.e.’s, even ambiguous ones, which allegedly permit a more flexible Parsing methods streamlined stack base string to be parsed (with end-marker) and stack contents (with indices) 0 · 25 effect after 1 2 3 4 5 ( ( ) a ) ⊣ initialisation of the stack ( 1T 3 ( 0E 1 0T 1 3 ( 0 0E 1 0T 1 3 6 1T 6 0E 2 0T 2 1 0E 2 0T 2 0 1T 1 1 6 0 0 0T 0 1T 3 1 1 0E 2 0T 2 7 2T 1 4 ( 1T 3 0E 1 0T 1 0 0E 1 0T 1 3 1 0T 2 4 4 ) 1 0T 2 ) 5 3T 1 0T 2 4 ⊣ 2 shift on a ) T 1E ⊣ reduction ( E ) ❀ T and shift on T a 1E 1E 1 0T 3 ⊣ reduction a ❀ T and shift on T ) E 1 0T 1 ⊣ reduction T T ❀ E and shift on E 8 2T 0 ( 3 shift on ) 0 0E 1T ⊣ 1 a 1E ( 1T 3T 5 T 1T ) a T 0 ( 3 ) T 0T ⊣ reduction ε ❀ E and shift on E E 0 0E ) a 1 ( 0E ) 7 2T 1 ( 0T ⊣ shift on ( E 1 0E ) a 1 0T ( 3 ⊣ 1 ( 0 0E 1T ) 1T ( 1T ) a shift on ( ( 1T ) 0 ) E ⊣ 0 0E 1 0T 1 8 2T 0 2 1E 0 0T 1 E 0 shift on ) ⊣ T 1 3T reduction ( E ) ❀ T and shift on T ⊣ reduction T ❀ E and accept without shifting on E Fig. 8. Tabulation of parsing steps of the parser using a vector-stack for string ( ( ) a ) generated by the grammar in Figure 1 having the ELR (1) pilot of Figure 2. 26 · Parsing methods streamlined Pilot Graph I2 I1 I0 a 0S ⊣ 1S ⊣ I3 3S ⊣ b e 2A 1A d 0A d 0A ⊣ A d ⊣ convergent edge A 4S 2S ⊣ ⊣ d I4 I5 Parse Traces J0 a J1 b J0 J1 1S ⊣ 0S ⊣ 1A d 0A d a e 3S ⊣ 1S ⊣ 0S ⊣ J2 J3 d 2A d 2A ⊣ ⊣ 0A ⊣ A J4 2S ⊣ d ⊣ J5 4S ⊣ 0A d reductions b e ❀ A (above) and a A d ❀ S (below) Fig. 9. Parsing steps of the parser using a vector-stack for string a b e d ⊣ recognized by the net in Figure 7, with the pilot here reproduced for convenience. mapping from syntax to semantics. In their view, which we do not share, transforming the original r.e.’s to DF A’s is not entirely satisfactory. Others have imposed restrictions on the r.e.’s, for instance limiting the depth of Kleene star nesting or forbidding common subexpressions, and so on. Although the original motivation to simplify parser construction has since vanished, it is fair to say that the r.e.’s used in language reference manuals are typically very simple, for the reason of avoiding Parsing methods streamlined · 27 obscurity. Others prefer to specify right parts by using the very readable graphical notations of syntax diagrams, which are a pictorial variant of FA state-transition diagrams. Whether the F A’s are deterministic or non- does not really make a difference, either in terms of grammar readability or ease of parser generation. Even when the source specification includes N F A’s, it is as simple to transform them into DF A’s by the standard construction, as it is to leave the responsibility of removing finite-state non-determinism to the algorithm that constructs the LR (1) automaton (pilot). On the other hand, we have found that an inexpensive normalization of F A’s (disallowing reentrance into initial states, Def. 2.1) pays off in terms of parser construction simplification. Assuming that the grammar is specified by a net of F A’s, two approaches for building a parser have been followed: (A) transform the grammar into a BN F grammar and apply Knuth’s LR (1) construction, or (B) directly construct an ELR (1) parser from the given machine net. It is generally agreed that “approach (B) is better than approach (A) because the transformation adds inefficiency and makes it harder to determine the semantic structure due to the additional structure added by the transformation” [Morimoto and Sassa 2001]. But since approach (A) leverages on existing parser generators such as Bison, it is quite common for language reference manuals featuring syntax chart notations to include also an equivalent BN F LR (1) (or even LALR (1)) grammar. In [Celentano 1981] a systematic transformation from EBN F to BN F is used to obtain, for an EBN F grammar, an ELR (1) parser that simulates the classical Knuth’s parser for the BN F grammar. The technical difficulty of approach (B), which all authors had to deal with, is how to identify the left end of a reduction handle, since its length is variable and possibly unbounded. A list of different solutions can be found in the already cited surveys. In particular, many algorithms (including ours) use a special shift move, sometimes called stackshift, to record into the stack the left end of the handle when a new computation on a net machine is started. But, whenever such algorithms permit an initial state to be reentered, a conflict between stack-shift and normal shift is unavoidable, and various devices have been invented to arbitrate the conflict. Some add read-back states to control how the parser should dig into the stack [Chapman 1984; LaLonde 1979], while others (e.g., [Sassa and Nakata 1987]) use counters for the same purpose, not to mention other proposed devices. Unfortunately it was shown in [Gálvez 1994; Kannapinn 2001] that several proposals do not precisely characterize the grammars they apply to, and in some cases may fall into unexpected errors. Motivated by the mentioned flaws of previous attempts, the paper by [Lee and Kim 1997] aims at characterizing the LR (k) property for ECF G grammars defined by a network of FA’s. Although their definition is intended to ensure that such grammars “can be parsed from left to right with a look-ahead of k symbols”, the authors admit that “the subject of efficient techniques for locating the left end of a handle is beyond the scope of this paper”. After such a long history of interesting but non-conclusive proposals, our finding of a rather simple formulation of the ELR (1) condition leading to a naturally corresponding parser, was rather unexpected. Our definition simply adds the treatment of convergent edges to Knuth’s definition. The technical difficulties were well understood since long and we combined existing ideas into a simple and provably correct solution. Of course, more experimental work would be needed to evaluate the performance of our algorithms 28 · Parsing methods streamlined on real-sized grammars. 4. DETERMINISTIC TOP-DOWN PARSING A simpler and very flexible top-down parsing method, traditionally called ELL (1),5 applies if an ELR (1) grammar satisfies further conditions. Although less general than the ELR (1), this method has several assets, primarily the ability to anticipate parsing decisions thus offering better support for syntax-directed translation, and to be implemented by a neat modular structure made of recursive procedures that mirror the graphs of network machines. In the next sections, our presentation rigorously derives step by step the properties of topdown deterministic parsers, as we add one by one some simple restrictions to the ELR( 1) condition. First, we consider the Single Transition Property and how it simplifies the shiftreduce parser: the number of m-states is reduced to the number of net states, convergent edges are no longer possible and the chain of stack pointers can be disposed. Second, we add the requirement that the grammar is not left-recursive and we obtain the traditional predictive top-down parser, which constructs the syntax tree in pre-order. At last, the direct construction of ELL (1) parsers sums up. Historical note. In contrast to the twisted story of ELR (1) methods, early efforts to develop top-down parsing algorithms for EBN F grammars have met with remarkable success and we do not need to critically discuss them, but just to cite the main references and to explain why our work adds value to them. Deterministic parsers operating topdown were among the first to be constructed by compilation pioneers, and their theory for BN F grammars was shortly after developed by [Rosenkrantz and Stearns 1970; Knuth 1971]. A sound method to extend such parsers to EBN F grammars was popularized by [Wirth 1975] recursive-descent compiler, systematized in the book [Lewi et al. 1979], and included in widely known compiler textbooks (e.g., [Aho et al. 2006]). However in such books top-down deterministic parsing is presented before shift-reduce methods and independently of them, presumably because it is easier to understand. On the contrary, this section shows that top-down parsing for EBN F grammars is a corollary of the ELR (1) parser construction that we have just presented. Of course, for pure BN F grammars the relationship between LR (k) and LL (k) grammar and language families has been carefully investigated in the past, see in particular [Beatty 1982]. Building on the concept of multiple transitions, which we introduced for ELR (1) analysis, we extend Beatty’s characterization to the EBN F case and we derive in a minimalist and provably correct way the ELL (1) parsing algorithms. As a by-product of our unified approach, we mention in the Conclusion the use of heterogeneous parsers for different language parts. 4.1 Single-transition property and pilot compaction Given an ELR (1) net M and its ELR (1) pilot P, recall that a m-state has the multipletransition property 3.2 (M T P ) if two identically labeled state transitions originate from two candidates present in the m-state. For brevity we also say that such m-state violates the single-transition property (ST P ). The next example illustrates several cases of violation. Example 4.1. Violations of ST P . 5 Extended, Left to right, Leftmost, with length of look-ahead equal to one. · Parsing methods streamlined 29 a Machine Net 1S a N a 1N 3N → 2N ↓ 2S → MS → 0S b N MN → 0N N Pilot Graph I1 I0 1S P → 0S ⊣ a 1N 0N 0N N I3 2S I2 ⊣ a b ⊣ N ⊣ 2S I4 ⊣ 2N 3N ⊣ b ⊣ 0N b ⊣ a N I5 2S ⊣ 2N b ⊣ b b I6 1S 1N ⊣ I7 3N b ⊣ Fig. 10. ELR(1) net of Ex. 4.1 with multiple candidates in the m-state base of I1 , I2 , I4 , I5 . Three cases are examined. First, grammar S → a∗ N , N → a N b | ε, generating the deterministic non-LL (k) language { an bm | n ≥ m ≥ 0 }, is represented by the net in Fig. 10, top. The presence of two candidates in I1|base (and also in other m-states) reveals that the parser has to carry on two simultaneous attempts at parsing until a reduction takes place, which is unique, since the pilot satisfies the ELR (1) condition: there are neither shift-reduction nor reduction-reduction conflicts, nor convergence conflicts. Second, the net in Figure 7 illustrates the case of multiple candidates in the base of a m-state (I3 ) that is entered by a convergent edge. Third, grammar S → b ( a | S c ) | a has a pilot that violates ST P , yet it contains only one candidate in each m-state base. On the other hand, if every m-state base contains one candidate, the parser configuration space can be reduced as well as the range of parsing choices. Furthermore, ST P entails that there are no convergent edges in the pilot. Next we show that m-states having the same kernel, qualified for brevity as kernelidentical, can be safely coalesced, to obtain a smaller pilot that is equivalent to the original one and bears closer resemblance to the machine net. We hasten to say that such transformation does not work in general for an ELR (1) pilot, but it will be proved to be correct under the ST P hypothesis. 30 · Parsing methods streamlined 4.1.1 Merging kernel-identical m-states. The merging operation coalesces two kernelidentical m-states I1 and I2 , suitably adjusts the pilot graph, then possibly merges more kernel-identical m-states. It is defined as follows: Algorithm 4.2. M erge ( I1 , I2 ) (1) replace I1 , I2 by a new kernel-identical m-state, denoted by I1, 2 , where each lookahead set is the union of the corresponding ones in the merged m-states: hp, πi ∈ I1, 2 ⇐⇒ hp, π1 i ∈ I1 and hp, π2 i ∈ I2 and π = π1 ∪ π2 (2) the m-state I1, 2 becomes the target for all the edges that entered I1 or I2 : X X X I −→ I1, 2 ⇐⇒ I −→ I1 or I −→ I2 (3) for each pair of edges from I1 and I2 , labeled X, the target m-states (which clearly are kernel-identical) are merged:  if ϑ ( I1 , X ) 6= ϑ ( I2 , X ) then call M erge ϑ (I1 , X ), ϑ ( I2 , X ) Clearly the merge operation terminates with a graph with fewer nodes. The set of all kernel-equivalent m-states is an equivalence class. By applying the Merge algorithm to the members of every equivalence class, we construct a new graph, to be called the compact pilot and denoted by C.6 Example 4.3. Compact pilot. We reproduce in Figure 11 the machine net, the original ELR (1) pilot and, in the bottom part, the compact pilot, where for convenience the m-states have been renumbered. Notice that the look-ahead sets have expanded: e.g., in K1T the look-ahead in the first row is the union of the corresponding look-aheads in the merged m-states I3 and I6 . We are going to prove that this loss of precision is not harmful for parser determinism thanks to the stronger constraints imposed by ST P . We anticipate from Section 4.4 that the compact pilot can be directly constructed from the machine net, saving some work to compute the larger ELR (1) pilot and then to merge kernel-identical nodes. 4.1.2 Properties of compact pilots. We are going to show that we can safely use the compact pilot as parser controller. P ROPERTY 4.4. Let P and C be respectively the ELR (1) pilot and the compact pilot of a net M satisfying ST P 7 . The ELR (1) parsers controlled by P and by C are equivalent, i.e., they recognize language L (M) and construct the same syntax tree for every x ∈ L (M). P ROOF. We show that, for every m-state, the compact pilot has no ELR (1) conflicts. Since the merge operation does not change the kernel, it is obvious that every C m-state 6 For the compact pilot the number of m-states is the same as for the LR (0) and LALR (1) pilots, which are historical simpler variants of LR (1) parsers not considered here, see for instance [Crespi Reghizzi 2009]. However neither LR (0) nor LALR (1) pilots have to comply with the ST P condition. 7 A weaker hypothesis would suffice: that every m-state has at most one candidate in its base, but for simplicity we have preferred to assume also that convergent edges are not present. · Parsing methods streamlined Machine Net 31 a T ME → 0E 1E ↓ ↓ MT → 0T T 1T 3T → 2T E ( ) Pilot Graph I1 I0 P → 0E ⊣ 0T a(⊣ T 1E ⊣ 0T a(⊣ T ( I3 1T a(⊣ 0E ) 0T a() 2T a ( ⊣ E a ( ⊣ I2 3T ) I8 I4 T 1E ) 0T a() ( T ( I6 a a ( 1T a() 0E ) 0T a() a 2T a ( ) E a a T 3T ) a ( ) I5 I7 ( Compact Pilot Graph K1E ≡ I1,4 K0E ≡ I0 L→ 0E ⊣ 0T a(⊣ 1T a() ⊣ 0E ) 0T a() 1E ) ⊣ 0T a() ⊣ T a ( ( K1T ≡ I3,6 T T E a a 2T a ( ) ⊣ 3T a() ⊣ ) K2T ≡ I7,8 K3T ≡ I2,5 ( Fig. 11. From top to bottom: machine net M, ELR (1) pilot graph P and compact pilot C; the equivalence classes of m-states are: { I0 }, { I1 , I4 }, { I2 , I5 }, { I3 , I6 } and { I7 , I8 }; the m-states of C are named K0E , . . . , K3T to evidence their correspondence with the states of net M. 32 · Parsing methods streamlined satisfies ST P . Therefore non-initial reduce-reduce conflicts can be excluded, since they involve two candidates in a base, a condition which is ruled out by ST P . Next, suppose by contradiction that a reduce-shift conflict between a final non-initial a ′ , occurs in I1, 2 , but neither in I1 nor in I2 . Since hqA , ai is state qA and a shift of qB → qB in the base of I1, 2 , it must also be in the bases of I1 or I2 , and an a labeled edge originates from I1 or I2 . Therefore the conflict was already there, in one or both m-states I1 , I2 . Next, suppose by contradiction that I1, 2 has a new initial reduce-shift conflict between an outgoing a labeled edge and an initial-final candidate h0A , ai. By definition of merge, h0A , ai is already in the look-ahead set of, say, I1 . Moreover, for any two kernel-identical m-states I1 and I2 , for any symbol X ∈ Σ ∪ V , either both ϑ (I1 , X) = I1′ and ϑ (I2 , X) = I2′ are defined or neither one, and the m-states I1′ , I2′ are kernel-identical. Therefore, an a labeled edge originates from I1 , which thus has a reduce-shift conflict, a contradiction. Last, suppose by contradiction that I1, 2 contains a new initial reduce-reduce conflict between 0A and 0B for some terminal character a that is in both look-ahead sets. Clearly in one of the merged m-states, say I1 , there are (in the closure) the candidates: h0A , π1 i with a ∈ π1 and h0B , ρ1 i with a 6∈ ρ1 and in I2 there are (in the closure) the candidates: h0A , π2 i with a 6∈ π2 and h0B , ρ2 i with a ∈ ρ2 To show the contradiction, we recall how look-aheads are computed. Let the bases be respectively hqC , σ1 i for I1 and hqC , σ2 i for I2 . Then any character in, say, π1 comes in two possible ways: 1) it is present in σ1 , or 2) it is a character that follows some state that is in the closure of I1 . Focusing on character a, the second possibility is excluded because a 6∈ π2 , whereas the look-ahead elements brought by case 2) are necessarily the same for m-states I1 and I2 . It remains that the presence of a in π1 and in ρ2 comes from its presence in σ1 and in σ2 . Hence a must be also in π2 , a contradiction. The parser algorithms differ only in their controllers, P and C. First, take a string accepted by the parser controlled by P. Since any m-state created by merge encodes exactly the same cases for reduction and for shift as the original merged m-states, the parsers will perform exactly the same moves for both pilots. Moreover, the chains of candidate identifiers are clearly identical since the candidate offset are not affected by merge. Therefore, at any time the parser stacks store the same elements, up to the merge relation, and the compact parser recognizes the same strings and constructs the same tree. Second, suppose by contradiction that an illegal string is recognized using the compact parser. For this string consider the first parsing time where P stops in error in m-state I1 , whereas C is able to move from I1, 2 . If the move is a terminal shift, the same shift is necessarily present in I1 . If it is a reduction, since the candidate identifier chains are identical, the same string is reduced to the same nonterminal. Therefore also the following nonterminal shift operated by C is legal also for P, which is a contradiction. We have thus established that the parser controlled by the compact pilot is equivalent to the original one. 4.1.3 Candidate identifiers or pointers unnecessary. Thanks to the ST P property, the parser can be simplified to remove the need for cid’s (or stack pointers). We recall that a cid was needed to find the reach of a non-empty reduction move into the stack: elements Parsing methods streamlined · 33 were popped until the cid chain reached an initial state, the end-of-list sentinel. Under ST P hypothesis, that test is now replaced by a simpler device, to be later incorporated in the final ELL (1) parser (Alg. 4.13). With reference to Alg. 3.8, only shift and reduction moves are modified. First, let us focus on the situation when the old parser, with J on top of stack and J|base = hqA , πi, performs the shift of X (terminal or non-) from state qA , which is necessarily non-initial; the shift would require to compute and record a non-null cid into the sms J ′ to be pushed on stack. In the same situation, the pointerless parser cancels from the top-of-stack element J all candidates other than qA , since they correspond to discarded parsing alternatives. Notice that the canceled candidates are necessarily in J|closure , hence they contain only initial states. Their elimination from the stack allows the parser to uniquely identify the reduction to be made when a final state of machine MA is entered, by a simple rule: keep popping the stack until the first occurrence of initial state 0A is found. Second, consider a shift from an initial state h0A , πi, which is necessarily in J|closure . In this case the pointerless parser leaves J unchanged and pushes ϑ (J, X) on the stack. The other candidates present in J cannot be canceled because they may be the origin of future nonterminal shifts. Since cid’s are not used by this parser, a stack element is identical to an m-state (of the compact pilot). Thus a shift move first updates the top of stack element, then it pushes the input token and the next m-state. We specify only the moves that differ from Alg. 3.8. Algorithm 4.5. Pointerless parser AP L . Let the pilot be compacted; m-states are denoted Ki and stack symbols Hi ; the set of candidates of Hi is weakly included in Ki . Shift move. Let the current character be a, H be the top of stack element, containing a candidate hqA , πi. Let qA → qA ′ and ϑ (K, a) = K ′ be respectively the state transition and m-state transition, to be applied. The shift move does: (1) if qA ∈ K|base (i.e., qA is not initial), eliminate all other candidates from H, i.e., set H equal to K|base (2) push a on stack and get next token (3) push H ′ = K ′ on the stack Reduction move (non-initial state). Let the stack be H[0] a1 H[1] a2 . . . ak H[k]. Assume that the pilot chooses the reduction candidate hqA , πi ∈ K[k], where qA is a final but non-initial state. Let H[h] be the topmost stack element such that 0A ∈ K[h]|kernel . The move does: (1) grow the syntax forest by applying the reduction ah+1 ah+2 . . . ak ❀ A and pop the stack symbols H[k], ak , H[k − 1], ak−1 , . . . , H[h + 1], ah+1 (2) execute the nonterminal shift move ϑ (K[h], A) Reduction move (initial state). It differs from the preceding case in that, for the chosen reduction candidate h0A , πi, the state is initial and final. Reduction ε ❀ A is applied to grow the syntax forest. Then the parser performs the nonterminal shift move ϑ (K[k], A). Nonterminal shift move. It is the same as a shift move, except that the shifted symbol is a nonterminal. The only difference is that the parser does not read the next input token at line (2) of Shift move. Clearly this reorganization removes the need of cid’s or pointers while preserving correctness. 34 · Parsing methods streamlined P ROPERTY 4.6. If the ELR (1) pilot of an EBN F grammar or machine net satisfies the ST P condition, the pointerless parser AP L of Alg. 4.5 is equivalent to the ELR (1) parser A of Alg. 3.8. P ROOF. There are two parts to the proof, both straightforward to check. First, after parsing the same string, the stacks of parsers A and AP L contain the same number k of stack elements, respectively J[0] . . . J[k] and K[0] . . . K[k], and for every pair of corresponding elements, the set of states included in K[i] is a subset of the set of states included in J[i] because Alg. 4.5 may have discarded a few candidates. Furthermore, we claim the next relation for any pair of stack elements at position i and i − 1. in J[i] candidate hqA , π, ♯ji points to hpA , π, ♯li in J[i − 1]|base ⇐⇒ hqA , πi ∈ K[i] and the only candidate in K[i − 1] is hpA , πi in J[i] candidate hqA , π, ♯ji points to h0A , π, ⊥i in J[i − 1]|closure ⇐⇒ hqA , πi ∈ K[i] and K[i − 1] equals the projection of J[i − 1] on hstate, look-aheadi Then by the specification of reduction moves, A performs reduction: ah+1 ah+2 . . . ak ❀ A ⇐⇒ AP L performs the same reduction Example 4.7. Pointerless parser trace. Such a parser is characterized by having in each stack element only one non-initial machine state, plus possibly a few initial ones. Therefore the parser explores only one possible reduction at a time and candidate pointers are not needed. Given the input string ( ( ) a ) ⊣, Figure 12 shows the execution trace of a pointerless parser for the same input as in Figure 6 (parser using cid’s). The graphical conventions are unchanged: the m-state (of the compact pilot) in each cell is framed, e.g., K0S is denoted 0S , etc.; the final candidates are encircled, e.g., 3T , etc.; and the look-aheads are omitted to avoid clogging. So a candidate appears as a pure machine state. Of course, here there are no pointers; instead, the initial candidates canceled by Alg. 4.5 from a mstate, are striked out. We observe that upon starting a reduction, the initial state of the active machine might in principle show up in a few stack elements to be popped. For instance the first (from the Figure top) reduction ( E ) ❀ T of machine MT , pops three stack elements, namely K3T , K2T and K1T , and the one popped last, i.e., K1T , contains a striked out candidate 0T that would be initial for machine MT . But the real initial state for the reduction remains instead unstriked below in the stack in element K1T , which in fact is not popped and thus is the origin of the shift on T soon after executed. We also point out that Alg. 4.5 does not cancel any initial candidates from a stack element, if a shift move is executed from one such candidate (see the Shift move case of Alg. 4.5). The motivation for not canceling is twofold. First, these candidates will not cause any early stop of the series of pop moves in the reductions that may come later, or said differently, they will not break any reduction handle. For instance the first (from the Figure top) shift on ( of machine MT , keeps both initial candidates 0E and 0T in the Parsing methods streamlined string to be parsed (with end-marker) and stack contents stack base · 35 effect after 1 2 3 4 5 ( ( ) a ) ⊣ initialisation of the stack ( ( ) ) a ⊣ 1T 1T 0E shift on ( 0T ( ( 1T 1T 0E 1T 0T 1T ( 1T 0E reduction ε ❀ E ) E 1T 0E 2T 3T shifts on E and ) reduction (E) ❀ T and shift on T T ⊣ 3T 3T shift on a 0T ( T 1T 0T ) a 1E 1E 0T 0E ⊣ 0T 1T 0E ) a 1E 0T 1T 3T 2T 1E ( 1T ⊣ 0T T 0E ) a 1T 1T 1T ⊣ 0E ( 0T ) a 0T ( 0E ) E 0T 0T shift on ( 1T 0E 0E ⊣ 0E ( 1T 1T ) a 0T ( 1T ) 1T 1E ) T 1E 1E 0T ⊣ 1E reduction a ❀ T and shift on T 0T ( ) E ⊣ 1T 1T 0E 27 2T 37 reduction T T ❀ E and shifts on E and ) 3T 0T ⊣ T 1E 1E reduction (E) ❀ T and shift on T 0T E ⊣ reduction T ❀ E and accept without shitting on E Fig. 12. Steps of the pointerless parsing algorithm APL ; the candidates are canceled by the shift moves as explained in Algorithm 4.5. 36 · Parsing methods streamlined stack m-state K1T , as the shift originates from the initial candidate 0T . This candidate will instead be canceled (i.e., it will show striked) when a shift on E is executed (soon after reduction T T ❀ E), as the shift originates from the non-initial candidate 1T . Second, some of such initial candidates may be needed for a subsequent nonterminal shift move. To sum up, we have shown that condition ST P permits to construct a simpler shift-reduce parser, which has a reduced stack alphabet and does not need pointers to manage reductions. The same parser can be further simplified, if we make another hypothesis: that the grammar is not left-recursive. 4.2 ELL (1) condition Our definition of top-down deterministically parsable grammar or network comes next. Definition 4.8. ELL (1) condition.8 A machine net M meets the ELL(1) condition if the following three clauses are satisfied: (1) there are no left-recursive derivations (2) the net meets the ELR(1) condition (3) the net has the single transition property (ST P ) Condition (1) can be easily checked by drawing a graph, denoted by G, that has as nodes the initial states of the net and has an edge 0A −→ 0B if in machine MA there exists an B edge 0A −→ rA , or more generally a path: A A A B 2 1 k . . . −→ qk −→ rA q1 −→ 0A −→ k≥0 where all the nonterminals A1 , A2 , . . ., Ak are nullable. The net is left-recursive if, and only if, graph G contains a circuit. Actually, left recursive derivations cause, in all but one situations, a violation of clause (2) or (3) of Def. 4.8. The only case that would remain undetected is a left-recursive derivation involving the axiom 0S and caused by state-transitions of the form: S 0S −→ 1S or A 1 1S 0S −→ A 2 1 A1 0A1 −→ ... S 0Ak −→ 1Ak k ≥ 1 (10) Three different types of left-recursive derivations are illustrated in Figure 13. The first two cause violations of clause (2) or (3), so that only the third needs to be checked on graph G: the graph contains a self-loop on node 0E . It would not be difficult to formalize the properties illustrated by the examples and to restate clause (1) of Definition 4.8 as follows: the net has no left-recursive derivation of the form (10), i.e., involving the axiom and not using ε-rules. This apparently weaker but indeed equivalent condition is stated by [Beatty 1982], in his definition of (non-extended) LL (1) grammars. 4.2.1 Discussion. To sum up, ELL (1) grammars, as defined here, are ELR (1) grammars that do not allow left-recursive derivations and satisfy the single-transition property (no multiple candidates in m-state bases and hence no convergent transitions). This is 8 The historical acronym “ELL (1)” has been introduced over and over in the past by several authors with slight differences. We hope that reusing again the acronym will not be considered an abuse. · Parsing methods streamlined E→XE + a | a 37 X→ε | b a ME → 0E 4E 1E X 2E b 3E → a + E MX → 0X 1X → ↓ a shift-reduce conflict in m-state I0 caused by a left-recursive derivation that makes use of ε-rules I0 0E ⊣ 0X ab a ⊣ I1 3E S→aA A→Ab | b b a MS → 0S A 1S 2S → MA → 0A 2A → 1A A b a left-recursive derivation through a nonterminal other than the axiom has the effect of creating two candidates in the base of m-state I2 and thus violates clause (2) I2 I1 I0 1S ⊣ a 0S ⊣ 2S A ⊣ 1A 0A ⊣ a E→E + a | a ME → 0E 1E 2E + E a 3E → clauses (1) and (2) are met and the left-recursive derivation 0E ⇒ 0E 1E is entirely contained in m-state I0 I0 0E + ⊣ a E I2 1E + ⊣ 3E + ⊣ I1 a + 2E + ⊣ I3 Fig. 13. Left-recursive nets violating ELL (1) conditions. Top: left-recursion with ε-rules violates clause (2). Middle: left-recursion on A 6= axiom violates clause (3). Bottom: left-recursive axiom E is undetected by clauses (2) and (3). a more precise reformulation of the definitions of “LL (1)” and “ELL (1)” grammars, which have accumulated in half a century. To be fair to the perhaps most popular definition of LL(1) grammar, we contrast it with ours. There are marginal contrived examples where 38 · Parsing methods streamlined a violation of ST P caused by the presence of multiple candidates in the base of a m-state, does not hinder a top-down parser from working deterministically [Beatty 1982]. A typical case is the LR (1) grammar { S → A a | B b, A → C, B → C, C → ε }. One of the m-states has two candidates in the base: hA → C •, ai, hB → C •, bi . The choice between the alternatives of S is determined by the following character, a or b, yet the grammar violates ST P . It easy to see that a necessary condition for such a situation to occur is that the language derived from some nonterminal of the grammar in question consists only of the empty string: ∃ A ∈ V such that LA (G) = { ǫ }. However this case can be usually removed without any penalty, nor a loss of generality, in all grammar applications. In fact, the grammar above can be simplified and the equivalent grammar { S → A | B, A → a, B → b } is obtained, which complies with ST P . 4.3 Stack contraction and predictive parser The last development, to be next presented, transforms the already compacted pilot graph into the Control Flow Graph of a predictive parser. The way the latter parser uses the stack differs from the previous models, the shift-reduce and pointerless parsers. More precisely, now a terminal shift move, which always executes a push operation, is sometimes implemented without a push and sometimes with multiple pushes. The former case happens when the shift remains inside the same machine: the predictive parser does not push an element upon performing a terminal shift, but it updates the top of stack element to record the new state. Multiple pushes happen when the shift determines one or more transfers from the current machine to others; the predictive parser performs a push for each transfer. The essential information to be kept on stack, is the sequence of machines that have been activated and have not reached a final state (where a reduction occurs). At each parsing time, the current or active machine is the one that is doing the analysis, and the current state is kept in the top of stack element. Previous non-terminated activations of the same or other machines are in the suspended state. For each suspended machine MA , a stack entry is needed to store the state qA , from where the machine will resume the computation when control is returned after performing the relevant reductions. The main advantage of predictive parsing is that the construction of the syntax tree can be anticipated: the parser can generate on-line the left derivation of the input. 4.3.1 Parser control-flow graph. Moving from the above considerations, first we slightly transform the compact pilot graph C and make it isomorphic to the original machine net M. The new graph is named parser control-flow graph (P CF G) because it represents the blueprint of parser code. The first step of the transformation splits every m-node of C that contains multiple candidates, into a few nodes that contain only one candidate. Second, the kernel-equivalent nodes are coalesced and the original look-ahead sets are combined into one. The third step creates new edges, named call edges, whenever a machine transfers control to another machine. At last, each call edge is labeled with a set of characters, named guide set, which is a summary of the information needed for the parsing decision to transfer control to another machine. Definition 4.9. Parser Control-Flow Graph. Every node of the P CF G, denoted by F , is identified by a state q of machine net M Parsing methods streamlined · 39 and denoted, without ambiguity, by q. Moreover, every node qA , where qA ∈ FA is final, consists of a pair hqA , πi, where set π, named prospect9 set, is the union of the look-ahead sets πi of every candidate hqA , πi i existing in the compact pilot graph C: [ πi π= ∀ hqA , πi i ∈ C The edges of F are of two types, named shift and call: X (1) There exists in F a shift edge qA → rA with X terminal or non-, if the same edge is in machine MA . γ1 (2) There exists in F a call edge qA 99K 0A1 , where A1 is a nonterminal possibly differA ent from A, if qA →1 rA is in MA , hence necessarily in some m-state K of C there exist candidates hqA , πi and h0A1 , ρi; and the m-state ϑ (K, A1 ) contains candidate hrA , πrA i. The call edge label γ1 ⊆ Σ ∪ { ⊣ }, named guide set,10 is recursively defined as follows: —it holds b ∈ γ1 if, and only if, any conditions below hold:  (11) b ∈ Ini L (0A1 )  A1 is nullable and b ∈ Ini L (rA ) (12) (13) A1 and L (rA ) are both nullable and b ∈ πrA γ2 ∃ in F a call edge 0A1 99K 0A2 and b ∈ γ2 (14) Relations (11), (12), (13) are not recursive and respectively consider that b is generated by MA1 called by MA ; or by MA but starting from state rA ; or that b follows MA . Rel. (14) is recursive and traverses the net as far as the chain of call sites activated. We observe that Rel. (14) determines an inclusion relation γ1 ⊇ γ2 between any two concatenated call γ1 γ2 γ1 edges qA 99K 0A1 99K 0A2 . We also write γ1 = Gui (qA 99K 0A1 ) instead of qA 99K 0A1 . We next extend the definition of guide set to the terminal shift edges and to the dangling a darts that tag the final  nodes. For each terminal shift edge p → q labeled with a ∈ Σ, a we set Gui p → q := { a }. For each dart that tags a final node containing a candidate hfA , πi with fA ∈ FA , we set Gui (fA →) := π. Then in the P CF G all edges (except the nonterminal shifts) can be interpreted as conditional instructions, enabled if the current character cc belongs to the associated guide set: a terminal shift edge labeled with { a } is enabled by a predicate cc = a (or cc ∈ { a } for uniformity); a call edge labeled with γ represents a conditional procedure invocation, where the enabling predicate is cc ∈ γ; a final node dart labeled with π is interpreted as a conditional return-from-procedure instruction to be executed if cc ∈ π. The remaining P CF G edges are nonterminal shifts, which are interpreted as unconditional return-from-procedure instructions. We show that for the same state such predicates never conflict with one another. P ROPERTY 4.10. For every node q of the P CF G of a grammar satisfying the ELL (1) condition, the guide sets of any two edges originating from q are disjoint. 9 Although traditionally the same word “look-ahead” has been used for both shift-reduce and top-down parsers, the set definitions differ and we prefer to differentiate their names. 10 It is the same as a “predictive parsing table element” in [Aho et al. 2006]. 40 · Parsing methods streamlined P ROOF. Since every machine is deterministic, identically labeled shift edges cannot originate from the same node, and it remains to consider the cases of shift-call and call-call edge pairs. γC γB a Consider a shift edge qA → rA with a ∈ Σ, and two call edges qA 99K 0B and qA 99K 0C . First, assume by contradiction a ∈ γB . If a ∈ γB comes from Rel. (11), then in the pilot m-state ϑ (qA , a) there are two base candidates, a condition that is ruled out by ST P . If it comes from Rel. (12), in the m-state with base qA , i.e., m-state K, there is a conflict between the shift of a and the reduction 0B , which owes its look-ahead a to a path from rA in machine MA . If it comes from Rel. (13), in m-state K there is the same shift-reduce conflict as before, though now reduction 0B owes its-look ahead a to some other machine that previously invoked machine MA . Finally, it may come from Rel. (14), which is the recursive case and defers the three cases before to some other machine that is immediately invoked by machine MB : there is either a violation of ST P or a shift-reduce conflict. Second, assume by contradiction a ∈ γB and a ∈ γC . Since a comes from one of four relations, twelve combinations should be examined. But since they are similar to the previous argumentation, we deal only with one, namely case (11)-(11): clearly, m-state ϑ (qA , a) violates ST P . The converse of Property 4.10 also holds, which makes the condition of having disjoint guide sets a characteristic property of ELL (1) grammars. We will see that this condition can be checked easily on the P CF G, with no need to build the ELR (1) pilot automaton. P ROPERTY 4.11. If the guide sets of a P CF G are disjoint, then the net satisfies the ELL (1) condition of Definition 4.8. The proof is in the Appendix. Example 4.12. For the running example, the P CF G is represented in Figure 14 with the same layout as the machine net for comparability. In the P CF G there are new nodes (only node 0T in this example), which derive from the initial candidates (excluding those containing the axiom 0S ) extracted from the closure part of the m-states of C. Having added such nodes, the closure part of the C nodes (except for node I0 ) becomes redundant and has been eliminated from P CF G node contents. As said, prospect sets are needed only in final states; they have the following properties: —For final states that are not initial, the prospect set coincides with the corresponding look-ahead set of the compact pilot C. This is the case of nodes 1E and 3T . —For a final-initial state, such as 0E , the prospect set is the union of the look-ahead sets of every candidate h0E , πi that occurs in C. For instance, h0E , { ), ⊣ }i takes ⊣ from m-state K0E and ) from K1T . Solid edges represent the shift ones, already present in the machine net and pilot graph. Dashed edges represent the call ones, labeled by guide sets, and how to compute them is next illustrated: —the guide set of call edge 0E 99K 0T (and of 1E 99K 0T ) is { a, ) }, since from state 0T both characters can be shifted —the guide set of edge 1T 99K 0E includes the terminals: E ) since 1T → 2T is in MT , language L (0E ) is nullable and ) ∈ Ini (2T ) a, ( since from 0E a call edge goes out to 0T with prospect set { a, ( } · Parsing methods streamlined Compact Pilot Graph Machine Network K1E K0E T ME → 0E 1E ↓ ↓ L→ T T 0E ⊣ 0T a(⊣ ) ⊣ 0T a() ⊣ T ( ( 1E T 1T 1T ( E K1T 3T → 2T ) a a a a MT → 0T 41 a() ⊣ 0E ) 0T a() E 2T a ( ) ⊣ 3T a() ⊣ ) K2T K3T ( Parser Control-Flow Graph 0E ME → ↑  ) ⊣   MT → 0T ( 1T 1E T ↑  ) ⊣ T a(  a() E ) 2T 3T  a() ⊣ a( → a Fig. 14. The Parser Control-Flow Graph F of the running example, from the net and the compact pilot. In accordance with Prop. 4.10, the terminal labels of all the edges that originate from the same node, do not overlap. 4.3.2 Predictive parser. It is straightforward to derive the parser from the P CF G; its nodes are the pushdown stack elements; the top of stack element identifies the state of the active machine, while inner stack elements refer to states of suspended machines, in the correct order of suspension. There are four sorts of moves. A scan move, associated with a terminal shift edge, reads the current character, cc, as the corresponding machine would do. A call move, associated with a call edge, checks the enabling predicate, saves on stack the return state, and switches to the invoked machine without consuming cc. A return move is triggered when the active machine enters a final state whose prospect set includes cc: the active state is set to the return state of the most recently suspended machine. A recognizing move terminates parsing. Algorithm 4.13. Predictive recognizer, A. —The stack elements are the states of P CF G F . At the beginning the stack contains the initial candidate h0S i. —Let hqA i be the top element, meaning that the active machine MA is in state qA . Moves are next specified, this way: 42 · Parsing methods streamlined —scan move cc if the shift edge qA −→ rA exists, then scan the next character and replace the stack top by hrA i (the active machine does not change) —call move γ B if there exists a call edge qA 99K 0B such that cc ∈ γ, let qA → rA be the corresponding nonterminal shift edge; then pop, push element hrA i and push element h0B i —return move if qA is a final state and cc is in the prospect set associated with qA in the P CF G F , then pop —recognition move if MA is the axiom machine, qA is a final state and cc =⊣, then accept and halt —in any other case, reject the string and halt From Prop. 4.10 it follows that for every parsing configuration at most one move is possible, i.e., the algorithm is deterministic. 4.3.3 Computing left derivations. To construct the syntax tree, the algorithm is next extended with an output function, thus turning the DP DA into a pushdown transducer that computes the left derivation of the input string, using the right-linearized grammar Ĝ. The output actions are specified in Table I and are so straightforward that we do not need to prove their correctness. Moreover, we recall that the syntax tree for grammar Ĝ is essentially an encoding of the syntax tree for the original EBN F grammar G, such that each node has at most two child nodes. Table I. Derivation steps computed by predictive parser. Current character is cc = b. Parser move Output derivation step b Scan move for transition qA −→ rA qA =⇒ b rA Ĝ γ 0B Call move for call edge qA 99K 0B and transition qA → rA qA =⇒ 0B rA Return move for state qA ∈ FA qA =⇒ ε Ĝ Ĝ Example 4.14. Running example: trace of predictive parser for input x = ( a ). Parsing methods streamlined stack x h0E i · predicate left derivation (a) ⊣ (∈ γ = { a ( } 0E ⇒ 0T 1E h1E i h0T i (a) ⊣ scan 0E ⇒ ( 1T 1E h1E i h1T i a) ⊣ a ∈ γ = {a(} 0E ⇒ ( 0E 2T 1E h1E i h2T ih0E i a) ⊣ a ∈ γ = {a(} 0E ⇒ ( 0T 1E 2T 1E h1E i h2T ih1E ih0T i a) ⊣ scan h1E i h2T ih1E ih3T i ) ⊣ ) ∈ π = {a() ⊣} h1E i h2T ih1E i ) ⊣ ) ∈ π = {) ⊣} 0E ⇒ ( a ε 2T 1E h1E i h2T i ) ⊣ scan 0E ⇒ ( a ) 3T 1E h1E i h3T i ⊣ ⊣∈ π = {a() ⊣} h1E i ⊣ ⊣ ∈ π = { ) ⊣ } accept 43 + + + + 0E ⇒ ( a 3T 1E 2T 1E + 0E ⇒ ( a ε 1E 2T 1E + + + 0E ⇒ ( a ) ε 1E + 0E ⇒ ( a ) ε For the original grammar, the corresponding derivation is: E ⇒ T ⇒ (E ) ⇒ (T ) ⇒ (a) 4.3.4 Parser implementation by recursive procedures. Predictive parsers are often implemented using recursive procedures. Each machine is transformed into a parameter-less so-called syntactic procedure, having a CF G matching the corresponding P CF G subgraph, so that the current state of a machine is encoded at runtime by the program counter. Parsing starts in the axiom procedure and successfully terminates when the input has been exhausted, unless an error has occurred before. The standard runtime mechanism of procedure invocation and return automatically implements the call and return moves. An example should suffice to show that the procedure pseudo-code is mechanically obtained from the P CF G. Example 4.15. Recursive descent parser. For the P CF G of Figure 14, the syntactic procedures are shown in Figure 15. The pseudo-code can be optimized in several ways. 4.4 Direct construction of parser control-flow graph We have presented and justified a series of rigorous steps that lead from an ELR (1) pilot to the compact pointer-less parser, and finally, to the parser control-flow graph. However, for a human wishing to design a predictive parser it would be tedious to perform all those steps. We therefore provide a simpler procedure for checking that an EBN F grammar satisfies the ELL (1) condition. The procedure operates directly on the grammar Parser Control Flow Graph and does not require the construction of the ELR (1) pilot. It uses a set of recursive equations defining the prospect and guide sets for all the states and edges of the P CF G; the equations are interpreted as instructions to compute iteratively the guide sets, after which the ELL (1) check simply verifies, according to Property 4.11, that the guide sets are disjoint. 4.4.1 Equations defining the prospect sets 44 · Parsing methods streamlined Recursive Descent Parser Machine Network procedure T - - state 0T if cc ∈ { a } then cc = next else if cc ∈ { ( } then cc = next - - state 1T if cc ∈ { a ( ) } then call E else error end if - - state 2T if cc ∈ { ) } then cc = next else error end if else error end if - - state 3T if cc ∈ { a ( ) ⊣ } then return else error end if end procedure T ME → 0E 1E ↓ ↓ T a MT → 0T 1T 3T → 2T E ( ) Recursive Descent Parser program ELL P ARSER cc = next call E if cc ∈ { ⊣ } then accept else reject end if end program procedure E - - optimized while cc ∈ { a ( } do call T end while if cc ∈ { ) ⊣ } then return else error end if end procedure Fig. 15. Main program and syntactic procedures of a recursive descent parser (Ex. 4.15 and Fig. 14); function next is the programming interface to the lexical analyzer or scanner; function error is the messaging interface. X (1) If the net includes shift edges of the kind pi →i q then the prospect set πq of state q is: [ πpi πq := X i pi →q A (2) If the net includes nonterminal shift edge qi → ri and the corresponding call edge in the PCFG is qi 99K 0A , then the prospect set for the initial state 0A of machine MA is:  [    Ini L (ri ) ∪ if N ullable L (ri ) then πqi else ∅ π0A := π0A ∪ A qi →ri Notice that the two sets of rules apply in an exclusive way to disjoints sets of nodes, because the normalization of the machines disallows re-entrance into initial states. 4.4.2 Equations defining the guide sets A (1) For each call edge qA 99K 0A1 associated with a nonterminal shift edge qA →1 rA , · Parsing methods streamlined 45 such that possibly other call edges 0A1 99K 0Bi depart from state 0A1 , the guide set Gui (qA 99K 0A1 ) of the call edge is defined as follows, see also conditions (11-14):    Ini L (A1        if N ullable (A1) then Ini L (rA ) else ∅ [  Gui (qA 99K 0A1 ) :=  if N ullable (A1) ∧ N ullable L (rA ) then πrA else ∅    S    Gui (0A1 99K 0Bi )  0A1 99K0Bi (2) For a final state fA ∈ FA , the guide set of the tagging dart equals the prospect set: Gui (fA →) := πfA a (3) For a terminal shift edge qA → rA with a ∈ Σ, the guide set is simply the shifted terminal:   a Gui qA → rA := { a } A computation starts by assigning to the prospect set of 0S (initial state of axiom machine) the end-marker: π0S := { ⊣ }. All other sets are initialized to empty. Then the above rules are repeatedly applied until a fixpoint is reached. Notice that the rules for computing the prospect sets are consistent with the definition of look-ahead set given in Section 2.2; furthermore, the rules for computing the guide sets are consistent with the definition of Parser Control Flow Graph provided in Section 4.9. Example 4.16. Running example: computing the prospect and guide sets. The following table shows the computation of most prospect and guide sets for the P CF G of Figure 14 (p. 41). The computation is completed at the third step. Prospect sets of Guide sets of 0E 1E 0T 1T 2T 3T ⊣ ∅ ∅ ∅ ∅ ∅ 0E 99K 0T 1E 99K 0T 1T 99K 0E ∅ ∅ ∅ ) ⊣ ) ⊣ a() ⊣ a() ⊣ a() ⊣ a() ⊣ a( a( a() ) ⊣ ) ⊣ a() ⊣ a() ⊣ a() ⊣ a() ⊣ a( a( a() Example 4.17. Guide sets in a non-ELL(1) grammar. The grammar { S → a∗ N, N → a N b | ε } of example 4.1 (p.28) violates the single transition property, as shown in Figure 10, hence it is not ELL (1). This can be verified also by computing the guide sets on the P CF G. We have Gui(0S 99K 0N ) ∩  a a 6 ∅: the Gui 0S → 1S = { a } 6= ∅ and Gui (1S 99K 0N ) ∩ Gui 1S → 1S = { a } = guide sets on the edges departing from states 0S and 1S are not disjoint. 5. TABULAR PARSING The LR and LL parsing methods are inadequate for dealing with nondeterministic and ambiguous grammars. The seminal work [Earley 1970] introduced a cubic-time algorithm 46 · Parsing methods streamlined for recognizing strings of any context-free grammar, even of an ambiguous one, though it did not explicitly present a parsing method, i.e., a means for constructing the (potentially numerous) parsing trees of the accepted string. Later, efficient representations of parse forests have been invented, which do not duplicate the common subtrees and thus achieve a polynomial-time complexity for the tree construction algorithm. Until recently [Aycock and Borsotti 2009], Earley parsers performed a complete recognition of the input before constructing any syntax tree [Grune and Jacobs 2009]. Concerning the possibility of directly using extended BN F grammars, Earley himself already gave some hints and later a few parser generators have been implemented, but no authoritative work exists, to the best of our knowledge. Another long-standing discussion concerns the pros and cons of using look-ahead. Since this issue is out of scope here, and a few experimental studies (see [Aycock and Horspool 2002]) have indicated that look-ahead-less algorithms can be faster at least for programming languages, we present the simpler version that does not use look-ahead. This is in line with the classical theoretical presentations of the Earley parsers for BN F grammars, such as the one in [Révész 1991]. Actually, our focus in the present work is on programming languages that are nonambiguous formal notations (unlike natural languages). Therefore our variant of the Earley algorithm is well suited for non-ambiguous EBN F grammars, though possibly nondeterministic, and the related procedure for building parse trees does not deal with multiple trees or forests. 5.1 String recognition Our algorithm is straightforward to understand, if one comes from the Vector Stack implementation of the ELR (1) parser of Section 3.4. When analyzing a string x = x1 . . . xn (with | x | = n ≥ 1) or x = ε (with | x | = n = 0), the algorithm uses a vector E [0 . . . n] or E [0], respectively, of n + 1 ≥ 1 elements, called Earley vector. Every vector element E [i] contains a set of pairs h pX , j i that consist of a state pX of the machine MX for some nonterminal X, and of an integer index j (with 0 ≤ j ≤ i ≤ n) that points back to the element E [j] that contains a corresponding pair with the initial state 0X of the same machine MX . This index marks the position in the input string, from where the currently assumed derivation from nonterminal X may have started. Before introducing our variant of the Earley Algorithm for EBN F grammars, we preliminarily define the operations Completion and TerminalShift. Completion (E, i) - - with index 0 ≤ i ≤ n do - - loop that computes the closure operation - - for each pair that launches machine MX   X for each pair h p, j i ∈ E [i] and X, q ∈ V, Q s.t. p → q do add pair h 0X , i i to element E [i] end for - - nested loops that compute the nonterminal shift operation - - for each final pair that enables a shift on nonterminal X Parsing methods streamlined · 47  for each pair h f, j i ∈ E [i] and X ∈ V such that f ∈ FX do - - for each pair that shifts on nonterminal X   X for each pair h p, l i ∈ E [j] and q ∈ Q s.t. p → q do add pair h q, l i to element E [i] end for end for while some pair has been added  Notice that in the Completion operation the nullable nonterminals are dealt with by a combination of closure and nonterminal shift operations. TerminalShift (E, i) - - with index 1 ≤ i ≤ n - - loop that computes the terminal shift operation - - for each preceding pair that shifts on terminal xi   x for each pair h p, j i ∈ E [i − 1] and q ∈ Q s.t. p →i q do add pair h q, j i to element E [i] end for The algorithm below for Earley syntactic analysis uses Completion and T erminalShif t. Algorithm 5.1. Earley syntactic analysis. - - analyze the terminal string x for possible acceptance - - define the Earley vector E [0 . . . n] with |x| = n ≥ 0 E [0] := { h 0S , 0 i } - - initialize the first elem. E [0] for i := 1 to n do - - initialize all elem.s E [1 . . . n] E [i] := ∅ end for Completion (E, 0) - - complete the first elem. E [0] i := 1 - - while the vector is not finished and the previous elem. is not empty  while i ≤ n ∧ E [i − 1] 6= ∅ do TerminalShift (E, i) - - put into the current elem. E [i] Completion (E, i) - - complete the current elem. E [i] i++ end while Example 5.2. Non-deterministic EBN F grammar with nullable nonterminal. 48 · Parsing methods streamlined The Earley acceptance condition if the following: h f, 0 i ∈ E [n] with f ∈ FS . A string x belongs to language L (G) if and only of the Earley acceptance condition is true. Figure 16 lists a non-ambiguous, non-deterministic EBN F grammar and shows the corresponding machine net. The string a a b b a a is analyzed: its syntax tree and analysis trace are in Figures 17 and 18, respectively; the edges in the latter figure ought to be ignored as they are related with the syntax tree construction discussed later. Machine Network Extended Grammar (EBNF) a A b S→ a+ ( b B a) ∗ | MS A+ ← 5S ↓ A a 0S b 1S 2S 3S B ↓ a 4S → b a MA → 0A A→aAb | ab 1A 3A → 2A A b c B→ bBa | c | ε MB → 0B 1B ↓ Fig. 16. 2B B b 3B → a Non-deterministic EBN F grammar G and network of Example 5.2. S a a b B b B a a ε Fig. 17. Syntax tree for the string a a b b a a of Example 5.2. The following lemma correlates the presence of certain pairs in the Earley vector elements, with the existence of a leftmost derivation for the string prefix analyzed up to that · Parsing methods streamlined 49 1B 3 2S 0 1S 0 1S 0 0B 0B 3 2B 3 3A 1 3A 0 3S 0 4S 0 1A 4 1A 5 0A 5 0A 6 0S 0 1A 0 1A 1 3S 0 5S 0A 0 0A 1 0A 2 2A 0 0A 4 E0 a E1 Fig. 18. a E2 b 4 E3 b E4 3B a E5 3 a 0 E6 Tabular parsing trace of string a a b b a a with the machine net in Figure 16. point and, together with the associated corollary, provides a proof of the correctness of the algorithm. L EMMA 5.3. If it holds h qA , j i ∈ E [i], which implies inequality j ≤ i, with qA ∈ QA , i.e., state qA belongs to the machine MA of nonterminal A, then it holds h 0A , j i ∈ ∗ E [j] and the right-linearized grammar Ĝ admits a leftmost derivation 0A ⇒ xj+1 . . . xi qA ∗ if j < i or 0A ⇒ qA if j = i. The proof is in the Appendix. C OROLLARY 5.4. If the Earley acceptance condition is satisfied, i.e., if h fS , 0 i ∈ + E [n] with fS ∈ FS , then the EBNF grammar G admits a derivation S ⇒ x, i.e., x ∈ L (S), and string x belongs to language L (G). The following lemma, which is the converse of Lemma 5.3, states the completeness of the Earley Algorithm. L EMMA 5.5. Take an EBNF grammar G and a string x = x1 . . . xn of length n that belongs to language L (G). In the right-linearized grammar Ĝ, consider any leftmost derivation d of a prefix x1 . . . xi (i ≤ n) of x, that is: + d : 0S ⇒ x1 . . . xi qA W with qA ∈ QA and W ∈ Q∗A . The two points below apply: (1) if it holds W 6= ε, i.e., W = rB Z for some rB ∈ QB , then it holds ∃ j 0 ≤ j ≤ i and A ∃ pB ∈ QB such that the machine net has an arc pB → rB and grammar Ĝ admits 50 · Parsing methods streamlined + + two leftmost derivations d1 : 0S ⇒ x1 . . . xj pB Z and d2 : 0A ⇒ xj+1 . . . xi qA , so that derivation d decomposes as follows: d pB →0A rB d2 = d : 0S ⇒1 x1 . . . xj pB Z =⇒ ⇒ x1 . . . xj xj+1 . . . xi qA rB Z x1 . . . xj 0A rB Z x1 . . . xi qA W A as an arc pB → rB in the net maps to a rule pB → 0A rB in grammar Ĝ (2) this point is split into two steps, the second being the crucial one: (a) if it holds W = ε, then it holds A = S, i.e., nonterminal A is the axiom, qA ∈ QS and h qA , 0 i ∈ E [i] (b) if it also holds x1 . . . xi ∈ L (G), i.e., the prefix also belongs to language L (G), then it holds qA = fS ∈ FS , i.e., state qA = fS is final for the axiomatic machine MS , and the prefix is accepted by the Earley algorithm Limit cases: if it holds i = 0 then it holds x1 . . . xi = ε; if it holds j = i then it holds xj+1 . . . xi = ε; and if it holds x = ε (so n = 0) then both cases hold, i.e., j = i = 0. If the prefix coincides with the whole string x, i.e., i = n, then step (2b) implies that string x, which by hypothesis belongs to language L (G), is accepted by the Earley algorithm, which therefore is complete. The proof is in the Appendix. 5.2 Syntax tree construction The next procedure BuildTree (BT) builds the parse tree of a recognized string through processing the vector E constructed by the Earley algorithm. Function BT is recursive and has four formal parameters: nonterminal X ∈ V , state f , and two nonnegative indices j and i. Nonterminal X is the root of the (sub)tree to be built. State f is final for machine MX ; it is the end of the computation path in MX that corresponds to analyzing the substring generated by X. Indices j and i satisfy the inequality 0 ≤ j ≤ i ≤ n; they respectively specify the left and right ends of the substring generated by X: + X =⇒ xj+1 . . . xi G + + X =⇒ ε if j = i if j < i G + Grammar G admits derivation S ⇒ x1 . . . xn or S ⇒ ε, and the Earley algorithm accepts string x. Thus, element E [n] contains the final axiomatic pair h f, 0 i. To build the tree of string x with root node S, function BT is called with parameters BT ( S, f, 0, n ); then the function will recursively build all the subtrees and will assemble them in the final tree. Function BT returns the syntax tree in the form of a parenthesized string, with brackets labeled by the root nonterminal of each (sub)tree. The commented code follows. BuildTree ( X, f, j, i ) - - X is a nonterminal, f is a final state of MX and 0 ≤ j ≤ i ≤ n - - return as parenthesized string the syntax tree rooted at node X - - node X will have a list C of terminal and nonterminal child nodes - - either list C will remain empty or it will be filled from right to left C := ε - - set to ε the list C of child nodes of X Parsing methods streamlined q := f - - set to f the state q in machine MX k := i - - set to i the index k of vector E · 51 - - walk back the sequence of term. & nonterm. shift oper.s in MX while ( q 6= 0X ) do - - while current state q is not initial x (a) - - try to backwards recover a terminal shift move p →k q, i.e., - - check if node X has terminal xk as its current child leaf ! ∃ h = k − 1 ∃ p ∈ QX such that if then x h p, j i ∈ E [h] ∧ net has p →k q C := xk · C - - concatenate leaf xk to list C end if Y (b) - - try to backwards recover a nonterm. shift oper. p → q, i.e., - - check if node X has nonterm. Y as its current child node ! ∃ Y ∈ V ∃ e ∈ FY ∃ h j ≤ h ≤ k ≤ i ∃ p ∈ QX s.t. if then Y h e, h i ∈ E [k] ∧ h p, j i ∈ E [h] ∧ net has p → q - - recursively build the subtree of the derivation: + + - - Y ⇒ xh+1 . . . xk if h < k or Y ⇒ ε if h = k G G - - and concatenate to list C the subtree of node Y C := BuildTree ( Y, e, h, k ) · C end if q := p - - shift the current state q back to p k := h - - drag the current index k back to h end while return ( C )X - - return the tree rooted at node X Figure 18 reports the analysis trace of Example 5.2 and also shows solid edges that correspond to iterations of the while loop in the procedure, and dashed edges that match the recursive calls. Notice that calling function BT with equal indices i and j, means building a subtree of the empty string, which may be made of one or more nullable nonterminals. This happens in the Figure 19, witch shows the tree of the BT calls and of the returned subtrees for Example 5.2, with the call BT (B, 0B , 4, 4 ). Notice that since a leftmost derivation uniquely identifies a syntax tree, the conditions in the two mutually exclusive if-then conditionals inside the while loop, are always satisfied in only one way: otherwise the analyzed string would admit several distinct left derivations and therefore it would be ambiguous. As previously remarked, nullable terms are dealt with by the Earley algorithm through a chain of Closure and Nonterminal Shift operations. An optimized version of the algorithm can be defined to perform the analysis of nullable terminals in a single step, along the same 52 · Parsing methods streamlined = a1 a2  BT ( S, 4S , 0, 6 )   a a b b ( ε )B a B a S BT ( B, 3B , 3, 5 )  = b ( ε )B a B b3 b4 BT ( B, 0B , 4, 4 ) a6 a5 = ( ε )B ε Fig. 19. Calls and return values of BuildTree for Example 5.2. lines as defined by [Aycock and Horspool 2002]; further work by the same authors also defines optimized procedures for building the parse tree in the presence of nullable nonterminals, which can also be adjusted and applied to our version of the Earley algorithm. 6. CONCLUSION We hope that this extension and conceptual compaction of classical parser construction methods, will be appreciated by compiler and language designers as well as by instructors. Starting from syntax diagrams, which are the most readable representation of grammars in language reference manuals, our method directly constructs deterministic shift-reduce parsers, which are more general and accurate than all preceding proposals. Then we have extended to the EBN F case Beatty’s old theoretical comparisons of LL (1) versus LR (1) grammars, and exploited it to derive general deterministic top-down parsers through stepwise simplifications of shift-reduce parsers. We have evidenced that such simplifications are correct if multiple-transitions and left-recursive derivations are excluded. For completeness, to address the needs of non-deterministic EBN F grammars, we have included an accurate presentation of the tabular Earley parsers, including syntax tree generatio. Our goal of coming up with a minimalist comprehensive presentation of parsing methods for Extended BN F grammars, has thus been attained. To finish we mention a practical development. There are circumstances that suggest or impose to use separate parsers, for different language parts identified by a grammar partition, i.e., by the sublanguages generated by certain subgrammars. The idea of grammar partition dates back to [Korenjak 1969], who wanted to reduce the size of an LR (1) pilot by decomposing the original parser into a family of subgrammar parsers, and to thus reduce the number of candidates and macro-states. Parser size reduction remains a goal of parser partitioning in the domain of natural language processing, e.g., see [Meng et al. 2002]. In such projects the component parsers are all homogeneous, whereas we are more interested in heterogeneous partitions, which use different parsing algorithms. Why should one want to diversify the algorithms used for different language parts? First, a language may contain Parsing methods streamlined · 53 parts that are harder to parse than others; thus a simpler ELL (1) parser should be used whenever possible, limiting the use of an ELR (1) parser - or even of an Earley one to the sublanguages that warrant a more powerful method. Second, there are well-known examples of language embedding, such as SQL inside C, where the two languages may be biased towards different parsing methods. Although heterogeneous parsers can be built on top of legacy parsing programs, past experimentation of mixed-mode parsers (e.g., [Crespi-Reghizzi and Psaila 1998]) has met with practical rather than conceptual difficulties, caused by the need to interface different parser systems. Our unifying approach looks promising for building seamless heterogeneous parsers that switch from an algorithm to another as they proceed. This is due to the homogeneous representation of the parsing stacks and tables, and to the exact formulation of the conditions that enable to switch from a more to a less general algorithm. Within the current approach, mixed mode parsing should have little or no implementation overhead, and can be viewed as a pragmatic technique for achieving greater parsing power without committing to a more general but less efficient non-deterministic algorithm, such as the so-called generalized LR parsers initiated by [Tomita 1986]. Aknowledgement. We are grateful to the students of Formal Languages and Compiler courses at Politecnico di Milano, who bravely accepted to study this theory while in progress. We also thank Giorgio Satta for helpful discussions of Earley algorithms. REFERENCES A HO , A., L AM , M., S ETHI , R., AND U LLMAN , J. 2006. Compilers: principles, techniques and tools. PrenticeHall, Englewoof Cliffs, NJ. AYCOCK , J. AND B ORSOTTI , A. 2009. Early action in an Earley parser. Acta Informatica 46, 8, 549–559. AYCOCK , J. AND H ORSPOOL , R. 2002. Practical Earley parsing. Comput. J. 45, 6, 620–630. B EATTY, J. C. 1982. On the relationship between the LL(1) and LR(1) grammars. Journal of the ACM 29, 4, 1007–1022. C ELENTANO , A. 1981. LR parsing technique for extended context-free grammars. Computer Languages 6, 2, 95–107. C HAPMAN , N. P. 1984. LALR (1, 1) parser generation for regular right part grammars. Acta Inf 21, 29–45. C RESPI R EGHIZZI , S. 2009. Formal languages and compilation. Springer, London. C RESPI -R EGHIZZI , S. AND P SAILA , G. 1998. Grammar partitioning and modular deterministic parsing. Computer Languages 24, 4, 197–227. E ARLEY, J. 1970. An efficient context-free parsing algorithm. Commun. ACM 13, 94–102. G ÁLVEZ , J. F. 1994. A note on a proposed LALR parser for extended context-free grammars. Inf. Process. Lett. 50, 6, 303–305. G RUNE , D. AND JACOBS , C. 2004. Parsing techniques: a practical guide. Vrije Universiteit, Amsterdam. G RUNE , D. AND JACOBS , C. 2009. Parsing techniques: a practical guide, 2nd ed. Springer, London. H EILBRUNNER , S. 1979. On the definition of ELR(k) and ELL(k) grammars. Acta Informatica 11, 169–176. H EMERIK , K. 2009. Towards a taxonomy for ECFG and RRPG parsing. In Language and Automata Theory and Applications, A. H. Dediu, A.-M. Ionescu, and C. Martı́n-Vide, Eds. LNCS, vol. 5457. Springer, 410–421. K ANNAPINN , S. 2001. Reconstructing LR theory to eliminate redundance, with an application to the construction of ELR parsers (in German). Ph.D. thesis, Technical University of Berlin. K NUTH , D. 1965. On the translation of languages from left to right. Information and Control 8, 607–639. K NUTH , D. E. 1971. Top-down syntax analysis. Acta Informatica 1, 79–110. K ORENJAK , A. J. 1969. A practical method for constructing LR(k) processors. Commun. ACM 12, 11, 613–623. L A L ONDE , W. R. 1979. Constructing LR parsers for regular right part grammars. Acta Informatica 11, 177–193. L EE , G.-O. AND K IM , D.-H. 1997. Characterization of extended LR(k) grammars. Inf. Process. Lett. 64, 2, 75–82. 54 · Parsing methods streamlined L EWI , J., D E V LAMINCK , K., H UENS , J., AND H UYBRECHTS , M. 1979. A programming methodology in compiler construction. North-Holland, Amsterdam. I and II. L OMET, D. B. 1973. A formalization of transition diagram systems. J. ACM 20, 2, 235–257. M ENG , H., L UK , P.-C., X U , K., AND W ENG , F. 2002. GLR parsing with multiple grammars for natural language queries. ACM Trans. on Asian Language Information Processing 1, 2 (June), 123–144. M ORIMOTO , S. AND S ASSA , M. 2001. Yet another generation of LALR parsers for regular right part grammars. Acta Informatica 37, 671–697. R ÉV ÉSZ , G. 1991. Introduction to formal languages. Dover, New York. ROSENKRANTZ , D. J. AND S TEARNS , R. E. 1970. Properties of deterministic top-down parsing. Information and Control 17, 3 (Oct.), 226–256. S ASSA , M. AND N AKATA , I. 1987. A simple realization of LR-parsers for regular right part grammars. Inf. Process. Lett. 24, 2, 113–120. T OMITA , M. 1986. Efficient parsing for natural language: a fast algorithm for practical systems. Kluwer, Boston. W IRTH , N. 1975. Algorithms + Data Structures = Programs. Prentice-Hall publishers, Englewood Cliffs, NJ. Parsing methods streamlined · 55 7. APPENDIX Proof of theorem 3.6 Let G be an EBN F grammar represented by machine net M and let Ĝ be the equivalent right-linearized grammar. Then net M meets the ELR (1) condition if, and only if, grammar Ĝ meets the LR (1) condition. P ROOF. Let Q be the set of the states of M. Clearly, for any non-empty rule X → Y Z of Ĝ, it holds X ∈ Q, Y ∈ Σ ∪ { 0A | 0A ∈ Q } and Z ∈ Q \ { 0A | 0A ∈ Q }. Let P and P̂ be the ELR and LR pilots of G and Ĝ, respectively. Preliminarily we study the correspondence between their transition functions, ϑ and ϑ̂, and their m-states, ˆ It helps us compare the pilot graphs for the running example in Figures denoted by I and I. 2 and 20, and for Example 3.5 in Figure 21. Notice that in the m-states of the LR pilot P̂, the candidates are denoted by marked rules (with a •). We observe that since grammar Ĝ is BN F , the graph of P̂ has the well-known property that all the edges entering the same m-state, have identical labels. In contrast, the identicallabel property (which is a form of locality) does not hold for P and therefore a m-state of P is possibly split into several m-states of P̂. Due to the very special right-linearized grammar form, the following mutually exclusive classification of the m-states of P̂, is exhaustive: —the m-state Iˆ0 is initial —a m-state Iˆ is intermediate if every candidate in Iˆ|base has the form pA → Y • qA —a m-state Iˆ is a sink reduction if every candidate has the form pA → Y qA • For instance, in Figure 20 the intermediate m-states are numbered from 1 to 12 and the sink reduction m-states from 13 to 24. We say that a candidate hqX , λi of P corresponds to a candidate of P̂ of the form hpX → s • qX , ρi, if the look-ahead sets are identical, i.e., if λ = ρ. Then two mstates I and Iˆ of P and P̂, respectively, are called correspondent if the candidates in I|base and in Iˆ|base correspond to each other. Moreover, we arbitrarily define as correspondent the initial m-states I0 and Iˆ0 . To illustrate, in the running example a few pairs of correspondent m-states are: (Iˆ1 , I1 ), (Iˆ9 , I1 ), (Iˆ4 , I4 ) and (Iˆ10 , I4 ). The following straightforward properties of correspondent m-states will be needed. L EMMA 7.1. The mapping defined by the correspondence relation from the set containing m-state Iˆ0 and the intermediate m-states of P̂, to the set of the m-states of P, is total, many-to-one and onto (surjective). (1) For any terminal or nonterminal symbol s and for any correspondent m-states I and ˆ transition ϑ (I, s) = I ′ is defined ⇐⇒ transition ϑ (I, ˆ s) = Iˆ′ is defined and I, ′ ˆ′ ′ ˆ m-state I is intermediate. moreover I , I are correspondent. (2) Let state fA be final non-initial. Candidate hfA , λi is in m-state I (actually in its base I|base ) ⇐⇒ a correspondent m-state Iˆ contains candidates hpA → s • fA , λi and hfA → ε •, λi. (3) Let state 0A be final initial with A 6= S. Candidate h0A , πi is in m-state I ⇐⇒ a correspondent m-state Iˆ contains candidate h0A → ε •, πi. (4) Let state 0S be final. Candidate h0S , πi is in m-state I0 ⇐⇒ candidate h0S → ε •, πi is in m-state Iˆ0 . · 56 Parsing methods streamlined 1T → 0E 2T • a ( ⊣ Iˆ20 Iˆ8 2T → ) 3T • a ( ⊣ Iˆ24 2T ր 3T ր ) 1T → 0E • 2T a ( ⊣ 2T → • ) 3T 2T → ) • 3T a(⊣ a(⊣ 3T → • ε = ε • a ( ⊣ Iˆ1 Iˆ0 a 0E → 0T • 1E 0E → • 0T 1E 0E P̂ → 0E → • ε = ε • 0T → • a 3T 0T → • ( 1T Iˆ12 ⊣ 1E → • 0T 1E 0T 1E → • ε = ε • a(⊣ 0T → • a 3T 0T → a 3T • a ( ⊣ Iˆ14 ⊣ 3T ր a ⊣ 0T → a • 3T a(⊣ 3T → • ε = ε • a ( ⊣ Iˆ2 a(⊣ 0T → • ( 1T ց 1E 0E → 0T 1E • ⊣ Iˆ13 0T a 1E → 0T • 1E 1E → • 0T 1E ( ( Iˆ9 1E → • ε = ε • ⊣ ⊣ 1E 0T → • a 3T a ( ⊣ −→ 0T → • ( 1T 1E → 0T 1E • ⊣ Iˆ21 0T ( Iˆ4 Iˆ3 0T → ( • 1T a(⊣ 1T → • 0E 2T a(⊣ 0E → • 0T 1E 0E → • ε = ε • 0T → • a 3T 0T → • ( 1T a 0E → 0T • 1E 0T ) 1E → • 0T 1E 1E → • ε = ε • 0T → • a 3T a() 0T → a 3T • a ( ) Iˆ17 ) 3T ր a ) 0T → a • 3T a() 3T → • ε = ε • a ( ) Iˆ5 a() 0T → • ( 1T ց 1E ւ 1T 0E → 0T 1E • ) Iˆ16 Iˆ15 0T → ( 1T • a ( ⊣ 0T a 0T 1E → 0T • 1E 1E → • 0T 1E ( ( 1E → • ε = ε • 0T → • a 3T 0T → • ( 1T ) ) a() 0T ւ 1E ( Iˆ10 1E → 0T 1E • ) Iˆ22 a Iˆ6 0T → ( • 1T a() 1T → • 0E 2T a() 0E → • 0T 1E 0E → • ε = ε • 0T → • a 3T 0T → • ( 1T 1T → 0E • 2T a ( ) ) 0E 2T → • ) 3T Iˆ7 a() ( a() 2T → ) • 3T ) a() 3T → • ε = ε • a ( ) 2T ց 1T → 0E 2T • a ( ) Iˆ19 Iˆ11 3T ց 2T → ) 3T • a ( ) Iˆ23 ւ 1T Iˆ18 0T → ( 1T • a ( ) Fig. 20. Pilot graph of the right-linearized grammar Ĝ of the running example (see Ex. 2.4, p.8). Parsing methods streamlined · 57 ˆ and for any initial state 0A , it holds (5) For any pair of correspondent m-states I and I, 0A ∈ I|closure ⇐⇒ 0A → • α ∈ Iˆ|closure for every alternative α of 0A . P ROOF. (of Lemma). First, to prove that the mapping is onto, assume by contradiction that a m-state I such that hqA , λi ∈ I, has no correspondent intermediate m-state in P̂. Clearly, there exists a Iˆ such that the kernels of Iˆ|base and I|base are identical because the right-linearized grammar has the same derivations as M (vs Sect. 2.1), and it remains that the look-aheads of a correspondent candidate in Iˆ|base and I|base differ. The definition of look-ahead set for a BN F grammar (not included) is the traditional one; it is easy to check that our Def. 2.7 of closure function computes exactly the same sets, a contradiction. Item 1. We observe that the bases of I and Iˆ are identical, therefore any candidate ˆ with h0B → • s qB , πi computed h0B , πi computed by Def. 2.7, matches a candidate in I, ˆ s) is by the traditional closure function for P̂. Therefore if ϑ (I, s) is defined, also ϑ (I, defined and yields an intermediate m-state. Moreover the next m-states are clearly correˆ s) is a sink reduction spondent since their bases are identical. On the other hand, if ϑ̂ (I, m-state then ϑ (I, s) is undefined. s Item 2. Consider an edge pA → fA entering state fA . By item 1, consider J and Jˆ as correspondent m-states that include the predecessor state pA , resp. within the candidate ˆ s) includes hpA , λi and hqA → t • pA , λi. Then ϑ (J, s) includes hfA , λi and ϑ̂ (J, ˆ hpA → s • fA , λi, hence also ϑ̂ (J , s)|closure includes hfA → ε •, λi. Item 3. If candidate h0A , πi is in I, it is in I|closure . Thus I|base contains a candidate hpB , λi such that closure (hpB , λi) ∋ h0A , πi. Therefore, some intermediate m-state contains a candidate hqB → s • pB , λi in the base and candidate h0A → ε •, πi in its closure. The converse reasoning is analogous. Item 4. This case is obvious. Item 5. We consider the case where the m-state I is not initial and the state 0A ∈ I|closure results from the closure operation applied to a candidate of I|base (the other cases, where I is the initial m-state I0 or the state 0A results from the closure operation applied to a candidate of I|closure , can be similarly dealt with): 0A ∈ I|closure ⇐⇒ some machine A MB includes the edge pB → qB ⇐⇒ pB ∈ I|base ⇐⇒ for every correspondent state Iˆ there are some suitable X and rB such that rB → X • pB ∈ Iˆ|base ⇐⇒ pB → • 0A qB ∈ Iˆ|closure ⇐⇒ 0A → • α ∈ Iˆ|closure for every alternative α of nonterminal 0A . This concludes the proof of the Lemma. Part “if” (of Theorem). We argue that a violation of the ELR (1) condition in P implies an LR (1) conflict in P̂. Three cases need to be examined. Shift - Reduce conflict. Consider a conflict in m-state: I ∋ hfB , { a }i where fB is final non-initial and ϑ (I, a) is defined ˆ a) By Lemma 7.1, items (1) and (2), there exists a correspondent m-state Iˆ such that ϑ (I, ˆ thus proving that the same conflict is in P̂. is defined and hfB → ε •, { a }i ∈ I, Similarly, consider a conflict in m-state: I ∋ h0B , { a }i where 0B is final and initial and ϑ (I, a) is defined 58 · Parsing methods streamlined ˆ a) By Lemma 7.1, items (1) and (3), there exists a correspondent m-state Iˆ such that ϑ (I, ˆ thus proving that the same conflict is in P̂. is defined and h0B → ε •, { a }i ∈ I, Reduce - Reduce conflict. Consider a conflict in m-state:  I ⊇ hfA , { a }i, hfB , { a }i where fA and fB are final non-initial By item (2) of the Lemma, the same conflict exists in a m-state:  Iˆ ⊇ hfA → ε •, { a }i, hfB → ε •, { a }i Similarly, a conflict in m-state:  I ⊇ h0A , { a }i, hfB , { a }i where 0A and fB are final corresponds, by items (2) and (3), to a conflict in m-state:  Iˆ ⊇ h0A → ε •, { a }i, hfB → ε •, { a }i By item (4) the same holds true for the special case 0A = 0S . X Convergence conflict. Consider a convergence conflict I → I ′ , where:  I ⊇ hpA , { a }i, hqA , { a }i δ (pA , X) = δ (qA , X) = ra ′ I|base ∋ hrA , { a }i First, if neither pA nor qA are the initial state, both candidates are in the base of I. By X item (1) there are correspondent intermediate m-states and transition Iˆ → Iˆ′ with Iˆ′ ⊇  hpA → X • rA , { a }i, hpA → X • rA , { a }i . Therefore m-state ϑ̂ (Iˆ′ , rA ) contains two reduction candidates with identical look-ahead, which is a conflict. Quite similarly, if (arbitrarily) qA ≡ 0A , then candidate hpA , { a }i is in the base of I and I|base necessarily contains a candidate C = hs, ρi such that closure (C) = h0A , { a }i. Therefore for some t and Y , there exists a m-state Iˆ correspondent of I such that ht → Y • s, ρi ∈ Iˆ|base and h0A → • X rA , { a }i ∈ Iˆ|closure , hence it holds ˆ X) = Iˆ′ , and h0A → X • rA , { a }i ∈ Iˆ′ . ϑ̂ (I, Part “only if” (of Theorem). We argue that every LR (1) conflict in P̂ entails a violation of the ELR (1) condition in P. Shift - Reduce conflict. The conflict occurs in a m-state Iˆ such that hfB → ε •, { a }i ∈ ˆ ˆ a) is defined. By items (1) and (2) (or (3)) of the Lemma, the correspondent I and ϑ (I, m-state I contains hfB , { a }i and the move ϑ (I, a) is defined, thus resulting in the same conflict. Reduce - Reduce conflict. First, consider a m-state having the form:  Iˆ|closure ⊇ hfA → ε •, { a }i, hfB → ε •, { a }i where fA and fB are final non-initial. By item (2) of the Lemma, the correspondent m-state  I contains the candidates I ⊇ hfA , { a }i, hfB , { a }i and has the same conflict. Second, consider a m-state having the form:  Iˆ|closure ⊇ hfA → ε •, { a }i, h0B → ε •, { a }i where fA is final non-initial. By items (2) and (3) the same conflict is in the correspondent m-state I. Parsing methods streamlined · 59 At last, consider a reduce-reduce conflict in a sink reduction m-state:  Iˆ ⊇ hpA → X rA •, { a }i, hqA → X rA •, { a }i rA ˆ I such that Iˆ′ contains candidates hpA → Then there exist a m-state and a transition Iˆ′ → X • rA , { a }i and hqA → X • rA , { a }i. Therefore the correspondent m-state I ′ X contains candidate hrA , { a }i, and there are a m-state Iˆ′′ and a transition Iˆ′′ → Iˆ′ such  ′′ that it holds hpA → • X rA , { a }i, hqA → • X rA , { a }i ⊆ Iˆ|closure . Since ′′ ′′ ′′ Iˆ 6= ∅, Iˆ is not a sink reduction state; let us call I its correspondent state. Then: |closure ′′ —If pA is initial then hpA , { a }i ∈ I|closure by virtue of Item 5. ′′ —If pA is not initial then there exists a candidate htA → Z • pA , { a }i ∈ Iˆ|base (notice that the look-ahead is the same because we are still in the same machine MA ) and hpA , { a }i ∈ I ′′ . A similar reasoning applies to state qA . Therefore hpA , { a }i ∈ I ′′ X and I ′′ → I ′ has a convergence conflict. This concludes the ‘if” and “only if” parts, and the Theorem itself. As a second example to illustrate convergence conflicts, the pilot graph P̂ equivalent to P of Figure 4, p.16, is shown in Figure 21. Proof of property 4.11 If the guide sets of a P CF G are disjoint, then the machine net satisfies the ELL (1) condition of Definition 4.8. P ROOF. Since the ELL (1) condition consists of the three properties of the ELR (1) pilot: (1) absence of left recursion; (2) ST P , i.e., absence of multiple transitions; and (3) absence of shift-reduce and reduce-reduce conflicts, we will prove that the presence of disjoint guide sets in the P CF G implies that all these three conditions hold. (1) We prove that if a grammar (represented as a net) is left recursive then its guide sets are not disjoint. If the grammar is left recursive then ∃ n > 1 such that in the P CF G there are n call edges 0A1 99K 0A2 , 0A2 99K 0A3 , . . ., 0An 99K 0A1 . Then since ∄ A ∈ V such that LA (G) = { ε }, it holds ∃ a ∈ Σ and ∃ Ai ∈ V such that there is a a shift edge 0Ai → pA and a ∈ Gui (0Ai 99K 0Ai+1 ), hence the guide sets for these two edges in the P CF G are not disjoint. Notice that the presence of left recursion due to rules of the kind A → X A . . . with X a nullable nonterminal, can be ruled out because this kind of left recursion leads to a shift-reduce conflict, as discussed in Section 4.2 and shown in Figure 13. (2) We prove that the presence of multiple transitions implies that the guide sets in the P CF G are not all disjoint. This is done by induction, through starting from the initial m-state of the pilot automaton (which has an empty base) and showing that all reachable m-states of the pilot automaton satisfy the Single Transition Property (ST P ), unless the guide sets of the P CF G are not all disjoint. We also note that the transitions from the m-states satisfying ST P lead to m-states the base of which is a singleton set: we call such m-states Singleton Base and we say that they satisfy the Singleton Base Property (SBP ). Induction base: Assume there exists a multiple transition from the initial m-state I0 = closure (h0S , { ⊣ }i). Hence I0 includes n > 1 candidates h0X1 , π1 i, h0X2 , π2 i, 60 · Parsing methods streamlined Iˆ1 0S → a • 1S Iˆ0 0S → • a 1S P̂ → 0S → • b 4S a ⊣ 0S → • b 4S e Iˆ5 1A → • 0S 2A 0S → • a 1S e 0S → • b 4S 0S → • 0A 5S 0S → • 0A 5S 0A → • a 1A 0A → • a 1A b b 1S → b • 2S ⊣ 1S → b • 2S 0S → b • 4S e 0S → b • 4S 2S → • c 3S 2S → • d 3S 4S → • c 3S ⊣ Iˆ8 ⊣ 4S → c • 3S e e 4S → • c 3S 2S → c • 3S Iˆ11 3S → • ε = ε • e ⊣ 2S → c 3S • ⊣ e 4S → c • 3S 3S → • ε = ε • e 3S 4S → c 3S • e e c 2S → c • 3S Iˆ10 sink a e 2S → • c 3S 2S → • d 3S e c Iˆ10 e 1S → • b 2S a 0S → • a 1S right-linearized grammar for Ex. 3.5   0S → a 1S      0  S → b 4S     0 → 0A 5S  S      1 → b 2S S      2 → c 3S S     2 → d3 S S   3S → ε     4S → c 3S       5S → e 3S      0A → a 1A      1  A → 0S 2A   2 → ε A 0S → a • 1S 0A → a • 1A 1A → • 0S 2A 0S → • 0A 5S 0A → • a 1A ⊣ 0A → a • 1A e 1S → • b 2S ⊣ Iˆ4 3S Iˆ11 sink 2S → c 3S • 4S → c 3S • e reduce-reduce conflict ⇐⇒ convergence conflict Fig. 21. Part of the (traditional - with marked rules) pilot of the right-linearized grammar for Ex. 3.5; the reducec reduce conflict in m-state Iˆ11 sink matches the convergence conflict of the edge I8 → I11 of P (Fig. 4, p.16). . . ., h0Xn , πn i, and for some h and k with 1 ≤ h < k ≤ n, the machine net inX X cludes transitions 0Xh → pXh and 0Xk → pXk , with X being a terminal symbol s.t. X = a ∈ Σ or being a nonterminal one s.t. X = Z ∈ V . Let us first consider the case X = a ∈ Σ and assume the candidate h0Xk , πk i derives from candidate h0Xh , πh i through a (possibly iterated) closure operation; then the P CF G includes the call edges 0Xh 99K 0Xh+1 , . . ., 0Xk−1 99K 0Xk , the inclusions { a } ⊆ Gui (0Xk−1 99K 0Xk ) ⊆ . . . ⊆ Gui (0Xh 99K 0Xh+1 ) hold, and there are two nona disjoint guide sets Gui (0Xh → pXh ) = { a } and Gui (0Xh 99K 0Xh+1 ) ⊇ { a }. Assuming instead that there is a candidate 0Xj , πj such that both h0Xh , πh i and h0Xk , πk i are derived by the closure operation through distinct paths, then the P CF G includes the call edges 0Xj 99K 0Xjh1 , . . ., 0Xjh−1 99K 0Xjh with 0Xjh = 0Xh and Parsing methods streamlined · 61 0Xj 99K 0Xjk1 . . . 0Xjk−1 99K 0Xjk with 0Xjk = 0Xk ; thus the following inclusions hold: { a } ⊆ Gui (0Xjh−1 99K 0Xjh ) ⊆ . . . ⊆ Gui (0Xj 99K 0Xjh1 ) and { a } ⊆ Gui (0Xjk−1 99K 0Xjk ) ⊆ . . . ⊆ Gui (0Xj 99K 0Xjk1 ); therefore the two guide sets Gui (0Xj 99K 0Xjh1 ) and Gui (0Xj 99K 0Xjk1 ) are not disjoint. Let us now consider the case X = Z ∈ V . Then if the candidate h0Xk , πk i derives from h0Xh , πh i, the P CF G includes the call edges 0Xh 99K 0Xh+1 , . . ., 0Xk−1 99K 0Xk , as well as 0Xh 99K 0Z and 0Xk 99K 0Z , hence Ini (0Z ) ⊆ Gui (0Xh 99K 0Z ) and Ini (0Z ) ⊆ Gui (0Xk 99K 0Z ) ⊆ Gui (0Xh 99K 0Xh+1 ), and the two guide sets Gui (0Xh 99K 0Z ) and Gui (0Xh 99K 0Xh+1 ) are not disjoint. The case of both candidates h0Xh , πh i and h0Xk , πk i deriving from a common candidate 0Xj , πj through distinct sequences of closure operations, is similarly dealt with and leads to the conclusion that in the P CF G there are two call edges originating from state 0Xj , the guide sets of which are not disjoint. This concludes the induction base. Inductive step: Consider a non-initial, singleton base m-state I, such that a multiple transition ϑ (I, X) is defined. Since I has a singleton base, of the two candidates from where the multiple transition originates, at least one is in I|closure . The case of both candidates in the closure is at all similar to the one treated in the base case of the induction. Therefore, we consider the case of one candidate in the base with a non-initial state qA and one in the closure with an initial state 0Y . Then if X = a ∈ Σ the P CF G has: states rA , rY and 0Y1 , . . ., 0Yn , with n ≥ 1 and Yn = Y ; shift edges a a qA → rA and 0Y → rY ; and call edges qA 99K 0Y1 , . . ., 0Yn−1 99K 0Y such that { a }⊆ Ini (0Y) ⊆ Gui (0Yn−1 99K 0Y ) ⊆ . . .⊆ Gui (q A 99K 0Y1 ) and { a } = a a Gui qA → rA . Thus the two guide sets Gui qA → rA and Gui (qA 99K 0Y1 ) are not disjoint. Otherwise if X = Z ∈ V , the P CF G includes the nonterminal shift Z Z edges qA → rA and 0Yn → rYn with rYn ∈ QYn , and the call edges qA 99K 0Y1 , . . ., 0Yn−1 99K 0Yn , and also the two call edges qA 99K 0Z and 0Yn 99K 0Z . Then it holds Gui (qA 99K 0Z ) ∩ Gui (qA 99K 0Y1 ) ⊇ Ini (Z), and the two guide sets Gui (qA 99K 0Z ) and Gui (qA 99K 0Y1 ) are not disjoint. This concludes the induction. (3) We prove that the presence of shift-reduce or reduce-reduce conflicts implies that the guide sets are not disjoint. We can assume that all m-states are singleton base, hence if there are two conflicting candidates at most one of them is in the base, as in the point (2) above. So: (a) First we consider reduce-reduce conflicts and the two cases of candidates being both in the closure or only one. i. If both candidates are in the closure then there are n > 1 candidates h0X1 , π1 i, . . ., h0Xn , πn i such that the candidates h0X1 , π1 i and h0Xn , πn i are conflicting, hence for some a ∈ Σ it holds a ∈ Gui (0X1 →) and a ∈ Gui (0Xn →). If the candidate h0Xn , πn i derives from candidate h0X1 , π1 i through a sequence of closure operations, then the P CF G includes the chain of call edges 0X1 99K 0X2 , . . ., 0Xn−1 99K 0Xn with a ∈ Gui (0Xn−1 99K 0Xn ) ⊆ . . . ⊆ Gui (0X1 99K 0X2 ), therefore a ∈ Gui (0X1 →) ∩ Gui (0X1 99K 0X2 ) and these two guide sets are not disjoint. If instead there is a candidate 0Xj , πj such that both h0X1 , π1 i and h0Xn , πn i are obtained from that candidate through distinct paths, it can be shown that in the P CF G there are two call edges departing from state 0Xj , the guide sets of which are not 62 · Parsing methods streamlined disjoint, as in the point (2) above. ii. The case where one candidate is in the base and one is in the closure, is quite similar to the one in the previous point: there are a candidate hfA , πi and n ≥ 1 candidates h0X1 , π1 i, . . ., h0Xn , πn i such that the candidates hfA , πi and h0Xn , πn i are conflicting, hence for some a ∈ Σ it holds a ∈ Gui (fA →) and a ∈ Gui (0Xn →), the P CF G includes the call edges fA 99K 0X1 , . . ., 0Xn−1 99K 0Xn , whence a ∈ Gui (fA →) ∩ Gui (fA 99K 0X1 ) and these two guide sets are not disjoint. (b) Then we consider shift-reduce conflicts and the three cases that arise depending on whether the conflicting candidates are both in the closure or only one, or whether there is one candidate that is both shift and reduction. i. If there are two conflicting candidates, both in the closure of m-state I, then either the closure of I includes n > 1 candidates h0X1 , π1 i, . . ., h0Xn , πn i and the P CF G includes the call edges 0X1 99K 0X2 , . . ., 0Xn−1 99K 0Xn , or the closure includes three candidates 0Xj , πj , h0Xh , πh i and h0Xk , πk i such that h0Xh , πh i and h0Xk , πk i derive from 0Xj , πj through distinct chains of closure operations. We first consider a linear chain of closure operations from h0X1 , π1 i to h0Xn , πn i. Let us first consider the case where h0X1 , π1 i is a reduction candidate (hence 0X1 is a final state), and ∃ a ∈ Σ such that a ∈ π1 and ∃ q ∈  a QXn such that 0Xn → q. Then it holds a ∈ Gui 0Xn−1 99K 0Xn ⊆ . . . ⊆ Gui (0X1 99K 0X2 ), therefore a ∈ Gui (0X1 →) ∩ Gui (0X1 99K 0X2 ) and these two guide sets are not disjoint. Let us then consider the symmetric case where 0Xn is a final state (hence h0Xn , πn i is a reduction candidate), a and ∃ a ∈ Σ such that a ∈ πn and  ∃ q ∈ QX1 such that 0X1 → q. Then it holds a ∈ Gui  0Xn−199K 0Xn ⊆ . . . ⊆ Gui (0X1 99K 0X2 ), therefore a ii. { a } = Gui 0X1 → q ∩ Gui (0X1 99K 0X2 ) and these two guide sets are not disjoint. The other case, where two candidates h0Xh , πh i and h0Xk , πk i derive from a third one 0Xj , πj through distinct chains of closure operations, is treated in a similar way and leads to the conclusion that in the P CF G there are two call edges departing from state 0Xj , the guide sets of which are not disjoint. If there are two conflicting candidates, one in the base and one in the closure, then we consider the two cases that arise depending on whether the reduction candidate is in the closure or in the base, similarly to point 3(b)i above. Let us first consider the case where the base contains the candidate hpA , πi, the closure includes n ≥ 1 candidates h0X1 , π1 i, . . ., h0Xn , πn i, state 0Xn is final hence h0Xn , πn i is a reduction candidate, and ∃ a ∈ Σ such that a a ∈ πn and ∃ q ∈ QA such that pA → q. Then since 0Xn is final, it holds N ullable (Xn) and { a } ∈ Gui (0Xn−1  99K 0Xn ) ⊆ . . . ⊆ Gui (0pA 99K a 0X1 ), whence { a } = Gui pA → q ∩ Gui (pA 99K 0X1 ) and these two guide sets are not disjoint. Let us then consider the symmetric case where the base contains a candidate hfA , πi with fA ∈ FA (hence hfA , πi is a reduction candidate), the closure includes n ≥ 1 candidates h0X1 , π1 i, . . ., h0Xn , πn i, and ∃ a ∈ Σ Parsing methods streamlined · 63 a such that a ∈ π and ∃ q ∈ QXn such that 0Xn → q. Then it holds a ∈ Gui (0Xn−1 99K 0Xn ) ⊆ . . . ⊆ Gui (fA 99K 0X1 ), therefore { a } ⊆ Gui (fA →) ∩ Gui (fA 99K 0X1 ) and these two guide sets are not disjoint. iii. If there is one candidate hpA , πi that is both shift and reduce, then pA ∈ FA , a and ∃ a ∈ Σ such that a ∈ π and ∃  qA ∈ QA such  that pA → qA . Then it a holds { a } = Gui (pA →) ∩ Gui pA → qA and so there are two guide sets on edges departing from the same P CF G node, that are not disjoint. This concludes the proof of the Property. Proof of lemma 5.3 If it holds h qA , j i ∈ E [i], which implies inequality j ≤ i, with qA ∈ QA , i.e., state qA belongs to the machine MA of nonterminal A, then it holds h 0A , j i ∈ E [j] and the ∗ right-linearized grammar Ĝ admits a leftmost derivation 0A ⇒ xj+1 . . . xi qA if j < i or ∗ 0A ⇒ qA if j = i. P ROOF. By induction on the sequence of insertion operations performed in the vector E by the Analysis Algorithm. Base. h0S , 0i ∈ E [0] and the property stated by the Lemma is trivially satisfied: ∗ h0S , 0i ∈ E [0] and 0S ⇒ 0S . Induction. We examine the three operations below: TerminalShift: if hqA , ji ∈ E [i] results from a TerminalShift operation, then it holds ′ ′ ′ ∃ qA such that δ (qA , xi ) = qA and hqA , ji ∈ E [i − 1], as well as h0A , ji ∈ E [j] and ∗ ∗ ′ 0A ⇒ xj+1 . . . xi−1 qA by the inductive hypothesis; hence 0A ⇒ xj+1 . . . xi−1 xi qA . Closure: if h0B , ii ∈ E [i] then the property is trivially satisfied: h0B , ii ∈ E [i] and ∗ 0B ⇒ 0B . NonterminalShift: suppose first that j < i; if hqFA , ji ∈ E [i] then h0A , ji ∈ E [j] ∗ and 0A ⇒ xj+1 . . . xi qFA by the inductive hypothesis; furthermore, if hqB , ki ∈ E [j] ∗ then h0B , ki ∈ E [k] and 0B ⇒ xk+1 . . . xj qB by the inductive hypothesis; also if ′ ′ ′ δ (qB , A) = qB then qB ⇒ 0A qB ; and since hqB , ki is added to E [i], it is eventually ′ proved that hqB , ki ∈ E [i] implies h0B , ki ∈ E [k] and: ∗ 0B ⇒ xk+1 . . . xj qB ∗ ′ ⇒ xk+1 . . . xj 0A qB ∗ ′ ⇒ xk+1 . . . xj xj+1 . . . xi qFA qB ′ ⇒ xk+1 . . . xi qB If j = i then the same reasoning applies, but there is not any TerminalShift since the derivation does not generate any terminal. In particular, for the NonterminalShift case, ∗ we have that if hqFA , ii ∈ E [i], then h0A , ii ∈ E [i] and 0A ⇒ qFA by the inductive ∗ hypothesis; and the rest follows as before but with k = i and 0B ⇒ qB . The reader may easily complete by himself with the two remaining proof cases where k < j = i or k = j < i, which are combinations. This concludes the proof of the Lemma. 64 · Parsing methods streamlined Proof of lemma 5.5 Take an EBNF grammar G and a string x = x1 . . . xn of length n that belongs to language L (G). In the right-linearized grammar Ĝ, consider any leftmost derivation d of a prefix x1 . . . xi (i ≤ n) of x, that is: + d : 0S ⇒ x1 . . . xi qA W with qA ∈ QA and W ∈ Q∗A . The two points below apply: (1) if it holds W 6= ε, i.e., W = rB Z for some rB ∈ QB , then it holds ∃ j 0 ≤ j ≤ i and A ∃ pB ∈ QB such that the machine net has an arc pB → rB and grammar Ĝ admits + + two leftmost derivations d1 : 0S ⇒ x1 . . . xj pB Z and d2 : 0A ⇒ xj+1 . . . xi qA , so that derivation d decomposes as follows: d pB →0A rB d = d : 0S ⇒1 x1 . . . xj pB Z ⇒2 x1 . . . xj xj+1 . . . xi qA rB Z =⇒ x1 . . . xj 0A rB Z x1 . . . xi qA W A as an arc pB → rB in the net maps to a rule pB → 0A rB in grammar Ĝ (2) this point is split into two steps, the second being the crucial one: (a) if it holds W = ε, then it holds A = S, i.e., nonterminal A is the axiom, qA ∈ QS and h qA , 0 i ∈ E [i] (b) if it also holds x1 . . . xi ∈ L (G), i.e., the prefix also belongs to language L (G), then it holds qA = fS ∈ FS , i.e., state qA = fS is final for the axiomatic machine MS , and the prefix is accepted by the Earley algorithm Limit cases: if it holds i = 0 then it holds x1 . . . xi = ε; if it holds j = i then it holds xj+1 . . . xi = ε; and if it holds x = ε (so n = 0) then both cases hold, i.e., j = i = 0. If the prefix coincides with the whole string x, i.e., i = n, then step (2b) implies that string x, which by hypothesis belongs to language L (G), is accepted by the Earley algorithm, which therefore is complete. ∗ P ROOF. By induction on the length of the derivation S ⇒ x. ∗ Base. Since 0S ⇒ 0S the thesis (case (1)) is satisfied by taking i = 0. Induction. We examine a few cases: X ∗ —If 0S ⇒ x1 . . . xi qA W ⇒ x1 . . . xi 0X rA W (because qA → rA ) then the closure operation adds to E [i] the item h0X , ii, hence the thesis (case (1)) holds by taking for j the value i, for qA the value 0X , for qB the value rA and for W the value rA Z. xi+1 ∗ —If 0S ⇒ x1 . . . xi qA W ⇒ x1 . . . xi xi+1 rA W (because qA → rA ) then the operation TerminalShift (E, i + 1) adds to E [i + 1] the item hrA , ji, hence the thesis (case (1)) holds by taking for j the same value and for qA the value rA . ∗ —If 0S ⇒ x1 . . . xi qA W ⇒ x1 . . . xi W (because qA = fA ∈ FA and fA → ε) then: ∗ —If Z = ε, qA = fS ∈ FS and 0S ⇒ x1 . . . xi fS ⇒ x1 . . . xi , then the current derivation step is the last one and the string is accepted because the pair hfS , 0i ∈ E [i] by the inductive hypothesis. —If W = qB Z, then by applying the inductive hypothesis to x1 . . . xj , the following ∗ B facts hold: ∃ k 0 ≤ k ≤ j, ∃ pC ∈ QC such that 0S ⇒ x1 . . . xk pC Z ′ , pC → qC , · Parsing methods streamlined ∗ 65 A 0B ⇒ xk+1 . . . xj pB , pB → qB , and the vector E is such that hpC , hi ∈ E [k], h0B , ki ∈ E [k], hpB , ki ∈ E [j], h0A , ji ∈ E [j] and hqA , ji ∈ E [i]; then the nonterminal shift operation in the Completion procedure adds to E [i] the pair hqB , ki. ∗ A ∗ First, we notice that from 0B ⇒ xk+1 . . . xj pB , pB → qB and 0A ⇒ xj+1 . . . xi fA , ∗ B it follows that 0B ⇒ xk+1 . . . xi qB . Next, since pC → qC , it holds: ∗ 0S ⇒ x1 . . . xk pC Z ⇒ x1 . . . xk 0B qC Z ′ therefore: ∗ 0S ⇒ x1 . . . xk xk+1 . . . xi qB qC Z ′ and the thesis holds by taking for j the value k, for qA the value qB , for qB the value qC and for W the value qC Z ′ . The above situation is schematized in Figure 22. E0 a1 E1 ... ak hpC , hi hpB , ki hpA , ji h0B , ki h0A , ji hqB , ki Ek Fig. 22. ak+1 ... aj Ej Schematic trace of tabular parsing. This concludes the proof of the Lemma. aj+1 Ej+1 ai Ei
6cs.PL
I/O-Efficient Similarity Join⋆ Rasmus Pagh, Ninh Pham, Francesco Silvestri⋆⋆ , and Morten Stöckel⋆ ⋆ ⋆ arXiv:1507.00552v2 [cs.DS] 28 Mar 2017 IT University of Copenhagen, Denmark Abstract. We present an I/O-efficient algorithm for computing similarity joins based on locality-sensitive hashing (LSH). In contrast to the filtering methods commonly suggested our method has provable subquadratic dependency on the data size. Further, in contrast to straightforward implementations of known LSH-based algorithms on external memory, our approach is able to take significant advantage of the available internal memory: Whereas the time complexity of classical algorithms includes a factor of N ρ , where ρ is a parameter of the LSH used, the I/O complexity of our algorithm merely includes a factor (N/M )ρ , where N is the data size and M is the size of internal memory. Our algorithm is randomized and outputs the correct result with high probability. It is a simple, recursive, cache-oblivious procedure, and we believe that it will be useful also in other computational settings such as parallel computation. Keywords: Similarity join; locality sensitive hashing; cache aware; cache oblivious; 1 Introduction The ability to handle noisy or imprecise data is becoming increasingly important in computing. In database settings this kind of capability is often achieved using similarity join primitives that replace equality predicates with a condition on similarity. To make this more precise consider a space U and a distance function d : U × U → R. The similarity join of sets R, S ⊆ U is the following: Given a radius r, compute the set R ⊲⊳≤r S = {(x, y) ∈ R × S | d(x, y) ≤ r}. This problem occurs in numerous applications, such as web deduplication [3, 13, 19], document clustering [4], data cleaning [2, 6]. As such applications arise in large-scale datasets, the problem of scaling up similarity join for different metric distances is getting more important and more challenging. Many known similarity join techniques (e.g., prefix filtering [2, 6], positional filtering [19], inverted index-based filtering [3]) are based on filtering techniques ⋆ ⋆⋆ ⋆⋆⋆ The research leading to these results has received funding from the European Research Council under the EU 7th Framework Programme, ERC grant agreement no. 614331. In part supported by University of Padova project CPDA121378 and by MIUR of Italy project AMANDA while working at the University of Padova. Supported by the Danish National Research Foundation / Sapere Aude program. that often, but not always, succeed in reducing computational costs. If we let N = |R| + |S| these techniques generally require Ω(N 2 ) comparisons for worstcase data. Another approach is locality-sensitive hashing (LSH) where candidate output pairs are generated using collisions of carefully chosen hash functions. The LSH is defined as follows. Definition 1. Fix a distance function d : U × U → R. For positive reals r, c, p1 , p2 , and p1 > p2 , c > 1, a family of functions H is (r, cr, p1 , p2 )-sensitive if for uniformly chosen h ∈ H and all x, y ∈ U: – If d(x, y) ≤ r then Pr [h(x) = h(y)] ≥ p1 ; – If d(x, y) ≥ cr then Pr [h(x) = h(y)] ≤ p2 . We say that H is monotonic if Pr [h(x) = h(y)] is a non-increasing function of the distance function d(x, y). We also say that H uses space s if a function h ∈ H can be stored and evaluated using space s. LSH is able to break the N 2 barrier in cases where for some constant c > 1 the number of pairs in R ⊲⊳≤cr S is not too large. In other words, there should not be too many pairs that have distance within a factor c of the threshold, the reason being that such pairs are likely to become candidates, yet considering them does not contribute to the output. For notational simplicity, we will talk about far pairs at distance greater than cr (those that should not be reported), near pairs at distance at most r (those that should be reported), and c-near pairs at distance between r and cr (those that should not be reported but the LSH provides no collision guarantees). Our contribution. In this paper we study I/O-efficient similarity join methods based on LSH. That is, we are interested in minimizing the number of I/O operations where a block of B points from U is transferred between an external memory and an internal memory with capacity for M points from U. Our main result is the first cache-oblivious algorithm for similarity join that has provably sub-quadratic dependency on the data size N and at the same time inverse polynomial dependency on M . In essence, where previous methods have an overhead factor of either N/M or (N/B)ρ we obtain an overhead of (N/M )ρ , where 0 < ρ < 1 is a parameter of the LSH employed, strictly improving both. We show: Theorem 1. Consider R, S ⊆ U, let N = |R| + |S|, assume 18 log N + 3B ≤ M < N and that there exists a monotonic (r, cr, p1 , p2 )-sensitive family of functions with respect to distance measure d, using space B and with p2 < p1 < 1/2. Let ρ = log p1 / log p2 . Then there exists a cache-oblivious randomized algorithm computing R ⊲⊳≤r S (w.r.t. d) with probability 1 − O (1/N ) using      ρ |R ⊲⊳ S| |R ⊲⊳ S| N N ≤cr ≤r  + +  I/Os.1 Õ  M B MB MB 1 The Õ (·)-notation hides polylog(N ) factors. 2 We conjecture that the bound in Theorem 1 is close to the best possible for the class of “signature based” algorithms that work by generating a set of LSH values (from a black-box and monotonic family) and checking all pairs that collide. Our conjecture is based on an informal argument, given in full in Section 4. We describe a worst-case input, where it seems significant advances are required to beat Theorem 1 asymptotically. Further, we observe that for M = N our bound coincides with the optimal bound of reading the input, and when M = 1 our bound coincides with the bounds of the best known internal memory algorithms. It is worth noting that whereas most methods in the literature focus on a single (or a few) distance measure, our method works for an arbitrary space and distance measure that allows LSH, e.g., Hamming, Manhattan (ℓ1 ), Euclidean (ℓ2 ), Jaccard, and angular metric distances. Since our approach makes use of LSH as a black box, the problem of reporting the complete join result with certainty would require major advances in LSH methods (see [16, 17] for recent progress in this direction). A primary technical hurdle in the paper is that we cannot use any kind of strong concentration bounds on the number of points having a particular value, since hash values of an LSH family may be correlated by definition. Another hurdle is duplicate elimination in the output stemming from pairs having multiple LSH collisions. However, in the context of I/O-efficient algorithms it is natural to not require the listing of all near pairs, but rather we simply require that the algorithm enumerates all such near pairs. More precisely, the algorithm calls for each near pair (x, y) a function emit(x, y). This is a natural assumption in external memory since it reduces the I/O complexity. In addition, it is desired in many applications where join results are intermediate results pipelined to a subsequent computation, and are not required to be stored on external memory. Our upper bound can be easily adapted to list all instances by increasing the I/O complexity of an unavoidable additive term of Θ (|R ⊲⊳≤r S|/B) I/Os. Organization. The organization of the paper is as follows. In Section 2, we briefly review related work. Section 3 describes our algorithms including a warm-up cache-aware approach and the main results, a cache-oblivious solution, its analysis, and a randomized approach to remove duplicates. Section 4 provides some discussions on our algorithms with some real datasets. Section 5 concludes the paper. 2 Related Work In this section, we briefly review LSH, the computational I/O model, and some state-of-the-art similarity join techniques. Locality-sensitive hashing (LSH). LSH was originally introduced by Indyk and Motwani [14] for similarity search problems in high dimensional data. This technique obtains a sublinear (i.e., O (N ρ )) time complexity by increasing the gap of collision probability between near points and far points using the LSH family as defined in Definition 1. The gap of collision probability is polynomial, with an exponent of ρ = log p1 / log p2 dependent on c. 3 It is worth noting that the standard LSHs for metric distances, including Hamming [14], ℓ1 [7], ℓ2 [1, 7], Jaccard [4] and angular distances [5] are monotonic. These common LSHs are space-efficient, and use space comparable to that required to store a point, except the LSH of [1] which requires space N o(1) . We do not explicitly require the hash values themselves to be particularly small. However, using universal hashing we can always map to small bit strings while introducing no new collisions with high probability. Thus we assume that B hash values fit in one memory block. Computational I/O model. We study algorithms for similarity join in the external memory model, which has been widely adopted in the literature (see, e.g., the survey by Vitter [18]). The external memory model consists of an internal memory of M words and an external memory of unbounded size. The processor can only access data stored in the internal memory and move data between the two memories in blocks of size B. For simplicity we will here measure block and internal memory size in units of points from U, such that they can contain B points and M points, respectively. The I/O complexity of any algorithm is defined as the number of input/output blocks moved between the two memories by the algorithm. The cache-aware approach makes explicit use of the parameters M and B to achieve its I/O complexity, whereas the cache-oblivious one [9] does not explicitly use any model parameters. The latter approach is desirable as it implies optimality on all levels of the memory hierarchy and does not require parameter tuning when executed on different physical machines. Note that the cache-oblivious model assumes that the internal memory is ideal in the sense that it has an optimal cachereplacement policy. Such cache-replacement policy can evict the block that is used furthest in the future, and can place a block anywhere in the cache (full associativity). Similarity join techniques. We review some state-of-the-art of similarity join techniques most closely related to our work. – Index-based similarity join. A popular approach is to make use of indexing techniques to build a data structure for one relation, and then perform queries using the points of the other relation. The indexes typically perform some kind of filtering to reduce the number of points that a given query point is compared to (see, e.g., [3, 6, 10]). Indexing can be space consuming, in particular for LSH, but in the context of similarity join this is not a big concern since we have many queries, and thus can afford to construct each hash table “on the fly”. On the other hand, it is clear that index-based similarity join techniques will not be able to take significant advantage of internal memory when N ≫ M . Indeed, the query complexity stated in [10] is O ((N/B)ρ ) I/Os. Thus the I/O complexity of using indexing for similarity join will be high. – Sorting-based. The indexing technique of [10] can be adapted to compute similarity joins more efficiently by using the fact that many points are being looked up in the hash tables. This means that all lookups can be done in 4 a batched fashion using sorting. This results in a dependency on N that is  Õ (N/B)1+ρ I/Os, where ρ ∈ (0; 1) is a parameter of the LSH family. – Generic joins. When N is close to M the I/O-complexity can be improved by using general join operators optimized for this case. It is easy to see that when N/M is an integer, a nested loop join requires N 2 /(M B) I/Os. Our cache-oblivious algorithm will make use of the following result on cacheoblivious nested loop joins: Theorem 2. (He and Luo [12]) Given a similarity join condition, the join of relations R and S can be computed by a cache-oblivious algorithm in   |R| + |S| |R||S| O I/Os. + B MB This number of I/Os suffices to generate the result in memory, but may not suffice to write it to disk. We note that a similarity join can be part of a multi-way join involving more than two relations. For the class of acyclic joins, where the variables compared in join conditions can be organized in a tree structure, one can initially apply a full reducer [20] that removes tuples that will not be part of the output. This efficiently reduces any acyclic join to a sequence of binary joins. Handling cyclic joins is much harder (see e.g. [15]) and outside the scope of this paper. 3 Our Algorithms In this section we describe our I/O efficient algorithms. We start in Section 3.1 with a warm-up cache-aware algorithm. It uses an LSH family where the value of the collision probability is set to be a function of the internal memory size. Section 3.2 presents our main result, a recursive and cache-oblivious algorithm, which uses the LSH with a black-box approach and does not make any assumption on the value of collision probability. Section 3.3 describes the analysis and Section 3.4 shows how to reduce the expected number of times of emitting near pairs. 3.1 Cache-aware algorithm: ASimJoin We will now describe a simple cache-aware algorithm called ASimJoin, which achieves the worst case I/O bounds as stated in Theorem 1. ASimJoin relies on an (r, cr, p′1 , p′2 )-sensitive family H′ of hash functions with the following properties: p′2 ≤ M/N and p′1 ≥ (M/N )ρ , for a suitable value 0 < ρ < 1. Given an arbitrary monotonic (r, cr, p1 , p2 )-sensitive family H, the family H′ can be built by concatenating ⌈logp2 (M/N )⌉ hash functions from H. For simplicity, we assume that logp2 (M/N ) is an integer and thus the probabilities p′1 and p′2 can be exactly obtained. Nevertheless, the algorithm and its analysis can be extended 5 Algorithm ASimJoin(R, S): R, S are the input sets. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Repeat 3 log (N ) times Associate to each point in R and S a counter initially set to 0; Repeat L = 2/p′1 times Choose h′i ∈ H′ uniformly at random; Use h′i to partition (in-place) R and S in buckets Rv , Sv of points with the hash value v; For each hash value v generated in the previous step /* For simplicity we assume that |Rv | ≤ |Sv | */ Split Rv and Sv into chunks Ri,v and Si,v of size at most M/2; For every chunk Ri,v of Rv Load in memory Ri,v ; For every chunk Si,v of Sv do Load in memory Si,v ; Compute Ri,v × Si,v and emit all near pairs. For each far pair, increment the associated counters by 1; Remove from Si,v and Ri,v all points with the associated counter larger than 8LM , and write Si,v back to external memory; Write Ri,v back to external memory; to the general case by increasing the I/O complexity by a factor at most p−1 1 in the worst case; in practical scenarios, this factor is a small constant [4, 7, 10]. ASimJoin assumes that each point in R and S is associated with a counter initially set to 0. This counter can be thought as an additional dimension of the point which hash functions and comparisons do not take into account. The algorithm repeats L = 2/p′1 times the following procedure. A hash function is randomly drawn from the (r, cr, p′1 , p′2 )-sensitive family, and it is used for partitioning the sets R and S into buckets of points with the same hash value. We let Rv and Sv denote the buckets respectively containing points of R and S with the same hash value v. Then, the algorithm iterates through every hash value and, for each hash value v, it uses a double nested loop for generating all pairs of points in Rv × Sv . The double nested loop loads consecutive chunks of Rv and Sv of size at most M/2: the outer loop runs on the smaller set (say Rv ), while the inner one runs on the larger one (say Sv ). For each pair (x, y), the algorithm emits the pair if d(x, y) ≤ r, increases by 1 counters associated with x and y if d(x, y) > cr, or ignores the pair if r < d(x, y) ≤ cr. Every time the counter of a point exceeds 8LM , the point is considered to be far away from all points and will be removed from the bucket. Chunks will be moved back in memory when they are no more needed. The entire ASimJoin algorithm is repeated 3 log N times to find all near pairs with high probability. The following theorem shows the I/O bounds of the cache-aware approach. Theorem 3. Consider R, S ⊆ U and let N = |R| + |S| be sufficiently large. Assume there exists a monotonic (r, cr, p′1 , p′2 )-sensitive family of functions with 6 respect to distance measure d with p′1 = (M/N )ρ and p′2 = M/N , for a suitable value 0 < ρ < 1. With probability 1 − 1/N , the ASimJoin algorithm enumerates all near pairs using      ρ |R ⊲⊳ S| |R ⊲⊳ S| N N ≤r ≤cr  + +  I/Os. Õ  M B MB MB Proof. We observe that the I/O cost of Steps 4-5, that is of partitioningsets N ρ N ) · B for R and S according to a hash function h′i , is L · sort(N ) = Õ ( M N ρ 2 L ≤ ( M ) repetitions . We now consider the I/O cost of an iteration of the loop in Step 6 for a given hash value v. When the size of one bucket (say Rv ) is smaller than M/2, we are able to load the whole Rv into the internal memory and then load consecutive blocks of Sv to execute join operations. Hence, the I/O cost of this step is at most (|Rv | + |Sv |)/B. The total I/O cost of the 3L log (N ) iterations of Step 6 among all possible hash values where at least one bucket has size smaller than N ρ N M/2 is at most L · N B = 2( M ) · B I/Os. The I/O cost of Step 6 when both buckets Rv and Sv are larger than M/2 is 2|Rv ||Sv |/(BM ). This means that the amortized cost of each pair in Rv × Sv is 2/(BM ). Therefore the amortized I/O cost of all iterations of Step 6, when there are no bucket size less than M/2, can be upper bounded by multiplying the total number of generated pairs by 2/(BM ). Based on this observation, we classify and enumerate generated pairs into three groups: near pairs, c-near pairs and far pairs. We denote by Cn , Ccn and Cf the respective size of each group, and upper bound these quantities to derive the proof. 1. Number of near pairs. By definition, LSH gives a lower bound on the probability of collision of near pairs. It may happen that the collision probability of near pairs is 1. Thus, two near points might collide in all L repetitions of Step 3 and in all 3 log (N ) repetitions of Step 1. This means that Cn ≤ 3L log (N )|R ⊲⊳≤r S|. Note that this bound is a deterministic worst case bound. 2. Number of c-near pairs. Any c-near pair from R ⊲⊳≤cr S appears in a bucket with probability at most p′1 due to monotonicity of our LSH family. Since we have L = 2/p′1 repetitions, each c-near pair collides at most 2 in expectation. In other words, the expected number of c-near pair collisions among L repetitions is at most 2|R ⊲⊳≤cr S|. By using the Chernoff bound [8, Exercise 1.1] with 3 log (N ) independent L repetitions (in Step 1), we have Pr [Ccn ≥ 6 log (N )|R ⊲⊳≤cr S|] ≤ 1/N 2 , Pr [Ccn ≤ 6 log (N )|R ⊲⊳≤cr S|] ≥ 1 − 1/N 2 . 2   We let sort(N ) = O (N/B) log M/B (N/B) be shorthand for the I/O complexity [18] of sorting N points. 7 3. Number of far pairs. If x ∈ R ∪ S is far away from all points, the expected number of collisions of x in L hash table (including duplicates) is at most 8LM , since then the point is removed by Step 14. Hence the total number of examined far pairs is Cf ≤ 24N LM log (N ). Therefore, by summing the number of near pairs Cn , c-near pairs Ccn , and far pairs Cf , and multiplying these quantities by the amortized I/O complexity 2/(BM ), we upper bound the I/O cost of all iterations of Step 6, when there are no buckets of size less than M/2, is Õ  N M ρ  N |R ⊲⊳≤r S| + B BM  |R ⊲⊳≤cr S| + BM  , with probability at least 1 − 1/N 2 . By summing all the previous bounds, we get the claimed I/O bound with high probability. We now analyze the probability to enumerate all near pairs. Consider one iteration of Step 1. A near pair is not emitted if at least one of the following events happen: 1. The two points do not collide in the same bucket in each of the L iterations ′ of Step 3. This happens with probability (1 − p′1 )L = (1 − p′1 )2/p1 ≤ 1/e2 . 2. One of the two points is removed by Step 14 because it collides with more than 8LM far points. By the Markov’s inequality and since there are at most N far points, the probability that x collides with at least 8LM points in the L iterations is at most 1/8. Then, this event happens with probability at most 1/4. Therefore, a near pair does not collide in one iteration of Step 1 with probability at most 1/e2 + 1/4 < 1/2 and never collides in the 3 log N iterations with probability at most (1/2)3 log N = 1/N 3 . Then, by an union bound, it follows that all near pairs (there are at most N 2 of them) collide with probability at least 1 − 1/N and the theorem follows. ⊓ ⊔ As already mentioned in the introduction, a near pair (x, y) can be emitted many times during the algorithm since points x and y can be hashed on the same value in p(x, y)L rounds of Step 3, where p(x, y) ≥ p′1 denotes the actual collision probability. A simple approach for avoiding duplicates is the following: for each near pair found during the i-th iteration of Step 3, the pair is emitted only if the two points did not collide by all hash functions used in the previous i − 1 rounds. The check starts from the hash function used in the previous round and backtracks until a collision is found or there are no more hash functions. This approach increases the worst case complexity by a factor L. Section 3.4 shows a more efficient randomized algorithm that reduces the number of replica per near pair to a constant. This technique also applies to the cache-oblivious algorithm described in the next section. 8 Algorithm OSimJoin(R, S, ψ): R, S are the input sets, and ψ is the recursion depth. If |R| > |S|, then swap (the references to) the sets such that |R| ≤ |S|; If ψ = Ψ or |R| ≤ 1, then compute R ⊲⊳≤r S using the algorithm of Theorem 2 and return; Pick a random sample S ′ of 18∆ points from S (or all points if |S| < 18∆); Compute R′ containing all points of R that have distance smaller than cr to at least half points in S ′ ; Compute R′ ⊲⊳≤r S using the algorithm of Theorem 2; Repeat L = 1/p1 times Choose h ∈ H uniformly at random; Use h to partition (in-place) R\R′ and S in buckets Rv , Sv of points with hash value v; For each v where Rv and Sv are nonempty, recursively call OSimJoin (Rv , Sv , ψ + 1); 1 2 3 4 5 6 7 8 9 3.2 Cache-oblivious algorithm: OSimJoin The above cache-aware algorithm uses an (r, cr, p′1 , p′2 )-sensitive family of functions H′ , with p′1 ∼ (M/N )ρ and p′2 ∼ M/N , for partitioning the initial sets into smaller buckets, which are then efficiently processed in the internal memory using the nested loop algorithm. If we know the internal memory size M , this LSH family can be constructed by concatenating ⌈logp2 (M/N )⌉ hash functions from any given primitive (r, cr, p1 , p2 )-sensitive family H. Without knowing M in the cache-oblivious setting, such family cannot be built. Therefore, we propose OSimJoin, a cache-oblivious algorithm that efficiently computes the similarity join without knowing the internal memory size M and the block length B. OSimJoin uses as a black-box a given monotonic (r, cr, p1 , p2 )-sensitive family H.3 The value of p1 and p2 can be considered constant in a practical scenario. As common in cache-oblivious settings, we use a recursive approach for splitting the problem into smaller and smaller subproblems that at some point will fit the internal memory, although this point is not known in the algorithm. We first give a high level description of the cache-oblivious algorithm and an intuitive explanation. We then provide a more detailed description and analysis. OSimJoin receives in input the two sets R and S of similarity join, and a parameter ψ denoting the depth in the recursion tree (initially, ψ = 0) that is used for recognizing the base case. Let |R| ≤ |S|, N = |R| + |S|, and denote with ∆ = log N and Ψ = ⌈log1/p2 N ⌉ two global values that are kept invariant in the recursive levels and computed using the initial input size N . For simplicity we assume that 1/p1 and 1/p2 are integers, and further assume without loss of generality that the initial size N is a power of two. Note that, if 1/p1 is not an 3 The monotonicity requirement can be relaxed to the following: Pr [h(x) = h(y)] ≥ Pr [h(x′ ) = h(y ′ )] for every two pairs (x, y) and (x′ , y ′ ) where d(x, y) ≤ r and d(x′ , y ′ ) > r. A monotonic LSH family clearly satisfies this assumption. 9 integer, the last iteration in Step 6 can be performed with a random variable L ∈ {⌊1/p1⌋, ⌈1/p1 ⌉} such that E [L] = 1/p1 . OSimJoin works as follows. If the problem is currently at the recursive level Ψ = ⌈log1/p2 N ⌉ or |R| ≤ 1, the recursion ends and the problem is solved using the cache-oblivious nested loop described in Theorem 2. Otherwise, the following operations are executed. By exploiting sampling, the algorithm identifies a subset R′ of R containing (almost) all points that are near or c-near to a constant fraction of points in S (Steps 3 – 4). Then we compute R′ ⊲⊳≤r S using the cacheoblivious nested-loop of Theorem 2 and remove points in R′ from R (Step 5). Subsequently, the algorithm repeats L = 1/p1 times the following operations: a hash function is extracted from the (r, cr, p1 , p2 )-sensitive family and used for partitioning R and S into buckets, denoted with Rv and Sv with any hash value v (Steps 7 – 8); then, the join Rv ⊲⊳≤r Sv is computed recursively by OSimJoin(Step 9). The explanation of our approach is the following. By recursively partitioning input points with hash functions from H, the algorithm decreases the probability of collision between two far points. In particular, the collision probability of a far pair is pi2 at the i-th recursive level. On the other hand, by repeating the partitioning 1/p1 times in each level, the algorithm guarantees that a near pair is enumerated with constant probability since the probability that a near pair collide is pi1 at the i-th recursive level. It deserves to be noticed that the collision probability of far and near pairs at the recursive level log1/p2 (N/M ) is Θ (M/N ) and Θ ((M/N )ρ ), respectively, which are asymptotically equivalent to the values in the cache-aware algorithm. In other words, the partitioning of points at this level is equivalent to the one in the cache-aware algorithm with collision probability for a far pair p′2 = M/N . Finally, we observe that, when a point in R becomes close to many points in S, it is more efficient to detect and remove it, instead of propagating it down to the base cases. This is due to the fact that the collision probability of very near pairs is always large (close to 1) and the algorithm is not able to split them into subproblems that fit in memory. 3.3 I/O Complexity and Correctness of OSimJoin Analysis of I/O Complexity. We will bound the expected number of I/Os of the algorithm rather than the worst case. This can be converted to an high probability bound by running log N parallel instances of our algorithm (without loss of generality we assume that the optimal cache replacement splits the cache into M/ log N parts that are assigned to each instance). The total execution stops when the first parallel instance terminates, which with probability at least 1 − 1/N is within a logarithmic factor of the expected I/O bound (logarithmic factors are absorbed in the Õ-notation). For notational simplicity, in this section we let R and S denote the initial input sets and let R̃ and S̃ denote the subsets given in input to a particular recursive subproblem (note that, due to Step 1, R̃ can denote a subset of R but also of S; similarly for S̃). We also let S̃ ′ denote the sampling of S̃ in Step 3, and with R̃′ the subset of R̃ computed in Step 4. Lemma 1 says that two properties 10 of the choice of random sample in Step 3 are almost certain, and the proof relies on Chernoff bounds on the choice of S̃ ′ . In the remainder of the paper, we assume that Lemma 1 holds and refer to this event as A holding with probability 1 − O (1/N ). Lemma 1. With probability at least 1 − O (1/N ) over the random choices in Step 3, the following bounds hold for every subproblem OSimJoin(R̃, S̃, ψ): |R̃′ ⊲⊳ S̃| > ≤cr |(R̃\R̃′ ) ⊲⊳ S̃| > >cr |R̃′ ||S̃| , 6 |R̃\R̃′ ||S̃| . 6 (1) (2) Proof. Let x ∈ R̃ be a point which is c-near to at most one sixth of the points in S̃, i.e., |x ⊲⊳≤cr S̃| ≤ |S̃|/6. The point x enters R̃′ if there are at least 9∆ cnear points in S̃ ′ and this happens, for a Chernoff bound [8, Theorem 1.1], with Pi=Ψ −1 probability at most 1/N 4 . Each point of R∪S appears in at most 2 i=0 Li < 2LΨ < 2N 2 subproblems and there are at most N points in R ∪ S. Therefore, with probability 1 − 2N 3 N −4 = 1 − 2N −1 , we have that in every subproblem OSimJoin(R̃, S̃, ψ) no point with at most |S̃|/6 c-near points in S̃ is in R̃′ . Hence each point in R̃ has at least |S̃|/6 c-near points in S̃, and the bound in Equation 1 follows. We can similarly show that, with probability 1 − 2N 3 N −4 = 1 − 2N −1 , we have that in every subproblem OSimJoin(R̃, S̃, ψ) all points with at least 5|S̃|/6 c-near points in S̃ are in R̃′ . Then, each point in R̃\R̃′ has |S̃|/6 far points in S̃ and Equation 2 follows. ⊓ ⊔ To analyze the number of I/Os for subproblems of size more than M we bound the cost in terms of different types of collisions of pairs in R × S that end up in the same subproblem of the recursion. We say that (x, y) is in a particular subproblem OSimJoin(R̃, S̃, ψ) if (x, y) ∈ (R̃ × S̃) ∪ (S̃ × R̃). Observe that a pair (x, y) is in a subproblem if and only if x and y have colliding hash values on every step of the call path from the initial invocation of OSimJoin. Definition 2. Given Q ⊆ R × S let Ci (Q) be the number of times a pair in Q is in a call to OSimJoin at the i-th level of recursion. We also let Ci,k (Q), with 0 ≤ k ≤ log M , denote the number of times a pair in Q is in a call to OSimJoin at the i-th level of recursion where the smallest input set has size in [2k , 2k+1 ) if 0 ≤ k < log M , and in [M, +∞) if k = log M . The count is over all pairs and with multiplicity, so if (x, y) is in several subproblems at the i-th level, all these are counted. Next we bound the I/O complexity of OSimJoin in terms of Ci (R ⊲⊳≤cr S) and Ci,k (R ⊲⊳>cr S), for any 0 ≤ i < Ψ . We will later upper bound the expected size of these quantities in Lemma 3 and then get the claim of Theorem 1. 11 Lemma 2. Let ℓ = ⌈log1/p2 (N/M )⌉ and M ≥ 18 log N + 3B. Given that A holds, the I/O complexity of OSimJoin(R, S, 0) is       C R ⊲⊳ S C R ⊲⊳ S L log M ℓ Ψ −1 i i,k X X  N Lℓ X >cr ≤cr  Õ  + +  B  MB B2k i=0 i=ℓ k=0 Proof. To ease the analysis we assume that no more than 1/3 of internal memory is used to store blocks containing elements of R and S, respectively. Since the cache-oblivious model assumes an optimal cache replacement policy this cannot decrease the I/O complexity. Also, internal memory space used for other things than data (input and output buffers, the recursion stack of size at most Ψ ) is less than M/3 by our assumption that M ≥ 18 log n + 3B. As a consequence, we have that the number of I/Os for solving a subproblem OSimJoin (R̃, S̃, ·)   where |R̃| ≤ M/3 and |S̃| ≤ M/3 is O (|R̃| + |S̃|)/B , including all recursive calls. This is because there is space M/3 dedicated to both input sets and only I/Os for reading the input are required. By charging the cost of such subproblems to the writing of the inputs in the parent problem, we can focus on subproblems where the largest set (i.e., S̃) has size more than M/3. We notice that the cost of Steps 3–4 is dominated by other costs by our assumption that the set S̃ ′ fits in internal memory, which implies that it suffices to scan data once to implement these steps. This cost is clearly negligible with respect to the remaining steps and thus we ignore them. We first provide an upper bound on the I/O complexity required by all subproblems at a recursive level above ℓ. Let OSimJoin (R̃, S̃, i) be a recursive call at the i-th recursive level, for 0 ≤ i ≤ ℓ. The I/O cost of thenested loop join in Step 5 in OSimJoin (R̃, S̃, i) is O |S̃|/B + |R̃′ ||S̃|/(M B) by Theorem 2.   We can ignore the O |S̃|/B term since it is asymptotically negligible with respect to the cost of each iteration of Step 6, which is upper bounded later. By than |R̃′ ||S̃|/6 pairs, and thus Equation 1, we have that R̃′ ⊲⊳≤cr S̃ contains more   the cost of Step 5 in OSimJoin(R̃, S̃, i) is O |R̃′ ⊲⊳≤cr S̃|/(M B) . This means that we can bound the total I/O cost of all executions of Step 5 at level i of the recursion with O (Ci (R ⊲⊳≤cr S) /(M B)) since each near pair (x, y) appears in Ci ((x, y)) subproblems at level i. The second major part of the I/O complexity is the cost of preparing recursive calls in OSimJoin( R̃, S̃, i) (i.e.,   Steps 7–8). In fact, in each iteration of Step 6, the I/O cost is Õ (|R̃| + |S̃|)/B , which includes the cost of hashing and of sorting to form buckets. Since each point of R̃ and S̃ is replicated in L subproblems in Step 6, we have that each point of the initial sets R and S is replicated Li+1 times at level i. Since the average cost per entry is Õ (1/B), we have that the total cost for preparing recursive calls at level i is Õ N Li+1 /B . By summing the above terms, we have that the total I/O complexity of all subproblems in the i-th recursive level is upper bounded by: 12    R ⊲⊳ S C i  ≤cr N Li+1  . + Õ   MB B   (3) We now focus our analysis to bound the I/O complexity required by all subproblems at a recursive level below ℓ. Let again OSimJoin(R̃, S̃, i) be a recursive call at the i-th recursive level, for ℓ ≤ i ≤ Ψ . We observe that (part of) the cost of a subproblem at level i ≥ ℓ can be upper bounded by a suitable function of collisions among far points in OSimJoin (R̃, S̃, i). More specifically, consider an iteration of Step 6 in a subproblem at level i. Then, the cost for preparing the recursive calls and for performing Step 5 in each subproblem (at level i + 1) generated during the iteration, can be upper bounded as ! |R̃\R̃′ | + |S̃| |(R̃\R̃′ ) ⊲⊳≤cr S̃| Õ , + B BM since each near pair in (R̃\R̃′ ) ⊲⊳≤cr S̃ is found in Step 5 in at most one subproblem at level i + 1 generated during the iteration. Since we have that |(R̃\R̃′ ) ⊲⊳≤cr S̃| ≤ |R̃\R̃′ ||S̃|, we easily get  that the above bound can be rewrit- ten as Õ |R̃\R̃′ ||S̃|/(B min{M, |R̃\R̃′ |}) . We observe that this bound holds even when i = Ψ − 1: in this case the cost includes all I/Os required for solving the subproblems at level Ψ called in the iteration and which are solved using the nested loop in Theorem 2 (see Step 2). By Lemma 1, we have that the above quantity can  be upper bounded with the number of far  collisions between R̃ and ′ ′ S̃, getting Õ (|R̃\R̃ ⊲⊳>cr S̃|)/(B min{M, |R̃\R̃ |}) . Recall that Ci,k (Q) denotes the number of times a pair in Q is in a call to OSimJoin at the i-th level of recursion where the smallest input set has size in [2k , 2k+1 ) if 0 ≤ k < log M , and in [M, +∞) if k = log M . Then, the total cost for preparing the recursive calls in Steps 7–8 in all subproblems at level i and for performing Step 5 in all subproblems at level (i + 1) is:4 Õ log M X k=0 Ci,k (R ⊲⊳>cr S) L B2k ! . (4) The L factor in the above bound follows since far collisions at level i are used for amortizing the cost of Step 5 for each one of the L iterations of Step 6. To get the total I/O complexity of the algorithm we sum the I/O complexity required by each recursive level. We bound the cost of each level as follows: for a level i < ℓ we use the bound in Equation 3; for a level i > ℓ we use the bound 4 We note that the true input size of a subproblem is |R̃| and not |R̃\R̃′ |. However, the expected value of Ci,k (R ⊲⊳>cr S) is computed assuming the worst case where there are no close pairs an thus R̃′ = ∅. 13 in Equation 4; for level i = ℓ, we use the bound given in Equation 4 to which we add the first term in Equation 3 since the cost of Step 5 at level ℓ is not included in Equation 4 (note that the addition of Equations 3 and 4 gives a weak upper bound for level ℓ). The lemma follows. ⊓ ⊔ We will now analyze the expected sizes of the terms in Lemma 2. Clearly each pair from R × S is in the top level call, so the number of collisions is |R||S| < N 2 . But in lower levels we show that the expected number of times that a pair collides either decreases or increases geometrically, depending on whether the collision probability is smaller or larger than p1 (or equivalently, depending on whether the distance is greater or smaller than the radius r). The lemma follows by expressing the number of collisions of the pairs at the i-th recursive level as a Galton-Watson branching process [11]. Lemma 3. Given that A holds, for each 0 ≤ i ≤ Ψ we have 1. 2. 3. 4.   ≤ |R ⊲⊳ S| (p2 /p1 )i ; E Ci R ⊲⊳ S >cr >cr    ≤ |R ⊲⊳ S| ; E Ci R ⊲⊳ S >r,≤cr    >r,≤cr ≤ |R ⊲⊳ S| Li ; E Ci R ⊲⊳ S ≤r ≤r    ≤ N 2k+1 (p2 /p1 )i , for any 0 ≤ k < log M . E Ci,k R ⊲⊳ S  >cr Proof. Let x ∈ R and y ∈ S. We are interested in upper bounding the number of collisions of the pair at the i-th recursive level. We envision the problem as branching process (more specifically a GaltonWatson process, see e.g. [11]) where the expected number of children (i.e., recursive calls that preserve a particular collision) is Pr [h(x) = h(y)] /p1 for random h ∈ H. It is a standard fact from this theory that the expected population size at generation i (i.e., number of times (x, y) is in a problem at recursive level i) is (Pr [h(x) = h(y)] /p1 )i [11, Theorem 5.1]. If d(x, y) > cr, we have that Pr [h(x) = h(y)] ≤ p2 and each far pair appears at most (p2 /p1 )i times in expectation at level i, from which follows Equation 1. Moreover, since the probability of collisions is monotonic in the distance, we have that Pr [h(x) = h(y)] ≤ 1 if d(x, y) ≤ r, and Pr [h(x) = h(y)] ≤ p1 if r < d(x, y) ≤ cr, from which follow Equations 2 and 3. In order to get the last bound we observe that each entry of R and S is k+1 i replicated Li = p−i L is the total 1 times at level i. Thus, we have that N 2 maximum number of far collisions in subproblems at level i where the smallest input set has size in [2k , 2k+1 ). Each one of these collisions survives up to level i with probability pi2 , and thus the expected number of these collisions is N 2k+1 (p1 /p2 )i . ⊓ ⊔ We are now ready to prove the I/O complexity of OSimJoin as claimed in Theorem 1. By the linearity of expectation and Lemma 2, we get that the 14 expected I/O complexity of OSimJoin is         L M E Ci,k R ⊲⊳ S ℓ E Ci R ⊲⊳ S Ψ −1 log X X  N Lℓ X >cr ≤cr  , Õ  + +  B  k M B B2 i=0 i=ℓ k=0 where ℓ = ⌈log1/p2 (N/M )⌉. Note that Ci,log M (R ⊲⊳>cr S) ≤ Ci (R ⊲⊳>cr S) we have |R ⊲⊳>cr S| ≤ N 2 and Ci (R ⊲⊳≤cr S) = Ci (R ⊲⊳≤r S) + Ci (R ⊲⊳>r,≤cr S). By plugging in the bounds on the expected number of collisions given in Lemma 3, we get the claimed result. Analysis of Correctness. The following lemma shows that OSimJoin outputs with probability 1 − O (1/N ) all near pairs, as claimed in Theorem 1.   Lemma 4. Let R, S ⊆ U and |R| + |S| = N . Executing O log3/2 N indepen- dent repetitions of OSimJoin(R,S,0) outputs R ⊲⊳≤r S with probability at least 1 − O (1/N ). Proof.√ We now argue that a pair (x, y) with d(x, y) ≤ r is output with probability Ω(1/ log N ). Let Xi = Ci ((x, y)) be the number of subproblems at the level i containing (x, y). By applying Galton-Watson branching process, we get that E [Xi ] = (Pr [h(x) = h(y)] /p1 )i . If Pr [h(x) = h(y)] /p1 > 1 then in fact there is positive constant probability that (x, y) survives indefinitely, i.e., does not go extinct [11]. Since at every branch of the recursion we eventually compare points that collide under all hash functions on the path from the root call, this implies that (x, y) is reported with a positive constant probability. In the critical case where Pr [h(x) = h(y)] /p1 = 1 we need to consider the variance of Xi , which by [11, Theorem 5.1] is equal to iσ 2 , where σ 2 is the variance of the number of children (hash collisions in recursive calls). If 1/p1 is integer, the number of children in our branching process follows a binomial distribution with mean 1. This implies that σ 2 < 1. Also in the case where 1/p1 is not integer, it is easy to see that the variance is bounded by 2. That is, we have Var √ (Xi ) ≤ 2i, which by Chebychev’s inequality means that for some integer j ∗ = 2 i + O (1): ∞ X j=j ∗ Pr [Xi ≥ j] ≤ ∞ X j=j ∗ Var (Xi ) /j 2 ≤ 1/2 . P∞ Pj ∗ −1 Since we have E [Xi ] = j=1 Pr [Xi ≥ j] = 1 then j=1 Pr [Xi ≥ j] > 1/2, and since Pr [Xi √ ≥ j] is non-increasing with j this implies that Pr [Xi ≥ 1] ≥ 1/(2j ∗ ) = Ω 1/ i . Furthermore, the recursion depth O (log N ) implies  the   √ probability that a near pair is found is Ω 1/ log N . Thus, by repeating O log3/2 N  times we can make the error probability O 1/N 3 for a particular pair and O (1/N ) for the entire output by applying the union bound. 15 3.4 Removing duplicates Given two near points x and y, the definition of LSH requires their collision probability p(x, y) = Pr [h(x) = h(y)] ≥ p1 . If p(x, y) ≫ p1 , our OSimJoin algorithm can emit (x, y) many times. As an example suppose that the algorithm ends in one recursive call: then, the pair (x, y) is expected to be in the same bucket for p(x, y)L iterations of Step 6 and thus it is emitted p(x, y)L ≫ 1 times in expectation. Moreover, if the pair is not emitted in the first recursive level, the expected number of emitted pairs increases as (p(x, y)L)i since the pair (x, y) is contained in (p(x, y)L)i subproblems at the i-th recursive level. A simple solution requires to store all emitted near pairs on the external memory, and then using a cache-oblivious sorting algorithm [9] for removing repetitions.   |R⊲⊳ S| I/Os, where κ is the expected However, this approach requires Õ κ B≤r average replication of each emitted pair, which can dominate the complexity of OSimJoin. A similar issue appears in the cache-aware algorithm ASimJoin as well: a near pair is emitted at most L′ = (N/M )ρ times since there is no recursion and the partitioning of the two input sets is repeated only L′ times. If the collision probability Pr [h(x) = h(y)] can be explicitly computed in O (1) time and no I/Os for each pair (x, y), it is possible to emit each near pair once in expectation without storing near pairs on the external memory. We note that the collision probability can be computed for many metrics, including Hamming [14], ℓ1 and ℓ2 [7], Jaccard [4], and angular [5] distances. For the cache-oblivious algorithm, the approach is the following: for each near pair (x, y) that is found at the i-th recursive level, with i ≥ 0, the pair is emitted with probability 1/(p(x, y)L)i ; otherwise, we ignore it. For the cache-aware algorithm, the idea is the same but a near pair is emitted with probability 1/(p(x, y)L′ ) with L′ = (N/M )ρ . Theorem 4. The above approaches guarantee that each near pair is emitted with constant probability in both ASimJoin and OSimJoin. Proof. The claim easily follows for the cache-aware algorithm: indeed the two points of a near pair (x, y) have the same hash value in p(x, y)L (in expectation) of the L′ = (N/M )ρ repetitions of Step 3. Therefore, by emitting the pair with probability 1/(p(x, y)L) we get the claim. We now focus on the cache-oblivious algorithm, where the claim requires a more articulated proof. Given a near pair (x, y), let Gi and Hi be random variables denoting respectively the number of subproblems at level i containing the pair (x, y), and the number of subproblems at level i where (x, y) is not found by the cache-oblivious nested loop join algorithm in Theorem 2. Let also Ki be a random variable denoting the actual number of times the pair (x, y) is emitted at level i. We have followings properties: 1. E [Ki |Gi , Hi ] = (Gi − Hi )/(p(x, y)L)i since a near pair is emitted with probability 1/(p(x, y)L)i only in those subproblems where the pair is found by the join algorithm. 16 2. E [Gi ] = (p(x, y)L)i since a near pair is in the same bucket with probability p(x, y)i (it follows from the previous analysis based on standard branching). 3. G0 = 1 since each pair exists at the beginning of the algorithm. 4. HΨ = 0 since each pair surviving up to the last recursive level is found by the nested loop join algorithm. i hP Ψ We are interested in upper bounding E i=0 Ki by induction that E " l X i=0 # Ki = 1 − E [Hl ] , (p(x, y)L)l for any 0 ≤ l ≤ Ψ . For l = 0 (i.e., the first call to OSimJoin) and note that E [G0 ] = G0 = 1, the equality is verified since E [K0 ] = E [E [K0 |G0 , H0 ]] = E [G0 − H0 ] = 1 − E [H0 ] . We now consider a generic level l > 0. Since a pair propagates in a lower recursive level with probability p(x, y), we have E [Gl ] = E [E [Gl |Hl−1 ]] = p(x, y)LE [Hl−1 ] . Thus,  Gl − Hl E [Kl ] = E [E [Kl |Gl , Hl ]] = E (p(x, y)L)l E [Hℓ−1 ] E [Hℓ ] = − (p(x, y)L)l−1 (p(x, y)L)l  . By exploiting the inductive hypothesis, we get E " l X i=0 # Ki = E [Kl ] + E Since HΨ = 0, we have E " l−1 X i=0 hP Ψ i=0 i # Ki = 1 − E [Hl ] . (p(x, y)L)l Ki = 1 and the claim follows. ⊓ ⊔ We observe that the proposed approach is equivalent to use an LSH where p(x, y) = p1 for each near pair. Finally, we remark that this approach does not avoid replica of the same near pair when the algorithm is repeated for increasing the collision of near pairs. Thus, the probability of emitting  probability  a pair is  √  at least Ω 1/ Ψ as shown in the second part of Section 3.3 and O log3/2 N repetitions of OSimJoin suffices to find all pairs with high probability (however,   the expected number of replica of a given near pair becomes O log3/2 N , even with the proposed approach). 17 4 Discussion We will argue informally that our I/O complexity of Theorem 1 is close to the optimal. For simple arguments, we split the I/O complexity of our algorithms in two parts:    ρ |R ⊲⊳ S| N N ≤r  + , T1 = M B MB T2 = |R ⊲⊳ S| ≤cr MB . We now argue that T1 I/Os are necessary. First, notice that we need O (N/B) I/Os per hash function for transferring data between memories, computing and writing hash values to disk to find collisions. Second, since each I/O brings at most B points in order to compute the distance with M points residing in the internal memory, we need N/B I/Os to examine M N pairs. This means that when the collision probability of far pairs p2 ≤ M/N and the number of collisions of far pairs is at most M N in expectation, we only need O (N/B)  I/Os to detect such far pairs. Now we consider the case where there are Ω N 2 pairs at distance cr. Due to the monotonicity of LSH family, the collision probability for each such pair must be O (M/N ) to ensure that O (N/B) I/Os suffices to examine such pairs. In turn, this means that the collision probability for near pairs within distance r must be at most O ((M/N )ρ ). So we need Ω ((N/M )ρ ) repetitions (different hash functions) to expect at least one collision for any near pair. Then, a worst-case data set can be given so that we might need to examine, for each of the Ω ((N/M )ρ ) hash functions, a constant fraction the pairs in R ⊲⊳≤r S whose collision probability is constant. For example, this can happen if R and S include two clusters of very near points. One could speculate that some pairs could be marked as “finished” during computation such that we do not have to compute their distances again. However, it seems hard to make this idea work for an arbitrary distance measure where there may be very little structure for the output set, hence the O (|R ⊲⊳≤r S|/(M B)) additional I/Os per repetition is needed. In order to argue that the term T2 is needed, we consider the case where all pairs in R ⊲⊳≤cr S have distance r + ε for a value ε small enough to make the collision probability of pair at distance r + ε indistinguishable from the collision probability of pair at distance r. Then every pair in R ⊲⊳≤cr S must be brought into the internal memory to ensure the correct result, which requires T2 I/Os. This holds for any algorithm enumerating or listing the near pairs. Therefore, there does not exist an algorithm that beats the quadratic dependency on N for such worst-case input sets, unless the distribution of the input is known beforehand. However, when |R ⊲⊳≤cr S| is subquadratic regarding N , a potential approach to achieve subquadratic dependency in expectation for similarity join problem is filtering invalid pairs based on their distances — currently LSH-based method is the only way to do this. 18 0 0 10 CDF of pairwise distances CDF of pairwise similarities 10 −1 10 −2 10 −3 10 −4 10 Jaccard similarity Cosine similarity −5 10 0 10 −1 10 −2 −3 10 −2 10 −3 10 −4 10 −5 −4 10 L1 distance L2 distance −1 10 10 10 2 10 3 10 4 10 Jaccard and cosine similarity L1 and L2 distance (a) Enron email dataset (b) MNIST dataset 5 10 Fig. 1. The cumulative distributions of pairwise similarities and pairwise distances on samples of 10,000 points from Enron Email and MNIST datasets. We note that values decrease on the x-axis of Figure 1.a, while they increase in Figure 1.b. Note that when M = N our I/O cost is O (N/B) as we would expect, since just reading the input is optimal. At the other extreme, when B = M = 1 our bound matches the time complexity of internal memory techniques. When |R ⊲⊳≤cr S| are bounded by M N then our algorithm achieves subquadratic dependency on N/M . Such an assumption is realistic in some real-world datasets as shown in the experimental evaluation section. To complement the above discussion we will evaluate our complexity by computing explicit constants and then evaluating the total number of I/Os spent by analyzing real datasets. Performing these “simulated experiments” has the advantage over real experiments that we are not impacted by any properties of a physical machine. We again split the I/O complexity of our algorithms in two parts:    ρ |R ⊲⊳ S| N N ≤r  +  T1 = M B MB T2 = |R ⊲⊳ S| ≤cr MB and carry out experiments to demonstrate that the first term T1 often dominates the second term T2 in real datasets. In particular, we depict the cumulative distribution function (cdf) in log-log scale of all pairwise distances (i.e., ℓ1 , ℓ2 ) and all pairwise similarities (i.e., Jaccard and cosine) on two commonly used datasets: Enron Email5 and MNIST6 , as shown in Figure 1. Since the Enron data set does not have a fixed data size per point, we consider a version of the data set where the dimension has been reduced such that each vector has a fixed size. 5 6 https://archive.ics.uci.edu/ml/datasets/Bag+of+Words http://yann.lecun.com/exdb/mnist/ 19 |R ⊲⊳ S| Data set Metric r cr Enron Jaccard 0.5 0.1 Enron Cosine 0.7 0.2 MNIST L1 3000 6000 ≤r |R ⊲⊳ S| ≤cr ρ N N 0.30 1.8 · 103 16 · 103 0.51 1.6 · 103 16 · 103 0.50 1.8 42 Standard LSH > 7.5 · 109 I/Os > 212 · 109 I/Os > 29 · 106 I/Os Nested loop ASimJoin 8 · 109 I/Os 3.2 · 109 I/Os 8 · 109 I/Os 6.6 · 109 I/Os 60 · 106 I/Os 12 · 106 I/Os Fig. 2. A comparison of I/O cost for similarity joins on the standard LSH, nested loop and ASimJoin algorithms. Figure 1.a shows an inverse polynomial relationship with a small exponent m between similarity threshold s and the number of pairwise similarities greater than s. The degree of the polynomial is particularly low when s > 0.5. This setting s > 0.5 is commonly used in many applications for both Jaccard and cosine similarities [2, 3, 19]. Similarly, Figure 1.b also shows a monomial relationship between the distance threshold r and the number of pairwise distances smaller than r. In turn, this means that the number of c-near pairs |R ⊲⊳≤cr S| is not much greater than cm |R ⊲⊳≤r S|. In other words, the second term T2 is often much smaller than the first term T1 . Finally, for the same data sets and metrics, we simulated the cache-aware algorithm with explicit constants and examined the I/Os cost to compare with a standard nested loop method (Section 2) and a lower bound on the standard LSH method (Section 2). We set the cache size M = N/1000, which is reasonable for judging a number of cache misses since the size ratio between CPU caches and RAM is in that order of magnitude. In general such setting allows us to investigate what happens when the data size is much larger than fast memory. For simplicity we use B = 1 since all methods contain a multiplicative factor 1/B on the I/O complexity. The values of ρ were computed using good LSH families for the specific metric and parameters r and c. These parameters are picked according to Figure 1 such that the number of c-near pairs are only an order of magnitude larger than the number of near pairs. The I/O complexity used for nested loop join is 2N + N 2 /M B (here we assume both sets have size N ) and the complexity for the standard LSH approach is lower bounded by sort N 1+ρ . This complexity is a lower bound on the standard sorting based approaches as it lacks the additional cost that depends on how LSH distributes the points. Since M = N/1000 we can bound the log-factor of the sorting complexity and use sort (N ) ≤ 8N since 2N points read and written twice. The I/O complexity of our approach is stated in Theorem 3. The computed I/O-values in Figure 2 show that the complexity of our algorithm is lower than that of all instances examined. Nested loop suffers from quadratic dependency on N , while the standard LSH bounds lack the dependency on M . Overall the I/O cost indicates that our cache-aware algorithm is practical on the examined data sets. 20 5 Conclusion In this paper we examine the problem of computing the similarity join of two relations in an external memory setting. Our new cache-aware algorithm of Section 3.1 and cache-oblivious algorithm of Section 3.2 improve upon current state of the art by around a factor of (M/B)ρ I/Os unless the number of c-near pairs is huge (more than N M ). We believe this is the first cache-oblivious algorithm for similarity join, and more importantly the first subquadratic algorithm whose I/O performance improves significantly when the size of internal memory grows. It would be interesting to investigate if our cache-oblivious approach is also practical — this might require adjusting parameters such as L. Our I/O bound is probably not easy to improve significantly, but interesting open problems are to remove the error probability of the algorithm and to improve the implicit dependence on dimension in B and M . Note that our work assumes for simplicity that the unit of M and B is number of points, but in general we may get tighter bounds by taking into account the gap between the space required to store a point and the space for hash values. Also, the result in this paper is made with general spaces in mind and it is an interesting direction to examine if the dependence on dimension could be made explicit and improved in specific spaces. References 1. Alexandr Andoni and Piotr Indyk. Near-optimal hashing algorithms for approximate nearest neighbor in high dimensions. In Proceedings of FOCS’06, pages 459–468, 2006. 2. Arvind Arasu, Venkatesh Ganti, and Raghav Kaushik. Efficient exact set-similarity joins. In Proceedings of VLDB’06, pages 918–929, 2006. 3. Roberto J. Bayardo, Yiming Ma, and Ramakrishnan Srikant. Scaling up all pairs similarity search. In Proceedings of WWW’07, pages 131–140, 2007. 4. Andrei Z. Broder, Steven C. Glassman, Mark S. Manasse, and Geoffrey Zweig. Syntactic clustering of the web. Computer Networks, 29(8-13):1157–1166, 1997. 5. Moses S. Charikar. Similarity estimation techniques from rounding algorithms. In Proceedings of STOC’02, pages 380–388, 2002. 6. Surajit Chaudhuri, Venkatesh Ganti, and Raghav Kaushik. A primitive operator for similarity joins in data cleaning. In Proceedings of ICDE’06, page 5, 2006. 7. Mayur Datar, Nicole Immorlica, Piotr Indyk, and Vahab S. Mirrokni. Localitysensitive hashing scheme based on p-stable distributions. In Proceedings of SOCG’04, pages 253–262, 2004. 8. Devdatt P. Dubhashi and Alessandro Panconesi. Concentration of Measure for the Analysis of Randomized Algorithms. Cambridge University Press, 2009. 9. Matteo Frigo, Charles E Leiserson, Harald Prokop, and Sridhar Ramachandran. Cache-oblivious algorithms. In Proceedings of FOCS’99, pages 285–297, 1999. 10. Aristides Gionis, Piotr Indyk, and Rajeev Motwani. Similarity search in high dimensions via hashing. In Proceedings of VLDB’99, pages 518–529, 1999. 11. Theodore E Harris. The theory of branching processes. Courier Dover Publications, 2002. 12. Bingsheng He and Qiong Luo. Cache-oblivious nested-loop joins. In Proceedings of CIKM’06, pages 718–727, 2006. 21 13. Monika Rauch Henzinger. Finding near-duplicate web pages: a large-scale evaluation of algorithms. In Proceedings of SIGIR’06, pages 284–291, 2006. 14. Piotr Indyk and Rajeev Motwani. Approximate nearest neighbors: Towards removing the curse of dimensionality. In Proceedings of STOC’98, pages 604–613, 1998. 15. Hung Q. Ngo, Christopher Ré, and Atri Rudra. Skew strikes back: new developments in the theory of join algorithms. SIGMOD Record, 42(4):5–16, 2013. 16. Andrzej Pacuk, Piotr Sankowski, Karol Wegrzycki, and Piotr Wygocki. Localitysensitive hashing without false negatives for l p. In Proceedings of COCOON’16, pages 105–118, 2016. 17. Rasmus Pagh. Locality-sensitive hashing without false negatives. In Proceedings of SODA’16, pages 1–9, 2016. 18. Jeffrey Scott Vitter. Algorithms and Data Structures for External Memory. Now Publishers Inc., 2008. 19. Chuan Xiao, Wei Wang, Xuemin Lin, and Jeffrey Xu Yu. Efficient similarity joins for near duplicate detection. In Proceedings of WWW’08, pages 131–140, 2008. 20. Mihalis Yannakakis. Algorithms for acyclic database schemes. In Proceedings of VLDB’81, pages 82–94, 1981. 22
8cs.DS
arXiv:1207.0612v2 [math.AC] 21 Jan 2013 COMPLETION BY DERIVED DOUBLE CENTRALIZER MARCO PORTA, LIRAN SHAUL AND AMNON YEKUTIELI Abstract. Let A be a commutative ring, and let a be a weakly proregular ideal in A. (If A is noetherian then any ideal in it is weakly proregular.) Suppose M is a compact generator of the category of cohomologically a-torsion complexes. We prove that the derived double centralizer of M is isomorphic to the a-adic completion of A. The proof relies on the MGM equivalence from [PSY] and on derived Morita equivalence. Our result extends earlier work of Dwyer-Greenlees-Iyengar [DGI] and Efimov [Ef]. 0. Introduction Let A be a commutative ring. We denote by D(Mod A) the derived category of A-modules. Given M ∈ D(Mod A) we define M (0.1) ExtA (M ) := HomD(Mod A) (M, M [i]). i∈Z This is a graded A-algebra with the Yoneda multiplication, which we call the Ext algebra of M . Suppose we choose a K-projective resolution P → M . The resulting DG Aalgebra B := EndA (P ) is called a derived endomorphism DG algebra of M . It turns out (see Proposition 2.3) that the DG algebra B is unique up to quasiL i isomorphism; and of course its cohomology H(B) := i∈Z H (B) is canonically isomorphic to ExtA (M ) as graded A-algebra. Consider the derived category D̃(DGMod B) of left DG B-modules. We can view P as an object of D̃(DGMod B), and thus, like in (0.1), we get the graded Aalgebra ExtB (P ). This is the derived double centralizer algebra of M . By Corollary 2.4, the graded algebra ExtB (P ) is independent of the resolution P → M , up to isomorphism. Let a be an ideal in A. The a-torsion functor Γa can be right derived, giving a triangulated functor RΓa from D(Mod A) to itself. A complex M ∈ D(Mod A) is called a cohomologically a-torsion complex if the canonical morphism RΓa (M ) → M is an isomorphism. The full triangulated category on the cohomologically torsion complexes is denoted by D(Mod A)a-tor . It is known that when a is finitely generated, the category D(Mod A)a-tor is compactly generated (for instance by the Koszul complex K(A; a) associated to a finite generating sequence a = (a1 , . . . , an ) of a). Date: 11 December 2012. Key words and phrases. Adic completion, derived functors, derived Morita theory. Mathematics Subject Classification 2010. Primary: 13D07; Secondary: 13B35, 13C12, 13D09, 18E30. This research was supported by the Israel Science Foundation and the Center for Advanced Studies at BGU. 1 2 MARCO PORTA, LIRAN SHAUL AND AMNON YEKUTIELI b the a-adic completion of A. This is a commutative A-algebra, Let us denote by A b If a is finitely generated, then the ring A b is and in it there is the ideal b a := a · A. b a-adically complete. A weakly proregular sequence in A is a finite sequence a of elements of A, whose Koszul cohomology satisfies certain vanishing conditions; see Definition 1.2. This concept was introduced by Alonso-Jeremias-Lipman [AJL] and Schenzel [Sc]. An ideal a in A is called weakly proregular if it can be generated by a weakly proregular sequence. It is important to note that if A is noetherian, then any finite sequence in it is weakly proregular, so that any ideal in A is weakly proregular. But there are some fairly natural non-noetherian examples (see [AJL, Example 3.0(b)] and [PSY, Example 4.35]). Here is our main result (repeated as Theorem 4.2 in the body of the paper). Theorem 0.2. Let A be a commutative ring, let a be a weakly proregular ideal in A, and let M be a compact generator of D(Mod A)a-tor . Choose a K-projective resolution P → M , and define B := EndA (P ). Then there is a unique isomorphism b of graded A-algebras ExtB (P ) ∼ = A. Our result extends earlier work of Dwyer-Greenlees-Iyengar [DGI] and Efimov [Ef]; see Remark 4.8 for a discussion. Let us say a few words on the proof of Theorem 0.2. We use derived Morita theory to find an isomorphism of graded algebras between ExtB (P ) and ExtA (N )op , where N := RΓa (A). The necessary facts about derived Morita theory are recalled in Section 3. We then use MGM equivalence (recalled in Section 1) to prove that b b ∼ ExtA (N ) ∼ = A. = ExtA (A) Acknowledgments. We wish to thank Bernhard Keller, John Greenlees, Alexander Efimov, Maxim Kontsevich, Vladimir Hinich and Peter Jørgensen for helpful discussions. We are also grateful to the anonymous referee for a careful reading of the paper and constructive remarks. 1. Weak Proregularity and MGM Equivalence Let A be a commutative ring, and let a be an ideal in it. (We do not assume that A is noetherian or a-adically complete.) There are two operations on A-modules associated to this data: the a-adic completion and the a-torsion. For an A-module c := lim←i M/ai M . An M its a-adic completion is the A-module Λa (M ) = M i element m ∈ M is called an a-torsion element if a m = 0 for i ≫ 0. The a-torsion elements form the a-torsion submodule Γa (M ) of M . Let us denote by Mod A the category of A-modules. So we have additive functors Λa and Γa from Mod A to itself. The functor Γa is left exact; whereas Λa is neither left exact nor right exact. An A-module is called a-adically complete if the canonical homomorphism τM : M → Λa (M ) is bijective (some texts would say that M is complete and separated); and M is a-torsion if the canonical homomorphism σM : Γa (M ) → M is bijective. If the ideal a is finitely generated, then the functor Λa is idempotent; namely for any module M , its completion Λa (M ) is a-adically complete. (There are counterexamples to that for infinitely generated ideals – see [Ye, Example 1.8].) The derived category of Mod A is denoted by D(Mod A). The derived functors LΛa , RΓa : D(Mod A) → D(Mod A) COMPLETION BY DERIVED DOUBLE CENTRALIZER 3 exist. The left derived functor LΛa is constructed using K-flat resolutions, and the right derived functor RΓa is constructed using K-injective resolutions. This means that for any K-flat complex P , the canonical morphism ξP : LΛa (P ) → Λa (P ) is an isomorphism; and for any K-injective complex I, the canonical morphism ξI : Γa (I) → RΓa (I) is an isomorphism. The relationship between the derived functors RΓa and LΛa was first studied in [AJL], where the Greenlees-May duality was established (following the paper [GM]). A complex M ∈ D(Mod A) is called a cohomologically a-torsion complex if R the canonical morphism σM : RΓa (M ) → M is an isomorphism. The complex M is called a cohomologically a-adically complete complex if the canonical morL phism τM : M → LΛa (M ) is an isomorphism. We denote by D(Mod A)a-tor and D(Mod A)a-com the full subcategories of D(Mod A) consisting of cohomologically atorsion complexes and cohomologically a-adically complete complexes, respectively. These are triangulated subcategories. Very little can be said about the functors LΛa and RΓa , and about the corresponding triangulated categories D(Mod A)a-tor and D(Mod A)a-com , in general. However we know a lot when the ideal a is weakly proregular. Before defining weak proregularity we have to talk about Koszul complexes. Recall that for an element a ∈ A the Koszul complex is  a· K(A; a) := · · · → 0 → A −→ A → 0 → · · · , concentrated in degrees −1 and 0. Given a finite sequence a = (a1 , . . . , an ) of elements of A, the Koszul complex associated to this sequence is K(A; a) := K(A; a1 ) ⊗A · · · ⊗A K(A; an ). This is a complex of finitely generated free A-modules, concentrated in degrees −n, . . . , 0. There is a canonical isomorphism of A-modules H0 (K(A; a)) ∼ = A/(a), where (a) is the ideal generated by the sequence a. For any i ≥ 1 let ai := (ai1 , . . . , ain ). If j ≥ i then there is a canonical homomorphism of complexes pj,i : K(A; aj ) → K(A; ai ), which in H0 corresponds to the surjection A/(aj ) → A/(ai ). Thus for every k ∈ Z we get an inverse system of A-modules  k (1.1) H (K(A; ai )) i∈N , with transition homomorphisms Hk (pj,i ) : Hk (K(A; aj )) → Hk (K(A; ai )). Of course for k = 0 the inverse limit equals the (a)-adic completion of A. What turns out to be crucial is the behavior of this inverse system for k < 0. For more details please see [PSY, Section 4]. An inverse system {Mi }i∈N of abelian groups, with transition maps pj,i : Mj → Mi , is called pro-zero if for every i there exists j ≥ i such that pj,i is zero. Definition 1.2. (1) Let a be a finite sequence in A. The sequence a is called a weakly proregular sequence if for every k ≤ −1 the inverse system (1.1) is pro-zero. (2) An ideal a in A is called a a weakly proregular ideal if it is generated by some weakly proregular sequence. The etymology of the name “weakly proregular sequence”, and the history of related concepts, are explained in [AJL] and [Sc]. 4 MARCO PORTA, LIRAN SHAUL AND AMNON YEKUTIELI If a is a regular sequence, then it is weakly proregular. More important is the following result. Theorem 1.3 ([AJL]). If A is noetherian, then every finite sequence in A is weakly proregular, so that every ideal in A is weakly proregular. Here is another useful fact. Theorem 1.4 ([Sc]). Let a be a weakly proregular ideal in a ring A. Then any finite sequence that generates a is weakly proregular. These theorems are repeated (with different proofs) as [PSY, Theorem 4.34] and [PSY, Corollary 6.3] respectively. As the next theorem shows, weak proregularity is the correct condition for the derived torsion functor to be “well-behaved”. Suppose a is a finite sequence that generates the ideal a ⊂ A. Consider the infinite dual Koszul complex  i K∨ ∞ (A; a) := lim HomA K(A; a ), A . i→ Given a complex M , there is a canonical morphism RΓa (M ) → K∨ ∞ (A; a) ⊗A M (1.5) in D(Mod A). Theorem 1.6 ([Sc]). The sequence a is weakly proregular iff the morphism (1.5) is an isomorphism for every M ∈ D(Mod A). The following theorem, which is [PSY, Theorem 1.1], plays a central role in our work. Theorem 1.7 (MGM Equivalence). Let A be a commutative ring, and a a weakly proregular ideal in it. (1) For any M ∈ D(Mod A) one has RΓa (M ) ∈ D(Mod A)a-tor and LΛa (M ) ∈ D(Mod A)a-com . (2) The functor RΓa : D(Mod A)a-com → D(Mod A)a-tor is an equivalence, with quasi-inverse LΛa . Remark 1.8. Slightly weaker versions of Theorem 1.7 appeared previously; they are [AJL, Theorem (0.3)∗ ] and [Sc, Theorem 4.5]. The difference is that in these earlier results it was assumed that the ideal a is generated by a sequence (a1 , . . . , an ) that is weakly proregular, and moreover each ai has bounded torsion. This extra condition certainly holds when A is noetherian. For the sake of convenience, in the present paper we quote [PSY] regarding derived completion and torsion. It is tacitly understood that in the noetherian case the results of [AJL] and [Sc] suffice. 2. The Derived Double Centralizer In this section we define the derived double centralizer of a DG module. See Remarks 2.6 and 2.7 for a discussion of this concept L and related literature. Let K be a commutative ring, and let A = i∈Z Ai be a DG K-algebra (associative and unital, but not necessarily commutative). Given left DG A-modules M COMPLETION BY DERIVED DOUBLE CENTRALIZER 5 and N , we denote by HomiA (M, N ) the K-module of A-linear homomorphisms of degree i. We get a DG K-module M HomA (M, N ) := HomiA (M, N ) i∈Z with the usual differential. The object EndA (M ) := HomA (M, M ) is a DG K-algebra. Since the left actions of A and EndA (M ) on M commute, we see that M is a left DG module over the DG algebra A ⊗K EndA (M ). The category of left DG A-modules is denoted by DGMod A. The set of morphisms HomDGMod A (M, N ) is precisely the set of 0-cocycles in the DG K-module HomA (M, N ). Note that DGMod A is a K-linear abelian category. Let K̃(DGMod A) be the homotopy category of DGMod A, so that  HomK̃(DGMod A) (M, N ) = H0 HomA (M, N ) . The derived category D̃(DGMod A) is gotten by inverting the quasi-isomorphisms in K̃(DGMod A). The categories K̃(DGMod A) and D̃(DGMod A) are K-linear and triangulated. If A happens to be a ring (i.e. Ai = 0 for i 6= 0) then DGMod A = C(Mod A), the category of complexes in Mod A, and D̃(DGMod A) = D(Mod A), the usual derived category. For M, N ∈ DGMod A we define ExtiA (M, N ) := HomD̃(DGMod A) (M, N [i]) and ExtA (M, N ) := M ExtiA (M, N ). i∈Z Definition 2.1. Let A be a DG K-algebra and M ∈ DGMod A. Define ExtA (M ) := ExtA (M, M ). This is a graded K-algebra with the Yoneda multiplication (i.e. composition of morphisms in D̃(DGMod A)). We call ExtA (M ) the Ext algebra of M . There is a canonical homomorphism of graded K-algebras H(EndA (M )) → ExtA (M ). If M is either K-projective or K-injective, then this homomorphism is bijective. Definition 2.2. Let A be a DG K-algebra and M a DG A-module. Choose a K-projective resolution P → M in DGMod A. The DG K-algebra B := EndA (P ) is called a derived endomorphism DG algebra of M . Note that there are isomorphisms of graded K-algebras H(B) ∼ = ExtA (P ) ∼ = ExtA (M ). The dependence of the derived endomorphism DG algebra B = EndA (P ) on the resolution P → M is explained in the next proposition. Proposition 2.3. Let M be a DG A-module, and let P → M and P ′ → M be K-projective resolutions in DGMod A. Define B := EndA (P ) and B ′ := EndA (P ′ ). Then there is a DG K-algebra B ′′ , and a DG B ′′ -module P ′′ , with DG K-algebra quasi-isomorphisms B ′′ → B and B ′′ → B ′ , and DG B ′′ -module quasi-isomorphisms P ′′ → P and P ′′ → P ′ . 6 MARCO PORTA, LIRAN SHAUL AND AMNON YEKUTIELI Proof. Choose a quasi-isomorphism φ : P ′ → P in DGMod A lifting the given quasiisomorphisms to M ; this can be done of course. Let L := cone(φ) i∈ h P ′ DGMod A, the mapping cone of φ. So as graded A-module L = P ⊕ P [1] = P ′ [1] ; h i d φ and the differential is dL = 0P dP ′ [1] , where φ is viewed as a degree 1 homomorphism P ′ [1] → P . Of course L is an acyclic DG module. Takeh Q :=iHomA (P ′ [1], P ), and let B ′′ be the triangular matrix graded algebra B ′′ := B Q 0 B′ with the obvious matrix multiplication. This makes sense because there is a canonical isomorphism of DG algebras B ′ ∼ = EndA (P ′ [1]). Note that ′′ ′′ B is a subalgebra of EndA (L). We make B into a DG algebra with differential dB ′′ := dEndA (L) |B ′′ . The projections B ′′ → B and B ′′ → B ′ on the diagonal entries are DG algebra quasi-isomorphisms, because their kernels are the acyclic complexes HomA (P ′ [1], L) and HomA (L, P ) respectively. Now under the restriction functor DGMod(B) → DGMod(B ′′ ) we have P 7→ [ P0 ],  0  ′ and likewise P 7→ P ′ . Consider the exact sequence i h 0 → [ P0 ] → L → P ′0[1] → 0   χ △ → [ P0 ] → L − → in in DGMod(B ′′ ). There is an induced distinguished triangle P0′ − D̃(DGMod(B ′′ )). But L is acyclic, so χ is an isomorphism.   Finally let us choose a K-projective resolution P ′′ → P0′ in DGMod(B ′′ ). Then χ induces a quasi-isomorphism P ′′ → [ P0 ] in DGMod(B ′′ ).  Corollary 2.4. In the situation of Proposition 2.3, there is an isomorphism of graded K-algebras ExtB (P ) ∼ = ExtB ′ (P ′ ). Proof. Since B ′′ → B is a quasi-isomorphism of DG algebras, it follows that the restriction functor D̃(DGMod(B)) → D̃(DGMod(B ′′ )) is an equivalence of triangulated categories. Therefore we get an induced isomorphism of graded K≃ algebras ExtB (P ) − → ExtB ′′ (P ′′ ). Similarly we get a graded K-algebra isomorphism ≃  → ExtB ′′ (P ′′ ). ExtB ′ (P ′ ) − Definition 2.5. Let M be a DG A-module, and let P → M be a K-projective resolution in DGMod A. The graded K-algebra ExtB (P ) is called a derived double centralizer of M . Remark 2.6. The uniqueness of the graded K-algebra ExtB (P ) provided by Corollary 2.4 is sufficient for the purposes of this paper (see Theorem 0.2). It is possible to show by a more detailed calculation that the isomorphism provided by Corollary 2.4 is in fact canonical (it does not depend on the choices made in the proof of Proposition 2.3, e.g. the quasi-isomorphism φ). Let us choose a K-projective resolution Q → P in DGMod(B), and define the DG algebra C := EndB (Q). Then C should be called a double endomorphism DG algebra of M . Of course H(C) ∼ = ExtB (P ) as graded algebras. There should be a canonical DG algebra homomorphism A → C. We tried to work out a comprehensive treatment of derived endomorphism algebras and their iterates, using the old-fashioned methods, and did not get very far (hence it is not included in the paper). We expect that a full treatment is only possible in terms of ∞-categories. COMPLETION BY DERIVED DOUBLE CENTRALIZER 7 Remark 2.7. Derived endomorphism DG algebras (and the double derived ones) were treated in several earlier the papers, including [DGI], [Jo] and [Ef]. These papers do not mention any uniqueness properties of these DG algebras; indeed, as far as we can tell, they just pick a convenient resolution P → M , and work with the DG algebra EndA (P ). Cf. Subsection 1.5 of [DGI] where this issue is briefly discussed. The most detailed treatment of derived endomorphism DG algebras that we know is in Keller’s paper [Ke]. In [Ke, Section 7.3] the concept of a lift of a DG module is introduced. The pair (B, P ) from Definition 2.2 is called a standard lift in [Ke]. It is proved that lifts are unique up to quasi-isomorphism (this is basically what is done in our Proposition 2.3); but there is no statement regarding uniqueness of these quasi-isomorphisms. Also there is no discussion of derived double centralizers. 3. Supplement on Derived Morita Equivalence Derived Morita theory goes back to Rickard’s paper [Ri], which dealt with rings and two-sided tilting complexes. Further generalizations can be found in [Ke, BV, Jo]. For our purposes (in Section 4) we need to know certain precise details about derived Morita equivalence in the case of DG algebras and compact generators (specifically, formula (3.3) for the functor F appearing in Theorem 3.5); and hence we give the full proof here. Let E be a triangulated category with infinite direct sums. Recall that an object M ∈ E is called compact (or small) if for any collection {Nz }z∈Z of objects of E, the canonical homomorphism   M M Nz HomE (M, Nz ) → HomE M, z∈Z z∈Z is bijective. The object M is called generator of E if for any nonzero object N ∈ E there is some i ∈ Z such that HomE (M, N [i]) 6= 0. As in Section 2 we consider a commutative ring K and a DG K-algebra A. The next lemma seems to be known, but we could not find a reference. Lemma 3.1. Let E be a triangulated category with infinite direct sums, let F, G : D̃(DGMod A) → E be triangulated functors that commute with infinite direct sums, and let η : F → G be a morphism of triangulated functors. Assume that ηA : F (A) → G(A) is an isomorphism. Then η is an isomorphism. △ → in Proof. Suppose we are given a distinguished triangle M ′ → M → M ′′ − D̃(DGMod A), such that two of the three morphisms ηM ′ , ηM and ηM ′′ are isomorphisms. Then the third is also an isomorphism. Since both functors F, G commute with shifts and direct sums, and since ηA is an isomorphism, it follows that ηP is an isomorphism for any free DG A-module P. S Next consider a semi-free DG module P . Choose any semi-basis Z = j≥0 Zj of P . This gives rise to an exhaustive ascending filtration {Pj }j≥−1 of P by DG submodules, with P−1 = 0. For every j we have a distinguished triangle θj △ → Pj−1 −→ Pj → Pj /Pj−1 − in D̃(DGMod A), where θj : Pj−1 → Pj is the inclusion. Since Pj /Pj−1 is a free DG module, by induction we conclude that ηPj is an isomorphism for every j. The 8 MARCO PORTA, LIRAN SHAUL AND AMNON YEKUTIELI telescope construction (see [BN, Remark 2.2]) gives a distinguished triangle M M Θ △ Pj −−→ Pj → P − →, j∈N j∈N with Θ|Pj−1 := (1, −θj ) : Pj−1 → Pj−1 ⊕ Pj . This shows that ηP is an isomorphism. Finally, any DG module M admits a quasi-isomorphism P → M with P semifree. Therefore ηM is an isomorphism.  Let E be a be a full triangulated subcategory of D̃(DGMod A) which is closed under infinite direct sums, and let M ∈ E. Fix a K-projective resolution P → M in DGMod A, and let B := EndA (P ). So B is a derived endomorphism DG algebra of M (Definition 2.2). Since P ∈ DGMod A ⊗K B, there is a triangulated functor (3.2) G : D̃(DGMod B op ) → D̃(DGMod A) , G(N ) := N ⊗LB P which is calculated by K-flat resolutions in DGMod B op . (Warning: P is usually not K-flat over B.) The functor G commutes with infinite direct sums, and G(B) ∼ = P ∼ = M in D̃(DGMod A). Therefore G(N ) ∈ E for every N ∈ D̃(DGMod B op ). Because P is K-projective over A, there is a triangulated functor (3.3) F : D̃(DGMod A) → D̃(DGMod B op ) , F (L) := HomA (P, L). We have F (M ) ∼ = B in D̃(DGMod B op ). = F (P ) ∼ Lemma 3.4. The functor F |E : E → D̃(DGMod B op ) commutes with infinite direct sums if and only if M is a compact object of E. Proof. We know that HomD̃(DGMod A) (M, L[j]) ∼ = Hj (RHomA (M, L)) ∼ = Hj (F (L)), functorially for L ∈ D̃(DGMod A). So M is compact relative to E if and only if the functors Hj ◦ F commute with direct sums in E. But that is the same as asking F to commute with direct sums in E.  Theorem 3.5. Let A be a DG K-algebra, let E be a be a full triangulated subcategory of D̃(DGMod A) which is closed under infinite direct sums, and let M be a compact generator of E. Choose a K-projective resolution P → M in DGMod A, and define B := EndA (P ). Then the functor F |E : E → D̃(DGMod B op ) from (3.3) is an equivalence of triangulated categories, with quasi-inverse the functor G from (3.2) . Proof. Let us write D(A) := D̃(DGMod A) etc. We begin by proving that the functors F and G are adjoints. Take any L ∈ D(A) and N ∈ D(B op ). We have to construct a bijection HomD(A) (G(N ), L) ∼ = HomD(B op ) (N, F (L)), COMPLETION BY DERIVED DOUBLE CENTRALIZER 9 which is bifunctorial. Choose a K-projective resolution Q → N in DGMod B op . Since the DG A-module Q⊗B P is K-projective, we have a sequence of isomorphisms (of K-modules) HomD(A) (G(N ), L) ∼ = H0 (RHomA (G(N ), L))  ∼ = H0 HomB op (Q, HomA (P, L)) = H0 (HomA (Q ⊗B P, L)) ∼ ∼ = H0 (RHomB op (N, F (L)) ∼ = HomD(B op ) (N, F (L)). The only choice made was in the K-projective resolution Q → N , so all is bifunctorial. The corresponding morphisms 1 → F ◦ G and G ◦ F → 1 are denoted by η and ζ respectively. Next we will prove that G is fully faithful. We do this by showing that for every N the morphism ηN : N → (F ◦G)(N ) in D(B op ) is an isomorphism. We know that G factors via the full subcategory E ⊂ D(A), and therefore, using Lemma 3.4, we know that the functor F ◦ G commutes with infinite direct sums. So by Lemma 3.1 it suffices to check for N = B. But in this case ηB is the canonical homomorphism of DG B op -modules B → HomA (P, B ⊗B P ), which is clearly bijective. It remains to prove that the essential image of the functor G is E. Take any ζL △ L ∈ E, and consider the distinguished triangle (G ◦ F )(L) −→ L → L′ − → in E, ′ in which L ∈ E is the mapping cone of ζL . Applying F and using η we get a 1F (L) △ distinguished triangle F (L) −−−→ F (L) → F (L′ ) − →. Therefore F (L′ ) = 0. But ′ ∼ ′ RHomA (M, L ) = F (L ), and therefore HomD(A) (M, L′ [i]) = 0 for every i. Since M is a generator of E we get L′ = 0. Hence ζL is an isomorphism, and so L is in the essential image of G.  4. The Main Theorem This is our interpretation of the completion appearing in Efimov’s recent paper [Ef], that is attributed to Kontsevich; cf. Remark 4.8 below for a comparison to [Ef] and to similar results in recent literature. Here is the setup for this section: A is a commutative ring, and a is a weakly proregular ideal in A. We do not assume that b := Λa (A), the a-adic completion of A is noetherian nor a-adically complete. Let A b b A, and let b a := a · A, which is an ideal of A. Since the ideal a is finitely generated, b is a-adically complete, and hence as a ring A b is it follows that the A-module A b a-adically complete. The full subcategory D(Mod A)a-tor ⊂ D(Mod A) is triangulated and closed under infinite direct sums. The results of Sections 2 and 3 are invoked with K := A. Recall the Koszul complex K(A; a) associated to a finite sequence a in A; see Section 1. It is a bounded complex of free A-modules, and hence it is a K-projective DG A-module. The next result was proved by several authors (see [BN, Proposition 6.1], [LN, Corollary 5.7.1(ii)] and [Ro, Proposition 6.6]). Proposition 4.1. Let a be a finite sequence that generates a. Then the Koszul complex K(A; a) is a compact generator of D(Mod A)a-tor . Of course there are other compact generators of D(Mod A)a-tor . Theorem 4.2. Let A be a commutative ring, let a be a weakly proregular ideal in A, and let M be a compact generator of D(Mod A)a-tor . Choose some K-projective resolution P → M in C(Mod A), and let B := EndA (P ). Then ExtiB (P ) = 0 for b all i 6= 0, and there is a unique isomorphism of A-algebras Ext0B (P ) ∼ = A. 10 MARCO PORTA, LIRAN SHAUL AND AMNON YEKUTIELI Recall that the DG A-algebra B is a derived endomorphism DG algebra of M (Definition 2.2), and the graded A-algebra ExtB (P ) is a derived double centralizer of M (Definition 2.5). We need a few lemmas before proving the theorem. Lemma 4.3. Let M be a compact object of D(Mod A)a-tor . Then M is also compact in D(Mod A), so it is a perfect complex of A-modules. Proof. Choose a finite sequence a that generates a. By [PSY, Corollary 4.26] there ∨ is an isomorphism of functors RΓa ∼ = K∨ ∞ (A; a) ⊗A −, where K∞ (A; a) is the infinite dual Koszul complex. Therefore the functor RΓa commutes with infinite direct sums. Let N ∈ D(Mod A), and consider the function R Hom(1, σN ) : HomD(Mod A) (M, RΓa (N )) → HomD(Mod A) (M, N ). Given a morphism α : M → N in D(Mod A) define R −1 β := RΓa (α) ◦ (σM ) : M → RΓa (N ). Since the functor RΓa is idempotent (Theorem 1.7(1)), the function α 7→ β is an R inverse to Hom(1, σN ), so the latter is bijective. Let {Nz }z∈Z be a collection of objects of D(Mod A). Due to the fact that M is a compact object of D(Mod A)a-tor , and to the observations above, we get isomorphisms M M ∼ HomD(Mod A) (M, Nz ) = HomD(Mod A) (M, RΓa (Nz )) z ∼ = HomD(Mod A) M z M   RΓa (Nz ) ∼ Nz = HomD(Mod A) M, RΓa z z M  M, Nz . ∼ = HomD(Mod A) M, z We see that M is also compact in D(Mod A).  Consider the contravariant functor D : D(Mod B) → D(Mod B op ) defined by choosing an injective resolution A → I over A, and letting D := HomA (−, I). Lemma 4.4. The functor D induces a duality (i.e. a contravariant equivalence) between the full subcategory of D(Mod B) consisting of objects perfect over A, and the full subcategory of D(Mod B op ) consisting of objects perfect over A. Proof. Take M ∈ D(Mod B) which is perfect over A. It is enough to show that the canonical homomorphism of DG B-modules (4.5) M → (D ◦ D)(M ) = HomA (HomA (M, I), I) is a quasi-isomorphism. For this we can forget the B-module structure, and just view this as a homomorphism of DG A-modules. Choose a resolution P → M where P is a bounded complex of finitely generated projective A-modules. We can replace M with P in equation (4.5); and after that we can replace I with A; now it is clear that this is a quasi-isomorphism.  c := Lemma 4.6. Let M and N be K-flat complexes of A-modules. We write M b Λa (M ) and N := Λa (N ). COMPLETION BY DERIVED DOUBLE CENTRALIZER 11 c and τ L : M c → LΛa (M c) are isomor(1) The morphisms ξM : LΛa (M ) → M b M phisms. (2) The homomorphism c, N b ) → HomD(Mod A) (M, N b) Hom(τM , 1) : HomD(Mod A) (M is bijective. Proof. (1) The morphism ξM is an isomorphism by [PSY, Proposition 3.6]. By Theorem 1.7(1) the complex LΛa (M ) is cohomologically complete; and therefore c is also cohomologically complete. But this means that τ L is an isomorphism. M b M b (2) Take a morphism α : M → N in D(Mod A). By part (1) we know that ξM and τ L are isomorphisms, so we can define b N −1 c b. :M →N β := (τ Lb )−1 ◦ LΛa (α) ◦ ξM N The function α 7→ β is an inverse to Hom(τM , 1).  Proof of Theorem 4.2. We shall calculate ExtB (P ) indirectly. By Lemma 4.3 we know that M , and hence also P , is perfect over A. So according to Lemma 4.4 there is an isomorphism of graded A-algebras ∼ ExtB op (D(P ))op . ExtB (P ) = Next we note that D(P ) = HomA (P, I) ∼ = HomA (P, A) = F (A) in D̃(DGMod B op ). Here F is the functor from (3.3). Therefore we get an isomorphism of graded A-algebras ExtB op (D(P )) ∼ = ExtB op (F (A)). Let N := RΓa (A) ∈ D(Mod A). We claim that F (A) ∼ = F (N ) in D̃(DGMod B op ). R To see this, we first note that the canonical morphism σA : N → A in D(Mod A) can be represented by an actual DG module homomorphism N → A (say by replacing N with a K-projective resolution of it). Consider the induced homomorphism HomA (P, N ) → HomA (P, A) of DG B op -modules. Like in the proof of Lemma 4.4, it suffices to show that this is a quasi-isomorphism of DG A-modules. This is true since, by GM Duality [PSY, Theorem 7.12], the canonical morphism R RHom(1, σA ) : RHomA (M, N ) → RHomA (M, A) in D(Mod A) is an isomorphism. We conclude that there is a graded A-algebra isomorphism ExtB op (F (A)) ∼ = ExtB op (F (N )). Take E := D(Mod A)a-tor in Theorem 3.5. Since F |E : E → D̃(DGMod B op ) is an equivalence, and E is full in D(Mod A), we see that F induces an isomorphism of graded A-algebras ExtA (N ) ∼ = ExtB op (F (N )). b in The next step is to use the MGM equivalence. We know that LΛa (N ) ∼ =A D(Mod A). And the functor LΛa induces an isomorphism of graded A-algebras b ExtA (N ) ∼ = ExtA (A). 12 MARCO PORTA, LIRAN SHAUL AND AMNON YEKUTIELI b By Lemma 4.6 the homoIt remains to analyze the graded A-algebra ExtA (A). morphism b A[i]) b b Hom(τA , 1) : HomD(Mod A) (A, → RHomD(Mod A) (A, A[i]) b = 0 for i 6= 0, and the A-algebra is bijective for every i. Therefore ExtiA (A) 0 b b homomorphism A → ExtA (A) is bijective. Combining all the steps above we see that ExtiB (P ) = 0 for i 6= 0, and there is bop . But A b is commutative, so A bop = A. b an A-algebra isomorphism Ext0B (P ) ∼ =A b Regarding the uniqueness: since the image of the ring homomorphism A → A b is dense, and A is b a-adically complete, it follows that the only A-algebra automorb is the identity. Therefore the A-algebra isomorphism Ext0B (P ) ∼ b phism of A = A that we produced is unique.  Remark 4.7. To explain how surprising this theorem is, take the case P = M := K(A; a), the Koszul complex associated to a sequence a = (a1 , . . . , an ) that generates the ideal a. As a free A-module (forgetting the grading and the differential), we have P ∼ = n2 A . The grading of P depends on n only (it is an exterior algebra). The differential of P is the only place where the sequence a enters. Similarly, the DG algebra B = EndA (P ) is a graded matrix algebra over A, of size n2 × n2 . The differential of B is where a is expressed. Forgetting the differentials, i.e. working with the graded A-module P ♮ , classical Morita theory tells us that EndB ♮ (P ♮ ) ∼ = A as graded A-algebras. Furthermore, P ♮ ♮ is a projective B -module, so we even have ExtB ♮ (P ♮ ) ∼ = A. However, the theorem tells us that for the DG-module structure of P we have b Thus we get a transcendental outcome – the completion A b – by ExtB (P ) ∼ = A. a homological operation with finite input (basically finite linear algebra over A together with a differential). Remark 4.8. Our motivation to work on completion by derived double centralizer came from looking at the recent paper [Ef] by Efimov. The main result of [Ef] is Theorem 1.1 about the completion of the category D(QCoh X) of a noetherian scheme X along a closed subscheme Y . This idea is attributed to Kontsevich. Corollary 1.2 of [Ef] is a special case of our Theorem 4.2: it has the extra assumptions that the ring A is noetherian and regular (i.e. it has finite global cohomological dimension). After writing the first version of our paper, we learned that a similar result was proved by Dwyer-Greenlees-Iyengar [DGI]. In that paper the authors continue the work of [DG] on derived completion and torsion. Their main result is Theorem 4.10, which is a combination of MGM equivalence and derived Morita equivalence in an abstract setup (that includes algebra and topology). The manifestation of this main result in commutative algebra is [DGI, Proposition 4.20], that is also a special case of our Theorem 4.2: the ring A is noetherian, and the quotient ring A/a is regular. Recall that our Theorem 4.2 only requires the ideal a to be weakly proregular, and there is no regularity condition on the rings A and A/a (the word “regular” has a double meaning here!). It is quite possible that the methods of [DGI] or [Ef] can be pushed further to remove the regularity conditions from the rings A and COMPLETION BY DERIVED DOUBLE CENTRALIZER 13 A/a. However, it is less likely that these methods can handle the non-noetherian case (i.e. assuming only that the ideal a is weakly proregular). References [AJL] [BN] [BV] [DG] [DGI] [Ef] [GM] [Jo] [Ke] [LN] [PSY] [Ri] [Ro] [Sc] [Ye] L. Alonso, A. Jeremias and J. Lipman, Local homology and cohomology on schemes, Ann. Sci. ENS 30 (1997), 1-39. Correction, availabe online at http://www.math.purdue.edu/~lipman/papers/homologyfix.pdf. M. Bokstedt and A. Neeman, Homotopy limits in triangulated categories, Compositio Math. 86 (1993), 209-234. A. Bondal and M. Van den Bergh, Generators and representability of functors in commutative and noncommutative geometry, Moscow Math. J. 3 (2003), 1-36. W. G. Dwyer and J. P. C. Greenless, Complete Modules and Torsion Modules, American J. Math. 124, No. 1 (2002), 199-220. W.G. Dwyer, J.P.C. Greenlees and S. Iyengar, Duality in algebra and topology, Advances Math. 200 (2006), 357-402. A.I Efimov, Formal completion of a category along a subcategory, eprint arXiv:1006.4721 at http://arxiv.org. J.P.C. Greenlees and J.P. May, Derived functors of I-adic completion and local homology, J. Algebra 149 (1992), 438-453. P. Jørgensen, Recollement for differential graded algebras, J. Algebra 299 (2006) 589-601. B. Keller, Deriving DG categories, Ann. Sci. Ecole Norm. Sup. 27, (1994) 63-102. J. Lipman and A. Neeman, Quasi-perfect scheme-maps and boundedness of the twisted inverse image functor, Illinois J. Math. 51, Number 1 (2007), 209-236. M. Porta, L. Shaul and A. Yekutieli, On the Homology of Completion and Torsion, to appear in Algebras and Representation Theory. J. Rickard, Derived equivalences as derived functors, J. London Math. Soc. 43 (1991), 37-48. R. Rouquier, Dimensions of triangulated categories, Journal of K-theory (2008), 1:193256. P. Schenzel, Proregular sequences, Local Cohomology, and Completion, Math. Scand. 92 (2003), 161-180. A. Yekutieli, On Flatness and Completion for Infinitely Generated Modules over Noetherian Rings, Comm. Algebra 39, Issue 11 (2011), 4221-4245. Department of Mathematics, Ben Gurion University, Be’er Sheva 84105, Israel E-mail address: (Porta) marcoporta1@libero.it, (Shaul) shlir@math.bgu.ac.il, (Yekutieli) amyekut@math.bgu.ac.il
0math.AC
NDT: Neual Decision Tree Towards Fully Functioned Neural Graph Han Xiao 1 arXiv:1712.05934v1 [cs.NE] 16 Dec 2017 Abstract Though traditional algorithms could be embedded into neural architectures with the proposed principle of (Xiao, 2017), the variables that only occur in the condition of branch could not be updated as a special case. To tackle this issue, we multiply the conditioned branches with Dirac symbol (i.e. 1x>0 ), then approximate Dirac symbol with the continuous functions (e.g. 1 − e−α|x| ). In this way, the gradients of condition-specific variables could be worked out in the back-propagation process, approximately, making a fully functioned neural graph. Within our novel principle, we propose the neural decision tree (NDT), which takes simplified neural networks as decision function in each branch and employs complex neural networks to generate the output in each leaf. Extensive experiments verify our theoretical analysis and demonstrate the effectiveness of our model. 1. Introduction Inspired by brain science, neural architectures have been proposed in 1943, (Mcculloch & Pitts, 1943). This branch of artificial intelligence develops from single perception (Casper et al., 1969) to deep complex network (Lecun et al., 2015), achieving several critical successes such as AlphaGo (Silver et al., 2016). Notably, all the operators (i.e. matrix multiply, non-linear function, convolution, etc.) in traditional neural networks are numerical and continuous, which could benefit from back-propagation algorithm, (Rumelhart et al., 1988). Recently, logics-based methods (e.g. Hungarian algorithm, max-flow algorithm, A∗ searching) are embedded into neural architectures in a dynamically graph-constructing manner, opening a new chapter for intelligence system, (Xiao, 1 State Key Laboratory of Intelligent Technology and Systems, National Laboratory for Information Science and Technology, Department of Computer Science and Technology, Tsinghua University, Beijing 100084, PR China. Correspondence to: Han Xiao <Almighty.Xiao.Han@iCloud.com>. Proceedings of the 35 th International Conference on Machine Learning, Stockholm, Sweden, PMLR 80, 2018. Copyright 2018 by the author(s). 2017). Generally, neural graph is defined as the intelligence architecture, which is characterized by both logics and neurons. With this proposed principle from the seminal work, we attempt to tackle image classification. Specifically, regarding this task, the overfull categories make too much burden for classifiers, which is a normal issue for large-scale datasets such as ImageNet (Deng et al., 2009). We conjecture that it would make effects to roughly classify the samples with decision tree, then category the corresponding samples with strong neural network in each leaf, because in each leaf, there are much fewer categories to predict. The attribute split in traditional decision trees (e.g. ID3, Random Forest, etc.) is oversimplified for precise pre-classification, (Zhou & Feng, 2017). Thus, we propose the method of neural decision tree (NDT), which applies neural network as decision function to strengthen the performance. Regarding the calculus procedure of NDT, the basic principle is to treat the logic flow (i.e. “if, for, while” in the sense of programming language) as a dynamic graph-constructing process, which is illustrated in Figure 1. This figure demonstrates the classification of four categories (i.e. sun, moon, car and pen), where an if structure is employed to split the samples into two branches (i.e. sun-moon, car-pen), where the fully connected networks generate the results respectively. In the forward propagation, our methodology activates some branch according to the condition of if, then dynamically constructs the graph according to the instructions in the activated branch. In this way, the calculus graph is constructed as a non-branching and continuous structure, where backward propagation could be performed conventionally, demonstrated in Figure 1 (b). Generally, we should note that the repeat (i.e. for, while) could be treated as performing if in multiple times, which could also be tackled by the proposed principle. Thus, all the traditional algorithms could be embedded into neural architectures. For more details, please refer to (Xiao, 2017). However, as a special challenge of this paper, the variables that are only introduced in the condition of branch could not be updated in the backward propagation, because they are outside the dynamically constructed graph, for the example of W in Figure 1. Thus, to make a completely functioned neural graph, this paper attempts to tackle this issue in an ap- NDT: Neual Decision Tree Towards Fully Functioned Neural Graph cantly, which illustrates the effectiveness of our methodology. The most important conclusion is that “our model is differentiable”, which verifies our theory and provides the novel methodology of fully functioned neural graph. Contributions (1.) We complete the principle of neural graph, which characterizes the intelligence systems with both logics and neurons. Also, we provide the proof that neural graph is Turing complete, which makes a learnable Turing machine for the theory of computation. (2.) To tackle the issue of overfull categories, we propose the method of neural decision tree (NDT), which takes simplified neural networks as decision function in each branch and employs complex neural networks to generate the output in each leaf. (3.) Our model outperforms other baselines extensively, verifying the effectiveness of our theory and method. Organization. In the Section 2, our methodology and neural architecture are discussed. In the Section 3, we specific the implementation of fully functioned neural graph in detail. In the Section 4, we provide the proof that neural graph is Turing complete. In the Section 5, we conduct the experiments for performance and verification. In the Section 6, we briefly introduce the related work. In Section 7, we list the potential future work from a developing perspective. Finally in the Section 8, we conclude our paper and publish our codes. Figure 1. Illustration of how logic flow is processed in our methodology. Referring to (b), we process the if-else structure of (a) in a dynamically graph-constructing manner. Theoretically, we construct the graph according to the active branch, in the forward propagation. When the forward propagation has constructed the graph according to logic instructions, the backward propagation would be performed as usual in a continuous and non-branching graph. Practically, the dynamically constructed process corresponds to batch operations. The samples with id 1,3,4 are activated in if branch, while those with id 2,5 are tackled in else branch. After the end of if-else instruction, the sub-batch hidden representations are joined as the classified results. proximated manner. Simply, we multiply the symbols inside the branch with Dirac function (i.e. 1x>0 or 1x≤0 ). Specifically, regarding Figure 1, we reform F CN etwork(img) as F CN etwork(img ⊗1tanh>0 ) in the if branch and perform the corresponding transformation in the else branch, where ⊗ is element-wise multiplication. The forward propagation would not be modified by the reformulation, while as to the backward process, we approximate the Dirac symbol with a continuous function to work out the gradients of condition, which solves this issue. It is noted that in this paper, the continuous function is 1 − e−α|x| ≈ 1x>0 . We conduct our experiments on public benchmark datasets: MNIST and CIFAR. Experimental results illustrate that our model outperforms other baselines extensively and signifi- 2. Methodology First, we introduce the overview of our model. Then, we discuss each component, specifically. Last, we discuss our model from the ensemble perspective. 2.1. Architecture Our architecture is illustrated in Figure 2, which is composed by three customized components namely feature, condition and target network. Firstly, The input is transformed by feature network and then the hidden features are classified by decision tree component composed by hierarchal condition networks. Secondly, the target networks predict the categories for each sample in each leaf. Finally, the targets are joined to work out the cross entropy objective. The process is exemplified in Algorithm 1. Feature Network. To extract the abstract features with deep neural structures, we introduce the feature network, which is often a stacked CNN and LSTM. Condition Network. To exactly pre-classify each sample, we employ a simplified neural network as condition network, which is usually a one- or two-layer multi-perceptions with the non-linear function of tanh. This layer is only applied in the inner nodes of decision tree. Actually, the effectiveness of traditional decision tree stems from the information gain NDT: Neual Decision Tree Towards Fully Functioned Neural Graph t = plef j pright = j PNtotal 1cn>0,j Li,j i=0 PNtotal 1cn>0 i=0 PNtotal 1cn≤0,j Li,j i=0 PNtotal 1cn≤0 i=0 (4) (5) where cn is short for condition network and Li,j is the adhoc label vector of i-th sample, where the true label position is 1 and otherwise 0. By simple computations, we have: PNtotal t Li,j ln(plef ) ∂IG j i=0 = (6) ∂1cn>0 Ntotal PNtotal Li,j ln(pright ) ∂IG j i=0 = (7) ∂1cn≤0 Ntotal where IG is short for Inf oGain. As discussed in Introduction, we approximate the Dirac symbol as a continuous function, specifically as 1 − e−α|x| ≈ 1x>0 . Thus, the gradient of condition network could be deducted as: ∂IG ∂IG ∂(1 − e−α|cn|) ∂IG ≈ = (αe−α|x| s(cn)) (8) ∂cn ∂1cn>0 ∂cn ∂1cn>0 ∂IG ∂(1 − e−α|cn|) ∂IG ∂IG ≈ = (αe−α|x| s(cn)) (9) ∂cn ∂1cn≤0 ∂cn ∂1cn≤0 Figure 2. The neural architecture of NDT (depth = 2). The input is classified by decision tree component with the condition networks, then the target networks predict the categories for each sample in each leaf. Notably, the tree component takes advantages of subbatch technique, while the targets are joined in batch to compute the cross entropy objective. splitting rules, which could not be learned by condition networks, directly. Thus, we involve an objective item for each decision node to maximize the information gain as: max Inf oGain = |F | Nright X right p ln(pright ) (1) j Ntotal j=0 j where N is the corresponding count, |F | is the feature number and p is the corresponding probabilistic distribution of features. Regarding the derivatives relative to Dirac symbol, we firstly reformulate the information gain in the form of Dirac symbol as: Nlef t = 1cn>0 (2) 1cn≤0 (3) i=1 Nright = NX total i=1 Actually, all the reduction could be performed automatically within the proposed principle, that to multiply the symbols inside the branch with Dirac function. PNtotal Specifically, as an example of the count, Nlef t = i=1 1 × 1cn>0 . Target Network. To finally predict the category of each sample, we apply a complex network as the target network, which often is a stacked convolution one for image or an LSTM for sentence. 2.2. Analysis From Ensemble Perspective |F | Nlef t X lef t t p ln(plef )+ j Ntotal j=0 j NX total where s is the sign function. NDT could be treated as an ensemble model, which ensembles many target networks with the hard branching condition networks. Currently, there exist two branches of ensemble methods, namely split by features, or split by samples, both of which increases the difficulty of single classifier. However, NDT splits the data by categories, which means single classifier deals with a simpler task. The key point is the split purity of condition networks, because the branching reduces the sample numbers for each leaf. Relatively to single classifier, if our model keeps the sample number per category, NDT could make more effects. For an example of one leaf, the sample number reduces to 30%, while the category number reduces from 10 to 3. With similarly sufficient samples, our model deals with 3classification, which is much easier than 10-classification. Thus, our model benefits from the strengthen of single classifier. NDT: Neual Decision Tree Towards Fully Functioned Neural Graph Algorithm 1 Neural Decision Tree (NDT) To implement symbol-specific logic component, we propose two batch operations, namely sub- and join-batch operation. Take the example of Figure 1 (c). To begin, there are five samples in the batch. In the forward pass, once processing in the branch, according to the condition, the batch is split into two sub-batches, each of which is respectively tackled by the instructions in the corresponding branch, simultaneously. After processed by two branches, the sub-batches are joined into one batch, according to the original order. In the backward propagation, the gradients of joined batch are split into two parts, which correspond to two sub-batches. When the process has propagated through two branches, the gradients of two sub-batches are joined again to form the gradients of stacked CNN. Theoretically, a sample in some sub-batch means the corresponding branch is activated for this sample and the other branch is deactivated. On the other word, the hidden representations of this sample connect to the activated branch rather than the deactivated one. Thus, the symbol-specific logic components perform our proposed principle, in the manner of sub- and join-batch operation. Notably, if there is no variable that is only introduced in the condition, it is unnecessary to update the condition, which makes corresponding neural graph an exact method. 3. Dynamical Graph Construction Previously introduced, neural graph is the intelligence architecture, which is characterized by both logics and neurons. Mathematically, the component of neurons are continuous functions, such as matrix multiply, hyperbolic tangent (tanh), convolution layer, etc, which could be implemented as mathematical operations. Obviously, simple principal implementation for non-batch mode is easy and direct. But practically, all the latest training methods take the advantages of batched mode. Hence, we focus on the batched implementation of neural graph in this section. Conventionally, neural graph is composed by two styles of variable, namely symbols such as W in Figure 1, and atomic types such as the integer d in Algorithm 1 Line 2. In essence, symbolic variables originate from the weights between neurons, while the atomic types are introduced by the embedded traditional algorithms. Therefore, regarding the component of logics, there exist two styles: symbol- and atomic-type-specific logic components, which are differentiated in implementation. Symbolspecific logics indicates the condition involves the symbols, such as Line 5 ∼ 9 in Algorithm 1, while atomic-typespecific logics means there are only atomic types in the condition such as Line 2 in Algorithm 1. However, our proposed principle, that dynamically constructing neural graph, could process both the situations. To implement atomic-type-specific logic component, we propose a more flexible batch operation namely allocatebatch. Take the example of Hungarian Layer (Xiao, 2017). The Hungarian algorithm deals with the similarity matrix to provide the alignment information, according to which, the dynamic links between symbols are dynamically allocated, shown in Figure 4 of (Xiao, 2017). Thus, the forward and backward propagation could be performed in a continuous calculus graph. Simply, in the forward pass, we record the allocated dynamic links of each sample in the batch, while in the backward pass, we propagate the gradients along these dynamic links. Obviously, the atomic-type-specific logic components perform our proposed principle, in the manner of allocate-batch operation. The traditional algorithms are a combination of branch (i.e. if ) and repeat (i.e. for, while). Repeat could be treated as performing branch in multiple times. Thus, the three batch operations, namely sub-, join- and allocate-batch operation, could process all the traditional algorithms, such as resolution method, A∗ searching, Q-learning, label propagation, PCA, K-Means, Multi-Armed Bandit (MAB), AdaBoost. 4. Neural Graph is Turing Complete Actually, if neural graph could simulate the Turing machine, it is Turing complete. Turing machine is composed by four parts: a cell-divided tape, reading/writing head, state register and a finite table of instructions. Correspondingly, NDT: Neual Decision Tree Towards Fully Functioned Neural Graph symbols are based on tensor arrays, which simulate the celldivided tape. Forward/Backward process indicate where to read/write. Atomic-type-specific variables record the state. Last, the logic flow (i.e. if, while, for) constructs the finite instruction table. In summary, neural graph is Turing complete. Specifically, neural graph is a learnable Turing machine rather than a static one. Learnable Turing machine could adjust the behaviors/performance, according to data and environment. Traditional computation models focus on static algorithms, while neural graph takes advantages of data and perception to strengthen the rationality of behaviors. 5. Experiment In the section, we verify our model on two datasets: MNIST (Lecun et al., 1998) and CIFAR (Krizhevsky, 2009). We first introduce the experimental settings in Section 4.1. Then, in Section 4.2, we conduct performance experiments to testify our model. Last, in Section 4.3, to further verify our theoretical analysis, that NDT could reduce the category number of leaf nodes, we perform a case study to justify our assumption. 5.1. Experimental Setting There exist three customized networks in our model, that the feature, condition and target network. We simply apply identify mapping as feature network. Regarding the condition network, we apply a two-layer fully connected perceptions, with the hyper-parameter input-300-1 for MNIST and input-3000-1 for CIFAR. Regarding the target network, we also employ a three-layer fully connected perceptions, with the hyper-parameter input-300-100-10 for MNIST, input3000-1000-10 for CIFAR-10 and input-3000-1000-100 for CIFAR-100. 1 To train the model, we leverage AdaDelta (Zeiler, 2012) as our optimizer, with hyper-parameter as moment factor η = 0.6 and  = 1 × 10−6 . We train the model until convergence, but at most 1,000 rounds. Regarding the batch size, we always choose the largest one to fully utilize the computing devices. Notably, the hyper-parameters of approximated continuous function is α = 1000. 5.2. Performance Verification MNIST. The MNIST dataset (Lecun et al., 1998) is a classic benchmark dataset, which consists of handwritten digit images, 28 x 28 pixels in size, organized into 10 classes (0 to 9) with 60,000 training and 10,000 test samples. We select some representative and competitive baselines: modern 1 We know the feature and target network are too oversimplified for this task. But this version targets at an exemplified model, which still could verify our conclusions. We will perform a complex feature and target network in the next/final version. Table 1. Performance Evaluation on MNIST Dataset. Methods Single Target Network LeNet-5 Multi-Perspective CNN Deep Belief Net SVM (RBF kernel) Random Forest Accuracy (%) 96.95 99.50 81.38 98.75 98.60 96.80 NDT (depth = 2) 97.90 CNN-based architecture LeNet-5 with dropout and ReLUs, classic linear classifier SVM with RBF kernel, Deep Belief Nets and a standard Random Forest with 2,000 trees. We could observe that: 1. NDT will beat all the baselines, verifying our theory and justifying the effectiveness of our model. 2. Compared to single target network, NDT promotes 0.65 point, which illustrates the ensemble of target network is effective. 3. Compared to Random Forest that is also a tree-based method, NDT promotes 0.75 point, which demonstrates the neurons indeed strengthen the decision trees. CIFAR. The CIFAR-10/100 dataset (Krizhevsky, 2009), is also a classic benchmark for overfull category classification, which consists of color natural images, 32 x 32 pixels in size, from 10/100 classes with 50,000 training and 10,000 test images. Several representative baselines are selected as Network in Network (NIN) (Lin et al., 2013), FitNets (Rao et al., 2016), Deep Supervised Network (DSN) (Lee et al., 2014), High-Way (Srivastava et al., 2015), All-CNN (Springenberg et al., 2014), Exponential Linear Units (ELU) (Clevert et al., 2015), FitResNets (Mishkin & Matas, 2015), gcForest (Zhou & Feng, 2017) and Deep ResNet (He et al., 2016). We could conclude that: 1. NDT will beat all the strong baselines, which verifies the effectiveness of neural decision trees and justifies the theoretical analysis. 2. Compared to single target network, NDT promotes 4.85 point, which illustrates the ensemble of target network is effective. 3. Compared with gcForest, the performance improves - points, which illustrates that neurons empower the decision trees more effectively than direct ensembles. 4. Compared with ResNet that is the strongest baseline, we promote the results over - points, which justifies NDT: Neual Decision Tree Towards Fully Functioned Neural Graph Figure 3. Case Study for NDT in MNIST with depth = 2 (a) and depth = 3 (b). The left tables are the test sample numbers that correspond to row-th leaf node and col-th category. For example, the sliced “1105” means there are 1105 test samples of category “1” in leaf node “A”. We slice the main component of a leaf and draw the corresponding decision trees in the right panel. Notably, “X” indicates the empty class. Table 2. Performance Evaluation (Error (%)) on CIFAR. Methods NIN DSN FitNets High-Way All-CNN ELU FitResNets ResNet gcForest Random Forest Single Target Network CIFAR-10 8.81 8.22 8.39 7.72 7.25 6.55 5.84 6.61 31.00 50.17 - CIFAR-100 35.68 34.57 35.04 32.39 33.71 24.28 27.66 25.16 89.37 NDT (depth = 4) - 84.52 our assumption, that NDT could reduce the category number of leaf nodes to enhance the intelligence systems. 5.3. Case Study To further testify our assumption that NDT could reduce the category number of leaf nodes, we perform a case study in MNIST. We make a statistics of test samples for each leaf node, illustrated in Figure 3. The item of table means row-th leaf node has how many samples in col-th category. For example, the “1105” in the first row and second column, means that there are 1,105 test samples of category “1” are pre-classified into leaf node “A”. Correspondingly, we draw the decision trees in the right panel with labeled categories, which specifically illustrates the decision process of NDT. For a complete verification, we vary the depth of NDT with 2 and 3. Firstly, we could clearly draw the conclusion from Figure 3, that each leaf node needs to predict less categories, which justifies our assumption. For example, in the bottom figure, the node “A” only needs to predict the category “1”, which is a single classification, and the node “H” only needs to predict the categories “0,3,5,8” which is a four classification. Because small classification is less difficult than large one, our target network in the leaf could perform better, which leads to performance promotion in a tree-ensemble manner. Secondly, from Figure 3, split purity could be worked out. Generally, the two-layer tanh multi-perception achieves a decent split purity. Indeed, the most difficult leaf nodes (e.g. “D” in the top and “H” in the bottom) are not perfect, but others gain a competitive split purity. Statistically, the main component or the sliced grid takes 92.4% share of total samples, which in a large probability, NDT would perform better than 92.4% accuracy in this case. NDT: Neual Decision Tree Towards Fully Functioned Neural Graph Finally, we discuss the hyper-parameter depth. From the top to the bottom of Figure 3, the categories are further split. For example, the node “B” in the top is split into “C” and “D” in the bottom, which means that the category “2” and “6” are further pre-classified. In this way, deep neural decision tree is advantageous. But much deeper NDT makes less sense, because the categories have been already split well. There would be mostly no difference for 1- or 2-classification. However, considering the efficiency and consuming resources, we suggest to apply a suitable depth, or theoretically about log2 (|C|), where |C| is the total category number. 6. Related Work In this section, we briefly introduce three lines of related work: image recognition, decision tree and neural graph. Convolution layer is necessary in current neural architectures for image recognition. Almost every model is a convolutional model with different configurations and layers, such as All-CNN (Springenberg et al., 2014) and DSN (Lee et al., 2014). Empirically, deeper network produces better accuracy. But it is difficult to train much deeper network for the issue of vanishing/exploding gradients, (Glorot & Bengio, 2010). Recently, there emerge two ways to tackle this problem: High-Way (Srivastava et al., 2015) and Residual Network (He et al., 2015). Inspired by LSTM, high-way network applies transform- and carry-gates for each layer, which allow information to flow across layers along the computation path without attenuation. For a more direct manner, residual network simply employs identity mappings to connect relatively top and bottom layers, which propagates the gradients more effectively to the whole network. Notably, achieving the state-of-the-art performance, residual network (ResNet) is the strongest model for image recognition, temporarily. Decision tree is a classic paradigm of artificial intelligence, while random forest is the representative methodology of this branch. During recent years, completely random tree forest has been proposed, such as iForest (Liu et al., 2008) for anomaly detection. However, with the popularity of deep neural network, lots of researches focus on the fusion between neurons and random forest. For example, (Richmond et al., 2015) converts cascaded random forests to convolutional neural network, (Welbl, 2014) leverages random forests to initialize neural network. Specially, as the stateof-the-art model, gcForest (Zhou & Feng, 2017) allocates a very deep architecture for forests, which is experimentally verified on several tasks. Notably, all of this branch could not jointly train the neurons and decision trees, which is the main disadvantage. To jointly fuse neurons and logics, (Xiao, 2017) proposes the basic principle of neural graph, which could embed traditional logics-based algorithms into neural architectures. The seminal paper merges the Hungarian algorithm with neurons as Hungarian layer, which could effectively recognize matched/unmatched sentence pairs. However, as a special case, the variables only introduced in the condition could not be updated, which is a disadvantage for characterizing complex systems. Thus, this paper focuses on this issue to make a fully functioned neural graph. 7. Future Work We list three lines of future work: design new components of neural graph, implement a script language for neural graph and analyze the theoretical properties of learnable Turing machine. This paper exemplifies an approach to embed decision tree into neural architectures. Actually, many traditional algorithms could promote intelligence system with neurons. For example, neural A∗ searching could learn the heuristic rules from data, which could be more effective and less resource consuming. For a further example, we could represent the data with deep neural networks, and conduct label propagation upon the hidden representations, where the propagation graph is constructed by K-NN method. Because the label propagation, K-NN and deep neural networks are trained jointly, the performance promotion could be expected. In fact, a fully functioned neural graph may be extremely hard and complex to implement. Thus, we expect to publish a script language for modeling neural graph and also a library that includes all the mainstream intelligence methods. Based on these instruments, neural graph could be more convenient for practical usage. Finally, as we discussed, neural graph is Turing complete, making a learnable Turing machine. We believe theoretical analysis is necessary for compilation and ability of neural graph. Take an example. Do the learnable and static Turing machine have the same ability? Take a further example. Could our brain excel Turing machine? If not, some excellent neural graphs may gain advantages over biological brain, because both of them are learnable Turing machines. If it could, the theoretical foundations of intelligence should be reformed. Take the final example. What is the best computation model for intelligence? 8. Conclusion This paper proposes the principle of fully functioned neural graph. Based on this principle, we design the neural decision tree (NDT) for image recognition. Experimental results on benchmark datasets demonstrate the effectiveness of our proposed method. NDT: Neual Decision Tree Towards Fully Functioned Neural Graph References Casper, M, Mengel, M, Fuhrmann, C, Herrmann, E, Appenrodt, B, Schiedermaier, P, Reichert, M, Bruns, T, Engelmann, C, and Grnhage, F. Perceptrons: An introduction to computational geometry. 75(3):3356–62, 1969. Clevert, DjorkArn, Unterthiner, Thomas, and Hochreiter, Sepp. Fast and accurate deep network learning by exponential linear units (elus). Computer Science, 2015. Deng, Jia, Dong, Wei, Socher, Richard, Li, Li-Jia, Li, Kai, and Fei-Fei, Li. Imagenet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pp. 248– 255. IEEE, 2009. Glorot, Xavier and Bengio, Yoshua. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 249–256, 2010. He, Kaiming, Zhang, Xiangyu, Ren, Shaoqing, and Sun, Jian. Deep residual learning for image recognition. pp. 770–778, 2015. He, Kaiming, Zhang, Xiangyu, Ren, Shaoqing, and Sun, Jian. Deep residual learning for image recognition. In Computer Vision and Pattern Recognition, pp. 770–778, 2016. Krizhevsky, Alex. Learning multiple layers of features from tiny images. 2009. Lecun, Y., Bottou, L., Bengio, Y., and Haffner, P. Gradientbased learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998. Lecun, Yann, Bengio, Yoshua, and Hinton, Geoffrey. Deep learning. Nature, 521(7553):436–444, 2015. Lee, Chen Yu, Xie, Saining, Gallagher, Patrick, Zhang, Zhengyou, and Tu, Zhuowen. Deeply-supervised nets. Eprint Arxiv, pp. 562–570, 2014. Lin, Min, Chen, Qiang, and Yan, Shuicheng. Network in network. Computer Science, 2013. Liu, Fei Tony, Kai, Ming Ting, and Zhou, Zhi Hua. Isolation forest. In Eighth IEEE International Conference on Data Mining, pp. 413–422, 2008. Mcculloch, Warren S and Pitts, Walter H. A logical calculus of ideas imminent in nervous activity. 1943. Mishkin, Dmytro and Matas, Jiri. All you need is a good init. 69(14):3013–3018, 2015. Rao, Jinfeng, He, Hua, and Lin, Jimmy. Noise-contrastive estimation for answer selection with deep neural networks. In ACM International on Conference on Information and Knowledge Management, pp. 1913–1916, 2016. Richmond, David L., Kainmueller, Dagmar, Yang, Michael Y., Myers, Eugene W., and Rother, Carsten. Relating cascaded random forests to deep convolutional neural networks for semantic segmentation. Computer Science, 2015. Rumelhart, D. E., Hinton, G. E., and Williams, R. J. Learning internal representations by error propagation. MIT Press, 1988. Silver, David, Huang, Aja, Maddison, Chris J., Guez, Arthur, Sifre, Laurent, Driessche, George Van Den, Schrittwieser, Julian, Antonoglou, Ioannis, Panneershelvam, Veda, and Lanctot, Marc. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484, 2016. Springenberg, Jost Tobias, Dosovitskiy, Alexey, Brox, Thomas, and Riedmiller, Martin. Striving for simplicity: The all convolutional net. Eprint Arxiv, 2014. Srivastava, Rupesh Kumar, Greff, Klaus, and Schmidhuber, Jrgen. Training very deep networks. Computer Science, 2015. Welbl, Johannes. Casting random forests as artificial neural networks (and profiting from it). In German Conference on Pattern Recognition, pp. 765–771. Springer, 2014. Xiao, Han. Hungarian layer: Logics empowered neural architecture. arXiv preprint arXiv:1712.02555, 2017. Zeiler, Matthew D. Adadelta: An adaptive learning rate method. Computer Science, 2012. Zhou, Zhi Hua and Feng, Ji. Deep forest: Towards an alternative to deep neural networks. 2017.
9cs.NE
Alignment Elimination from Adams’ Grammars Härmel Nestra1 1 Institute of Computer Science, University of Tartu, J. Liivi 2, 50409 Tartu, Estonia harmel.nestra@ut.ee arXiv:1706.06497v1 [cs.PL] 20 Jun 2017 Abstract Adams’ extension of parsing expression grammars enables specifying indentation sensitivity using two non-standard grammar constructs — indentation by a binary relation and alignment. This paper proposes a step-by-step transformation of well-formed Adams’ grammars for elimination of the alignment construct from the grammar. The idea that alignment could be avoided was suggested by Adams but no process for achieving this aim has been described before. 1998 ACM Subject Classification D.3.1 Formal Definitions and Theory; D.3.4 Processors; F.4.2 Grammars and Other Rewriting Systems Keywords and phrases Parsing expression grammars, indentation, grammar transformation 1 Introduction Parsing expression grammars (PEG) introduced by Ford [6] serve as a modern framework for specifying the syntax of programming languages and are an alternative to the classic context-free grammars (CFG). The core difference between CFG and PEG is that descriptions in CFG can be ambiguous while PEGs are inherently deterministic. A syntax specification written in PEG can in principle be interpreted as a top-down parser for that syntax; in the case of left recursion, this treatment is not straightforward but doable (see, e.g., [8]). Formally, a PEG is a quadruple G = (N, T, δ, s) where: N is a finite set of non-terminals; T is a finite set of terminals; δ is a function mapping each non-terminal to its replacement (corresponding to the set of productions of CFG); s is the start expression (corresponding to the start symbol of CFG). So δ : N → EG and s ∈ EG , where the set EG of all parsing expressions writable in G is defined inductively as follows: 1. ε ∈ EG (the empty string); 2. a ∈ EG for every a ∈ T (the terminals); 3. X ∈ EG for every X ∈ N (the non-terminals); 4. pq ∈ EG whenever p ∈ EG , q ∈ EG (concatenation) 5. p/q ∈ EG whenever p ∈ EG , q ∈ EG (choice); 6. !p ∈ EG whenever p ∈ EG (negation, or lookahead); 7. p ∗ ∈ EG whenever p ∈ EG (repetition). All constructs of PEG except for negation are direct analogues of constructs of the EBNF form of CFG, but their semantics is always deterministic. So p ∗ repeats parsing of p until failure, and p/q always tries to parse p first, q is parsed only if p fails. For example, the expression ab/a consumes the input string ab entirely while a/ab only consumes its first character. The corresponding EBNF expressions ab | a and a | ab are equivalent, both can match either a or ab from the input string. Negation !p tries to parse p and fails if p succeeds; © Härmel Nestra; licensed under Creative Commons License CC-BY 2 Alignment Elimination from Adams’ Grammars if p fails then !p succeeds with consuming no input. Other constructs of EBNF like non-null repetition p + and optional occurrence [p] can be introduced to PEG as syntactic sugar. Languages like Python and Haskell allow the syntactic structure of programs to be shown by indentation and alignment, instead of the more conventional braces and semicolons. Handling indentation and alignment in Python has been specified in terms of extra tokens INDENT and DEDENT that mark increasing and decreasing of indentation and must be generated by the lexer. In Haskell, rules for handling indentation and alignment are more sophisticated. Both these languages enable to locally use a different layout mode where indentation does not matter, which additionally complicates the task of formal syntax specification. Adams and Ağacan [3] proposed an extension of PEG notation for specifying indentation sensitivity and argued that it considerably simplifies this task for Python, Haskell and many other indentation-sensitive languages. In this extension, expression p > , for example, denotes parsing of p while assuming a greater indentation than that of the surrounding block. In general, parsing expressions may be equipped with binary relations (as was > in the example) that must hold between the baselines of the local and the current indentation block. In addition, ¦p¦ denotes parsing of p while assuming the first token of the input being aligned, i.e., positioned on the current indentation baseline. For example, the do expressions in Haskell can be specified by <doexp> <istmts> <stmts> ::= ::= ::= do> (<istmts>/<stmts>) + (¦<stmt>¦ )> > { (<stmt>(;<stmt>)∗ [;]})~ Here, <istmts> and <stmts> stand for statement lists in the indentation and relaxed mode, respectively. In the indentation mode, a statement list is indented (marked by > in the second production) and all statements in it are aligned (marked by ¦ · ¦). In the relaxed mode, however, relation ~ is used to indicate that the indentation baseline of the contents can be anything. (Technically, ~ is the binary relation containing all pairs of natural numbers.) Terminals do and { are also equipped with > to meet the Haskell requirement that subsequent tokens of aligned blocks must be indented more than the first token. Alignment construct provides fulcra for disambiguating the often large variety of indentation baseline candidates. Besides simplicity of this grammar extension and its use, a strength of it lies in the fact that grammars can still serve as parsers. The rest of the paper is organized as follows. Section 2 formally introduces additional constructs of PEG for specifying code layout, defines their semantics and studies their semantic properties. In Sect. 3, a semantics-preserving process of eliminating the alignment construct from grammars is described. Section 4 refers to related work and Sect. 5 concludes. 2 Indentation extension of PEG Adams and Ağacan [3] extend PEGs with the indentation and alignment constructs. We propose a slightly different extension with three rather than two extra constructs. Our approach agrees with that implemented by Adams in his indentation package for Haskell [1], whence calling the grammars in our approach Adams’ grammars is justified. All differences between the definitions in this paper and in [3] are listed and discussed in Subsect. 2.4. Let N denote the set of all natural numbers, and let B = {tt, ff } (the Boolean domain). Denote by ℘(X) the set of all subsets of set X, and let <(X) denote the set of all binary relations on set X, i.e., <(X) = ℘(X × X). Standard examples are >∈ <(N) (consisting of all pairs (n, m) of natural numbers such that n > m) and 4 ∈ <(N) (the identity H. Nestra relation consisting of all pairs of equal natural numbers); the indentation extension also makes use of ~ ∈ <(N) (the relation containing all pairs of natural numbers). Whenever ρ ∈ <(X) and Y ⊆ X, denote ρ(Y ) = {x ∈ X : ∃y ∈ Y.(y, x) ∈ ρ} (the image of Y under relation ρ). The inverse relation of ρ is defined by ρ−1 = {(x, y) : (y, x) ∈ ρ}, and the composition of relations σ and ρ by σ ◦ ρ = {(x, z) : ∃y.(x, y) ∈ σ ∧ (y, z) ∈ ρ}. Finally,  denote <+ (X) = ρ ∈ <(X) : ∀x ∈ X.ρ−1 ({x}) 6= ∅ = {ρ ∈ <(X) : ρ(X) = X}. 2.1 Adams’ grammars Extend the definition of EG given in Sect. 1 with the following three additional clauses: 8. p ρ ∈ EG for every p ∈ EG and ρ ∈ <(N) (indentation); 9. p σ ∈ EG for every p ∈ EG and σ ∈ <(N) (token position); 10. ¦p¦ ∈ EG for every p ∈ EG (alignment). Parsing of an expression p ρ means parsing of p while assuming that the part of the input string corresponding to p forms a new indentation block whose baseline is in relation ρ to the baseline of the surrounding block. (Baselines are identified with column numbers.) The position construct p σ , missing in [3], determines how tokens of the input can be situated w.r.t. the current indentation baseline. Finally, parsing an expression ¦p¦ means parsing of p while assuming the first token of the input being positioned on the current indentation baseline (unlike the position operator, this construct does not affect processing the subsequent tokens). Inspired by the indentation package [1], we call the relations that determine token positioning w.r.t. the indentation baseline token modes. In the token mode > for example, tokens may appear only to the right of the indentation baseline. Applying the position operator with relation > to parts of Haskell grammar to be parsed in the indentation mode avoids indenting every single terminal in the example in Sect. 1. Also, indenting terminals with > is inadequate for do expressions occurring inside a block of relaxed mode but the position construct can be easily used to change the token mode for such blocks (e.g., to ≥). We call a PEG extended with these three constructs a PEG> . Recall from Sect. 1 that N and T denote the set of non-terminal and terminal symbols of the grammar, respectively, and δ : N → EG is the production function. Concerning the semantics of PEG> , each expression parses an input string of terminals (w ∈ T ∗ ) in the context of a current set of indentation baseline candidates (I ∈ ℘(N)) and a current alignment flag indicating whether the next terminal should be aligned or not (b ∈ B), assuming a certain token mode (τ ∈ <(N)). Parsing may succeed, fail, or diverge. If parsing succeeds, it returns as a result a new triple containing the rest of the input w0 , a new set I 0 of baseline candidates updated according to the information gathered during parsing, and a new alignment flag b0 . This result is denoted by >(w0 , I 0 , b0 ). If parsing fails, there is no result in a triple form; failure is denoted by ⊥. Triples of the form (w, I, b) ∈ T ∗ × ℘(N) × B are behaving as operation states of parsing, as each parsing step may use these data and update them. We will write State = T ∗ × ℘(N) × B (as we never deal with different terminal sets, dependence on T is not explicitly marked), and denote by State + 1 the set of possible results of parsing, i.e., {>(s) : s ∈ State} ∪ {⊥}. The assertion that parsing expression e in grammar G with input string w in the context of I and b assuming token mode τ results in o ∈ State + 1 is denoted by e, τ `G (w, I, b) → o. The formal definition below must be interpreted inductively, i.e., an assertion of the form G, τ `e s → o is valid iff it has a finite derivation by the following ten rules: 1. ε, τ `G s → >(s). 2. For every a ∈ T , a, τ `G (w, I, b) → o holds in two cases: 3 4 Alignment Elimination from Adams’ Grammars If o = >(w0 , I 0 , ff ) for w0 , I 0 , i such that w = ai w0 (ai denotes a occurring at column i) and either b = ff and i ∈ τ−1 (I), I 0 = I ∩ τ({i}), or b = tt and i ∈ I, I 0 = {i}; If o = ⊥, and there are no w0 and i such that w = ai w0 with either b = ff and i ∈ τ−1 (I) or b = tt and i ∈ I. 3. For every X ∈ N , X, τ `G s → o holds if δ(X), τ `G s → o holds. 4. For every p, q ∈ EG , pq, τ `G s → o holds in two cases: If there exists a triple s0 such that p, τ `G s → >(s0 ) and q, τ `G s0 → o; If p, τ `G s → ⊥ and o = ⊥. 5. For every p, q ∈ EG , p/q, τ `G s → o holds in two cases: If there exists a triple s0 such that p, τ `G s → >(s0 ) and o = >(s0 ); If p, τ `G s → ⊥ and q, τ `G s → o. 6. For every p ∈ EG , !p, τ `G s → o holds in two cases: If p, τ `G s → ⊥ and o = >(s); If there exists a triple s0 such that p, τ `G s → >(s0 ) and o = ⊥. 7. For every p ∈ EG , p ∗ , τ `G s → o holds in two cases: If p, τ `G s → ⊥ and o = >(s); If there exists a triple s0 such that p, τ `G s → >(s0 ) and p ∗ , τ `G s0 → o. 8. For every p ∈ EG and ρ ∈ <(N), p ρ , τ `G (w, I, b) → o holds in two cases: If there exists a triple (w0 , I 0 , b0 ) such that p, τ `G (w, ρ−1 (I), b) → >(w0 , I 0 , b0 ) and o = >(w0 , I ∩ ρ(I 0 ), b0 ); If p, τ `G (w, ρ−1 (I), b) → ⊥ and o = ⊥. 9. For every p ∈ EG and σ ∈ <(N), p σ , τ `G s → o holds if p, σ `G s → o holds. 10. For every p ∈ EG , ¦p¦, τ `G (w, I, b) → o holds in two cases: If there exists a triple (w0 , I 0 , b0 ) such that p, τ `G (w, I, tt) → >(w0 , I 0 , b0 ) and o = >(w0 , I 0 , b ∧ b0 ); If p, τ `G (w, I, tt) → ⊥ and o = ⊥. The idea behind the conditions i ∈ τ−1 (I) and i ∈ I occurring in clause 2 is that any column i where a token may appear is in relation τ with the current indentation baseline (known to be in I) if no alignment flag is set, and coincide with the indentation baseline otherwise. For the same reason, consuming a token in column i restricts the set of allowed indentations to τ({i}) or {i} depending on the alignment flag. In both cases, the alignment flag is set to ff . In clause 8 for p ρ , the set I of allowed indentation is replaced by ρ−1 (I) as the local indentation baseline must be in relation ρ with the current indentation baseline known to be in I. After successful parsing of p with the resulting set of allowed local indentations being I 0 , the set of allowed indentations of the surrounding block is restricted to ρ(I 0 ). Clause 10 similarly operates on the alignment flag. > For a toy example, consider parsing of ¦ab¦ with the operation state (a2 b3 , N, ff ) assuming the token mode ≥. For that, we must parse ¦ab¦ with (a2 b3 , N \ {0} , ff ) by clause 8 since >−1 (N) = N \ {0}. For that in turn, we must parse ab with (a2 b3 , N \ {0} , tt) by clause 10. By clause 2, we have a, ≥ `G (a2 b3 , N \ {0} , tt) → >(b3 , {2} , ff ) (as 2 ∈ N \ {0}) and b, ≥ `G (b3 , {2} , ff ) → >(ε, {2} , ff ) (as (2, 3) ∈ ≥−1 ). Therefore, by clause 4, ab, ≥ `G (a2 b3 , N \ {0} , tt) → >(ε, {2} , ff ). Finally, ¦ab¦, ≥ `G (a2 b3 , N \ {0} , ff ) → >(ε, {2} , ff ) and > ¦ab¦ , ≥ `G (a2 b3 , N, ff ) → >(ε, {0, 1} , ff ) by clauses 10 and 8. The set {0, 1} in the final state shows that only 0 and 1 are still candidates for the indentation baseline outside the parsed part of the input (before parsing, the candidate set was the whole N). Note that this definition involves circular dependencies. For instance, if δ(X) = X for some X ∈ N then X, τ `G s → o if X, τ `G s → o by clause 3. There is no result of parsing in such cases (not even ⊥). We call this behaviour divergence. H. Nestra 2.2 5 Properties of the semantics Ford [6] proves that parsing in PEG is unambiguous, whereby the consumed part of an input string always is its prefix. Theorem 2.1 below is an analogous result for PEG> . Besides the uniqueness of the result of parsing, it states that if we only consider relations in <+ (N) then the whole operation state in our setting is in a certain sense decreasing during parsing. Denote by ≥ the suffix order of strings (i.e., w ≥ w0 iff w = uw0 for some u ∈ T ∗ ) and by w the implication order of truth values (i.e., tt A ff ). Denote by > the pointwise order on operation states, i.e., (w, I, b) > (w0 , I 0 , b0 ) iff w ≥ w0 , I ⊇ I 0 and b w b0 . I Theorem 2.1. Let G = (N, T, δ, s) be a PEG> , e ∈ EG , τ ∈ <+ (N) and s ∈ State. Then e, τ `G s → o for at most one o, whereby o = >(s0 ) implies s > s0 . Also if s = (w, I, b) and s0 = (w0 , I 0 , b0 ) then s 6= s0 implies both w > w0 and b0 = ff , and I 6= ∅ implies I 0 6= ∅. Proof. By induction on the shape of the derivation tree of the assertion e, τ `G s → o. J Theorem 2.1 enables to observe a common pattern in the semantics of indentation and alignment. Denoting by κ(p) either p ρ or ¦p¦, both clauses 8 and 10 have the following form, parametrized on two mappings α, γ : State → State: For p ∈ EG , κ(p), τ `G s → o holds in two cases: If there exists a state s0 such that p, τ `G α(s) → >(s0 ) and o = >(s ∧ γ(s0 )); If p, τ `G α(s) → ⊥ and o = ⊥. The meanings of indentation and alignment constructs are distinguished solely by α and γ. For many properties, proofs that rely on this abstract common definition can be carried out, assuming that γ is monotone, preserves the largest element and follows together with α the axiom x ∧ γ(y) ≤ γ(α(x) ∧ y). The class of all meet semilattices L with top element, equipped with mappings α, γ satisfying these three conditions, contains identities (i.e., semilattices L with α = γ = idL ) and is closed under compositions (of different α, γ defined on the same semilattice L) and under direct products. If ρ ∈ <+ (N) then the conditions hold for α1 , γ1 : ℘(N) → ℘(N) with α1 (I) = ρ−1 (I), γ1 (I) = ρ(I), similarly in the case if α2 , γ2 : B → B with α2 (b) = tt, γ2 (b) = b. Now the direct product of the identities of T ∗ and B with (α1 , γ1 ) on ℘(N) gives the indentation case, and the direct product of the identities of T ∗ and ℘(N) and the Boolean lattice B with (α2 , γ2 ) gives the alignment case. If α, γ satisfy the conditions then γ(α(x)) ≥ x since x = x∧> = x∧γ(>) ≤ γ(α(x)∧>) = γ(α(x)). Adding dual conditions (α monotone, α(⊥) = ⊥ and α(x) ∨ y ≥ α(x ∨ γ(y))) would make (α, γ) a Galois’ connection. In our cases, the dual axioms do not hold. 2.3 Semantic equivalence I Definition 2.2. Let G = (N, T, δ, s) be a PEG> and p, q ∈ EG . We say that p and q are semantically equivalent in G and denote p ∼G q iff p, τ `G s → o ⇐⇒ q, τ `G s → o for every τ ∈ <+ (N), s ∈ State and o ∈ State + 1. For example, one can easily prove that pε ∼G p ∼G εp, p(qr ) ∼G (pq)r , p/(q/r ) ∼G (p/q)/r , p(q/r ) ∼G pq/pr , p/q ∼G p/!pq for all p, q, r ∈ EG [6]. We are particularly interested in equivalences involving the additional operators of PEG> . In Sect. 3, they will be useful in eliminating alignment and position operators. The following Theorem 2.3 states distributivity laws of the three new operators of PEG> w.r.t. other constructs: I Theorem 2.3. Let G = (N, T, δ, s) be a PEG> . Then: 6 Alignment Elimination from Adams’ Grammars 1. εσ ∼G ε, (pq)σ ∼G p σ q σ , (p/q)σ ∼G p σ /q σ , (!p)σ ∼G !p σ , (p ∗ )σ ∼G (p σ )∗ , (p ρ )σ ∼G (p σ )ρ , ¦p¦σ ∼G ¦p σ ¦ for all σ ∈ <+ (N); 2. ερ ∼G ε, (p/q)ρ ∼G p ρ /q ρ , (!p)ρ ∼G !p ρ , (p σ )ρ ∼G (p ρ )σ for all ρ ∈ <+ (N); 3. ¦ε¦ ∼G ε, ¦p/q¦ ∼G ¦p¦/¦q¦, ¦!p¦ ∼G !¦p¦, ¦p σ ¦ ∼G ¦p¦σ . Proof. The equivalences in claim 1 hold as the token mode steadily distributes to each case of the semantics definition. Those in claims 2 and 3 have straightforward proofs using the joint form of the semantics of indentation and alignment and the axioms of α, γ. J Note that indentation does not distribute with concatenation, i.e., (pq)ρ G p ρ q ρ . This is because (pq)ρ assumes one indentation block with a baseline common to p and q while p ρ q ρ tolerates different baselines for p and q. For example, take p = a ∈ T , q = b ∈ T , let the token mode be 4 and the input state be (a1 b2 , N, ff ) (recall that ai means terminal a occurring in column i). We have a, 4 `G (a1 b2 , N \ {0} , ff ) → >(b2 , {1} , ff ) and b, 4 `G (b2 , {1} , ff ) → ⊥ (since (2, 1) ∈ / 4), therefore ab, 4 `G (a1 b2 , N \ {0} , ff ) → ⊥ > 1 2 and (ab) , 4 `G (a b , N, ff ) → ⊥. On the other hand, a, 4 `G (a1 b2 , N \ {0} , ff ) → >(b2 , {1} , ff ) implies a> , 4 `G (a1 b2 , N, ff ) → >(b2 , {0} , ff ) (since N ∩ (> ({1})) = {0}) and, analogously, b> , 4 `G (b2 , {0} , ff ) → >(ε, {0} , ff ) (since >−1 ({0}) = N \ {0} 3 2 and {0} ∩ (> ({2})) = {0}). Consequently, a> b> , 4 `G (a1 b2 , N, ff ) → >(ε, {0} , ff ). We can however prove the following facts: I Theorem 2.4. Let G = (N, T, δ, s) be a PEG> . 1. Identity indentation law: For all p ∈ EG , p 4 ∼G p. 2. Composition law of indentations: For all p ∈ EG and ρ, σ ∈ <+ (N), (p ρ )σ ∼G p σ◦ρ . ρ 3. Distributivity of indentation and alignment: For all p ∈ EG and ρ ∈ <+ (N), ¦p¦ ∼G ¦p ρ ¦. 4. Idempotence of alignment: For all p ∈ EG , ¦¦p¦¦ ∼G ¦p¦. 5. Cancellation of outer token modes: For all p ∈ EG and σ, τ ∈ <(N), (p σ )τ ∼G p σ . 6. Terminal alignment property: For all a ∈ T , ¦a¦ ∼G a4 . Proof. For claim 1, note that an indentation with the identity relation 4 corresponds to α, γ being identity mappings. Hence   0 0 0  ∃s .p, τ `G s → >(s ) ∧ o = >(s ∧ s )  p 4 , τ `G s → o ⇐⇒ or   p, τ `G s → ⊥ ∧ o = ⊥   0 0 0  ∃s .p, τ `G s → >(s ) ∧ o = >(s )  ⇐⇒ or   p, τ `G s → ⊥ ∧ o = ⊥ ⇐⇒ p, τ `G s → o, where s ∧ s0 can be replaced with s0 because s > s0 by Theorem 2.1. Concerning claims 2–4, let κ1 , κ2 be two constructs whose semantics follow the common pattern of indentation and alignment with mapping pairs (α1 , γ1 ) and (α2 , γ2 ), respectively. Then κ2 (κ1 (p)), τ `G s → o   0 0 0  ∃s .κ1 (p), τ `G α2 (s) → >(s ) ∧ o = >(s ∧ γ2 (s ))  ⇐⇒ or   κ1 (p), τ `G α2 (s) → ⊥ ∧ o = ⊥   00 00 00  ∃s .p, τ `G α1 (α2 (s)) → >(s ) ∧ o = >(s ∧ γ2 (α2 (s) ∧ γ1 (s )))  ⇐⇒ . or   p, τ `G α1 (α2 (s)) → ⊥ ∧ o = ⊥ H. Nestra 7 By monotonicity of γ2 and the fact that s 6 γ2 (α2 (s)), we have s ∧ γ2 (α2 (s) ∧ γ1 (s00 )) 6 s ∧ γ2 (α2 (s)) ∧ γ2 (γ1 (s00 )) = s ∧ γ2 (γ1 (s00 )). By the third axiom of α2 and γ2 , we also have γ2 (α2 (s) ∧ γ1 (s00 )) > s ∧ γ2 (γ1 (s00 )) whence s ∧ γ2 (α2 (s) ∧ γ1 (s00 )) > s ∧ γ2 (γ1 (s00 )). Consequently, s ∧ γ2 (α2 (s) ∧ γ1 (s00 )) can be replaced with s ∧ γ2 (γ1 (s00 )). Hence the semantics of the composition of κ1 and κ2 follows the pattern of semantics of indentation and alignment for mappings α1 ◦α2 and γ2 ◦γ1 . To prove claim 2, it now suffices to observe that the mappings α, γ in the semantics of (·)σ◦ρ equal the compositions of the corresponding mappings for the semantics of (·)ρ and (·)σ . For claim 3, it suffices to observe that the mappings α, γ given for an indentation and for alignment modify different parts of the operation state whence their order of application is irrelevant. Claim 4 holds because the mappings α, γ in the alignment semantics are both idempotent. Finally, claim 5 is trivial and claim 6 follows from a straightforward case study. J Theorems 2.3 and 2.4 enact bringing alignments through all syntactic constructs except concatenation. Alignment does not distribute with concatenation, because in parsing of an expression of the form ¦pq¦, the terminal to be aligned can be in the part of the input consumed by p or (if parsing of p succeeds with consuming no input) by q. Alignment can nevertheless be moved through concatenation if any successful parsing of the first expression in the concatenation either never consumes any input or always consumes some input: I Theorem 2.5. Let G = (N, T, δ, s) be a PEG> and p, q ∈ EG . 1. If p, τ `G s → >(s0 ) implies s0 = s for all τ ∈ <+ (N), s, s0 ∈ State, then ¦pq¦ ∼G ¦p¦¦q¦. 2. If p, τ `G s → >(s0 ) implies s0 6= s for all τ ∈ <+ (N), s, s0 ∈ State, then ¦pq¦ ∼G ¦p¦q. Proof. Straightforward case study. J Theorem 2.5 (1) holds also for indentation (instead of alignment), the same proof in terms of α, γ is valid. Finally, the following theorem states that position and indentation of terminals are equivalent if the alignment flag is false and the token mode is the identity: I Theorem 2.6. Let G = (N, T, δ, s) be a PEG> . Let a ∈ T , σ ∈ <+ (N) and w ∈ T ∗ , I ∈ ℘(N), o ∈ State + 1. Then aσ , 4 `G (w, I, ff ) → o ⇐⇒ aσ , 4 `G (w, I, ff ) → o. Proof. Straightforward case study. 2.4 J Differences of our approach from previous work Our specification of PEG> differs from the definition used by Adams and Ağacan [3] by three essential aspects listed below. The last two discrepancies can be understood as bugs in the original description that have been corrected in the Haskell indentation package by Adams [1]. This package also provides means for locally changing the token mode. All in all, our modifications fully agree with the indentation package. 1. The position operator p σ is missing in [3]. The treatment there assumes just one default token mode applying to the whole grammar, whence token positions deviating from the default must be specified using the indentation operator. The benefits of the position operator were shortly discussed in Subsect. 2.1. 2. According to the grammar semantics provided in [3], the alignment flag is never changed at the end of parsing of an expression of the form ¦p¦. This is not appropriate if p succeeds without consuming any token, as the alignment flag would unexpectedly remain true during parsing of the next token that is out of scope of the alignment operator. The value the alignment flag had before starting parsing ¦p¦ should be restored in this case. This is the purpose of conjunction in the alignment semantics described in this paper. 8 Alignment Elimination from Adams’ Grammars 3. In [3], an alignment is interpreted w.r.t. the indentation baseline of the block that corresponds to the parsing expression to which the alignment operator is applied. Indentation operators occurring inside this expression and processed while the alignment flag is true are neglected. In the semantics described in our paper, raising the alignment flag does not suppress new indentations. Alignments are interpreted w.r.t. the indentation baseline in force at the aligned token site. This seems more appropriate than the former approach where the indentations cancelled because of an alignment do not apply even to the subsequent non-aligned tokens. Distributivity of indentation and alignment fails in the semantics of [3]. Note that alignment of a block nevertheless suppresses the influence of position operators whose scope extend over the first token of the block. Our grammar semantics has also two purely formal deviations from the semantics used by Adams and Ağacan [3] and Ford [6]. 1. We keep track of the rest of the input in the operation state while both [3, 6] expose the consumed part of the input instead. This difference was introduced for simplicity and to achieve uniform decreasing of operation states in Theorem 2.1. 2. We do not have explicit step counts. They were used in [6] to compose proofs by induction. We provide analogous proofs by induction on the shape of derivation trees. 3 Elimination of alignment and position operators Adams [2] describes alignment elimination in the context of CFGs. In [3], Adams and Ağacan claim that alignment elimination process for PEGs is more difficult due to the lookahead construct. To our knowledge, no concrete process of semantics-preserving alignment elimination is described for PEGs before. We provide one below for well-formed grammars. We rely on the existence of position operators in the grammar; this is not an issue since we also show that position operators can be eliminated from alignment-free grammars. 3.1 Approximation semantics and well-formed expressions For defining well-formedness, we first need to introduce approximation semantics that consists of assertions of the form e *G n where e ∈ EG and n ∈ {−1, 0, 1}. This semantics is a decidable extension of the predicate that tells whether parsing of e may succeed with consuming no input (result 0), succeed with consuming some input (result 1) or fail (result −1). No particular input strings, indentation sets etc. are involved, whence the semantics is not deterministic. The following set of clauses define the approximation semantics inductively. ε *G 0. For every a ∈ T , a *G 1 and a *G −1. For every X ∈ N , X *G n if δ(X) *G n. For every p, q ∈ EG , pq *G n holds in four cases: p *G 0, q *G 0 and n = 0; There exist n0 , n00 ∈ {0, 1} such that p *G n0 , q *G n00 , 1 ∈ {n0 , n00 } and n = 1; There exists n0 ∈ {0, 1} such that p *G n0 , q *G −1 and n = −1; p *G −1 and n = −1. 5. For every p, q ∈ EG , p/q *G n holds in two cases: p *G n and n ∈ {0, 1}; p *G −1 and q *G n. 6. For every p ∈ EG , !p *G n holds in two cases: 1. 2. 3. 4. H. Nestra 7. 8. 9. 10. 9 p *G −1 and n = 0; There exists n0 ∈ {0, 1} such that p *G n0 and n = −1. For every p ∈ EG , p ∗ *G n holds in two cases: p *G −1 and n = 0; p *G −1, p *G 1 and n = 1. For every p ∈ EG and ρ ∈ <(N), p ρ *G n if p *G n. For every p ∈ EG and σ ∈ <(N), p σ *G n if p *G n. For every p ∈ EG , ¦p¦ *G n if p *G n. On the PEG constructs (1–7), our definition basically copies that given by Ford [6], except for the case p ∗ *G 1 where our definition requires p *G −1 besides p *G 1. This is sound since if parsing of p never fails then parsing of p ∗ cannot terminate. The difference does not matter in the grammar transformations below as they assume repetition-free grammars. I Theorem 3.1. Let G = (N, T, δ, s) be a PEG> . Assume that e, τ `G s → o for some τ ∈ <(N) and s ∈ State, o ∈ State + 1. Then: 1. If o = >(s) then e *G 0; 2. If o = >(s0 ) for some s0 6= s then e *G 1; 3. If o = ⊥ then e *G −1. Proof. By induction on the shape of the derivation tree of the assertion e, τ `G s → o. J Well-formedness is a decidable conservative approximation of the predicate that is true iff parsing in G never diverges (it definitely excludes grammars with left recursion but can exclude also some safe grammars). Well-formedness of PEGs was introduced by Ford [6]. The following set of clauses is an inductive definition of predicate WF G , well-formedness of expressions, for PEG> : 1. ε ∈ WF G ; 2. For every a ∈ T , a ∈ WF G ; 3. For every X ∈ N , X ∈ WF G if δ(X) ∈ WF G ; 4. For every p, q ∈ EG , pq ∈ WF G if p ∈ WF G and, in addition, p *G 0 implies q ∈ WF G ; 5. For every p, q ∈ EG , p/q ∈ WF G if p ∈ WF G and, in addition, p *G −1 implies q ∈ WF G ; 6. For every p ∈ EG , !p ∈ WF G if p ∈ WF G ; 7. For every p ∈ EG , p ∗ ∈ WF G if p 6*G 0 and p ∈ WF G ; 8. For every p ∈ EG and ρ ∈ <+ (N), p ρ ∈ WF G if p ∈ WF G ; 9. For every p ∈ EG and σ ∈ <+ (N), p σ ∈ WF G if p ∈ WF G ; 10. For every p ∈ EG , ¦p¦ ∈ WF G if p ∈ WF G . This definition rejects non-terminals with directly or indirectly left recursive rules since for a concatenation pq to be well-formed, p must be well-formed, leading to an infinite derivation in the case of any kind of left recursion. On the other hand, requiring both p ∈ WF G and q ∈ WF G in the clause for pq ∈ WF G would be too restrictive since this would reject non-terminals with meaningful recursive productions like X 7→ aX/ε. Again, clauses for PEG constructs (1–7) mostly copy the definition given by Ford [6]. This time, the choice case is an exception. In [6], p/q is considered well-formed only if both p and q are well-formed, which needlessly rejects non-terminals with safe recursive rules like X 7→ ε/X. We require q ∈ WF G only if q could possibly be executed, i.e. if p *G −1. A grammar G = (N, T, δ, s) is called well-formed if p ∈ WF G for every expression p occurring as a subexpression in some δ(X) or s. Ford [6] proves by induction on the length 10 Alignment Elimination from Adams’ Grammars of the input string that, in well-formed grammars, parsing of every expression whose all subexpressions are well-formed terminates on every input string. We can prove an analogous result in a similar way but we prefer to generalize the statement to a stricter semantics which enables to occasionally construct easier proofs later. The new semantics, which we call strict, is defined by replacing the choice clause in the definition of Subsect. 2.1 with the following: 5. For every p, q ∈ EG , p/q, τ `G s → o holds in two cases: There exists a triple s0 such that p, τ `G s → >(s0 ), o = >(s0 ) and, in addition, p *G −1 implies q, τ `G s → o0 for some o0 ∈ State + 1; p, τ `G s → ⊥ and q, τ `G s → o. The new semantics is more restrictive since, to finish parsing of an expression of the form p/q after parsing p successfully, also q must be parsed if p *G −1 happens to be the case. In the standard semantics, parsing of p/q does not have to try q if parsing of p is successful. So, if parsing of an expression terminates in the strict semantics then it terminates with the same result in the standard semantics (but not necessarily vice versa). Therefore proving that parsing always gives a result in the strict semantics will establish this also for the standard semantics. In the rest, we sign strict semantics with exclamation mark, i.e., parsing assertions will be of the form e, τ `! G s → o. I Theorem 3.2. Let G = (N, T, δ, s) be a well-formed PEG> and let e ∈ EG . Assume that all subexpressions of e are well-formed. Then for every τ ∈ <+ (N) and s ∈ State, there exists o ∈ State + 1 such that e, τ `! G s → o. Proof. By induction on the length of the input string (i.e., the first component of s). The induction step uses induction on the shape of the derivation tree of the assertion e ∈ WF G . J 3.2 Splitting As the repetition operator can always be eliminated (by adding a new non-terminal Ap with δ(Ap ) = pAp /ε for each subexpression p that occurs under the star operator), we may assume that the input grammar G is repetition-free. The first stage of our process also assumes that G is well-formed, all negations are applied to atomic expressions, and all choices are disjoint. A choice expression p/q is called disjoint if parsing of p and q cannot succeed in the same input state and token mode. Achieving the last two preconditions can be considered as a preparatory and previously studied (e.g. in [6] as stage 1 of negation elimination) step of the process. Issues concerning this are discussed briefly in Subsect. 3.5. We use in principle the same splitting algorithm as in stage 2 of the negation elimination process described by Ford [6], adding clauses for the extra operators in PEG> . The approach defines two functions γ0 : WF G → EG and γ1 : EG → EG as follows (F is a metavariable denoting any expression that always fails, e.g., !ε): γ0 (ε) γ0 (a) γ0 (X) γ0 (pq) γ0 (p/q) γ0 (!p) γ0 (p ρ ) γ0 (p σ ) γ0 (¦p¦) =ε = F = γ0 (δ(X))   γ0 (p)γ0 (q) if p *G 0 = F otherwise   γ0 (p)/γ0 (q) if p *G −1 = γ0 (p) otherwise = !(γ1 (p)/γ0 (p)) = (γ0 (p))ρ = (γ0 (p))σ = ¦γ0 (p)¦ γ1 (ε) γ1 (a) γ1 (X) =F = a =X γ1 (pq) = γ1 (p)γ1 (q)/γ1 (p)γ0 (q)/γ0 (p)γ1 (q)   γ1 (p)/γ1 (q) if p *G −1 γ1 (p/q) = γ1 (p) otherwise γ1 (!p) = F γ1 (p ρ ) = (γ1 (p))ρ γ1 (p σ ) = (γ1 (p))σ γ1 (¦p¦) = ¦γ1 (p)¦ H. Nestra 11 Correctness of the definition of γ0 follows by induction on the shape of the derivation tree of the assertion e ∈ WF G . In the negation case, we use that negations are applied to atomic expressions, whence the reference to γ1 can be eliminated by a replacement from its definition. The definition of γ1 is sound by induction on the shape of the expression e. A new grammar G0 = (N, T, δ0 , s 0 ) is defined using γ0 , γ1 by equations δ0 (X) = γ1 (δ(X)), 0 s = γ1 (s)/γ0 (s). The equivalence of the input and output grammars relies on the splitting invariant established by Theorem 3.3 below which allows instead of each parsing expression e with negations in front of atoms and disjoint choices in G to equivalently use parsing expression γ1 (e)/γ0 (e) in G0 . The claim is analogous to the splitting invariant used by [6] but we can provide a simpler proof using the strict semantics (an analogous proof using the standard semantics would fail in the choice case). I Theorem 3.3. Let e, τ `G s → o where e ∈ EG , τ ∈ <+ (N) and s ∈ State, o ∈ State + 1. Assuming that all choices in the rules of G and expression e are disjoint and the negations are applied to atoms, the following holds: 1. If o = >(s) then γ0 (e), τ `G0 s → >(s) and γ1 (e), τ `G0 s → ⊥; 2. If o = >(s0 ) where s0 6= s then γ0 (e), τ `G0 s → ⊥ and γ1 (e), τ `G0 s → >(s0 ); 3. If o = ⊥ then γ0 (e), τ `G0 s → ⊥ and γ1 (e), τ `G0 s → ⊥. Proof. We don’t use the repetition operator, whence all expressions in well-formed grammars are well-formed (this fact follows from an easy induction on the expression structure). By Theorems 3.2 and 2.1, e, τ `! G s → o. The desired result follows by induction of the shape of the derivation tree of e, τ `! G s → o, using the disjointness assumption in the choice case. J As the result of this transformation, the sizes of the right-hand sides of the productions can grow exponentially though the number of productions stays unchanged. Preprocessing the grammar via introducing new non-terminals in such a way that all concatenations were applied to atoms (similarly to Ford [6]) would hinder the growth, but the size in the worst case remains exponential. The subsequent transformations cause at most a linear growth of right-hand sides. 3.3 Alignment elimination In a grammar G = (N, T, δ, s) obtained via splitting, we can eliminate alignments using the following three steps: 1. Introduce a copy X 0 of each non-terminal X and define δ(X 0 ) = ¦δ(X)¦. 2. In all right-hand sides of productions and the start expression, apply distributivity laws (Theorem 2.3 (3), Theorem 2.4 (3), Theorem 2.5) and idempotence (Theorem 2.4 (4)) to bring all alignment operators down to terminals and non-terminals. Replace alignment of terminals by position (Theorem 2.4 (6)). 3. In all right-hand sides of productions and the start expression, replace all subexpressions of the form ¦X¦ with the corresponding new non-terminal X 0 . For establishing the equivalence of the original and the obtained grammar, the following general theorem can be used. I Theorem 3.4. Let G1 = (N, T, δ1 , s 1 ) and G2 = (N, T, δ2 , s 2 ) be PEG> s. If for every X ∈ N , δ1 (X) ∼G1 δ2 (X) then e, τ `G2 s → o always implies e, τ `G1 s → o. Proof. Easy induction on the shape of the derivation tree of e, τ `G2 s → o. J 12 Alignment Elimination from Adams’ Grammars Denote by φ the function defined on EG that performs transformations of steps 2–3, i.e., distributes alignment operators to the non-terminals and replaces aligned non-terminals with corresponding new non-terminals. Denote by G0 the grammar obtained after step 3. Note that step 1 does not change the semantics of expressions written in the original grammar. Steps 2 and 3 replace the right-hand sides of productions with expressions that are semantically equivalent with them in the grammar obtained after step 1. By Theorem 3.4, this implies that whenever parsing of some e ∈ EG in the final grammar G0 produces some result then the same result is obtained when parsing e with the same input state and token mode in the original grammar G. In order to be able to apply Theorem 3.4 with grammars interchanged, we need the equivalence of the right-hand sides of productions also in grammar G0 . For this, it is sufficient to show ¦X¦ ∼G0 X 0 for every X ∈ N , which in turn would follow from the statement ¦φ(δ(X))¦ ∼G0 φ(¦δ(X)¦). Consequently, the equivalence of the initial and final grammars is implied by the following theorem. I Theorem 3.5. For every e ∈ EG , φ(¦e¦) ∼G0 ¦φ(e)¦. Proof. The claim is a direct consequence of the following two lemmas, both holding for arbitrary s ∈ State, o ∈ State + 1: If φ(¦e¦), τ `G0 s → o then ¦φ(e)¦, τ `G0 s → o and ¦φ(¦e¦)¦, τ `G0 s → o; If ¦φ(e)¦, τ `G0 s → o or ¦φ(¦e¦)¦, τ `G0 s → o then φ(¦e¦), τ `G0 s → o. Both lemmas are proven by induction on the shape of derivation trees. The assertion with two alignments (both outside and inside) is needed in the case where e itself is of the form ¦p¦. J 3.4 Elimination of position operators In an alignment-free PEG> G = (N, T, δ, s), we can get rid of position operations using a process largely analogous to the alignment elimination, consisting of the following four steps: 1. Introduce a new non-terminal hX, τi for each existing non-terminal X and relation τ used by a position operator, with δ(hX, τi) = (δ(X))τ . 2. Apply distributivity laws (Theorem 2.3 (1)) and cancellation (Theorem 2.4 (5)) to bring all position operators down to terminals and non-terminals. 3. Replace all subexpressions of the form Xτ with corresponding new non-terminals hX, τi. 4. Replace all subexpressions of the form aτ with aτ . Again, denote by φ the function defined on EG that performs transformations of steps 2–3, i.e., distributes position operators to the terminals and non-terminals and replaces non-terminals under position operators with corresponding new non-terminals. Denote by G0 the grammar obtained after step 3. Theorem 3.4 applies here as well, whence the equivalence of the grammar obtained after step 3 and the initial grammar is implied by the following Theorem 3.6. I Theorem 3.6. For every e ∈ EG and σ ∈ <+ (N), φ(e σ ) ∼G0 (φ(e))σ . Proof. The claim is a direct consequence of the following two lemmas, both holding for arbitrary s ∈ State, o ∈ State + 1 and τ, υ ∈ <+ (N): If φ(e σ ), τ `G0 s → o then (φ(e))σ , τ `G0 s → o and (φ(e σ ))υ , τ `G0 s → o; If (φ(e))σ , τ `G0 s → o or (φ(e σ ))υ , τ `G0 s → o then φ(e σ ), τ `G0 s → o. Both lemmas are proven by induction on the shape of the derivation trees. The claim with position operator both outside and inside ((φ(e σ ))υ ) is needed in the case when e itself is an application of the position operator. J H. Nestra Correctness of step 4 can be proven by induction on the shape of the derivation trees, using Theorem 2.6. Note that here we must assume that parsing according to the final grammar is performed with the alignment flag false (a natural assumption as the grammar is alignment-free) and the token mode 4. 3.5 Discussion on the preconditions Alignment elimination was correctly defined under the assumption that the input grammar is well-formed, has negations only in front of atoms, and disjoint choices (all these conditions are needed at stage 1 only). The second assumption can be easily established by introducing a new non-terminal for each expression p such that !p occurs in the productions or in the start expression. This can be done in the lines of the first stage of the negation elimination process described by Ford [6]. This transformation preserves well-formedness of the grammar. Achieving disjoint choices is a more subtle topic. A straightforward way would be replacing choices of the form p/q with disjoint choices p/!pq which seems to work well as p/q and p/!pq are equivalent in the standard semantics. Alas, p/q and p/!pq are not equivalent in the approximation semantics, because if p *G 1, p *G −1, q *G 0 but q 6*G −1, then p/!pq *G −1 while p/q 6*G −1. Due to this, replacing p/q with p/!pq can break well-formedness. Take X ∈ N such that δ(X) =!(a/ε)X. Then X ∈ WF G due to !(a/ε) ∈ WF G alone, no recursive call to X ∈ WF G arises as !(a/ε) 6*G 0. However, if δ0 (X) =!(a/!aε)X in G0 then !(a/!aε) *G0 0 whence well-formedness of X now recursively requires well-formedness of X. Thus X ∈ / WF G0 . (An argument similar to this shows that the first stage of the negation elimination process in Ford [6] also can break well-formedness. As the second stage is correctly defined only for well-formed grammars, the whole process fails.) One solution would be changing the approximation semantics by adding, to the inductive definition in Subsect. 3.1, a general clause 0. e *G −1 if e *G 0 or e *G 1. This forces e *G −1 to hold whenever an assertion of the form e *G n holds, and in particular, p/q becomes equivalent to p/!pq. Then replacing p/q with p/!pq preserves well-formedness. Although well-formedness predicate becomes more restrictive and rejects more safe grammars, the loss seems to be little and acceptable in practice (expressions q such that q *G 0 or q *G 1 while q 6*G −1 seem to occur not very commonly in influenced productions such as X 7→!(p/q)X, but a further investigation is needed to clarify this). 4 Related work PEGs were first introduced and studied by Ford [6] who also showed them to be closely related with the TS system [5] and TDPL [4], as well as to their generalized forms [5, 4]. Adams [2] and Adams and Ağacan [3] provide an excellent overview of previous approaches to describing indentation-sensitive languages and attempts of building indentation features into parser libraries. Our work is a theoretical study of the approach proposed in [3] while some details of the semantics used in our paper were “corrected” in the lines of Adams’ indentation package for Haskell [1]. This package enables specifying indentation sensitivity within the Parsec and Trifecta parser combinator libraries. A process of alignment operator elimination is previously described for CFGs by Adams [2]. Matsumura and Kuramitsu [7] develop a very general extension of PEG that also enables to specify indentation. Their framework is powerful but complicated. The approach proposed 13 14 Alignment Elimination from Adams’ Grammars in [3] and followed by us is in contrast with [7] by focusing on indentation and aiming to maximal simplicity and convenience of usage. 5 Conclusion We studied the extension of PEG proposed by Adams and Ağacan [3] for indentationsensitive parsing. This extension uses operators for marking indentation and alignment besides the classic ones. Having added one more operator (position) for convenience, we found a lot of useful semantic equivalences that are valid on expressions written in the extended grammars. We applied these equivalences subsequently for defining a process that algorithmically eliminates all alignment and position operators from well-formed grammars. References 1 2 3 4 5 6 7 8 Michael D. Adams. The indentation package. URL: http://hackage.haskell.org/ package/indentation. Michael D. Adams. Principled parsing for indentation-sensitive languages: Revisiting Landin’s offside rule. In Roberto Giacobazzi and Radhia Cousot, editors, The 40th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’13, Rome, Italy - January 23 - 25, 2013, pages 511–522. ACM, 2013. URL: http://doi.acm.org/10.1145/2429069.2429129, doi:10.1145/2429069.2429129. Michael D. Adams and Ömer S. Ağacan. Indentation-sensitive parsing for Parsec. In Wouter Swierstra, editor, Proceedings of the 2014 ACM SIGPLAN symposium on Haskell, Gothenburg, Sweden, September 4-5, 2014, pages 121–132. ACM, 2014. URL: http://doi. acm.org/10.1145/2633357.2633369, doi:10.1145/2633357.2633369. Alfred V. Aho and Jeffrey D. Ullman. The Theory of Parsing, Translation, and Compiling. Prentice-Hall, Inc., Upper Saddle River, NJ, USA, 1972. Alexander Birman and Jeffrey D. Ullman. Parsing algorithms with backtrack. Information and Control, 23(1):1–34, 1973. URL: http://dx.doi.org/10.1016/S0019-9958(73) 90851-6, doi:10.1016/S0019-9958(73)90851-6. Bryan Ford. Parsing expression grammars: A recognition-based syntactic foundation. In Neil D. Jones and Xavier Leroy, editors, Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2004, Venice, Italy, January 14-16, 2004, pages 111–122. ACM, 2004. URL: http://doi.acm.org/10.1145/964001. 964011, doi:10.1145/964001.964011. Tetsuro Matsumura and Kimio Kuramitsu. A declarative extension of parsing expression grammars for recognizing most programming languages. JIP, 24(2):256–264, 2016. URL: http://dx.doi.org/10.2197/ipsjjip.24.256, doi:10.2197/ipsjjip.24.256. Sérgio Medeiros, Fabio Mascarenhas, and Roberto Ierusalimschy. Left recursion in parsing expression grammars. In Francisco Heron de Carvalho Junior and Luís Soares Barbosa, editors, Programming Languages - 16th Brazilian Symposium, SBLP 2012, Natal, Brazil, September 23-28, 2012. Proceedings, volume 7554 of Lecture Notes in Computer Science, pages 27–41. Springer, 2012. URL: http://dx.doi.org/10.1007/978-3-642-33182-4_4, doi:10.1007/978-3-642-33182-4_4.
6cs.PL
Bridging Static and Dynamic Program Analysis using Fuzzy Logic Jacob Lidman & Josef Svenningsson Chalmers University of Technology {lidman, josefs}@chalmers.se Static program analysis is used to summarize properties over all dynamic executions. In a unifying approach based on 3-valued logic properties are either assigned a definite value or unknown. But in summarizing a set of executions, a property is more accurately represented as being biased towards true, or towards false. Compilers use program analysis to determine benefit of an optimization. Since benefit (e.g., performance) is justified based on the common case understanding bias is essential in guiding the compiler. Furthermore, successful optimization also relies on understanding the quality of the information, i.e. the plausibility of the bias. If the quality of the static information is too low to form a decision we would like a mechanism that improves dynamically. We consider the problem of building such a reasoning framework and present the fuzzy data-flow analysis. Our approach generalize previous work that use 3-valued logic. We derive fuzzy extensions of data-flow analyses used by the lazy code motion optimization and unveil opportunities previous work would not detect due to limited expressiveness. Furthermore we show how the results of our analysis can be used in an adaptive classifier that improve as the application executes. 1 Introduction How can one reconcile static and dynamic program analysis? These two forms of analysis complement each other: static analysis summarizes all possible runs of a program and thus provide soundness guarantees, while dynamic analysis provides information about the particular runs of a program which actually happen in practice and can therefore provide more relevant information. Being able to combine these two paradigms has applications on many forms on analyses, such as alias analysis [15, 19] and dependence analysis [17]. Compilers use program analysis frameworks to prove legality as well as determining benefit of transformations. Specifications for legality are composed of safety and liveness assertions (i.e. universal and existentially quantified properties), while specifications for benefit use assertions that hold in the common case. This reason for adopting the common case is that few transformations improve performance in general (i.e., for every input, environment). Similarly most transformations could potentially improve performance in a least one case. As such, compiler optimizations are instead motivated based on (an approximation of) the majority case, i.e. the (weighted) mean. While determining legality has improved due to advances in the verification community the progress in establishing benefit has been slow. In this paper we introduce fuzzy data-flow analysis, a framework for static program analysis based on fuzzy logic. The salient feature of our framework is that it can naturally incorporate dynamic information while still being a static analysis. This ability comes thanks to a shift from “crisp” sets where membership is binary, as employed in conventional static analysis, to fuzzy sets where membership is gradual. De Vink and Wiklicky (Eds.): QAPL 2017 EPTCS 250, 2017, pp. 111–126, doi:10.4204/EPTCS.250.7 © J. Lidman & J. Svenningsson This work is licensed under the Creative Commons Attribution License. 112 Bridging Static and Dynamic Program Analysis using Fuzzy Logic We make the following contributions: • Section 3 introduces our main contribution, the fuzzy data-flow framework. • Section 4 demonstrates the benefit of our framework by presenting a generalization of a wellknown code motion algorithm and we show how this generalization provides new opportunities for optimizations previous approaches would not discover. • Section 4 shows how fuzzy logic can benefit program analysis by (1) using second-order fuzzy sets to separate uncertainty in data-flow and control-flow and hence improve an inter-procedural analysis and (2) using fuzzy regulators to refine the results of our static analysis, hence improving the precision dynamically. 2 Preliminaries We introduce and define fuzzy sets and the operators that form fuzzy logic. These concepts will be used in Section 3 to define the transfer functions of our data-flow analysis. 2.1 Fuzzy set Elements of a crisp set1 are either members or non-members w.r.t to a universe of discourse. A fuzzy set (FS) instead allow partial membership denoted by a number from the unit interval [0, 1]. The membership degree typically denotes vagueness. The process to convert crisp membership to fuzzy grades is called fuzzification and the inverse is called defuzzification. Following Dubois et al. [8, 7] let S be a crisp set and µ : S 7→ [0, 1] a membership function (MF) then hS, µi is a fuzzy set. As a convention, if S is understood from context we sometimes refer to µ as a fuzzy set. The membership function formalizes the fuzzification. Fuzzy sets are ordered point-wise, i.e. (S, µA ) ≤ (S, µB ) ⇔ ∀s ∈ S : µA (s) ≤ µB (s). We can accommodate some notion about uncertainty of vagueness by considering a type-2 fuzzy set where the membership degree itself is a fuzzy set. Type-2 FS (T2FS) membership functions are composed of a primary (Js ) and secondary (µ) membership {h(s, u), µ(s, u)i | s ∈ S, u ∈ Js ⊆ [0, 1]}. Here uncertainty is represented by the secondary membership that define the possibility of the primary membership. When for each x and u, it holds µ(x, u) = 1 the T2FS is called an interval T2FS. Gehrke et al. [9] showed that this can equivalently be described as an interval valued fuzzy sets (IVFS) where µ : S → {[l, u] |⊥ ≤ l ≤ u ≤ > }. IVFS are a special case of lattice valued fuzzy sets (L-fuzzy sets) where the membership domain forms a lattice over [0, 1]. Defuzzification of T2FS often proceeds in two phases. The first phase applies type reduction to transform the T2FS to a type-1 FS (T1FS). The second phase then applies a type-1 defuzzification. 2.2 Fuzzy logic Fuzzy logic defines many-valued formal systems to reason about truth in the presence of vagueness. Contrary to classical logic the law of excluded middle (p ∨ ¬p = >) and the law of non-contradiction (p ∧ ¬p = ⊥) does not, in general, hold for these systems. Fuzzy logic uses T-, S- and C- norms to ˜ ∨, ˜ ¬i ˜ 2 which generalize the logical operators ∧, ∨ and ¬. We compactly represent a fuzzy logic by h∧, is sometimes called a De Morgan system [8] because it satisfies a generalization of De Morgans laws: ˜ Q) ⇔ ¬ ˜¬ ˜ Q) ⇔ ¬ ˜¬ ¬(P ˜ ∧ ˜ P∨ ˜ Q and ¬(P ˜ ∨ ˜ P∧ ˜ Q. 1 In the context of fuzzy logic, crisp or Boolean set refer to a classical set to avoid confusion with fuzzy sets. one would expect the definition of a fuzzy logic to include a “fuzzy implication” operator in this work we do not consider it. 2 Although J. Lidman & J. Svenningsson 113 1 2 3 Fuzzy logic Min-Max Algebraic Sum-product Lukasiewicz 4 Nilpotent T-norm min(x, y) xy max(x + y − 1, 0) ( min(x, y) x + y > 1 0 otherwise S-norm max(x, y) x + y − xy min(x + y, 1) ( max(x, y) x + y < 1 1 otherwise C-norm 1−x 1−x 1−x 1−x Table 1: Common instantiations of fuzzy logics Definition 1. Let U be a binary function [0, 1]2 → [0, 1] that is commutative, associative and increasing and has an identity element e ∈ [0, 1]. If e = 1 then U is a Triangular norm (T-norm) and if e = 0 then U is a Triangular conorm (S-norm)3 . Definition 2. A C-norm is a unary function n : [0, 1] → [0, 1] that is decreasing, involutory (i.e., n(n(x)) = x) with boundary conditions (i.e, n(0) = 1, n(1) = 0). Standard examples of fuzzy logics are shown in Table 1 [8, 7]. Examples 1-3 are special cases (and limits) of the Frank family of fuzzy logics that are central to our work and formally defined in Definition 3. Definition 3. Let  s ∈ [0, 1] ∪ {∞} then the Frank family of T-norms is defined by:  min(x, y) s=0    xy s=1 T s (x, y) = max(x    + y − 1, 0)  s = ∞   log 1 + (sx −1)(sy −1) otherwise s s−1 The set of intervals in [0, 1] forms a bounded partial order hI, v, >, ⊥i4 where [lx , ux ] ≤ [ly , uy ] ⇔ (lx ≤ ly ) ∧ (ux ≤ uy ) , > = [1, 1] and ⊥ = [0, 0]. As per Gehrke et al. [9] we can point-wise lift a T1FS fuzzy logic ˜ ∨, ˜ ¬i ˜ ∨} ˜ and ¬[l, h∧, ˜ to a IVFS fuzzy logic, i.e., [lx , ux ] [ly , uy ] = [lx ly , ux uy ], ˆ ∈ {∧, ˜ u] = [¬ ˜ u, ¬ ˜ l]. 3 Fuzzy data-flow analysis Static data-flow analyses deduce values of semantic properties that are satisfied the dynamics of the application. The dynamics is formalized as a system of monotone transfer functions and collector functions. Transfer functions describe how blocks alter the semantic properties. Collectors functions merge results from different, possibly mutual exclusive, branches of the application. The solution of the analysis is obtained through Kleene iteration and is a unique fixed-point of the system of equations. In a classical framework the domain of the values is binary, i.e. either true (1) or false (0). The interpretation of these values depends on the type of analysis. The value true means that the property can possibly hold in a may-analysis (i.e., it is impossible that the value is always false) while it means that the property always holds in a must-analysis. The value false could mean either the opposite of true or that the result is inconclusive. Our fuzzy data-flow analysis instead computes the partial truth of the property, i.e. values are elements of [0, 1]. A value closer to 0 means that the property is biased towards false and vice versa. Furthermore the transfer functions are logical formulas from a Frank family fuzzy logic and the collector 3 The general concept, allowing any e ∈ [0, 1], is called a uninorm [8] and is either orlike (i.e., U(0, 1) = U(1, 0) = 1) or andlike (i.e., U(0, 1) = U(1, 0) = 0). Our work does not require the full generality. 4 This should not be confused with the partial order used in the interval abstraction. 114 Bridging Static and Dynamic Program Analysis using Fuzzy Logic functions are weighted average functions where the constant α is determined prior to performing the analysis. In contrast to the classical framework Kleene iteration proceeds until the results differ by a constant ε which is the maximal error allowed by the solution. The error can be made arbitrarily small. This section introduces the fuzzy data-flow framework and we prove termination using continuity properties and Banach’s fixed-point theorem. Section 4 then presents an example analysis to demonstrate the benefit of the framework. The analysis is performed on a weighted flow-graph G = hV, E, αi where V is a set of logical formulas (denoting the transfer function of each block), E ⊆ V × V is a set of edges (denoting control transfers) and αe ∈ [0, 1] denotes the normalized contribution for each edge e. As a running example we will use Figure 1 (left) which shows a flow-graph with four nodes and their corresponding logical formula. The flow graph has four control edges denoting contributions between nodes. For instance, Block 1 (B1) receives 0.1 of its contribution from B0 and 0.9 from B2, i.e. αhB0,B1i = 0.1 and αhB2,B1i = 0.9. B0 Out = 0.0 0.1 B1 Out = In 1.0 0.9 1.0 Out = In  Out(B0) = 0.0     Out(B1) = 0.1Out(B0) + 0.9Out(B2)  Out(B2) = min (0.8, max(1 − Out(B1), 0.3))    Out(B3) = Out(B1) B3 Out = 0.8 ∧ (¬In ∨ ¬0.7) B2 Figure 1: Example flow-graph (left) and its corresponding equation system (middle) and the analysis result and error as a function of iteration (right) Definition 4. Let P be a finite set of properties and V S : P 7→ [0, 1] a valuation for each property. We use [[φ ]] (V S) to denote the interpretation of the fuzzy formula φ given a V S. Given a flow-graph G = hV, E, αi with a unique start node vstart the map GS : V 7→ V S describes the value of each property at each node and a fuzzy data-flow analysis is a Kleene iteration of F : GS 7→ GS: S(vstart ) v = vstart F(S) = λ v.  ∑ αhw,vi [[v]] (S(w)) otherwise hw,vi∈E Figure 1 (middle) shows the equation system, as implied by Definition 4, interpreted in a min-max fuzzy logic for the example flow-graph. The red colored text corresponds to the collector function, i.e. the weighted average, and the normal text is the interpretation of the logical formula. In order to prove termination of a fuzzy analysis we need to introduce a continuity property. Definition 5. A function f : [0, 1]n 7→ [0, 1] is K-Lipschitz continuous5 iff ∀x, h : | f (~x −~h) − f (~x)|1 ≤ K|~h|1 . Where |~x|1 is l1 -norm (i.e., the absolute value) of ~x6 . If 0 ≤ K < 1 then f is called a contraction mapping and if 0 ≤ K ≤ 1 then f is called a non-expansive mapping. In a sequence of applications of a contraction mapping the difference between two consecutive applications will decrease and in the limit reach zero. By imposing a bounded error we guarantee that this 5 Our definition restricts the domain and metric of both metric spaces (i.e., for the domain and co-domain of f ) compared to the more general, and common, definition of a Lipschitz continuous function. 6 Other l -norms can be used but only if we restrict the logic to the min-max fuzzy logic [14]. p J. Lidman & J. Svenningsson 115 sequence terminates in a bounded amount of time. The analysis error and result of B2 as a function of iteration for the example is shown in Figure 1 (right). Note that the error (red line) is decreasing and the value of B2 (blue line) tends towards a final value. We next proceed to prove that any fuzzy data-flow analysis iteratively computes more precise results and terminates in a bounded amount of time for a finite maximum error 21q from some q ∈ N − {0}. We let [0, 1]q denote the maximal congruence set of elements from [0, 1] that are at least 21q apart, i.e. [0, 1]q = { 2iq | 0 ≤ i ≤ 2q }. The set of intervals on [0, 1], i.e. I are defined analogously. For this we prove the non-expansive property of fuzzy formulas. Theorem 1. Let x, y,C, wi ∈ [0, 1]q , for some i ∈ N, fi (~x) : [0, 1]nq 7→ [0, 1]q be 1-Lipschitz and gi (~x) : [0, 1]nq 7→ [0, 1]q be Ki -Lipschitz. • Functions x + y, x − y, xy, min(x, y) and abs(x) are 1-Lipschitz. Constants are 0-Lipschitz. N−1 x) is 1-Lipschitz. • If ∑N−1 i=0 wi = 1 then ∑i=0 wi f i (~ • The composition ga ◦ gb is Ka Kb -Lipschitz. Finally, • Formulas defined in a Frank family Fuzzy logic are 1-Lipschitz. • If F : Inq → Iq satisfies ∀x ∈ Inq : y ∈ x ⇒ f (y) ∈ F(x) then F is 1-Lipschitz. In summary, as per Theorem 1: • Transfer functions in a Frank family fuzzy logic are non-expansive mappings. • S(vstart ) is constant and hence a contraction mapping. • The composition of 1) Two non-expansive functions is a non-expansive function and 2) A nonexpansive and a contraction function is a contraction function. As the analysis is performed on the unit interval which together with the l1 -norm forms a complete metric space we can guarantee termination by Banach’s fixed-point theorem. Theorem 2 (Banach fixed-point theorem). Let (X, d) be a complete metric space and f : X 7→ X a contraction. Then f has a unique fixed-point x∗ in X. This concludes our development of fuzzy data-flow analysis. 4 Lazy code motion Improving performance often means removing redundant computations. Computations are said to be fully redundant, but not dead, if the operands at all points remain the same. For two such computations it is enough to keep one and store away the result for later. We can eliminate this redundancy using (global) common sub-expression elimination (GCSE). Furthermore a computation that does not change on some paths is said to be partially redundant. Loop invariant code motion (LICM) finds partially redundant computations inside loops and move these to the entry block of the loop. Lazy code motion is a compiler optimization that eliminate both fully and partially redundant computations, and hence subsumes both CSE and LICM. Knoop-Rüthing-Steffen (KRS) algorithm [12, 6] performs LCM in production compilers such as GCC when optimizing for speed. 116 Bridging Static and Dynamic Program Analysis using Fuzzy Logic B0 v o i d diffPCM ( ) { b = 0 , A = 0 , B = 0; f o r ( i = 0 ; i < N ; i ++) i f ( i n [ i ] != b ) b = a b s ( i n [ i ]−b ) ; B = Transform ( b ) ; A = IncRate ( i ) ; o u t [ i ] = A*B ; } B1 i<N 1 N N−1 N B2 in[i] != b B5 1− p p b = abs(a[i]-b) B3 B4 B = Transform(b); A = IncRate(i); out[i] = A*B i=i+1 v o i d diffPCM ( ) { b = 0 , A = 0 , B = 0; f o r ( i = 0 ; i < N ; i ++) Update← ANFIS decision of updating b Leave← ANFIS decision of leaving b i f ( i n [ i ] != b ) b = a b s ( i n [ i ]−b ) ; If Update < Leave: Decision error! else If Update > Leave: Decision error! B = Transform ( b ) ; A = IncRate ( i ) ; o u t [ i ] = A*B ; } Figure 2: diffPCM function (left), the corresponding flow-chart (middle) and the version used in Section 4.3 which is annotated with ANFIS classifier invocations (right) It consists of a series of data-flow analyses and can be summarized in these four steps: 1. Solve a very busy expression7 and an available expression data-flow problem [16]. 2. Introduce a set that describes the earliest block where an expression must be evaluated. 3. Determine the latest control flow edge where the expression must be computed. 4. Introduce Insert and Delete sets which describe where expressions should be evaluated. The target domain of the analysis is the set of static expressions in a program. Input to the analysis is three predicates determining properties about the expressions in different blocks: • An expression “e” is downward exposed if it produces the same result if evaluated at the end of the block where it is defined. We use DEE(b, e) to denote if “e” is downward exposed in block “b”. • An expression “e” is upward exposed if it produces the same result if evaluated at the start of the block where it is defined. We use UEE(b, e) to denote this. • An expression “e” is killed in block “b” if any variable appearing in “e” is updated in “b”. We use KILL(b, e) to denote this. Very busy expression analysis is a backward-must data-flow analysis that depends on UEE and KILL and computes the set of expressions that is guaranteed to be computed at some time in the future. Similarly Available expression analysis is a forward-must data-flow analysis that depends on DEE and KILL and deduces the set of previously computed expressions that may be reused. The fixed-point system of these two analyses are shown in Figure 3. It is beyond the scope of this paper to further elaborate on the details of these analyses, the interested reader should consider Nielson et al. [16]. Here the LCM algorithm and the data-flow analyses it depends on, are applications we use to demonstrate the benefit of our framework. As such a rudimentary understanding is sufficient. Consider the simplified differential pulse-code modulation routine diffPCM in Figure 2 (left). We assume that N and the relative number of times block B3 (denoted p) is statically known8 . In each iteration diffPCM invokes the pure functions Transform, to encode the differential output, and IncRate to get a quantification rate. We use the KRS-LCM algorithm to determine if these invocations can be made prior to entering the loop and contrast this to a situation where the data-flow analyses are performed 7 Knoop 8 In et al. [12] refer to this as anticipatable expression data-flow problem. this demonstration we let p = 0.999 and N = 1000, but our conclusions hold as N increases and p approaches 1. J. Lidman & J. Svenningsson 117 Block Knoop-Ruthing-Steffen LCM Available expression ( V AvIn(b) = b0 ∈Pred(b) AvOut(b0 ), b 6= B0 AvOut(b) = DEE(b) ∨ [AvIn(b) ∧ ¬Kill(b)] Very busy expression ( V AnIn(b) = b0 ∈Succ(b) AnOut(b0 ), b 6= B5 AnOut(b) = UEE(b) ∨ [AnIn(b) ∧ ¬Kill(b)] B0 B1 B2 B3 B4 B5 (1) DEE 6543210 0000000 0000001 0000010 0000000 0101000 0000000 UEE 6543210 0000000 0000001 0000010 1000000 0110100 0000000 Block (2) B0 B1 B2 B3 B4 B5 ( AnIn( j) ∧ ¬AvOut(i) ∧ [Kill(i) ∨ AnOut(i)] i 6= B0 Earliest(i, j) = AnIn( j) ∧ ¬AvOut(B0) otherwise (3) ( V LaterIn( j) = j0 ∈Pred( j) LaterOut(:, j), j 6= B0 LaterOut(i, j) = Earliest(i, j) ∨ [LaterIn(i) ∧ ¬UEE(i)] (4) 6 0.0 0.0 0.0 0.0 0.0 0.0 5 0.0 0.0 0.0 0.0 1.0 0.0 4 0.0 0.0 0.0 0.0 0.0 0.0 DEE 3 0.0 0.0 0.0 0.0 1.0 0.0 2 0.0 0.0 0.0 0.0 0.0 0.0 1 0.0 0.0 1.0 0.0 0.0 0.0 0 0.0 1.0 0.0 0.0 0.0 0.0 6 0.0 0.0 0.0 1.0 0.0 0.0 5 0.0 0.0 0.0 0.0 1.0 0.0 4 0.0 0.0 0.0 0.0 1.0 0.0 UEE 3 0.0 0.0 0.0 0.0 0.0 0.0 2 0.0 0.0 0.0 0.0 1.0 0.0 1 0.0 0.0 1.0 0.0 0.0 0.0 0 0.0 1.0 0.0 0.0 0.0 0.0 6 1.0 0.0 0.0 1.0 1.0 0.0 5 1.0 0.0 0.0 1.0 0.0 0.0 4 1.0 0.0 0.0 0.0 1.0 0.0 KILL 3 1.0 0.0 0.0 0.0 1.0 0.0 2 1.0 0.0 0.0 0.0 1.0 0.0 1 1.0 0.0 0.0 1.0 1.0 0.0 0 1.0 0.0 0.0 0.0 1.0 0.0 Block B0 B1 B2 B3 B4 B5 Insert(i, j) = LaterOut( j) ∧ ¬LaterIn( j) Delete(k) = UEE(k) ∧ ¬LaterIn(k), k 6= B0 Block Edge B0→B1 B1→B5 B1→B2 B2→B3 B2→B4 B3→B4 B4→B1 6 5 4 Insert 3 0.001 0.001 0.001 0.001 0.001 0.000 0.001 0.998 0.001 0.001 0.001 0.001 0.998 0.000 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.000 0.000 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.000 2 1 0 0.000 0.000 0.000 0.000 0.001 0.000 0.000 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 Block B0 B1 B2 B3 B4 B5 Expression Index 6 5 4 Delete 3 0.000 0.000 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.998 0.000 0.000 0.000 0.000 0.000 0.001 0.000 0.000 0.000 0.000 0.000 0.000 0.000 abs(a[i]-b) 6 Transform(b) 5 2 1 0 IncRate(i) 4 A*B 3 i+1 2 B0 B1 B2 B3 B4 B5 Edge B0→B1 B1→B5 B1→B3 B2→B3 B2→B4 B3→B4 B4→B1 in[i] != b 1 KILL 6543210 1111111 0000000 0000000 1100010 1011111 0000000 Insert 6543210 0000000 0000000 0000000 0000000 0000000 0000000 0000000 Block B0 B1 B2 B3 B4 B5 Delete 6543210 0000000 0000000 0000000 0000000 0000000 0000000 i≤N 0 Figure 3: Knoop-Rüthing-Steffen LCM formulation (middle) using classical (left) and fuzzy (right/bottom) data-flow analysis 118 Bridging Static and Dynamic Program Analysis using Fuzzy Logic in the fuzzy framework. As we will show the “fuzzy KRS-LCM” allows us to uncover opportunites the classical KRS-LCM would miss. 4.1 Type-1 static analysis The data-flow problems of the KRS algorithm use expressions as domain. The mapping between expressions of diffPCM and indexes are listed in Figure 3 (bottom) together with the values of DEE, UEE and KILL for each block (top right). The classical KRS algorithm conclude that both calls must be evaluated in B4 (bottom light gray box, “Delete” matrix, Column 4 and 5). For the fuzzy data-flow analyses we use the Type-1 Min-Max fuzzy logic. The corresponding fuzzy sets of DEE, UEE and KILL are given in Figure 3 (top dark gray box). Step (1) of the fuzzy KRS-LCM is hence the fixed-point to below system of equations: Available expression analysis system  AvOut(B0) = 0.0         AvOut(B4) ∧ ¬Kill(B1) AvOut(B1) = DEE(B1) ∨ N1 AvOut(B0) + N−1  N   AvOut(B2) = DEE(B2) ∨ (AvOut(B1) ∧ ¬Kill(B2))  AvOut(B3) = DEE(B3) ∨ (AvOut(B2) ∧ ¬Kill(B3))     AvOut(B4) = DEE(B4) ∨ ([pAvOut(B2) + (1 − p)AvOut(B3)] ∧ ¬Kill(B4))    AvOut(B5) = DEE(B5) ∨ (AvOut(B1) ∧ ¬Kill(B4)) Very busy expression analysis system  ∧ ¬Kill(B1))  AnOut(B0) = UEE(B0) ∨ (AnOut(B1)   N−1     AnOut(B2) + N1 AnOut(B5) ∧ ¬Kill(B1) AnOut(B1) = UEE(B1) ∨ N   AnOut(B2) = UEE(B2) ∨ ([pAnOut(B4) + (1 − p)AnOut(B3)] ∧ ¬Kill(B2))  AnOut(B3) = UEE(B3) ∨ (AnOut(B4) ∧ ¬Kill(B3))      AnOut(B4) = UEE(B4) ∨ (AnOut(B1) ∧ ¬Kill(B4))    AnOut(B5) = 0.0 Steps (2) and (4) introduce (constant) predicates and are performed outside the analysis framework. Step (3) is done similarly to step (1). Figure 3 (bottom dark gray box) shows the result from step (4). In contrast to the classical LCM the result implies that it is very plausible (0.998) that we can delete the invocation of Transform (“Delete” matrix, Column 5) from block B4 and instead add it at the end of B0 and B3 (or start of B1 and B4). However, result for the invocation of IncRate remains. This is because the invocation depends on the value of i which is updated at the end of B4. 4.2 Type-2 static analysis To increase data-flow analysis precision a function call is sometimes inlined at the call site. The improvement can however be reduced if the control-flow analysis is inaccurate and multiple targets are considered for a particular call site. We show how the uncertainty in control-flow and data-flow can be quantified in two different dimensions using type-2 interval fuzzy sets. As per Section 2 we can lift an arbitrary fuzzy predicate to intervals. Here we assume no knowledge about the relative number of calls to each target and treat the different calls non-deterministically. We assume two different IncRate functions, as in Figure 4 (left), have been determined as targets. Their respective UEE and Kill entries are the same but since i is updated at the end of block B4 their DEE entry will differ. The result of IncRate_1 depends on the variable i and therefore DEE(B41 ) = 0101000, in contrast the entry for IncRate_2 is DEE(B42 ) = 0111000, where 0 = [0, 0] and 1 = [1, 1]. The new J. Lidman & J. Svenningsson B = Transform(b); ... = IncRate(i); i n t IncRate 1 ( i n t i ) { r e t u r n 2* i ; i n t IncRate 2 ( i n t i ) { return 1; } } A = ... out[i] = A*B i=i+1 119 Block 6 5 4 3 2 1 0 Edge B0→B1 B1→B5 B1→B3 B2→B3 B2→B4 B3→B4 B4→B1 Kill DEE UEE [1.0, 1.0] [0.0, 0.0] [0.0, 0.0] [0.0, 0.0] [1.0, 1.0] [1.0, 1.0] [1.0, 1.0] [0.0, 1.0] [1.0, 1.0] [1.0, 1.0] [1.0, 1.0] [0.0, 0.0] [1.0, 1.0] [0.0, 0.0] [1.0, 1.0] [1.0, 1.0] [0.0, 0.0] [0.0, 0.0] [1.0, 1.0] [0.0, 0.0] [0.0, 0.0] Insert Block Delete [0.001, 0.999] B0 [0.000, 0.000] [0.001, 0.999] B1 [0.000, 0.000] [0.001, 0.999] B2 [0.000, 0.000] [0.001, 0.999] B3 [0.000, 0.000] [0.001, 0.999] B4 [0.002, 0.999] [0.001, 0.999] B5 [0.000, 0.000] [0.000, 0.999] Figure 4: Implementations of IncRate inlined in block B4 (left); DEE, UEE and Kill vectors of block B4 and Delete Insert analysis result for expression IncRate(i) (right) ˜ DEE(B42 ) = h0, 1, [0, 1], 1, 0, 0, 0i. The new entry for block B4 is given by DEE(B4) = DEE(B41 ) ∨ Kill, DEE and UEE sets are given in Figure 4 (right). Applying the fuzzy KRS-LCM, but with Type-1 min-max fuzzy logic lifted to Interval type-2 minmax fuzzy logic gives the values of Delete and Insert for expression IncRate(i) in Figure 4 (right). The result for invoking IncRate prior to the loop is [0.001, 0.999] as opposed to 0.001 from the Type-1 analysis in Section 4.1. The added dimension in the result of the type-2 fuzzy analysis allows us to differentiate uncertain results from pessimistic results. In the given example we showed that the result of Section 4.1 is a pessimistic over-generalization and that the two paths need to be considered seperately to increase precision. 4.3 Hybrid analysis The result from a fuzzy data-flow analysis is a set of fuzzy membership degrees. This section shows how the result can automatically be improved following the static analysis using a fuzzy regulator/classifier, if more specific information is provided at a later point. The classifier, a Takagi-Sugeno Adaptive-Networkbased fuzzy inference system (TS-ANFIS) [10, 11] shown in Figure 5, is composed of five layers: 1. Lookup fuzzy membership degree of the input value. 2. Compute the firing strength of a rule, i.e. conjunction of all membership degrees from each rule. 3. Normalize the firing strengths, i.e., w̄i = wi / ∑ j w j . 4. Weight the normalized firing strength to the consequent output of the rule fi (x). 5. Combine all rule classifiers, i.e. f = ∑i w̄i fi . This classifier uses a polynomial (i.e., the consequent part of the adaptive IF-THEN rules) to decide the output membership. The order of the TS-ANFIS is the order of the polynomial. The classification accuracy of the TS-ANFIS can be improved online/offline by fitting the polynomial to the input data. For a first-order TS-ANFIS this can be implemented as follows: • (Offline) (Affine) Least square (LS) optimization [10] is a convex optimization problem that finds an affine function (i.e., y = a0 + ∑ni=1 ai xi ) which minimizes ||A[1; X] −Y ||22 where X and Y are the input and output vectors of the training set. • (Online) Least mean square  (LMS) [10] is an adaptive filter that gradually (in steps of a given constant µ) minimizes E |y − f (x)|2 , where hx, yi is an input/output sample. 120 Bridging Static and Dynamic Program Analysis using Fuzzy Logic IF x0 is A0 and x1 is B0 THEN f = c(1,0) + c(1,1) x0 + c(1,2) x1 IF x0 is A1 and x1 is B1 THEN f = c(2,0) + c(2,1) x0 + c(2,2) x1 µA0 µB0 0.6 A0 0.5 x0 x1 x0 A1 ∏ w1 N w¯1 µA1 w¯1 f1 ∑ B0 x1 B1 ∏ w2 N w¯2 f2 w¯2 x0 x1 µB1 f 0.286 0.1 x0 = 0.6 x1 = 0.2 Figure 5: First-order Takagi-Sugeno ANFIS with two rules and two variables (left) and four example fuzzy sets (right) To exemplify the functionality of the TS-ANFIS we consider the classification of~x = h0.6, 0.2i using the two rule TS-ANFIS from Figure 5 (left). Let f1 (~x) = 0.2x0 −0.43x1 , f2 (~x) = 0.1x1 +0.5 and membership functions be given as in Figure 5 (right). The membership degrees are marked in the figure as µA0 (x0) = 0.6, µB0 (x1) = 0.5 for the first rule and µA1 (x0) = 0.286, µB1 (x0) = 0.1 for the second rule. Hence the weight of the first rule (i.e., w1 ) is 0.6 ∧ 0.5 = 0.5 and the second rule (i.e., w2 ) is 0.286 ∧ 0.1 = 0.1. The normalized weights are then w¯1 = 0.833 and w¯1 = 0.167. As the consequence functions output f1 (~x) = 0.034 and f2 (~x) = 0.52 we produce the prediction 0.833 f1 (~x) + 0.167 f2 (~x) = 0.115. We return to the diffPCM function and again consider if we can invoke Transform(b) prior to entering the loop. We saw in Section 4.1 that the fuzzy membership degree was 0.998. To improve classification accuracy we let the TS-ANFIS also use the i variable and the first input value (i.e., in[0]). These variables were not part of the analysis and so we conservatively assume the fuzzy membership degree to be the same for any value of these variables (in our experiments: 1.0). As shown in Figure 2 (right), we inserted calls to compute the ANFIS decision of updating and keeping the variable b constant in the diffPCM function. If the incorrect decision was made the error was noted and an error rate computed after handling all input samples. We consider invoking the diffPCM function on four different input sets. Each input set defined as 10 periods with 25 input values in each period. The input sets (i.e., in[...]) is given in Figure 6 (left). We use the LMS algorithm9 after each incorrect classification and the LS algorithm if the error rate of a period was larger than or equal to 80%. Note that the values of a period is not always perfectly representable by a linear classifier and sometimes varies between different periods, although periods are “similar”. Hence we do not expect the classifier to be monotonically improving with increasing period. As shown in the result in Figure 6 (right) the classification error decreases fast with both period and input sample. In two cases a small residual error remains after the final period. This show that the TS-ANFIS can improve the analysis result dynamically and hence increase the accuracy of when Transform can be invoked prior to entering the loop. 9 The constant µ for the four different runs was set to 0.001, 0.05, 0.15 and 0.1 respectively. 121 2 1 1.8 0.9 1.6 0.8 1.4 0.7 1.2 0.6 Error rate Input value J. Lidman & J. Svenningsson 1 0.8 0.5 0.4 0.6 0.3 0.4 0.2 0.2 0.1 0 0 0 50 100 150 200 250 1 2 3 4 Sample 5 6 7 8 9 10 6 7 8 9 10 6 7 8 9 10 6 7 8 9 10 Period 60 1 0.9 50 0.8 0.7 0.6 Error rate Input value 40 30 20 0.5 0.4 0.3 0.2 10 0.1 0 0 0 50 100 150 200 250 1 2 3 4 Sample 5 Period 12 1 0.9 10 0.8 0.7 0.6 Error rate Input value 8 6 4 0.5 0.4 0.3 0.2 2 0.1 0 0 0 50 100 150 200 250 1 2 3 4 Sample 5 Period 25 1 0.9 20 0.8 0.6 Error rate Input value 0.7 15 10 0.5 0.4 0.3 5 0.2 0.1 0 0 0 50 100 150 Sample 200 250 1 2 3 4 5 Period Figure 6: 10 × 25 input values (left) and the corresponding classification error rate (right) 122 5 Bridging Static and Dynamic Program Analysis using Fuzzy Logic Related work Most systems include elements (e.g., input values, environment state) where information is limited but probabilistic and/or non-deterministic uncertainty can be formulated. For these systems a most likely or even quantitative analysis of properties is possible. Often this analysis relies on a probability theory for logical soundness. Cousot and Monerau [3] introduced a unifying framework for probabilistic abstract interpretation. Much work have since, although perhaps implicitly, relied on their formulation. Often probabilistic descriptions are known with imprecision that manifests as non-deterministic uncertainty [2]. Adje et al. [1] introduced an abstraction based on the zonotope abstraction for Dempster-Shafer structures and P-boxes10 . Di Pierro et al. [5] developed a probabilistic abstract interpretation framework and demonstrated an alias analysis algorithm that could guide the compiler in this decision. They later formulated data-flow problems (e.g., liveness analysis) in the same framework [4]. An important distinction between their (or similar probabilistic frameworks) and classical frameworks is the definition of the confluence operator. In contrast to a classical may- or must framework they use the weighted average. This is similar to the work by Ramalingam [18] that showed that the meet-over-paths (MOP) solution exists for such confluence operator with a transfer function defined in terms of min, max and negation (i.e., the Min-max fuzzy logic). Our work extends this to allow other transfer functions and integrates the static data-flow analysis with a dynamic refinement mechanism through fuzzy control theory. 6 Conclusion A major problem for static program analysis is the limited input information and hence the conservative results. To alleviate the situation dynamic program analysis is sometimes used. Here accurate information is available, but in contrast to its static counter-part the results only cover a single or few runs. To bridge the gap, and find a promising middle-ground, probabilistic/speculative program analysis frameworks have been proposed. These frameworks can be considered to intersect both by being a static program analysis that uses dynamic information. We have introduced an data-flow framework based on fuzzy sets that supports such analyses. We solved data-flow problems of use for speculative compilation and showed how our analysis unveils opportunities that previous approaches could not express and reason about. We furthermore showed that our data-flow framework based on fuzzy sets admit mechanisms from fuzzy control theory to enhance the analysis result dynamically allowing for a hybrid analysis framework. References [1] Assale Adje, Olivier Bouissou, Jean Goubault-Larrecq, Eric Goubault & Sylvie Putot (2014): Static Analysis of Programs with Imprecise Probabilistic Inputs. In: Verified Software: Theories, Tools, Experiments, Lecture Notes in Computer Science 8164, Springer Berlin Heidelberg, pp. 22–47, doi:10.1007/978-3-64254108-7 2. [2] Patrick Cousot & Radhia Cousot (2014): Abstract Interpretation: Past, Present and Future. In: Proceedings of the Joint Meeting of the Twenty-Third EACSL Annual Conference on Computer Science Logic (CSL) and the Twenty-Ninth Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), CSL-LICS ’14, ACM, pp. 2:1–2:10, doi:10.1145/2603088.2603165. 10 Lower and upper bounds on a cumulative probability distribution functions J. Lidman & J. Svenningsson 123 [3] Patrick Cousot & Michaël Monerau (2012): Probabilistic Abstract Interpretation. In: 22nd European Symposium on Programming (ESOP 2012), Lecture Notes in Computer Science 7211, Springer-Verlag, pp. 166– 190, doi:10.1007/978-3-642-28891-3 3. [4] Pierro A Di & H Wiklicky (2013): Probabilistic data flow analysis: a linear equational approach. In: Proceedings of the Fourth International Symposium on Games, Automata, Logics and Formal Verification, pp. 150–165, doi:10.4204/EPTCS.119.14. [5] Alessandra Di Pierro, Chris Hankin & Herbert Wiklicky (2007): A Systematic Approach to Probabilistic Pointer Analysis. In: Programming Languages and Systems, Lecture Notes in Computer Science 4807, Springer Berlin Heidelberg, pp. 335–350, doi:10.1007/978-3-540-76637-7 23. [6] Karl-Heinz Drechsler & Manfred P. Stadel (1993): A Variation of Knoop, Rüthing, and Steffen’s Lazy Code Motion. SIGPLAN Not. 28(5), pp. 29–38, doi:10.1145/152819.152823. [7] D. Dubois & H. Prade (1980): Fuzzy sets and systems - Theory and applications. Academic press, New York. [8] D. Dubois, H.M. Prade & H. Prade (2000): Fundamentals of Fuzzy Sets. The Handbooks of Fuzzy Sets, Springer US, doi:10.1007/978-1-4615-4429-6. [9] Mai Gehrke, Carol Walker & Elbert Walker (1996): Some comments on interval valued fuzzy sets. International Journal of Intelligent Systems 11(10), pp. 751–759, doi:10.1002/(SICI)1098111X(199610)11:10¡751::AID-INT3¿3.0.CO;2-Y. [10] J.-S.R. Jang (1993): ANFIS: adaptive-network-based fuzzy inference system. Systems, Man and Cybernetics, IEEE Transactions on 23(3), pp. 665–685, doi:10.1109/21.256541. [11] Jyh-Shing Roger Jang & Chuen-Tsai Sun (1997): Neuro-fuzzy and Soft Computing: A Computational Approach to Learning and Machine Intelligence. Prentice-Hall, Inc., Upper Saddle River, NJ, USA. [12] Jens Knoop, Oliver Rüthing & Bernhard Steffen (1992): Lazy Code Motion. In: Proceedings of the ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation, PLDI ’92, ACM, pp. 224–234, doi:10.1145/143095.143136. [13] S. Maleki, Yaoqing Gao, M.J. Garzaran, T. Wong & D.A. Padua (2011): An Evaluation of Vectorizing Compilers. In: Parallel Architectures and Compilation Techniques (PACT), 2011 International Conference on, pp. 372–382, doi:10.1109/PACT.2011.68. [14] A. Mesiarov (2007): k-lp-Lipschitz t-norms. International Journal of Approximate Reasoning 46(3), pp. 596 – 604, doi:10.1016/j.ijar.2007.02.002. Special Section: Aggregation Operators. [15] Markus Mock, Manuvir Das, Craig Chambers & Susan J. Eggers (2001): Dynamic Points-to Sets: A Comparison with Static Analyses and Potential Applications in Program Understanding and Optimization. In: Proceedings of the 2001 ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, PASTE ’01, ACM, pp. 66–72, doi:10.1145/379605.379671. [16] Flemming Nielson, Hanne R. Nielson & Chris Hankin (1999): Principles of Program Analysis. SpringerVerlag New York, Inc., doi:10.1007/978-3-662-03811-6. [17] P.M. Petersen & D.A. Padua (1996): Static and dynamic evaluation of data dependence analysis techniques. Parallel and Distributed Systems, IEEE Transactions on 7(11), pp. 1121–1132, doi:10.1109/71.544354. [18] G. Ramalingam (1996): Data Flow Frequency Analysis. In: Proceedings of the ACM SIGPLAN 1996 Conference on Programming Language Design and Implementation, PLDI ’96, ACM, pp. 267–277, doi:10.1145/231379.231433. [19] ConstantinoG. Ribeiro & Marcelo Cintra (2007): Quantifying Uncertainty in Points-To Relations. In: Languages and Compilers for Parallel Computing, Lecture Notes in Computer Science 4382, Springer Berlin Heidelberg, pp. 190–204, doi:10.1007/978-3-540-72521-3 15. 124 Bridging Static and Dynamic Program Analysis using Fuzzy Logic Appendix A: Omitted proofs of Theorem 1. Let x, y,C, wi ∈ [0, 1], for some i ∈ N, fi (~x) : [0, 1]nq 7→ [0, 1]q be 1-Lipschitz and gi (~x) : [0, 1]nq 7→ [0, 1]q be Ki -Lipschitz. 1. Functions x + y, x − y, xy, min(x, y) and abs(x) are 1-Lipschitz. Constants are 0-Lipschitz Let b ∈ [x, x + h] for some 0 ≤ x ≤ x + h ≤ 1: (a) g(x) = abs (x): |g(x + h) − g(x)| = |abs (x + h) − abs (x)| = |x + h − x| By definition x, h ∈ [0, 1] ≤ 1|h| (b) g(x, y) = x + y: |g(x + h1 , y + h2 ) − g(x, y)| = |((x + h1 ) + (y + h2 )) − (x + y)| By definition = |h1 + h2 | ≤ |h1 | + |h2 | Triangle inequality = 1|h| Distributivity |g(x + h1 , y + h2 ) − g(x, y)| = |((x + h1 ) − (y + h2 )) − (x − y)| By definition (c) g(x, y) = x − y: = |h1 + (−1)h2 | ≤ |h1 | + | − 1||h2 | Triangle inequality = 1|h| Distributivity (d) g(x, y) = xy: |g(x + h1 , y + h2 ) − g(x, y)| = g(x + h1 , y0 ) − g(x, y0 − h2 ) 0 0 = (x + h1 )y − x(y − h2 ) Substitution y0 = y + h2 By definition 0 = |h1 y + xh2 | ≤ |h1 + h2 | 0 ≤ x, y0 ≤ 1 ≤ |h1 | + |h2 | Triangle inequality = 1|h| Distributivity (e) g(x, y) = min(x, y): |g(x + h1 , y + h2 ) − g(x, y)| = |min(x + h1 , y + h2 ) − min(x, y)|   x + h1 + y + h2 |x + h1 − y − h2 | − − 2 2 =   x + y |x − y| − 2 2 h1 + h2 |x| + | − 1||y| + |h1 − h2 | − + 2 2 ≤ |x| + | − 1||y| 2 h1 + h2 |h1 − h2 | = − 2 2 By definition min(x, y) = x + y |x − y| − 2 2 = | min(h1 , h2 )| ≤ |h1 + h2 | = 1|h| Triangle inequality J. Lidman & J. Svenningsson 125 (f) g(x, y) = C |g(x + h) − g(x)| = |C −C| = 0 ≤ 0|h| N−1 x) is 1-Lipschitz 2. If ∑N−1 i=0 wi = 1 then ∑i=0 wi f i (~ g(~x +~h) − g(~x) = N−1 ∑ wi f (x ~+ h) − i=0 N−1 = ∑ wi N−1 ∑ wi f (~x) By definition i=0   f (x ~+ h) − f (~x) Associativitiy and commutativity i=0 ! N−1 ≤ ∑ wi Ki |h| Triangle inequality, distributivity and wi ≥ 0 i=0 = 1|h| Ki = 1 and ∑ wi = 1 i 3. The composition ga ◦ gb is Ka Kb -Lipschitz g(~x) = fa (~x) ◦ fa (~x): |g(x + h) − g(x)| = fa ( fb (x ~+ h)) − fa ( fb (~x)) By definition ≤ Ka fb (x ~+ h) − fb (~x) Definition 5 ≤ Ka Kb |h| Definition 5 4. Formulas defined in a Frank family Fuzzy logic are 1-Lipschitz. This follows from structural induction on the height of parse tree of the predicate P(x). By De Morgan’s laws it is enough to show the induction step for ∨ and ¬. • Base case: – v: g(x) = x: |g(x + h) − g(x)| = |x + h − x| ≤ 1|h|. – > or ⊥: g(x) = C: 1-Lipschitz by 3. • Induction step: – ¬φ ≡ 1 − φ : 1-Lipschitz from the base case for constants (> and ⊥) and cases 1c and 3 and assumption that φ is 1-Lipschitz.  min(x, y) 1-Lipschitz from Theorem 1 case 1e     1-Lipschitz from Theorem 1 case 1d  xy max(x + y − 1, 0) Equal to 1 − min(2 − x − y, 1) using De Morgans law. – φ1 ∨ φ2 :   This expression is 1-Lipschitz from Theorem 1    case 1c, 1e and 3 5. If F : Inq → Iq satisfy ∀x ∈ Inq : y ∈ x ⇒ f (y) ∈ F(x) then F is 1-Lipschitz F : Inq → Iq can be decomposed into two functions Fl : Inq → [0, 1]q and Fu : Inq → [0, 1]q such that ∀i : F(i) = [Fl (i), Fu (i)], i.e., Fl (i) gives the infimum of f (i) and Fu (i) gives the supremum of i. We show that both Fl and Fu are 1-Lipschitz continuous: • Fl (I) = inf f (i): Assume I = [l, u], since I is finite we can rewrite the operation as pairi∈I wise applications of min, i.e., min( f (l), min( f (l + 21q ), min( f (l + 222 ), ...))). As per above case 1e min is 1-Lipschitz. Similarly the composition of two 1-Lipschitz functions is also 1-Lipschitz, or in extension, a finite number of compositions. 126 Bridging Static and Dynamic Program Analysis using Fuzzy Logic • Fu (I) = sup f (i): max(x, y) is equivalent to 1 − min(1 − x, 1 − y) which is 1-Lipschitz by i∈I above case 1c and 1e so proof follows in the same way as the Fl (I) case.
6cs.PL
Complexity of Manipulation with Partial Information in Voting arXiv:1604.04359v2 [cs.MA] 13 Jul 2017 Palash Dey Tata Institute of Fundamental Research, Mumbai palash.dey@tifr.res.in Neeldhara Misra Indian Institute of Technology, Gandhinagar mail@neeldhara.com Y. Narahari Indian Institute of Science, Bangalore hari@csa.iisc.ernet.in January 2, 2018 Abstract The Coalitional Manipulation problem has been studied extensively in the literature for many voting rules. However, most studies have focused on the complete information setting, wherein the manipulators know the votes of the non-manipulators. While this assumption is reasonable for purposes of showing intractability, it is unrealistic for algorithmic considerations. In most real-world scenarios, it is impractical to assume that the manipulators to have accurate knowledge of all the other votes. In this work, we investigate manipulation with incomplete information. In our framework, the manipulators know a partial order for each voter that is consistent with the true preference of that voter. In this setting, we formulate three natural computational notions of manipulation, namely weak, opportunistic, and strong manipulation. We say that an extension of a partial order is viable if there exists a manipulative vote for that extension. We propose the following notions of manipulation when manipulators have incomplete information about the votes of other voters. 1. W EAK M ANIPULATION: the manipulators seek to vote in a way that makes their preferred candidate win in at least one extension of the partial votes of the non-manipulators. 2. O PPORTUNISTIC M ANIPULATION: the manipulators seek to vote in a way that makes their preferred candidate win in every viable extension of the partial votes of the nonmanipulators. 3. S TRONG M ANIPULATION: the manipulators seek to vote in a way that makes their preferred candidate win in every extension of the partial votes of the non-manipulators. We consider several scenarios for which the traditional manipulation problems are easy (for instance, Borda with a single manipulator). For many of them, the corresponding manipulative questions that we propose turn out to be computationally intractable. Our hardness results often hold even when very little information is missing, or in other words, even when the instances are very close to the complete information setting. Our results show that the impact of paucity of information on the computational complexity of manipulation crucially depends on the notion of manipulation under consideration. Our overall conclusion is that computational hardness continues to be a valid obstruction to manipulation, in the context of a more realistic model. Keywords: voting, manipulation, incomplete information, algorithm, computational complexity 1 1 Introduction In many real life and AI related applications, agents often need to agree upon a common decision although they have different preferences over the available alternatives. A natural tool used in these situations is voting. Some classic examples of the use of voting rules in the context of multiagent systems include Clarke tax [ER91], collaborative filtering [PHG00], and similarity search [FKS03], etc. In a typical voting scenario, we have a set of candidates and a set of voters reporting their rankings of the candidates called their preferences or votes. A voting rule selects one candidate as the winner once all voters provide their votes. A set of votes over a set of candidates along with a voting rule is called an election. A central issue in voting is the possibility of manipulation. For many voting rules, it turns out that even a single vote, if cast differently, can alter the outcome. In particular, a voter manipulates an election if, by misrepresenting her preference, she obtains an outcome that she prefers over the “honest” outcome. In a cornerstone impossibility result, Gibbard and Satterthwaite [Gib73, Sat75] show that every unanimous and non-dictatorial voting rule with three candidates or more is manipulable. We refer to [BCE+ 15] for an excellent introduction to various strategic issues in computational social choice theory. Considering that voting rules are indeed susceptible to manipulation, it is natural to seek ways by which elections can be protected from manipulations. The works of Bartholdi et al. [BITT89, BIO91] approach the problem from the perspective of computational intractability. They exploit the possibility that voting rules, despite being vulnerable to manipulation in theory, may be hard to manipulate in practice. Indeed, a manipulator is faced with the following decision problem: given a collection of votes P and a distinguished candidate c, does there exist a vote v that, when tallied with P, makes c win for a (fixed) voting rule r? The manipulation problem has subsequently been generalized to the problem of C OALITIONAL MANIPULATION by Conitzer et al. [CSL07], where one or more manipulators collude together and try to make a distinguished candidate win the election. The manipulation problem, fortunately, turns out to be NP-hard in several settings. This established the success of the approach of demonstrating a computational barrier to manipulation. However, despite having set out to demonstrate the hardness of manipulation, the initial results in [BITT89] were to the contrary, indicating that many voting rules are in fact easy to manipulate. Moreover, even with multiple manipulators involved, popular voting rules like plurality, veto, kapproval, Bucklin, and Fallback continue to be easy to manipulate [XZP+ 09]. While we know that the computational intractability may not provide a strong barrier [PR06, PR07, FKN08, XC08a, XC08b, FHH10, Wal10, Wal11, IKM12, Dey15, DMN15b, DMN16, DMN15a, DN14, DN15] even for rules for which the coalitional manipulation problem turns out to be NP-hard, in all other cases the possibility of manipulation is a much more serious concern. 1.1 Motivation and Problem Formulation In our work, we propose to extend the argument of computational intractability to address the cases where the approach appears to fail. We note that most incarnations of the manipulation problem studied so far are in the complete information setting, where the manipulators have complete knowledge of the preferences of the truthful voters. While these assumptions are indeed the best possible for the computationally negative results, we note that they are not reflective of typical real-world scenarios. Indeed, concerns regarding privacy of information, and in other cases, the sheer volume of information, would be significant hurdles for manipulators to obtain complete information. Motivated by this, we consider the manipulation problem in a natural partial infor2 mation setting. In particular, we model the partial information of the manipulators about the votes of the non-manipulators as partial orders over the set of candidates. A partial order over the set of candidates will be called a partial vote. Our results show that several of the voting rules that are easy to manipulate in the complete information setting become intractable when the manipulators know only partial votes. Indeed, for many voting rules, we show that even if the ordering of a small number of pairs of candidates is missing from the profile, manipulation becomes an intractable problem. Our results therefore strengthen the view that manipulation may not be practical if we limit the information the manipulators have at their disposal about the votes of other voters [CWX11]. We introduce three new computational problems that, in a natural way, extend the question of manipulation to the partial information setting. In these problems, the input is a set of partial votes P corresponding to the votes of the non-manipulators, a non-empty set of manipulators M, and a preferred candidate c. The task in the W EAK M ANIPULATION (WM) problem is to determine if there is a way to cast the manipulators’ votes such that c wins the election for at least one extension of the partial votes in P. On the other hand, in the S TRONG M ANIPULATION (SM) problem, we would like to know if there is a way of casting the manipulators’ votes such that c wins the election in every extension of the partial votes in P. We also introduce the problem of O PPORTUNISTIC M ANIPULATION (OM), which is an “intermediate” notion of manipulation. Let us call an extension of a partial profile viable if it is possible for the manipulators to vote in such a way that the manipulators’ desired candidate wins in that extension. In other words, a viable extension is a Y ES-instance of the standard C OALITIONAL M ANIPULATION problem. We have an opportunistic manipulation when it is possible for the manipulators to cast a vote which makes c win the election in all viable extensions. Note that any Y ES-instance of S TRONG M ANIPULATION is also an Y ES-instance of O PPORTUNISTIC M ANIPULATION, but this may not be true in the reverse direction. As a particularly extreme example, consider a partial profile where there are no viable extensions: this would be a N O-instance for S TRONG M ANIPULATION, but a (vacuous) Y ES-instance of O PPORTUNISTIC M ANIPULATION. The O PPORTUNISTIC M ANIPULATION problem allows us to explore a more relaxed notion of manipulation: one where the manipulators are obliged to be successful only in extensions where it is possible to be successful. Note that the goal with S TRONG M ANIPULATION is to be successful in all extensions, and therefore the only interesting instances are the ones where all extensions are viable. It is easy to see that Y ES instance of S TRONG M ANIPULATION is also a Y ES instance of O PPOR TUNISTIC M ANIPULATION and W EAK M ANIPULATION . Beyond this, we remark that all the three problems are questions with different goals, and neither of them render the other redundant. We refer the reader to Figure 1 for a simple example distinguishing these scenarios. All the problems above generalize C OALITIONAL M ANIPULATION, and hence any computational intractability result for C OALITIONAL M ANIPULATION immediately yields a corresponding intractability result for W EAK M ANIPULATION, S TRONG M ANIPULATION, and O PPORTUNISTIC M A NIPULATION under the same setting. For example, it is known that the C OALITIONAL M ANIPULA TION problem is intractable for the maximin voting rule when we have at least two manipulators [XZP+ 09]. Hence, the W EAK M ANIPULATION, S TRONG M ANIPULATION, and O PPORTUNISTIC M ANIPULATION problems are intractable for the maximin voting rule when we have at least two manipulators. 3 Figure 1: An example of a partial profile. Consider the plurality voting rule with one manipulator. If the favorite candidate is A, then the manipulator simply has to place A on the top of his vote to make A win in any extension. If the favorite candidate is B, there is no vote that makes B win in any extension. Finally, if the favorite candidate is C, then with a vote that places C on top, the manipulator can make C win in the only viable extension (Extension 2). 1.2 Related Work A notion of manipulation under partial information has been considered by Conitzer et al. [CWX11]. They focus on whether or not there exists a dominating manipulation and show that this problem is NP-hard for many common voting rules. Given some partial votes, a dominating manipulation is a non-truthful vote that the manipulator can cast which makes the winner at least as preferable (and sometimes more preferable) as the winner when the manipulator votes truthfully. The dominating manipulation problem and the W EAK M ANIPULATION, O PPOR TUNISTIC M ANIPULATION , and S TRONG M ANIPULATION problems do not seem to have any apparent complexity-theoretic connection. For example, the dominating manipulation problem is NP-hard for all the common voting rules except plurality and veto, whereas, the S TRONG M ANIPULATION problem is easy for most of the cases (see Table 1). However, the results in [CWX11] establish the fact that it is indeed possible to make manipulation intractable by restricting the amount of information the manipulators possess about the votes of the other voters. Elkind and Erdélyi [EE12] study manipulation under voting rule uncertainty. However, in our work, the voting rule is fixed and known to the manipulators. Two closely related problems that have been extensively studied in the context of incomplete votes are P OSSIBLE W INNER and N ECESSARY W INNER [KL05]. In the P OSSIBLE W INNER problem, we are given a set of partial votes P and a candidate c, and the question is whether there exists an extension of P where c wins, while in the N ECESSARY W INNER problem, the question is whether c is a winner in every extension of P. Following the work in [KL05], a number of special cases and variants of the P OSSIBLE W INNER problem have been studied in the literature [CLMM10, BBF10, BRR11, BRR+ 12, GNNW14, XC11, DL13, NW14, BFLR12, ML15]. The flavor of the W EAK M ANIPULATION problem is clearly similar to P OSSIBLE W INNER. However, we emphasize that there are subtle distinctions between the two problems. A more elaborate comparison is made in the next section. 4 1.3 Our Contribution Our primary contribution in this work is to propose and study three natural and realistic generalizations of the computational problem of manipulation in the incomplete information setting. We summarize the complexity results in this work in Table 1. Our results provide the following interesting insights on the impact of lack of information on the computational difficulty of manipulation. We note that the number of undetermined pairs of candidates per vote are small constants in all our hardness results. B We observe that the computational problem of manipulation for the plurality and veto voting rules remains polynomial time solvable even with lack of information, irrespective of the notion of manipulation under consideration [Proposition 1, Theorem 11 and 15, and Observation 4]. We note that the plurality and veto voting rule also remain vulnerable under the notion of dominating manipulation [CWX11]. B The impact of absence of information on the computational complexity of manipulation is more dynamic for the k-approval, k-veto, Bucklin, Borda, and maximin voting rules. Only the W EAK M ANIPULATION and O PPORTUNISTIC M ANIPULATION problems are computationally intractable for the k-approval [Theorem 1 and 5], k-veto [Theorem 2 and 6], Bucklin [Theorem 3 and 10], Borda [Observation 3 and Theorem 7], and maximin [Observation 3 and Theorem 8] voting rules, whereas the S TRONG M ANIPULATION problem remains computationally tractable [Theorem 11 to 14]. B Table 1 shows an interesting behavior of the Fallback voting rule. The Fallback voting rule is the only voting rule among the voting rules we study here for which the W EAK M ANIPULATION problem is NP-hard [Theorem 3] but both the O PPORTUNISTIC M ANIPULATION and S TRONG M ANIPULATION problems are polynomial time solvable [Theorem 13 and Observation 4]. This is because the O PPORTUNISTIC M ANIPULATION problem can be solved for the Fallback voting rule by simply making manipulators vote for their desired candidate. B Our results show that absence of information makes all the three notions of manipulations intractable for the Copelandα voting rule for every rational α ∈ [0, 1] \ {0.5} for the W EAK M ANIPULATION problem [Observation 3] and for every α ∈ [0, 1] for the O PPORTUNISTIC M ANIPULATION and S TRONG M ANIPULATION problems [Theorem 4 and 9]. Our results (see Table 1) show that whether lack of information makes the manipulation problems harder, crucially depends on the notion of manipulation applicable to the situation under consideration. All the three notions of manipulations are, in our view, natural extension of manipulation to the incomplete information setting and tries to capture different behaviors of manipulators. For example, the W EAK M ANIPULATION problem maybe applicable to an optimistic manipulator whereas for an pessimistic manipulator, the S TRONG M ANIPULATION problem may make more sense. Organization of the paper: We define the problems and introduce the basic terminology in the next section. We present our hardness results in Section 3. In Section 4, we present our polynomially solvable algorithms. Finally we conclude with future directions of research in Section 5. 5 WM, ` = 1 Plurality Veto k-Approval k-Veto Bucklin Fallback Borda maximin Copelandα WM OM, ` = 1 P NP-complete OM SM, ` = 1 SM P P coNP-hard P NP-complete coNP-hard P NP-hard coNP-hard Table 1: Summary of Results (` denotes the number of manipulators). The results in white follow immediately from the literature (Observation 1 to 3). Our results for the Copelandα voting rule hold for every rational α ∈ [0, 1]\{0.5} for the W EAK M ANIPULATION problem and for every α ∈ [0, 1] for the O PPORTUNISTIC M ANIPULATION and S TRONG M ANIPULATION problems. 2 Preliminaries In this section, we begin by providing the technical definitions and notations that we will need in the subsequent sections. We then formulate the problems that capture our notions of manipulation when the votes are given as partial orders, and finally draw comparisons with related problems that are already studied in the literature of computational social choice theory. 2.1 Notations and Definitions Let V = {v1 , . . . , vn } be the set of all voters and C = {c1 , . . . , cm } the set of all candidates. If not specified explicitly, n and m denote the total number of voters and the total number of candidates respectively. Each voter vi ’s vote is a preference i over the candidates which is a linear order over C. For example, for two candidates a and b, a i b means that the voter vi prefers a to b. We denote the set of all linear orders over C by L(C). Hence, L(C)n denotes the set of all n-voters’ preference profile (1 , . . . , n ). A map r : ∪n,|C|∈N+ L(C)n −→ 2C \ {∅} is called a voting rule. For some preference profile  ∈ L(C)n , if r() = {w}, then we say w wins uniquely and we write r() = w. From here on, whenever we say some candidate w wins, we mean that the candidate w wins uniquely. For simplicity, we restrict ourselves to the unique winner case in this paper. All our proofs can be easily extended in the co-winner case. A more general setting is an election where the votes are only partial orders over candidates. A partial order is a relation that is reflexive, antisymmetric, and transitive. A partial vote can be extended to possibly more than one linear vote depending on how we fix the order of the unspecified pairs of candidates. For example, in an election with the set of candidates C = {a, b, c}, a valid partial vote can be a  b. This partial vote can be extended to three linear votes namely, a  b  c, 6 a  c  b, c  a  b. In this paper, we often define a partial vote like  \A, where  ∈ L(C) and A ⊂ C × C, by which we mean the partial vote obtained by removing the order among the pair of candidates in A from . Also, whenever we do not specify the order among a set of candidates while describing a complete vote, the statement/proof is correct in whichever way we fix the order among them. We now give examples of some common voting rules. B Positional scoring rules: An m-dimensional vector α ~ = (α1 , α2 , . . . , αm ) ∈ Rm with α1 > α2 > . . . > αm and α1 > αm naturally defines a voting rule – a candidate gets score αi from a vote if it is placed at the ith position, and the score of a candidate is the sum of the scores it receives from all the votes. The winners are the candidates with maximum score. Scoring rules remain unchanged if we multiply every αi by any constant λ > 0 and/or add any constant µ. Hence, we assume without loss of generality that for any score vector α ~ , there exists a j such that αj − αj+1 = 1 and αk = 0 for all k > j. We call such a α ~ a normalized score vector. For α ~ = (m − 1, m − 2, . . . , 1, 0), we get the Borda voting rule. With αi = 1 ∀i 6 k and 0 else, the voting rule we get is known as k-approval. For the k-veto voting rule, we have αi = 0 ∀i 6 m − k and −1 else. Plurality is 1-approval and veto is 1-veto. B Bucklin and simplified Bucklin: Let ` be the minimum integer such that at least one candidate gets majority within top ` positions of the votes. The winners under the simplified Bucklin voting rule are the candidates having more than n/2 votes within top ` positions. The winners under the Bucklin voting rule are the candidates appearing within top ` positions of the votes highest number of times. B Fallback and simplified Fallback: For these voting rules, each voter v ranks a subset Xv ⊂ C of candidates and disapproves the rest of the candidates [BS09]. Now for the Fallback and simplified Fallback voting rules, we apply the Bucklin and simplified Bucklin voting rules respectively to define winners. If there is no integer ` for which at least one candidate gets more than n/2 votes, both the Fallback and simplified Fallback voting rules output the candidates with most approvals as winners. We assume, for simplicity, that the number of candidates each partial vote approves is known. B Maximin: For any two candidates x and y, let D(x, y) be N(x, y) − N(y, x), where N(x, y) (respectively N(y, x)) is the number of voters who prefer x to y (respectively y to x). The election we get by restricting all the votes to x and y only is called the pairwise election between x and y. The maximin score of a candidate x is miny6=x D(x, y). The winners are the candidates with maximum maximin score. B Copelandα . The Copelandα score of a candidate x is |{y 6= x : DE (x, y) > 0}| + α|{y 6= x : DE (x, y) = 0}|, where α ∈ [0, 1]. That is, the Copelandα of a candidate x is the number of other candidates it defeats in pairwise election plus α times the number of other candidates it ties with in pairwise elections. The winners are the candidates with the maximum Copelandα score. 2.2 Problem Definitions We now formally define the three problems that we consider in this work, namely W EAK M ANIPU LATION , O PPORTUNISTIC M ANIPULATION , and S TRONG M ANIPULATION . Let r be a fixed voting rule. We first introduce the W EAK M ANIPULATION problem. 7 Definition 1. r-W EAK M ANIPULATION Given a set of partial votes P over a set of candidates C, a positive integer ` (> 0) denoting the number of manipulators, and a candidate c, do there exist votes 1 , . . . , ` ∈ L(C) such that there exists an extension  ∈ L(C)|P| of P with r(, 1 , . . . , ` ) = c? To define the O PPORTUNISTIC M ANIPULATION problem, we first introduce the notion of an (r, c)opportunistic voting profile, where r is a voting rule and c is any particular candidate. Definition 2. (r, c)-Opportunistic Voting Profile Let ` be the number of manipulators and P a set of partial votes. An `-voter profile (i )i∈[`] ∈ L(C)` is called an (r, c)-opportunistic voting  profile if for each extension P  of P for which  there exists an `-vote profile (0i )i∈[`] ∈ L(C)` with r P ∪ 0i i∈[`] = c, we have r P ∪ (i )i∈[`] = c. In other words, an `-vote profile is (r, c)-opportunistic with respect to a partial profile if, when put together with the truthful votes of any extension, c wins if the extension is viable to begin with. We are now ready to define the O PPORTUNISTIC M ANIPULATION problem. Definition 3. r-O PPORTUNISTIC M ANIPULATION Given a set of partial votes P over a set of candidates C, a positive integer ` (> 0) denoting the number of manipulators, and a candidate c, does there exist an (r, c)-opportunistic `-vote profile? We finally define the S TRONG M ANIPULATION problem. Definition 4. r-S TRONG M ANIPULATION Given a set of partial votes P over a set of candidates C, a positive integer ` (> 0) denoting the number of manipulators, and a candidate c, do there exist votes (i )i∈` ∈ L(C)` such that for every extension  ∈ L(C)|P| of P, we have r(, (i )i∈[`] ) = c? We use (P, `, c) to denote instances of W EAK M ANIPULATION, O PPORTUNISTIC M ANIPULATION, and S TRONG M ANIPULATION, where P denotes a profile of partial votes, ` denotes the number of manipulators, and c denotes the desired winner. For the sake of completeness, we provide the definitions of the C OALITIONAL M ANIPULATION and P OSSIBLE W INNER problems below. Definition 5. r-C OALITIONAL M ANIPULATION Given a set of complete votes  over a set of candidates C, a positive integer ` (> 0) denoting the number   ` of manipulators, and a candidate c, do there exist votes (i )i∈` ∈ L(C) such that r , (i )i∈[`] = c? Definition 6. r-P OSSIBLE W INNER Given a set of partial votes P and a candidate c, does there exist an extension  of the partial votes in P to linear votes such that r() = c? 2.3 Comparison with Possible Winner and Coalitional Manipulation For any fixed voting rule, the W EAK M ANIPULATION problem with ` manipulators reduces to the P OSSIBLE W INNER problem. This is achieved by simply using the same set as truthful votes and introducing ` empty votes. We summarize this in the observation below. 8 Observation 1. The W EAK M ANIPULATION problem many-to-one reduces to the P OSSIBLE W INNER problem for every voting rule. Proof. Let (P, `, c) be an instance of W EAK M ANIPULATION. Let Q be the set consisting of ` many copies of partial votes {∅}. Clearly the W EAK M ANIPULATION instance (P, `, c) is equivalent to the P OSSIBLE W INNER instance (P ∪ Q, c). However, whether the P OSSIBLE W INNER problem reduces to the W EAK M ANIPULATION problem or not is not clear since in any W EAK M ANIPULATION problem instance, there must exist at least one manipulator and a P OSSIBLE W INNER instance may have no empty vote. From a technical point of view, the difference between the W EAK M ANIPULATION and P OSSIBLE W INNER problems may look marginal; however we believe that the W EAK M ANIPULATION problem is a very natural generalization of the C OALITIONAL M ANIPULATION problem in the partial information setting and thus worth studying. Similarly, it is easy to show, that the C OALITIONAL M ANIPULATION problem with ` manipulators reduces to W EAK M ANIPULATION, O PPORTUNISTIC M ANIPULATION, and S TRONG M ANIPULATION problems with ` manipulators, since the former is a special case of the latter ones. Observation 2. The C OALITIONAL M ANIPULATION problem with ` manipulators many-to-one reduces to W EAK M ANIPULATION, O PPORTUNISTIC M ANIPULATION, and S TRONG M ANIPULATION problems with ` manipulators for all voting rules and for all positive integers `. Proof. Follows from the fact that every instance of the C OALITIONAL M ANIPULATION problem is also an equivalent instance of the W EAK M ANIPULATION, O PPORTUNISTIC M ANIPULATION, and S TRONG M ANIPULATION problems. Finally, we note that the C OALITIONAL M ANIPULATION problem with ` manipulators can be reduced to the W EAK M ANIPULATION problem with just one manipulator, by introducing `−1 empty votes. These votes can be used to witness a good extension in the forward direction. In the reverse direction, given an extension where the manipulator is successful, the extension can be used as the manipulator’s votes. This argument leads to the following observation. Observation 3. The C OALITIONAL M ANIPULATION problem with ` manipulators many-to-one reduces to the W EAK M ANIPULATION problem with one manipulator for every voting rule and for every positive integer `. Proof. Let (P, `, c) be an instance of C OALITIONAL M ANIPULATION. Let Q be the set of consisting of `−1 many copies of partial vote {c  others}. Clearly the W EAK M ANIPULATION instance (P∪Q, 1, c) is equivalent to the C OALITIONAL M ANIPULATION instance (P, `, 1). This observation can be used to derive the hardness of W EAK M ANIPULATION even for one manipulator whenever the hardness for C OALITIONAL M ANIPULATION is known for any fixed number of manipulators (for instance, this is the case for the voting rules such as Borda, maximin and Copeland). However, determining the complexity of W EAK M ANIPULATION with one manipulator requires further work for voting rules where C OALITIONAL M ANIPULATION is polynomially solvable for any number of manipulators (such as k-approval, Plurality, Bucklin, and so on). 9 3 Hardness Results In this section, we present our hardness results. While some of our reductions are from the P OS SIBLE W INNER problem, the other reductions in this section are from the E XACT C OVER BY 3-S ETS problem, also referred to as X3C. This is a well-known NP-complete [GJ79] problem, and is defined as follows. Definition 7 (Exact Cover by 3-Sets (X3C)). Given a set U and a collection S = {S1 , S2 , . . . , St } of t subsets of U with |Si | = 3 ∀i = 1, . . . , t, does there exist a T ⊂ S with |T| = |U| 3 such that ∪X∈T X = U? We use X3C to refer to the complement of X3C, which is to say that an instance of X3C is a Y ES instance if and only if it is a N O instance of X3C. The rest of this section is organized according to the problems being addressed. 3.1 Weak Manipulation To begin with, recall that the C OALITIONAL M ANIPULATION problem is NP-complete for the Borda [DKNW11, BNW11], maximin [XZP+ 09], and Copelandα [FHS08, FHHR09, FHS10] voting rules for every rational α ∈ [0, 1] \ {0.5}, when we have two manipulators. Therefore, it follows from Observation 3 that the W EAK M ANIPULATION problem is NP-complete for the Borda, maximin, and Copelandα voting rules for every rational α ∈ [0, 1] \ {0.5}, even with one manipulator. For the k-approval and k-veto voting rules, we reduce from the corresponding P OSSIBLE W IN NER problems. While it is natural to start from the same voting profile, the main challenge is in undoing the advantage that the favorite candidate receives from the manipulator’s vote, in the reverse direction. We begin with proving that the W EAK M ANIPULATION problem is NP-complete for the k-approval voting rule even with one manipulator and at most 4 undetermined pairs per vote. Theorem 1. The W EAK M ANIPULATION problem is NP-complete for the k-approval voting rule even with one manipulator for any constant k > 1, even when the number of undetermined pairs in each vote is no more than 4. Proof. For simplicity of presentation, we prove the theorem for 2-approval. We reduce from the P OSSIBLE W INNER problem for 2-approval which is NP-complete [XC11], even when the number of undetermined pairs in each vote is no more than 4. Let P be the set of partial votes in a P OSSIBLE W INNER instance, and let C = {c1 , . . . , cm , c} be the set of candidates, where the goal is to check if there is an extension of P that makes c win. For developing the instance of W EAK M ANIPULATION, we need to “reverse” any advantage that the candidate c obtains from the vote of the manipulator. Notice that the most that the manipulator can do is to increase the score of c by one. Therefore, in our construction, we “artificially” increase the score of all the other candidates by one, so that despite of the manipulator’s vote, c will win the new election if and only if it was a possible winner in the P OSSIBLE W INNER instance. To this end, we introduce (m + 1) many dummy candidates d1 , . . . , dm+1 and the complete votes: wi = ci  di  others, for every i ∈ {1, . . . , m} Further, we extend the given partial votes of the P OSSIBLE W INNER instance to force the dummy candidates to be preferred least over the rest - by defining, for every vi ∈ P, the corresponding 10 partial vote v0i as follows. v0i = vi ∪ {C  {d1 , . . . , dm+1 }}. This ensures that all the dummy candidates do not receive any score from the modified partial votes corresponding to the partial votes of the P OSSIBLE W INNER instance. Notice that since the number of undetermined pairs in vi is no more than 4, the number of undetermined pairs in v0i is also no more than 4. Let (C0 , Q, c) denote this constructed W EAK M ANIPULATION instance. We claim that the two instances are equivalent. In the forward direction, suppose c is a possible winner with respect to P, and let P be an extension where c wins. Then it is easy to see that the manipulator can make c win in some extension by placing c and dm+1 in the first two positions of her vote (note that the partial score of dm+1 is zero in Q). Indeed, consider the extension of Q obtained by mimicking the extension P on the “common” partial votes, {v0i | vi ∈ P}. Notice that this is well-defined since vi and v0i have exactly the same set of incomparable pairs. In this extension, the score of c is strictly greater than the scores of all the other candidates, since the scores of all candidates in C is exactly one more than their scores in P, and all the dummy candidates have a score of at most one. In the reverse direction, notice that the manipulator puts the candidates c and dm+1 in the top two positions without loss of generality. Now suppose the manipulator’s vote c  dm+1  others makes c win the election for an extension Q of Q. Then consider the extension P obtained by restricting Q to C. Notice that the score of each candidate in C in this extension is one less than their scores in Q. Therefore, the candidate c wins this election as well, concluding the proof. The above proof can be imitated for any other constant values of k by reducing it from the P OSSIBLE W INNER problem for k-approval and introducing (m + 1)(k − 1) dummy candidates. We will use Lemma 1 in subsequent proofs which has been used before [BRR11, DMN15b, DMN16]. Lemma 1. Let C = {c1 , . . . , cm } ] D, (|D| > 0) be a set of candidates, and α ~ a normalized score vector of length |C|. Then, for any given X = (X1 , . . . , Xm ) ∈ Zm , there exists λ ∈ R and a voting profile such that the α ~ -score of ci is λ + Xi for all 1 6 i 6 m, and the score of candidates d ∈ D is less than λ. Pm Moreover, the number of votes is O(poly(|C| · i=1 |Xi |, λ)). Note that the number of votes used in Lemma 1 is polynomial in m if λ and |Xi | is polynomial in m for every i ∈ [m], which indeed is the case in all the proofs that use Lemma 1. We next show that the WM problem is NP-complete for the k-veto voting rule. Theorem 2. The W EAK M ANIPULATION problem for the k-veto voting rule is NP-complete even with one manipulator for any constant k > 1. Proof. We reduce from the P OSSIBLE W INNER problem for the k-veto voting rule which is known to be NP-complete [BD09]. Let P be the set of partial votes in a P OSSIBLE W INNER problem instance, and let C = {c1 , . . . , cm , c} be the set of candidates, where the goal is to check if there is an extension that makes c win with respect to k-veto. We assume without loss of generality that c’s position is fixed in all the partial votes (if not, then we fix the position of c as high as possible in every vote). We introduce k + 1 many dummy candidates d1 , . . . , dk , d. The role of the first k dummy candidates is to ensure that the manipulator is forced to place them at the “bottom k” positions of her vote, so that all the original candidates get the same score from the additional vote of the manipulator. The most natural way of achieving this is to ensure that the dummy candidates have the 11 same score as c in any extension (note that we know the score of c since c’s position is fixed in all the partial votes). This would force the manipulator to place these k candidates in the last k positions. Indeed, doing anything else will cause these candidates to tie with c, even when there is an extension of P that makes c win. To this end, we begin by placing the dummy candidates in the top k positions in all the partial votes. Formally, we modify every partial vote as follows: w = di  others, for every i ∈ {1, . . . , k} At this point, we know the scores of c and di , for every i ∈ {1, . . . , k}. Using Lemma 1, we add complete votes such that the final score of c is the same with the score of every di and the score of c is strictly more than the score of d. The relative score of every other candidate remains the same. This completes the description of the construction. We denote the augmented set of partial votes by P. We now argue the correctness. In the forward direction, if there is an extension of the votes that makes c win, then we repeat this extension, and the vote of the manipulator puts the candidate di at the position m + i + 2; and all the other candidates in an arbitrary fashion. Formally, we let the manipulator’s vote be: v = c  c1  · · ·  cm  d  d 1  · · ·  d k . By construction c wins the election in this particular setup. In the reverse direction, consider a vote of the manipulator and an extension Q of P in which c wins. Note that the manipulator’s vote necessarily places the candidates di in the bottom k positions — indeed, if not, then c cannot win the election by construction. We extend a partial vote w ∈ P by mimicking the extension of the corresponding partial vote w0 ∈ P, that is, we simply project the extension of w0 on the original set of candidates C. Let Q denote this proposed extension of P. We claim that c wins the election given by Q. Indeed, suppose not. Let ci be a candidate whose score is at least the score of c in the extension Q. Note that the scores of ci and c in the extension Q are exactly the same as their scores in Q, except for a constant offset — importantly, their scores are offset by the same amount. This implies that the score of ci is at least the score of c in Q as well, which is a contradiction. Hence, the two instances are equivalent. We next prove, by a reduction from X3C, that the W EAK M ANIPULATION problem for the Bucklin and simplified Bucklin voting rules is NP-complete even with one manipulator and at most 16 undetermined pairs per vote. Theorem 3. The W EAK M ANIPULATION problem is NP-complete for Bucklin, simplified Bucklin, Fallback, and simplified Fallback voting rules, even when we have only one manipulator and the number of undetermined pairs in each vote is no more than 16. Proof. We reduce the X3C problem to W EAK M ANIPULATION for simplified Bucklin. Let (U = {u1 , . . . , um }, S := {S1 , S2 , . . . , St }) be an instance of X3C, where each Si is a subset of U of size three. We construct a W EAK M ANIPULATION instance based on (U, S) as follows. Candidate set: C = W ∪ X ∪ D ∪ U ∪ {c, w, a, b}, where |W| = m − 3, |X| = 4, |D| = m + 1 We first introduce the following partial votes P in correspondence with the sets in the family as follows. W  X  Si  c  (U \ Si )  D \ ({X × ({c} ∪ Si )}) , ∀i 6 t 12 Notice that the number of undetermined pairs in every vote in P is 16. We introduce the following additional complete votes Q: B t copies of U  c  others B m/3 − 1 copies of U  a  c  others B m/3 + 1 copies of D  b  others The total number of voters, including the manipulator, is 2t + 2m/3 + 1. Now we show equivalence of the two instances. In the forward direction, suppose we have an exact set cover T ⊂ S. Let the vote of the manipulator v be c  D  others. We consider the following extension P of P. W  Si  c  X  (U \ Si )  D On the other hand, if Si ∈ S \ T, then we have: W  X  Si  c  (U \ Si )  D We claim that c is the unique simplified Bucklin winner in the profile (P, W, v). Notice that the simplified Bucklin score of c is m + 1 in this extension, since it appears in the top m + 1 positions in the m/3 votes corresponding to the set cover, t votes from the complete profile Q and one vote v of the manipulator. For any other candidate ui ∈ U, ui appears in the top m + 1 positions once in P and t + m 3 − 1 times in Q. Thus, ui does not get majority in top m + 1 positions making its simplified Bucklin score at least m + 2. Hence, c is the unique simplified Bucklin winner in the profile (P, W, v). Similarly, the candidate w1 appears only t times in the top m + 1 positions. The same can be argued for the remaining candidates in D, W, and w. In the reverse direction, suppose the W EAK M ANIPULATION is a Y ES instance. We may assume without loss of generality that the manipulator’s vote v is c  D  others, since the simplified Bucklin score of the candidates in D is at least 2m. Let P be the extension of P such that c is the unique winner in the profile (P, Q, v). As every candidate in W is ranked within top m + 2 positions m in t + m 3 + 1 votes in Q, for c to win, c  X must hold in at least 3 votes in P. In those votes, all the candidates in Si are also within top m + 2 positions. Now if any candidate in U is within top m + 1 positions in P more than once, then c will not be the unique winner. Hence, the Si ’s corresponding to the votes where c  X in P form an exact set cover. The reduction above also works for the Bucklin voting rule. Specifically, the argument for the forward direction is exactly the same as the simplified Bucklin above and the argument for the reverse direction is as follows. Every candidate in W is ranked within top m + 2 positions in t+ m 3 + 1 votes in Q and c is never placed within top m + 2 positions in any vote in Q. Hence, for c to win, c  X must hold in at least m 3 votes in P. In those votes, all the candidates in Si are also within top m positions. Notice that c never gets placed within top m positions in any vote in (P, Q). Now if any candidate x ∈ U is within top m positions in P more than once, then x gets majority within top m positions and thus c cannot win. The result for the Fallback and simplified Fallback voting rules follow from the corresponding results for the Bucklin and simplified Bucklin voting rules respectively since every Bucklin and simplified Bucklin election is also a Fallback and simplified Fallback election respectively. 13 3.2 Strong Manipulation We know that the C OALITIONAL M ANIPULATION problem is NP-complete for the Borda, maximin, and Copelandα voting rules for every rational α ∈ [0, 1] \ {0.5}, when we have two manipulators. Thus, it follows from Observation 2 that S TRONG M ANIPULATION is NP-hard for Borda, maximin, and Copelandα voting rules for every rational α ∈ [0, 1] \ {0.5} for at least two manipulators. For the case of one manipulator, S TRONG M ANIPULATION turns out to be polynomial-time solvable for most other voting rules. For Copelandα , however, we show that the problem is co-NP-hard for every α ∈ [0, 1] for a single manipulator, even when the number of undetermined pairs in each vote is bounded by a constant. This is achieved by a careful reduction from X3C. The following lemma has been used before [McG53]. Lemma 2. For any function f : C × C −→ Z, such that 1. ∀a, b ∈ C, f(a, b) = −f(b, a). 2. ∀a, b, c, d ∈ C, f(a, b) + f(c, d) is even, there exists a n-voters’ profile such that for all a, b ∈ C, a defeats b with a margin of f(a, b). Moreover,   X n is even and n = O  |f(a, b)| {a,b}∈C×C We have following intractability result for the S TRONG M ANIPULATION problem for the Copelandα rule with one manipulator and at most 10 undetermined pairs per vote. Theorem 4. S TRONG M ANIPULATION is co-NP-hard for Copelandα voting rule for every α ∈ [0, 1] even when we have only one manipulator and the number of undetermined pairs in each vote is no more than 10. Proof. We reduce X3C to S TRONG M ANIPULATION for Copelandα rule. Let (U = {u1 , . . . , um }, S = {S1 , S2 , . . . , St }) is an X3C instance. We assume, without loss of generality, t to be an even integer (if not, replicate any set from S). We construct a corresponding W EAK M ANIPULATION instance for Copelandα as follows. Candidate set C = U ∪ {c, w, z, d} Partial votes P: ∀i 6 t, (U \ Si )  c  z  d  Si  w \ {{z, c} × (Si ∪ {d, w})} Notice that the number of undetermined pairs in every vote in P is 10. Now we add a set Q of complete votes with |Q| even and |Q| = poly(m, t) using Lemma 2 to achieve the following margin of victories in pairwise elections. Figure 2 shows the weighted majority graph of the resulting election. B DQ (d, z) = DQ (z, c) = DQ (c, d) = DQ (w, z) = 4t B DQ (ui , d) = DQ (c, ui ) = 4t ∀ui ∈ U B DQ (z, ui ) = t ∀ui ∈ U 14 B DQ (c, w) = t − B DQ (ui , ui+1 2m 3 −2 (mod ∗)m ) = 4t ∀ui ∈ U B DQ (a, b) = 0 for every a, b ∈ C, a 6= b, not mentioned above d 4t uj 4t uj+1 w 4t 4t t 4t t− c 2m 3 4t −2 4t z Figure 2: Weighted majority graph of the reduced instance in Theorem 4. The weight of all the edges not shown in the figure are 0. For simplicity, we do not show edges among {u1 , . . . , um }. We have only one manipulator who tries to make c winner. Notice that the number of votes in the S TRONG M ANIPULATION instance (P ∪ Q, 1, c) including the manipulator’s vote is odd (since |P| and |Q| are even integers). Therefore, DP∗ ∪Q∪{v∗ } (a, b) is never zero for every a, b ∈ C, a 6= b in every extension P∗ of P and manipulators vote v∗ and consequently the particular value of α does not play any role in this reduction. Hence, we assume, without loss of generality, α to be zero from here on and simply use the term Copeland instead of Copelandα . Now we show that the X3C instance (U, S) is a Y ES instance if and only if the S TRONG M ANIPU LATION instance (P ∪ Q, 1, c) is a N O instance (a S TRONG M ANIPULATION instance is a N O instance if there does not exist a vote of the manipulator which makes c the unique winner in every extension of the partial votes). We can assume without loss of generality that manipulator puts c at first position and z at last position in her vote v. Assume that the X3C instance is a Y ES instance. Suppose (by renaming) that S1 , . . . , S m3 forms an exact set cover. We claim that the following extension P of P makes both z and c Copeland co-winners. Extension P of P: m i 6 , (U \ Si )  c  z  d  Si  w 3 m + 1, (U \ Si )  d  Si  w  c  z i> 3 We have summarize the pairwise margins between z and c and the rest of the candidates from the profile (P ∪ Q ∪ v) in Table 2. The candidates z and c are the co-winners with Copeland score (m + 1). 15 C \ {z} DP∪Q∪v (z, ·) C \ {c} DP∪Q∪v (c, ·) c > 3t z, ui ∈ U > 3t w, d 6 −3t w −1 ui ∈ U 1 d 6 −3t Table 2: DP∪Q∪v (z, ·) and DP∪Q∪v (c, ·) For the other direction, notice that Copeland score of c is at least m + 1 since c defeats d and every candidate in U in every extension of P. Also notice that the Copeland score of z can be at most m + 1 since z loses to w and d in every extension of P. Hence the only way c cannot be the unique winner is that z defeats all candidates in U and w defeats c. This requires w  c in at least t− m 3 extensions of P. We claim that the sets Si in the remaining of the extensions where c  w forms an exact set cover for (U, S). Indeed, otherwise some candidate ui ∈ U is not covered. Then, notice that ui  z in all t votes, making D(z, ui ) = −1. 3.3 Opportunistic Manipulation All our reductions for the co-NP-hardness for O PPORTUNISTIC M ANIPULATION start from X3C. We note that all our hardness results hold even when there is only one manipulator. Our overall approach is the following. We engineer a set of partial votes in such a way that the manipulator is forced to vote in a limited number of ways to have any hope of making her favorite candidate win. For each such vote, we demonstrate a viable extension where the vote fails to make the candidate a winner, leading to a N O instance of O PPORTUNISTIC M ANIPULATION. These extensions rely on the existence of an exact cover. On the other hand, we show that if there is no exact set cover, then there is no viable extension, thereby leading to an instance that is vacuously a Y ES instance of O PPORTUNISTIC M ANIPULATION. Our first result on O PPORTUNISTIC M ANIPULATION shows that the O PPORTUNISTIC M ANIPULATION problem is co-NP-hard for the k-approval voting rule for constant k > 3 even when the number of manipulators is one and the number of undetermined pairs in each vote is no more than 15. Theorem 5. The O PPORTUNISTIC M ANIPULATION problem is co-NP-hard for the k-approval voting rule for constant k > 3 even when the number of manipulators is one and the number of undetermined pairs in each vote is no more than 15. Proof. We reduce X3C to O PPORTUNISTIC M ANIPULATION for k-approval rule. Let (U = {u1 , . . . , um }, S = {S1 , S2 , . . . , St }) is an X3C instance. We construct a corresponding O PPORTUNISTIC M ANIPULATION instance for k-approval voting rule as follows. We begin by introducing a candidate for every element of the universe, along with k − 3 dummy candidates (denoted by W), and special candidates {c, z1 , z2 , d, x, y}. Formally, we have: Candidate set C = U ∪ {c, z1 , z2 , d, x, y} ∪ W. Now, for every set Si in the universe, we define the following total order on the candidate set, which we denote by P0i : W  Si  y  z1  z2  x  (U \ Si )  c  d 16 Using P0i , we define the partial vote Pi as follows: Pi = P0i \ ({{y, x, z1 , z2 } × Si } ∪ {(z1 , z2 ), (x, z1 ), (x, z2 )}). We denote the set of partial votes {Pi : i ∈ [t]} by P and {P0i : i ∈ [t]} by P0 . We remark that the number of undetermined pairs in each partial vote Pi is 15. We now invoke Lemma 1 from [DMN16], which allows to achieve any pre-defined scores on the candidates using only polynomially many additional votes. Using this, we add a set Q of complete votes with |Q| = poly(m, t) to ensure the following scores, where we denote the k-approval score of a candidate from a set of votes V by sV (·): sQ (z1 ) = sQ (z2 ) = sQ (y) = sQ (c) − m/3; sQ (d), sQ (w) 6 sQ (c) − 2t ∀w ∈ W; sQ (x) = sQ (c) − 1; sP0 ∪Q (uj ) = sQ (c) + 1 ∀j ∈ [m]. Our reduced instance is (P ∪ Q, 1, c). The reasoning for this score configuration will be apparent as we argue the equivalence. We first argue that if we had a Y ES instance of X3C (in other words, there is no exact cover), then we have a Y ES instance of O PPORTUNISTIC M ANIPULATION. It turns out that this will follow from the fact that there are no viable extensions, because, as we will show next, a viable extension implies the existence of an exact set cover. To this end, first observe that the partial votes are constructed in such a way that c gets no additional score from any extension. Assuming that the manipulator approves c (without loss of generality), the final score of c in any extension is going to be sQ (c) + 1. Now, in any viable extension, every candidate uj has to be “pushed out” of the top k positions at least once. Observe that whenever this happens, y is forced into the top k positions. Since y is behind the score of c by only m/3 votes, Si ’s can be pushed out of place in only m/3 votes. For every uj to lose one point, these votes must correspond to an exact cover. Therefore, if there is no exact cover, then there is no viable extension, showing one direction of the reduction. On the other hand, suppose we have a N O instance of X3C – that is, there is an exact cover. Let {Si : i ∈ [m/3]} forms an exact cover of U. We will now use the exact cover to come up with two viable extensions, both of which require the manipulator to vote in different ways to make c win. Therefore, there is no single manipulative vote that accounts for both extensions, leading us to a N O instance of O PPORTUNISTIC M ANIPULATION. First, consider this completion of the partial votes: i = 1, W  y  x  z1  z2  Si  (U \ Si )  c  d 2 6 i 6 m/3, W  y  z1  z2  x  Si  (U \ Si )  c  d m/3 + 1 6 i 6 t, W  Si  y  z1  z2  x  (U \ Si )  c  d Notice that in this completion, once accounted for along with the votes in Q, the score of c is tied with the scores of all uj ’s, z1 , x and y, while the score of z2 is one less than the score of c. Therefore, the only k candidates that the manipulator can afford to approve are W, the candidates c, d and z2 . However, consider the extension that is identical to the above except with the first vote changed to: W  y  x  z2  z1  Si  (U \ Si )  c  d Here, on the other hand, the only way for c to be an unique winner is if the manipulator approves W, c, d and z1 . Therefore, it is clear that there is no way for the manipulator to provide a consolidated vote for both these profiles. Therefore, we have a N O instance of O PPORTUNISTIC M ANIPULATION. 17 We next move on to the k-veto voting rule and show that the O PPORTUNISTIC M ANIPULATION problem for the k-veto is co-NP-hard for every constant k > 4 even when the number of manipulators is one and the number of undetermined pairs in each vote is no more than 15. Theorem 6. The O PPORTUNISTIC M ANIPULATION problem is co-NP-hard for the k-veto voting rule for every constant k > 4 even when the number of manipulators is one and the number of undetermined pairs in each vote is no more than 15. Proof. We reduce X3C to O PPORTUNISTIC M ANIPULATION for k-veto rule. Let (U = {u1 , . . . , um }, S = {S1 , S2 , . . . , St }) is an X3C instance. We construct a corresponding O PPORTUNISTIC M ANIPULATION instance for k-veto voting rule as follows. Candidate set C = U ∪ {c, z1 , z2 , d, x, y} ∪ A ∪ W, where A = {a1 , a2 , a3 }, |W| = k − 4 For every i ∈ [t], we define P0i as follows: ∀i 6 t, c  A  (U \ Si )  d  Si  y  x  z1  z2  W Using P0i , we define partial vote Pi = P0i \ ({{y, x, z1 , z2 } × Si } ∪ {(z1 , z2 ), (x, z1 ), (x, z2 )}) for every i ∈ [t]. We denote the set of partial votes {Pi : i ∈ [t]} by P and {P0i : i ∈ [t]} by P0 . We note that the number of undetermined pairs in each partial vote Pi is 15. Using Lemma 1, we add a set Q of complete votes with |Q| = poly(m, t) to ensure the following. We denote the k-veto score of a candidate from a set of votes W by sW (·). B sP0 ∪Q (z1 ) = sP0 ∪Q (z2 ) = sP0 ∪Q (c) − m/3 B sP0 ∪Q (ai ) = sP0 ∪Q (uj ) = sP0 ∪Q (w) = sP0 ∪Q (c) ∀ai ∈ A, uj ∈ U, w ∈ W B sP0 ∪Q (y) = sP0 ∪Q (c) − m/3 − 1 B sP0 ∪Q (x) = sP0 ∪Q (c) − 2 We have only one manipulator who tries to make c winner. Now we show that the X3C instance (U, S) is a Y ES instance if and only if the O PPORTUNISTIC M ANIPULATION instance (P ∪ Q, 1, c) is a N O instance. In the forward direction, let us now assume that the X3C instance is a Y ES instance. Suppose (by renaming) that S1 , . . . , Sm/3 forms an exact set cover. Let us assume that the manipulator’s vote v disapproves every candidate in W ∪ A since otherwise c can never win uniquely. We now show that if v does not disapprove z1 then, v is not a c-optimal vote. Suppose v does not disapprove z1 . Then we consider the following extension P of P. i = 1, c  A  (U \ Si )  d  y  z1  x  z2  Si  W 2 6 i 6 m/3, c  A  (U \ Si )  d  y  z1  z2  x  Si  W m/3 + 1 6 i 6 t, c  A  (U \ Si )  d  Si  y  x  z1  z2  W We have the following scores sP∪Q (c) = sP∪Q (z1 ) = sP∪Q (z2 ) + 1 = sP∪Q (x) + 1 = sP∪Q (uj ) + 1 ∀uj ∈ U. Hence, both c and z1 win for the votes P∪Q∪{v}. However, the vote v0 which disapproves a1 , a2 , a3 , z1 makes c a unique winner for the votes P ∪ Q ∪ {v0 }. Hence, v is not a c-optimal vote. Similarly, we can show that if the manipulator’s vote does not disapprove z2 then, the vote is not 18 c-optimal. Hence, there does not exist any c-optimal vote and the O PPORTUNISTIC M ANIPULATION instance is a N O instance. In the reverse direction, we show that if the X3C instance is a N O instance, then there does not exist a vote v of the manipulator and an extension P of P such that c is the unique winner for the votes P ∪ Q ∪ {v0 } thereby proving that the O PPORTUNISTIC M ANIPULATION instance is vacuously Y ES (and thus every vote is c-optimal). Notice that, there must be at least m/3 votes P1 in P where the corresponding Si gets pushed in bottom k positions since sP0 ∪Q (uj ) = sP0 ∪Q (c) ∀ai ∈ A, uj ∈ U. However, in each vote in P1 , y is placed within top m − k many position and thus we have |P1 | is exactly m/3 since sP0 ∪Q (y) = sP0 ∪Q (c) − m/3 − 1. Now notice that there must be at least one candidate u ∈ U which is not covered by the sets Si s corresponding to the votes P1 because the X3C instance is a N O instance. Hence, c cannot win the election uniquely irrespective of the manipulator’s vote. Thus every vote is c-optimal and the O PPORTUNISTIC M ANIPULATION instance is a Y ES instance. We show next similar intractability result for the Borda voting rule too with only at most 7 undetermined pairs per vote. Theorem 7. The O PPORTUNISTIC M ANIPULATION problem is co-NP-hard for the Borda voting rule even when the number of manipulators is one and the number of undetermined pairs in every vote is no more than 7. Proof. We reduce X3C to O PPORTUNISTIC M ANIPULATION for the Borda rule. Let (U = {u1 , . . . , um }, S = {S1 , S2 , . . . , St }) is an X3C instance. Without loss of generality we assume that m is not divisible by 6 (if not, then we add three new elements b1 , b2 , b3 to U and a set {b1 , b2 , b3 } to S). We construct a corresponding O PPORTUNISTIC M ANIPULATION instance for the Borda voting rule as follows. Candidate set C = U ∪ {c, z1 , z2 , d, y} For every i ∈ [t], we define P0i as follows: ∀i 6 t, y  Si  z1  z2  (U \ Si )  d  c Using P0i , we define partial vote Pi = P0i \ ({({y} ∪ Si ) × {z1 , z2 }} ∪ {(z1 , z2 )}) for every i ∈ [t]. We denote the set of partial votes {Pi : i ∈ [t]} by P and {P0i : i ∈ [t]} by P0 . We note that the number of undetermined pairs in each partial vote Pi is 7. Using Lemma 1, we add a set Q of complete votes with |Q| = poly(m, t) to ensure the following. We denote the Borda score of a candidate from a set of votes W by sW (·). B sP0 ∪Q (y) = sP0 ∪Q (c) + m + m/3 + 3 B sP0 ∪Q (z1 ) = sP0 ∪Q (c) − 3bm/6c − 2 B sP0 ∪Q (z2 ) = sP0 ∪Q (c) − 5bm/6c − 3 B sP0 ∪Q (ui ) = sP0 ∪Q (c) + m + 5 − i ∀i ∈ [m] B sP0 ∪Q (d) 6 sP0 ∪Q (c) − 5m 19 We have only one manipulator who tries to make c winner. Now we show that the X3C instance (U, S) is a Y ES instance if and only if the O PPORTUNISTIC M ANIPULATION instance (P∪Q, 1, c) is a N O instance. Notice that we can assume without loss of generality that the manipulator places c at the first position, d at the second position, the candidate ui at (m + 5 − i)th position for every i ∈ [m], and y at the last position, since otherwise c can never win uniquely irrespective of the extension of P (that it, the manipulator’s vote looks like c  d  {z1 , z2 }  um  um−1  · · ·  u1  y). In the forward direction, let us now assume that the X3C instance is a Y ES instance. Suppose (by renaming) that S1 , . . . , Sm/3 forms an exact set cover. Let the manipulator’s vote v be c  d  z1  z2  um  · · ·  u1  y. We now argue that v is not a c-optimal vote. The other case where the manipulator’s vote v0 be c  d  z2  z1  um  · · ·  u1  y can be argued similarly. We consider the following extension P of P. 1 6 i 6 bm/6c, z2  y  Si  z1  (U \ Si )  d  c dm/6e 6 i 6 m/3, z1  y  Si  z2  (U \ Si )  d  c m/3 + 1 6 i 6 t, y  Si  z1  z2  (U \ Si )  d  c We have the following Borda scores sP∪Q∪{v} (c) = sP∪Q∪{v} (y) + 1 = sP∪Q∪{v} (z2 ) + 6 = sP∪Q∪{v} (z1 ) = sP∪Q∪{v} (ui ) + 1 ∀i ∈ [m]. Hence, c does not win uniquely for the votes P ∪ Q ∪ {v}. However, c is the unique winner for the votes P ∪ Q ∪ {v0 }. Hence, there does not exist any c-optimal vote and the O PPORTUNISTIC M ANIPULATION instance is a N O instance. In the reverse direction, we show that if the X3C instance is a N O instance, then there does not exist a vote v of the manipulator and an extension P of P such that c is the unique winner for the votes P ∪ Q ∪ {v0 } thereby proving that the O PPORTUNISTIC M ANIPULATION instance is vacuously Y ES (and thus every vote is c-optimal). Notice that the score of y must decrease by at least m/3 for c to win uniquely. However, in every vote v where the score of y decreases by at least one in any extension P of P, at least one of z1 or z2 must be placed at top position of the vote v. However, the candidates z1 and z2 can be placed at top positions of the votes in P at most m/3 many times while ensuring c does not lose the election. Also, even after manipulator places the candidate ui at (m + 5 − i)th position for every i ∈ [m], for c to win uniquely, the score of every ui must decrease by at least one. Hence, altogether, there will be exactly m/3 votes (denoted by the set P1 ) in any extension of P where y is placed at the second position. However, since the X3C instance is a N O instance, the Si s corresponding to the votes in P1 does not form a set cover. Let u ∈ U be an element not covered by the Si s corresponding to the votes in P1 . Notice that the score of u does not decrease in the extension P and thus c does not win uniquely irrespective of the manipulator’s vote. Thus every vote is c-optimal and thus the O PPORTUNISTIC M ANIPULATION instance is a Y ES instance. Thus every vote is c-optimal and the O PPORTUNISTIC M ANIPULATION instance is a Y ES instance. For the maximin voting rule, we show intractability of O PPORTUNISTIC M ANIPULATION with one manipulator even when the number of undetermined pairs in every vote is at most 8. Theorem 8. The O PPORTUNISTIC M ANIPULATION problem is co-NP-hard for the maximin voting rule even when the number of manipulators is one and the number of undetermined pairs in every vote is no more than 8. 20 Proof. We reduce X3C to O PPORTUNISTIC M ANIPULATION for the maximin rule. Let (U = {u1 , . . . , um }, S = {S1 , S2 , . . . , St }) is an X3C instance. We construct a corresponding O PPORTUNISTIC M ANIPULATION instance for the maximin voting rule as follows. Candidate set C = U ∪ {c, z1 , z2 , z3 , d, x, y} For every i ∈ [t], we define P0i as follows: ∀i 6 t, Si  x  d  y  (U \ Si )  z1  z2  z3 Using P0i , we define partial vote Pi = P0i \ ({({x} ∪ Si ) × {d, y}}) for every i ∈ [t]. We denote the set of partial votes {Pi : i ∈ [t]} by P and {P0i : i ∈ [t]} by P0 . We note that the number of undetermined pairs in each partial vote Pi is 8. We define another partial vote p as follows. p = (z1  z2  z3  others ) \ {(z1 , z2 ), (z2 , z3 ), (z1 , z3 )} Using Lemma 2, we add a set Q of complete votes with |Q| = poly(m, t) to ensure the following pairwise margins (notice that the pairwise margins among z1 , z2 , and z3 does not include the partial vote p). Figure 3 shows the weighted majority graph of the resulting election. B DP0 ∪Q∪{p} (d, c) = 4t + 1 B DP0 ∪Q∪{p} (x, d) = 4t + 2m/3 + 1 B DP0 ∪Q∪{p} (y, x) = 4t − 2m/3 + 1 B DP0 ∪Q∪{p} (d, uj ) = 4t − 1 ∀uj ∈ U B DP0 ∪Q (z1 , z2 ) = DP0 ∪Q (z2 , z3 ) = DP0 ∪Q (z3 , z1 ) = 4t + 2 B |DP0 ∪Q∪{p} (a, b)| 6 1 for every a, b ∈ C not defined above. We have only one manipulator who tries to make c winner. Now we show that the X3C instance (U, S) is a Y ES instance if and only if the O PPORTUNISTIC M ANIPULATION instance (P ∪ Q ∪ {p}, 1, c) is a N O instance. Notice that we can assume without loss of generality that the manipulator’s vote prefers c to every other candidate, y to x, x to d, and d to uj for every uj ∈ U. In the forward direction, let us now assume that the X3C instance is a Y ES instance. Suppose (by renaming) that S1 , . . . , Sm/3 forms an exact set cover. Notice that the manipulator’s vote must prefer either z2 to z1 or z1 to z3 or z3 to z2 . We show that if the manipulator’s vote v prefers z2 to z1 , then v is not a c-optimal vote. The other two cases are symmetrical. Consider the following extension P of P and p of p. 1 6 i 6 m/3, d  y  Si  x  (U \ Si )  z1  z2  z3 m/3 + 1 6 i 6 t, Si  x  d  y  (U \ Si )  z1  z2  z3 p = z2  z3  z1  others From the votes in P ∪ Q ∪ {v, p}, the maximin score of c is −4t, of d, x, uj ∀uj ∈ U are −4t − 2, of z1 , z3 are at most than −4t − 2, and of z2 is −4t. Hence, c is not the unique maximn winner. 21 d 4t − 1 uj z1 4t + 2 4t + 2 z3 4t + 2 z2 4t + 1 4t + 2m/3 + 1 c y x 4t − 2m/3 + 1 Figure 3: Weighted majority graph of the reduced instance in Theorem 8. Solid line and dashed line represent pairwise margins in P0 ∪Q∪{p} and P0 ∪Q respectively. The weight of all the edges not shown in the figure are within −1 to 1. For simplicity, we do not show edges among {u1 , . . . , um }. However, the manipulator’s vote c  z1  z2  z3  other makes c the unique maximin winner. Hence, v is not a c-optimal vote. For the reverse direction, we show that if the X3C instance is a N O instance, then there does not exist a vote v of the manipulator and an extension P of P such that c is the unique winner for the votes P ∪ Q ∪ {v0 } thereby proving that the O PPORTUNISTIC M ANIPULATION instance is vacuously Y ES (and thus every vote is c-optimal). Consider any extension P of P. Notice that, for c to win uniquely, y  x must be at least m/3 of the votes in P; call these set of votes P1 . However, d  x in every vote in P1 and d  x can be in at most m/3 votes in P for c to win uniquely. Hence, we have |P1 | = m/3. Also for c to win, each d  uj must be at least one vote of P and d  uj is possible only in the votes in P1 . However, the sets Si s corresponding to the votes in P1 does not form a set cover since the X3C instance is a N O instance. Hence, there must exist a uj ∈ U for which uj  d in every vote in P and thus c cannot win uniquely irrespective of the vote of the manipulator. Thus every vote is c-optimal and the O PPORTUNISTIC M ANIPULATION instance is a Y ES instance. Our next result proves that the O PPORTUNISTIC M ANIPULATION problem is co-NP-hard for the Copelandα voting rule too for every α ∈ [0, 1] even with one manipulator and at most 8 undetermined pairs per vote. Theorem 9. The O PPORTUNISTIC M ANIPULATION problem is co-NP-hard for the Copelandα voting rule for every α ∈ [0, 1] even when the number of manipulators is one and the number of undetermined pairs in each vote is no more than 8. Proof. We reduce X3C to O PPORTUNISTIC M ANIPULATION for the Copelandα voting rule. Let (U = {u1 , . . . , um }, S = {S1 , S2 , . . . , St }) is an X3C instance. We construct a corresponding O PPORTUNISTIC M ANIPULATION instance for the Copelandα voting rule as follows. Candidate set C = U ∪ {c, z1 , z2 , z3 , d1 , d2 , d3 , x, y} For every i ∈ [t], we define P0i as follows: 22 ∀i 6 t, Si  x  y  c  others Using P0i , we define partial vote Pi = P0i \({({x}∪Si )×{c, y}}) for every i ∈ [t]. We denote the set of partial votes {Pi : i ∈ [t]} by P and {P0i : i ∈ [t]} by P0 . We note that the number of undetermined pairs in each partial vote Pi is 8. We define another partial vote p as follows. p = (z1  z2  z3  others ) \ {(z1 , z2 ), (z2 , z3 ), (z1 , z3 )} Using Lemma 2, we add a set Q of complete votes with |Q| = poly(m, t) to ensure the following pairwise margins (notice that the pairwise margins among z1 , z2 , and z3 does not include the partial vote p). Figure 4 shows the weighted majority graph of the resulting election. B DP0 ∪Q∪{p} (uj , c) = 2 ∀uj ∈ U B DP0 ∪Q∪{p} (x, y) = 2m/3 B DP0 ∪Q∪{p} (c, y) = DP0 ∪Q∪{p} (x, c) = DP0 ∪Q∪{p} (di , c) = DP0 ∪Q∪{p} (zk , c) DP0 ∪Q∪{p} (uj , x) = DP0 ∪Q∪{p} (x, zk ) = DP0 ∪Q∪{p} (di , x) = DP0 ∪Q∪{p} (y, uj ) DP0 ∪Q∪{p} (di , y) = DP0 ∪Q∪{p} (y, zk ) = DP0 ∪Q∪{p} (zk , uj ) = DP0 ∪Q∪{p} (uj , di ) DP0 ∪Q∪{p} (zk , d1 ) = DP0 ∪Q∪{p} (zk , d2 ) = DP0 ∪Q∪{p} (d3 , zk ) = 4t ∀i, k ∈ [3], j ∈ [m] = = = B DP0 ∪Q∪{p} (uj , u` ) = −4t for at least m/3 many u` ∈ U B DP0 ∪Q (z1 , z2 ) = DP0 ∪Q (z2 , z3 ) = DP0 ∪Q (z3 , z1 ) = 1 B |DP0 ∪Q∪{p} (a, b)| 6 1 for every a, b ∈ C not defined above. We have only one manipulator who tries to make c winner. Now we show that the X3C instance (U, S) is a Y ES instance if and only if the O PPORTUNISTIC M ANIPULATION instance (P ∪ Q ∪ {p}, 1, c) is a N O instance. Since the number of voters is odd, α does not play any role in the reduction and thus from here on we simply omit α. Notice that we can assume without loss of generality that the manipulator’s vote prefers c to every other candidate and x to y. In the forward direction, let us now assume that the X3C instance is a Y ES instance. Suppose (by renaming) that S1 , . . . , Sm/3 forms an exact set cover. Suppose the manipulator’s vote v order z1 , z2 , and z3 as z1  z2  z3 . We will show that v is not a c-optimal vote. Symmetrically, we can show that the manipulator’s vote ordering z1 , z2 , and z3 in any other order is not c-optimal. Consider the following extension P of P and p of p. 1 6 i 6 m/3, y  c  Si  x  others m/3 + 1 6 i 6 t, Si  x  y  c  others p = z1  z2  z3  others From the votes in P ∪ Q ∪ {v, p}, the Copeland score of c is m + 4 (defeating y, zk , uj ∀k ∈ [3], j ∈ [m]), of y is m+3 (defeating zk , uj ∀k ∈ [3], j ∈ [m]), of uj is at most 2m/3+4 (defeating x, di ∀i ∈ [3] and at most 2m/3 many u` ∈ U), of x is 5 (defeating c, y, zk ∀l ∈ [3]), of d1 , d2 is 2 (defeating y and c), of d3 is 5 (defeating y, c, zk ∀k ∈ [3]). of z3 is m + 3 (defeating di , uj ∀i ∈ [3], j ∈ [m]) for every k ∈ [3], of z3 is m + 2 (defeating d1 , d2 , uj i ∈ [3], j ∈ [m]), z2 is m + 3 (defeating 23 uj z1 1 2 z2 y c 1 z3 d1 2m/3 x d2 d3 1 Figure 4: Weighted majority graph of the reduced instance in Theorem 9. Solid line and dashed line represent pairwise margins in P0 ∪ Q ∪ {p} and P0 ∪ Q respectively. The weight of all the edges not shown in the figure are within −1 to 1. The weight of all unlabeled edges are 4t. For simplicity, we do not show edges among {u1 , . . . , um }. 24 d1 , d2 , z3 , uj i ∈ [3], j ∈ [m]), z1 is m + 4 (defeating d1 , d2 , z2 , z3 , uj i ∈ [3], j ∈ [m]). Hence, c co-wins with z1 with Copeland score m + 4. However, the manipulator’s vote c  z3  z2  z1 makes c win uniquely. Hence, v is not a c-optimal vote and thus the O PPORTUNISTIC M ANIPULATION instance is a N O instance. For the reverse direction, we show that if the X3C instance is a N O instance, then there does not exist a vote v of the manipulator and an extension P of P such that c is the unique winner for the votes P ∪ Q ∪ {v0 } thereby proving that the O PPORTUNISTIC M ANIPULATION instance is vacuously Y ES (and thus every vote is c-optimal). Consider any extension P of P. Notice that, for c to win uniquely, c must defeat each uj ∈ U and thus c is preferred over uj in at least one vote in P; we call these votes P1 . However, in every vote in P1 , y is preferred over x and thus |P1 | 6 m/3 because x must defeat y for c to win uniquely. Since the X3C instance is a N O instance, there must be a candidate u ∈ U which is not covered by the sets corresponding to the votes in P1 and thus u is preferred over c in every vote in P. Hence, c cannot win uniquely irrespective of the vote of the manipulator. Thus every vote is c-optimal and the O PPORTUNISTIC M ANIPULATION instance is a Y ES instance. For the Bucklin and simplified Bucklin voting rules, we show intractability of the O PPORTUNIS TIC M ANIPULATION problem with at most 15 undetermined pairs per vote and only one manipulator. Theorem 10. The O PPORTUNISTIC M ANIPULATION problem is co-NP-hard for the Bucklin and simplified Bucklin voting rules even when the number of manipulators is one and the number of undetermined pairs in each vote is no more than 15. Proof. We reduce X3C to O PPORTUNISTIC M ANIPULATION for the Bucklin and simplified Bucklin voting rules. Let (U = {u1 , . . . , um }, S = {S1 , S2 , . . . , St }) is an X3C instance. We assume without loss of generality that m is not divisible by 6 (if not, we introduce three elements in U and a set containing them in S) and t is an even integer (if not, we duplicate any set in S). We construct a corresponding O PPORTUNISTIC M ANIPULATION instance for the Bucklin and simplified Bucklin voting rules as follows. Candidate set C = U ∪ {c, z1 , z2 , x1 , x2 , d} ∪ W, where |W| = m − 3 For every i ∈ [t], we define P0i as follows: ∀i 6 t, (U \ Si )  Si  d  x1  x2  z1  z2  others P0i , Using we define partial vote Pi = P0i \ ({({d} ∪ Si ) × {x1 , x2 , z1 , z2 }} ∪ {(z1 , z2 )}) for every i ∈ [t]. We denote the set of partial votes {Pi : i ∈ [t]} by P and {P0i : i ∈ [t]} by P0 . We note that the number of undetermined pairs in each partial vote Pi is 15. We introduce the following additional complete votes Q: B t/2 − bm/6c − 1 copies of W  z1  z2  x1  c  others B t/2 − bm/6c − 1 copies of W  z1  z2  x2  c  others B 2dm/6e copies of W  z1  z2  d  c  others B bm/6c copies of W  z1  d  x1  c  others B bm/6c copies of W  z1  d  x2  c  others 25 B 2dm/6e − 1 copies of U  x1  others B One U  c  others We have only one manipulator who tries to make c winner. Now we show that the X3C instance (U, S) is a Y ES instance if and only if the O PPORTUNISTIC M ANIPULATION instance (P∪Q, 1, c) is a N O instance. The total number of voters in the O PPORTUNISTIC M ANIPULATION instance is 2t + 2m/3 + 1. We notice that within top m + 1 positions of the votes in P0 ∪ Q, c appears t + m/3 times, z1 and z2 appear t + bm/6c times, x1 appears t/2 + m/3 − 1 times, x2 appears t/2 − 1 times, every candidate in W appears t + m/3 − 1 times, every candidate in U appears t + m/3 + 1 times. Also every candidate in U appears t + m/3 + 1 times within top m positions of the votes in P ∪ Q. Hence, for both Bucklin and simplified Bucklin voting rules, we can assume without loss of generality that the manipulator puts c, every candidate in W, x1 , x2 , and exactly one of z1 and z2 . In the forward direction, let us now assume that the X3C instance is a Y ES instance. Suppose (by renaming) that S1 , . . . , Sm/3 forms an exact set cover. Suppose the manipulator’s vote v puts c, every candidate in W, x1 , x2 , and z1 within top m + 1 positions. We will show that v is not c-optimal. The other case where the manipulator’s vote v0 puts c, every candidate in W, x1 , x2 , and z2 within top m + 1 positions is symmetrical. Consider the following extension P of P: 1 6 i 6 bm/6c, (U \ Si )d  x1  x2  z2  Si  z1  others dm/6e 6 i 6 m/3, (U \ Si )d  x1  x2  z1  Si  z2  others m/3 + 1 6 i 6 t, (U \ Si )  Si  d  x1  x2  z1  z2  others For both Bucklin and simplified Bucklin voting rules, c co-wins with z1 for the votes in P ∪ Q ∪ {v}. However, c wins uniquely for the votes in P ∪ Q ∪ {v0 }. Hence, v is not a c-optimal vote and thus the O PPORTUNISTIC M ANIPULATION instance is a N O instance. For the reverse direction, we show that if the X3C instance is a N O instance, then there does not exist a vote v of the manipulator and an extension P of P such that c is the unique winner for the votes P ∪ Q ∪ {v0 } thereby proving that the O PPORTUNISTIC M ANIPULATION instance is vacuously Y ES (and thus every vote is c-optimal). Consider any extension P of P. Notice that, for c to win uniquely, every candidate must be pushed out of top m + 1 positions in at least one vote in P; we call these set of votes P1 . Notice that, |P1 | > m/3. However, in every vote in P1 , at least one of z1 and z2 appears within top m + 1 many positions. Since, the manipulator has to put at least one of z1 and z2 within its top m + 1 positions and z1 and z2 appear t + bm/6c times in the votes in P0 ∪ Q, we must have |P1 | 6 m/3 and thus |P1 | = m/3, for c to win uniquely. However, there exists a candidate u ∈ U not covered by the Si s corresponding to the votes in P1 . Notice that u gets majority within top m positions of the votes and c can never get majority within top m + 1 positions of the votes. Hence, c cannot win uniquely irrespective of the vote of the manipulator. Thus every vote is c-optimal and the O PPORTUNISTIC M ANIPULATION instance is a Y ES instance. 4 Polynomial Time Algorithms We now turn to the polynomial time cases depicted in Table 1. This section is organized in three parts, one for each problem considered. 26 4.1 Weak Manipulation Since the P OSSIBLE W INNER problem is in P for the plurality and the veto voting rules [BD09], it follows from Observation 1 that the W EAK M ANIPULATION problem is in P for the plurality and veto voting rules for any number of manipulators. Proposition 1. The W EAK M ANIPULATION problem is in P for the plurality and veto voting rules for any number of manipulators. Proof. The P OSSIBLE W INNER problem is in P for the plurality and the veto voting rules [BD09]. Hence, the result follows from Observation 1. 4.2 Strong Manipulation We now discuss our algorithms for the S TRONG M ANIPULATION problem. The common flavor in all our algorithms is the following: we try to devise an extension that is as adversarial as possible for the favorite candidate c, and if we can make c win in such an extension, then roughly speaking, such a strategy should work for other extensions as well (where the situation only improves for c). However, it is challenging to come up with an extension that is globally dominant over all the others in the sense that we just described. So what we do instead is we consider every potential nemesis w who might win instead of c, and we build profiles that are “as good as possible” for w and “as bad as possible” for c. Each such profile leads us to constraints on how much the manipulators can afford to favor w (in terms of which positions among the manipulative votes are safe for w). We then typically show that we can determine whether there exists a set of votes that respects these constraints, either by using a greedy strategy or by an appropriate reduction to a flow problem. We note that the overall spirit here is similar to the approaches commonly used for solving the N ECESSARY W INNER problem, but as we will see, there are non-trivial differences in the details. We begin with the k-approval and k-veto voting rules. Theorem 11. The S TRONG M ANIPULATION problem is in P for the k-approval and k-veto voting rules, for any k and any number of manipulators. Proof. For the time being, we just concentrate on non-manipulators’ votes. For each candidate 0 0 c0 ∈ C \ {c}, calculate the maximum possible value of smax NM (c, c ) = sNM (c ) − sNM (c) from nonmanipulators’ votes, where sNM (a) is the score that candidate a receives from the votes of the non-manipulators. This can be done by checking all 4 possible score combinations that c and c0 can get in each vote v and choosing the one which maximizes sv (c0 ) − sv (c) from that vote. We now fix the position of c at the top position for the manipulators’ votes and we check if it is possible to place 0 0 other candidates in the manipulators’ votes such that the final value of smax NM (c, c )+sM (c )−sM (c) is negative which can be solved easily by reducing it to the max flow problem which is polynomial time solvable. We now prove that the S TRONG M ANIPULATION problem for scoring rules is in P for one manipulator. Theorem 12. The S TRONG M ANIPULATION problem is in P for any scoring rule when we have only one manipulator. 27 0 Proof. For each candidate c0 ∈ C \ {c}, calculate smax NM (c, c ) using same technique described in the proof of Theorem 11. We now put c at the top position of the manipulator’s vote. For each candidate c0 ∈ C \ {c}, c0 can be placed at positions i ∈ {2, . . . , m} in the manipulator’s vote which 0 makes smax NM (c, c ) + αi − α1 negative. Using this, construct a bipartite graph with C \ {c} on left and {2, . . . , m} on right and there is an edge between c0 and i iff the candidate c0 can be placed at i in the manipulator’s vote according to the above criteria. Now solve the problem by finding existence of perfect matching in this graph. Our next result proves that the S TRONG M ANIPULATION problem for the Bucklin, simplified Bucklin, Fallback, and simplified Fallback voting rules are in P. Theorem 13. The S TRONG M ANIPULATION problem is in P for the Bucklin, simplified Bucklin, Fallback, and simplified Fallback voting rules, for any number of manipulators. Proof. Let (C, P, M, c) be an instance of S TRONG M ANIPULATION for simplified Bucklin, and let m denote the total number of candidates in this instance. Recall that the manipulators have to cast their votes so as to ensure that the candidate c wins in every possible extension of P. We use Q to denote the set of manipulating votes that we will construct. To begin with, without loss of generality, the manipulators place c in the top position of all their votes. We now have to organize the positioning of the remaining candidates across the votes of the manipulators to ensure that c is a necessary winner of the profile (P, Q). To this end, we would like to develop a system of constraints indicating the overall number of times that we are free to place a candidate w ∈ C \ {c} among the top ` positions in the profile Q. In particular, let us fix w ∈ C \ {c} and 2 6 ` 6 m. Let ηw,` be the maximum number of votes of Q in which w can appear in the top ` positions. Our first step is to compute necessary conditions for ηw,` . We use Pw,` to denote a set of complete votes that we will construct based on the given partial votes. Intuitively, these votes will represent the “worst” possible extensions from the point of view of c when pitted against w. These votes are engineered to ensure that the manipulators can make c win the elections Pw,` for all w ∈ C \ {c} and ` ∈ {2, . . . , m}, if, and only if, they can strongly manipulate in favor of c. More formally, there exists a voting profile Q of the manipulators so that c wins the election Pw,` ∪ Q, for all w ∈ C \ {c} and ` ∈ {2, . . . , m} if and only if c wins in every extension of the profile P ∪ Q. We now describe the profile Pw,` . The construction is based on the following case analysis, where our goal is to ensure that, to the extent possible, we position c out of the top ` − 1 positions, and incorporate w among the top ` positions. B Let v ∈ P be such that either c and w are incomparable or w  c. We add the complete vote v0 to Pw,` , where v0 is obtained from v by placing w at the highest possible position and c at the lowest possible position, and extending the remaining vote arbitrarily. B Let v ∈ P be such that c  w, but there are at least ` candidates that are preferred over w in v. We add the complete vote v0 to Pw,` , where v0 is obtained from v by placing c at the lowest possible position, and extending the remaining vote arbitrarily. B Let v ∈ P be such that c is forced to be within the top ` − 1 positions, then we add the complete vote v0 to Pw,` , where v0 is obtained from v by first placing w at the highest possible position followed by placing c at the lowest possible position, and extending the remaining vote arbitrarily. 28 B In the remaining votes, notice that whenever w is in the top ` positions, c is also in the top ` − 1 positions. Let P∗w,` denote this set of votes, and let t be the number of votes in P∗w,` . We now consider two cases. Let d` (c) be the number of times c is placed in the top ` − 1 positions in the profile Pw,` ∪ Q, and let d` (w) be the number of times w is placed in the top ` positions in the profile Pw,` . Let us now formulate the requirement that in Pw,` ∪ Q, the candidate c does not have a majority in the top ` − 1 positions and w does have a majority in the top ` positions. Note that if this requirement holds for any w and `, then strong manipulation is not possible. Therefore, to strongly manipulate in favor of c, we must ensure that for every choice of w and `, we are able to negate the conditions that we derive. The first condition from above simply translates to d` (c) 6 n/2. The second condition amounts to requiring first, that there are at least n/2 votes where w appears in the top ` positions, that is, d` (w) + ηw,` + t > n/2. Further, note that the gap between d` (w) + ηw,` and majority will be filled by using votes from P∗w,` to “push” w forward. However, these votes contribute equally to w and c being in the top ` and ` − 1 positions, respectively. Therefore, the difference between d` (w) + ηw,` and n/2 must be less than the difference between d` (c) and n/2. Summarizing, the following conditions, which we collectively denote by (?), are sufficient to defeat c in some extension: d` (c) 6 n/2, d` (w) + ηw,` + t > n/2, n/2 − d` (w) + ηw,` < n/2 − d` (c). From the manipulator’s point of view, the above provides a set of constraints to be satisfied as they place the remaining candidates across their votes. Whenever d` (c) > n/2, the manipulators place any of the other candidates among the top ` positions freely, because c already has majority. On the other hand, if d` (c) 6 n/2, then the manipulators must respect at least one of the following constraints: ηw,` 6 n/2 − t − d` (w) and ηw,` 6 d` (c) − d` (w). Extending the votes of the manipulator while respecting these constraints (or concluding that this is impossible to do) can be achieved by a natural greedy strategy — construct the manipulators’ votes by moving positionally from left to right. For each position, consider each manipulator and populate her vote for that position with any available candidate. We output the profile if the process terminates by completing all the votes, otherwise, we say N O. We now argue the proof of correctness. Suppose the algorithm returns N O. This implies that there exists a choice of w ∈ C \ {c} and ` ∈ {2, . . . , m} such that for any voting profile Q of the manipulators, the conditions in (?) are satisfied. (Indeed, if there exists a voting profile that violated at least one of these conditions, then the greedy algorithm would have discovered it.) Therefore, no matter how the manipulators cast their vote, there exists an extension where c is defeated. In particular, for the votes in P \ P∗w,` , this extension is given by Pw,` . Further, we choose n/2 − ηw,` − d` (w) votes among the votes in P∗w,` and extend them by placing w in the top ` positions (and extending the rest of the profile arbitrary). We extend the remaining votes in P∗w,` by positioning w outside the top ` positions. Clearly, in this extension, c fails to achieve majority in the top ` − 1 positions while w does achieve majority in the top ` positions. On the other hand, if the algorithm returns Y ES, then consider the voting profile of the manipulators. We claim that c wins in every extension of P ∪ Q. Suppose, to the contrary, that there exists an extension R and a candidate w such that the simplified Bucklin score of c is no more than the simplified Bucklin score of w in R. In this extension, therefore, there exists ` ∈ {2, . . . , m} for which w attains majority in the top ` positions and c fails to attain majority in the top ` − 1 positions. However, note that this is already impossible in any extension of the profile Pw,l ∪ P∗w,` , because of the design of the constraints. By construction, the number of votes in which c appears in the top ` − 1 positions in R is only greater than the number of times c appears in the top ` − 1 positions in 29 any extension of Pw,l ∪ P∗w,` (and similarly for w). This leads us to the desired contradiction. For the Bucklin voting rule, we do the following modifications to the algorithm. If d` (c) > d` (w) for some w ∈ C \ {c} and ` < m, then we make ηw,` = ∞. The proof of correctness for the Bucklin voting rule is similar to the proof of correctness for the simplified Bucklin voting rule above. For Fallback and simplified Fallback voting rules, we consider the number of candidates each voter approves while computing ηw,` . We output Y ES if and only if ηw,` > 0 for every w ∈ C \ {c} and every ` 6 m, since we can assume, without loss of generality, that the manipulator approves the candidate c only. Again the proof of correctness is along similar lines to the proof of correctness for the simplified Bucklin voting rule. We next show that the S TRONG M ANIPULATION problem for the maximin voting rule is polynomial-time solvable when we have only one manipulator. Theorem 14. The S TRONG M ANIPULATION problem for the maximin voting rules are in P, when we have only one manipulator. Proof. For the time being, just concentrate on non-manipulators’ votes. Using the algorithm for NW for maximin in [XC11], we compute for all pairs w, w0 ∈ C, N(w,w0 ) (w, d) and N(w,w0 ) (c, w0 ) for all d ∈ C \ {c}. This can be computed in polynomial time. Now we place c at the top position in the manipulator’s vote and increase all N(w,w0 ) (c, w0 ) by one. Now we place a candidate w at the second position if for all w0 ∈ C, N0(w,w0 ) (w, d) < N(w,w0 ) (c, w0 ) for all d ∈ C \ {c}, where N0(w,w0 ) (w, d) = N(w,w0 ) (w, d) of the candidate d has already been assigned some position in the manipulator’s vote, and N0(w,w0 ) (w, d) = N(w,w0 ) (w, d) + 1 else. The correctness argument is in the similar lines of the classical greedy manipulation algorithm of [BITT89]. 4.3 Opportunistic Manipulation For the plurality, Fallback, and simplified Fallback voting rules, it turns out that the voting profile where all the manipulators approve only c is a c-opportunistic voting profile, and therefore it is easy to devise a manipulative vote. Observation 4. The O PPORTUNISTIC M ANIPULATION problem is in P for the plurality and Fallback voting rules for a any number of manipulators. For the veto voting rule, however, a more intricate argument is needed, that requires building a system of constraints and a reduction to a suitable instance of the maximum flow problem in a network, to show polynomial time tractability of O PPORTUNISTIC M ANIPULATION. Theorem 15. The O PPORTUNISTIC M ANIPULATION problem is in P for the veto voting rule for a constant number of manipulators. Proof. Let (P, `, c) be an input instance of O PPORTUNISTIC M ANIPULATION. We may assume without loss of generality that the manipulators approve P c. We view the voting profile of the manipulators as a tuple (na )a∈C\{c} ∈ (N ∪ {0})m−1 with a∈C\{c} na = `, where the na many manipulators disapprove a. We denote the set of such tuples as T and we have |T| = O((2m)` ) which is polynomial in m since ` is a constant. A tuple (na )a∈C\{c} ∈ T is not c-optimal if there exists another tuple (n0a )a∈C\{c} ∈ T and an extension P of P with the following properties. We denote the veto score of a candidate from P by s(·). For every candidate a ∈ C \ {c}, we define two quantities w(a) and d(a) as follows. 30 B s(c) > s(a) for every a ∈ C \ {c} with na = n0a = 0 and we define w(a) = s(c) − 1, d(a) = 0 B s(c) > s(a)−n0a for every a ∈ C\{c} with na > n0a and we define w(a) = s(c)−n0a −1, d(a) = 0 B s(a) − na > s(c) > s(a) − n0a for every a ∈ C \ {c} with na < n0a and we define w(a) = s(c) − n0a , d(a) = s(a) − na We guess the value of s(c). Given a value of s(c), we check the above two conditions by reducing this to a max flow problem instance as follows. We have a source vertex s and a sink t. We have a vertex for every a ∈ C (call this set of vertices Y) and a vertex for every vote v ∈ P (call this set of vertices X). We add an edge from s to each in X of capacity one. We add an edge of capacity one from a vertex x ∈ X to a vertex y ∈ Y if the candidate corresponding to the vertex y can be placed at the last position in an extension of the partial vote corresponding to the vertex x. We add an edge from a vertex y to t of capacity w(a), where a is the voter corresponding to the vertex y. We also set the demand of every vertex y d(a) (that is the total amount of flow coming into vertex y must be at least d(a)), where a is the voter corresponding to the vertex y. Clearly, the above three conditions are met if and only if there is a feasible |P| amount of flow in the above flow graph. Since s(c) can have only |P| + 1 possible values (from 0 to P) and |T| = O((2m)` ), we can iterate over all possible pairs of tuples in T and all possible values of s(c) and find a c-optimal voting profile if there exists a one. 5 Conclusion We revisited many settings where the complexity barrier for manipulation was non-existent, and studied the problem under an incomplete information setting. Our results present a fresh perspective on the use of computational complexity as a barrier to manipulation, particularly in cases that were thought to be dead-ends (because the traditional manipulation problem was polynomially solvable). To resurrect the argument of computational hardness, we have to relax the model of complete information, but we propose that the incomplete information setting is more realistic, and many of our hardness results work even with very limited incompleteness of information. Our work is likely to be the starting point for further explorations. To begin with, we leave open the problem of completely establishing the complexity of strong, opportunistic, and weak manipulations for all the scoring rules. Other fundamental forms of manipulation and control do exist in voting, such as destructive manipulation and control by adding candidates. It would be interesting to investigate the complexity of these problems in a partial information setting. Another exciting direction is the study of average case complexity, as opposed to the worst case results that we have pursued. These studies have already been carried out in the setting of complete information [PR06, FP10, Wal10]. Studying the problems that we propose in the averagecase model would reveal further insights on the robustness of the incomplete information setting as captured by our model involving partial orders. Our results showed that the impact of paucity of information on the computational complexity of manipulation crucially depends on the notion of manipulation under consideration. We also argued that different notions of manipulation may be applicable to different situations, maybe based of how optimistic (or pessimistic) the manipulators are. One important direction of future research 31 is to run extensive experimentations on real and synthetic data to know how people manipulate in the absence of complete information. Acknowledgement Palash Dey wishes to gratefully acknowledge support from Google India for providing him with a special fellowship for carrying out his doctoral work. Neeldhara Misra acknowledges support by the INSPIRE Faculty Scheme, DST India (project IFA12-ENG-31). References [BBF10] Yoram Bachrach, Nadja Betzler, and Piotr Faliszewski. Probabilistic possible winner determination. In International Conference on Artificial Intelligence (AAAI), volume 10, pages 697–702, 2010. [BCE+ 15] Felix Brandt, Vincent Conitzer, Ulle Endriss, Jérôme Lang, and Ariel D Procaccia. Handbook of computational social choice, 2015. [BD09] Nadja Betzler and Britta Dorn. Towards a dichotomy of finding possible winners in elections based on scoring rules. In Mathematical Foundations of Computer Science (MFCS), pages 124–136. Springer, 2009. [BFLR12] Dorothea Baumeister, Piotr Faliszewski, Jérôme Lang, and Jörg Rothe. Campaigns for lazy voters: truncated ballots. In International Conference on Autonomous Agents and Multiagent Systems, AAMAS 2012, Valencia, Spain, June 4-8, 2012 (3 Volumes), pages 577–584, 2012. [BIO91] John Bartholdi III and James B. Orlin. Single transferable vote resists strategic voting. Soc. Choice Welf., 8(4):341–354, 1991. [BITT89] John Bartholdi III, C.A. Tovey, and M.A. Trick. The computational difficulty of manipulating an election. Soc. Choice Welf., 6(3):227–241, 1989. [BNW11] Nadja Betzler, Rolf Niedermeier, and Gerhard J Woeginger. Unweighted coalitional manipulation under the borda rule is NP-hard. In IJCAI, volume 11, pages 55–60, 2011. [BRR11] Dorothea Baumeister, Magnus Roos, and Jörg Rothe. Computational complexity of two variants of the possible winner problem. In The 10th International Conference on Autonomous Agents and Multiagent Systems (AAMAS), pages 853–860, 2011. [BRR+ 12] Dorothea Baumeister, Magnus Roos, Jörg Rothe, Lena Schend, and Lirong Xia. The possible winner problem with uncertain weights. In ECAI, pages 133–138, 2012. [BS09] Steven J Brams and M Remzi Sanver. Voting systems that combine approval and preference. In The mathematics of preference, choice and order, pages 215–237. Springer, 2009. 32 [CLMM10] Yann Chevaleyre, Jérôme Lang, Nicolas Maudet, and Jérôme Monnot. Possible winners when new candidates are added: The case of scoring rules. In Proc. International Conference on Artificial Intelligence (AAAI), 2010. [CSL07] Vincent Conitzer, Tuomas Sandholm, and Jérôme Lang. When are elections with few candidates hard to manipulate? J. ACM, 54(3):14, 2007. [CWX11] Vincent Conitzer, Toby Walsh, and Lirong Xia. Dominating manipulations in voting with partial information. In International Conference on Artificial Intelligence (AAAI), volume 11, pages 638–643, 2011. [Dey15] Palash Dey. Computational complexity of fundamental problems in social choice theory. In Proc. 2015 International Conference on Autonomous Agents and Multiagent Systems, pages 1973–1974. International Foundation for Autonomous Agents and Multiagent Systems, 2015. [DKNW11] Jessica Davies, George Katsirelos, Nina Narodytska, and Toby Walsh. Complexity of and algorithms for borda manipulation. In Proc. International Conference on Artificial Intelligence (AAAI), pages 657–662, 2011. [DL13] Ning Ding and Fangzhen Lin. Voting with partial information: what questions to ask? In Proc. 12th International Conference on Autonomous Agents and Multi-agent Systems (AAMAS), pages 1237–1238. International Foundation for Autonomous Agents and Multiagent Systems, 2013. [DMN15a] Palash Dey, Neeldhara Misra, and Y. Narahari. Detecting possible manipulators in elections. In Proc. 2015 International Conference on Autonomous Agents and Multiagent Systems, AAMAS 2015, Istanbul, Turkey, May 4-8, 2015, pages 1441–1450, 2015. [DMN15b] Palash Dey, Neeldhara Misra, and Y. Narahari. Kernelization complexity of possible winner and coalitional manipulation problems in voting. In Proc. 2015 International Conference on Autonomous Agents and Multiagent Systems, AAMAS 2015, Istanbul, Turkey, May 4-8, 2015, pages 87–96, 2015. [DMN16] Palash Dey, Neeldhara Misra, and Y. Narahari. Kernelization complexity of possible winner and coalitional manipulation problems in voting. Theor. Comput. Sci., 616:111– 125, 2016. [DN14] Palash Dey and Y Narahari. Asymptotic collusion-proofness of voting rules: the case of large number of candidates. In Proc. 13th International Conference on Autonomous Agents and Multiagent Systems (AAMAS), pages 1419–1420. International Foundation for Autonomous Agents and Multiagent Systems, 2014. [DN15] Palash Dey and Y Narahari. Asymptotic collusion-proofness of voting rules: The case of large number of candidates. Studies in Microeconomics, 3(2):120–139, 2015. [EE12] Edith Elkind and Gábor Erdélyi. Manipulation under voting rule uncertainty. In Proc. 11th International Conference on Autonomous Agents and Multiagent Systems (AAMAS), pages 627–634. International Foundation for Autonomous Agents and Multiagent Systems, 2012. 33 [ER91] Eithan Ephrati and Jeffrey S Rosenschein. The Clarke tax as a consensus mechanism among automated agents. In Proc. Ninth International Conference on Artificial Intelligence (AAAI), pages 173–178, 1991. [FHH10] Piotr Faliszewski, Edith Hemaspaandra, and Lane A Hemaspaandra. Using complexity to protect elections. Commun ACM, 53(11):74–82, 2010. [FHHR09] Piotr Faliszewski, Edith Hemaspaandra, Lane A. Hemaspaandra, and Jörg Rothe. Llull and copeland voting computationally resist bribery and constructive control. J. Artif. Intell. Res., 35:275–341, 2009. [FHS08] Piotr Faliszewski, Edith Hemaspaandra, and Henning Schnoor. Copeland voting: Ties matter. In Proc. 7th International Conference on Autonomous Agents and Multiagent Systems (AAMAS), pages 983–990. International Foundation for Autonomous Agents and Multiagent Systems, 2008. [FHS10] Piotr Faliszewski, Edith Hemaspaandra, and Henning Schnoor. Manipulation of copeland elections. In Proc. 9th International Conference on Autonomous Agents and Multiagent Systems (AAMAS), pages 367–374. International Foundation for Autonomous Agents and Multiagent Systems, 2010. [FKN08] Ehud Friedgut, Gil Kalai, and Noam Nisan. Elections can be manipulated often. In IEEE 49th Annual IEEE Symposium on Foundations of Computer Science (FOCS), pages 243–249. IEEE, 2008. [FKS03] Ronald Fagin, Ravi Kumar, and D. Sivakumar. Efficient similarity search and classification via rank aggregation. In Proc. 2003 ACM SIGMOD International Conference on Management of Data, SIGMOD ’03, pages 301–312, New York, NY, USA, 2003. ACM. [FP10] Piotr Faliszewski and Ariel D Procaccia. Ai’s war on manipulation: Are we winning? AI Magazine, 31(4):53–64, 2010. [Gib73] Allan Gibbard. Manipulation of voting schemes: a general result. Econometrica, pages 587–601, 1973. [GJ79] Michael R Garey and David S Johnson. Computers and Intractability, volume 174. freeman New York, 1979. [GNNW14] Serge Gaspers, Victor Naroditskiy, Nina Narodytska, and Toby Walsh. Possible and necessary winner problem in social polls. In Proc. 13th International Conference on Autonomous Agents and Multiagent Systems (AAMAS), pages 613–620. International Foundation for Autonomous Agents and Multiagent Systems, 2014. [IKM12] M. Isaksson, G. Kindler, and E. Mossel. The geometry of manipulation - a quantitative proof of the gibbard-satterthwaite theorem. Combinatorica, 32(2):221–250, 2012. [KL05] Kathrin Konczak and Jérôme Lang. Voting procedures with incomplete preferences. In Proc. International Joint Conference on Artificial Intelligence-05 Multidisciplinary Workshop on Advances in Preference Handling, volume 20, 2005. 34 [McG53] David C McGarvey. A theorem on the construction of voting paradoxes. Econometrica, pages 608–610, 1953. [ML15] Vijay Menon and Kate Larson. Complexity of manipulation in elections with partial votes. CoRR, abs/1505.05900, 2015. [NW14] Nina Narodytska and Toby Walsh. The computational impact of partial votes on strategic voting. In Proc. 21st European Conference on Artificial Intelligence, 18-22 August 2014, Prague, Czech Republic - Including Prestigious Applications of Intelligent Systems (PAIS 2014), pages 657–662, 2014. [PHG00] David M. Pennock, Eric Horvitz, and C. Lee Giles. Social choice theory and recommender systems: Analysis of the axiomatic foundations of collaborative filtering. In Proc. Seventeenth National Conference on Artificial Intelligence and Twelfth Conference on on Innovative Applications of Artificial Intelligence, July 30 - August 3, 2000, Austin, Texas, USA., pages 729–734, 2000. [PR06] Ariel D Procaccia and Jeffrey S Rosenschein. Junta distributions and the averagecase complexity of manipulating elections. In Proc. Fifth International Conference on Autonomous Agents and Multiagent Systems (AAMAS), pages 497–504. ACM, 2006. [PR07] Ariel D. Procaccia and Jeffrey S. Rosenschein. Average-case tractability of manipulation in voting via the fraction of manipulators. In Proc. 6th International Joint Conference on Autonomous Agents and Multiagent Systems (AAMAS 2007), Honolulu, Hawaii, USA, May 14-18, 2007, page 105, 2007. [Sat75] Mark Allen Satterthwaite. Strategy-proofness and Arrow’s conditions: Existence and correspondence theorems for voting procedures and social welfare functions. J. Econ. Theory, 10(2):187–217, 1975. [Wal10] Toby Walsh. An empirical study of the manipulability of single transferable voting. In Proc. 19th European Conference on Artificial Intelligence (ECAI), pages 257–262, 2010. [Wal11] Toby Walsh. Where are the hard manipulation problems? J. Artif. Intell. Res., pages 1–29, 2011. [XC08a] Lirong Xia and Vincent Conitzer. Generalized scoring rules and the frequency of coalitional manipulability. In Proc. 9th ACM conference on Electronic Commerce (EC), pages 109–118. ACM, 2008. [XC08b] Lirong Xia and Vincent Conitzer. A sufficient condition for voting rules to be frequently manipulable. In Proc. 9th ACM conference on Electronic Commerce (EC), pages 99–108. ACM, 2008. [XC11] Lirong Xia and Vincent Conitzer. Determining possible and necessary winners under common voting rules given partial orders. volume 41, pages 25–67. AI Access Foundation, 2011. 35 [XZP+ 09] Lirong Xia, Michael Zuckerman, Ariel D Procaccia, Vincent Conitzer, and Jeffrey S Rosenschein. Complexity of unweighted coalitional manipulation under some common voting rules. In Proc. 21st International Joint Conference on Artificial Intelligence (IJCAI), volume 9, pages 348–352, 2009. 36
8cs.DS
Achieving the time of 1-NN, but the accuracy of k-NN arXiv:1712.02369v2 [math.ST] 22 Dec 2017 Lirong Xue Princeton University Abstract We propose a simple approach which, given distributed computing resources, can nearly achieve the accuracy of k-NN prediction, while matching (or improving) the faster prediction time of 1-NN. The approach consists of aggregating denoised 1-NN predictors over a small number of distributed subsamples. We show, both theoretically and experimentally, that small subsample sizes suffice to attain similar performance as k-NN, without sacrificing the computational efficiency of 1-NN. 1 INTRODUCTION While k-Nearest Neighbor (k-NN) classification or regression can achieve significantly better prediction accuracy that 1-NN (k = 1), practitioners often default to 1-NN as it can achieve much faster prediction that scales better with large sample size n. In fact, much of the commercial tools for nearest neighbor search remain optimized for 1-NN rather than for k-NN, further biasing practice towards 1-NN. Unfortunately, 1-NN is statistically inconsistent, i.e., its prediction accuracy plateaus early as sample size n increases, while k-NN n→∞ keeps improving longer for choices of k −−−−→ ∞. In this work we consider having access to a small number of distributed computing units, and ask whether better tradeoffs between k-NN and 1-NN can be achieved by harnessing parallelism at prediction time. A simple idea is bagging multiple 1-NN predictors computed over distributed subsamples; however this tends to require large number of subsamples, while the number of computing units is often constrained in practice. In fact, an infinite number of subsamples is assumed in all known consistency guarantees for the 1-NN bagging approach (Biau et al., 2010; Samworth et al., 2012). Here, we are Samory Kpotufe Princeton University particularly interested in small numbers of distributed subsamples (say 1 to 10) as a practical matter. Hence, we consider a simple variant of the above idea, consisting of aggregating a few denoised 1-NN predictors. With this simple change, we obtain the same theoretical error-rate guarantees as for k-NN, using few subsamples, while individual processing times are of the same order or better than 1-NN’s computation time. The main intuition behind denoising is as follows. The increase in variance due to subsampling is hard to counter if too few predictors are aggregated. We show that this problem is suitably addressed by denoising each subsample as a preprocessing step, i.e., replacing the subsample labels with k-NN estimates based on the original data. Prediction then consists of aggregating – by averaging or by majority – the 1-NN predictions from a few denoised subsamples (of small size m  n). Interestingly, as shown both theoretically and experimentally, we can let the subsampling ratio n→∞ (m/n) −−−−→ 0 while achieving a prediction accuracy of the same order as that of k-NN. Such improved accuracy over vanilla 1-NN is verified experimentally, even for relatively small number of distributed predictors. Note that, in practice, we aim to minimize the number of distributed predictors, or equivalently the number of computing units which is usually costly in its own right. This is therefore a main focus in our experiments. In particular, we will see that even with a single denoised 1-NN predictor, i.e., one computer, we can observe a significant improvement in accuracy over vanilla 1-NN while maintaining the prediction speed of 1-NN. Our main focus in this work is classification – perhaps the most common form of NN prediction – but our results readily extend to regression. Detailed Results And Related Work While nearest neighbor prediction methods are among the oldest and most enduring in data analysis (Fix and Hodges Jr, 1951; Cover and Hart, 1967; Kulkarni and Posner, 1995), their theoretical performance in practical settings is still being elucidated. For statistical consistency, it is well known that one needs a number n→∞ k −−−−→ ∞ of neighbors, i.e., the vanilla 1-NN method Manuscript under review by AISTATS 2018 is inconsistent for either regression or classification (Devroye et al., 1994). In the case of regression, Kpotufe (2011) shows that convergence rates (l2 excess error over Bayes) behave as O(n−2/(2+d) ), for Lipschitz regression functions over data with intrinsic dimension d; this then implies a rate of O(n−1/(2+d) ) for binary classification via known relations between regression and classification rates (see e.g. Devroye et al. (1996)). Similar rates are recovered in (Cannings et al., 2017) under much refined parametrization of the marginal input distribution, while a recent paper of Moscovich et al. (2016) recovers similar rates in semisupervised settings. Such classification rates can be sharpened by taking into account the noise margin, i.e., the mass of data away from the decision boundary. This is done in the recent work of Chaudhuri and Dasgupta (2014) which obtain faster rates of the form O(n−α(β+1)/(2α+d) ) – where the regression function is assumed α-smooth – which can be much faster for large β (characterizing the noise margin). However such rates require large number of neighbors k = O(n2α/(2α+d) ) growing as a root of sample size n; such large k implies much slower prediction time in practice, which is exacerbated by the scarcity of optimized tools for ‘k’ nearest neighbor search. In contrast, fast commercial tools for 1-NN search are readily available, building on various space partitioning data structures (Krauthgamer and Lee, 2004; Clarkson, 2005; Beygelzimer et al., 2006; Gionis et al., 1999). In this work we show that the classification error of the proposed approach, namely aggregated denoised 1NN’s, is of the same optimal order Õ(n−α(β+1)/(2α+d) ) plus a term Õ(m−α(β+1)/d ) where m ≤ n is the subsample size used for each denoised 1-NN. This additional term, due to subsampling, is of lower order provided m = Ω̃(nd/(2α+d) ); in other words we can let the subn→∞ sampling ratio (m/n) = Ω̃(n−2α/(2α+d) ) −−−−→ 0 while achieving the same rate as k-NN. We emphasize that the smaller the subsampling ratio, the faster the prediction time: rather than just maintaining the prediction time of vanilla 1-NN, we can actually get considerably better prediction time using smaller subsamples, while at the same time considerably improving prediction accuracy towards that of k-NN. Finally notice that the theoretical subsampling ratio of Ω̃(n−2α/(2α+d) ) is best with smaller d, the intrinsic dimension of the data, which is not assumed to be known a priori. Such intrinsic dimension d is smallest for structured data in IRD , e.g. data on an unknown manifold, or sparse data, and therefore suggests that much smaller subsamples – hence faster prediction times – are possible with structured data while achieving good prediction accuracy. As mentioned earlier, the even simpler approach of bagging 1-NN predictors is known to be consistent (Biau and Devroye, 2010; Biau et al., 2010; Samworth et al., 2012), however only in the case of an infinite bag size, corresponding to an infinite number of computing units in our setting – we assume one subsample per computing unit so as to maintain or beat the prediction time of 1-NN. Interestingly, as first shown in (Biau and Devroye, 2010; Biau et al., 2010), the subsampling ratio (m/n) can also tend to 0 as n → ∞, while achieving optimal prediction rates (for fixed α = 1, β = 0), albeit assuming an infinite number of subsamples. In contrast we show optimal rates – on par with those of k-NN – for even one denoised subsample. This suggests, as verified experimentally, that few such denoised subsamples are required for good prediction accuracy. The recent work of Kontorovich and Weiss (2015), of a more theoretical nature, considers a similar question as ours, and derives a penalized 1-NN approach shown to be statistically consistent unlike vanilla 1NN. The approach of Kontorovich and Weiss (2015) roughly consists of finding a subsample of the data whose induced 1-NN achieves a significant margin between classes (two classes in that work). Unfortunately finding such subsample can be prohibitive (computable in time O(n4.376 )) in the large data regimes of interest here. In contrast, our training phase only involves random subsamples, and cross-validation over a denoising parameter k (i.e., our training time is akin to the usual k-NN training time). Finally, unlike in the above cited works, our rates are established for multiclass classification (for the sake of completion), and depend logarithmically on the number of classes. Furthermore, as stated earlier, our results extend beyond classification to regression, and in fact are established by first obtaining regression rates for estimating the so-called regression function E [Y |X]. Paper outline. Section 2 presents our theoretical setup and the prediction approach. Theoretical results are discussed in Section 3, and the analysis in Section 4. Experimental evaluations on real-world datasets are presented in Section 5. 2 2.1 PRELIMINARIES Distributional Assumptions Our main focus is classification, although our results extend to regression. Henceforth we assume we are . n given an i.i.d. sample (X, Y) = (Xi , Yi )1 where X ∈ . D X ⊂ IR , and Y ∈ [L] = {1, 2, . . . , L}. The conditional distribution PY |X is fully captured by the so-called regression function, defined as η : X 7→ Manuscript under review by AISTATS 2018 [0, 1]L , where ηi (x) = P (Y = i|X = x). We assume the following on PX,Y . Assumption 1 (Intrinsic dimension and regularity of PX ). First, for any x ∈ X and r > 0, define the ball . B(x, r) = {x0 ∈ X : kx − x0 k ≤ r}. We assume, there exists an integer d, and a constant Cd such that, for all x ∈ X , r > 0, we have PX (B(x, r)) ≥ Cd rd . In this work d is unknown to the procedure. However, as is now understood from previous work (see e.g. Kpotufe (2011)), the performance of NN methods depends on such intrinsic d. We will see that the performance of the approach of interest here would also depends on such unknown d. In particular, as is argued in (Kpotufe, 2011), d is low for low-dimensional manifolds, or sparse data, so we would think of d  D for structured data. Note that the above assumption also imposes regularity on PX , namely by ensuring sufficient mass locally on X (so that NNs of a point x are not arbitrarily far from it). Assumption 2 (Smoothness of η). The function η is (λ, α)-Hölder for some λ > 0, 1 ≥ α > 0, i.e., 0 ∀x, x ∈ X , 0 α 0 kη(x) − η(x )k∞ ≤ λ kx − x k . We will use the following version of Tsybakov’s noise condition (Audibert and Tsybakov, 2007), adapted to the multiclass setting. Assumption 3 (Tsybakov noise condition). For any x ∈ X , let η(l) (x) denote the l’th largest element in {ηl (x)}L l=1 . There exists β > 0, and Cβ > 0 such that  ∀t > 0, P η(1) (X) − η(2) (X) ≤ t ≤ Cβ tβ . 2.2 Classification Procedure For any classifier h : X 7→ [L], we are interested in the 0-1 classification error err(h) = PX,Y (h(X) 6= Y ) . It is well known that the above error is mimimized by . the Bayes classifier h∗ (x) = argmaxl ηl (x). Therefore, for any estimated classifier ĥ, we are interested in the excess error err(ĥ) − err(h∗ ). We first recall the following basic nearest neighbor estimators. Definition 1 (k-NN prediction). Given k ∈ N, let kNN-I(x) denote the indices of the k nearest neighbors of x in the sample X. Assume, for simplicity, that ties are resolved so that |kNN-I(x)| = k. The k-NN classifier can be defined via the regression estimate η̂ : X 7→ [0, 1]L , where . 1 η̂l (x) = k X i∈kNN-I(x) 1 {Yi = l} . The k-NN classifier is then obtained as: hη̂ (x) = argmax η̂l (x). l Finally we let rk (x) denote the distance from x to its k-th nearest neighbor. We can now formally describe the approach considered in this work. Definition 2 (Denoised 1-NN). Consider a random subsample (without replacement) X0 of X of size m ≤ n. For any x ∈ X , let NN(X0 ; x) denote the nearest neighbor of x in X0 . The denoised 1-NN estimate at x is given as ĥ(x) = hη̂ (NN(X0 ; x)), where hη̂ is as defined above for some fixed k. This estimator corresponds to 1-NN over a sample X0 where each Xi0 ∈ X0 is prelabeled as hη̂ (Xi0 ). The resulting estimator, which we denote subNN for simplicity, is defined as follows. Definition 3 (subNN). Let {ĥi }Ii=1 , denote denoised 1-NN estimators defined over I independent subsamples of size m (i.e., the I sets of indices corresponding to each subsample are picked independently, although the indices in each set is picked with replacement in [n]). At any x ∈ X , the subNN estimate h̄(x) is the majority label in {ĥi (x)}Ii=1 . It is clear that the subNN estimate can be computed in parallel over I machines, while the final step – namely, computation of the majority vote – takes negligible time. Thus, we will view the prediction time complexity at any query x as the average time (over I machines) it takes to compute the 1-NN of x on each subsample. This time complexity gets better as (m/n) → 0. Furthermore, we will show that, even with relatively small I (increasing variability), we can let (m/n) get small while attaining an excess error on par with that of k-NN (here hη̂ ). This is verified experimentally. 3 OVERVIEW OF RESULTS Our main theoretical result, Theorem 1 below, concerns the statistical performance of subNN. The main technicality involves characterizing the effect of subsampling and denoising on performance. Interestingly, the rate below does not depend on the number I of subsamples: this is due to the averaging effect of taking majority vote accross the I submodels, and is discussed in detail in Section 4 (see proof and discussion of Lemma 2). In particular, the rate is bounded in terms of a bad event that is unlikely for a random submodel, and therefore unlikely to happen for a majority. Manuscript under review by AISTATS 2018 Theorem 1. Let 0 < δ < 1. Let V denote the VC dimension of balls on X . With probability at least 1−Lδ, there exists a choice of k ∈ [n], such that the estimate h̄ satisfies α(β+1)/(2α+d) V ln(Ln/δ) err(h̄) − err(h ) ≤ C1 · n  α(β+1)/d V ln(m/δ) + C2 · , m ∗  for constants C1 , C2 depending on PX,Y . The first term above is a function of the size n of the original sample, and recovers the recent optimal bounds for k-NN classification of Chaudhuri and Dasgupta (2014). We note however that the result of Chaudhuri and Dasgupta (2014) concerns binary classification, while here we consider the more general setting of multiclass. Matching lower bounds were established earlier in (Audibert and Tsybakov, 2007). The second term, a function of the subsample size m, characterizes the additional error (over vanilla k-NN hη̂ ) due to subsampling and due to using 1-NN’s at prediction time. As discussed earlier in the introduction, the first term dominates (i.e. we recover the same rates as for k-NN) whenever the subsampling ratio (m/n) = Ω̃(n−α/(2α+d) ) which goes to 0 as n → ∞. This is remarkable in that it suggests smaller subsample sizes are sufficient (for good accuracy) in the large sample regimes motivating the present work. We will see later that this is supported by experiments. As mentioned earlier, similar vanishing subsampling ratios were shown for bagged 1-NN in (Biau and Devroye, 2010; Biau et al., 2010; Samworth et al., 2012), but assuming a infinite number of subsamples. In contrast the above result holds for any number of subsamples, and the improvements over 1-NN are supported in experiments over varying number of subsamples, along with varying subsampling ratios. The main technicalities and insights in establishing Theorem 1 are discussed in Section 4 below, with some proof details relegated to the appendix. 4 ANALYSIS OVERVIEW The proof of Theorem 1 combines the statements of Propositions 3 and 2 below. The main technicality involved is in establishing Proposition 3 which brings together the effect of noise margin β, smoothness α, and the overall error due to denoising over a subsample. We overview these supporting results in the next subsection, followed by the proof of Theorem 1. 4.1 Supporting Results Theorem 1 relies on first establishing a rate of convergence for the k-NN regression estimate η̂, used in denoising the subsamples. While such rates exist in the literature under various assumptions (see e.g. Kpotufe (2011)), we require a high-probability rate that holds uniformly over all x ∈ X . This is given in Proposition 1 below, and is established for our particular setting where Y takes discrete multiclass values (i.e. η̂ and η are both multivariate functions). Its proof follows standard techniques adapted to our particular aim, and is given in the appendix (supplementary material). Proposition 1 (Uniform k-NN regression error). Let 0 < δ < 1. Let η̂ denote the k-NN regression estimate of Definition 1. The followingholds for a choice of   d 2α nL 2α+d (nCd ) 2α+d . With probability at k = O ln δ least 1 − 2δ over (X, Y), we have simultaneously for all x ∈ X :   α V ln(nL/δ) 2α+d kη̂(x) − η(x)k∞ ≤ C nCd where C is a function of α, λ. The above statement is obtained, by first remarking that, under structural assumptions on PX , (namely that there is sizable mass everywhere locally on X ), nearest neighbor distances can be uniformly bounded with high-probability. Such nearest neighbor distances control the bias of the k-NN estimator, while its variance behaves like O(1/k). Such a uniform bound on NN distances is given in Lemma 1 below and follows standard insights. Lemma 1 (Uniform bound on NN distances rk ). As in Definition 1, let rk (x) denote the distance from x ∈ X n to its k’th nearest neighbor in a sample X ∼ PX . Then, with probability at least 1 − δ over X, the following holds for all k ∈ [n]:  sup rk (x) ≤ x∈X 4.2 3 Cd  d1  · max k V ln 2n + ln 8δ , n n  d1 . SubNN Convergence We are ultimately interested in the particular regression estimates induced by subsampling: the denoised 1NN estimates ĥ over a subsample can be viewed as . ĥ = argmaxl∈[L] η̂l] for a regression estimate η̂ ] (x) = 0 η̂(NN(X ; x)), i.e., η̂ evaluated at the nearest neighbor NN(X0 ; x) of x in X0 . Our first step is to relate the error of η̂ ] to that of η̂. Here again the bound on NN distances of Lemma 1 above comes in handy since η̂ ] can be viewed as introducing additional bias to η̂, a bias which is in turn controlled by the distance from a Manuscript under review by AISTATS 2018 query x to its NN in the subsample X0 . By the above lemma, this distance is of order Õ(m−1/d ), introducing a bias of order Õ(m−α/d ) given the smoothness of η. Thus, combining the above two results yields the following regression error on denoised estimates. Proposition 2 (Uniform convergence of denoised 1-NN regression). Let 0 < δ < 1. Let η̂ denote the k-NN regression estimate of Definition 1. Let X0 denote a subsample (without replacement) of . X. Define the denoised 1-NN estimate η̂ ] (x) = 0 η̂(NN(X; x)). The following holds for a choice of  d 2α 2α+d (nC ) 2α+d k = O (V ln nL . With probability d δ ) at least 1 − 3δ over (X, Y), and X0 , we have simultaneously for all x ∈ X : kη̂ ] (x) − η(x)k∞  α V ln(nL/δ) 2α+d ≤C nCd  α V ln(m/δ) d +C , mCd  where C is a function of α, λ. Proof. Define x0 = NN(X0 ; x) so that η̂ ] (x) = η̂(x0 ). We then have the two parts decomposition: kη̂ ] (x) − η(x)k∞ = kη̂(x0 ) − η(x)k∞ Lemma 2 (Uniform convergence of aggregate regresI sion). Given independent subsamples {X0i }i=1 from (X, Y), define η̂i] (x) = η̂(NN(X0i ; x)), i.e., the regression estimate η̂ evaluated at the nearest neighbor NN(X0i ; x) of x in X0i . Suppose there exists φ = φ(n, m) such that,   max PX,Y,X0i ∃x ∈ X , kη̂i] (x) − η(x)k∞ > φ ≤ δ, i∈[I] for some 0 < δ < 1. Then, let h̄ denote the subNN I estimate using subsamples {X0i }i=1 . With probability at I least 1 − Lδ over the randomness in (X, Y) and {X0i }1 , the following holds simultaneously for all x ∈ X : ηh∗ (x) (x) − ηh̄(x) (x) ≤ 2φ. Remark. Notice that in the above statement, the probability of error goes from δ to Lδ, but does not depend on the number I of submodels. This is because of the averaging effect of the majority vote. For intuition, suppose B is a bad event and 1Bi is whether B happens for submodel i. Suppose further that E 1Bi ≤ δ for all i. Then the likelihood of B happening for a majority of more than I/2 of models is ( ) X X 2 E1 1Bi ≥ I/2 ≤ · E 1Bi ≤ 2δ, I i i (1) by a Markov inequality. We use this type of intuition in the proof, however over a sequence of related bad events, and using the fact that, the submodels’ estimates are independent conditioned on X, Y. where the last inequality follows (with probability 1 − 2δ) from Proposition 1. Proof. The result isnobtained by appropriately boundo ing the indicator 1 ∃x : ηh∗ (x) (x) − ηh̄(x) (x) > 2φ . To bound the second term in inequality (1), notice that X0 can be viewed as m i.i.d. samples from PX . Therefore kx0 − xk can be bounded using Lemma 1. Therefore by smoothness condition on η in Assumption 2, we have with probability at least 1−δ, simultaneously for all x ∈ X : Let ĥi denote the denoised 1-NN classifier on sample X0i , or for short, the i’th submodel. First notice that, if . the majority vote h̄(x) = l for some label l ∈ [L], then at least I/L submodels ĥi (x) predict l at x. In other words, we have ≤ kη̂(x0 ) − η(x0 )k∞ + kη(x0 ) − η(x)k∞  α  V ln(nL/δ) 2α+d + kη(x0 ) − η(x)k∞ , ≤C nCd I kη(x0 ) − η(x)k∞ ≤ λkx0 − xkα α  αd   3V ln 2m + 3 ln 8δ d V ln m δ . (2) ≤λ ≤C mCd mCd Combining (1) and (2) yields the statement. Next we consider aggregate regression error, i.e., the discrepancy (ηh∗ (x) (x) − ηh̄(x) (x)) between the coordinates of η given by the labels h∗ (x) and h̄(x). This will be bounded in terms of the error φ(n, m) attainable by the individual denoised regression estimates (as bounded in the above proposition). o LX n 1 ĥi (x) = l ≥ 1. I i=1 . Therefore, fix x ∈ X , and let h̄(x) = l; we then have:  1 ηh∗ (x) (x) − ηh̄(x) (x) > 2φ .  = 1 ηh∗ (x) (x) − ηl (x) > 2φ I o  LX n ≤ 1 ĥi (x) = l 1 ηh∗ (x) (x) − ηl (x) > 2φ I i=1 I ≤ o LX n 1 ηh∗ (x) (x) − ηĥi (x) (x) > 2φ . I i=1 (3) Manuscript under review by AISTATS 2018 . We bound the above as follows. Suppose ĥi (x) = li . ∗ ∗ ∗ and h (x) = l for some labels li and l in [L]. Now, ] if kη(x) − η̂i] (x)k∞ ≤ φ, then ηl∗ (x) ≤ η̂i,l ∗ (x) + φ and ] ηli (x) ≥ η̂i,l (x) − φ. Also by definition we know that i ] ĥi (x) is the maximum entry of η̂i] (x), so η̂i,l ∗ (x) ≤ ] η̂i,l (x). Therefore i ] ] ηh∗ (x) (x) − ηĥi (x) (x) ≤ (η̂i,l ∗ (x) + φ) − (η̂i,l (x) − φ) i ] ] = (η̂i,l ∗ (x) − η̂i,l (x)) + 2φ ≤ 2φ. i In other words, ηh∗ (x) (x) − ηĥi (x) (x) > 2φ only when kη(x) − η̂i] (x)k∞ > φ. Thus, bound (3) to obtain: n o 1 ηh∗ (x) (x) − ηh̄(x) (x) > 2φ ≤ I o LX n 1 kη(x) − η̂i] (x)k∞ > φ . I i=1 Finally we use the fact that, for an event A(x), we have 1 {∃x ∈ X : A(x)} = supx∈X 1 {A(x)}. Combine this fact with the above inequality to get: n o 1 ∃x ∈ X : ηh∗ (x) (x) − ηh̄(x) (x) > 2φ n o = sup 1 ηh∗ (x) (x) − ηh̄(x) (x) > 2φ x∈X ≤ sup x∈X I o LX n 1 kη(x) − η̂i] (x)k∞ > φ I i=1 ≤ I n o LX sup 1 kη(x) − η̂i] (x)k∞ > φ I i=1 x∈X = I o LX n 1 ∃x ∈ X : kη(x) − η̂i] (x)k∞ > φ . I i=1 . Proof. Since, for any classifier h, ηh(x) (x) = P (Y = h(x)), the excess error h of the sub-NN classii fier h̄ can be written as E X ηh∗ (X) (X) − ηh̄(X) (X) . Thus, the assumption in the proposition statement – that for all x ∈ X, ηh∗ (x) (x) − ηh̄(x) (x) < 2φ (with probability at least 1 − δ) – yields a trivial bound of 2φ on the excess error. We want to refine this bound. Let η(l) (x) be the l-th largest entry in the vector η(x) = . L {ηl }l=1 , and define ∆(x) = η(1) (x) − η(2) (x). Then at any fixed point x, we can refine the bound on excess error at x (namely ηh∗ (x) (x) − ηh̄(x) (x)), by separately considering the following exhaustive conditions A(x) and B(x) on x: A: ∆(x) ≥ 2φ, in which case the excess error is 0. This follows from η(1) (x) = ηh∗ (x) (x) and that: ηh∗ (x) (x) − ηh̄(x) (x) < 2φ ≤ ηh∗ (x) (x) − η(2) (x) In other words ηh̄(x) (x) is larger than η(2) , so . equals η(1) (x) = ηh∗(x) (x). B: ∆(x) < 2φ, in which case the excess error cannot be refined at x. However, the total mass of such x’s is at most Cβ (2φ)β by Tsybakov’s noise condition (Assumption 3). Combining these conditions, we have with probability at least 1 − δ that the excess error satisfies: h i err(h̄) − err(h∗ ) = E X ηh∗ (X) (X) − ηh̄(X) (X) ≤ E X [0 · 1 {A(X)} + 2φ · 1 {B(X)}] ≤ 2φ · E [1 {B(X)}] ≤ 2φ · P (∆(x) ≤ 2φ) ≤ Cβ (2φ)β+1 . The final statement is obtained by integrating both sides of the inequality over the randomness in X, Y and I the (conditionally) independent subsamples {X0i }1 . Next, Proposition 3 below states that the excess error of the subNN estimate h̄ can be bounded in terms of the aggregate regression error (ηh∗ − ηh̄ ) considered in Lemma 2. In particular, the proposition serves to account for the effect of the noise margin parameter β towards obtaining faster rates than those in terms of smoothness α only. Combining the results of this section yield the main theorem whose proof is given next. 4.3 Proof Of Theorem 1 Our main result follows easily from Propositions 2 and 3. This is given below. Proposition 3. Suppose there exists φ = φ(n, m) such that, with probability at least 1 − δ over the randomI ness in (X, Y) and the subsamples {X0i }i=1 , we have simultaneously for all x ∈ X , ηh∗ (x) (x) − ηh̄(x) (x) < 2φ. Proof. Fix any 0 < δ < 1. Note that the conditions of Lemma 2 are verified in Proposition 2, namely that, with probability 1 − 3δ, all regression errors (of submodels) are bounded by Then with probability at least 1 − δ, the excess classification error of the estimate h̄ satisfies: . φ= C err(h̄) − err(h∗ ) ≤ Cβ (2φ)β+1 .  V ln(Ln/δ) n α/(2α+d)  +C V ln(m/δ) m α/d , (4) Manuscript under review by AISTATS 2018 Table 1: Datasets Used In Evaluating SubNN Name MiniBooNE TwitterBuzz LetterBNG NewsGroups20 YearPredMSD WineQuality #train 120k 130k 34k 11k 34k 5.5k #test 10k 10k 10k 7.5k 10k 1.0k #dimension 50 50 16 130k 90 12 #classes 2 2 26 20 regression regression where C is a constant depending on α and λ. Next, the conditions of Proposition 3 are obtained in Lemma 2 with the same setting of φ. It follows that with probability at least 1 − 3Lδ, we have: err(h̄) − err(h∗ ) ≤ Cβ (2φ)β+1 , with φ as in (4). Given that g(x) = xβ+1 is a convex function, we conclude by applying Jensen’s inequality (viewing (1/2C) · φ as an average of two terms). 5 EXPERIMENTS Experimental Setup. Data is standardized along each coordinate of X. - Fitting subNN. We view the subsample size m and the number I of subsamples as exogenous parameters determined by the practical constraints of a given application domain. Namely, smaller m yields faster prediction and is driven by prediction time requirement, while larger I improves prediction error but is constrained by available computing units. However, much of our experiments concern the sensitivity of subNN to m and I, and yield clear insights into tradeoffs on these choices. Thus, for any fixed choice of m and I, we choose k by 2-fold cross-validation. The search for k is done in two stages: first, the best value k 0 (minimizdlog ne ing validation error) is picked on a log-scale {2i }i=1 , then a final choice for k is made on a refined linear range [dk 0 /2e − 10 : 2k 0 + 10]. - Fitting k-NN. k is also chosen in two stages as above. Description Particle identification (Roe, 2010) Buzz in social media (François Kawala, 2013) English alphabet (ML) Document classification (Mitchell, 1999) Release year of songs (Bertin-Mahieux, 2011) Quality of wine (Cortez, 2009) that of k-NN) for versions of subNN((m/n), I), where m/n is the subsampling ratio used, and I is the number of subsamples. For regression datasets, the error is the MSE, while for classification we use 0-1 error. The prediction time reported for the subNN methods is the maximum time over the I subsamples plus aggregation time, reflecting the effective prediction time for the distributed-computing settings motivating this work. The results support our theoretical insights, namely that subNN can achieve accuracy close or matching that of k-NN, while at the same time achieving fast prediction time, on par or better than those of 1-NN. - Sensitivity to m and I. As expected, better times are achievable with smaller subsample sizes, while better prediction accuracy is achievable as more subsamples tend to reduce variability. This is further illustrated for instance in Figure 1, where we vary the number of subsamples. Interestingly in this figure, for the MiniBoone dataset, the larger subsampling ratio 0.75 yields the best accuracy over any number of subsamples, but the gap essentially disappears when enough subsamples are used. We thus have the following prescription in choosing m and I: while small values of I work generally well, large values of I can only improve accuracy; on the other hand, subsampling ratios of 0.1 yield good time-accuracy tradeoffs accross datasets. Table 1 describes the datasets used in the experiments. We use k-d-tree for fast NN search from Python scikit-learn for all datasets but NewsGroups20 for which we perform a direct search (due to highdimensionality and sparsity). As explained earlier, our main focus is on classification, however theoretical insights from previous sections extend to regression, as substantiated in this section. The code in Python can be found at https://github.com/lirongx/SubNN. - Benefits of denoising. In Figure 2, we compare subNN with pure bagging of 1-NN models. As suggested by theory, we see that the bagging approach does indeed require considerably more subsamples to significantly improve over the error of vanilla 1-NN. In contrast, the accuracy of subNN quickly tends to that of k-NN, in particular for TwitterBuzz where 1 or 3 subsamples are sufficient to statistically close the gap, even for small subsampling ratio. This could be due to hidden but beneficial structural aspects of this data. In all cases, the experiments further highlights the benefits of our simple denoising step, as a variance reduction technique. This is further supported by the error-bars (std) over 5 repetitions as shown in Figure 2. Results. Our main experimental results are described in Table 2, showing the relative errors (error of the method divided by that of vanilla k-NN) and relative prediction time (prediction time divided by Conclusion. We propose a procedure with theoretical guarantees, which is easy to implement over distributed computing resources, and which achieves good time-accuracy tradeoffs for nearest neighbor methods. Manuscript under review by AISTATS 2018 Table 2: Ratios Of Error Rates and Prediction Times Over Corresponding Errors And Times Of k-NN. Data MiniBooNE TwitterBuzz LetterBNG NewsGroups20 YearPredMSD WineQuality Relative Error subNN(0.1,10) subNN(0.75,10) 1.039 1.027 1.000 1.005 1.086 1.144 1.206 1.002 1.082 1.110 1.011 1.018 1NN 1.280 1.405 1.127 1.122 1.859 1.276 0.15 40 subNN(0.1,−) subNN(0.5,−) subNN(0.75,−) 1NN kNN ● Time 30 subNN(0.1,−) subNN(0.5,−) subNN(0.75,−) 1NN kNN 0.14 0.13 Error Rate MiniBooNE prediction time 20 0.16 MiniBooNE Prediction Error ● Relative Time subNN(0.1,10) subNN(0.75,10) 0.247 0.547 0.185 0.522 0.219 0.396 0.081 0.668 0.025 0.249 0.885 0.906 1NN 0.609 0.550 0.459 0.610 0.847 0.989 ● 10 0.12 ● ● ● ● ● 0 0.11 ● ● ● ● 0 2 4 6 8 10 0 2 number of subsamples 4 6 8 10 number of subsamples Figure 1: Comparing the Effect Of Subsampling Ratios on Prediction And Time Performance Of SubNN. Shown are SubNN estimates using subsampling ratios 0.1, 0.5, and 0.75. 0.16 Error Rate ● 0.14 0.15 0.14 subNN(0.75,−) bag−1NN(0.75,−) 1NN kNN ● 0.15 subNN(0.1,−) bag−1NN(0.1,−) 1NN kNN ● 0.13 Error Rate MiniBooNE: subNN vs. bag−1NN(0.75,−) 0.13 0.16 MiniBooNE: subNN vs. bag−1NN(0.1,−) ● 0.12 0.12 ● ● ● 0 2 4 6 8 10 0 2 number of subsamples ● 2 0.050 ● ● ● 4 6 number of subsamples 8 10 subNN(0.75,−) bag−1NN(0.75,−) 1NN kNN ● 0.035 0.035 0 10 0.045 Error Rate ● ● 8 0.040 0.050 0.045 0.040 ● 6 TwitterBuzz: subNN vs. bag−1NN(0.75,−) subNN(0.1,−) bag−1NN(0.1,−) 1NN kNN ● 4 number of subsamples TwitterBuzz: subNN vs. bag−1NN(0.1,−) Error Rate ● ● ● 0.11 0.11 ● 0 2 ● ● ● 4 6 ● 8 10 number of subsamples Figure 2: Bagged 1NN Compared With SubNN Using Subsampling Ratios 0.1 (Left) And 0.75 (Right). Manuscript under review by AISTATS 2018 References Jean-Yves Audibert and Alexandre B. Tsybakov. Fast learning rates for plug-in classifiers. The Annals of Statistics, 35(2):608–633, 2007. T. Bertin-Mahieux. Yearpredictionmsd data https://archive.ics.uci.edu/ml/datasets/ YearPredictionMSD, 2011. set. A. Beygelzimer, S. Kakade, and J. Langford. Cover trees for nearest neighbors. International Conference on Machine Learning (ICML), 2006. Gérard Biau and Luc Devroye. On the layered nearest neighbour estimate, the bagged nearest neighbour estimate and the random forest method in regression and classification. Journal of Multivariate Analysis, 101(10): 2499–2518, 2010. Gérard Biau, Frédéric Cérou, and Arnaud Guyader. On the rate of convergence of the bagged nearest neighbor estimate. Journal of Machine Learning Research, 11 (Feb):687–712, 2010. Timothy I Cannings, Thomas B Berrett, and Richard J Samworth. Local nearest neighbour classification with applications to semi-supervised learning. arXiv preprint arXiv:1704.00642, 2017. Kamalika Chaudhuri and Sanjoy Dasgupta. Rates of convergence for nearest neighbor classification. In Advances in Neural Information Processing Systems, pages 3437–3445, 2014. Kenneth L. Clarkson. Nearest-neighbor searching and metric space dimensions. Nearest-Neighbor Methods for Learning and Vision: Theory and Practice, 2005. Paulo Cortez. Wine quality data set. https://archive. ics.uci.edu/ml/datasets/Wine+Quality, 2009. Thomas Cover and Peter Hart. Nearest neighbor pattern classification. IEEE transactions on information theory, 13(1):21–27, 1967. L. Devroye, L. Gyorfi, and G. Lugosi. A Probabilistic Theory of Pattern Recognition. Springer, 1996. Luc Devroye, Laszlo Gyorfi, Adam Krzyzak, and Gábor Lugosi. On the strong universal consistency of nearest neighbor regression function estimates. The Annals of Statistics, pages 1371–1385, 1994. Evelyn Fix and Joseph L Hodges Jr. Discriminatory analysis-nonparametric discrimination: consistency properties. Technical report, DTIC Document, 1951. et. al. François Kawala. Buzz in social media data set. https://archive.ics.uci.edu/ml/datasets/ Buzz+in+social+media+, 2013. Aristides Gionis, Piotr Indyk, Rajeev Motwani, et al. Similarity search in high dimensions via hashing. In VLDB, volume 99, pages 518–529, 1999. Aryeh Kontorovich and Roi Weiss. A bayes consistent 1-nn classifier. In AISTATS, 2015. S. Kpotufe. k-NN Regression Adapts to Local Intrinsic Dimension. Advances in Neural Information Processing Systems (NIPS), 2011. R. Krauthgamer and J. Lee. Navigating nets: Simple algorithms for proximity search. ACM-SIAM Symposium on Discrete Algorithms (SODA), 2004. Sanjeev R Kulkarni and Steven E Posner. Rates of convergence of nearest neighbor estimation under arbitrary sampling. IEEE Transactions on Information Theory, 41 (4):1028–1039, 1995. Tom Mitchell. Twenty newsgroups data set. https://archive.ics.uci.edu/ml/datasets/Twenty+ Newsgroups, 1999. Open ML. Open ml machine learning platform. https: //www.openml.org/d/1378. Amit Moscovich, Ariel Jaffe, and Boaz Nadler. Minimaxoptimal semi-supervised regression on unknown manifolds. arXiv preprint arXiv:1611.02221, 2016. Byron Roe. Miniboone particle identification data set. https://archive.ics.uci.edu/ml/datasets/ MiniBooNE+particle+identification, 2010. Richard J Samworth et al. Optimal weighted nearest neighbour classifiers. The Annals of Statistics, 40(5):2733– 2763, 2012. Manuscript under review by AISTATS 2018 A PROOF OF MAIN RESULTS In this section, we show the proof of Proposition 1 (uniform bound on kNN regression error). The proof is done by decomposing the regression error into bias and variance (Lemma 5) and bound each of them separately in Lemma 4 and 5. Lemma 1 will be proved first as a by-product. The decomposition is the following. Define η̃(x) as: η̃(x) = EY|X η̂(x) = 1 k X η(Xi ). i∈kNN-I(x) P (Bx (, k)) = P (B (x, (1 − ) rk (x))) ≥ Cd (1−)d rkd (x). Therefore, with probability at least 1 − δ, the following holds simultaneously for all x ∈ X : rk (x)  1 P(Bx (, k)) d ≤ Cd    d1 1 k V ln 2n + ln 8δ d 3 · max · (1 − )−1 . ≤ , Cd n n Viewing η̃ as the expectation of η̂ conditioning sample X, we can have the following variance and bias decomposition of error of η̂: Let  → 0 in the above inequality and conclude the proof. kη̂(x) − η(x)k∞ ≤ kη̂(x) − η̃(x)k∞ + kη̃(x) − η(x)k∞ . (5) Using Lemma 1 (uniform rk (x) bound), we can get a uniform bound on the bias of η̂: We start by introducing a known result on relative VC bound in Lemma 3. Then in Lemma 1, we use it to give a uniform bound on rk (x) - the distance between query point x and its k-th nearest neighborhood in data. After that we use Lemma 1 to bound bias and variance separately in Lemma 4 and 5. Proposition 1 is concluded by combing the two bounds. Lemma 4 (Bias of η̂). Let V be the VC dimension of the class of balls on X . For 0 < δ < 1 and k ≥ V ln 2n + ln 8δ , with probability at least 1 − δ over the randomness in the choice of X, the following inequality holds simultaneously for all x ∈ X :  α 3 k d kη̃(x) − η(x)k∞ ≤ λ · . · Cd n Lemma 3 (Relative VC Bound, Vapnik 1971). Let B be a set of subsets of X . B has finite VC dimension V. For n drawn sample X1 , . . . , Xn , the empirical probPn ability measure is defined as Pn (B) = n1 i=1 1Xi ∈B . Define αn = (V ln 2n + ln(8/δ))/n. Let 0 < δ < 1, with probability at least 1 − δ over the randomness in X1 , . . . , Xn , the following holds simultaneously for all B ∈ B: p P(B) ≤ Pn (B) + Pn (B)αn + αn . Proof. First, for a fixed sample X, by Assumption 2 (Smoothness of η) we have: kη̃(x) − η(x)k∞ X 1 = η(Xi ) − η(x) k i∈kNN-I(x) ≤ ≤ Using the above result, we can prove Lemma 1 (bound on rk ). Proof of Lemma 1. By Lemma 3, let αn = (V ln 2n + ln(8/δ)) /n, with probability at least 1 − δ over the randomness in X and  > 0, for any x ∈ X and closed ball Bx (, k) = B(x, (1 − )rk (x)), we have: p P(Bx (, k)) ≤ Pn (Bx (, k)) + Pn (Bx (, k))αn + αn ≤ 3 max (Pn (Bx (, k)), αn )   k V ln 2n + ln 8δ , . < 3 max n n By Assumption 1 (intrinsic dimension), for any x ∈ X and any  > 0, P (Bx (, k)) is lower-bounded as below. 1 k 1 k 1 ≤ k X ∞ kη(Xi ) − η(x)k∞ i∈kNN-I(x) X λkXi − xkα i∈kNN-I(x) X λrkα (x) = λrkα (x). i∈kNN-I(x) It follows by Lemma 1, that, with high probability at least 1 − δ over X, the following holds simultaneously for all x ∈ X .  α 3 k d α kη̃(x) − η(x)k∞ ≤ λrk (x) ≤ λ · · . Cd n Lemma 5 (Variance of η̂). Let V be the VC dimension of balls on X . For 0 < δ < 1, with probability at least 1 − δ over the randomness in (X, Y), the following inequality holds simultaneously for all x ∈ X : Manuscript under review by AISTATS 2018 kη̂(x) − η̃(x)k∞ < √ r V 1 − 2δ: 1 nL ln . k δ Proof. Consider the l-th value of η̂(x) − η̃(x): 1 (η̂(x) − η̃(x))l = k X  1 {Yi = l} − ηl (Xi ) . i∈kNN-I(x) Fix x, X and consider the randomness in Y conditioned on X. Use Hoeffding’s Inequality. There are k independent terms in the above summation and E(1 {Yi = l} |Xi ) = ηl (Xi ). So the following holds with probability at least 1 − δ0 over the randomness in Y: r 2 1 (η̂(x) − η̃(x))l ≤ ln . 2k δ0 Apply the above analysis to l = 1, . . . , L and combine them by union bound. So the following inequality holds with probability at least 1 − L · δ0 over the randomness in Y: r kη̂(x) − η̃(x)k∞ ≤ 2 1 ln . 2k δ0 Then consider variations in x. Given X fixed, the left hand side of the above inequality can be seen as a function of kNN-I(x). This is a subset of X covered by ball B(x, rk (x)). By Sauer’s Lemma, the number of V such subsets of X covered by a ball is bounded by en . V  en V So there are at most V many different variations of the above inequality when x varies. We combine the V variations by union bound. Let δ = δ0 · L · en , the V following happens with probability at least 1 − δ over the randomness in Y: r 1 2 ln sup kη̂(x) − η̃(x)k∞ ≤ 2k δ 0 x∈X r V en 1 2L ≤ ln + ln 2k V 2k δ r √ 1 nL ≤ V ln . k δ The above inequality holds for any fixed sample X and the right hand side do not depend on X. So it continue to hold for any drawn X. Thus we conclude the proof. Combining the bias and variance of η̂, we have the bound on uniform kNN regression error. Proof of Proposition 1. Apply Lemma 4 (bias) and 5 (variance) to inequality 5, with probability at least  kη̂(x)−η(x)k∞ ≤ λ 3 Cd r α/d  α/d √ k 1 nL · + V· ln . n k δ The aboved is minimized at k = 2α 2α+d (nC ) 2α+d , where C 0 depend only on C 0 (V ln nL ) d δ α and λ. Plug in this value of k into the statement α above, we obtain kη̂(x)−η(x)k∞ = C 00 ( V ln(nL/δ) ) 2α+d , nCd where C 00 depend solely on α and λ. B ADDITIONAL TABLES AND PLOTS In this section we present supplemental plots and tables. Table 3 shows the same experiment as in Table 2, but reports average prediction time (over the I subsamples) rather than the maximum prediction times, plus the aggregation time. Comparing the two tables, one can see that the differences between average and maximum times are small. In other words, prediction time is rather stable over the subsamples, which is to be expected as these times are mostly controlled by subsample size and computing resource. Figure 3 presents the same experiments as in Figure 1, for an additional dataset (TwitterBuzz). It compares the error and prediction time of subNN models as a function of the number I of subsamples used. Again, as we can see, subNN yields error rates similar to those of kNN, even for a small number of subsamples. As expected, the best prediction times are achieved with the smaller subsample ratio of 0.1. Manuscript under review by AISTATS 2018 Table 3: Ratios Of Error Rates and Average Prediction Times Over Corresponding Errors And Times Of k-NN. Data MiniBooNE TwitterBuzz LetterBNG NewsGroups20 YearPredMSD WineQuality Relative Error subNN(0.1,10) subNN(0.75,10) 1.039 1.027 1.000 1.005 1.086 1.144 1.206 1.002 1.082 1.110 1.011 1.018 1NN 1.280 1.405 1.127 1.122 1.859 1.276 50 TwitterBuzz prediction time ● subNN(0.1,−) subNN(0.5,−) subNN(0.75,−) 1NN kNN 20 Time 30 0.045 40 subNN(0.1,−) subNN(0.5,−) subNN(0.75,−) 1NN kNN 10 0.040 Error Rate 0.050 TwitterBuzz Prediction Error ● Relative Average Time subNN(0.1,10) subNN(0.75,10) 0.216 0.492 0.179 0.480 0.218 0.390 0.076 0.659 0.025 0.248 0.826 0.878 1NN 0.609 0.550 0.459 0.610 0.847 0.989 ● ● ● ● ● ● 0.035 ● ● ● 0 ● 0 2 4 6 number of subsamples 8 10 0 2 4 6 8 10 number of subsamples Figure 3: Comparing the Effect Of Subsampling Ratio And Number Of Models (TwitterBuzz). We find that all the subNN predictors reach error similar to that of k-NN even when using only a few subsamples (1 or 3). As expected, subNN with a subsampling ratio of 0.1 results in the best prediction times.
10math.ST
COMPLETE INTERSECTIONS OF QUADRICS AND THE WEAK LEFSCHETZ PROPERTY arXiv:1802.06253v1 [math.AC] 17 Feb 2018 A. ALZATI AND R. RE Abstract. We consider graded artinian complete intersection algebras A = C[x0 , . . . , xm ]/I with I generated by homogeneous forms of degree d ≥ 2. We show that the general multiplication by a linear form µL : Ad−1 → Ad is injective. We prove that the Weak Lefschetz Property for holds for any c.i. algebra A as above with d = 2 and m ≤ 4, previously known for m ≤ 3. 1. Introduction The Weak Lefschetz Property (in short WLP) of a graded algebra A, presented as the quotient A = k[x0 , . . . , xmP ]/I, with I an homogeneous ideal, asserts that for any general linear form L = ai xi and any k ≥ 0, the multiplication map µL : Ak → Ak+1 has maximal rank. It has been conjectured that if char(k) = 0 then any complete intersection k-algebra, i.e. an algebra as above with I generated by a regular sequence, has the WLP. It is also conjectured that such an algebra should have the Strong Lefschetz Property, i.e. the analogous maximal rank property with L replaced by Ld , for any d. The most significant case of these conjectures is the case when A is artinian. These are considered to be very challenging problems, despite affirmative answers for m ≤ 2, see [3], and in the monomial case, see [6] and [7]. In this article we examine the case of a c.i. artinian algebra A with I generated in degree d ≥ 2. The first main result of the present article is an easy and geometrical proof of a generalization of the so called Injectivity Lemma of Proposition 4.3 of [5]. More precisely we show the injectivity of the general multiplication map µL : Ad−1 → Ad . This result is stated in Corollary 4. That result is also used in Remark 3 to obtain a new and simple proof of the WLP for d = 2 and m = 3, already covered in [5]. Then we examine the case d = 2 and m = 4, for which we prove the WLP by introducing some geometrical methods that seem to be new in the existing literature. This is the content of Theorem 1 of Section 6, which is the other main result of this paper. Despite we are proposing only limited progress toward the WLP conjecture, we hope that the methods of the present article can shed some light on the geometrical aspects of the general problem and inspire further investigations. The plan of the article is the following. In Section 2 we state the general results on artinian Gorenstein and c.i. algebras that are common knowledge for commutative algebraists and algebraic geometers. These will be the only prerequisites of this paper, since we have chosen to provide an essentially self-contained exposition of our results. Then, in Section 3 we study some interesting stratifications of the Date: 13 February, 2018 . 2010 Mathematics Subject Classification. Primary 13A02, secondary 14N05. Key words and phrases. Weak Lefschetz property, artinian algebra, complete intersection. This work has been done within the framework of the national project “Geometry on Algebraic Varieties”, Prin (Cofin) 2015 of MIUR. 1 2 A. ALZATI AND R. RE projective space P(Id ), associated to generating piece of the ideal I. These results are immediately used to give a prof of the Injectivity Lemma mentioned above. In Section 4 we introduce our general geometrical method for approaching the WLP conjecture, that is we study the projectivization of variety of pairs (z, Q) ∈ A1 × As such zQ = 0. We introduce some differential methods to this purpose. In the final section 5 and 6 we consider the case d = 2 of the WLP conjecture for complete intersections in equal degrees, and give its solution for m = 4, as already mentioned above. 2. General setup Notations. Let f0 , . . . , fm be homogeneous polynomials in C[x0 , . . . , xm ] with no common zeros and of equal degree d > 1, i.e. a regular sequence. We set I = (f0 , . . . , fm ) ⊂ C[x0 , . . . , xm ] and we denote A = C[x0 , . . . , xm ]/I the artinian L∞ quotient ring. We set U ∗ = hx0 , . . . , xm i, so that C[x0 , . . . , xm ] = S • U ∗ = i=0 S i U ∗ . Observe that U ∗ ∼ = A1 , since we have d > 1. Given a C-vector space V , we will denote P(V ) the projective space of the 1dimensional vector subspaces of V . It v ∈ V is a non-zero element, we will denote [v] ∈ P(V ) its associated point. Definition 1. A is said to have the Weak Lefschetz Property (WLP), if for any k ∈ N and for any fixed general linear form L ∈ U ∗ the multiplication map µL : Ak −→ Ak+1 has maximal rank. Note that the property holds trivially if k ≤ d − 2 and if k ≫ 0, since in these cases either Ik = Ik+1 = 0 or Ak+1 = 0 . Definition 2. We say that A fails the WLP because of surjectivity in degree k > 0 if one has dim Ak ≥ dim Ak+1 but the multiplication µL : Ak → Ak+1 is not surjective for any linear form L. In analogous way one defines the failure of WLP because of injectivity. In general we say that A has the WLP in degree k > 0 if for a general linear form L the multiplication map µL : Ak → Ak+1 has maximal rank. We collect a few well known facts in the following proposition. Proposition 1. The following facts hold. (1) If µL : Ak → Ak+1 is injective, then µL : Aj → Aj+1 is injective for any j ≤ k. (2) A is self-dual as it is Gorenstein. As a consequence it is enough to check the WLP in the case of injectivity (resp. in the case of surjectivity). (3) If A is a c.i. algebra of type (d, . . . , d) then socle(A) = A(m+1)(d−1) ∼ =C and WLP holds for A if for a general linear form L the multiplication map µL : As → As+1 is injective, with s = ⌈(m + 1)(d − 1)/2⌉ − 1. 2.1. The Macaulay inverse system I −1 . It is appropriate also to mention at this point that the dual A∗ = ⊕A∗i is a sub S • U ∗ module of S • U , with respect the derivation of action of S • U ∗ on S • U . Indeed the action of a linear form L ∈ U ∗ defined as the traspose of the multiplication map turns out to be a derivation, and indeed the Macaulay-Matlis duality more generally identifies S k U ∗ with the space of homogeneous linear differential operators of degree k, with constant coefficients, acting on S • U , and conversely, by exchanging the roles of U and U ∗ . It is then clear that A∗ = Ann(I) and it is usually indicated with I −1 , which is known as the Macaulay inverse system associated to I. The inverse system of any Gorenstein algebra A is generated by a single element g ∈ S M U as a S • U ∗ -module, with M equal to the socle degree of A, that is I −1 is generated by derivatives of g of any order. In our case we have M = (m + 1)(d − 1). A basic, and certainly well known, result for I −1 that will be useful for us is the following. COMPLETE INTERSECTIONS OF QUADRICS AND THE WEAK LEFSCHETZ PROPERTY 3 Proposition 2. The ideal I = (f0 , . . . , fm ) ⊂ C[x0 , . . . , xm ], with fi independent and of degree d, is a c.i. ideal if and only if Id−1 does not contain any non-zero power of a linear form pd ∈ S d U , with p ∈ U and in this case Id−1 has dimension  m+d − m − 1. d Proof. I is c.i. if and only if V (f0 , . . . , fm ) = ∅ if and only if there is no [p] ∈ P(U ) such that f0 (p) = · · · = fm (p) = 0. But it is well known that d!fi (p) = hfi , pd i, which shows that I is c.i. if and only if there is no [pd ] ∈ P(Id−1 ). Moreover Id−1 = Ann(Id ) with respect to the duality pairing h , i : S d U ⊗ S d U ∗ → C, and this fact explains the dimension formula.  Remark 1. Observe that the non-zero homogeneous polynomials q ∈ S • U define hypersurfaces V (q) ⊂ P(U ∗ ). To any L ∈ U ∗ we associate a derivative ∂L (q) = L(q), defined by the action of S • U ∗ on S • U , and therefore L(q) = 0 means that the hypersurface V (q) is a cone with a vertex point in [L] ∈ P(U ∗ ). Remark 2. The study of the inverse system I −1 in association to the study of the WLP of the algebra A = S • U ∗ /I is the main theme of the article [4]. It would be interesting to fully understand the connections between the result above and the approach in the cited article. 3. Stratifications of Id . In this section we collect some easy results on the homogeneous part of the ideal I in degree d. We will denote νd (P(U ∗ )) = {[z d ] ∈ S d U ∗ | [z] ∈ P(U ∗ )} . S = {[Q] ∈ P(S d U ∗ ) | ∃z ∈ U ∗ , ∃P ∈ S d−1 U ∗ : Q = zP } More generally, for any r ≥ 1, we denote Secr−1 (S) = {[z1 P1 + · · · + zr Pr ] | zi ∈ U ∗ , Pi ∈ S d−1 U ∗ }. Proposition 3. If I = (q0 , . . . , qm ) is a a c.i. ideal generated by forms of degree d ≥ 2, then P(Id ) ∩ νd (P(U ∗ )) is a finite set and dim P(Id ) ∩ S ≤ 1. More generally one has dim P(Id ) ∩ Secr−1 (S) ≤ min(2r − 1, m). Proof. Assume dim P(I2 )∩ν2 (P(U ∗ )) ≥ 1. Consider a irreducible curve C contained in that set, and consider a local analytic parametrization of this curve at a general point of the form zλd = (z0 + λz1 + O(λ2 ))d = z0d + dλz0d−1 z1 + O(λ2 ). Then z0d , z0d−1 z1 ∈ Id , impossible because otherwise they could be completed to a basis of Id , so they should be a c.i., but they vanish on V (x0 ), a contradiction. Similarly assume that dim P(Id ) ∩ S ≥ 2. Then we would have a local analytic parametrization of a surface at a general point of the form zλ,µ Pλ,µ = (z0 + λz1 + µz2 )(P0 + λP1 + µP2 ) + o(λ, µ), contained in P(Id ), which would give z0 P0 , z0 P1 + z1 P0 , z0 P2 + z2 P0 ∈ Id . This produces a contradiction by similar reasons as above, since the three elements above are not a c.i., as they vanish on V (z0 , P0 ). In the general case, let us assume m ≥ dim P(Id ) ∩ Secr−1 (S) ≥ 2r and let us write a bijective local analytic parametrization of such a family at a general point r X i=1 zi (λ)Pi (λ) ∈ Id , 4 A. ALZATI AND R. RE with λ = (λ1 , . . . , λ2r ). Then one may expand P zi (λ) = zi + j λj zij + o(λ) P Pi (λ) = Pi + j λj Pij + o(λ) and find the relations P Pi zi Pi ∈ Id i (zi Pij + zij Pi ) ∈ Id , ∀ j = 1, . . . , 2r. Now observe that the 2r + 1 forms above are independent by construction and they all vanish on V (z1 , . . . , zr , P1 , . . . , Pr ), which has codimension ≤ 2r in Pm , a contradiction, since they should be a complete intersection.  An immediate consequence of the proposition above significantly extends the Injectivity Lemma of Proposition 4.3 of [5], proved in that paper in the case d = 2. Corollary 4 (Injectivity Lemma). Let A = C[x0 , . . . , xm ]/I an artinian algebra, with I generated by a regular sequence of forms of degree d. Then for general z ∈ A1 the multiplication map µz : Ad−1 −→ Ad is injective. Proof. Otherwise for any general [z] ∈ P(U ∗ ) there exists some P ∈ S d−1 U ∗ such that zP ∈ Id , (note that such factorization is unique) hence dim(P(Id ) ∩ S) ≥ m = dim P(U ∗ ), but this contradicts the second dimension statement of Proposition 3.  Remark 3. In [5] it was observed that, as a consequence of the result above in the case d = 2, the WLP holds for d = 2 and 2 ≤ m ≤ 3. Indeed in those cases one has s = ⌈(m + 1)(d − 1)⌉ − 1 = 1. Remark 4. Proposition 3 actually gives more precise information than Corollary 4 on the dimension so-called non Lefschetz locus, that is the locus of [z] ∈ P(A1 ) such that the moltiplication map µz : Ad−1 → Ad is not injective, by showing that this locus has dimension at most 1. We refer the reader to the recent article [1] for many other deep results in this context. In the case of d = 2, since quadrics are classified by their rank up to projective transformations, we can give a more precise and alternative form of Proposition 3, which will be useful later to cover the case d = 2 and m = 4. Proposition 5. Set Rr = {[Q] ∈ P(S 2 U ∗ ) | rk(Q) ≤ r} for any 1 ≤ r ≤ m, that is Rr is the projectivized set of quadrics of rank at most r. Let I a c.i. ideal generated by m + 1 quadrics. Then dim P(I2 ) ∩ Rr ≤ r − 1. Proof. We can use induction on r. The case r = 1 is covered already in Proposition 3. Assume that dim P(I2 ) ∩ Rr ≥ r > 1 and let Q be a general point in a r dimensional irreducible subvariety of that closed set. Hence, by the inductive hypothesis, it must be rk(Q) = r and therefore we can write Q = L21 + · · · + L2r . Since the set of quadratic forms of rank r is a single orbit under the action of GL(m + 1), we can find a local analytical parametrization of the given r-dimensional component of dim P(I2 ) ∩ Rr with parameters ǫ = (ǫ1 , . . . , ǫr ) such that Qǫ = r X (Li + ǫ1 Li1 + · · · + ǫr Lir )2 ∈ P(I2 ) ∩ Rr . i=1 Moreover, by construction, we can assume that Q, F1 = ∂ǫ1 Qǫ |ǫ=0 , . . . , Fr = ∂ǫr Qǫ |ǫ=0 are independent. Then, computing the derivatives above, we find that X X X Li Li,r Q= L2i , F1 = Li L1i , . . . , Fr = i COMPLETE INTERSECTIONS OF QUADRICS AND THE WEAK LEFSCHETZ PROPERTY 5 are r + 1 independent elements in P(I2 ) that vanish on V (L1 , . . . , Lr ) 6= ∅. Since r ≤ m and any base of I2 must be a c.i., we obtain a contradiction.  Remark 5. The results of this section, although very simple, strongly depend on the complete intersection hypothesis. They cannot in general be extended to the case of Gorenstein algebras A, even when these algebras are presented by quadrics. Indeed infinite series of counterexamples to the result in Corollary 4 in the Gorenstein case have been provided in [2], see for example their Corollary 3.8. 4. Differential lemmas Set s = ⌈(m + 1)(d − 1)/2⌉ − 1 as above. Assuming that WLP does not hold for the algebra A, that is the general multiplication map µz : As → As+1 is not injective, we consider a subvariety of P(A1 ) × P(As ) W ⊆ {([z], [Q]) ∈ P(A1 ) × P(As ) | zQ = 0} = Γ. (1) such that W is the unique component of Γ with π1 (W) = P(A1 ). The uniqueness of W comes from the fact that the fibers of the projections of the variety Γ are linear spaces. The variety W is endowed with the two projections π1 and π2 to P(A1 ) and P(As ), respectively. Then, for general [z] ∈ P(A1 ) and [Q] ∈ π2 (W), we define the vector spaces Q(z) = {Q ∈ As | zQ = 0} . Z(Q) = {z ∈ A1 | zQ = 0}, This means that π1−1 ([z]) = PQ(z) and π2−1 ([Q]) = PZ(Q). We set the following notations, for general [z] ∈ P(A1 ) and general [Q] ∈ P(A1 ) such that zQ = 0. δ = dim π2−1 ([Q]) = dim Z(Q) − 1, ε = dim π1−1 ([z]) = dim Q(z) − 1. (2) We also set N = dim W = m + ε = dim π2 (W) + δ. Now consider a general point ([z̄], [Q̄]) ∈ W and a system of parameters λ = (λ1 , . . . , λN ) for W centered at ([z̄], [Q̄]). We denote ([z], [Q]) a point in a neighborhood of ([z̄], [Q̄]), with the understanding that z = z(λ1 , . . . , λN ) and Q = Q(λ1 , . . . , λN ) are rational functions defined at λ = 0. Finally, we denote zi = ∂λi z, Qi = ∂λi Q, i = 1, . . . , N. Lemma 6. Under the notations above, one has dimhz1 , . . . , zN i = N − ε = m and dimhQ1 , . . . , QN i = N − δ. In particular one has hz, z1 , . . . , zN i = U ∗ . Moreover, the following relations hold, for any i, j = 0, . . . , N . ′ i) If  Q, Q ∈ π1−1 ([z]), then QQ′ = 0 ∈ A2s , ∂Q ii) Q ∂λ = 0 ∈ A2s ,  i   ∂Q ∂Q iii) z ∂λi = 0 ∈ A2s+1 , ∂λj iv) For any h ≥ 0 and for any 1 ≤ i1 , . . . , ih ≤ N one has   ∂hQ h+1 = 0 ∈ As+h . z ∂λi1 · · · ∂λih ∂Q In particular, for any i, one has z 2 ∂λ = 0. i 6 A. ALZATI AND R. RE Proof. The first assertions of the Lemma are clear by the fact that π1 (W) = P(U ∗ ), and by the surjectivity of the tangent maps for π1 and π2 at a general point ([z], [Q]) ∈ W. P ∂ By applying ∂λ to the relation zQ = cj (λ)fi (x) ∈ Is+1 , with x = (x0 , . . . , xm ) i a fixed base of U ∗ and fj (x) a generating set for Is+1 ⊂ S s+1 U , we immediately see that ∂Q (3) zi Q + z ∈ Is+1 . ∂λi Multiplying the relation above by Q′ and using zQ′ ∈ I, we obtain zi QQ′ ∈ I2s+1 and, since A1 = hz, z1 , . . . , zm i, we see that A1 · QQ′ = {0} ⊂ A2r . By our choice of s we have socle(A)2s = {0}, therefore we find QQ′ ∈ I2s . This proves (i). ∂Q ∈ I2s . Next, Setting Q = Q′ , by derivations of the last relation, we get Q ∂λ j ∂Q ∂Q ∂Q we compute z ∂λ = −zi Q ∂λ = 0, using (3). This completes the proof of i), ii) i ∂λj j and iii). We prove iv) by induction on h, (we assume that it is true for h and we prove it for h + 1) the base case being the starting relation zQ = 0. Let us assume by inductive hypothesis z h+1 F ∈ Is+h , F = ∂ hQ . ∂λi1 · · · ∂λih By derivation with respect to λi we obtain ∂F ∈ Is+h . ∂λi Then the inductive step is immediately proved by multiplying this last relation by z and using that z h+1 F ∈ Is+h .  (h + 1)z h zi F + z h+1 5. complete intersection algebras presented by quadrics We recall the following simple formula for Hilbert function of an artinian c.i. algebra presented by quadrics. Fact. Let A be the artinian algebra obtained from a complete intersection of  quadrics in Pm . Then one has HF (A, k) = dim Ak = m+1 for any k ≥ 0. k Indeed one can compute dim Ak from the Koszul resolution m+1 ^ 1 ^ U ∗ → S → A → 0,  and the fact that this resolution gives as result dim Ak = m+1 can be seen directly k considering the special case I = (x20 , . . . , x2m ), in which case Ak has basis given by the classes mod I of all squarefree monomials xǫ00 · · · xǫmm , i.e. with exponents  m+1 ǫi ∈ {0, 1}, whose number is exactly k . 0 → S(−2(m + 1)) ⊗ U ∗ → · · · → S(−2) ⊗ The following technical lemma will be useful later. Lemma 7. Let A be a c.i. artinian algebra as above, with m ≥ 4. If z is general in A1 and z, w ∈ A1 are linearly independent, then dimhz, wiA1 ≥ 2m − 1. Moreover one has dimhz, wiA1 ≥ 2m, unless the following properties hold. (1) m = 4 and dim P(I2 ) ∩ R4 = 3. (2) The incidence variety Υ = {(Π, [F ]) | Π ∈ Gr(m − 2, P(U )), [F ] ∈ P(I2 ), Π ⊂ V (F )} has dim Υ = 4 and there exist 4-dimensional irreducible components Υ ′ ⊆ Υ such that, denoting π1 (Π, [F ]) = Π and π2 (Π, [F ]) = [F ] the two projections, COMPLETE INTERSECTIONS OF QUADRICS AND THE WEAK LEFSCHETZ PROPERTY 7 one has dim π1 (Υ ′ ) = dim π2 (Υ ′ ) = 3. Any Π = V (z, w) with z general and such that dimhz, wiA1 = 2m − 1 is such that Π ∈ π1 (Υ ′ ) for one of these components. Proof. One has hz, wiA1 = (hz, wiU ∗ + I2 )/I2 ∼ = hz, wiU ∗ /(hz, wiU ∗ ∩ I2 ). Note ∗ that dimhz, wiU = 2(m+1)−1 = 2m+1, as it degree 2 piece of the ideal generated by z, w. Therefore, to get the general bound dimhz, wiA1 ≥ 2m − 1 it is sufficient to show that dim(hz, wiU ∗ ∩ I2 ) ≤ 2. But this is clear, because I2 is generated by a complete intersection and therefore at most 2 independent element of I2 can contain the 2-codimensional linear space Π = V (z, w). The only possibility for obtaining dimhz, wiA1 = 2m−1 is dim(hz, wiU ∗ ∩I2 ) = 2. Note that, setting Π = V (z, w), then P(hz, wiU ∗ ∩ I2 ) = π2 π1−1 (Π), with π1 , π2 the projections from Υ introduced above. Note also that for (Π, [F ]) ∈ Υ one has F = zL + wM , hence [F ] ∈ R4 , that is π2 (Υ ) ⊆ P(I2 ) ∩ R4 . If for some Π it were π2 π1−1 (Π) ⊆ R2 , then one has dim P(hz, wiU ∗ ∩ I2 ) = dim π2 π1−1 (Π) = 1 if and only if Π = V (z, w) is contained in a pencil of rank 2 (and hence reducible) quadrics Fλ,µ of the form either (λz + µw)L or (αz + βw)Mλ,µ . In any case the given pencil has a fixed hyperplane component, and therefore it cannot be contained in I2 , since this latter is generated by a complete intersection. So this case is impossible. Assume now that for Π = V (z, w) with z general one has dim π2 π1−1 (Π) = 1 and π2 π1−1 (Π) ⊂ R3 but not in R2 . The fibres π1−1 (Π) have dimension at least 1 and their union form some irreducible subvariety Υ ′ of Υ such that π2 (Υ ′ ) ⊆ R3 . A general element of π1−1 (Π) is (Π, [F ]) with [F ] of rank 3. It is well known that such a quadric F has ∞1 spaces Π ∼ = Pm−2 contained in it. Moreover by Proposition 5 we know that dim P(I2 ) ∩ R3 ≤ 2, hence dim Υ ′ ≤ 2 + dim π2−1 ([F ]) = 3 and therefore dim π1 (Υ ′ ) = 3 − dim π1−1 (Π) ≤ 2. Since there are ∞1 hyperplanes V (z) ⊂ Pm containing a fixed Π ∼ = Pm−2 , we see that if m ≥ 4, a general V (z) cannot contain ′ any Π ∈ π1 (Υ ), a contradiction. We are left with the case when, for Π = V (z, w) with z general, one has dim π2 π1−1 (Π) = 1 and π2 π1−1 (Π) ⊂ R4 but not in R3 . As above, the fibres π1−1 (Π) have dimension at least 1 and their union form some irreducible subvariety Υ ′ of Υ with the following properties: • π2 (Υ ′ ) ⊂ R4 and π2 (Υ ′ ) 6⊂ R3 . • As by Proposition 5 we know dim P(I2 ) ∩ R4 ≤ 3, we have dim π2 (Υ ′ ) ≤ 3. • As a consequence, since a general [F ] ∈ π2 (Υ ′ ) has rank 4 and it contains ∞1 spaces Π, one has dim Υ ′ ≤ 4. • On the other hand, as any Π is contained in ∞1 hyperplanes, one must have m = 1 + dim π1 (Υ ′ ) = 1 + dim Υ ′ − 1 ≤ 4, therefore m = 4 and all the preceding inequalities are actually equalities. In particular dim π1 (Υ ′ ) = 3, dim Υ ′ = 4 and, by applying the same arguments as above to every irreducible component of Υ , one has dim Υ ≤ 4, then Υ ′ is a irreducible component of Υ . Moreover dim π2 (Υ ′ ) = 3 and therefore it is a irreducible component of π2 (Υ ) = P(I2 ) ∩ R4 , which also has the maximal possible dimension dim P(I2 ) ∩ R4 = 3.  6. Application: the case d = 2 and m = 4 In this last section we apply the results obtained so far to prove that the WLP holds for c.i. algebras presented by quadrics in P4 , that is we assume d = 2 and m = 4. Even this simple case appears not to be covered in the existing literature. For d = 2 and m = 4 the dimensions of Ai for i = 0, . . . , 5 are 1, 5, 10, 10, 5, 1 8 A. ALZATI AND R. RE By the results stated in Proposition 1, we only need to examine the general multiplication map µz : A2 → A3 , as in the present case one has s = ⌈(m + 1)(d − 1)/2⌉ − 1 = 2. Note that by letting [z] vary in P(A1 ), we can build an exact sequence of sheaves (4) Φ 0 → K → A2 ⊗ OP(A1 ) −→ A3 ⊗ OP(A1 ) (1) → N → 0, where Φ is defined fiberwise by Φ([z]) = µz . Assuming that the WLP does not hold, let ([z], [Q]) ∈ W be a general element. We consider the multiplication map µQ : A2 −→ A4 ∼ = C5 . Under the notations of Section 4, we have the following result. Lemma 8. dim coker(µQ ) = dim Z(Q) = δ + 1. Q Q Proof. The map A2 −→ A4 is dual to the map A1 −→ A3 by the perfect pairings A4 ⊗A1 → A5 and A2 ⊗A3 → A5 defined by the multiplication. Hence coker(µQ ) ∼ = Z(Q)∗ , which proves the statement.  We also have the following formula relating Z(Q) with the vector space spanned by the derivatives of Q with respect to the parameters λ1 , . . . , λN , with N = dim W, introduced in the previous section. Lemma 9. For arbitrary m one has dimhQ, Q1 , . . . , QN i = m + 1 + ε − δ. In particular for m = 4 we have dimhQ, Q1 , . . . , QN i = 5 + ε − δ. Proof. The embedded tangent space to the image of the map π2 : W −→ P(A2 ) defined by ([z], [Q]) 7→ Q ∈ P(A2 ) is given by hQ, Q1 , . . . , QN i/hQi, hence it has dimension equal to dimhQ, Q1 , . . . , QN i − 1. By Lemma 6 the same tangent space has dimension N − δ = m + ε − δ, from which the statement follows.  We introduce one last preliminary result about the dimension of Z(Q). This will be the only place in this paper where it turns out very useful to consider the inverse system I −1 , mentioned in Section 2. Lemma 10. If m = 4 one has δ ≤ 1, that is dim Z(Q) ≤ 2. Proof. Assume that dim Z(Q) ≥ 3. Then consider g ∈ S 5 U such that I2−1 is generated by g as a S • U ∗ -module. Since zQ = 0 for any z ∈ Z(Q), then, by Remark 1, the cubic Q(g) ∈ S 3 U is a cone with vertex space PZ(Q), and we are assuming dim PZ(Q) ≥ 2. But then, in a suitable coordinate system, Q(g) is defined by a degree three homogeneous polynomial in two variables, and it is easy to see that the vector space generated by its partial derivatives always contain the square of a linear form, obtaining a contradiction by Proposition 2.  The spaces Z(Q) and hQ, Q1 , . . . , QN i are connected with µQ in the following way. Lemma 11. One has Z(Q)A1 + hQ, Q1 , . . . , QN i ⊆ ker µQ . Proof. This is clear by definition of Z(Q) and by Lemma 6 (i) and (ii).  We can finally prove the following. Theorem 1. The WLP holds for m = 4 and d = 2. Proof. Assume that WLP does not hold. In view of Lemma 10, we have two cases. COMPLETE INTERSECTIONS OF QUADRICS AND THE WEAK LEFSCHETZ PROPERTY 9 Case 1: δ = 1. Then, by Lemma 8 we have dim ker µQ = dim A2 − dim A4 + dim coker µQ = 5 + δ + 1 = 7. Since Z(Q)A1 ⊆ ker µQ and dim Z(Q)A1 ≥ 7 by Lemma 7, we have dim Z(Q)A1 = 7. Note that also the second part of Lemma 7 applies to this case. The planes Π = V (z, w), with hz, wi = Z(Q), with Q varying in π2 (W), form a irreducible family of dimension dim π2 (W) = 4 + ε − δ = 3 + ε. But by the second part of Lemma 7 we know that such a family can be at most 3-dimensional, hence ε = 0. In this case we have dim W = 4. Let us then consider the varieties Y = {[z] ∈ P(A1 ) | dim π1−1 ([z]) ≥ 1}, Ỹ = π1−1 (Y ) ⊂ W. Note that one necessarily has codim(Y ) ≥ 2. Indeed if dim Y = 3, then dim Ỹ ≥ 4 = dim W, hence Ỹ = W, impossible, as we have shown ε = 0. Hence a general line l ∼ = P1 ⊂ P(A1 ) does not intersect Y , and the restriction of the exact sequence (4) to l gives an exact sequence of vector bundles Φ 0 → K → A2 ⊗ OP1 −→ A3 ⊗ OP1 (1) −→ N → 0, ∼ A∗ with K and N line bundles.Recall that Φ symmetric, that is, identifying A3 = 2 by means of the multiplication pairing A3 ⊗ A2 → A5 ∼ = C, then one can write Φ as a sheaf map Φ : A2 ⊗ OP1 → A∗2 ⊗ OP1 (1), and then Φ = Φ∗ (1) . By dualizing the exact sequence above, one immediately sees that N = K∗ (1), and a degree calculation gives 2 deg K + 9 = 0, impossible. Case 2: δ = 0. Then Z(Q) = hzi and, by Lemma 11, we have zA1 + hQ, Q1 , . . . , QN i ⊆ ker µQ . Since z is general and hence we can apply the result of Corollary 4, we have dim zA1 = 5. Moreover, by Lemma 8, we have dim ker µQ = dim A2 − dim A4 + δ + 1 = 6 and finally, by Lemma 9, we have dimhQ, Q1 , . . . , QN i = 5 + ε. Then it is easy to conclude that dim(zA1 ∩ hQ, Q1 , . . . , QN i) ≥ 4 + ε ≥ 4. Now we consider a subspace V ⊆ µ−1 z (zA1 ∩hQ, Q1 , . . . , QN i) ⊂ A1 with dim V = 4. Claim. A2 = V A1 . Proof of the Claim. Recalling that A1 = U ∗ /I1 = U ∗ , the claim is equivalent to assert that V U ∗ +I2 = S 2 U ∗ . First of all, using the fact that V is the space of linear forms vanishing on one point p ∈ Pm = P(U ), that is V = H 0 Ip (1), we see that V U ∗ = H 0 Ip (2) and it has dimension dim S 2 U ∗ − 1 = 14. Then V U ∗ + I2 ( S 2 U ∗ if and only if dim(V U ∗ ∩ I2 ) ≥ 1 + dim I2 + dim V U ∗ − dim S 2 U ∗ = 5. But this means that in I2 ⊆ V U ∗ = H 0 Ip (2), which is impossible.  Then we have zA2 = zV A1 ⊂ hQ, Q1 , . . . , QN iA1 , which, by Lemma 6 (iv) implies z 3 A2 ⊂ z 2 hQ, Q1 , . . . , QN iA1 = {0}, hence, since the socle of A is generated in degree 5, one finds z 3 = 0. But this is impossible for general z ∈ A1 , since the z 3 ’s with z general generate A3 .  10 A. ALZATI AND R. RE References [1] M. Boji, J. Migliore, R.M. Miró-Roig, U. Nagel, The non-Lefschetz locus, arXiv:1609.00952 [math.AC]. [2] R. Gondim, G. Zappalà, Lefschetz properties for Artinian Gorenstein algebras presented by quadrics Proc. Amer. Math. Soc. 146 (2018), 993–1003. [3] T. Harima, J. Migliore, U. Nagel, and J. Watanabe, The Weak and Strong Lefschetz Properties for artinian K-Algebras, J. Algebra 262 (2003), 99–126. [4] E. Mezzetti, R. Miró-Roig, G. Ottaviani, Laplace Equations and the Weak Lefschetz Property Canadian Journal of Mathematics 65 (3), 634–654. [5] J. Migliore, U. Nagel, Gorenstein algebras presented by quadrics, Collect. Math. 64 (2013), 211–233. [6] R. Stanley, Weyl groups, the hard Lefschetz theorem, and the Sperner property, SIAM J. Algebraic Discrete Methods 1 (1980), 168–184. [7] J. Watanabe, The Dilworth number of Artinian rings and finite posets with rank function, Commutative Algebra and Combinatorics, Advanced Studies in Pure Math. Vol. 11, Kinokuniya Co. North Holland, Amsterdam (1987), 303–312. Alberto Alzati, Dipartimento di Matematica F.Enriques, Università di Milano, via Saldini 50, 20133 Milano (Italy) E-mail address: alberto.alzati@unimi.it Riccardo Re, Dipartimento di Scienza e Alta Tecnologia, Università dell’ Insubria, Via Valleggio 11, 22100, Como (Italy) E-mail address: riccardo.re@uninsubria.it
0math.AC
RECURRENT NEURAL NETWORK TRAINING WITH DARK KNOWLEDGE TRANSFER arXiv:1505.04630v5 [stat.ML] 8 May 2016 Zhiyuan Tang1,3 , Dong Wang1,2∗ , Zhiyong Zhang1,2 1. Center for Speech and Language Technologies (CSLT), RIIT, Tsinghua University 2. Tsinghua National Laboratory for Information Science and Technology 3. Chengdu Institute of Computer Applications, Chinese Academy of Sciences ∗ {tangzy,zhangzy}@cslt.riit.tsinghua.edu.cn Corresponding Author:wangdong99@mails.tsinghua.edu.cn ABSTRACT Recurrent neural networks (RNNs), particularly long short-term memory (LSTM), have gained much attention in automatic speech recognition (ASR). Although some successful stories have been reported, training RNNs remains highly challenging, especially with limited training data. Recent research found that a well-trained model can be used as a teacher to train other child models, by using the predictions generated by the teacher model as supervision. This knowledge transfer learning has been employed to train simple neural nets with a complex one, so that the final performance can reach a level that is infeasible to obtain by regular training. In this paper, we employ the knowledge transfer learning approach to train RNNs (precisely LSTM) using a deep neural network (DNN) model as the teacher. This is different from most of the existing research on knowledge transfer learning, since the teacher (DNN) is assumed to be weaker than the child (RNN); however, our experiments on an ASR task showed that it works fairly well: without applying any tricks on the learning scheme, this approach can train RNNs successfully even with limited training data. Index Terms— recurrent neural network, long shortterm memory, knowledge transfer learning, automatic speech recognition 1. INTRODUCTION Deep learning has gained significant success in a wide range of applications, for example, automatic speech recognition (ASR) [1]. A powerful deep learning model that has been reported effective in ASR is the recurrent neural network (RNN), e.g., [2, 3, 4]. An obvious advantage of RNNs compared to conventional deep neural networks (DNNs) is that RNNs can model long-term temporal properties and thus are suitable for modeling speech signals. A simple training method for RNNs is the backpropagation through time algorithm [5]. This first-order approach, This work was supported by the National Natural Science Foundation of China under Grant No. 61371136 and the MESTDC PhD Foundation Project No. 20130002120011. This paper was also supported by Huilan Ltd. and Sinovoice. however, is rather inefficient due to two main reasons: (1) the twists of the objective function caused by the high nonlinearity; (2) the vanishing and explosion of gradients in backpropagation [6]. In order to address these difficulties (mainly the second), a modified architecture called the long short-term memory (LSTM) was proposed in [7] and has been successfully applied to ASR [8]. In the echo state network (ESN) architecture proposed by [9], the hidden-to-hidden weights are not learned in the training so the problem of odd gradients does not exist. Recently, a special variant of the Hessian-free (HF) optimization approach was successfully applied to learn RNNs from random initialization [10, 11]. A particular problem of the HF approach is that the computation is demanding. Another recent study shows that a carefully designed momentum setting can significantly improve RNN training, with limited computation and can reach the performance of the HF method [12]. Although these methods can address the difficulties of RNN training to some extent, they are either too tricky (e.g., the momentum method) or less optimal (e.g., the ESN method). Particularly with limited data, RNN training remains difficult. This paper focuses on the LSTM structure and presents a simple yet powerful training algorithm based on knowledge transfer. This algorithm is largely motivated by the recently proposed logit matching [13] and dark knowledge distiller [14]. The basic idea of the knowledge transfer approach is that a well-trained model involves rich knowledge of the target task and can be used to guide the training of other models. Current research focuses on learning simple models (in terms of structure) from a powerful yet complex model, or an ensemble of models [13, 14] based on the idea of model compression [15]. In ASR, this idea has been employed to train small DNN models from a large and complex one [16]. In this paper, we conduct an opposite study, which employs a simple DNN model to train a more complex RNN. Different from the existing research that tries to distill knowledge from the teacher model, we treat the teacher model as a regularization so that the training process of the child model is smoothed, or a pre-training step so that the supervised training can be located at a good starting point. This in fact leads to a new training approach that is easy to perform and can be extended to any model architecture. We employ this idea to address the difficulties in RNN training. The experiments on an ASR task with the Aurora4 database verified that the proposed method can significantly improve RNN training. The reset of the paper is organized as follows. Section 2 briefly discusses some related works, and Section 3 presents the method. Section 4 presents the experiments, and the paper is concluded by Section 5. 2. RELATED TO PRIOR WORK This study is directly motivated by the work of dark knowledge distillation [14]. The important aspect that distinguishes our work from others is that the existing methods focus on distilling knowledge of complex model and use it to improve simple models, whereas our study uses simple models to teach complex models. The teacher model in our work in fact knows not so much, but it is sufficient to provide a rough guide that is important to train complex models, such as RNNs in the present study. Another related work is the knowledge transfer between DNNs and RNNs, as proposed in [17]. However, it employs knowledge transfer to train DNNs with RNNs. This still follows the conventional idea described above, and so is different from ours. 3. RNN TRAINING WITH KNOWLEDGE TRANSFER 3.1. Dark knowledge distiller The idea that a well-trained DNN model can be used as a teacher to guide the training of other models was proposed by several authors almost at the same time [13, 14, 16]. The basic assumption is that the teacher model encodes rich knowledge for the task in hand and this knowledge can be distilled to boost the child model which is often simpler and can not learn many details without the teacher’s guide. There are a few ways to distill the knowledge. The logit matching approach proposed by [13] teaches a child model by encouraging its logits (activations before softmax) close to those of the teacher model in terms of the ℓ-2 norm, and the dark knowledge distiller model proposed by [14] encourages the posterior probabilities (softmax output) of the child model close to those of the teacher model in terms of cross entropy. This transfer learning has been applied to learn simple models to approach the performance of a complex model or a large model ensemble, for example, learning a small DNN from a large DNN [16] or a DNN from a more complex RNN [17]. We focus on the dark knowledge distiller approach as it showed better performance in our experiments. Basically, a well-trained DNN model plays the role of a teacher and generates posterior probabilities of the training samples as new targets for training other models. These posterior probabilities are called ‘soft targets’ since the class identities are not as deterministic as the original one-hot ‘hard targets’. To make the targets softer, a temperature T can be applied to scale the logits in the softmax, formulated as pi = ezi /T P zj /T j e where i, j index the output units. The introduction of T allows more information of non-targets to be distilled. For example, a training sample with the hard target [1 0 0] does not involve any rank information for the second and third class; with the soft targets, e.g., [0.8, 0.15, 0.5], the rank information of the second and third class is reflected. Additionally, with a large T applied, the target is even softer, e.g, [0.6, 0.25, 0.15], which allows the non-target classes to be more prominent in the training. Note that the additional rank information on the non-target classes is not available in the original target, but is distilled from the teacher model. Additionally, a larger T boosts information of non-target classes but at the same time reduces information of target classes. If T is very large, the soft target falls back to a uniform distribution and is not informative any more1 . Therefore, T controls how the knowledge is distilled from the teacher model and hence needs to be set appropriately according to the task in hand. 3.2. Dark knowledge for complex model training Dark knowledge, in the form of soft targets, can be used not only for boosting simple models, but also for training complex models. We argue that training with soft targets offers at least two advantages: (1) it provides more information for model training and (2) it makes the training more reliable. These two advantages are particularly important for training complex models, especially when the training data is limited. Firstly, soft targets offer probabilistic class labels which are not so ‘definite’ as hard targets. On one hand, this matches the real situation where uncertainty always exists in classification tasks. For example, in speech recognition, it is often difficult to identify the phone class of a frame due to the effect of co-articulation. On the other hand, this uncertainty involves rich (but less discriminative) information within a single example. For example, the uncertainty in phone classes indicates phones are similar to each other and easy to get confused. Making use of this information in the form of soft targets (posterior probabilities) helps improve statistical strength of all phones in a collaborative way, and therefore is particularly helpful for phones with little training data. Secondly, soft targets blur the decision boundary of classes, which offers a smooth training. The smoothness associated with soft targets has been noticed in [14], which states that soft targets result in less variance in the gradient between training samples. This can be easily verified by looking at the gradients backpropagated to the logit layer, which is ti − yi for the i-th logit, where ti is the target and yi is the output of the child model in training. The accumulated 1 This argument should be not confused with the conclusion in [14] where it was found that when T is also applied to the child net, a large T is equal to logit matching. The assumption of this equivalence is that T is large compared to the magnitude of the logit values, but not infinitely large. In fact, if T is very large, the gradient will approach zero so no knowledge is distilled from the teacher model. variance is given by: X {Ex (ti − yi )2 − (Ex ti − Ex yi )2 } V ar(t) = i where the expectation Ex is conducted on the training data x. If we assume that Ex ti is identical for soft and hard targets (which is reasonable if the teacher model is well trained on the same data), then the variance is given by: X Ex (ti − yi )2 + const V ar(t) = i where const is a constant term. If we assume that the child model can well learn the teacher model, the gradient variance approaches to zero with soft targets, which is impossible with hard targets even if when the training has converged. The reduced gradient variance is highly desirable when training deep and complex models such as RNNs. We argue that it can mitigate the risk of gradient vanishing and explosion that is well known to hinder RNN training, leading to a more reliable training. 3.3. Regularization view It has been known that including both soft and hard targets improves performance with appropriate setting of a weight factor to balance their relative contributions [14]. This can be formulated as a regularized training problem, with the objective function given by: L (θ) = = αLH (θ) + LS (θ) XX (αtij + pij )ln{yij (θ)} i j where θ represents the parameters of the model, LH (θ) and LS (θ) are the cost associated with the hard and soft targets respectively, and α is the weight factor. Additionally, tij and pij are the hard and soft targets for the i-th sample on the j-th class, respectively. Note that LH (θ) is the objective function of the conventional supervised training, and so LS (θ) plays a role of regularization. The effect of the regularization term is to force the model under training (child model) to mimic the teacher model, a way of knowledge transfer. In this study, a DNN model is used as the teacher model to regularize the training of an RNN. With this regularization, the RNN training looks for optima which produce similar targets as the DNN does, so the risk of over-fitting and under-fitting can be largely reduced. 3.4. Pre-training view Instead of training the model with soft and hard targets altogether, we can first train a reasonable model with soft targets, and then refine the model with hard targets. By this way, the transfer learning plays the role of pre-training, and the conventional supervised training plays the role of fine-tuning. The rationale is that the soft targets results in a reliable training so can be used to conduct model initialization. However, since the information involved in soft targets is less discriminative, refinement with hard targets tends to be helpful. This can be informally interpreted as teaching the model with less but important discriminative information firstly, and once the model is strong enough, more discriminative information can be learned. This leads to a new pre-training strategy based on dark knowledge transfer. In the conventional pre-training approaches based on either restricted Boltzmann machine (RBM) [18] or auto-encoder (AE) [19], simple models are trained and stacked to construct complex models. The dark knowledge pre-training functions in a different way: it makes a complex model trainable by using less discriminative information (soft targets), while the model structure does not change. This approach possesses several advantages: (1) it is totally supervised and so more task-oriented; (2) it pre-trains the model as a whole, instead of layer by layer, so tends to be fast; (3) it can be used to pre-train any complex models for which the layer structure is not clear, such as the RNN model that we focus on in this paper. The pre-training view is related to the curriculum training method discussed in [20], where training samples that are easy to learn are firstly selected to train the model, while more difficult ones are selected later when the model has been fairly strong. In the dark knowledge pre-training, the soft targets can be regarded as easy samples for pre-training, and hard targets as difficult samples for fine-tuning. Interestingly, the regularization view and the pre-training view are closely related. The pre-training is essentially a regularization that places the model to some location in the parameter space where good local minima can be easily reached. This relationship between regularization and pre-training has been discussed in the context of DNN training [21]. 4. EXPERIMENTS To verify the proposed method, we use it to train RNN acoustic models for an ASR task which is known to be difficult. Note that all the RNNs we mention in this section are indeed LSTMs. The experiments are conducted on the Aurora4 database in noisy conditions, and the data profile is largely standard: 7137 utterances for model training, 4620 utterances for development and 4620 utterances for testing. The Kaldi toolkit[22] is used to conduct the model training and performance evaluation, and the process largely follows the Aurora4 s5 recipe for GPU-based DNN training. Specifically, the training starts from constructing a system based on Gaussian mixture models (GMM) with the standard 13dimensional MFCC features plus the first and second order derivatives. A DNN system is then trained with the alignment provided by the GMM system. The feature used for the DNN system is the 40-dimensional Fbanks. A symmetric 11frame window is applied to concatenate neighboring frames, and an LDA transform is used to reduce the feature dimension to 200, which forms the DNN input. The DNN architecture involves 4 hidden layers and each layer consists of 2048 units. The output layer is composed of 2008 units, equal to the total number of Gaussian mixtures in the GMM system. The cross entropy is used as the training criterion, and the stochastic gradient descendent (SGD) algorithm is employed to perform the training. In the dark knowledge transfer learning, the trained DNN model is used as the teacher model to generate soft targets for the RNN training. The RNN architecture involves 2 layers of LSTMs with 800 cells per layer. The unidirectional LSTM has a recurrent projection layer as in [4] while the non-recurrent one is discarded. The input features are the 40dimensional Fbanks, and the output units correspond to the Gaussian mixtures as in the DNN. The RNN is trained with 4 streams and each stream contains 20 continuous frames. The momentum is empirically set to 0.9, and the starting learning rate is set to 0.0001 by default. The experimental results are reported in Table 1. The performance is evaluated in terms of two criteria: the frame accuracy (FA) and the word error rate (WER). While FA is more related to the training criterion (cross entropy), WER is more important for speech recognition. In Table 1, the FAs are reported on both the training set (TR FA) and the cross validation set (CV FA), and the WER is reported on the test set. In Table 1, RNN-0 is the RNN baseline trained with hard targets. RNN-T1 and RNN-T2 are trained with dark knowledge transfer, where the temperature T is set to 1 and 2 respectively. For each dark knowledge transfer model, the soft targets are employed in three ways: in the ‘soft’ way, only soft targets are used in RNN training; in the ‘reg.’ way, the soft and hard targets are used together, and the soft targets play the role of regularization, where the gradients of the soft’s are scaled up with T 2 [14]. In the ‘pretrain’ way, the soft targets and the hard targets are used sequentially, and the soft targets play the role of pre-training. The weight factor in the regularization approach is empirically set to 0.5. Targets DNN RNN-0 RNN-T1 (soft) RNN-T1 (reg.) RNN-T1 (pretrain) RNN-T2 (soft) RNN-T2 (reg.) RNN-T2 (pretrain) Hard Hard Soft Soft + Hard Soft, Hard Soft Soft + Hard Soft, Hard FA% TR 63.0 67.3 59.4 67.5 65.5 58.2 65.8 64.6 FA% CV 45.2 51.9 49.9 53.7 54.2 49.5 53.3 54.1 WER% 11.40 13.57 11.46 10.84 10.71 11.32 10.88 10.57 Table 1: Results with Different Models and Training Methods It can be observed that the RNN baseline (RNN-0) can not beat the DNN baseline in terms of WER, although much effort has been devoted to calibrate the training process, including various trials on different learning rates and momentum values. This is consistent with the results published with the Kaldi recipe. Note that this does not mean RNNs are inferior to DNNs. From the FA results, it is clear that the RNN model leads to better quality in terms of the training objective. Unfortunately, this advantage is not propagated to WER on the test set. Additionally, the results shown here can not be interpreted as that RNNs are not suitable for ASR (in terms of WER). In fact several researchers have reported better WERs with RNNs, e.g., [3]. Our results just say that with the Aurora4 database, the RNN with the basic training method does not generalize well in terms of WER, although it works well in terms of the training criterion. This problem can be largely solved by the dark knowledge transfer learning, as demonstrated by the results of the RNN-T1 and RNN-T2 systems. It can be seen that with the soft targets only, the RNN system obtains equal (T=1) or even better (T=2) performance in comparison with the DNN baseline, which means that the knowledge embedded in the DNN model has been transferred to the RNN model, and the knowledge can be arranged in a better form within the RNN structure. Paying attention to the FA results, it can be seen that the knowledge transfer learning does not improve accuracy on the training set, but leads to better or close FAs on the CV set compared to the DNN and RNN baseline. This indicates that transfer learning with soft targets sacrifices the FA performance on the training set a little, but leads to better generalization on the CV set. Additionally, the advantage on WER indicates that the generalization is improved not only in the sense of data sets, but also in the sense of evaluation metrics. When combining soft and hard targets, either in the way of regularization or pre-training, the performance in terms of both FA and WER is improved. This confirms the hypothesis that the knowledge transfer learning does play roles of regularization and pre-training. Note that in all these cases, the FA results on the training set are lower than that of the RNN baseline, which confirms that the advantage of the knowledge transform learning resides in improving generalizability of the resultant model. When comparing the two dark knowledge RNN systems with different temperatures T , we see T=2 leads to little worse FAs on the training and CV set, but slightly better WERs. This confirms that a higher temperature generates a smoother direction and leads to better generalization. 5. CONCLUSION We proposed a novel RNN training method based on dark knowledge transfer learning. The experimental results on the ASR task demonstrated that knowledge learned by simple models can be effectively used to guide the training of complex models. This knowledge can be used either as a regularization or for pre-training, and both approaches can lead to models that are more generalizable, a desired property for complex models. The future work involves applying this technique to more complex models that are difficult to train with conventional approaches, for example deep RNNs. Knowledge transfer between heterogeneous models is under investigation as well, e.g., between probabilistic models and neural models. 6. REFERENCES [1] L. Deng and D. Yu, “Deep learning: Methods and applications,” Foundations and Trends in Signal Processing, vol. 7, no. 3-4, pp. 197–387, 2013. [Online]. Available: http://dx.doi.org/10.1561/2000000039 [2] A. Graves, A.-R. Mohamed, and G. Hinton, “Speech recognition with deep recurrent neural networks,” in Proceedings of IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2013, pp. 6645–6649. [12] I. Sutskever, J. Martens, G. Dahl, and G. Hinton, “On the importance of initialization and momentum in deep learning,” in Proceedings of the 30th International Conference on Machine Learning (ICML-13), 2013, pp. 1139–1147. [13] J. Ba and R. Caruana, “Do deep nets really need to be deep?” in Advances in Neural Information Processing Systems, 2014, pp. 2654–2662. [14] G. E. Hinton, O. Vinyals, and J. Dean, “Distilling the knowledge in a neural network,” in NIPS 2014 Deep Learning Workshop, 2014. [3] A. Graves and N. Jaitly, “Towards end-to-end speech recognition with recurrent neural networks,” in Proceedings of the 31st International Conference on Machine Learning (ICML-14), 2014, pp. 1764–1772. [15] C. Bucilu, R. Caruana, and A. Niculescu-Mizil, “Model compression,” in Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, 2006, pp. 535–541. [4] H. Sak, A. Senior, and F. Beaufays, “Long short-term memory recurrent neural network architectures for large scale acoustic modeling,” in Proceedings of the Annual Conference of International Speech Communication Association (INTERSPEECH), 2014. [16] J. Li, R. Zhao, J.-T. Huang, and Y. Gong, “Learning small-size DNN with output-distribution-based criteria,” in Proceedings of the Annual Conference of International Speech Communication Association (INTERSPEECH), 2014. [5] D. E. Rumelhart, G. E. Hinton, and R. J. Williams, “Learning representations by back-propagating errors,” Nature, vol. 323, no. 6088, pp. 533– 536, 1986, 10.1038/323533a0. [Online]. Available: http://dx.doi.org/10.1038/323533a0 [17] W. Chan, N. R. Ke, and I. Lane, “Transferring knowledge from a RNN to a DNN,” arXiv preprint arXiv:1504.01483, 2015. [6] Y. Bengio, P. Simard, and P. Frasconi, “Learning longterm dependencies with gradient descent is difficult,” Neural Networks, IEEE Transactions on, vol. 5, no. 2, pp. 157–166, 1994. [7] S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural computation, vol. 9, no. 8, pp. 1735– 1780, 1997. [8] A. Graves and J. Schmidhuber, “Framewise phoneme classification with bidirectional lstm and other neural network architectures,” Neural Networks, vol. 18, no. 5, pp. 602–610, 2005. [9] H. Jaeger and H. Haas, “Harnessing nonlinearity: Predicting chaotic systems and saving energy in wireless communication,” Science, vol. 304, no. 5667, pp. 78– 80, 2004. [10] J. Martens, “Deep learning via hessian-free optimization,” in Proceedings of the 27th International Conference on Machine Learning (ICML-10), 2010, pp. 735– 742. [11] J. Martens and I. Sutskever, “Learning recurrent neural networks with hessian-free optimization,” in Proceedings of the 28th International Conference on Machine Learning (ICML-11), 2011, pp. 1033–1040. [18] G. E. Hinton and R. R. Salakhutdinov, “Reducing the dimensionality of data with neural networks,” Science, vol. 313, no. 5786, pp. 504–507, 2006. [19] Y. Bengio, P. Lamblin, D. Popovici, H. Larochelle et al., “Greedy layer-wise training of deep networks,” Advances in neural information processing systems, vol. 19, p. 153, 2007. [20] A. Romero, N. Ballas, S. E. Kahou, A. Chassang, C. Gatta, and Y. Bengio, “Fitnets: Hints for thin deep nets,” arXiv preprint arXiv:1412.6550, 2014. [21] D. Erhan, Y. Bengio, A. Courville, P.-A. Manzagol, P. Vincent, and S. Bengio, “Why does unsupervised pretraining help deep learning?” The Journal of Machine Learning Research, vol. 11, pp. 625–660, 2010. [22] D. Povey, A. Ghoshal, G. Boulianne, L. Burget, O. Glembek, N. Goel, M. Hannemann, P. Motlicek, Y. Qian, P. Schwarz, J. Silovsky, G. Stemmer, and K. Vesely, “The kaldi speech recognition toolkit,” in IEEE 2011 Workshop on Automatic Speech Recognition and Understanding. IEEE Signal Processing Society, Dec. 2011, iEEE Catalog No.: CFP11SRW-USB.
9cs.NE
Implementation of a Distributed Coherent Quantum Observer arXiv:1702.06215v1 [quant-ph] 20 Feb 2017 Ian R. Petersen and Elanor H. Huntington Abstract— This paper considers the problem of implementing a previously proposed distributed direct coupling quantum observer for a closed linear quantum system. By modifying the form of the previously proposed observer, the paper proposes a possible experimental implementation of the observer plant system using a non-degenerate parametric amplifier and a chain of optical cavities which are coupled together via optical interconnections. It is shown that the distributed observer converges to a consensus in a time averaged sense in which an output of each element of the observer estimates the specified output of the quantum plant. I. I NTRODUCTION In this paper we build on the results of [1] by providing a possible experimental implementation of a direct coupled distributed quantum observer. A number of papers have recently considered the problem of constructing a coherent quantum observer for a quantum system; e.g., see [2]– [4]. In the coherent quantum observer problem, a quantum plant is coupled to a quantum observer which is also a quantum system. The quantum observer is constructed to be a physically realizable quantum system so that the system variables of the quantum observer converge in some suitable sense to the system variables of the quantum plant. The papers [1], [5]–[7] considered the problem of constructing a direct coupling quantum observer for a given quantum system. In the papers [1], [2], [4], [5], the quantum plant under consideration is a linear quantum system. In recent years, there has been considerable interest in the modeling and feedback control of linear quantum systems; e.g., see [8]– [10]. Such linear quantum systems commonly arise in the area of quantum optics; e.g., see [11], [12]. In addition, the papers [13], [14] have considered the problem of providing a possible experimental implementation of the direct coupled observer described in [5] for the case in which the quantum plant is a single quantum harmonic oscillator and the quantum observer is a single quantum harmonic oscillator. For this case, [13], [14] show that a possible experimental implementation of the augmented quantum plant and This work was supported by the Air Force Office of Scientific Research (AFOSR). This material is based on research sponsored by the Air Force Research Laboratory, under agreement number FA2386-16-1-4065. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the Air Force Research Laboratory or the U.S. Government. This work was also supported by the Australian Research Council (ARC). Ian R. Petersen and Elanor H. Huntington are with the Research School of Engineering, The Australian National University, Canberra, ACT 0200, Australia. Email: i.r.petersen@gmail.com, Elanor.Huntington@anu.edu.au. quantum observer system may be constructed using a nondegenerate parametric amplifier (NDPA) which is coupled to a beamsplitter by suitable choice of the amplifier and beamsplitter parameters; e.g., see [12] for a description of an NDPA. In this paper, we consider the issue of whether a similar experimental implementation may be provided for the distributed direct coupled quantum observer proposed in [1]. The paper [1] proposes a direct coupled distributed quantum observer which is constructed via the direct connection of many quantum harmonic oscillators in a chain as illustrated in Figure 1. It is shown that this quantum network can be constructed so that each output of the direct coupled distributed quantum observer converges to the plant output of interest in a time averaged sense. This is a form of time averaged quantum consensus for the quantum networks under consideration. However, the experimental implementation approach of [13], [14] cannot be extended in a straightforward way to the direct coupled distributed quantum observer [1]. This is because it is not feasible to extend the NDPA used in [13], [14] to allow for the multiple direct couplings to the multiple observer elements required in the theory of [1]. Hence, in this paper, we modify the theory of [1] to develop a new direct coupled distributed observer in which there is direct coupling only between the plant and the first element of the observer. All of the other couplings between the different elements of the observer are via optical field couplings. This is illustrated in Figure 2. Also, all of the elements of the observer except for the first one are implemented as passive optical cavities. The only active element in the augmented plant observer system is a single NDPA used to implement the plant and first observer element. These features mean that the proposed direct coupling observer is much easier to implement experimentally that the observer which was proposed in [1]. Distributed Quantum Observer Quantum Plant ... zp zo1 Fig. 1. zo2 zoN Distributed Quantum Observer of [1]. We establish that the distributed quantum observer proposed in this paper has very similar properties to the distributed quantum observer proposed in [1] in that each output of the distributed observer converges to the plant output of y1a y2a w2a -1 Quantum Plant Observer 1 wNa y(N-1)a -1 Observer N Observer 3 ... y2b zo1 w2b zo2 Fig. 2. II. Q UANTUM L INEAR S YSTEMS In the distributed quantum observer problem under consideration, both the quantum plant and the distributed quantum observer are linear quantum systems; see also [8], [15], [16]. The quantum mechanical behavior of a linear quantum system is described in terms of the system observables which are self-adjoint operators on an underlying infinite dimensional complex Hilbert space H. The commutator of two scalar operators x and y on H is defined as [x, y] = xy − yx. Also, for a vector of operators x on H, the commutator of x and a scalar operator y on H is the vector of operators [x, y] = xy − yx, and the commutator of x and its adjoint x† is the matrix of operators [x, x† ] , xx† − (x# xT )T , where x# , (x∗1 x∗2 · · · x∗n )T and ∗ denotes the operator adjoint. The dynamics of the closed linear quantum systems under consideration are described by non-commutative differential equations of the form Ax(t); y3b w3b w(N-1)b yNb zoN zo3 Distributed Quantum Observer Proposed in This Paper. interest in a time averaged sense. However, an important difference between the observer proposed in [1] and the observer proposed in this paper is that in [1] the output for each observer element corresponded to the same quadrature whereas in this paper, different quadratures are used to define the outputs with a 90◦ phase rotation as we move from observer element to element along the chain of observers. ẋ(t) = y3a ... Observer 2 w1b zp w3a -1 x(0) = x0 (1) where A is a real matrix in Rn×n , and x(t) = [ x1 (t) . . . xn (t) ]T is a vector of system observables; e.g., see [8]. Here n is assumed to be an even number and n 2 is the number of modes in the quantum system. The initial system variables x(0) = x0 are assumed to satisfy the commutation relations [xj (0), xk (0)] = 2ıΘjk , j, k = 1, . . . , n, (2) where Θ is a real skew-symmetric matrix with components Θjk . In the case of a single quantum harmonic oscillator, we will choose x = (x1 , x2 )T where x1 = q is the position operator, and x2 = p is the momentum operator. The commutation relations are [q, p] = 2i. In general, the matrix Θ is assumed to be of the form Θ = diag(J, J, . . . , J) (3) where J denotes the real skew-symmetric 2 × 2 matrix   0 1 J= . −1 0 The system dynamics (1) are determined by the system Hamiltonian which is a self-adjoint operator on the underlying Hilbert space H. For the linear quantum systems under consideration, the system Hamiltonian will be a quadratic form H = 12 x(0)T Rx(0), where R is a real symmetric matrix. Then, the corresponding matrix A in (1) is given by A = 2ΘR. (4) where Θ is defined as in (3); e.g., see [8]. In this case, the system variables x(t) will satisfy the commutation relations at all times: [x(t), x(t)T ] = 2ıΘ for all t ≥ 0. (5) That is, the system will be physically realizable; e.g., see [8]. Remark 1: Note that that the Hamiltonian H is preserved in time for the system (1). Indeed, Ḣ = 12 ẋT Rx+ 21 xT Rẋ = −xT RΘRx + xT RΘRx = 0 since R is symmetric and Θ is skew-symmetric. III. D IRECT C OUPLING D ISTRIBUTED C OHERENT Q UANTUM O BSERVERS In our proposed direct coupling coherent quantum observer, the quantum plant is a single quantum harmonic oscillator which is a linear quantum system of the form (1) described by the non-commutative differential equation ẋp (t) = zp (t) = Ap xp (t); Cp xp (t) xp (0) = x0p ; (6) where zp (t) denotes the vector of system variables to be estimated by the observer and Ap ∈ R2×2 , Cp ∈ R1×2 . It is assumed that this quantum plant corresponds to a plant  qp Hamiltonian Hp = 12 xp (0)T Rp xp (0). Here xp = pp where qp is the plant position operator and pp is the plant momentum operator. As in [1], in the sequel we will assume that Ap = 0. We now describe the linear quantum system of the form (1) which will correspond to the distributed quantum observer; see also [8], [15], [16]. This system is described by a non-commutative differential equation of the form ẋo (t) = Ao xo (t); zo (t) = Co xo (t) xo (0) = x0o ; (7) where the observer output zo (t) is the distributed observer no estimate vector and Ao ∈ Rno ×no , Co ∈ R 2 ×no . Also, xo (t) is a vector of self-adjoint non-commutative system variables; e.g., see [8]. We assume the distributed observer order no is an even number with N = n2o being the number of elements in the distributed quantum observer. We also assume that the plant variables commute with the observer variables. We will assume that the distributed quantum observer has a chain structure and is coupled to the quantum plant as shown in Figure 2. Furthermore, we write   zo1  zo2    zo =  .   ..  IV. I MPLEMENTATION OF A D ISTRIBUTED Q UANTUM O BSERVER We will consider a distributed quantum observer which has a chain structure and is coupled to the quantum plant as shown in Figure 2. In this distributed quantum observer, there a direct coupling between the quantum plant and the first quantum observer. This direct coupling is determined by a coupling Hamiltonian which defines the coupling between the quantum plant and the first element of the distributed quantum observer: Hc = xp (0)T Rc xo1 (0). (10) However, in contrast to [1], there is field coupling between the first quantum observer and all other quantum observers in the chain of observers. The motivation for this structure is that it would be much easier to implement experimentally than the structure proposed in [1]. Indeed, the subsystem consisting of the quantum plant and the first quantum observer can be implemented using an NDPA and a beamsplitter in a similar way to that described in [13], [14]; see also [12] for further details on NDPAs and beamsplitters. This is illustrated in Figure 3. zoN where zoi = Coi xoi for i = 1, 2, . . . , N. Note that Coi ∈ R1×2 . The augmented quantum linear system consisting of the quantum plant (6) and the distributed quantum observer (7) is then a quantum system of the form (1) described by equations of the form where     ẋp (t) xp (t)  ẋo1 (t)   xo1 (t)       ẋo2 (t)      = Aa  xo2 (t)  ;  ..  ..    .  .   ẋoN (t) zp (t) = zo (t) = where  xoN (t) Cp xp (t); Co xo (t) Co2 0 0 .. . CoN   .  We now formally define the notion of a direct coupled linear quantum observer. Definition 1: The distributed linear quantum observer (7) is said to achieve time-averaged consensus convergence for the quantum plant (6) if the corresponding augmented linear quantum system (8) is such that   1 Z  1 T   1  ( .  zp (t) − zo (t))dt = 0. (9) lim T →∞ T 0  ..  1 1a NDPA w 1b Fig. 3. NDPA coupled to a beamsplitter representing the quantum plant and first quantum observer. (8)  Co1   Co =   y beamsplitter Also, the remaining quantum observers in the distributed quantum observer are implemented as simple cavities as shown in Figure 4. wia yib ith cavity yia wNa wib yNb Nth cavity Fig. 4. Optical cavity implementation of the remaining quantum observers in the distributed quantum observer. The proposed quantum optical implementation of a distributed quantum observer is simpler than that of [1]. However, its dynamics are somewhat different than those of the distributed quantum observer proposed in [1]. We now proceed to analyze these dynamics. Indeed, using the results of [14], we can write down quantum stochastic differential equations (QSDEs) describing the plant-first observer system shown in Figure 3: dxp = 2Jαβ T xo1 dt; 1 2ω1 Jxo1 dt − κ1b xo1 dt + 2JβαT xp dt 2 √ − κ1b dw1b ; √ (11) dy1a = κ1b xo1 dt + dw1b   qp is the vector of position and momentum where xp = pp   q1 is the operators for the quantum plant and xo1 = p1 vector of position and momentum operators for the first quantum observer. Here, α ∈ R2 , β ∈ R2 and κ1b > 0 are parameters which depend on the parameters of the beamsplitter and the NDPA. The parameters α and β define the coupling Hamiltonian matrix defined in (10) as follows: dxo1 = Rc = αβ T . (12) In addition, the parameters of the beamsplitter and the NDPA need to be chosen as described in [13], [14] in order to obtain QSDEs of the required form (11). The QSDEs describing the ith quantum observer for i = 2, 3, . . . , N − 1 are as follows: κia + κib xoi dt dxoi = 2ωi Jxoi dt − √ √2 − κia dwia − κib dwib ; √ dyia = κib xoi dt + dwib ; √ (13) dyib = κia xoi dt + dwia   qi is the vector of position and momentum where xoi = pi operators for the ith quantum observer; e.g., see [12]. Here κia > 0 and κib > 0 are parameters relating to the reflectivity of each of the partially reflecting mirrors which make up the cavity. The QSDEs describing the N th quantum observer are as follows: √ κN a dxoN = 2ωN JxoN dt − xoN dt − κN a dwN a ; 2 √ dyN b = κN a xoN dt + dwN a (14)   qN is the vector of position and momenwhere xoN = pN tum operators for the N th quantum observer. Here κN a > 0 is a parameter relating to the reflectivity of the partially reflecting mirror in this cavity. In addition to the above equations, we also have the following equations which describe the interconnections between the observers as in Figure 2: w(i+1)a wib = = −yia ; y(i+1)b (15) for i = 1, 2, . . . , N − 1. In order to describe the augmented system consisting of the quantum plant and the quantum observer, we now combine equations (11), (13), (14) and (15). Indeed, starting with observer N , we have from (14), (15) √ dyN b = κN a xoN dt − dy(N −1)a . But from (13) with i = N − 1, √ dy(N −1)a = κ(N −1)b xo(N −1) dt + dw(N −1)b . Therefore, dyN b = = √ √ κN a xoN dt − κ(N −1)b xo(N −1) dt − dw(N −1)b √ √ κN a xoN dt − κ(N −1)b xo(N −1) dt − dyN b using (15). Hence, √ √ κ(N −1)b κN a dyN b = xoN dt − xo(N −1) dt. (16) 2 2 From this, it follows using (14) that √ dwN a = − κN a xoN dt + dyN b √ √ κ(N −1)b κN a = − xoN dt − xo(N −1) dt. 2 2 Then, using (14) we obtain the equation √ κ(N −1)b κN a dxoN = 2ωN JxoN dt + xo(N −1) dt. (17) 2 We now consider observer N − 1. Indeed, it follows from (13) and (15) with i = N − 1 that dxo(N −1) = = = 2ωN −1 Jxo(N −1) dt κ(N −1)a + κ(N −1)b xo(N −1) dt − 2 √ √ − κ(N −1)a dw(N −1)a − κ(N −1)b dyN b 2ωN −1 Jxo(N −1) dt κ(N −1)a + κ(N −1)b − xo(N −1) dt 2 √ − κ(N −1)a dw(N −1)a √ κN a κ(N −1)b − xoN dt 2 κ(N −1)b + xo(N −1) dt 2 κ(N −1)a xo(N −1) dt 2ωN −1 Jxo(N −1) dt − 2 √ κN a κ(N −1)b − xoN dt 2 √ − κ(N −1)a dw(N −1)a (18) using (16). Now using (13) and (15) with i = N − 2, it follows that √ dy(N −2)a = κ(N −2)b xo(N −2) dt + dw(N −2)b √ κ(N −2)b xo(N −2) dt + dy(N −1)b = √ √ = κ(N −2)b xo(N −2) dt + κ(N −1)a xo(N −1) dt +dw(N −1)a using (13) with i = N −1. Hence using (15) with i = N −2, it follows that √ √ κ(N −2)b xo(N −2) dt + κ(N −1)a xo(N −1) dt dy(N −2)a = −dy(N −2)a . where Therefore dy(N −2)a √ √ κ(N −2)b κ(N −1)a = xo(N −2) dt + xo(N −1) dt. 2 2 Ao = Substituting this into (18), we obtain = dxo(N −1) 2ωN −1 Jxo(N −1) dt √ κ(N −1)b κN a xoN dt − 2 √ κ(N −2)b κ(N −1)a + xo(N −2) dt. (19) 2 Continuing this process, we obtain the following QSDEs for the variables xoi : dxoi = 2ωi Jxoi dt √ κib κ(i+1)a − xo(i+1) dt √ 2 κ(i−1)b κia xo(i−1) dt + 2 −µ2 I ω2 J µ3 I ω1 J  µ2 I   2    0   Jβ  0 2 ..  . 0 = 2ω1 Jxo1 dt − √ κ1b κ(2a xo2 dt + 2JβαT xp dt. 2 (21) We now observe that the plant equation dxp = 2Jαβ T xo1 dt (22) .. . ωN−1 J µN I    ,   −µN I  ωN J     (24) and µi = (20) 0 −µ4 I .. . µN−1 I Bo = 1√ κ(i−1)b κia > 0 4 for i = 2, 3, . . . , N . To construct a suitable distributed quantum observer, we will further assume that for i = 2, 3, . . . , N − 1. Finally for xo1 , we obtain dxo1 −µ3 I ω3 J .. .  β = Cp = −µ1 α, αT , (25) where µ1 > 0 and Co =     1   2 kαk    αT −JαT  0 −αT JαT .. 0 . (−J)N−1 αT     .    (26) implies that the quantity This choice of the matrix Co means that different quadratures are used for the outputs of the elements of the distributed quantum observer with a 90◦ phase rotation as we move from observer element to element along the chain of observers. In order to construct suitable values for the quantities µi and ωi , we require that zp = αT xp satisfies dzp = 2αT Jαβ T xo1 dt = 0 since J is a skew-symmetric matrix. Therefore, zp (t) = zp (0) = zp Ao x̄o + Bo zp = 0 (23) for all t ≥ 0. We now combine equations (21), (20), (17) and write them in vector-matrix form. Indeed, let   xo1  xo2    xo =  .  .  ..  xoN Then, we can write where       x̄o =      α Jα −α −Jα α .. . (J)N −1 α This will ensure that the quantity (27)        zp .     xe = xo − x̄o (28) will satisfy the non-commutative differential equation ẋo = Ao xo + Bo zp ẋe = Ao xe . (29) This, combined with the fact that  T α  −JαT 1  Co x̄o =  kαk2  0    ×     =   1 1 .. . 1 where  0 .. . (−J)  α Jα .. . (J)N −1 α  N −1 T α        zp     zp  (30) will be used in establishing condition (9) for the distributed quantum observer. Now, we require   α  Jα     −α      Ao  −Jα  + Bo   α     ..   . N −1 (J)   ω1 Jα − µ2 Jα − µ1 Jα   µ2 α − ω 2 α + µ3 α    µ3 Jα − ω3 Jα + µ4 Jα  = 2    ..   . Ro =  ω1 I  −µ2 J       µ2 J ω2 I −µ3 J 0  xTo Ro xo = = = ω1 kxo1 k2 − 2µ2 xTo1 αxTo2 α + ω2 kxo2 k2 −2µ3 xTo2 αxTo3 α + ω3 kxo3 k2 .. . −2µN xToN −1 αxToN α + ωN kxoN k2 ω1 a∗1 a1 − ıµ2 a∗1 a2 + ıµ2 a∗2 a1 + ω2 a∗2 a2 −ıµ3 a∗2 a3 + ıµ3 a∗3 a2 + ω3 a∗3 a3 .. . −ıµN a∗N −1 aN + ıµN a∗N aN −1 + ωN a∗N aN a†o R̃o ao where    ao =   (31) a1 a2 .. . aN     ∈ CN  and for i = 1, 2, . . . , N − 1 and (32) To show that the above candidate distributed quantum observer leads to the satisfaction of the condition (9), we first note that xe defined in (28) will satisfy (29). If we can show that Z 1 T lim xe (t)dt = 0, (33) T →∞ T 0 then it will follow from (30) and (28) that (9) is satisfied. In order to establish (33), we first note that we can write Ao = 2ΘRo . ωN−1 I −µN J  qi ∈ R2 for i = 1, 2, . . . , N . Also, define pi the complex scalars ai = qi + ıpi for i = 1, 2, . . . , N . Then it is straightforward to verify that where xoi = That is, we will assume that ω N = µN . ..    .   µN J  ωN I xoN = 0. ωi = µi + µi+1 0 µ4 J .. . −µN−1 J We will now show that the symmetric matrix Ro is positivedefinite. Lemma 1: The matrix Ro is positive definite. Proof: In order to establish this lemma, let   xo1  xo2    xo =  .  ∈ R2N  ..  µN (J)N −2 α + ωN J N α This will be satisfied if and only if   ω 1 − µ2 − µ1  µ2 − ω 2 + µ3     µ3 − ω 3 + µ4   = 0.    ..   . µN − ω N µ3 J ω3 I .. .   ω1 −ıµ2  ıµ2 ω2   ıµ3 R̃o =     0 −ıµ3 ω3 .. . .. ..  . . ıµN 0    .   −ıµN  ωN Here † denotes the complex conjugate transpose of a vector. From this, it follows that the real symmetric matrix Ro is positive-definite if and only if the complex Hermitian matrix R̃o is positive-definite. To prove that R̃o is positive-definite, we first substitute the equations (31) and (32) into the definition of R̃o to obtain   µ1 + µ2 −ıµ2  ıµ2 µ2 + µ3 −ıµ3 0      . .   . ıµ3 µ3 + µ4 R̃o =     .. ..  . . −ıµN  0 ıµN µN = R̃o1 + R̃o2 where    R̃o1 =   and µ1 0 .. . 0  R̃o2 µ2 −ıµ2  +ıµ2 µ2 + µ3   +ıµ3 =    0  0 ... 0 0 ... 0   ..  ≥ 0 .  0 ... 0 −ıµ3 µ3 + µ4 .. .  .. . .. . +ıµN Now, we can write a†o R̃o2 ao 0    .   −ıµN  µN = µ2 a∗1 a1 − ıµ2 a∗1 a2 + ıµ2 a∗2 a1 + µ2 a∗2 a2 +µ3 a∗2 a2 − ıµ3 a∗2 a3 + ıµ3 a∗3 a2 + µ4 a∗3 a3 .. . +µN −1 a∗N −1 aN −1 − ıµN a∗N −1 aN +ıµN a∗N aN −1 + µN a∗N aN = µ2 (−ıa∗1 + a∗2 )(ıa1 + a2 ) +µ3 (−ıa∗2 + a∗3 )(ıa2 + a3 ) .. . +µN (−ıa∗N −1 + a∗N )(ıaN −1 + aN ) ≥ 0. Thus, R̃o2 ≥ 0. Furthermore, a†o R̃o2 ao = 0 if and only if a2 a3 aN = = .. . = −ıa1 ; −ıa2 ; −ıaN −1 . That is, the null space of R̃o2 is given by   1  −ı     −1     ı  N (R̃o2 ) = span{ }.  1     ..   .  (−ı)N −1 The fact that R̃o1 ≥ 0 and R̃o2 ≥ 0 implies that R̃o ≥ 0. In order to show that R̃o > 0, suppose that ao is a non-zero vector in N (R̃o ). It follows that a†o R̃o ao = a†o R̃o1 ao + a†o R̃o2 ao = 0. Since R̃o1 ≥ 0 and R̃o2 ≥ 0, ao must be contained in the null space of R̃o1 and the null space of R̃o2 . Therefore ao must be of the form   1   −ı     −1     ı ao = γ     1     ..   . (−ı)N −1 where γ 6= 0. However, then a†o R̃o1 ao = γ 2 µ̃1 6= 0 and hence ao cannot be in the null space of R̃o1 . Thus, we can conclude that the matrix R̃o is positive definite and hence, the matrix Ro is positive definite. This completes the proof of the lemma. We now verify that the condition (9) is satisfied for the distributed quantum observer under consideration. This proof follows along very similar lines to the corresponding proof given in [1]. We recall from Remark 1 that the quantity 1 T 2 xe (t) Ro xe (t) remains constant in time for the linear system: ẋe = Ao xe = 2ΘRo xe . That is 1 1 xe (t)T Ro xe (t) = xe (0)T Ro xe (0) 2 2 ∀t ≥ 0. (34) However, xe (t) = e2ΘRo t xe (0) and Ro > 0. Therefore, it follows from (34) that p p λmin (Ro )ke2ΘRo t xe (0)k ≤ λmax (Ro )kxe (0)k for all xe (0) and t ≥ 0. Hence, ke2ΘRo t k ≤ s λmax (Ro ) λmin (Ro ) for all t ≥ 0. Now since Θ and Ro are non-singular, Z 0 T e2ΘRo t dt = 1 2ΘRo T −1 −1 1 −1 −1 e Ro Θ − Ro Θ 2 2 (35) and therefore, it follows from (35) that Z T 1 e2ΘRo t dtk k T 0 1 1 2ΘRo T −1 −1 1 −1 −1 = k e Ro Θ − Ro Θ k T 2 2 1 2ΘRo T −1 −1 ke kkRo Θ k ≤ 2T 1 + kRo−1 Θ−1 k 2T s λmax (Ro ) −1 −1 kR Θ k λmin (Ro ) o 1 2T ≤ + → 0 1 kRo−1 Θ−1 k 2T as T → ∞. Hence, 1 k T →∞ T lim = ≤ = T Z xe (t)dtk Z T 1 k e2ΘRo t xe (0)dtk lim T →∞ T 0 Z T 1 lim e2ΘRo t dtkkxe (0)k k T →∞ T 0 0. 0 This implies 1 T →∞ T lim Z T xe (t)dt = 0 0 and hence, it follows from (28) and (30)  1 Z  1 1 T  lim zo (t)dt =  . T →∞ T 0  .. 1 Also, (23) implies 1 T →∞ T lim Z T 0    zp (t)dt =   1 1 .. . 1 that     zp .      zp .  Therefore, condition (9) is satisfied. Thus, we have established the following theorem. Theorem 1: Consider a quantum plant of the form (6) where Ap = 0. Then the distributed direct coupled quantum observer defined by equations (7), (10), (12), (24), (25), (26), (31), (32) achieves time-averaged consensus convergence for this quantum plant. R EFERENCES [1] I. R. Petersen, “Time averaged consensus in a direct coupled distributed coherent quantum observer,” in Proceedings of the 2015 American Control Conference, Chicago, IL, July 2015. [2] I. Vladimirov and I. R. Petersen, “Coherent quantum filtering for physically realizable linear quantum plants,” in Proceedings of the 2013 European Control Conference, Zurich, Switzerland, July 2013. [3] Z. Miao, L. A. D. Espinosa, I. R. Petersen, V. Ugrinovskii, and M. R. James, “Coherent quantum observers for n-level quantum systems,” in Australian Control Conference, Perth, Australia, November 2013. [4] Z. Miao, M. R. James, and I. R. Petersen, “Coherent observers for linear quantum stochastic systems,” Automatica, vol. 71, pp. 264–271, 2016. [5] I. R. Petersen, “A direct coupling coherent quantum observer,” in Proceedings of the 2014 IEEE Multi-conference on Systems and Control, Antibes, France, October 2014, also available arXiv 1408.0399. [6] ——, “A direct coupling coherent quantum observer for a single qubit finite level quantum system,” in Proceedings of 2014 Australian Control Conference, Canberra, Australia, November 2014, also arXiv 1409.2594. [7] ——, “Time averaged consensus in a direct coupled coherent quantum observer network for a single qubit finite level quantum system,” in Proceedings of the 10th ASIAN CONTROL CONFERENCE 2015, Kota Kinabalu, Malaysia, May 2015. [8] M. R. James, H. I. Nurdin, and I. R. Petersen, “H ∞ control of linear quantum stochastic systems,” IEEE Transactions on Automatic Control, vol. 53, no. 8, pp. 1787–1803, 2008. [9] H. I. Nurdin, M. R. James, and I. R. Petersen, “Coherent quantum LQG control,” Automatica, vol. 45, no. 8, pp. 1837–1846, 2009. [10] A. J. Shaiju and I. R. Petersen, “A frequency domain condition for the physical realizability of linear quantum systems,” IEEE Transactions on Automatic Control, vol. 57, no. 8, pp. 2033 – 2044, 2012. [11] C. Gardiner and P. Zoller, Quantum Noise. Berlin: Springer, 2000. [12] H. Bachor and T. Ralph, A Guide to Experiments in Quantum Optics, 2nd ed. Weinheim, Germany: Wiley-VCH, 2004. [13] I. R. Petersen and E. H. Huntington, “A possible implementation of a direct coupling coherent quantum observer,” in Proceedings of 2015 Australian Control Conference, Gold Coast, Australia, November 2015. [14] I. R. Petersen and E. Huntington, “Implementation of a direct coupling coherent quantum observer including observer measurements,” in Proceedings of the 2016 American Control Conference, Boston, MA, July 2016. [15] J. Gough and M. R. James, “The series product and its application to quantum feedforward and feedback networks,” IEEE Transactions on Automatic Control, vol. 54, no. 11, pp. 2530–2544, 2009. [16] G. Zhang and M. James, “Direct and indirect couplings in coherent feedback control of linear quantum systems,” IEEE Transactions on Automatic Control, vol. 56, no. 7, pp. 1535–1550, 2011.
3cs.SY
VALUATION THEORY, GENERALIZED IFS ATTRACTORS AND FRACTALS arXiv:1803.07809v1 [math.AC] 21 Mar 2018 JAN DOBROWOLSKI AND FRANZ-VIKTOR KUHLMANN Abstract. Using valuation rings and valued fields as examples, we discuss in which ways the notions of “topological IFS attractor” and “fractal space” can be generalized to cover more general settings. Given functions f1 , . . . , fn on a set X, we will associate to them an iterated function system (IFS), denoted by F = [f1 , . . . , fn ] , where we view F as a function on the power set P(X) defined by P(X) ∋ S 7→ F (S) := n [ fi (S) . i=1 One of the basic approaches to calling a space X “fractal” is to ask that there is an iterated function system F such that F (X) = X, and that the functions in the system satisfy certain additional forms of being “contracting”: Definition 1. A compact metric space (X, d) is called fractal if there is a system F = [f1 , . . . , fn ] with F (X) = X where the functions fi are contracting, that is, d(fi x, fi y) < d(x, y) for any distinct x, y ∈ X. In the absence of a metric, one has to find other ways of encoding what is meant by “contracting”. In [1], Banakh and Nowak give a topological analogue for the common definition of “fractal” that uses iterated function systems; for a detailed continuation of this approach, see [2]. Definition 2. A compact topological space X is called fractal if there is an iterated function system F = [f1 , . . . , fn ] consisting of continuous functions fi : X → X such that F (X) = X and the following “shrinking condition” is satisfied: (SC) for every open covering C of X, there is some k ∈ N such that for every sequence (i1 , . . . , ik ) ∈ {1, . . . , n}k there is U ∈ C with fi1 ◦ . . . ◦ fik (X) ⊆ U . Date: November 18, 2017. 2000 Mathematics Subject Classification. Primary 28A80, 12J25; Secondary 37C25, 37C70, 12J15. 1 2 JAN DOBROWOLSKI AND FRANZ-VIKTOR KUHLMANN Clearly, it suffices to check (SC) only for finite coverings. If we fix a basis for the open sets, then it suffices to check (SC) only for finite coverings consisting of basic sets, as every finite covering can be refined to such a covering. For the topology induced by a valuation v on a field K with value group vK, one can take the collection of ultrametric balls Bα (a) := {b ∈ K | v(a − b) ≥ α} where α ∈ vK and a ∈ K as a basis; note that by the ultrametric triangle law, this set is closed under nonempty intersections. For the same reason, if v(a − b) ≥ α, then Bα (a) = Bα (b). The same works when we restrict v to a subring R of K, except that then the values of the elements in R just form a linearly ordered subset of vK. Example 3. We take a prime p and denote by Fp the finite field with p elements. Then Fp consists of the elements i = i + pZ, 0 ≤ i < p. We consider the Laurent series ring (∞ ) X j R := Fp [[t]] = ij t | ij ∈ Fp . j=0 The t-adic valuation vt on Fp [[t]] is defined by ∞ X ij tj = ℓ if cℓ 6= 0 (1) vt j=ℓ where 0 ≤ ℓ ∈ Z. For 0 ≤ i ≤ p − 1, we define a function fi by ! ∞ ∞ ∞ X X X j j := i + ij t ij−1 t = i + t ij tj , fi j=0 j=1 j=0 where i is understood to be an element of Fp . Then fi (R) = i + tR and therefore, the iterated function system F = [f0 , . . . , fp−1] satisfies F (R) = S 0≤i<p i + tR = R. Each ultrametric ball in R (with respect to the t-adic valuation of Fp [[t]]) is of the form ! ( ) m−1 m−1 X X ij tj = b ∈ R | t divides b − ij tj Bm j=0 j=0 for some integer m ≥ 0, which we call the radius of the ball. (The empty sum is understood to be 0). Given any finite open covering of R consisting of ultrametric balls, we take m to be the maximum of the radii of all balls in the covering. Then the covering can be refined to a covering of the form ( ! ) m−1 X Bm i0 , . . . , im−1 ∈ {0, . . . , p − 1} . ij tj j=0 3 For every m ≥ 1 and i0 , . . . , im−1 ∈ {0, . . . , p − 1} we have that ! m−1 X fi0 ◦ . . . ◦ fim−1 (R) = Bm ij tj . j=0 Since the functions fi are continuous in the topology induced by the ultrametric (an argument will be given below in the more general case of discrete valuation rings), we see that Fp [[t]] with its ultrametric balls is fractal, in the sense of Definition 2. ⋄ Here is an obvious generalization of the previous example. Example 4. We work in the same situation as in the last example, but now fix an integer µ ≥ 0 and for every i∗ = (i∗ (0), . . . , i∗ (µ)) ∈ {0, . . . , p − 1}µ+1 we set ! µ ∞ ∞ X X X j j µ+1 ∗ fi∗ := ij t i (j)t + t ij tj . j=0 j=0 Then fi∗ (R) = µ X j=µ+1 i∗ (j)tj + tµ+1 R j=0 and therefore, the iterated function system F = [fs | s ∈ S] satisfies F (R) = µ X Stj + tµ+1 R = R . j=0 ∈ {0, . . . , p − 1}µ+1 we now have that ! µ m−1 X X j k(µ+1) , i∗k (j)t fi0 ◦ . . . ◦ fim−1 (R) = Bm t For every m ≥ 1 and i∗0 , . . . , i∗m−1 k=0 j=0 ⋄ We generalize our observations to discrete valuation rings (which in general cannot be presented in power series form, in particular not in mixed characteristic). We take a discrete valuation ring R with maximal ideal M and choose a uniformizing parameter t ∈ R, i.e., the value of t is the smallest positive element in the value set of R. Further, we choose a system of representatives S ⊂ R for the residue field R/M. Then for every s ∈ S we define a function fs by: (2) fs (a) := s + ta for a ∈ O. Then fs (R) = s + tR and therefore, [ [ fs (R) = s + tR = R . s∈S s∈S 4 JAN DOBROWOLSKI AND FRANZ-VIKTOR KUHLMANN For every m ≥ 1 and s0 , . . . , sm−1 ∈ S we have that fs0 ◦ . . . ◦ fsm−1 (R) = Bm m−1 X j=0 sj tj ! . If a, b ∈ R with a − b ∈ Bm (0), then fs (a) − fs (b) = t(a − b) ∈ Bm+1 (0). This shows that each fs is contracting and hence continuous in the topology induced by the ultrametric. If R/M is finite, then we have finitely many functions and obtain: Proposition 5. Every discrete valuation ring with finite residue field and equipped with the canonical ultrametric is fractal (under both definitions given above). Note that for any topological space X, the existenceSof a continuous IFS F = [f1 , . . . , fn ] satisfying conditions (SC) and X = i fi [X] from Definition 2 implies that X is quasi-compact. By the following example, it can be seen that these conditions do not imply that X is Hausdorff (so Definition 2 could be also considered for non-Hausdorff quasicompact spaces): Example 6. Let X = [0, 1] be equipped with the topology in which the open sets are ∅ and the cofinite sets. Define f1 , f2 : X → X by f1 (x) = x/2, f2 (x) = 1/2+x/2. Then the system (f1 , fS2 ) consists of continuous functions, and satisfies conditions (SC) and X = i fi [X]. ⋄ The following definition seems to be the weakest reasonable generalization of Definition 2 to possibly infinite function systems. Definition 7. Let X be a topological space, and {fi : i ∈ I} any set of continuous mappings X → X satisfying (SC), i.e., for any finite open covering U of X there is a natural number l such that for any g1 , . . . , gl ∈ {fi : i ∈ I}, the image g1 ◦· · ·◦gl [X] is contained in some U ∈SU. We will say that X is a topological attractor for {fi : i ∈ I}, if X = cl( i∈I fi [X]). For any cardinal number κ, we will say that X is a topological κ-IFS-attractor, if X is an attractor for some set of continuous functions satisfying (SC) of cardinality at most κ. For normal spaces, the property of being a κ-IFS-attractor implies a bound on the weight (i.e., the minimal cardinality of a basis of the topology): Proposition 8. Suppose X is a normal space which is a κ-IFS-attractor. Then w(X) ≤ 2κ + ℵ0 . Proof: Choose a system of functions F = {fi : i ∈ I} of cardinality at S most κ satisfying (SC) such that X is an attractor for F , i.e., X = cl( i∈I fi [X]). 5 Claim 1. For any natural number l, we have that (3) [ X = cl ! g1 ◦ · · · ◦ gl [X] g1 ,...,gl ∈F . Proof of the claim. We proceed by induction on l. Suppose that (3) holds. Then for every i ∈ I, we get by the continuity of fi that " #! [ fi [X] ⊆ cl fi g1 ◦ · · · ◦ gl [X] g1 ,...,gl ∈F = cl [ fi ◦ g1 ◦ · · · ◦ gl [X] g1 ,...,gl ∈F  ⊆ cl  [ g1 ,...,gl+1 ∈F S B=     X \ cl  [ (g1 ,...,gl )∈I  g1 ◦ · · · ◦ gl+1 [X] . Thus, we obtain that X = cl( i∈I fi [X]) ⊆ cl( This completes the proof of the claim. Define ! S g1 ,...,gl+1 ∈F g1 ◦ · · · ◦ gl+1[X]).  g1 ◦ · · · ◦ gl [X] l < ω, I ⊆ F l   .  Clearly, |B| ≤ 2κ + ℵ0 . We will show that B is a basis of X. So take any open subset U of X and x ∈ U. Since X is normal, we can choose open sets V1 , V2 such that x ∈ V1 ⊆ cl(V1 ) ⊆ V2 ⊆ cl(V2 ) ⊆ U . Let l be as in the condition (SC) for F and the covering {V2 , X \ cl(V1 )} of X. Define J = {(g1 , . . . , gl ) ∈ F l : g1 ◦ · · · ◦ gl [X] ⊆ X \ cl(V1 )} and S W = X \ cl( (g1 ,...,gl )∈J g1 ◦ · · · ◦ gl [X]) ∈ B. Since V1 is disjoint from S to check that W ⊆ (g1 ,...,gl )∈J g1 ◦ · · ·◦ gl [X], we get that x ∈ W . It remains S U. Take any y ∈ X \ U. We will show that y ∈ cl( (g1 ,...,gl )∈J g1 ◦ · · ·◦ gl [X]). Take any open neighbourhood Z of y. By the claim, g1 ◦ · · · ◦ gl [X] meets Z ∩ (X \ cl(V2 )) for some h1 , . . . , hl ∈ F . Then the image g1 ◦ · · · ◦ gl [X] is not contained in VS 2 , so it is contained in X \ cl(V1 ) and (h1 , . . . , hl ) ∈ J. Therefore, Z meets (g1 ,...,gl )∈J g1 ◦ · · · ◦ gl [X], and we are done.  The above proposition applies in particular to compact spaces (which are known to be normal). In particular, we obtain that every topological IFSattractor has a countable basis. Thus, by the Urysohn metrization theorem, we get: Corollary 9. Every topological IFS-attractor is metrizable. 6 JAN DOBROWOLSKI AND FRANZ-VIKTOR KUHLMANN Condition (SC) is not satisfied in some natural examples where the metric shrinking condition is satisfied (i.e., liml supi1 ,...,il diam(fi1 ◦· · ·◦fil [X]) = 0): Example 10. Let X = ω ω be the Baire space (which is homeomorphic to k((t)) considered with the valuation topology, where k is any field of cardinality ℵ0 ). For any i < ω, define fi : X → X as follows: fi (x)(0) = i and fi (x)(n) = x(n − 1) for n > 0. Then (SC) is not satisfied S for fi , i < ω, which is witnessed by the covering {U, X\U}, where U = n<ω {x ∈ X : x(0) = n, x(1) = · · · = x(n) = 0}. ⋄ Thus, we want to consider another topological shrinking condition, in which we are allowed to choose a basis from which the covering sets are taken. However, to make it possible to cover in this way the whole space (which is not assumed to be compact), we allow one of the covering sets to be not in the fixed basis. This leads to the following definition: Definition 11. A family of functions (fi )i∈I on a topological space X satisfies (SC∗) if there is a basis B of X such that for every finite open covering C of X containing at most one set which is not in B, there is some k ∈ N such that, for every sequence (i1 , . . . , ik ) ∈ I k , there is U ∈ C with fi1 ◦ . . . ◦ fik (X) ⊆ U . Every space is an attractor for the set of all constant functions from X to X (i.e., is covered by their images). We will say that X is a weak ∗-IFS attractor if it is an attractor for a set of functions satisfying (SC∗) of a cardinality smaller than |X|. We will say that X is a ∗-IFS attractor if it is an attractor for a finite set of functions satisfying (SC∗). Clearly, we have: Remark 12. If X is a compact space, then it is a ∗-IFS attractor if and only if it is a topological IFS attractor. By the following example, it can be seen that being a ∗-IFS attractor does not imply compactness: Example 13. Let X = ω be considered with the discrete topology. Define f0 , f1 : X → X by f0 (n) = 0 and f1 (n) = n + 1. Then X is a ∗-IFS attractor for {f0 , f1 }, so X is a ∗-IFS attractor. Proof: We choose a basis B consisting of all singletons. Consider any covering of X of a form {U, {n1 }, . . . , {nl }}. Then it is sufficient to take k = max(n1 , . . . , nl ) + 1.  Example 14. Let X = ω ω , and let fi : X → X, i < ω be as in Example 10. Then, (fi )i<ω satisfies (SC∗), so X is a weak ∗-IFS attractor. More generally, for any cardinal number κ, the space κω is an attractor for a set of functions of cardinality κ, so it is a weak ∗-IFS attractor if κ < κω (this holds for example for all cardinals with countable cofinality, so for unboundedly many cardinals). 7 Proof: For any α ∈ κ, define fα : κω → κω by fα (x)(0) = α and fα (x)(n) = x(n − 1) for n > 0. We choose the standard basis of κω , i.e., B = {Ax : x ∈ κk , k < ω}, where Ax = {y ∈ κω : x ⊆ y}. Write |x| = k if x ∈ κk . Choose any open covering of κω of the form {U, Ax1 , . . . , Axn }. Put k = max(|x1 |, . . . , |xn |). For any sequence (α0 , . . . , αk−1) ∈ κk we have that fα0 ◦ · · ·◦ fαk−1 [κω ] = Ay , where y(i) = αi for all i < k, so this image is either contained in one of the sets Ax1 , . . . , Axn , or disjoint from all of them and thus contained in U.  Proposition 15. Suppose A is a densely ordered abelian group and | · | : A → {a ∈ A | a ≥ 0} is the associated absolute value. Consider a collection of functions fi : A → A, i ∈ I. Suppose that there is a sequence (ai )i<ω of positive elements of A which converges to 0, and that for every k and any sequence (i1 , . . . , ik ) ∈ I k we have diam(fi1 ◦ · · · ◦ fik [A]) < ai . Then fi : A → A, i ∈ I satisfies SC∗ (where we consider A with the order topology). Proof: We choose a basis B of the order topology on A consisting of all open intervals. We consider any covering of A of the form {U, (a1 , b1 ), . . . , (an , bn )}. For any i there is ci > 0 such that each of the intervals (ai − ci , ai + ci ), (bi − ci , bi + ci ) is contained in one of the sets from the covering. Now, choose k such that for every sequence (i1 , . . . , ik ) ∈ I k we have diam(fi1 ◦· · ·◦fik [A]) < c := 1/2 min(c1 , . . . , cn , b1 −a1 , . . . , bn −an ). Then for a ∈ A,, [a − c, a + c] is a subset of some of the sets from the covering: otherwise, by the choice of ci ’s, a would be at distance > c from all ai ’s and bi ’s, and hence a could not belong any of the intervals (ai , bi ) (as in that case we would have [a − c, a + c] ⊆ (ai , bi ). But that would mean that [a − c, a + c] ⊆ U. By the above, any set of diameter smaller than c is contained in one of the sets from the covering, so we are done.  Corollary 16. R is a weak ∗-IFS attractor. Proof: Take a continuous bijection f0 : R → (−1, 1) which is Lipschitz with constant 1/2. Define fn (x) = n+f0 (x) for any integer n. Then, clearly, the family {fn : n ∈ Z} satisfies the assumptions of Proposition 15, so we obtain that it satisfies SC∗. Of course, R is an attractor for that family (and has a bigger cardinality).  A fractal space is compact. If we have a space that is only locally compact, one can ask whether it is “locally fractal”, that is, whether every element is contained in a fractal subspace. Example 17. We consider the Laurent series field (∞ ) X K := Fp ((t)) = ij tj | ℓ ∈ Z , ij ∈ Fp . j=ℓ 8 JAN DOBROWOLSKI AND FRANZ-VIKTOR KUHLMANN The t-adic valuation vt on Fp ((t)) is defined by (1) where ℓ is now an arbitrary integer. For every k ∈ Z, the function tk Fp ((t)) ∋ c 7→ tℓ−k c ∈ tℓ Fp ((t)) is a homeomorphism w.r.t.Sthe topology induced by the t-adic valuation. On the other hand, K = k∈Z tk Fp ((t)). So we see that Fp ((t)) is the union over an increasing chain of mutually homeomorphic fractal spaces. ⋄ However, we wish to show that Fp ((t)) is locally fractal in a stronger sense. The idea is to write Fp ((t)) as a union over a collection of mutually homeomorphic fractal subspaces and extend the functions we have used for B0 (0) = Fp [[t]] in a suitable way so that they work simultaneously for all of these subspaces. To this end, we observe that for any two a, b ∈ K, the function B0 (a) ∋ c 7→ c − a + b ∈ B0 (b) is a homeomorphism. Note that since there are only finitely many elements in Bℓ (0) that are S non-equivalent modulo B0 (0), we can write it as a finite union of the form j B0 (aj ). Example 18. We extend the functions fi we used for Fp [[t]] by setting: ! ∞ −1 ∞ −1 ∞ X X X X X j j j j fi := ij t ij t + i + ij−1 t = ij t + i + t ij tj . j=ℓ j=1 j=ℓ j=ℓ j=0 P∞ aj tj ∈ Fp ((t)) with aj ∈ Fp we have that ! −1 −1 X X j aj tj + fi (Fp [[t]]) aj t + Fp [[t]] = fi (B0 (a)) = fi For every a = j=ℓ j=ℓ j=ℓ and therefore, n [ i=1 fi (B0 (a)) = −1 X j aj t + j=ℓ n [ fi (Fp [[t]]) = i=1 −1 X aj tj + Fp [[t]] = B0 (a) . j=ℓ On the other hand, for every m ≥ 1 and i0 , . . . , im−1 ∈ {0, . . . , p − 1} we have that ! −1 m−1 X X fi0 ◦ . . . ◦ fim−1 (B0 (a)) = Bm aj tj + ij tj ⊂ B0 (a) . j=ℓ j=0 ⋄ For arbitrary discretely valued fields (K, v) with valuation ring R and valuation ideal M we can proceed as follows. As before, we choose a uniformizing parameter t ∈ K and a system of representatives S ⊂ R for the residue field Kv. We set ( −1 ) X K − := sj tj 0 ≥ ℓ ∈ Z snd sℓ , . . . , s−1 ∈ S . j=ℓ 9 Then for every a ∈ R there is a unique element a−1 ∈ K −1 such that a − a−1 ∈ R. For every s ∈ S we define a function fs : K → K by fs (a) := a− + s + t(a − a− ) . (4) For every a ∈ K we obtain that fs (B0 (a)) = a− + s + tR and therefore, [ [ fs (B0 (a)) = a− + s + tR = a− + R = B0 (a) . s∈S s∈S On the other hand, for every m ≥ 1 and s0 , . . . , sm−1 ∈ S we have that ! m−1 X fs0 ◦ . . . ◦ fsm−1 (B0 (a)) = Bm a− + sj tj ⊂ B0 (a) . j=0 Take b, c ∈ B0 (a). Then b − c ∈ B0 (0), and if b − c ∈ Bm (0) with m ≥ 0, then b− = c− and fs (b) − fs (c) = b− + s + t(b − b− ) − c− − s − t(c − c− ) = t(b − c) ∈ Bm+1 (0) . This shows that each fs is contracting and hence continuous in the topology induced by the ultrametric. We define: Definition 19. A locally compact metric space (X, d) is locally fractal if it is the union over a collection of mutually homeomorphic subspaces Xj , j ∈ J, and there is a system F = [f1 , . . . , fn ] of functions fi : X → X such that for every j ∈ J, Xj is fractal w.r.t. the restrictions of the functions fi to Xj . Definition 20. A locally compact topological space X is (locally fractal if it is the union over a collection of mutually homeomorphic subspaces Xj , j ∈ J, and there is a system F = [f1 , . . . , fn ] of functions fi : X → X such that for every j ∈ J, Xj is (topologically) fractal w.r.t. the restrictions of the functions fi to Xj . Note that we do not require the functions fi to be continuous or contracting or to satisfy (SC) on all of X. Indeed, the functions we constructed above have the property that if (a−b)− 6= 0, then (fi (a)−fi (b))− = (a−b)− . We have proved: Proposition 21. Every discretely valued field with finite residue field is locally fractal under both definitions. References [1] T. Banakh and M. Nowak: A 1-dimensional Peano continuum which is not an IFS attractor, Proc. Amer. Math. Soc. 141 (2013), 931–935 [2] T. Banakh, W. Kubiś, N. Novosad, M. Nowak and F. Strobin: Contractive function systems, their attractors and metrization, Topological Methods in Nonlinear Analysis 46 (2015), 1029–1066 10 JAN DOBROWOLSKI AND FRANZ-VIKTOR KUHLMANN Faculty of Mathematics and Physical Sciences, University of Leeds, Leeds LS2 9JT, UK E-mail address: dzas87@gmail.com Institute of Mathematics, ul. Wielkopolska 15, 70-451 Szczecin, Poland E-mail address: fvk@math.usask.ca
0math.AC
Optimal weighted least-squares methods ∗ arXiv:1608.00512v1 [math.NA] 1 Aug 2016 Albert Cohen† and Giovanni Migliorati‡ August 2, 2016 Abstract We consider the problem of reconstructing an unknown bounded function u defined on a domain X ⊂ Rd from noiseless or noisy samples of u at n points (xi )i=1,...,n . We measure the reconstruction error in a norm L2 (X, dρ) for some given probability measure dρ. Given a linear space Vm with dim(Vm ) = m ≤ n, we study in general terms the weighted least-squares approximations from the spaces Vm based on independent random samples. It is well known that least-squares approximations can be inaccurate and unstable when m is too close to n, even in the noiseless case. Recent results from [4, 5] have shown the interest of using weighted least squares for reducing the number n of samples that is needed to achieve an accuracy comparable to that of best approximation in Vm , compared to standard least squares as studied in [3]. The contribution of the present paper is twofold. From the theoretical perspective, we establish results in expectation and in probability for weighted least squares in general approximation spaces Vm . These results show that for an optimal choice of sampling measure dµ and weight w, which depends on the space Vm and on the measure dρ, stability and optimal accuracy are achieved under the mild condition that n scales linearly with m up to an additional logarithmic factor. In contrast to [3], the present analysis covers cases where the function u and its approximants from Vm are unbounded, which might occur for instance in the relevant case where X = Rd and dρ is the Gaussian measure. From the numerical perspective, we propose a sampling method which allows one to generate independent and identically distributed samples from the optimal measure dµ. This method becomes of interest in the multivariate setting where dµ is generally not of tensor product type. We illustrate this for particular examples of approximation spaces Vm of polynomial type, where the domain X is allowed to be unbounded and high or even infinite dimensional, motivated by certain applications to parametric and stochastic PDEs. AMS classification numbers: 41A10, 41A25, 41A65, 62E17, 93E24. Keywords: multivariate approximation, weighted least squares, error analysis, convergence rates, random matrices, conditional sampling, polynomial approximation. 1 Introduction Let X be a Borel set of Rd . We consider the problem of estimating an unknown function u : X → R from pointwise data (y i )i=1,...,n which are either noiseless or noisy observations of u at points (xi )i=1,...,n from X. In numerous applications of interest, some prior information is either established or assumed on the function u. Such information may take various forms such as: ∗ This research is supported by Institut Universitaire de France and the ERC AdV project BREAD. Universités, UPMC Univ Paris 06, CNRS, UMR 7598, Laboratoire Jacques-Louis Lions, 4, place Jussieu 75005, Paris, France. email: cohen@ljll.math.upmc.fr ‡ Sorbonne Universités, UPMC Univ Paris 06, CNRS, UMR 7598, Laboratoire Jacques-Louis Lions, 4, place Jussieu 75005, Paris, France. email: migliorati@ljll.math.upmc.fr † Sorbonne 1 (i) regularity properties of u, in the sense that it belongs to a given smoothness class; (ii) decay or sparsity of the expansion of u in some given basis; (iii) approximability of u with some prescribed error by given finite-dimensional spaces. Note that the above are often related to one another and sometimes equivalent, since many smoothness classes can be characterized by prescribed approximation rates when using certain finite-dimensional spaces or truncated expansions in certain bases. This paper uses the third type of prior information, taking therefore the view that u can be “well approximated” in some space Vm of functions defined everywhere on X, such that dim(Vm ) = m. We work under the following mild assumption: f or any x ∈ X, there exists v ∈ Vm such that v(x) 6= 0. (1) This assumption holds, for example, when Vm contains the constant functions. Typically, the space Vm comes from a family (Vj )j≥1 of nested spaces with increasing dimension, such as algebraic or trigonometric polynomials, or piecewise polynomial functions on a hierarchy of meshes. We are interested in measuring the error in the L2 (X, dρ) norm Z 1/2 kvk := |v|2 dρ , X where dρ is a given probability measure on X. We denote by h·, ·i the associated inner product. One typical strategy is to pick the estimate from a finite-dimensional space Vm such that dim(Vm ) = m. The ideal estimator is given by the L2 (X, dρ) orthogonal projection of u onto Vm , namely Pm u := argmin ku − vk. v∈Vm In general, this estimator is not computable from a finite number of observations. The best approximation error em (u) := min ku − vk = ku − Pm uk, v∈Vm thus serves as a benchmark for a numerical method based on a finite sample. In the subsequent analysis, we make significant use of an arbitrary L2 (X, dρ) orthonormal basis {L1 , . . . , Lm } of the space Vm . We also introduce the notation em (u)∞ := min ku − vkL∞ , v∈Vm ∞ where L is meant with respect to dρ, and observe that em (u) ≤ em (u)∞ for any probability measure dρ. The weighted least-squares method consists in defining the estimator as n uW := argmin v∈Vm 1X i w |v(xi ) − y i |2 , n i=1 (2) where the weights wi > 0 are given. In the noiseless case y i = u(xi ), this also writes argmin ku − vkn , (3) v∈Vm where the discrete seminorm is defined by n kvkn := 1X i w |v(xi )|2 n i=1 2 !1/2 . (4) This seminorm is associated with the semi-inner product h·, ·in . If we expand the solution to (3) as Pm j=1 vj Lj , the vector v = (vj )j=1,...,m is the solution to the normal equations Gv = d, (5) where the matrix G has entries Gj,k = hLj , Lk in and where the data vector d = (dj )j=1,...,m is given Pn by dj := n1 i=1 wi y i Lj (xi ). This system always has at least one solution, which is unique when G is nonsingular. When G is singular, we may define uW as the unique minimal ℓ2 norm solution to (5). Note that G is nonsingular if and only if k · kn is a proper norm on the space Vm . Then, if the data are noisefree that is, when y i = u(xi ), we may also write n uW = Pm u, n where Pm is the orthogonal projection onto Vm for the norm k · kn . In practice, for the estimator (2) to be easily computable, it is important that the functions L1 , . . . , Lm have explicit expressions that can be evaluated at any point in X so that the system (5) can be assembled. Let us note that computing this estimator by solving (5) only requires that {L1 , . . . , Lm } is a basis of the space Vm , not necessarily orthonormal in L2 (X, dρ). Yet, since our subsequent analysis of this estimator makes use of an L2 (X, dρ) orthonormal basis, we simply assume that {L1 , . . . , Lm } is of such type. In our subsequent analysis, we sometimes work under the assumption of a known uniform bound kukL∞ ≤ τ. (6) We introduce the truncation operator z 7→ Tτ (z) := sign(z) min{|z|, τ }, and we study the truncated weighted least-squares approximation defined by uT := Tτ ◦ uW . Note that, in view of (6), we have |u − uT | ≤ |u − uW | in the pointwise sense and therefore ku − uT k ≤ ku − uW k. The truncation operator aims at avoiding unstabilities which may occur when the matrix G is ill-conditioned. In this paper, we use randomly chosen points xi , and corresponding weights wi = w(xi ), distributed in such a way that the resulting random matrix G concentrates towards the identity I as n increases. Therefore, if no L∞ bound is known, an alternative strategy consists in setting to zero the estimator when G deviates from the identity by more than a given value in the spectral norm. We recall that for m × m matrices X, this norm is defined as kXk2 := supkvk2 =1 kXvk2 . More precisely, we introduce the conditioned least-squares approximation, defined by ( uW , if kG − Ik2 ≤ 12 , uC := 0, otherwise. The choice of 12 as a threshold for the distance between G and I in the spectral norm is related to our subsequent analysis. However, the value 21 could be be replaced by any real number in ]0, 1[ up to some minor changes in the formulation of our results. Note that kG − Ik2 ≤ 1 =⇒ cond(G) ≤ 3. 2 3 (7) It is well known that if n ≥ m is too much close to m, weighted least-squares methods may become unstable and inaccurate for most sampling distributions. For example, if X = [−1, 1] and Vm = Pm−1 is the space of algebraic polynomials of degree m − 1, then with m = n the estimator coincides with the Lagrange polynomial interpolation which can be highly unstable and inaccurate, in particular for equispaced points. The question that we want to address here in general terms is therefore: Given a space Vm and a measure dρ, how to best choose the samples y i and weights wi in order to ensure that the L2 (X, dρ) error ku − ũk is comparable to em (u), with n being as close as possible to m, for ũ ∈ {uW , uT , uC } ? We address this question in the case where the xi are randomly chosen. More precisely, we draw independently the xi according to a certain probabiity measure dµ defined on X. A natural prescription for the success of the method is that kvkn approaches kvk as n tends to +∞. Therefore, one first obvious choice is to use dµ = dρ and wi = 1, i = 1, . . . , n, (8) that is, sample according to the measure in which we plan to evaluate the L2 error and use equal weights. When using equal weights wi = 1, the weighted least-squares estimator (2) becomes the standard leastsquares estimator, as a particular case. The strategy (8) was analyzed in [3], through the introduction of the function m X |Lj (x)|2 , x 7→ km (x) := j=1 which is the diagonal of the integral kernel of the projector Pm . This function only depends on Vm and dρ. It is strictly positive in X due to Assumption 1. Its reciprocal function is characterized by 1 = min kvk2 , km (x) v∈Vm ,v(x)=1 and is called Christoffel function in the particular case where Vm is the space of algebraic polynomials of total degree m − 1, see [10]. Obviously, the function km satisfies Z km dρ = m. (9) X We define Km = Km (Vm , dρ) := kkm kL∞ , and recall the following results from [3, 7] for the standard least-squares method with the weights and the sampling measure chosen as in (8). Theorem 1 For any r > 0, if m and n are such that the condition Km ≤ κ n 1 − ln 2 , with κ := κ(r) = ln n 2 + 2r (10) is satisfied, then the following hold: (i) The matrix G satisfies the tail bound   1 ≤ 2n−r . Pr kG − Ik2 > 2 4 (11) (ii) If u ∈ L2 (X, dρ) satisfies a uniform bound (6), then the truncated least-squares estimator satisfies, in the noiseless case, E(ku − uT k2 ) ≤ (1 + ε(n))em (u)2 + 8τ 2 n−r , (12) where ε(n) := 4κ ln(n) → 0 as n → +∞, and κ as in (10). (iii) If u ∈ L∞ (X, dρ), then the truncated and nontruncated least-squares estimators satisfy, in the noiseless case, √ (13) ku − uT k ≤ ku − uW k ≤ (1 + 2)em (u)∞ , with probability larger than 1 − 2n−r . The second item in the above result shows that the optimal accuracy em (u) is met in expectation, up to an additional term of order n−r . When em (u) has polynomial decay O(m−s ), we are ensured that this additional term can be made negligible by taking r strictly larger than s/2, which amounts in taking κ(r) small enough. Condition (10) imposes a minimal number of samples to ensure stability and accuracy of standard least squares. Since (9) implies that Km ≥ m, the fulfillment of this condition requires that n is at least of the order m ln(m). However simple examples show that the restriction can be more severe, for example if Vm = Pm−1 on X = [−1, 1] and with ρ being the uniform probability measure. In this case, one √ choice for the Lj are the Legendre polynomials with proper normalization kLj kL∞ = |Lj (1)| = 1 + 2j so that Km = m2 , and therefore condition (10) imposes that n is at least of order m2 ln(m). Other examples in the multivariate setting are discussed in [1, 2] which show that for many relevant approximation spaces Vm and probability measures dρ, the behaviour of Km is superlinear in m, leading to a very demanding regime in terms of the needed number n of samples. In the case of multivariate downward closed polynomial spaces, precise upper bounds for Km have been proven in [2, 6] for measures associated to Jacobi polynomials. In addition, note that the above theory does not cover simple situations such as algebraic polynomials over unbounded domains, for example X = R equipped with the Gaussian measure, since the orthonormal polynomials Lj are unbounded for j ≥ 2 and thus Km = ∞ if m ≥ 2. 2 Main results In the present paper, we show that these limitations can be overcome, by using a proper weighted leastsquares method. We thus return to the general form of the discrete norm (4) used in the definition of the weighted least-squares estimator. We now use a sampling measure dµ which generally differs from dρ and is such that wdµ = dρ, R where w is a positive function defined everywhere on X and such that X w−1 dρ = 1, and we then consider the weighted least-square method with weights given by wi = w(xi ). With such a choice, the norm kvkn again approaches kvk as n increases. The particular case dµ = dρ and w ≡ 1 corresponds to the standard least-squares method analyzed by Theorem 1. Note that changing the sampling measure is a commonly used strategy for reducing the variance in Monte Carlo methods, where it is referred to as importance sampling. 5 With Lj again denoting the L2 (X, dρ) orthonormal basis of Vm , we now introduce the function x 7→ km,w (x) := m X w(x)|Lj (x)|2 , j=1 which only depends on Vm , dρ and w, as well as Km,w = Km,w (Vm , dρ, w) := kkm,w kL∞ . R √ √ Note that, since the wLj are an L2 (X, dµ) orthonormal basis of wVm , we find that X km,w dµ = m and thus Km,w ≥ m. We prove in this paper the following generalization of Theorem 1. Theorem 2 For any r > 0, if m and n are such that the condition 1 − ln 2 n , with κ := ln n 2 + 2r (14)   1 ≤ 2n−r . Pr kG − Ik2 > 2 (15) Km,w ≤ κ is satisfied, then the following hold: (i) The matrix G satisfies the tail bound (ii) If u ∈ L2 (X, dρ) satisfies a uniform bound (6), then the truncated weighted least-squares estimator satisfies, in the noiseless case, E(ku − uT k2 ) ≤ (1 + ε(n))em (u)2 + 8τ 2 n−r , where ε(n) := 4κ ln(n) (16) → 0 as n → +∞, and κ as in (10). (iii) If u ∈ L∞ (X, dρ), then the nontruncated weighted least-squares estimators satisfy, in the noiseless case, √ ku − uW k ≤ (1 + 2)em (u)∞ , (17) with probability larger than 1 − 2n−r . (iv) If u ∈ L2 (X, dρ), then the conditioned weighted least-squares estimator satisfies, in the noiseless case, E(ku − uC k2 ) ≤ (1 + ε(n))em (u)2 + 2kuk2n−r , where ε(n) := 4κ ln(n) (18) → 0 as n → +∞, and κ as in (10). Let us mention that the quantity Km,w has been considered in [4], where similar stability and approximation results have been formulated in a slightly different form (see in particular Theorem 2.1 therein), in the specific framework of total degree polynomial spaces. The interest of Theorem 2 is that it leads us in a natural way to an optimal sampling strategy for the weighted least-square method. We simply take w := m m = Pm , 2 km j=1 |Lj | (19) and with such a choice for w one readily checks that dµ := km dρ, m 6 (20) R is a probability measure on X since X km dρ = m. In addition, we have for this particular choice that km,w = wkm = m, and therefore Km,w = m. We thus obtain the following result as a consequence of Theorem 2, which shows that the above choice of w and dµ allows us to obtain near-optimal estimates for the truncated weighted least-squares estimator, under the minimal condition that n is at least of the order m ln(m). Corollary 1 For any r > 0, if m and n are such that the condition m≤κ n 1 − ln 2 , with κ := ln n 2 + 2r (21) is satisfied, then the conclusions (i), (ii), (iii) and (iv) of Theorem 2 hold for weighted least squares with the choice of w and dµ given by (19) and (20). One of the interests of the above optimal sampling strategy is that it applies to polynomial approximation on unbounded domains that were not covered by Theorem 1, in particular X = R equipped with the Gaussian measure. In this case, the relevant target functions u are often nonuniformly bounded and therefore the results in items (ii) and (iii) of Theorem 2 do not apply. The result in item (iv) for the conditioned estimator uC remains valid, since it does not require uniform boundedness of u. Let us remark that all the above results are independent of the dimension d of the domain X. However, raising d has the unavoidable effect of restricting the classes of functions for which the best approximation error em (u) or em (u)∞ have some prescribed decay, due to the well-known curse of dimensionality. Note that the optimal pair (dµ, w) described by (19) and (20) depends on Vm , that is w = wm and dµ = dµm . This raises a difficulty for properly choosing the samples in settings where the choice of Vm is not fixed a-priori, such as in adaptive methods. In certain particular cases, it is known that wm and dµm admit limits w∗ and dµ∗ as m → ∞ and are globally equivalent to these limits. One typical example is given by the univariate polynomial spaces Vm = Pm−1 , when X = [−1, 1] and dρ = ρdx where ρ is a Jacobi weight and dx is the Lebesgue measure on X. In this case dµ∗ is the pluripotential equilibrium measure dµ∗ = dx √ , 2π 1 − x2 see e.g. [11, 9], and one has cdµ∗ ≤ dµm ≤ Cdµ∗ , m ≥ 1, for some fixed constants 0 < c < C < ∞. Thus, in such a case, the above corollary also holds for the choice w = w∗ and dµ = dµ∗ under the condition m ≤ Cc κ lnnn . The development of sampling strategies in cases of varying values of m without such asymptotic equivalences is the object of current investigation. A closely related weighted least-squares strategy was recently proposed and analyzed in [5], in the polynomial framework. There, the authors propose to use the renormalized Christoffel function (19) in the definition of the weights, however sampling from the fixed pluripotential equilibrium measure dµ∗ . Due to 7 the fact that dµm differs from dµ∗ , the main estimate obtained in [5] (see p.3 therein) does not have the same simple form of a direct comparison between ku − uT k and em (u) as in (ii) of Theorem 2. In particular, it involves an extra term d(f ) which does not vanish even as n → ∞. One intrinsic difficulty when using the optimal pair (dµ, w) = (dµm , wm ) described by (19) and (20) is the effective sample generation, in particular in the multivariate framework since the measure dµm is generally not of tensor product type. One possible approach is to use Markov Chain Monte Carlo methods such as the Metropolis-Hastings algorithm, as explored in [4]. In such methods the samples are mutually correlated, and only asymptotically distributed according to the desired sampling measure. One contribution of the present paper is to propose a straightforward and effective sampling strategy for generating an arbitrary finite number n of independent samples identically distributed according to dµm . This strategy requires that dρ has tensor product structure and that the spaces Vm are spanned by tensor product bases, such as for multivariate polynomial spaces, in which case dµm is generally not of tensor product type. The rest of our paper is organized as follows. The proof of Theorem 2 is given in §3 in a concise form since it follows the same lines as the original results on standard least squares from [3, 7]. We devote §4 to analog results in the case of samples affected by additive noise, proving that the estimates are robust under condition (14). The proposed method for sampling the optimal measure dµm is discussed in §5, and we illustrate its effectiveness in §6 by numerical examples. 3 Proof of Theorem 2 The proof is structurally similar to that of Theorem 1 given in [3] for items (i) and (ii) and in [2] for item Pn (iii), therefore we only sketch it. We observe that G = n1 i=1 Xi where the Xi are i.i.d. copies of the rank 1 random matrix   X = X(x) := w(x)Lj (x)Lk (x) , j,k=1,...,m with x a random variable distributed over X according to µ. One obviously has E(X) = I. We then invoke the Chernov bound from [12] to obtain that if kXk2 ≤ R almost surely, then, for any 0 < δ < 1, Pr {kG − Ik2 > δ} ≤ 2m   c  1/R e−δ δ = 2m exp − , (1 − δ)1−δ R (22) with cδ := δ + (1 − δ) ln(1 − δ) > 0. Taking δ = 12 , and observing that kX(x)k2 = m X 1 Km,w (x) |Lj (x)|2 = w(x) , n n j=1 K which yields (15) in item (i). we may thus take R = m,w n For the proof of (16) in item (ii), we first consider the event where kG − Ik2 ≤ 12 . In this case we write n n ku − uT k2 = kTτ (u) − Tτ (uW )k2 ≤ ku − uW k2 = ku − Pm uk2 ≤ kgk2 + kPm gk2 , n where we have used that Pm Pm u = Pm u and that g is orthogonal to Vm , and thus ku − uT k2 ≤ em (u)2 + where a = (aj )j=1,...,m is solution of the system Ga = b, 8 m X j=1 |aj |2 , g := u − Pm u, and b := (hg, Lk in )k=1,...,m . Since kG−1 k2 ≤ 2, it follows that ku − uT k2 ≤ em (u)2 + 4 In the event where kG − Ik2 > 1 2, m X k=1 |hg, Lk in |2 . we simply write ku − uT k ≤ 2τ . It follows that E(ku − uT k2 ) ≤ em (u)2 + 4 m X k=1 E(|hg, Lk in |2 ) + 8τ 2 n−r . For the second term, we have n n 1 XX E(w(xi )w(xj )g(xi )g(xj )Lk (xi )Lk (xj )) n2 i=1 j=1  1 = 2 n(n − 1)|E(w(x)g(x)Lk (x))|2 + nE(|w(x)g(x)Lk (x)|2 ) n Z  1 1 |hg, Lk i|2 + |w(x)|2 |g(x)|2 |Lk (x)|2 dµ = 1− n n X Z 1 = w(x)|g(x)|2 |Lk (x)|2 dρ, n X E(|hg, Lk in |2 ) = where we have used the fact that g is L2 (X, ρ)-orthogonal to Vm and thus to Lk . Summing over k, we obtain m X k=1 E(|hg, Lk in |2 ) ≤ κ Km,w kgk2 ≤ em (u)2 , n ln(n) and we therefore obtain (16). For the proof of (17) in item (iii) we place ourselves in the event where kG − Ik2 ≤ 12 . This property also means that 3 1 kvk22 ≤ hGv, vi2 ≤ kvk22 , v ∈ Rm , 2 2 which can be expressed as a norm equivalence over Vm , 1 3 kvk2 ≤ kvk2n ≤ kvk2 , 2 2 v ∈ Vm . (23) We then write that for any v ∈ Vm , n ku − Pnm uk ≤ ku − vk + kv − Pm uk √ n ukn ≤ ku − vk + 2kv − Pm √ ≤ ku − vk + 2ku − vkn √ ≤ (1 + 2)ku − vkL∞ , n n where we have used (23), the Pythagorean identity ku − vk2n = ku − Pm uk2n + kv − Pm uk2n , and the fact that both k · k and k · kn are dominated by k · kL∞ . Since v is arbitrary, we obtain (17). Finally, (18) in item (iv) is proven in a very similar way as (16) in item (ii), by writing that in the event kG − Ik2 > 12 , we have ku − uC k = kuk, so that E(ku − uC k2 ) ≤ em (u)2 + 4 m X k=1 and we conclude in the same way. E(|hg, Lk in |2 ) + 2kuk2 n−r , ✷ 9 4 The noisy case In a similar way as in [3, 8], we can analyze the case where the observations of u are affected by an additive noise. In practical situations the noise may come from different sources, such as a discretization error when u is evaluated by some numerical code, or a measurement error. The first one may be viewed as a perturbation of u by a deterministic funtion h, that is, we observe y i = u(xi ) + h(xi ). The second one is typically modelled as a stochastic fluctuation, that is, we observe y i = u(xi ) + η i . where η i are independent realizations of the centered random variable η = y − u(x). Here, we do not necessarily assume η and x to be independent, however we typically assume that the noise is centered, that is, E(η|x) = 0, (24) and we also assume uniformly bounded conditional variance σ 2 := sup E(|η|2 |x) < ∞. (25) x∈X Note that we may also consider consider a noncentered noise, which amounts in adding the two contributions, that is, y i = u(xi ) + β i , β i = h(xi ) + η i , (26) with h(x) = E(β|x). The following result shows that the estimates in Theorem 2 are robust under the presence of such an additive noise. Theorem 3 For any r > 0, if m and n are such that condition (14) is satisfied, then the following hold for the noise model (26): (i) if u ∈ L2 (X, dρ) satisfies a uniform bound (6), then the truncated weighted least-squares estimator satisfies K m,w σ 2 + 8τ 2 n−r , (27) E(ku − uT k2 ) ≤ (1 + 2ε(n))em (u)2 + (8 + 2ε(n))khk2 + n (ii) if u ∈ L2 (X, dρ), then the conditioned weighted least-squares estimator satisfies K m,w σ 2 + 2kuk2 n−r , n R → 0 as n → +∞, with κ as in (10), and K m,w := X km,w dρ. E(ku − uC k2 ) ≤ (1 + 2ε(n))em (u)2 + (8 + 2ε(n))khk2 + where in both cases ε(n) := 4κ ln(n) (28) Proof: We again first consider the event where kG − Ik2 ≤ 12 . In this case we write ku − uT k ≤ ku − uW k, n and use the decomposition u − uW = g − Pm g − h where g = u + Pm u as in the proof of Theorem 2 and h stands for the solution to the least-squares problem for the noise data (β i )i=1,...,n . Therefore n n n ku − uW k2 = kgk2 + kPm g + hk2 ≤ kgk2 + 2kPm gk2 + 2khk2 = kgk2 + 2kPm gk2 + 2 10 m X j=1 |nj |2 , where n = (nj )j=1,...,m is solution to Gn = b, b := n 1 X n i=1  β i w(xi )Lk (xi ) k=1,...,m = (bk )k=1,...,m . Since kG−1 k2 ≤ 2, it follows that ku − uT k2 ≤ em (u)2 + 8 m X k=1 |hg, Lk in |2 + 8 m X k=1 |bk |2 . Compared to the proof of Theorem 2, we need to estimate the expectation of the third term on the right side. For this we simply write that E(|bk |2 ) = n n 1 XX E(β i w(xi )Lk (xi )β j w(xj )Lk (xj )). n2 i=1 j=1 For i 6= j, we have E(β i w(xi )Lk (xi )β j w(xj )Lk (xj )) = E(βw(x)Lk (x))2 = E(h(x)w(x)Lk (x))2 = Z 2 hwLk dµ X = |hh, Lk i|2 . Note that the first and second expectations are with respect to the joint density of (x, β) and the third one with respect to the density of x, that is, µ. For i = j, we have E(|β i w(xi )Lk (xi )|2 ) = E(|βw(x)Lk (x)|2 ) Z E(|βw(x)Lk (x)|2 |x)dµ = X Z E(|β|2 |x)|w(x)Lk (x)|2 dµ = ZX E(|β|2 |x)w(x)|Lk (x)|2 dρ = X Z (|h(x)|2 + E(|η|2 |x))w(x)|Lk (x)|2 dρ = X Z ≤ (|h(x)|2 + σ 2 )w(x)|Lk (x)|2 dρ. X Summing up on i, j and k, and using condition (14), we obtain that m X k=1  K m,w 2  K m,w σ 2 1 Km,w κ  E(|bk |2 ) ≤ 1 − 2 khk2 + khk2 + khk2 + σ ≤ 1+ . n n n log n n (29) For the rest we proceed as for item (ii) and (iv) in the proof of Theorem 2, using that in the event kG−Ik2 > 12 we have ku − uT k ≤ 2τ and ku − uC k = kuk. ✷ Remark 1 Note that for the standard least-squares method, corresponding to the case where w ≡ 1, we know 2 that K m,w = m. The noise term thus takes the stardard form mσ n , as seen for example in Theorem 3 2of [3] κσ or in Theorem 1 of [8]. Note that, in any case, condition (14) implies that this term is bounded by log n. The conclusions of Theorem 3 do not include the estimate in probability similar to item (iii) in Theorem 2. We can obtain such an estimate in the case of a bounded noise, where we assume that h ∈ L∞ (X) and 11 η is a bounded random variable, or equivalently, assuming that β is a bounded random variable, that is we use the noise model (26) with |β| ≤ D, a.s. (30) For this bounded noise model we have the following result. Theorem 4 For any r > 0, if m and n are such that condition (14) is satisfied, then the following hold for the the noise model (26) under (30): if u ∈ L∞ (X, dρ), then the nontruncated weighted least-squares estimator satisfies √ √ ku − uW k ≤ (1 + 2)em (u)∞ + 2D, (31) with probability larger than 1 − 2n−r . Proof: Similar to the proof of (iii) in Theorem 2, we place ourselves in the event where kG − Ik2 ≤ use the norm equivalence (23). We then write that for any v ∈ Vm , 1 2 and n n ku − uW k ≤ ku − vk + kv − Pm uk + kPm βk. The first two terms already appeared in the noiseless case and can be treated in the same way. The new n term Pm β corresponds to the weighted least-squares approximation from the noise vector, and satisfies √ √ √ n n βkn ≤ 2kβkn ≤ 2D. kPm βk ≤ 2kPm This leads to (31). 5 ✷ Random sampling from µm The analysis in the previous sections prescribes the use of the optimal sampling measure dµm defined in (20) for drawing the samples x1 , . . . , xn in the weighted least-squares method. In this section we discuss numerical methods for generating independent random samples according to this measure, in a specific relevant multivariate setting. Here, we make the assumption that X = ×di=1 Xi is a Cartesian product of univariate real domains Xi , and that dρ is a product measure, that is, d O dρi , dρ = i=1 where each dρi is a measure defined on Xi . We assume that each dρi is of the form dρi (t) = ρi (t)dt, for some nonnegative continuous function ρi , and therefore dρ(x) = ρ(x) dx, ρ(x) = d Y ρi (xi ), i=1 x = (x1 , . . . , xd ) ∈ X. In particular dρ is absolutely continuous with respect to the Lebesgue measure. We consider the following general setting: for each i = 1, . . . , d, we choose a univariate basis (φij )j≥0 orthonormal in L2 (Xi , dρi ). We then define the tensorized basis Lν (x) := d Y φiνi (xi ), i=1 12 ν ∈ Nd0 , which is orthonormal in L2 (X, dρ). We consider general subspaces of the form Vm := span{Lν : ν ∈ Λ}, for some multi-index set Λ ⊂ Nd0 such that #(Λ) = m. Thus we may rename the (Lν )ν∈Λ as (Lj )j=1,...,m after a proper ordering has been chosen, for example in the lexicographical sense. For the given set Λ of interest, we introduce λj := max νj and λΛ := max λj . ν∈Λ j=1,...,d The measure dµm is thus given by dµm (x) = µm (x)dx, where µm (x) := m 1 X 1 X |Li (x)|2 ρ(x) = |Lν (x)|2 ρ(x), m i=1 #(Λ) ν∈Λ x ∈ X. (32) We now discuss our sampling method for generating n independent random samples x1 , . . . , xn identically distributed according to the multivariate density (32). Note that this density does not have a product structure, despite ρ is a product density. There exist many methods for sampling from multivariate densities. In contrast to Markov Chain Monte Carlo methods mentioned in the introduction, the method that we next propose exploits the particular structure of the multivariate density (32), in order to generate independent samples in a straightforward manner, and sampling only from univariate densities. Given the vector x = (x1 , . . . , xd ) of all the coordinates, for any A ⊆ {1, . . . , d}, we introduce the notation xA := (xi )i∈A , Ā := {1, . . . , d} \ A, xĀ := (xi )i∈Ā , and dxA := O dxi , dρA := i∈A O dρi , ρA (xA ) := i∈A Y ρi (xi ), i∈A In the following, we mainly use the particular sets XA := × Xi . i∈A Aq := {1, . . . , q} and Āq := {q + 1, . . . , d}, so that any x ∈ X may be written as x = (xAq , xĀq ). Using such a notation, for any q = 1, . . . , d, we associate to the joint density µm its marginal density ψq of the first q variables, namely Z ψq (xAq ) := XĀq µm (xAq , xĀq ) dxĀq . (33) Since (φij )j≥0 is an orthonormal basis of L2 (Xi , dρi ), for any q = 1, . . . , d and any ν ∈ Nd0 , we obtain that Z XĀq 2 |Lν (xAq , xĀq )| ρ(xAq , xĀq )dxĀq = ρAq (xAq ) q Y i=1 |φiνi (xi )|2 , xAq ∈ XAq . Therefore, the marginal density (33) can be written in simple form as q ψq (xAq ) = XY 1 |φiνi (xi )|2 . ρAq (xAq ) #(Λ) i=1 ν∈Λ 13 (34) Sequential conditional sampling. Based on the previous notation and remarks, we propose an algorithm which generates n samples xk = (xk1 , . . . , xkd ) ∈ X with k = 1, . . . , n, that are independent and identically distributed realizations from the density µm in (32). In the multivariate case the coordinates can be arbitrarily reordered. Start with the first coordinate x1 and sample n points x11 , . . . , xn1 ∈ X1 from the univariate density ϕ1 : X1 → R : t 7→ ϕ1 (t) := ψ1 (t) = ρ1 (t) X 1 |φν1 (t)|2 , #(Λ) (35) ν∈Λ which coincides with the marginal ψ1 of x1 calculated in (34). In the univariate case d = 1 the algorithm terminates. In the multivariate case d ≥ 2, by iterating q from 2 to d, consider the qth coordinate xq , and sample n points x1q , . . . , xnq ∈ Xq in the following way: for any k = 1, . . . , n, given the values xkAq−1 = (xk1 , . . . , xkq−1 ) ∈ XAq−1 that have been calculated at the previous q − 1 steps, sample the point xkq ∈ Xq from the univariate density Qq−1 j k 2 P 2 q j=1 |φνj (xj )| ν∈Λ |φνq (t)| k ϕq : Xq → R : t 7→ ϕq (t|xAq−1 ) := ρq (t) . (36) P Qq−1 j k 2 ν∈Λ j=1 |φνj (xj )| The expression on the right-hand side of (36) is continuous at any t ∈ Xq and at any xkAq−1 ∈ XAq−1 . Assumption 1 ensures that the denominator of (36) is strictly positive for any possible choice of xkAq−1 = (xk1 , . . . , xkq−1 ) ∈ XAq−1 , and also ensures that the marginal ψq−1 is strictly positive at any point xkAq−1 ∈ XAq−1 such that ρAq−1 (xkAq−1 ) 6= 0. For any t ∈ Xq and any xkAq−1 ∈ XAq−1 such that ρAq−1 (xkAq−1 ) 6= 0, the density ϕq satisfies ϕq (t|xkAq−1 ) = ψq (xkAq−1 , t) , ψq−1 (xkAq−1 ) (37) where the densities ψq and ψq−1 are the marginals defined in (33) and evaluated at the points (xkAq−1 , t) ∈ X q and xkAq−1 ∈ XAq−1 , respectively. From (37), using (34) and simplifying the term ρAq−1 (xkAq−1 ) = QAq−1 k j=1 ρj (xj ) 6= 0, one obtains the right-hand side of (36). The right-hand side of equation (37) is well defined for any t ∈ Xq and any xkAq−1 ∈ XAq−1 such that ρAq−1 (xkAq−1 ) 6= 0, and it is not defined at the points xkAq−1 ∈ XAq−1 such that ρAq−1 (xkAq−1 ) = 0 where ψq−1 (xkAq−1 ) vanishes. Nonetheless, (37) has finite limits at any point (xkAq−1 , t) ∈ XAq , and these limits equal expression (36). According to technical terminology, the right-hand side of equation (37) is the conditional density of xq given x1 , . . . , xq−1 with respect to the density ψq , and ϕq is the continuous extension to XAq of this conditional density. The densities ϕ1 , . . . , ϕd defined in (35)–(36) can be concisely rewritten for any q = 1, . . . , d as X (38) αν (xkAq−1 )|φqνq (t)|2 , ϕq (t|xkAq−1 ) = ρq (t) ν∈Λ where the nonnegative weights (αν )ν∈Λ are defined as  1   if q = 1,   #(Λ) , Q q−1 αν = αν (zAq−1 ) := |φjνj (zj )|2   P j=1 , if 2 ≤ q ≤ d, Q  q−1 j  2 ν∈Λ j=1 |φνj (zj )| P for any zAq−1 = (z1 , . . . , zq−1 ) ∈ XAq−1 . Since ν∈Λ αν = 1, each density ϕq in (38) is a convex combination of the densities ρq |φq1 |2 , . . . , ρq |φqλq |2 . Note that if the orthonormal basis (φqj )j≥0 have explicit expressions 14 and can be evaluated at any point in Xq , then the same holds for the univariate densities (38). In particular, in the polynomial case, for standards univariate densities ρi such as uniform, Chebyshev or Gaussian, the orthonormal polynomials (φij )j≥1 have expressions which are explicitely computable, for example by recursion formulas. In Algorithm 1 we summarize our sampling method, that sequentially samples the univariate densities (38) to generate independent samples from the multivariate density (32). In the univariate case d = 1 the algorithm does not run the innermost loop, and only samples from ϕ1 . In the multivariate case d ≥ 2 the algorithm runs also the innermost loop, and conditionally samples also from ϕ2 , . . . , ϕd . Our algorithm therefore relies on accurate sampling methods for the relevant univariate densities (38). Algorithm 1 Sequential conditional sampling for µm . INPUT: n, d, Λ, ρi , (φij )j≥0 for i = 1, . . . , d. i.i.d. OUTPUT: x1 , . . . , xn ∼ µm . for k = 1 to n do αν ← (#(Λ))−1 , for any ν ∈ Λ. Sample xk1 from t 7→ ϕ1 (t) = ρ1 (t) for q = 2 to d do q−1 Q j k 2 |φνj (xj )| αν ← j=1 P q−1 Q ν∈Λ j=1 |φjνj (xkj )|2 P ν∈Λ αν |φ1ν1 (t)|2 . , for any ν ∈ Λ. Sample xkq from t 7→ ϕq (t) = ρq (t) end for xk ← (xk1 , . . . , xkd ). end for P ν∈Λ αν |φqνq (t)|2 . We close this section by discussing two possible methods for sampling from such densities: rejection sampling and inversion transform sampling. Both methods equally apply to any univariate density ϕq , and therefore we present them for any q arbitrarily chosen from 1 to d. Rejection sampling (RS). For applying this method, one needs to find a suitable univariate density Θq , whose support contains the support of ϕq , and a suitable real Mq > 1 such that ϕq (t) ≤ Mq Θq (t), t ∈ supp(ϕq ). The density Θq should be easier to sample than ϕq , i.e. efficient pseudorandom number generators for sampling from Θq are available. The value of Mq should be the smallest possible. For sampling one point from ϕq using RS: sample a point z from Θq , and sample u from the standard uniform U(0, 1). Then check if u < ϕq (z)/Mq Θq (z): if this is the case then accept z as a realization from ϕq , otherwise reject z and restart sampling z and u from beginning. On average, acceptance occurs once every Mq trials. Therefore, for a given q, sampling one point from ϕq by RS requires on average Mq evaluations of the function t 7→ ρq (t) X ϕq (t) = αν |φqνq (t)|2 . Mq Θq (t) Mq Θq (t) ν∈Λ 15 This amounts in evaluating Mq times the terms φq0 , φqλq and a subset of the terms φq1 , . . . , φqλq −1 , depending on Λ. The coefficients αν depend on the terms φj0 , . . . , φjλj for j = 1, . . . , q − 1, which have been already evaluated when sampling the previous coordinates 1, . . . , q −1. Thus, if we use RS for sampling the univariate densities, the overall computational cost of Algorithm 1 for sampling n points x1 , . . . , xn ∈ X is on average Pd proportional to n q=1 Mq (λq + 1). When the basis functions (φqj )j≥0 form a bounded orthonormal system, an immediate and simple choice of the parameters in the algorithm is Mq = max kφqνq k2L∞ , and ν∈Λ Θq (t) = ρq (t). (39) With such a choice, we can quantify more precisely the average computational cost of sampling n points √ in dimension d. When (φqj )j≥0 are the Chebyshev polynomials, whose L∞ norms satisfy kφqj kL∞ ≤ 2, we Pd obtain the bound 2n q=1 (λq + 1) ≤ 2nd(λΛ + 1) ≤ 2ndm. When (φqj )j≥0 are the Legendre polynomials, Pd √ whose L∞ norms satisfy kφqj kL∞ ≤ 2j + 1, we have the crude estimate 2n q=1 (λq + 1)2 ≤ 2nd(λΛ + 1)2 ≤ 2ndm2 . In general, when (φqj )j≥0 are Jacobi polynomials, similar upper bounds can be derived, and the dependence of these bounds on n and d is linear. Inversion transform sampling (ITS). Let Φq : Xq → [0, 1] be the cumulative distribution function associated to the univariate density ϕq . In the following, only when using the ITS method, we make the further assumption that ρq vanishes at most a finite number of times in Xq . Such an assumption is fulfilled in many relevant situations, e.g. when ρq is the density associated to Jacobi or Hermite polynomials orthonormal in L2 (Xq , dρq ). Together with Assumption 1, this ensures that the function t 7→ Φq (t) is continuous and strictly increasing on Xq . Hence Φq is a bijection between Xq and [0, 1], and it has a unique inverse Φ−1 : [0, 1] → Xq which is continuous and strictly increasing on [0, 1]. Sampling from ϕq q using ITS can therefore be performed as follows: sample n independent realizations u1 , . . . , un identically distributed according to the standard uniform U(0, 1), and obtain the n independent samples from ϕq as 1 −1 n (Φ−1 q (u ), . . . , Φq (u )). For any u ∈ [0, 1], computing z = Φ−1 q (u) ∈ Xq is equivalent to find the unique solution z ∈ Xq to Φq (z) = u. This can be executed by elementary root-finding numerical methods, e.g. the bisection method or Newton’s method. In alternative to using root-finding methods, one can build an interpolant operator Iq −1 of Φ−1 q , and then approximate Φq (u) ≈ Iq (u) for any u ∈ [0, 1]. Such an interpolant Iq can be constructed for example by piecewise linear interpolation, from the data (Φq (tq1 ), tq1 ), . . . , (Φq (tqsq ), tqsq ) at sq suitable points tq1 < . . . < tqsq in Xq . Both root-finding methods and the interpolation method require evaluating the function Φq pointwise in Xq . In general these evaluations can be computed using standard univariate quadrature formulas. When (φqj )j≥0 are orthogonal polynomials, the explicit expression of the primitive of ϕq can be used for directly evaluating the function Φq . Finally we discuss the overall computational cost of Algorithm 1 for sampling n points x1 , . . . , xn ∈ X when using ITS for sampling the univariate densities. With the bisection method, this overall cost amounts Pd to n q=1 γq Wq , where γq is the maximum number of iterations for locating the zero in Xq up to some desired tolerance, and Wq is the computational cost of each iteration. With the interpolation of Φ−1 q , the overall cost amounts to n evaluations of each interpolant Iq , in addition to the cost for building the interpolants which does not depend on n. 16 6 Examples and numerical illustrations This section presents the numerical performances of the weighted least-squares method compared to the standard least-squares method, in three relevant situations where dρ can be either the uniform measure, the Chebyshev measure, or the Gaussian measure. In each one of these three cases, we choose w and dµ in the weighted least-squares method from (19) and (20), as prescribed by our analysis in Corollary 1. For standard least squares we choose w and dµ as in (8). Our tests focus on the condition number of the Gramian matrix, that quantifies the stability of the linear system (5) and the stability of the weighted and standard least-squares estimators. A meaningful quantity is therefore the probability Pr{cond(G) ≤ 3}, (40) where, through (7), the value three of the threshold is related to the parameter δ = 1/2 in the previous analysis. For any n and m, from (7) the probability (40) is larger than Pr{kG − Ik2 ≤ 21 }. From Corollary 1, under condition (21) between n, m and r, the Gramian matrix of weighted least squares satisfies (15) and therefore the probability (40) is larger than 1 − 2n−r . For standard least squares, from Theorem 1 the Gramian matrix satisfies (40) with probability larger than 1 − 2n−r , but under condition (10). In the numerical tests the probability (40) is approximated by empirical probability, obtained by counting how many times the event cond(G) ≤ 3 occurs when repeating the random sampling one hundred times. All the examples presented in this section confine to multivariate approximation spaces of polynomial type. One natural assumption in this case is to require that the set Λ is downward closed, that is, satisfies ν∈Λ and ν̃ ≤ ν =⇒ ν̃ ∈ Λ, where ν̃ ≤ ν means that ν̃j ≤ νj for all i = 1, . . . , d. Then Vm is the polynomial space spanned by the monomials d Y ν zj j , z 7→ z ν := j=1 and the orthonormal basis Lν is provided by taking each (φij )j≥0 to be a sequence of univariate orthonormal polynomials of L2 (Xi , dρi ). In both the univariate and multivariate forthcoming examples, the random samples from the measure dµm are generated using Algorithm 1. The univariate densities ϕ1 , . . . , ϕd are sampled using the inversion transform sampling method. The inverse of the cumulative distribution function is approximated using the interpolation technique. 6.1 Univariate examples In the univariate case d = 1, let the index set be Λ = {0, . . . , m − 1} and Vm = PΛ = span{z k : k = 0, . . . , m − 1}. We report in Fig. 1 the probability (40), approximated by empirical probability, when G is the Gramian matrix of the weighted least-squares method. Different combinations of values for m and n are tested, with three choices of the measure dρ: uniform, Gaussian and Chebyshev. The results do not show perceivable differences among the performances of weighted least squares with the three different measures. In any of the three cases, n/ ln(n) ≥ 4m is enough to obtain an empirical probability equal to one that cond(G) ≤ 3. This confirms that condition (21) with any choice of r > 0 ensures (40), since it demands for a larger number of samples. Fig. 2 shows the probability (40) when G is the Gramian matrix of standard least squares. With the uniform measure, the condition n/ ln(n) ≥ m2 is enough to have (40) with empirical probability larger 17 dρ uniform measure dρ Gaussian measure dρ Chebyshev measure Figure 1: Weighted least squares, P r{cond(G) ≤ 3}, d = 1. Left: dρ uniform measure. Center: dρ Gaussian measure. Right: dρ Chebyshev measure. dρ uniform measure dρ Gaussian measure dρ Chebyshev measure Figure 2: Standard least squares, P r{cond(G) ≤ 3}, d = 1. Left: dρ uniform measure. Center: dρ Gaussian measure. Right: dρ Chebyshev measure. than 0.95. When dρ is the Gaussian measure, stability requires a very large number of evaluations, roughly n/ ln(n) linearly proportional to exp(m/3). For the univariate Chebyshev measure, it is proven that standard least squares are stable under the same minimal condition (21) as for weighted least squares. In accordance with the theory, the numerical results obtained in this case with weighted and standard least squares are indistinguishable, see Fig. 1-right and Fig. 2-right. 6.2 Multivariate examples Afterwards we present some numerical tests in the multivariate setting. These tests are again based, as in the previous section, on approximating the probability (40) by empirical probability. In dimension d larger than one there are many possible ways to enrich the polynomial space PΛ . The number of different downward closed sets whose cardinality equals m gets very large already for moderate values of m and d. Therefore, we present the numerical results for a chosen sequence of polynomial spaces PΛ1 , . . . , PΛm such that Λ1 ⊂ · · · ⊂ Λm , where each Λj ⊂ Nd0 is downward closed, #(Λj ) = dim(PΛj ) = j and the starting set Λ1 contains only the null multi-index. All the tests in Fig. 3 and Fig. 4 have been obtained using the same sequence of increasingly embedded polynomial spaces PΛ1 ⊂ . . . ⊂ PΛm , for both weighted and standard least 18 squares and for the three choices of the measures dρ. Such a choice allows us to establish a fair comparison between the two methods and among different measures, without the additional variability arising from modifications to the polynomial space. dρ uniform measure dρ Gaussian measure dρ Chebyshev measure Figure 3: Weighted least squares, P r{cond(G) ≤ 3}, d = 10. Left: dρ uniform measure. Center: dρ Gaussian measure. Right: dρ Chebyshev measure. dρ uniform measure dρ Gaussian measure dρ Chebyshev measure Figure 4: Standard least squares, P r{cond(G) ≤ 3}, d = 10. Left: dρ uniform measure. Center: dρ Gaussian measure. Right: dρ Chebyshev measure. We report the results obtained for the tests in dimension d = 10. The results in Fig. 3 confirm that weighted least squares always yield an empirical probability equal to one that cond(G) ≤ 3, provided that n/ log(n) ≥ 2m. This condition ensures that (21) with any choice of r > 0 implies (40), thus verifying Corollary 1. Again, the results do not show significant differences among the three choices of the measure dρ: a straight line, with the same slope for all the three cases uniform, Chebyshev and Gaussian, separates the two regimes corresponding to empirical probabilities equal to zero and one. Compared to the univariate case in Fig. 1, the results in Fig. 3 exhibit a sharper transition between the two extreme regimes, and an overall lower variability in the transition regime. The results for standard least squares with d = 10 are shown in Fig. 4. In the case of the uniform measure, in Fig. 4-right, stability is ensured if n/ ln(n) ≥ 3.5m, which is more demanding than the condition n/ ln(n) ≥ 2m needed for the stability of weighted least squares in Fig. 3-right, but much less strict than the condition required with standard least squares in the univariate case, where n/ ln(n) scales like m2 . 19 These phenomena have already been observed and described in [7]. Similar results as those with the uniform measure are obtained with the Chebyshev measure in Fig. 4-left, where again standard least squares achieve stability using more evaluations than weighted least squares in Fig. 3-left. The case of the Gaussian measure drastically differs from the uniform and Chebyshev cases: the results in Fig. 4-center clearly indicate that a very large number of evaluations n compared to m is required to achieve stability of standard least squares. Let us mention that analogous results as those presented in Figs. 1 and 3 for weighted least squares have been obtained also in other dimensions, and with many other sequences of increasingly embedded polynomial spaces. In the next tables we report some of these results for selected values of d = 1, 2, 5, 10, 50, 100. We choose n = 26599 and m = 200 that satisfy condition (21) with r = 1, and report in Table 1 the empirical probabilities that approximate (40), again calculated over one hundred repetitions. This table provides multiple comparisons: weighted least squares versus standard least squares, for the three choices of the measure dρ (uniform, Gaussian and Chebyshev) and with d varying between 1 and 100. method dρ d=1 d=2 d=5 d = 10 d = 50 d = 100 weighted LS weighted LS weighted LS uniform Gaussian Chebyshev 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 standard LS standard LS standard LS uniform Gaussian Chebyshev 0 0 1 0 0 1 0.54 0 1 1 0 1 1 0 1 1 0 1 Table 1: P r{cond(G) ≤ 3}, with n = 26559 and m = 200: weighted least squares versus standard least squares, dρ uniform versus dρ Gaussian versus dρ Chebyshev, d = 1, 2, 5, 10, 50, 100. method dρ d=1 d=2 d=5 d = 10 d = 50 d = 100 weighted LS weighted LS weighted LS uniform Gaussian Chebyshev 1.5593 1.5994 1.5364 1.4989 1.5698 1.4894 1.4407 1.4743 1.4694 1.4320 1.4643 1.4105 1.4535 1.4676 1.4143 1.4179 1.4237 1.4216 standard LS standard LS standard LS uniform Gaussian Chebyshev 19.9584 ∼ 1019 1.5574 29.8920 ∼ 1019 1.5367 3.0847 ∼ 1019 1.5357 1.9555 ∼ 1016 1.4752 1.7228 ∼ 109 1.4499 1.5862 ∼ 103 1.4625 Table 2: Average of cond(G), with n = 26559 and m = 200: weighted least squares versus standard least squares, dρ uniform versus dρ Gaussian versus dρ Chebyshev, d = 1, 2, 5, 10, 50, 100. In Table 1, all the empirical probabilities related to results for weighted least squares are equal to one, and confirm the theory since, for the chosen values of n, m and r, the probability (40) is larger than 1 − 5.67 × 10−7 . This value is computed using estimate (22) from the proof of Theorem 2. In contrast to weighted least squares, whose empirical probability equal one independently of dρ and d, the empirical probability of standard least squares does depend on the chosen measure, and to some extent on the dimension d as well. With the uniform measure, the empirical probability that approximates (40) equals zero when d = 1 or d = 2, equals 0.54 when d = 5, and equals one when d = 10, d = 50 or d = 100. In the Gaussian case, standard least squares always feature null empirical probabilities. With the Chebyshev measure, the condition number of G for standard least squares is always lower than three for any tested value of d. In addition to the results in Table 1, further information are needed for assessing how severe is the lack 20 of stability when obtaining null empirical probabilities. To this aim, in Table 2 we also report the average value of cond(G), obtained when averaging the condition number of G over the same repetitions used to estimate the empirical probabilities in Table 1. The information in Table 2 are complementary to those in Table 1. On the one hand they point out the stability and robustness of weighted least squares, showing a tamed condition number with any measure dρ and any dimension d. On the other hand they provide further insights on stability issues of standard least squares and their dependence on dρ and d. For standard least squares with the uniform measure, the average condition number reduces as the dimension d increases, in agreement with the conclusion drawn from Table 1. The Gramian matrix of standard least squares with the Gaussian measure is very ill-conditioned for all tested values of d. For standard least squares with the Chebyshev measure, the averaged condition number of G is only slightly larger than the one for weighted least squares. It is worth remarking that, the results for standard least squares in Fig. 4, Table 1 and Table 2 are sensitive to the chosen sequence of polynomial spaces. Testing different sequences might produce different results, that however necessarily obey to the estimates proven in Theorem 1 with uniform and Chebyshev measures, when n, m and r satisfy condition (10). Many other examples with standard least squares have been extensively discussed in previous works e.g. [7, 2], also in situations where n, m and r do not satisfy condition (10) and therefore Theorem 1 does not apply. In general, when n, m and r do not satisfy (10), there exist multivariate polynomial spaces of dimension m such that the Gramian matrix of standard least squares with the uniform and Chebyshev measures does not satisfy (11). Examples of such spaces are discussed in [7, 2]. Using these spaces would yield null empirical probabilities in Table 1 for standard least squares with the uniform and Chebyshev measures. For weighted least squares, when n, m and r satisfy condition (21), any sequence of polynomial spaces yields empirical probabilities close to one, according to Corollary 1. Indeed such a robustness with respect to the choices of dρ, of the polynomial space and of the dimension d represents one of the main advantages of the weighted approach. References [1] G. Chardon, A. Cohen, and L. Daudet, Sampling and reconstruction of solutions to the Helmholtz equation, Sampl. Theory Signal Image Process., 13:67–89, 2014. [2] A. Chkifa, A. Cohen, G. Migliorati, F. Nobile, and R. Tempone, Discrete least squares polynomial approximation with random evaluations - application to parametric and stochastic elliptic PDEs, M2AN, 49(3):815–837, 2015. [3] A. Cohen , M.A. Davenport, and D. Leviatan, On the stability and accuracy of least squares approximations, Found. Comput. Math., 13:819–834, 2013. [4] A. Doostan and J. Hampton, Coherence motivated sampling and convergence analysis of least squares polynomial Chaos regression, Comput. Methods Appl. Mech. Engrg., 290:73–97,2015. [5] J.D. Jakeman, A. Narayan, and T. Zhou, A Christoffel function weighted least squares algorithm for collocation approximations, preprint. [6] G. Migliorati, Multivariate Markov-type and Nikolskii-type inequalities for polynomials associated with downward closed multi-index sets, J. Approx. Theory, 189:137–159, 2015. 21 [7] G. Migliorati, F. Nobile, E. von Schwerin, and R. Tempone, Analysis of discrete L2 projection on polynomial spaces with random evaluations, Found. Comput. Math., 14:419–456, 2014. [8] G. Migliorati, F. Nobile, and R. Tempone, Convergence estimates in probability and in expectation for discrete least squares with noisy evaluations at random points, J. Multivar. Analysis, 142:167–182, 2015. [9] E.B. Saff, and V. Totik, Logarithmic Potentials with External Fields, Springer, 1997. [10] P. Nevai, Géza Freud, orthogonal polynomials and Christoffel Functions. A case study, J. Approx. theory, 48:3–167, 1986. [11] A. Máté, P. Nevai, and V. Totik, Szegö’s extremum problem on the unit circle, Annals of Mathematics, 134:433–453, 1991. [12] J. Tropp, User friendly tail bounds for sums of random matrices, Found. Comput. Math., 12:389–434, 2012. 22
10math.ST
How to Construct Deep Recurrent Neural Networks Razvan Pascanu1 , Caglar Gulcehre1 , Kyunghyun Cho2 , and Yoshua Bengio1 arXiv:1312.6026v5 [cs.NE] 24 Apr 2014 1 Département d’Informatique et de Recherche Opérationelle, Université de Montréal, {pascanur, gulcehrc}@iro.umontreal.ca, yoshua.bengio@umontreal.ca 2 Department of Information and Computer Science, Aalto University School of Science, kyunghyun.cho@aalto.fi Abstract In this paper, we explore different ways to extend a recurrent neural network (RNN) to a deep RNN. We start by arguing that the concept of depth in an RNN is not as clear as it is in feedforward neural networks. By carefully analyzing and understanding the architecture of an RNN, however, we find three points of an RNN which may be made deeper; (1) input-to-hidden function, (2) hidden-tohidden transition and (3) hidden-to-output function. Based on this observation, we propose two novel architectures of a deep RNN which are orthogonal to an earlier attempt of stacking multiple recurrent layers to build a deep RNN (Schmidhuber, 1992; El Hihi and Bengio, 1996). We provide an alternative interpretation of these deep RNNs using a novel framework based on neural operators. The proposed deep RNNs are empirically evaluated on the tasks of polyphonic music prediction and language modeling. The experimental result supports our claim that the proposed deep RNNs benefit from the depth and outperform the conventional, shallow RNNs. 1 Introduction Recurrent neural networks (RNN, see, e.g., Rumelhart et al., 1986) have recently become a popular choice for modeling variable-length sequences. RNNs have been successfully used for various task such as language modeling (see, e.g., Graves, 2013; Pascanu et al., 2013a; Mikolov, 2012; Sutskever et al., 2011), learning word embeddings (see, e.g., Mikolov et al., 2013a), online handwritten recognition (Graves et al., 2009) and speech recognition (Graves et al., 2013). In this work, we explore deep extensions of the basic RNN. Depth for feedforward models can lead to more expressive models (Pascanu et al., 2013b), and we believe the same should hold for recurrent models. We claim that, unlike in the case of feedforward neural networks, the depth of an RNN is ambiguous. In one sense, if we consider the existence of a composition of several nonlinear computational layers in a neural network being deep, RNNs are already deep, since any RNN can be expressed as a composition of multiple nonlinear layers when unfolded in time. Schmidhuber (1992); El Hihi and Bengio (1996) earlier proposed another way of building a deep RNN by stacking multiple recurrent hidden states on top of each other. This approach potentially allows the hidden state at each level to operate at different timescale (see, e.g., Hermans and Schrauwen, 2013). Nonetheless, we notice that there are some other aspects of the model that may still be considered shallow. For instance, the transition between two consecutive hidden states at a single level is shallow, when viewed separately.This has implications on what kind of transitions this model can represent as discussed in Section 3.2.3. Based on this observation, in this paper, we investigate possible approaches to extending an RNN into a deep RNN. We begin by studying which parts of an RNN may be considered shallow. Then, 1 for each shallow part, we propose an alternative deeper design, which leads to a number of deeper variants of an RNN. The proposed deeper variants are then empirically evaluated on two sequence modeling tasks. The layout of the paper is as follows. In Section 2 we briefly introduce the concept of an RNN. In Section 3 we explore different concepts of depth in RNNs. In particular, in Section 3.3.1–3.3.2 we propose two novel variants of deep RNNs and evaluate them empirically in Section 5 on two tasks: polyphonic music prediction (Boulanger-Lewandowski et al., 2012) and language modeling. Finally we discuss the shortcomings and advantages of the proposed models in Section 6. 2 Recurrent Neural Networks A recurrent neural network (RNN) is a neural network that simulates a discrete-time dynamical system that has an input xt , an output yt and a hidden state ht . In our notation the subscript t represents time. The dynamical system is defined by ht = fh (xt , ht−1 ) yt = fo (ht ), (1) (2) where fh and fo are a state transition function and an output function, respectively. Each function is parameterized by a set of parameters; θ h and θ o . n oN (n) (n) (n) (n) Given a set of N training sequences D = (x1 , y1 ), . . . , (xTn , yTn ) , the parameters n=1 of an RNN can be estimated by minimizing the following cost function: J(θ) = (n) (n) (n) N Tn 1 XX (n) (n) d(yt , fo (ht )), N n=1 t=1 (3) (n) where ht = fh (xt , ht−1 ) and h0 = 0. d(a, b) is a predefined divergence measure between a and b, such as Euclidean distance or cross-entropy. 2.1 Conventional Recurrent Neural Networks A conventional RNN is constructed by defining the transition function and the output function as  ht = fh (xt , ht−1 ) = φh W> ht−1 + U> xt (4)  > yt = fo (ht , xt ) = φo V ht , (5) where W, U and V are respectively the transition, input and output matrices, and φh and φo are element-wise nonlinear functions. It is usual to use a saturating nonlinear function such as a logistic sigmoid function or a hyperbolic tangent function for φh . An illustration of this RNN is in Fig. 2 (a). The parameters of the conventional RNN can be estimated by, for instance, stochastic gradient descent (SGD) algorithm with the gradient of the cost function in Eq. (3) computed by backpropagation through time (Rumelhart et al., 1986). 3 3.1 Deep Recurrent Neural Networks Why Deep Recurrent Neural Networks? Deep learning is built around a hypothesis that a deep, hierarchical model can be exponentially more efficient at representing some functions than a shallow one (Bengio, 2009). A number of recent theoretical results support this hypothesis (see, e.g., Le Roux and Bengio, 2010; Delalleau and Bengio, 2011; Pascanu et al., 2013b). For instance, it has been shown by Delalleau and Bengio (2011) that a deep sum-product network may require exponentially less units to represent the same function compared to a shallow sum-product network. Furthermore, there is a wealth of empirical evidences supporting this hypothesis (see, e.g., Goodfellow et al., 2013; Hinton et al., 2012b,a). These findings make us suspect that the same argument should apply to recurrent neural networks. 2 3.2 Depth of a Recurrent Neural Network yt-1 yt ht-1 xt-1 ht xt yt+1 ht+1 xt+1 Figure 1: A conventional recurrent neural network unfolded in time. The depth is defined in the case of feedforward neural networks as having multiple nonlinear layers between input and output. Unfortunately this definition does not apply trivially to a recurrent neural network (RNN) because of its temporal structure. For instance, any RNN when unfolded in time as in Fig. 1 is deep, because a computational path between the input at time k < t to the output at time t crosses several nonlinear layers. A close analysis of the computation carried out by an RNN (see Fig. 2 (a)) at each time step individually, however, shows that certain transitions are not deep, but are only results of a linear projection followed by an element-wise nonlinearity. It is clear that the hidden-to-hidden (ht−1 → ht ), hiddento-output (ht → yt ) and input-to-hidden (xt → ht ) functions are all shallow in the sense that there exists no intermediate, nonlinear hidden layer. We can now consider different types of depth of an RNN by considering those transitions separately. We may make the hidden-to-hidden transition deeper by having one or more intermediate nonlinear layers between two consecutive hidden states (ht−1 and ht ). At the same time, the hidden-tooutput function can be made deeper, as described previously, by plugging, multiple intermediate nonlinear layers between the hidden state ht and the output yt . Each of these choices has a different implication. 3.2.1 Deep Input-to-Hidden Function A model can exploit more non-temporal structure from the input by making the input-to-hidden function deep. Previous work has shown that higher-level representations of deep networks tend to better disentangle the underlying factors of variation than the original input (Goodfellow et al., 2009; Glorot et al., 2011b) and flatten the manifolds near which the data concentrate (Bengio et al., 2013). We hypothesize that such higher-level representations should make it easier to learn the temporal structure between successive time steps because the relationship between abstract features can generally be expressed more easily. This has been, for instance, illustrated by the recent work (Mikolov et al., 2013b) showing that word embeddings from neural language models tend to be related to their temporal neighbors by simple algebraic relationships, with the same type of relationship (adding a vector) holding over very different regions of the space, allowing a form of analogical reasoning. This approach of making the input-to-hidden function deeper is in the line with the standard practice of replacing input with extracted features in order to improve the performance of a machine learning model (see, e.g., Bengio, 2009). Recently, Chen and Deng (2013) reported that a better speech recognition performance could be achieved by employing this strategy, although they did not jointly train the deep input-to-hidden function together with other parameters of an RNN. 3.2.2 Deep Hidden-to-Output Function A deep hidden-to-output function can be useful to disentangle the factors of variations in the hidden state, making it easier to predict the output. This allows the hidden state of the model to be more compact and may result in the model being able to summarize the history of previous inputs more efficiently. Let us denote an RNN with this deep hidden-to-output function a deep output RNN (DO-RNN). Instead of having feedforward, intermediate layers between the hidden state and the output, Boulanger-Lewandowski et al. (2012) proposed to replace the output layer with a conditional gen3 yt yt yt yt yt z t-1 ht-1 ht xt (a) RNN ht ht-1 ht ht-1 xt (b) DT-RNN xt (b*) DT(S)-RNN ht-1 ht xt (c) DOT-RNN ht-1 zt ht xt (d) Stacked RNN Figure 2: Illustrations of four different recurrent neural networks (RNN). (a) A conventional RNN. (b) Deep Transition (DT) RNN. (b*) DT-RNN with shortcut connections (c) Deep Transition, Deep Output (DOT) RNN. (d) Stacked RNN erative model such as restricted Boltzmann machines or neural autoregressive distribution estimator (Larochelle and Murray, 2011). In this paper we only consider feedforward intermediate layers. 3.2.3 Deep Hidden-to-Hidden Transition The third knob we can play with is the depth of the hidden-to-hidden transition. The state transition between the consecutive hidden states effectively adds a new input to the summary of the previous inputs represented by the fixed-length hidden state. Previous work with RNNs has generally limited the architecture to a shallow operation; affine transformation followed by an element-wise nonlinearity. Instead, we argue that this procedure of constructing a new summary, or a hidden state, from the combination of the previous one and the new input should be highly nonlinear. This nonlinear transition could allow, for instance, the hidden state of an RNN to rapidly adapt to quickly changing modes of the input, while still preserving a useful summary of the past. This may be impossible to be modeled by a function from the family of generalized linear models. However, this highly nonlinear transition can be modeled by an MLP with one or more hidden layers which has an universal approximator property (see, e.g., Hornik et al., 1989). An RNN with this deep transition will be called a deep transition RNN (DT-RNN) throughout remainder of this paper. This model is shown in Fig. 2 (b). This approach of having a deep transition, however, introduces a potential problem. As the introduction of deep transition increases the number of nonlinear steps the gradient has to traverse when propagated back in time, it might become more difficult to train the model to capture longterm dependencies (Bengio et al., 1994). One possible way to address this difficulty is to introduce shortcut connections (see, e.g., Raiko et al., 2012) in the deep transition, where the added shortcut connections provide shorter paths, skipping the intermediate layers, through which the gradient is propagated back in time. We refer to an RNN having deep transition with shortcut connections by DT(S)-RNN (See Fig. 2 (b*)). Furthermore, we will call an RNN having both a deep hidden-to-output function and a deep transition a deep output, deep transition RNN (DOT-RNN). See Fig. 2 (c) for the illustration of DOT-RNN. If we consider shortcut connections as well in the hidden to hidden transition, we call the resulting model DOT(S)-RNN. An approach similar to the deep hidden-to-hidden transition has been proposed recently by Pinheiro and Collobert (2014) in the context of parsing a static scene. They introduced a recurrent convolutional neural network (RCNN) which can be understood as a recurrent network whose the transition between consecutive hidden states (and input to hidden state) is modeled by a convolutional neural network. The RCNN was shown to speed up scene parsing and obtained the state-of-the-art result in Stanford Background and SIFT Flow datasets. Ko and Dieter (2009) proposed deep transitions for Gaussian Process models. Earlier, Valpola and Karhunen (2002) used a deep neural network to model the state transition in a nonlinear, dynamical state-space model. 3.2.4 Stack of Hidden States An RNN may be extended deeper in yet another way by stacking multiple recurrent hidden layers on top of each other (Schmidhuber, 1992; El Hihi and Bengio, 1996; Jaeger, 2007; Graves, 2013). 4 We call this model a stacked RNN (sRNN) to distinguish it from the other proposed variants. The goal of a such model is to encourage each recurrent level to operate at a different timescale. It should be noticed that the DT-RNN and the sRNN extend the conventional, shallow RNN in different aspects. If we look at each recurrent level of the sRNN separately, it is easy to see that the transition between the consecutive hidden states is still shallow. As we have argued above, this limits the family of functions it can represent. For example, if the structure of the data is sufficiently complex, incorporating a new input frame into the summary of what had been seen up to now might be an arbitrarily complex function. In such a case we would like to model this function by something that has universal approximator properties, as an MLP. The model can not rely on the higher layers to do so, because the higher layers do not feed back into the lower layer. On the other hand, the sRNN can deal with multiple time scales in the input sequence, which is not an obvious feature of the DT-RNN. The DT-RNN and the sRNN are, however, orthogonal in the sense that it is possible to have both features of the DT-RNN and the sRNN by stacking multiple levels of DT-RNNs to build a stacked DT-RNN which we do not explore more in this paper. 3.3 Formal descriptions of deep RNNs Here we give a more formal description on how the deep transition recurrent neural network (DTRNN) and the deep output RNN (DO-RNN) as well as the stacked RNN are implemented. 3.3.1 Deep Transition RNN We noticed from the state transition equation of the dynamical system simulated by RNNs in Eq. (1) that there is no restriction on the form of fh . Hence, we propose here to use a multilayer perceptron to approximate fh instead. In this case, we can implement fh by L intermediate layers such that > > ht = fh (xt , ht−1 ) = φh WL φL−1 WL−1 φL−2 · · · φ1 W1> ht−1 + U> xt  , where φl and Wl are the element-wise nonlinear function and the weight matrix for the l-th layer. This RNN with a multilayered transition function is a deep transition RNN (DT-RNN). An illustration of building an RNN with the deep state transition function is shown in Fig. 2 (b). In the illustration the state transition function is implemented with a neural network with a single intermediate layer. This formulation allows the RNN to learn a non-trivial, highly nonlinear transition between the consecutive hidden states. 3.3.2 Deep Output RNN Similarly, we can use a multilayer perceptron with L intermediate layers to model the output function fo in Eq. (2) such that  > > yt = fo (ht ) = φo VL φL−1 VL−1 φL−2 · · · φ1 V1> ht , where φl and Vl are the element-wise nonlinear function and the weight matrix for the l-th layer. An RNN implementing this kind of multilayered output function is a deep output recurrent neural network (DO-RNN). Fig. 2 (c) draws a deep output, deep transition RNN (DOT-RNN) implemented using both the deep transition and the deep output with a single intermediate layer each. 3.3.3 Stacked RNN The stacked RNN (Schmidhuber, 1992; El Hihi and Bengio, 1996) has multiple levels of transition functions defined by   (l) (l) (l−1) (l) (l) (l−1) ht = fh (ht , ht−1 ) = φh Wl> ht−1 + U> , l ht 5 (l) where ht is the hidden state of the l-th level at time t. When l = 1, the state is computed using xt (l−1) instead of ht . The hidden states of all the levels are recursively computed from the bottom level l = 1. Once the top-level hidden state is computed, the output can be obtained using the usual formulation in Eq. (5). Alternatively, one may use all the hidden states to compute the output (Hermans and Schrauwen, 2013). Each hidden state at each level may also be made to depend on the input as well (Graves, 2013). Both of them can be considered approaches using shortcut connections discussed earlier. The illustration of this stacked RNN is in Fig. 2 (d). 4 Another Perspective: Neural Operators In this section, we briefly introduce a novel approach with which the already discussed deep transition (DT) and/or deep output (DO) recurrent neural networks (RNN) may be built. We call this approach which is based on building an RNN with a set of predefined neural operators, an operatorbased framework. In the operator-based framework, one first defines a set of operators of which each is implemented by a multilayer perceptron (MLP). For instance, a plus operator ⊕ may be defined as a function receiving two vectors x and h and returning the summary h0 of them: h0 = x ⊕ h, where we may constrain that the dimensionality of h and h0 are identical. Additionally, we can define another operator B which predicts the most likely output symbol x0 given a summary h, such that x0 = Bh It is possible to define many other operators, but in this paper, we stick to these two operators which are sufficient to express all the proposed types of RNNs. yt + ht-1 ht xt Figure 3: A view of an RNN under the operator-based framework: ⊕ and B are the plus and predict operators, respectively. It is clear to see that the plus operator ⊕ and the predict operator B correspond to the transition function and the output function in Eqs. (1)–(2). Thus, at each step, an RNN can be thought as performing the plus operator to update the hidden state given an input (ht = xt ⊕ ht−1 ) and then the predict operator to compute the output (yt = Bht = B(xt ⊕ ht−1 )). See Fig. 3 for the illustration of how an RNN can be understood from the operator-based framework. Each operator can be parameterized as an MLP with one or more hidden layers, hence a neural operator, since we cannot simply expect the operation will be linear with respect to the input vector(s). By using an MLP to implement the operators, the proposed deep transition, deep output RNN (DOT-RNN) naturally arises. This framework provides us an insight on how the constructed RNN be regularized. For instance, one may regularize the model such that the plus operator ⊕ is commutative. However, in this paper, we do not explore further on this approach. Note that this is different from (Mikolov et al., 2013a) where the learned embeddings of words happened to be suitable for algebraic operators. The operator-based framework proposed here is rather geared toward learning these operators directly. 5 Experiments We train four types of RNNs described in this paper on a number of benchmark datasets to evaluate their performance. For each benchmark dataset, we try the task of predicting the next symbol. 6 The task of predicting the next symbol is equivalent to the task of modeling the distribution over a sequence. For each sequence (x1 , . . . , xT ), we decompose it into p(x1 , . . . , xT ) = p(x1 ) T Y p(xt | x1 , . . . , xt−1 ), t=2 and each term on the right-hand side will be replaced with a single timestep of an RNN. In this setting, the RNN predicts the probability of the next symbol xt in the sequence given the all previous symbols x1 , . . . xt−1 . Then, we train the RNN by maximizing the log-likelihood. We try this task of modeling the joint distribution on three different tasks; polyphonic music prediction, character-level and word-level language modeling. We test the RNNs on the task of polyphonic music prediction using three datasets which are Nottingham, JSB Chorales and MuseData (Boulanger-Lewandowski et al., 2012). On the task of characterlevel and word-level language modeling, we use Penn Treebank Corpus (Marcus et al., 1993). 5.1 Model Descriptions We compare the conventional recurrent neural network (RNN), deep transition RNN with shortcut connections in the transition MLP (DT(S)-RNN), deep output/transition RNN with shortcut connections in the hidden to hidden transition MLP (DOT(S)-RNN) and stacked RNN (sRNN). See Fig. 2 (a)–(d) for the illustrations of these models. Notthingam Music JSB Chorales MuseData Char-level Language Word-level # units # parameters # units # parameters # units # parameters # units # parameters # units # parameters RNN DT(S)-RNN DOT(S)-RNN 600 465K 200 75K 600 465K 600 420K 200 4.04M 400,400 585K 400,400 585K 400,400 585K 400,400 540K 200,200 6.12M 400,400,400 745K 400,400,400 745K 400,400,400 745K 400,400,600 790K 200,200,200 6.16M sRNN 2 layers 400 550K 400 550K 600 1185K 400 520K 400 8.48M Table 1: The sizes of the trained models. We provide the number of hidden units as well as the total number of parameters. For DT(S)-RNN, the two numbers provided for the number of units mean the size of the hidden state and that of the intermediate layer, respectively. For DOT(S)-RNN, the three numbers are the size of the hidden state, that of the intermediate layer between the consecutive hidden states and that of the intermediate layer between the hidden state and the output layer. For sRNN, the number corresponds to the size of the hidden state at each level The size of each model is chosen from a limited set {100, 200, 400, 600, 800} to minimize the validation error for each polyphonic music task (See Table. 1 for the final models). In the case of language modeling tasks, we chose the size of the models from {200, 400} and {400, 600} for word-level and character-level tasks, respectively. In all cases, we use a logistic sigmoid function as an element-wise nonlinearity of each hidden unit. Only for the character-level language modeling we used rectified linear units (Glorot et al., 2011a) for the intermediate layers of the output function, which gave lower validation error. 5.2 Training We use stochastic gradient descent (SGD) and employ the strategy of clipping the gradient proposed by Pascanu et al. (2013a). Training stops when the validation cost stops decreasing. Polyphonic Music Prediction: For Nottingham and MuseData datasets we compute each gradient step on subsequences of at most 200 steps, while we use subsequences of 50 steps for JSB Chorales. 7 We do not reset the hidden state for each subsequence, unless the subsequence belongs to a different song than the previous subsequence. The cutoff threshold for the gradients is set to 1. The hyperparameter for the learning rate schedule1 is tuned manually for each dataset. We set the hyperparameter β to 2330 for Nottingham, 1475 for MuseData and 100 for JSB Chroales. They correspond to two epochs, a single epoch and a third of an epoch, respectively. The weights of the connections between any pair of hidden layers are sparse, having only 20 nonzero incoming connections per unit (see, e.g., Sutskever et al., 2013). Each weight matrix is rescaled to have a unit largest singular value (Pascanu et al., 2013a). The weights of the connections between the input layer and the hidden state as well as between the hidden state and the output layer are initialized randomly from the white Gaussian distribution with its standard deviation fixed to 0.1 and 0.01, respectively. In the case of deep output functions (DOT(S)-RNN), the weights of the connections between the hidden state and the intermediate layer are sampled initially from the white Gaussian distribution of standard deviation 0.01. In all cases, the biases are initialized to 0. To regularize the models, we add white Gaussian noise of standard deviation 0.075 to each weight parameter every time the gradient is computed (Graves, 2011). Language Modeling: We used the same strategy for initializing the parameters in the case of language modeling. For character-level modeling, the standard deviations of the white Gaussian distributions for the input-to-hidden weights and the hidden-to-output weights, we used 0.01 and 0.001, respectively, while those hyperparameters were both 0.1 for word-level modeling. In the case of DOT(S)-RNN, we sample the weights of between the hidden state and the rectifier intermediate layer of the output function from the white Gaussian distribution of standard deviation 0.01. When using rectifier units (character-based language modeling) we fix the biases to 0.1. In language modeling, the learning rate starts from an initial value and is halved each time the validation cost does not decrease significantly (Mikolov et al., 2010). We do not use any regularization for the character-level modeling, but for the word-level modeling we use the same strategy of adding weight noise as we do with the polyphonic music prediction. For all the tasks (polyphonic music prediction, character-level and word-level language modeling), the stacked RNN and the DOT(S)-RNN were initialized with the weights of the conventional RNN and the DT(S)-RNN, which is similar to layer-wise pretraining of a feedforward neural network (see, e.g., Hinton and Salakhutdinov, 2006). We use a ten times smaller learning rate for each parameter that was pretrained as either RNN or DT(S)-RNN. Notthingam JSB Chorales MuseData RNN 3.225 8.338 6.990 DT(S)-RNN 3.206 8.278 6.988 DOT(S)-RNN 3.215 8.437 6.973 sRNN 3.258 8.367 6.954 DOT(S)-RNN* 2.95 7.92 6.59 Table 2: The performances of the four types of RNNs on the polyphonic music prediction. The numbers represent negative log-probabilities on test sequences. (*) We obtained these results using DOT(S)-RNN with Lp units in the deep transition, maxout units in the deep output function and dropout (Gulcehre et al., 2013). 5.3 Result and Analysis 5.3.1 Polyphonic Music Prediction The log-probabilities on the test set of each data are presented in the first four columns of Tab. 2. We were able to observe that in all cases one of the proposed deep RNNs outperformed the conventional, shallow RNN. Though, the suitability of each deep RNN depended on the data it was trained on. The best results obtained by the DT(S)-RNNs on Notthingam and JSB Chorales are close to, but 1 We use at each update τ , the following learning rate ητ = 1 1+ max(0,τ −τ0 ) β , where τ0 and β indicate respec- tively when the learning rate starts decreasing and how quickly the learning rate decreases. In the experiment, we set τ0 to coincide with the time when the validation error starts increasing for the first time. 8 worse than the result obtained by RNNs trained with the technique of fast dropout (FD) which are 3.09 and 8.01, respectively (Bayer et al., 2013). In order to quickly investigate whether the proposed deeper variants of RNNs may also benefit from the recent advances in feedforward neural networks, such as the use of non-saturating activation functions2 and the method of dropout. We have built another set of DOT(S)-RNNs that have the recently proposed Lp units (Gulcehre et al., 2013) in deep transition and maxout units (Goodfellow et al., 2013) in deep output function. Furthermore, we used the method of dropout (Hinton et al., 2012b) instead of weight noise during training. Similarly to the previously trained models, we searched for the size of the models as well as other learning hyperparameters that minimize the validation performance. We, however, did not pretrain these models. The results obtained by the DOT(S)-RNNs having Lp and maxout units trained with dropout are shown in the last column of Tab. 2. On every music dataset the performance by this model is significantly better than those achieved by all the other models as well as the best results reported with recurrent neural networks in (Bayer et al., 2013). This suggests us that the proposed variants of deep RNNs also benefit from having non-saturating activations and using dropout, just like feedforward neural networks. We reported these results and more details on the experiment in (Gulcehre et al., 2013). We, however, acknowledge that the model-free state-of-the-art results for the both datasets were obtained using an RNN combined with a conditional generative model, such as restricted Boltzmann machines or neural autoregressive distribution estimator (Larochelle and Murray, 2011), in the output (Boulanger-Lewandowski et al., 2012). Character-Level Word-Level RNN 1.414 117.7 DT(S)-RNN 1.409 112.0 DOT(S)-RNN 1.386 107.5 sRNN 1.412 110.0 ∗ 1.411 1232 ? 1.243 1173 Table 3: The performances of the four types of RNNs on the tasks of language modeling. The numbers represent bit-per-character and perplexity computed on test sequence, respectively, for the character-level and word-level modeling tasks. ∗ The previous/current state-of-the-art results obtained with shallow RNNs. ? The previous/current state-of-the-art results obtained with RNNs having long-short term memory units. 5.3.2 Language Modeling On Tab. 3, we can see the perplexities on the test set achieved by the all four models. We can clearly see that the deep RNNs (DT(S)-RNN, DOT(S)-RNN and sRNN) outperform the conventional, shallow RNN significantly. On these tasks DOT(S)-RNN outperformed all the other models, which suggests that it is important to have highly nonlinear mapping from the hidden state to the output in the case of language modeling. The results by both the DOT(S)-RNN and the sRNN for word-level modeling surpassed the previous best performance achieved by an RNN with 1000 long short-term memory (LSTM) units (Graves, 2013) as well as that by a shallow RNN with a larger hidden state (Mikolov et al., 2011), even when both of them used dynamic evaluation3 . The results we report here are without dynamic evaluation. For character-level modeling the state-of-the-art results were obtained using an optimization method Hessian-free with a specific type of RNN architecture called mRNN (Mikolov et al., 2012a) or a regularization technique called adaptive weight noise (Graves, 2013). Our result, however, is better than the performance achieved by conventional, shallow RNNs without any of those advanced 2 Note that it is not trivial to use non-saturating activation functions in conventional RNNs, as this may cause the explosion of the activations of hidden states. However, it is perfectly safe to use non-saturating activation functions at the intermediate layers of a deep RNN with deep transition. 1 Reported by Mikolov et al. (2012a) using mRNN with Hessian-free optimization technique. 2 Reported by Mikolov et al. (2011) using the dynamic evaluation. 3 Reported by Graves (2013) using the dynamic evaluation and weight noise. 3 Dynamic evaluation refers to an approach where the parameters of a model are updated as the validation/test data is predicted. 9 regularization methods (Mikolov et al., 2012b), where they reported the best performance of 1.41 using an RNN trained with the Hessian-free learning algorithm (Martens and Sutskever, 2011). 6 Discussion In this paper, we have explored a novel approach to building a deep recurrent neural network (RNN). We considered the structure of an RNN at each timestep, which revealed that the relationship between the consecutive hidden states and that between the hidden state and output are shallow. Based on this observation, we proposed two alternative designs of deep RNN that make those shallow relationships be modeled by deep neural networks. Furthermore, we proposed to make use of shortcut connections in these deep RNNs to alleviate a problem of difficult learning potentially introduced by the increasing depth. We empirically evaluated the proposed designs against the conventional RNN which has only a single hidden layer and against another approach of building a deep RNN (stacked RNN, Graves, 2013), on the task of polyphonic music prediction and language modeling. The experiments revealed that the RNN with the proposed deep transition and deep output (DOT(S)RNN) outperformed both the conventional RNN and the stacked RNN on the task of language modeling, achieving the state-of-the-art result on the task of word-level language modeling. For polyphonic music prediction, a different deeper variant of an RNN achieved the best performance for each dataset. Importantly, however, in all the cases, the conventional, shallow RNN was not able to outperform the deeper variants. These results strongly support our claim that an RNN benefits from having a deeper architecture, just like feedforward neural networks. The observation that there is no clear winner in the task of polyphonic music prediction suggests us that each of the proposed deep RNNs has a distinct characteristic that makes it more, or less, suitable for certain types of datasets. We suspect that in the future it will be possible to design and train yet another deeper variant of an RNN that combines the proposed models together to be more robust to the characteristics of datasets. For instance, a stacked DT(S)-RNN may be constructed by combining the DT(S)-RNN and the sRNN. In a quick additional experiment where we have trained DOT(S)-RNN constructed using nonsaturating nonlinear activation functions and trained with the method of dropout, we were able to improve the performance of the deep recurrent neural networks on the polyphonic music prediction tasks significantly. This suggests us that it is important to investigate the possibility of applying recent advances in feedforward neural networks, such as novel, non-saturating activation functions and the method of dropout, to recurrent neural networks as well. However, we leave this as future research. One practical issue we ran into during the experiments was the difficulty of training deep RNNs. We were able to train the conventional RNN as well as the DT(S)-RNN easily, but it was not trivial to train the DOT(S)-RNN and the stacked RNN. In this paper, we proposed to use shortcut connections as well as to pretrain them either with the conventional RNN or with the DT(S)-RNN. We, however, believe that learning may become even more problematic as the size and the depth of a model increase. In the future, it will be important to investigate the root causes of this difficulty and to explore potential solutions. We find some of the recently introduced approaches, such as advanced regularization methods (Pascanu et al., 2013a) and advanced optimization algorithms (see, e.g., Pascanu and Bengio, 2013; Martens, 2010), to be promising candidates. Acknowledgments We would like to thank the developers of Theano (Bergstra et al., 2010; Bastien et al., 2012). We also thank Justin Bayer for his insightful comments on the paper. We would like to thank NSERC, Compute Canada, and Calcul Québec for providing computational resources. Razvan Pascanu is supported by a DeepMind Fellowship. Kyunghyun Cho is supported by FICS (Finnish Doctoral Programme in Computational Sciences) and “the Academy of Finland (Finnish Centre of Excellence in Computational Inference Research COIN, 251170)”. 10 References Bastien, F., Lamblin, P., Pascanu, R., Bergstra, J., Goodfellow, I. J., Bergeron, A., Bouchard, N., and Bengio, Y. (2012). Theano: new features and speed improvements. Deep Learning and Unsupervised Feature Learning NIPS 2012 Workshop. Bayer, J., Osendorfer, C., Korhammer, D., Chen, N., Urban, S., and van der Smagt, P. (2013). On fast dropout and its applicability to recurrent networks. arXiv:1311.0701 [cs.NE]. Bengio, Y. (2009). Learning deep architectures for AI. Found. Trends Mach. Learn., 2(1), 1–127. Bengio, Y., Simard, P., and Frasconi, P. (1994). Learning long-term dependencies with gradient descent is difficult. IEEE Transactions on Neural Networks, 5(2), 157–166. Bengio, Y., Mesnil, G., Dauphin, Y., and Rifai, S. (2013). Better mixing via deep representations. In ICML’13. Bergstra, J., Breuleux, O., Bastien, F., Lamblin, P., Pascanu, R., Desjardins, G., Turian, J., WardeFarley, D., and Bengio, Y. (2010). Theano: a CPU and GPU math expression compiler. In Proceedings of the Python for Scientific Computing Conference (SciPy). Oral Presentation. Boulanger-Lewandowski, N., Bengio, Y., and Vincent, P. (2012). Modeling temporal dependencies in high-dimensional sequences: Application to polyphonic music generation and transcription. In ICML’2012. Chen, J. and Deng, L. (2013). A new method for learning deep recurrent neural networks. arXiv:1311.6091 [cs.LG]. Delalleau, O. and Bengio, Y. (2011). Shallow vs. deep sum-product networks. In NIPS. El Hihi, S. and Bengio, Y. (1996). Hierarchical recurrent neural networks for long-term dependencies. In NIPS 8. MIT Press. Glorot, X., Bordes, A., and Bengio, Y. (2011a). Deep sparse rectifier neural networks. In AISTATS. Glorot, X., Bordes, A., and Bengio, Y. (2011b). Domain adaptation for large-scale sentiment classification: A deep learning approach. In ICML’2011. Goodfellow, I., Le, Q., Saxe, A., and Ng, A. (2009). Measuring invariances in deep networks. In NIPS’09, pages 646–654. Goodfellow, I. J., Warde-Farley, D., Mirza, M., Courville, A., and Bengio, Y. (2013). Maxout networks. In ICML’2013. Graves, A. (2011). Practical variational inference for neural networks. In J. Shawe-Taylor, R. Zemel, P. Bartlett, F. Pereira, and K. Weinberger, editors, Advances in Neural Information Processing Systems 24, pages 2348–2356. Graves, A. (2013). Generating sequences with recurrent neural networks. arXiv:1308.0850 [cs.NE]. Graves, A., Liwicki, M., Fernandez, S., Bertolami, R., Bunke, H., and Schmidhuber, J. (2009). A novel connectionist system for improved unconstrained handwriting recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence. Graves, A., Mohamed, A., and Hinton, G. (2013). Speech recognition with deep recurrent neural networks. ICASSP. Gulcehre, C., Cho, K., Pascanu, R., and Bengio, Y. (2013). Learned-norm pooling for deep feedforward and recurrent neural networks. arXiv:1311.1780 [cs.NE]. Hermans, M. and Schrauwen, B. (2013). Training and analysing deep recurrent neural networks. In Advances in Neural Information Processing Systems 26, pages 190–198. Hinton, G., Deng, L., Dahl, G. E., Mohamed, A., Jaitly, N., Senior, A., Vanhoucke, V., Nguyen, P., Sainath, T., and Kingsbury, B. (2012a). Deep neural networks for acoustic modeling in speech recognition. IEEE Signal Processing Magazine, 29(6), 82–97. Hinton, G. E. and Salakhutdinov, R. (2006). Reducing the dimensionality of data with neural networks. Science, 313(5786), 504–507. Hinton, G. E., Srivastava, N., Krizhevsky, A., Sutskever, I., and Salakhutdinov, R. (2012b). Improving neural networks by preventing co-adaptation of feature detectors. Technical report, arXiv:1207.0580. 11 Hornik, K., Stinchcombe, M., and White, H. (1989). Multilayer feedforward networks are universal approximators. Neural Networks, 2, 359–366. Jaeger, H. (2007). Discovering multiscale dynamical features with hierarchical echo state networks. Technical report, Jacobs University. Ko, J. and Dieter, F. (2009). Gp-bayesfilters: Bayesian filtering using gaussian process prediction and observation models. Autonomous Robots. Larochelle, H. and Murray, I. (2011). The Neural Autoregressive Distribution Estimator. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics (AISTATS’2011), volume 15 of JMLR: W&CP. Le Roux, N. and Bengio, Y. (2010). Deep belief networks are compact universal approximators. Neural Computation, 22(8), 2192–2207. Marcus, M. P., Marcinkiewicz, M. A., and Santorini, B. (1993). Building a large annotated corpus of english: The Penn Treebank. Computational Linguistics, 19(2), 313–330. Martens, J. (2010). Deep learning via Hessian-free optimization. In L. Bottou and M. Littman, editors, Proceedings of the Twenty-seventh International Conference on Machine Learning (ICML10), pages 735–742. ACM. Martens, J. and Sutskever, I. (2011). Learning recurrent neural networks with Hessian-free optimization. In Proc. ICML’2011. ACM. Mikolov, T. (2012). Statistical Language Models based on Neural Networks. Ph.D. thesis, Brno University of Technology. Mikolov, T., Karafiát, M., Burget, L., Cernocky, J., and Khudanpur, S. (2010). Recurrent neural network based language model. In Proceedings of the 11th Annual Conference of the International Speech Communication Association (INTERSPEECH 2010), volume 2010, pages 1045–1048. International Speech Communication Association. Mikolov, T., Kombrink, S., Burget, L., Cernocky, J., and Khudanpur, S. (2011). Extensions of recurrent neural network language model. In Proc. 2011 IEEE international conference on acoustics, speech and signal processing (ICASSP 2011). Mikolov, T., Sutskever, I., Deoras, A., Le, H., Kombrink, S., and Cernocky, J. (2012a). Subword language modeling with neural networks. unpublished. Mikolov, T., Sutskever, I., Deoras, A., Le, H.-S., Kombrink, S., and Cernocky, J. (2012b). Subword language modeling with neural networks. preprint (http://www.fit.vutbr.cz/ imikolov/rnnlm/char.pdf). Mikolov, T., Sutskever, I., Chen, K., Corrado, G., and Dean, J. (2013a). Distributed representations of words and phrases and their compositionality. In Advances in Neural Information Processing Systems 26, pages 3111–3119. Mikolov, T., Chen, K., Corrado, G., and Dean, J. (2013b). Efficient estimation of word representations in vector space. In International Conference on Learning Representations: Workshops Track. Pascanu, R. and Bengio, Y. (2013). Revisiting natural gradient for deep networks. Technical report, arXiv:1301.3584. Pascanu, R., Mikolov, T., and Bengio, Y. (2013a). On the difficulty of training recurrent neural networks. In ICML’2013. Pascanu, R., Montufar, G., and Bengio, Y. (2013b). On the number of response regions of deep feed forward networks with piece-wise linear activations. arXiv:1312.6098[cs.LG]. Pinheiro, P. and Collobert, R. (2014). Recurrent convolutional neural networks for scene labeling. In Proceedings of The 31st International Conference on Machine Learning, pages 82–90. Raiko, T., Valpola, H., and LeCun, Y. (2012). Deep learning made easier by linear transformations in perceptrons. In Proceedings of the Fifteenth Internation Conference on Artificial Intelligence and Statistics (AISTATS 2012), volume 22 of JMLR Workshop and Conference Proceedings, pages 924–932. JMLR W&CP. Rumelhart, D. E., Hinton, G. E., and Williams, R. J. (1986). Learning representations by backpropagating errors. Nature, 323, 533–536. 12 Schmidhuber, J. (1992). Learning complex, extended sequences using the principle of history compression. Neural Computation, (4), 234–242. Sutskever, I., Martens, J., and Hinton, G. (2011). Generating text with recurrent neural networks. In L. Getoor and T. Scheffer, editors, Proceedings of the 28th International Conference on Machine Learning (ICML 2011), pages 1017–1024, New York, NY, USA. ACM. Sutskever, I., Martens, J., Dahl, G., and Hinton, G. (2013). On the importance of initialization and momentum in deep learning. In ICML. Valpola, H. and Karhunen, J. (2002). An unsupervised ensemble learning method for nonlinear dynamic state-space models. Neural Comput., 14(11), 2647–2692. 13
9cs.NE
Significantly Improving Lossy Compression for Scientific Data Sets Based on Multidimensional Prediction and Error-Controlled Quantization arXiv:1706.03791v1 [cs.IT] 12 Jun 2017 Dingwen Tao,∗ Sheng Di,† Zizhong Chen,∗ and Franck Cappello†‡ ∗ University of California, Riverside, CA, USA {dtao001, chen}@cs.ucr.edu † Argonne National Laboratory, IL, USA {sdi1, cappello}@anl.gov ‡ University of Illinois at Urbana-Champaign, IL, USA Abstract—Today’s HPC applications are producing extremely large amounts of data, such that data storage and analysis are becoming more challenging for scientific research. In this work, we design a new error-controlled lossy compression algorithm for large-scale scientific data. Our key contribution is significantly improving the prediction hitting rate (or prediction accuracy) for each data point based on its nearby data values along multiple dimensions. We derive a series of multilayer prediction formulas and their unified formula in the context of data compression. One serious challenge is that the data prediction has to be performed based on the preceding decompressed values during the compression in order to guarantee the error bounds, which may degrade the prediction accuracy in turn. We explore the best layer for the prediction by considering the impact of compression errors on the prediction accuracy. Moreover, we propose an adaptive error-controlled quantization encoder, which can further improve the prediction hitting rate considerably. The data size can be reduced significantly after performing the variablelength encoding because of the uneven distribution produced by our quantization encoder. We evaluate the new compressor on production scientific data sets and compare it with many other state-of-the-art compressors: GZIP, FPZIP, ZFP, SZ-1.1, and ISABELA. Experiments show that our compressor is the best in class, especially with regard to compression factors (or bitrates) and compression errors (including RMSE, NRMSE, and PSNR). Our solution is better than the second-best solution by more than a 2x increase in the compression factor and 3.8x reduction in the normalized root mean squared error on average, with reasonable error bounds and user-desired bitrates. I. I NTRODUCTION One of the most challenging issues in performing scientific simulations or running large-scale parallel applications today is the vast amount of data to store in disks, to transmit on networks, or to process in postanalysis. The Hardware/Hybrid Accelerated Cosmology Code (HACC), for example, can generate 20 PB of data for a single 1trillion-particle simulation; yet a system such as the Mira supercomputer at the Argonne Leadership Computing Facility has only 26 PB of file system storage, and a single user cannot request 75% of the total storage capacity for a simulation. Climate research also deals with a large volume of data during simulation and postanalysis. As indicated by [10], nearly 2.5 PB of data were produced by the Community Earth System Model for the Coupled Model Intercomparison Project (CMIP) 5, which further introduced 170 TB of postprocessing data submitted to the Earth System Grid [4]. Estimates of the raw data requirements for the CMIP6 project exceed 10 PB [3]. Data compression offers an attractive solution for largescale simulations and experiments because it enables significant reduction of data size while keeping critical information available to preserve discovery opportunities and analysis accuracy. Lossless compression preserves 100% of the information; however, it suffers from limited compression factor (up to 2:1 in general [15]), which is far less than the demand of large-scale scientific experiments and simulations. Therefore, only lossy compression with user-set error controls can fulfill user needs in terms of data accuracy and of large-scale execution demand. The key challenge in designing an efficient errorcontrolled lossy compressor for scientific research applications is the large diversity of scientific data. Many of the existing lossy compressors (such as SZ-1.1 [9] and ISABELA [12]) try to predict the data by using curve-fitting method or spline interpolation method. The effectiveness of these compressors highly relies on the smoothness of the data in local regions. However, simulation data often exhibits fairly sharp or spiky data changes in small data regions, which may significantly lower the prediction accuracy of the compressor and eventually degrade the compression quality. NUMARCK [6] and SSEM [16] both adopt a quantization step in terms of the distribution of the data (or quantile), which can mitigate the dependence of smoothness of data; however, they are unable to strictly control the compression errors based on the user-set bounds. ZFP [13] uses an optimized orthogonal data transform that does not strongly rely on the data smoothness either; however, it requires an exponent/fixed-point alignment step, which might not respect the user error bound when the data value range is huge (as shown later in the paper). And its optimized transform coefficients are highly dependent on the compression data and cannot be modified by users. In this work, we propose a novel lossy compression algorithm that can deal with the irregular data with spiky changes effectively, will still strictly respecting user-set error bounds. Specifically, the critical contributions are threefold: • We propose a multidimensional prediction model that can significantly improve the prediction hitting rate (or prediction accuracy) for each data point based on its nearby data values in multiple dimensions, unlike previous work [9] that focuses only on single-dimension prediction. Extending the single-dimension prediction to multiple dimensions is challenging. Higher-dimensional prediction requires solving more complicated surface equation system involving many more variables, which become intractable especially when the number of data points used in the prediction is relatively high. However, since the data used in the prediction must be • • preceding decompressed values in order to strictly control the compression errors, the prediction accuracy is degraded significantly if many data points are selected for the prediction. In this paper, not only do we derive a generic formula for the multidimensional prediction model but we also optimize the number of data points used in the prediction by an in-depth analysis with realworld data cases. We design an adaptive error-controlled quantization and variable-length encoding model in order to optimize the compression quality. Such an optimization is challenging in that we need to design the adaptive solution based on very careful observation on masses of experiments and the variable-length encoding has to be tailored and reimplemented to suit variable numbers of quantization intervals. We implement the new compression algorithm, namely SZ-1.4, and release the source code under a BSD license. We comprehensively evaluate the new compression method by using multiple real-world production scientific data sets across multiple domains, such as climate simulation [7], X-ray scientific research [2], and hurricane simulation [1]. We compare our compressor with five state-of-the-art compressors: GZIP, FPZIP, ZFP, SZ-1.1, and ISABELA. Experiments show that our compressor is the best in class, especially with regard to both compression factors (or bit-rates) and compression errors (including RMSE, NRMSE, and PSNR). On the three tested data sets, our solution is better than the second-best solution by nearly a 2x increase in the compression factor and 3.8x reduction in the normalized root mean squared error on average. The rest of the paper is organized as follows. In Section II we formulate the error-controlled lossy compression issue. We describe our novel compression method in Section III (an optimized multidimensional prediction model with bestlayer analysis) and Section IV (an adaptive error-controlled quantization and variable-length encoding model). In Section V we evaluate the compression quality using multiple production scientific data sets. In Section VI we discuss the use of our compressor in parallel for large-scale data sets and perform an evaluation on a supercomputer. In Section VII we discuss the related work, and in Section VIII we conclude the paper with a summary and present our future work. II. P ROBLEM AND M ETRICS D ESCRIPTION In this paper, we focus mainly on the design and implementation of a lossy compression algorithm for scientific data sets with given error bounds in high-performance computing (HPC) applications. These applications can generate multiple snapshots that will contain many variables. Each variable has a specific data type, for example, multidimensional floating-point array and string data. Since the major type of the scientific data is floating-point, we focus our lossy compression research on how to compress multidimensional floating-point data sets within reasonable error bounds. Also, we want to achieve a better compression performance measured by the following metrics: 1) Pointwise compression error between original and reconstructed data sets, for example, absolute error and value-range-based relative error 1 2) Average compression error between original and reconstructed data sets, for example, RMSE, NRMSE, and PSNR. 3) Correlation between original and reconstructed data sets 4) Compression factor or bit-rates 5) Compression and decompression speed We describe these metrics in detail below. Let us first define some necessary notations. Let the original multidimensional floating-point data set be X = {x1 , x2 , ..., xN }, where each xi is a floatingpoint scalar. Let the reconstructed data set be X̃ = {x˜1 , x˜2 , ..., x˜N }, which is recovered by the decompression process. Also, we denote the range of X by RX , that is, RX = xmax − xmin . We now discuss the metrics we may use in measuring the performance of a compression method. Metric 1: For data point i, let eabsi = xi − x̃i , where eabsi is the absolute error; let ereli = eabsi /RX , where ereli is the value-range-based relative error. In our compression algorithm, one should set either one bound or both bounds for the absolute error and the value-range-based relative error depending on their compression accuracy requirement. The compression errors will be guaranteed within the error bounds, which can be expressed by the formula |eabsi | < ebabs or/and |ereli | < ebrel for 1 ≤ i ≤ N , where ebabs is the absolute error bound and ebrel is the value-range-based relative error bound. Metric 2: To evaluate the average error in the compression, we first use the popular root mean squared error (RMSE). v u N u1 X rmse = t (eabsi )2 (1) N i=1 Because of the diversity of variables, we further adopt the normalized RMSE (NRMSE). rmse nrmse = (2) RX The peak signal-to-noise ratio (PSNR) is another commonly used average error metric for evaluating a lossy compression method, especially in visualization. It is calculated as following. RX psnr = 20 · log10 ( ) (3) rmse PSNR measures the size of the RMSE relative to the peak size of the signal. Logically, a lower value of RMSE/NRMSE means less error, but a higher value of PSNR represents less error. Metric 3: To evaluate the correlation between original and reconstructed data sets, we adopt the Pearson correlation coefficient ρ, cov(X, X̃) ρ= , (4) σX σX̃ where cov(X, X̃) is the covariance. This coefficient is a measurement of the linear dependence between two variables, giving ρ between +1 and −1, where ρ = 1 is the 1 Note that unlike the pointwise relative error that is compared with each data value, value-range-based relative error is compared with value range. total positive linear correlation. The APAX profiler [17] suggests that the correlation coefficient between original and reconstructed data should be 0.99999 (“five nines”) or better. Metric 4: To evaluate the size reduce as a result of the compression, we use the compression factor CF , f ilesize(Forig ) CF (F ) = , f ilesize(Fcomp ) Already processed points (including all colors) To be predicted point First layer Second layer Third layer (5) or the bit-rate (bits/value), f ilesizebit (Fcomp ) BR(F ) = , (6) N where f ilesizebit is the file size in bits and N is the data size. The bit-rate represents the amortized storage cost of each value. For a single/double floating-point data set, the bit-rate is 32/64 bits per value before a compression, while the bit-rate will be less than 32/64 bits per value after a compression. Also, CF and BR have a mathematical relationship as BR(F ) ∗ CF (F ) = 32/64 so that a lower bit-rate means a higher compression factor. Metric 5: To evaluate the speed of compression, we compare the throughput (bytes per second) based on the execution time of both compression and decompression with other compressors. III. P REDICTION M ODEL BASED ON M UTIDIMENSIONAL S CIENTIFIC DATA S ETS In Sections III and IV, we present our novel compression algorithm. At a high level, the compression process involves three steps: (1) predict every data value through our proposed multilayer prediction model; (2) adopt an error-controlled quantization encoder with an adaptive number of intervals; and (3) perform a variable-length encoding technique based on the uneven distributed quantization codes. In this section, we first present our new multilayer prediction model designed for multidimensional scientific data sets. Then, we give a solution for choosing the best layer for our multilayer prediction model. We illustrate how our prediction model works using two-dimensional data sets as an example. A. Prediction Model for Multidimensional Scientific Data Sets Consider a two-dimensional data set on a uniform grid of size M × N , where M is the size of second dimension and N is the size of first dimension. We give each data point a global coordinate (i, j), where 0 < i ≤ M and 0 < j ≤ N . In our compression algorithm, we process the data point by point from the low dimension to the high dimension. Assume that the coordinates of the current processing data point are (i0 , j0 ) and the processed data points are (i, j), where i < i0 or i = i0 , j < j0 , as shown in Figure 1. The figure also shows our definition of “layer” around the processing data point (i0 , j0 ). We denote the data subset Sin0 j0 and Tin0 j0 by Sin0 j0 = {(i0 − k1 , j0 − k2 )|0 ≤ k1 , k2 ≤ n} \ {(i0 , j0 )} Tin0 j0 = {(i0 − k1 , j0 − k2 )|0 ≤ k1 + k2 ≤ 2n − 1, k1 , k2 ≥ 0}. Since the data subset Sin0 j0 contains the layer from the first one to the nth one, we call Sin0 j0 “n-layer data subset.” Now we build a prediction model for two-dimensional data sets using the n(n+2) symmetric processed data points in the n-layer data subset Sin0 j0 to predict data (i0 , j0 ). Fourth layer 1-layer 2-layer 3-layer 4-layer Figure 1. Example of 9×9 two-dimensional data set showing the processed / processing data and the data in different layers of the prediction model. First, let us define a three-dimensional surface, called the “prediction surface,” with the maximum order of 2n − 1 as follows. i,j≥0 X i j f (x, y) = ai,j x y (7) 0≤i+j≤2n−1 The surface f (x, y) has n(2n + 1) coefficients, so we can construct a linear system with n(2n + 1) equations by using the coordinates and values of n(2n + 1) data points. And then solve this system for these n(2n + 1) coefficients; consequently, we build the prediction surface f (x, y). However, the problem is that not every linear system has a solution, which also means not every set of n(2n + 1) data is able to be on the surface at the same time. Fortunately, we demonstrate that the linear system constructed by the n(2n+1) data in Tin0 j0 can be solved with an explicit solution. Also, we demonstrate that f (i0 , j0 ) can be expressed by the linear combination of the data values in Sin0 j0 . Now let us give the following theorem and proof. Theorem 1: The n(2n + 1) data in Tin0 j0 will determine a surface f (x, y) shown in equation (7), and the value (k1 ,k2P )6=(0,0)   of f (i0 , j0 ) equals (−1)k1 +k2 +1 kn1 kn2 V (i0 − 0≤k  1 ,k2 ≤n k1 , j0 −k2 ), where nk is the binomial coefficient and V (i, j) is the data value of (i, j) in Sin0 j0 . Proof: We transform the coordinate of each data point in Tin0 j0 to a new coordinate as (i0 −k1 , j0 −k2 ) → (k1 , k2 ). Then, using their new coordinates and data values, we can construct a linear system with n(2n + 1) equations as i,j≥0 X V (k1 , k2 ) = ai,j k1i k2j , (8) 0≤i+j≤2n−1 where 0 ≤ k1 + k2 ≤ 2n − 1, k1 , k2 ≥ 0. Let us denote F as follows.    (k1 ,k2 )6=(0,0) X n n k +k +1 F = (−1) 1 2 k1 0≤k1 ,k2 ≤n i,j≥0 P For any coefficient al,m , k2 V (k1 , k2 ) (9) ai,j k1i k2j only has 0≤i+j≤2n−1 al,m , which is k1l k2m one term containing Also, from equations (8) and · al,m . (9), F contains (k1 ,k2P )6=(0,0) ( (−1)k1 +k2 +1 0≤k1 ,k2 ≤n And because X (−1)k1 +k2 +1 n k1 k1 +k2 +1 (−1) 0≤k1 ,k2 ≤n X =− (−1)k1 +k2 X  Table I F ORMULAS OF 1, 2, 3, 4- LAYER PREDICTION FOR TWO - DIMENSIONAL k1l k2m ) · al,m . DATA SETS (−1)k1 n k1l k2m k2 2-Layer    n k1 n k1l k2m + 0l+m k2 3-Layer    0≤k1 ,k2 ≤n =− n k2    0≤k1 ,k2 ≤n =  1-Layer (k1 ,k2 )6=(0,0) X n k1 n k1 n k1l k2m + 0l+m k2     X n n k1l · (−1)k2 k2m + 0l+m . k1 k2 0≤k1 ≤n 0≤k2 ≤n 4-Layer For l + m ≤ 2n + 1, either l or m is smaller than  from the theory of finite differences [5], P n. Also, (−1)i ni P (x) = 0 for any polynomial P (x) of 0≤i≤n  P degree less than n, so either (−1)k1 kn1 k1l = 0 or 0≤k1 ≤n  P (−1)k2 kn2 k2m = 0. 0≤k2 ≤n Therefore, F contains 0l+m · al,m , so l,m≥0 P F = 0l+m · al,m = a0,0 and 0≤l+m≤2n−1 (k1 ,k2P )6=(0,0) (−1)k1 +k2 +1 f (0, 0) = a0,0 = 0≤k1 ,k2 ≤n n k1  n k2  V (k1 , k2 ). We transform the current coordinate to the previous one reversely, namely, (k1 , k2 ) → (i0 − k1 , j0 − k2 ). Thus, f (i0 , j0 ) = (k1 ,k2P )6=(0,0) (−1)k1 +k2 +1 0≤k1 ,k2 ≤n n k1  n k2  V (i0 − k1 , j0 − k2 ). From this theorem, we know that the value of (i0 , j0 ) on the prediction surface, f (i0 , j0 ), can be expressed by the linear combination of the data values in Sin0 j0 . Hence, we can use the value of f (i0 , j0 ) as our predicted value for V (i0 , j0 ). In other words, we build our prediction model using the data values in Sin0 j0 as follows. f (i0 , j0 ) = (k1 ,k2P )6=(0,0) (−1)k1 +k2 +1 0≤k1 ,k2 ≤n n k1  n k2  V (i0 − k1 , j0 − k2 ) (10) We call this prediction model using n-layer data subset Sin0 j0 the “n-layer prediction model,” consequently, our proposed model can be called a multilayer prediction model. Also, we can derive a generic formula of the multilayer prediction model for any dimensional data sets. Because of space limitations, we give the formula as follows,   (k1 ,··· ,kd )6=(0,··· ,0) d X Y f (x1 , · · · , xd ) = (−1)kj − 0≤k1 ,··· ,kd ≤n j=1 n kj (11) · V (x1 − k1 , · · · , xd − kd ), where d is the dimensional size of the data set and n represents the “n-layer” used in the prediction model. Note that Lerenzo predictor [11] is a special case of our multidimensional prediction model when n = 1. Prediction Formula f (i0 , j0 ) = V (i0 , j0 − 1) + V (i0 − 1, j0 ) − V (i0 − 1, j0 − 1) f (i0 , j0 ) = 2V (i0 − 1, j0 ) + 2V (i0 , j0 − 1) −4V (i0 − 1, j0 − 1) − V (i0 − 2, j0 ) − V (i0 , j0 − 2) +2V (i0 − 2, j0 − 1) + 2V (i0 − 1, j0 − 2) − V (i0 − 2, j0 − 2) f (i0 , j0 ) = 3V (i0 − 1, j0 ) + 3V (i0 , j0 − 1) −9V (i0 − 1, j0 − 1) − 3V (i0 − 2, j0 ) − 3V (i0 , j0 − 2) +9V (i0 − 2, j0 − 1) + 9V (i0 − 1, j0 − 2) − 9V (i0 − 2, j0 − 2) +V (i0 − 3, j0 ) + V (i0 , j0 − 3) −3V (i0 − 3, j0 − 1) − 3V (i0 − 1, j0 − 3) +3V (i0 − 3, j0 − 2) + 3V (i0 − 2, j0 − 3) − V (i0 − 3, j0 − 3) f (i0 , j0 ) = 4V (i0 − 1, j0 ) + 4V (i0 , j0 − 1) −16V (i0 − 1, j0 − 1) − 6V (i0 − 2, j0 ) − 6V (i0 , j0 − 2) +24V (i0 − 2, j0 − 1) + 24V (i0 − 1, j0 − 2) −36V (i0 − 2, j0 − 2) + 4V (i0 − 3, j0 ) + 4V (i0 , j0 − 3) −16V (i0 − 3, j0 − 1) − 16V (i0 − 1, j0 − 3) + 24V (i0 − 3, j0 − 2) +24V (i0 − 2, j0 − 3) − 16V (i0 − 3, j0 − 3) −V (i0 − 4, j0 ) − V (i0 , j0 − 4) + 4V (i0 − 4, j0 − 1) +4V (i0 − 1, j0 − 4) − 6V (i0 − 4, j0 − 2) − 6V (i0 − 2, j0 − 4) +4V (i0 − 4, j0 − 3) + 4V (i0 − 3, j0 − 4) − V (i0 − 4, j0 − 4) B. In-Depth Analysis of the Best Layer for Multilayer Prediction Model In Subsection III-A, we developed a general prediction model for multidimensional data sets. Based on this model, we need to answer another critical question: How many layers should we use for the prediction model during the compression process? In other words, we want to find the best n for equation (11). Why does there have to exist a best n? We will use twodimensional data sets to explain. We know that a better n can result in a more accurate data prediction, and a more accurate prediction will bring us a better compression performance, including improvements in compression factor, compression error, and compression/decompression speed. On the one hand, a more accurate prediction can be achieved by increasing the number of layers, which will bring more useful information along multiple dimensions. On the other hand, we also note that data from further distance will bring more uncorrelated information (noise) into the prediction, which means that too many layers will degrade the accuracy of our prediction. Therefore, we infer that there has to exist a best number of layers for our prediction model. How can we get the best n for our multilayer prediction model? For a two-dimensional data set, we first need to get prediction formulas for different layers by substituting 1, 2, 3, and so forth into the generic formula of our prediction model (as shown in equation (11)). The formulas are shown in Table I. Then we introduce a term called the “prediction hitting rate,” which is the proportion of the predictable data in the whole data set. We define a data point as “predictable data” if the difference between its original value and predicted value is not larger than the error bound. We denote the PH prediction hitting rate by RP H = NN , where NP H is the number of predictable data points and N is the size of the data set. In the climate simulation ATM data sets example, the hitting rates are calculated in Table II, based on the prediction methods described above. Here the second column shows the prediction hitting rate by using the original data values, orig denoted by RP H . In this case, 2-layer prediction will be 1-Layer 2-Layer 3-Layer 4-Layer orig RP H decomp RP H 21.5% 37.5% 25.8% 14.5% 19.2% 6.5% 9.8% 5.9% A. Error-Controlled Quantization The design of our error-controlled quantization is shown in Figure 2. First, we calculate the predicted value by using the multilayer prediction model proposed in the preceding section. We call this predicted value the “first-phase predicted value,” represented by the red dot in Fig. 2. Then, we expand 2m − 2 values from the first-phase predicted value by scaling the error bound linearly; we call these values “second-phase predicted values,” represented by the orange dots in Fig. 2. The distance between any two adjacent predicted values equals twice the error bound. Note that each predicted value will also be expanded one more error bound in both directions to form an interval with the length of twice the error bound. This will ensure that all the intervals are not overlapped. If the real value of the data point falls into a certain interval, we mark it as predictable data and use its corresponding predicted value from the same interval to represent the real value in the compression. In this case, the difference between the real value and predicted value is always lower than the error bound. However, if the real value doesn’t fall into any interval, we mark the data point as unpredictable data. Since there are 2m − 1 intervals, we use 2m − 1 codes to encode these 2m − 1 intervals. Since all the predictable data can be Real Value Second-phase 2m-1+1 Predicted Value 2*Error Bound First-phase Predicted Value Error Bound 2m-1 2*Error Bound Second-phase 2m-1-1 Predicted Value 2*Error Bound Second-phase 2m-1-2 Predicted Value … IV. AEQVE: A DAPTIVE E RROR - CONTROLLED Q UANTIZATION AND VARIABLE - LENGTH E NCODING In this section, we present our adaptive error-controlled quantization and variable-length encoding model, namely, AEQVE, which can further optimize the compression quality. First, we introduce our quantization method, which is completely different from the traditional one. Second, using the same logic from Subsection III-B, we develop an adaptive solution to optimize the number of intervals in the errorcontrolled quantization. Third, we show the fairly uneven distribution produced by our quantization encoder. Finally, we reduce the data size significantly by using the variablelength encoding technique on the quantization codes. Second-phase 2m-1+2 Predicted Value 2*Error Bound … more accurate than other layers if performing the prediction on the original data values. However, in order to guarantee that the compression error (absolute or value-range-based relative) falls into the user-set error bounds, the compression algorithm must use the preceding decompressed data values instead of the original data values. Therefore, the last column of Table II shows the hitting rate of the prediction by using decomp preceding decompressed data values, denoted by RP . H In this case, 1-layer prediction will become the best one for the compression algorithm on ATM data sets. Since the best layer n is data-dependent, different scientific data sets may have different best layers. Thus, we give users an option to set the value of layers in the compression process. The default value in our compressor is n = 1. … PREDICTION MODEL BASED ON ORIGINAL AND DECOMPRESSED DATA VALUES ON ATM DATA SETS Quan;za;on Code 2m-1 … Table II P REDICTION HITTING RATE USING DIFFERENT LAYERS FOR THE 1 Figure 2. Design of error-controlled quantization based on linear scaling of the error bound. encoded as the code of its corresponding interval and since all the unpredictable data will be encoded as another code, we need m bits to encode all 2m codes. For example, we use the codes of 1, · · · , 2m−1 , · · · , 2m − 1 to encode predictable data and use the code of 0 to encode unpredictable data. This process is quantization encoding. Note that our proposed error-controlled quantization is totally different from the traditional quantization technique, vector quantization, used in previous lossy compression, such as SSEM [16] and NUMARCK [6], in two properties: uniformity and error-control. The vector quantization method is nonuniform, whereas our quantization is uniform. Specifically, in vector quantization, the more concentratedly the data locates, the shorter the quantization interval will be, while the length of our quantization intervals is fixed (i.e. twice the error bound). Therefore, in vector quantization, the compression error cannot be controlled for every data point, especially the points in the intervals with the length longer than twice the error bound. Thus, we call our quantization method as error-controlled quantization. The next question is, How many quantization intervals should we use in the error-controlled quantization? We leave this question to Subsection IV-B. First, we introduce a technique we will adopt after the quantization. Figure 3 shows an example of the distribution of quantization codes produced by our quantization encoder, which uses 255 quantization intervals to represent predictable data. From this figure, we see that the distribution of quantization codes is uneven and that the degree of nonuniformity of the distribution depends on the accuracy of the previous prediction. In information and coding theory, a strategy, called variable-length encoding, is used to compress the nonuniform distribution source. In variable-length encoding, more common symbols will be generally represented using fewer bits than less common symbols. For uneven distribution, we can employ the variable-length encoding to reduce the data size significantly. Note that variable-length encoding is a process of lossless data compression. Specifically, we use the most popular variable-length 14% Predic6on Hi:ng Rate 12% 10% 8% 6% 4% (a) 100.0% 90.0% 80.0% 70.0% 60.0% 50.0% 40.0% 30.0% 20.0% 10.0% 0.0% Error-controlled Quantization Code encoding strategy, Huffman coding. Here we do not describe the Huffman coding algorithm in detail, but we note that Huffman coding algorithm implemented in all the lossless compressors on the market can deal only with the source byte by byte; hence, the total number of the symbols is as higher as to 256 (28 ). In our case, however, we do not limit m to be no greater than 8. Hence, if m is larger than 8, more than 256 quantization codes need to be compressed using the Huffman coding. Thus, in our compression, we implement a highly efficient Huffman coding algorithm that can handle a source with any number of quantization codes. B. Adaptive Scheme for Number of Quantization Intervals In Subsection IV-A, our proposed compression algorithm encodes the predictable data with its corresponding quantization code and then uses variable-length encoding to reduce the data size. A question remaining: How many quantization intervals should we use? We use an m − bit code to encode each data point, and the unpredictable data will be stored after a reduction of binary-representation analysis [9]. However, even binaryrepresentation analysis can reduce the data size to a certain extent. Storing the unpredictable data point has much more overhead than storing the quantization codes. Therefore, we should select a value for the number of quantization intervals that is as small as possible but can provide a sufficient prediction hitting rate. Note that the rate depends on the error bound as shown in Figure 4. If the error bound is too low (e.g., ebrel = 10−7 ), the compression is close to lossless, and achieving a high prediction hitting rate is difficult. Hence, we focus our research on a reasonable range of error bounds, ebrel ≥ 10−6 . Now we introduce our adaptive scheme for the number of quantization intervals used in the compression algorithm. Figure 4 shows the prediction hitting rate with different value-range-based relative error bounds using different numbers of quantization intervals on 2D ATM data sets and 3D hurricane data sets. It indicates that the prediction hitting rate will suddenly descend at a certain error bound from over 90% to a relatively low value. For example, if using 511 quantization intervals, the prediction hitting rate will drop from 97.1% to 41.4% at ebrel = 10−6 . Thus, we consider that 511 quantization intervals can cover only the valuerange-based relative error bound higher than 10−6 . However, different numbers of quantization intervals have different capabilities to cover different error bounds. Generally, more quantization intervals will cover lower error bounds. Baker et al. [3] point out that ebrel = 10−5 is enough for climate research simulation data sets, such as ATM data sets. Thus, based on Fig. 4, for ATM data sets, using 63 intervals 511 4095 16383 65535 Value-range-based Rela6ve Error Bound (b) Figure 3. Distribution produced by error-controlled quantization encoder on ATM data sets of (a) value-range-based relative error bound = 10−3 and (b) value-range-based relative error bound = 10−4 with 255 quantization intervals (m = 8). Quan6za6on Intervals # 63 1.0E-01 1.0E-02 1.0E-03 1.0E-04 1.0E-05 1.0E-06 1.0E-07 1.0E-08 (a) Predic6on Hi:ng Rate Error-controlled Quantization Code 0% 1 11 21 31 41 51 61 71 81 91 101 111 121 131 141 151 161 171 181 191 201 211 221 231 241 251 2% 1 11 21 31 41 51 61 71 81 91 101 111 121 131 141 151 161 171 181 191 201 211 221 231 241 251 50% 45% 40% 35% 30% 25% 20% 15% 10% 5% 0% 100.0% 90.0% 80.0% 70.0% 60.0% 50.0% 40.0% 30.0% 20.0% 10.0% 0.0% Quan6za6on Intervals # 15 63 255 2047 4095 1.0E-01 1.0E-02 1.0E-03 1.0E-04 1.0E-05 1.0E-06 1.0E-07 1.0E-08 Value-range-based Rela6ve Error Bound (b) Figure 4. Prediction hitting rate with decreasing error bounds using different quantization intervals on (a) ATM data sets and (b) hurricane data sets. and 511 intervals are good choices for ebrel = 10−4 and ebrel = 10−5 respectively. But, for hurricane data sets, we suggest using 15 intervals for ebrel = 10−4 and 63 intervals for ebrel = 10−5 . In our compression algorithm, a user can determine the number of quantization intervals by setting a value for m (2m − 1 quantization intervals). However, if it is unable to achieve a good prediction hitting rate (smaller than θ) in some error bounds, our compression algorithm will suggest that the user increases the number of quantization intervals. On contrast, the user should reduce the number of quantization intervals until a further reduction results the prediction hitting rate smaller than θ. In practice, sometimes a user’s requirement for compression accuracy is stable; therefore, the user can tune a good value for the number of quantization intervals and get optimized compression factors in the following large-scale compression. Algorithm 1 in Figure 5 outlines our proposed lossy compression algorithm. Note that the input data is a ddimensional floating-point array of the size N = n(1) × n(2) × · · · × n(d) , where n(1) is the size of the lowest dimension and n(d) is the size of the highest dimension. Before processing the data (line 1-3), our algorithm needs to compute the (n + 1)d − 1 coefficients (based on Equation 11) of the n-layer prediction method only once (line 3). While processing the data (line 4-20), first, the algorithm computes the predicted value for the current processing data point using the n-layer prediction method (line 9). Next, the algorithm computes the difference between the original and predicted data value and encodes the data point using 2m quantization codes (line 10-11). Then, if the data point is unpredictable, the algorithm adopts the binaryrepresentation analysis (line 14) proposed in [9] to reduce its storage. Lastly, the algorithm computes and records the decompressed value for the future prediction (line 16). After processing each data point (line 21-25), the algorithm will compress the quantization codes using the variable-length encoding technique (line 21) and count the number of predictable data points (line 22). If the prediction hitting rate is lower than the threshold θ, our algorithm will suggest that the user increases the quantization interval number (line Table III D ESCRIPTION OF DATA SETS USED IN EMPIRICAL PERFORMANCE EVALUATION ATM APS Hurricane O(1) O(1) O(1) O(1) O(1) O(1) O(N) O(N) Figure 5. Proposed lossy compression algorithm using Multi-layer Prediction and AEQVE Model 23-25). The computation complexity of each step is shown in Figure 4. Note that (1) lines 3 and 9 are O(1), since they depend only on the number of layers n used in the prediction rather than the data size N ; (2) although line 14 is O(1), binary-presentation analysis is more time-consuming than the other O(1) operations, such as lines 9-11 and 16, and hence increasing the prediction hitting rate can result in faster compression significantly; and (3) since we adopt the Huffman coding algorithm for the variable-length encoding and the total number of the symbols (i.e., quantization intervals) is 2m (such as 255), line 22 is its theoretical complexity O(N log 2m ) = O(mN ) = O(N ). Therefore, the overall complexity is O(N ). V. E MPIRICAL P ERFORMANCE E VALUATION In this section, we evaluate our compression algorithm, namely SZ-1.4, on various single-precision floating-point data sets: 2D ATM data sets from climate simulations [7], 2D APS data sets from X-ray scientific research [2], and 3D hurricane data sets from a hurricane simulation [1], as shown in Table III. Also, we compare our compression algorithm SZ-1.4 with state-of-the-art losseless (i.e., GZIP [8] and FPZIP [14]) and lossy compressors (i.e., ZFP [13], SZ-1.1 [9], and ISABELA [12]), based on the metrics mentioned in Section III. We conducted our experiments on a single core of an iMac with 2.3 GHz Intel Core i7 processors and 32 GB of 1600 MHz DDR3 RAM. Data Source Climate simulation X-ray instrument Hurricane simulation Dimension Size 1800 × 3600 2560 × 2560 100 × 500 × 500 Data Size 2.6 TB 40 GB 1.2 GB File Number 11400 1518 624 A. Compression Factor First, we evaluated our compression algorithm (i.e., SZ1.4) based on the compression factor. Figure 6 compares the compression factors of SZ-1.4 and five other compression methods: GZIP, FPZIP, ZFP, SZ-1.1, and ISABELA, with reasonable value-range-based relative error bounds, namely, 10−3 , 10−4 , 10−5 , and 10−6 , respectively. Specifically, we ran different compressors using the absolute error bounds computed based on the above listed ratios and the global data value range and then checked the compression results. Figure 6 indicates that SZ-1.4 has the best compression factor within these reasonable error bounds. For example, with ebrel = 10−4 , for ATM data sets, the average compression factor of SZ-1.4 is 6.3, which is 110% higher than ZFP’s 3.0, 70% higher than SZ-1.1’s 3.8, 350% higher than ISABELA’s 1.4, 232% higher than FPZIP’s 1.9, and 430% higher than GZIP’s 1.3. For APS data sets, the average compression factor of SZ-1.4 is 5.2, which is 79% higher than ZFP’s 2.9, 74% higher than SZ-1.1’s 3.0, 340% higher than ISABELA 1.2, 300% higher than FPZIP’s 1.3, and 372% higher than GZIP’s 1.1. For the hurricane data sets, the average compression factor of SZ-1.4 is 21.3, which is 166% higher than ZFP’s 8.0, 139% higher than SZ-1.1’s 8.9, 1675% higher than ISABELA’s 1.2, 788% higher than FPZIP’s 2.4, and 1538% higher than GZIP’s 1.3. Note that ISABELA cannot deal with some low error bounds; thus, we plot its compression factors only until it fails. We note that ZFP might not respect the error bound because of the fixed-point alignment when the value range is huge. For example, the variable CDNUMC in the ATM data sets, its value range is from 10−3 to 1011 and the compression error of the data point with the value 6.936168 is 0.123668 if using ZFP with ebabs = 10−7 . When the value range is not such huge, the maximum compression error of ZFP is much lower than the input error bound, whereas the maximum compression errors of the other lossy compression methods, including SZ-1.4, are exactly the same as the input error bound. This means that ZFP is overconservative with regard to the user’s accuracy requirement. Table V shows the maximum compression errors of SZ-1.4 and ZFP with different error bounds. For a fair comparison, we also evaluated SZ-1.4 by setting its input error bound as the maximum compression error of ZFP, which will make the maximum compression errors of SZ-1.4 and ZFP the same. The comparison of compression factors is shown in Figure 7. For example, with the same maximum compression error of 4.3 × 10−4 , our average compression factor is 162% higher than ZFP’s on the ATM data sets. With the same maximum compression error of 1.8 × 10−4 , our average compression factor is 71% higher than ZFP’s on the hurricane data sets. B. Rate-Distortion We note that ZFP is designed for a fixed bit-rate, whereas SZ (including SZ-1.1 and SZ-1.4) and ISABELA are designed for a fixed maximum compression error. Thus, for a fair comparison, we plot the rate-distortion curve for all the Table IV C OMPARISON OF P EARSON CORRELATION COEFFICIENT USING VARIOUS LOSSY COMPRESSORS WITH DIFFERENT MAXIMUM COMPRESSION ERRORS Maximum erel 3.3 × 10−3 4.3 × 10−4 2.6 × 10−5 3.4 × 10−6 4.1 × 10−7 SZ-1.4 0.99998 ≥ 1 − 10−6 ≥ 1 − 10−8 ≥ 1 − 10−10 ≥ 1 − 10−12 ATM ZFP 0.9996 ≥ 1 − 10−7 ≥ 1 − 10−9 ≥ 1 − 10−11 ≥ 1 − 10−13 SZ-1.1 0.99998 ≥ 1 − 10−6 ≥ 1 − 10−9 ≥ 1 − 10−11 ≥ 1 − 10−13 Maximum erel 2.4 × 10−3 1.8 × 10−4 2.5 × 10−5 2.6 × 10−6 2.9 × 10−7 SZ-1.4 0.998 ≥ 1 − 10−5 ≥ 1 − 10−6 ≥ 1 − 10−8 ≥ 1 − 10−10 SZ-1.4 Our Compression 12 ZFP-0.5 10 SZ-1.1 8 ISABELA-0.2.1 6 4 FPZIP GZIP 2 0 1.00E-03 1.00E-04 1.00E-05 20 15 ZFP-0.5 5 0 3.3E-03 1.00E-06 (a) ZFP-0.5 8 SZ-1.1 6 ISABELA-0.2.1 4 FPZIP GZIP 0 1.00E-05 Compression Factor 30 SZ-1.4 Our Compression 20 ZFP-0.5 10 1.8E-04 2.5E-05 2.6E-06 2.9E-07 Value-range-based RelaAve Error Bound (b) Figure 7. Comparison of compression factors with same maximum compression error using SZ-1.4 and ZFP on (a) ATM and (b) hurricane data sets. 35 30 25 SZ-1.4 Our Compression 20 ZFP-0.5 15 SZ-1.1 10 ISABELA-0.2.1 5 FPZIP GZIP 0 1.0E-05 1.0E-06 Value-range-based Rela@ve Error Bound (c) Figure 6. Comparison of compression factors using different lossy compression methods on (a) ATM, (b) APS, and (c) hurricane data sets with different error bounds. Table V M AXIMUM COMPRESSION ERRORS ( NORMALIZED TO VALUE RANGE ) USING SZ-1.4 AND ZFP WITH DIFFERENT USER - SET VALUE - RANGE - BASED ERROR BOUNDS 10−2 10−3 10−4 10−5 10−6 4.1E-07 40 2.4E-03 (b) 1.0E-04 3.4E-06 0 1.00E-06 Value-range-based Rela@ve Error Bound 1.0E-03 Compression Factor Compression Factor SZ-1.4 Our Compression 2 2.6E-05 (a) 50 10 1.00E-04 4.3E-04 Value-range-based RelaAve Error Bound 12 1.00E-03 SZ-1.4 Our Compression 10 Value-range-based Rela@ve Error Bound User-set ebrel SZ-1.1 0.998 ≥ 1 − 10−5 ≥ 1 − 10−5 ≥ 1 − 10−7 ≥ 1 − 10−11 25 14 Compression Factor Compression Factor 16 Hurricane ZFP 0.99995 ≥ 1 − 10−6 ≥ 1 − 10−8 ≥ 1 − 10−9 ≥ 1 − 10−11 ATM SZ-1.4 ZFP 1.0 × 10−2 3.3 × 10−3 1.0 × 10−3 4.3 × 10−4 1.0 × 10−4 2.6 × 10−5 1.0 × 10−5 3.4 × 10−6 1.0 × 10−6 4.1 × 10−7 Hurricane SZ-1.4 ZFP 1.0 × 10−2 2.4 × 10−3 1.0 × 10−3 1.8 × 10−4 1.0 × 10−4 2.5 × 10−5 1.0 × 10−5 2.6 × 10−6 1.0 × 10−6 2.9 × 10−7 lossy compressors and compare the distortion quality with the same rate. Here rate means bit-rate in bits/value, and we will use the peak signal-to-noise ratio (PSNR) to measure the distortion quality. PSNR is calculated by the equation (3) in decibel. Generally speaking, in the rate-distortion curve, the higher the bit-rate (i.e., more bits per value) in compressed storage, the higher the quality (i.e., higher PSNR) of the reconstructed data after decompression. Figure 8 shows the rate-distortion curves of the different lossy compressors on the three scientific data sets. The figure indicates that our lossy compression algorithm (i.e., SZ-1.4) has the best rate-distortion curve on the 2D data sets, ATM and APS. Specifically, when the bit-rate equals 8 bits/value (i.e., CF = 4), for the ATM data sets, the PSNR of SZ-1.4 is about 103 dB, which is 14 dB higher than the second-best ZFP’s 89 dB. This 14 dB improvement in PSNR represents an increase in accuracy (or reduction in RMSE) of more than 5 times. Also, the accuracy of our compressor is more than 7 times that of SZ-1.1 and 103 times than of ISABELA. For APS data sets, the PSNR of SZ-1.4 is about 96 dB, which is 9 dB higher than ZFP’s 87 dB. This 9 dB improvement in PSNR represents an increase in accuracy of 2.8 times. Also, the accuracy of our compressor is 8 times that of SZ-1.1 and 790 times that of ISABELA. For the 3D hurricane data sets, the rate-distortion curves illustrate that at low bit-rate (i.e., 2 bits/value) the PSNR of SZ-1.4 is close to that of ZFP. In the other cases of bitrate higher than 2 bits/value, our PSNR is better than ZFP’s. Specifically, when the bit-rate is 8 bits/value, our PSNR is about 182 dB, which is 11 dB higher (i.e., 3.5 times in accuracy) than ZFP’s 171 dB, and 47 dB higher (i.e., 224 times in accuracy) than SZ-1.1’s 135 dB. Note that we test and show the cases only with the bit-rate lower than 16 bits/value for the three single-precision data sets, which means the compression factors are higher than 2. As we mentioned in Section I, some lossless compressors can provide a compression factor up to 2 [15]. It is reasonable to assume that users are interested in lossy compression only if it provides a compression factor of 2 or higher. C. Pearson Correlation Next we evaluated our compression algorithm (i.e., SZ1.4) based on the Pearson correlation coefficient between Table VI C OMPRESSION AND DECOMPRESSION SPEEDS (MB/ S ) USING SZ-1.4 AND ZFP WITH DIFFERENT VALUE - RANGE - BASED RELATIVE ERROR BOUNDS User-set ebrel 10−3 10−4 10−5 10−6 ATM SZ-1.4 ZFP Comp Decomp Comp Decomp 82.3 174.0 118.7 181.8 61.5 100.6 100.5 139.4 55.4 83.8 87.9 121.3 46.1 55.6 83.6 105.7 APS SZ-1.4 ZFP Comp Decomp Comp Decomp 77.7 130.5 101.1 156.5 64.3 98.0 104.5 133.6 52.9 78.8 101.7 115.3 44.3 50.8 95.4 109.7 180 160 PSNR (dB) 140 120 SZ-1.4 Our Compression 100 80 ZFP-0.5 60 SZ-1.1 40 ISABELA-0.2.1 20 0 0 2 4 6 8 10 12 14 16 Rate (bits/value) (a) 160 140 PSNR (dB) 120 100 SZ-1.4 Our Compression 80 ZFP-0.5 60 SZ-1.1 40 20 ISABELA-0.2.1 0 0 2 4 6 8 10 12 14 16 Rate (bits/value) (b) 250 PSNR (dB) 200 150 SZ-1.4 ZFP-0.5 100 SZ-1.1 50 ISABELA-0.2.1 0 0 2 4 6 8 10 12 14 16 Rate (bits/value) (c) Figure 8. Rate-distortion using different lossy compression methods on (a) ATM, (b) APS, and (c) hurricane data sets. the original and the decompressed data. Table IV shows the Pearson correlation coefficients using different lossy compression methods with different maximum compression errors. Because of space limitations, we compare SZ-1.4 only with ZFP and SZ-1.1, since from the previous evaluations they outperform ISABELA significantly. We note that we use the maximum compression error of ZFP as the input error bound of SZ-1.4 and SZ-1.1 to make sure that all three lossy compressors have the same maximum compression error. From Table IV we know that all three compressors have “five nines” or better coefficients (marked with bold) (1) from 4.3 × 10−4 to lower value-range-based relative error bounds on the ATM data sets and (2) from 1.8 × 10−4 to lower value-range-based relative error bounds on the hurricane data sets. These results mean SZ-1.4 has accuracy in the Pearson correlation of decompressed data similar to that of ZFP and SZ-1.1. D. Speed Now, let us evaluate the compression and decompression speed of our compressor (i.e., SZ-1.4). We evaluate the compression and decompression speed of different lossy compressors with different error bound in megabytes per Hurricane SZ-1.4 ZFP Comp Decomp Comp Decomp 84.9 176.4 251.6 549.6 82.8 164.5 211.3 436.0 76.2 149.0 174.3 322.8 69.5 118.1 150.9 265.4 second. First, we compare the overall speed of SZ-1.4 with SZ-1.1 and ISABELA’s. For the 2D ATM and APS data sets, on average, our compressor is 2.2x faster than SZ1.1 and 32x faster than ISABELA. For the 3D hurricane data sets, on average, SZ-1.4 is 2.4x faster than SZ-1.1 and 62x faster than ISABELA. Due to space limitations, we do not show the specific values of SZ-1.1 and ISABELA. We then compare the speed of SZ-1.4 and ZFP. Table VI shows the compression and decompression speed of SZ-1.4 and ZFP. It illustrates that on average SZ-1.4’s compression is 50% slower than ZFP’s and decompression is 48% slower than ZFP’s. Our compression has not been optimized in performance because the primary objective was to reach high compression factors, therefore, we plan to optimize our compression for different architectures and data sets in the future. E. Autocorrelation of Compression Error Finally, we analyze the autocorrelation of the compression errors, since some applications require the compression errors to be uncorrelated. We evaluate the autocorrelation of the compression errors on the two typical variables in the ATM data sets, i.e., FREQSH and SNOWHLND. The compression factors of FREQSH and SNOWHLND are 6.5 and 48 using SZ-1.4 with ebrel = 10−4 . Thus, to some extent, FREQSH can represent relatively low-compressionfactor data sets, while SNOWHLND can represent relatively high-compression-factor data sets. Figure 9 shows the first 100 autocorrelation coefficients of our and ZFP’s compression errors on these two variables. It illustrates that on the FREQSH the maximum autocorrelation coefficient of SZ-1.4 is 4×10−3 , which is much lower than ZFP’s 0.25. However, on the SNOWHLND the maximum autocorrelation coefficient of SZ-1.4 is about 0.5, which is higher than ZFP’s 0.23. We also evaluate the autocorrelation of SZ-1.4 and ZFP on the APS and hurricane data sets and observe that, generally, SZ-1.4’s autocorrelation is lower than ZFP’s on the relatively low-compression-factor data sets, whereas ZFP’s autocorrelation is lower than SZ-1.4’s on the relatively highcompression-factor data sets. We therefore plan to improve the autocorrelation of compression errors on the relatively high-compression-factor data sets in the future. The effect of compression error autocorrelation being application specific, lossy compressor users might need to understand this effect before using one of the other compressor. VI. D ISCUSSION In this section, we first discuss the parallel use of our compressor (i.e., SZ-1.4) for large-scale data sets. We then perform an empirical performance evaluation on the full 2.5 TB ATM data sets using 1024 cores (i.e., 64 nodes, each node with two Intel Xeon E5-2670 processors and 64 GB DDR3 memory, and each processor has 8 cores) from the Blues cluster at Argonne. SZ-1.4 Our Compression 0.30 0.004 0.20 0.003 0.10 0.002 0.001 0.00 0.000 -0.001 1 11 21 31 41 -0.002 51 61 71 81 -0.10 91 1 11 21 31 41 0.50 0.20 0.40 0.15 0.30 0.10 0.20 0.05 0.10 0.00 0.00 -0.05 31 41 51 61 (c) 71 81 91 ZFP 0.25 21 61 (b) SZ-1.4 Our Compression 11 51 -0.20 (a) 0.60 1 Table VII S TRONG SCALABILITY OF PARALLEL COMPRESSION USING SZ-1.4 WITH DIFFERENT NUMBER OF PROCESSES ON B LUES ZFP 0.005 71 81 91 1 11 21 31 41 51 -0.10 61 71 81 91 (d) Figure 9. Autocorrelation analysis (first 100 coefficients) of compression errors with increasing delays using our lossy compressor and ZFP on variable FREQSH (i.e., (a) and (b)) and variable SNOWHLND (i.e., (c) and (d)) in ATM data sets. Compression Wri;ng Compressed Data Wri;ng Ini;al Data 100% 80% 60% 40% 20% Number of Processes 1 2 4 8 16 32 64 128 256 512 1024 Number of Nodes 1 2 4 8 16 32 64 64 64 64 64 Comp Speed (GB/s) 0.09 0.18 0.35 0.70 1.40 2.79 5.60 11.2 21.5 40.5 81.3 Speedup 1.00 2.00 3.99 7.99 15.98 31.91 63.97 127.6 245.8 463.0 930.7 Parallel Efficiency 100.0% 99.8% 99.9% 99.8% 99.9% 99.7% 99.9% 99.7% 96.0% 90.4% 90.9% Table VIII S TRONG SCALABILITY OF PARALLEL DECOMPRESSION USING SZ-1.4 WITH DIFFERENT NUMBER OF PROCESSES ON B LUES Number of Processes 1 2 4 8 16 32 64 128 256 512 1024 Number of Nodes 1 2 4 8 16 32 64 64 64 64 64 Decomp Speed (GB/s) 0.20 0.40 0.80 1.60 3.20 6.40 12.8 25.6 49.0 92.5 187.0 Speedup 1.00 1.99 4.00 7.94 16.00 31.91 64.00 127.7 244.5 461.4 932.7 Parallel Efficiency 100.0% 99.6% 99.9% 99.2% 99.9% 99.7% 99.9% 99.7% 95.5% 90.1% 91.1% 0% 1 2 4 8 16 32 64 128 256 512 1024 Number of Processes (a) Decompression Reading Compressed Data Reading Ini;al Data 100% 80% 60% 40% 20% 0% 1 2 4 8 16 32 64 128 256 512 1024 Number of Processes (b) Figure 10. Comparison of time to compress/decompress and write/read compressed data against time to write/read initial data on Blues. Parallel compression can be classified into two categories: in-situ compression and off-line compression. Our compressor can be easily used as an in-situ compressor embedded in a parallel application. Each process can compress/decompress a fraction of the data that is being held in its memory. For off-line compression, an MPI program or a script can be used to load the data into multiple processes and run the compression separately on them. ATM data sets (as shown in Table III), for example, have a total of 11400 files and APS data sets have 1518 files. The users can load these files by multiple processes and run our compressor in parallel, without inter-process communications. We present the strong scalability of the parallel compression and decompression without the I/O (i.e., writing/reading data) time in Table VII and VIII with different scales ranging from 1 to 1024 processes on the Blues cluster. In the experiments, we set ebrel = 10−4 for all the compression. The number of processes is increased in two stages. At the first stage, we launch one process per node and increase the num- ber of nodes until the maximum number we can request (i.e., 64). At the second stage, we run the parallel compression on 64 nodes while changing the number of processes per node. We measure the time of compression/decompression without the I/O time and use the maximum time among all the processes. We test each experiment five times and use the average compression/decompression time to calculate their speeds, speedup, and parallel efficiency as shown in the tables. The two tables illustrates that the parallel efficiency of our compressor can stay nearly 100% from 1 to 128 processes, which demonstrates that our compression/decompression have linear speedup with the number of processors. However, the parallel efficiency is decreased to about 90% when the total number of processes is greater than 128 (i.e, more than two processes per node). This performance degradation is due to node internal limitations. Note that the compression/decompression speeds of a singe process in Table VII and VIII are different from ones in Table VI, since we run the sequential and parallel compression on two different platforms. Figure 10 compares the time to compress/decompress and write/read the compressed data against the time to write/read the initial data. Each bar represents the sum of compression/decompression time, writing/reading the compressed data and writing/reading the initial data. We normalize the sum to 100% and plot a dash line at 50% to ease the comparison. It illustrates that the time of writing and reading initial data will be much longer than the time of writing and reading compressed data plus the time of compression and decompression on the Blues when the number of processors is 32 or more. This demonstrates our compressor can effectively reduce the total I/O time when dealing with the ATM data sets. We also note that the relative time spent in I/O will increase with the number of processors, because of inevitable bottleneck of the bandwidth when writing/reading data simultaneously by many processes. By contract, our compression/decompression have linear speedup with the number of processors, which means the performance gains should be greater with increasing scale. VII. R ELATED W ORK Scientific data compression algorithms fall into two categories: losseless compression [14], [8], [18] and lossy compression [9], [16], [13], [12]. Popular lossless compression algorithms include GZIP [8], LZ77 [18], and FPZIP [14]. However, the mainly limitation of the lossless compressors is their fairly low compression factor (up to 2:1 in general [15]). In order to improve the compression factor, several lossy data compression algorithms were proposed in recent years. ISABELA [12] performs data compression by B-spline interpolation after sorting the data series. But ISABELA has to use extra storage to record the original index for each data point because of the loss of the location information in the data series; thus, it suffers from a low compression factor especially for large numbers of data points. Lossy compressors using vector quantization, such as NUMARCK [6] and SSEM [16], cannot guarantee the compression error within the bound and have a limitation of the compression factor, as demonstrated in [9]. The difference between NUMARCK and SSEM is that NUMARCK uses vector quantization on the differences between adjacent two iterations for each data, whereas SSEM uses vector quantization on the high frequency data after wavelet transform. ZFP is a lossy compressor using exponent/fixed-point alignment, orthogonal block transform, bit-plane encoding. However, it might not respect the error bound when the data value range is huge. VIII. C ONCLUSION AND F UTURE W ORK In this paper, we propose a novel error-controlled lossy compression algorithm. We evaluate our compression algorithm by using multiple real-world production scientific data sets across multiple domains, and we compare it with five state-of-the-art compressors based on a series of metrics. We have implemented and released our compressor under a BSD license. The key contributions are listed below. • We derive a generic model for the multidimensional prediction and optimize the number of data points used in the prediction to achieve significant improvement in the prediction hitting rate. • We design an adaptive error-controlled quantization and variable-length encoding model (AEQVE) to deal effectively with the irregular data with spiky changes. • Our average compression factor is more than 2x compared with the second-best compressor with reasonable error bounds and our average compression error has more than 3.8x reduction over the second-best with user-desired bit-rates on the ATM, APS and hurricane data sets. We encourage users to evaluate our lossy compressor and compare with existing state-of-the-art compressors on more scientific data sets. In the future work, we plan to optimize our compression for different architectures and data sets. We will also further improve the autocorrelation of our compression on the data sets with relatively high compression factors. ACKNOWLEDGMENTS This research was supported by the Exascale Computing Project (ECP), Project Number: 17-SC-20-SC, a collaborative effort of two DOE organizations - the Office of Science and the National Nuclear Security Administration, responsible for the planning and preparation of a capable exascale ecosystem, including software, applications, hardware, advanced system engineering and early testbed platforms, to support the nation’s exascale computing imperative. The submitted manuscript has been created by UChicago Argonne, LLC, Operator of Argonne National Laboratory (Argonne). Argonne, a U.S. Department of Energy Office of Science laboratory, is operated under Contract No. DE-AC02-06CH11357. R EFERENCES [1] A simulation of a hurricane from the National Center for Atmospheric Research. http://vis.computer.org/vis2004contest/ data.html, 2016. Online. [2] E. Austin. Advanced photon source. Synchrotron Radiation News, 29(2):29–30, 2016. [3] A. H. Baker, H. Xu, J. M. Dennis, M. N. Levy, D. Nychka, S. A. Mickelson, J. Edwards, M. Vertenstein, and A. Wegener. A methodology for evaluating the impact of data compression on climate simulation data. In HPDC’14, pages 203–214, 2014. [4] D. Bernholdt, S. Bharathi, D. Brown, K. Chanchio, M. Chen, A. Chervenak, L. Cinquini, B. Drach, I. Foster, P. Fox, et al. The Earth System Grid: Supporting the next generation of climate modeling research. Proceedings of the IEEE, 93(3):485–495, 2005. [5] S. Brenner and R. Scott. The Mathematical Theory of Finite Element Methods, volume 15. Springer Science & Business Media, 2007. [6] Z. Chen, S. W. Son, W. Hendrix, A. Agrawal, W. Liao, and A. N. Choudhary. NUMARCK: machine learning algorithm for resiliency and checkpointing. In SC 2014, pages 733–744, 2014. [7] Community Earth Simulation Model (CESM). http://www. cesm.ucar.edu/, 2016. Online. [8] L. P. Deutsch. Gzip file format specification version 4.3. [9] S. Di and F. Cappello. Fast error-bounded lossy HPC data compression with SZ. In IPDPS 2016, pages 730–739, 2016. [10] P. J. Gleckler, P. J. Durack, R. J. Stouffer, G. C. Johnson, and C. E. Forest. Industrial-era global ocean heat uptake doubles in recent decades. Nature Climate Change, 2016. [11] L. Ibarria, P. Lindstrom, J. Rossignac, and A. Szymczak. Out-of-core compression and decompression of large ndimensional scalar fields. In Computer Graphics Forum, volume 22, pages 343–348. Wiley Online Library, 2003. [12] S. Lakshminarasimhan, N. Shah, S. Ethier, S. Ku, C. Chang, S. Klasky, R. Latham, R. B. Ross, and N. F. Samatova. ISABELA for effective in situ compression of scientific data. Concurrency and Computation: Practice and Experience, 25(4):524–540, 2013. [13] P. Lindstrom. Fixed-rate compressed floating-point arrays. TVCG, 20(12):2674–2683, 2014. [14] P. Lindstrom and M. Isenburg. Fast and efficient compression of floating-point data. TVCG, 12(5):1245–1250, 2006. [15] P. Ratanaworabhan, J. Ke, and M. Burtscher. Fast lossless compression of scientific floating-point data. In DCC 2006, pages 133–142, 2006. [16] N. Sasaki, K. Sato, T. Endo, and S. Matsuoka. Exploration of lossy compression for application-level checkpoint/restart. In IPDPS 2015, pages 914–922, 2015. [17] A. Wegener. Universal numerical encoder and profiler reduces computing’s memory wall with software, fpga, and soc implementations. In DCC 2013, page 528, 2013. [18] J. Ziv and A. Lempel. A universal algorithm for sequential data compression. IEEE Transactions on Information Theory, 23(3):337–343, 1977.
7cs.IT
arXiv:1612.01520v1 [math.ST] 4 Dec 2016 Change point detection in autoregressive models with no moment assumptions Fumiya Akashi Holger Dette Waseda University Ruhr-Universität Bochum Department of Applied Mathematics Fakultät für Mathematik 169-8555, Tokyo, Japan 44780 Bochum, Germany Yan Liu Waseda University Department of Applied Mathematics 169-8555, Tokyo, Japan Abstract In this paper we consider the problem of detecting a change in the parameters of an autoregressive process, where the moments of the innovation process do not necessarily exist. An empirical likelihood ratio test for the existence of a change point is proposed and its asymptotic properties are studied. In contrast to other work on change point tests using empirical likelihood, we do not assume knowledge of the location of the change point. In particular, we prove that the maximizer of the empirical likelihood is a consistent estimator for the parameters of the autoregressive model in the case of no change point and derive the limiting distribution of the corresponding test statistic under the null hypothesis. We also establish consistency of the new test. A nice feature of the method consists in the fact that the resulting test is asymptotically distribution free and does not require an estimate of the long run variance. The asymptotic properties of the test are investigated by means of 1 a small simulation study, which demonstrates good finite sample properties of the proposed method. Keywords and Phrases: Empirical likelihood, change point analysis, infinite variance, autoregressive processes AMS Subject Classification: 62M10, 62G10, 62G35 1 Introduction The problem of detecting structural breaks in time series has been studied for a long time. Since the seminal work of Page (1954, 1955), who proposed a sequential scheme for identifying changes in the mean of a sequence of independent random variables, numerous authors have worked on this problem. A large part of the literature concentrates on CUSUM tests, which are nonparametric by design [see Aue and Horváth (2013) for a recent review and some important references]. Other authors make distributional assumptions to construct tests for structural breaks. For example, Gombay and Horváth (1990) suggested a likelihood ratio procedure to test for a change in the mean and extensions of this method can be found in the monograph of Csörgö and Horváth (1997) and the reference therein. An important problem in this context is the detection of changes in the parameters of an autoregressive process and we refer to the work of Andrews (1993), Bai (1993, 1994), Davis et al. (1995), Lee et al. (2003) and Berkes et al. (2011) among others who proposed CUSUM-type and likelihood ratio tests. In practice, however, the distribution of random variables is rarely known and its misspecification may result in an invalid analysis using likelihood ratio methods. One seminal method to treat the likelihood ratio empirically has been investigated by Owen (1988), Qin and Lawless (1994) in a general context and extended by Chuang and Chan (2002) to estimate and test parameters in an autoregressive model. In change point analysis the empirical likelihood approach can be viewed as a compromise between the completely parametric likelihood ratio and nonparametric CUSUM method. Baragona et al. (2013) used this concept to construct a test for changepoints and showed that in the case where the location of the break points is known, 2 the limiting distribution of the corresponding test statistic is a chi-square distribution. Ciuperca and Salloum (2015) considered the change point problem in a non-linear model with independent data without assuming knowledge of its location and derived an extreme value distribution as limit distribution of the empirical likelihood ratio test statistic. These findings are similar in spirit to the meanwhile classical results in Csörgö and Horváth (1997), who considered the likelihood ratio test. The purpose of the present paper is to investigate an empirical likelihood test for a change in the parameters of an autoregressive process with infinite variance (more precisely we do not assume the existence of any moments). Our work is motivated by the fact that in many fields, such as electrical engineering, hydrology, finance and physical systems, one often observes “heavy-tailed” data [see Nolan (2015) or Samoradnitsky and Taqqu (1994) among many others]. To deal with such data, many authors have developed L1 -based methods. For example, Chen et al. (2008) constructed a robust test for a linear hypothesis of the parameters based on least absolute deviation. Ling (2005) and Pan et al. (2007) proposed self-weighted least absolute deviation-based estimators for (parametric) time series models with an infinite variance innovation process and show the asymptotic normality of the estimators. However, the limit distribution of the L1 -based statistics usually contains the unknown probability density of the innovation process, which is difficult to estimate. For example, Ling (2005) and Pan et al. (2007) used kernel density estimators for this purpose, but the choice of the corresponding bandwidth is not clear and often depends on users. To circumvent problems of this type in the context of change point analysis, we combine in this paper quantile regression and empirical likelihood methods. As a remarkable feature, the asymptotic distribution of the proposed test statistic does not involve unknown quantities of the model even if we consider autoregressive models with an infinite variance in the innovation process. We would also like to emphasize that the nonparametric CUSUM tests proposed by Bai (1993, 1994) for detecting structural breaks in the parameters of an autoregressive process assume the existence of the variance of the innovations. However, an alternative to the method proposed here are CUSUM tests based on quantile regression, which has been re3 cently considered by Qu (2008), Su and Xiao (2008) and Zhou et al. (2015) among others. The remaining part of this paper is organized as follows. In Section 2, we introduce the model, the testing problem and the so-called self-weighted empirical likelihood ratio test statistic. Our main results are given in Section 3, where we derive the limit distribution of the proposed test statistic and prove consistency. The finite sample properties of the proposed test are investigated in Section 4 by means of a simulation study. We also compare the test proposed in this paper with the CUSUM test using quantile regression [see Qu (2008)]. While the empirical likelihood based test suggested here is competitive with the CUSUM test using quantile regression when the innovation process is Gaussian, it performs remarkably better than the CUSUM test of Qu (2008) if the innovation process has heavy tails. Moreover, the new test is robust with respect non-stationarity even when the process is nearly a unit root process. Finally, rigorous proofs of the results relegated to Section 5. 2 Change point tests using empirical likelihood Throughout this paper the following notations and symbols are used. The set of all integers and real numbers are denoted as Z and R, respectively. For any sequence of random vectors {An : n ≥ 1} we denote by L P →A → A and An − An − convergence in probability and law to a random vector A, respectively. The transpose of a matrix M is denoted by M 0 , and kM k = {tr(M 0 M )}1/2 is the Frobenius norm. We denote the i-dimensional zero vector, the j × k zero matrix and the l × l identity matrix by 0i , Oj×k and Il×l , respectively. Consider the autoregressive model of order p (AR(p) model) defined by 0 yt = Xt−1 β + et , (2.1) where Xt−1 = (yt−1 , . . . , yt−p )0 and β ∈ Rp and assume that the innovation process {et : t ∈ Z} is a sequence of independent and identically distributed (i.i.d.) random 4 variables with vanishing median. Let {y1−p , . . . , yn } be an observed stretch from the model ( 2.1) for β = β0 , where β0 = (β1 , . . . , βp )0 denotes the “true” parameter. This paper focuses on a posteriori type change point problem for the parameters in the AR(p) process ( 2.1). More precisely, we consider the model ( 0 θ1 + et (1 ≤ t ≤ k ∗ ) Xt−1 yt = 0 θ2 + et (k ∗ + 1 ≤ t ≤ n) Xt−1 for some vector θ1 , θ2 ∈ Rp , where k ∗ ∈ {1, . . . , n} is the unknown time point of the change. The testing problem for a change point in the autoregressive process can then be formulated by the following hypotheses: H0 : θ1 = θ2 = β0 against H1 : θ1 6= θ2 . (2.2) Note that we neither assume knowledge of the change point k ∗ (if the null hypothesis is not true) nor of the true value β0 ∈ Rp (if the null hypothesis holds). For the testing problem ( 2.2), we construct an empirical likelihood ratio (ELR) test. To be precise, let I denote the indicator function. As the median of et is zero, the moment condition hn 1 o i 0 ∗ E − I(yt − Xt−1 β0 ≤ 0) a (Xt−1 ) = 0m (2.3) 2 holds under the null hypothesis H0 in ( 2.2), where a∗ (Xt−1 ) is any m-dimensional measurable function of Xt−1 independent of et . Motivated by the moment conditions ( 2.3), we first introduce the self-weighted moment function n1 o 0 g(Yt p , β) := − I yt − Xt−1 β ≤ 0 a∗ (Xt−1 ) (t = 1, . . . , n), 2 where Yt p = (yt , . . . , yt−p ) and a∗ (Xt−1 ) = wt−1 a(Xt−1 ), a(x) = (x0 , ϕ(x)0 )0 is an m = (p + q)-dimensional function, ϕ a q-dimensional function, wt−1 = w(yt−1 , . . . , yt−p ) a self-weight and w some positive weight function. We can choose the weight function w and ϕ arbitrarily provided that Assumption 3.2 in Section 3 holds. In particular, we can use a(x) = x, which corresponds to the case q = 0 (see also Section 4). Note that under the null hypothesis H0 , we have that E[g(Yt p , β0 )] = 0m for all t = 1, . . . , n. Let rn,k be (v1 , . . . , vk , vk+1 , . . . , vn )0 be a vector in the unit cube [0, 1]n , 5 then the empirical likelihood (EL), for β = θ1 before the change point k ∈ {1, . . . , n} and β = θ2 after the change point, is defined by k n n Y  Y  o Ln,k (θ1 , θ2 ) := sup vi vj : rn,k ∈ Pn,k ∩ Mn,k (θ1 , θ2 ) , i=1 j=k+1 where Pn,k and Mn,k (θ1 , θ2 ) are subsets of the cube [0, 1]n defined as n n Pn,k := rn,k ∈ [0, 1] : k X vi = i=1 n X o vj = 1 j=k+1 and k n o n X X p n vj g(Yjp , θ2 ) = 0m . Mn,k (θ1 , θ2 ) := rn,k ∈ [0, 1] : vi g(Yi , θ1 ) = i=1 j=k+1 Note that the unconstrained maximum EL is represented as Ln,k,E := sup n nY vi : rn,k ∈ Pn,k o = k −k (n − k)−(n−k) , i=1 and hence, the logarithm of the empirical likelihood ratio (ELR) statistic is given by Ln,k (θ1 , θ2 ) Ln,k,E k n n Y  Y  o = − log sup kvi (n − k)vj : rn,k ∈ Pn,k ∩ Mn,k (θ1 , θ2 ) ln,k (θ1 , θ2 ) := − log i=1 = k hX  0 j=k+1 p log 1 − λ g(Yi , θ1 ) + i=1 n X i  log 1 − η 0 g(Yjp , θ2 ) , (2.4) j=k+1 where ( 2.4) is obtained by the Lagrange multiplier method and the multipliers λ, η ∈ Rm satisfy k X i=1 n X g(Yjp , θ2 ) g(Yi p , θ1 ) = = 0m . 1 − λ0 g(Yi p , θ1 ) j=k+1 1 − η 0 g(Yjp , θ2 ) 6 We finally define the test statistic for the change point problem ( 2.2). Since the maximum ELR under H0 is given by Pn,k := sup{−ln,k (β, β)}, β∈B one may define the ELR test statistic by Tn := 2 max br1 nc≤k≤br2 nc Pn,k , (2.5) where 0 < r1 < r2 < 1 for fixed constants. Note that we do not consider the maximum of {Pn,k | k = 1, . . . , n} as Pn,k can not be estimated accurately for small and large values of k (see Theorem 3.1 in Section 3 for more details). The asymptotic properties of a weighted version of this statistic are investigated in the following section. Remark 2.1. The approach presented here can be naturally extended to the general τ -quantile regression models. To be precise, suppose that Qy (τ | Xt−1 ) = inf{y : P (yt < y | Xt−1 ) ≥ τ } denotes the τ th-quantile of yt conditional on Xt−1 and assume that Qy (τ | Xt−1 ) = β(τ )0 Xt−1 . The moment condition E[g (τ ) (Yt p , β0 (τ ))] = 0m still holds under the null hypothesis H0 , if we define g (τ ) (Yt p , β(τ )) := ψτ (yt − β(τ )0 Xt−1 )a∗ (Xt−1 ) and ψτ (u) := {τ − I(u ≤ 0)}. Remark 2.2. The method can also be extended to develop change point analysis based on the generalized empirical likelihood (GEL). A GEL test statistic for the change point problem ( 2.2) can be defined by ρ ln,k (θ1 , θ2 ) h = 2 sup k X λ∈Rm i=1 0 p ρ {λ g(Yi , θ1 )} + sup η∈Rm 7 n X j=k+1 i  ρ η 0 g(Yjp , θ2 ) , where ρ is a real-valued, concave, twice differentiable function defined on an open interval of the real line that contains the point 0 with ρ0 (0) = ρ00 (0) = 1. Typical examples for the choice of ρ are given by ρ(ν) = − log(1 − ν) and (1 + cν)(c+1)/c − 1 . ρ(ν) = c+1 (2.6) Using Lagrangian multipliers, it is easy to see that the choice ρ(ν) = − log(1 − ν) yields the empirical likelihood method discussed so far. The class associated with ( 2.6) is called the Cressie-Read family [see Cressie and Read (1984)]. 3 Main results In this section we state our main results. Throughout this paper, let F and f denote the distribution function and the probability density function of et , respectively. We impose the following assumptions. Assumption 3.1. (i) β0 ∈ Int(B), where the parameter space B is a compact set in Rp with nonempty interior. (ii) 1 − β1 z − · · · − βp z p 6= 0 for |z| ≤ 1 and β ∈ B. (iii) The median of et is zero. (iv) The distribution function F of et is continuous and differentiable at the point 0 with positive derivative F 0 (0) = f (0). 2 Assumption 3.2. E[(wt−1 + wt−1 )(ka(Xt−1 )k2 + ka(Xt−1 )k3 )] < ∞. Assumption 3.3. The matrix E[g(Yt p , β0 )g(Yt p , β0 )0 ] is positive definite. Assumption 3.4. (i) There exists a constant γ > 2 such that E[ka∗ (Xt−1 )kγ ] < ∞. 8 (ii) Let vt := sign(et )a∗ (Xt−1 ). Then the sequence {vt : t ∈ Z} is strong mixing P 1−2/γ with mixing coefficients αl that satisfy ∞ < ∞. l=1 αl The maximum EL estimator β̂n,k is defined by −ln,k (β̂n,k , β̂n,k ) = sup{−ln,k (β, β)} , β∈B and the consistency with corresponding rate of convergence of this statistic are given in the following theorem. Theorem 3.1. Suppose that Assumptions 3.1-3.4 hold and define k ∗ := rn for some r ∈ (0, 1). Then, under the null hypothesis H0 , we have, as n → ∞,  β̂n,k∗ − β0 = Op n−1/2 . As seen from Theorem 3.1, Tn is not accurate for small k and n − k as the result does not hold if k/n = o(1) or (n − k)/n = o(1). In addition, the ELR statistic is not computable for small k and n − k. For this reason, we consider in the following discussion the trimmed and weighted-version of EL ratio test statistic, defined by k Pn,k , (3.1) T̃n := 2 max h k1n ≤k≤k2n n where h is a given weight function, k1n := r1 n, k2n := r2 n and 0 < r1 < r2 < 1. If T̃n takes a significant large value, we have enough reason to reject the null hypothesis H0 of no change point. We also need a further assumption to control a remainder terms in the stochastic expansion of T̃n . Assumption 3.5. sup0<r<1 h(r)2 < ∞. With this additional assumption the limit distribution of the test statistic ( 3.1) can be derived in the following theorem. Theorem 3.2. Suppose that Assumptions 3.1-3.5 hold. Then, under the null hypothesis H0 of no change point n o 2 L T̃n − → T := sup r−1 (1 − r)−1 h(r) B(r) − rB(1) + h(r)B(1)0 QB(1) (3.2) r1 ≤r≤r2 9 as n → ∞. Here {B(r) : r ∈ [0, 1]} is an m-dimensional vector of independent Brownian motions and the matrix Q is defined by Q = Im×m − Ω−1/2 GΣG0 Ω−1/2 , (3.3) where A1/2 denotes the square root of a nonnegative definite matrix A, G = G(β0 ) = ∂g(β0 )/∂β 0 , Σ = (G0 Ω−1 G)−1 and 1 Ω := E[g(Yt p , β0 )g(Yt p , β0 )0 ] = E[a∗ (Xt−1 )a∗ (Xt−1 )0 ]. 4 (3.4) A test for the hypotheses in ( 2.2) is now easily obtained by rejecting the null hypothesis in ( 2.2) whenever T̃n > q1−α , (3.5) where q1−α is the (1 − α)-quantile of the distribution of the random variable T defined on the right-hand side of equation ( 3.2) (using an appropriate estimate of the matrix Q). Theorem 3.3. Suppose that Assumptions 3.1-3.5 and the alternative H1 : θ1 6= θ2 hold. Then we have P T̃n − →∞ as n → ∞. Theorem 3.3 shows that the power of the test ( 3.5) approaches 1 at any fixed alternative. In other words, the test is consistent. 4 Finite sample properties In this section, we illustrate the finite sample properties of the ELR test ( 3.5) for the hypothesis ( 2.2) by means of small simulation study. For this purpose we consider the AR(1) model yt = βyt−1 + et , 10 where the coefficient β satisfies ( β= θ1 (t = 1, . . . , k ∗ ) θ2 (t = k ∗ + 1, . . . , n) . For the calculation of the ELR statistic T̃n in ( 3.1), we use the functions a(x) = x and h(r) = r(1 − r) throughout this section. Following Ling (2005), the self-weights are chosen as ( 1 (dt−1 = 0) wt−1 = , 3 (c/dt−1 ) (dt−1 6= 0) where dt−1 = |yt−1 |I(|yt−1 | > c) and c is the 95%-quantile of the sample {y0 , y1 , . . . , yn }. The trimming parameters in the definition of the statistic T̃n are chosen as r1n = 0.1 and r2n = 0.9. The critical value in ( 3.5) is obtained as the empirical 95% quantile of the Monte-Carlo samples   2 (l) (l) max B (k/n) − (k/n)B (1) : l = 1, . . . , 1000 , k1n ≤k≤k2n where B (1) (·), . . . , B (1000) (·) are independent standard Brownian motions (note that in this case, the matrix in ( 3.3) is given by Q = 0). In Figures 1-3, we display the rejection probabilities of the ELR test ( 3.5) for the hypothesis ( 2.2), where the nominal level is chosen as α = 0.05. The horizontal and vertical axes show, respectively, the values of θ2 and the rejection rate of the hypothesis H0 : θ1 = θ2 at this point (θ1 is fixed as 0.3). The sample sizes are given by n = 100, 200 and 400 and the distribution of the innovation process is a standard normal distribution (Figure 1), a t-distribution with 2 degrees of freedom (Figure 2) and a Cauchy distribution (Figure 3). We also consider two values of the parameter r in the definition of the change point k ∗ = rn, that is r = 0.5 and r = 0.8. We observe that for small sample sizes, the test is slightly conservative and that the approximation of the nominal level improves with increasing sample size. The alternatives are rejected with reasonable probabilities, where the power is larger in the case r = 0.5 than for r = 0.8. A comparison of the different distributions in Figures 1-3 shows that the power is lower for standard normal distributed innovations, while 11 an error process with a Cauchy distribution yields the largest rejection probabilities. Other simulations show a similar picture, and the results are omitted for the sake of brevity. Figure 1: Simulated rejection probabilities of the ELR test ( 3.5) in the AR(1) model with normal distributed innovations. (a) θ1 = 0.3, r = 0.5 (b) θ1 = 0.3, r = 0.8 rejection rate ▮ △ ▮ △ ▮ △ ▮ △ ▮ ○ △ ○ ○ ○ ▮ rejection rate 1.0 ▮ ▮ ▮ △ △ ○ 0.6 ▮ ○ △0.4 ○ ▮ △ ○ n = 100 △ n = 200 ▮ n = 400 △ ○0.2 ▮ ▮ 1.0 ▮ ▮ ▮ ○ 0.8 0.6 ○ ○ -1.0 ○ n = 100 △ n = 200 ▮ n = 400 α = 0.05 △ ▮ ○ △ ○ θ2 ▮ 0.4 △ ○ ○ 1.0 △ ▮ △ ○ ○ 0.5 ▮ ▮ △ △ △ ○ △ ▮ ▮ ○ ○ △ ▮ ○ ○ △ △ ○ ○ -0.5 ▮ △ α = 0.05 ○ ○ -1.0 ▮ △ △ ▮ ○ ▮ △ ▮ 0.8 △ ▮ △ ▮ △ ▮ 0.2▮ △ △ ○ ○ ○ △ ▮ ▮ △ ○ △ △ ▮ ▮ ○ ○ ○ △ ○ △ ○ △ ○ ○ ▮ 0.5 -0.5 1.0 θ2 Figure 2: Simulated rejection probabilities of the ELR test ( 3.5) in the AR(1) model with t-distributed innovations. (a) θ1 = 0.3, r = 0.5 (b) θ1 = 0.3, r = 0.8 rejection rate ▮ ▮ ▮ △ ○ △ ○ △ ▮ △ ▮ ○ △ ▮ △ ○ ○ ▮ △ ▮ △ ○ rejection rate 1.0 ▮ ▮ ▮ △ ○ 0.4 △ ○ 0.2 ○ △ ○ △ △ ▮ ▮ ○ △ △ ○ ○ ○ ▮ △ ○ 0.5 ▮ ▮ 1.0 ▮ ○ n = 100 △ n = 200 ▮ n = 400 ○ △ 0.8 0.6 ▮ △ ○ ▮ 0.4 △ ○ ○ ○ 1.0 -1.0 12 -0.5 ○ △ ○ ▮ △ △ ▮ ○ △ ▮ △ ○ ○ ○ ▮ ▮ △ ○ △ ○ △ ○ ○ 0.5 ○ n = 100 △ n = 200 ▮ n = 400 α = 0.05 ▮ △0.2 ○ θ2 ▮ △ △ ○ ▮ ▮ ○ α = 0.05 ▮ ▮ △ ○ ▮ ▮ △ ○ 0.6 ▮ ▮ △ △ △ 0.8 △ -0.5 ▮ △ ○ ▮ ▮ ○ -1.0 ▮ △ ○ 1.0 θ2 Figure 3: Simulated rejection probabilities of the ELR test ( 3.5) in the AR(1) model with Cauchy distributed innovations. (a) θ1 = 0.3, r = 0.5 (b) θ1 = 0.3, r = 0.8 rejection rate ▮ ▮ ▮ ▮ △ ○ △ ○ △ ○ △ ▮ △ ▮ ○ △ ▮ △ ○ ○ ▮ △ ▮1.0 rejection rate ▮ ▮ △ ○ ▮ △ ▮ ▮ △ △ ○ ○ ▮ △ ○ △ ○ △ 0.6 ○ ○ 0.4 △ ▮ ○ -0.5 ▮ △ ▮ △ n = 100 △ n = 200 ▮ n = 400 ▮ 1.0 ▮ ○ 0.8 ○ ○ ○ 0.6▮ △0.4 ○ -1.0 △ ▮ △ ○ θ2 ▮ △ △ ○ 1.0 ▮ △ ▮ ○ 0.5 ▮ ▮ △ ○ △ ○ △ ▮ △ α = 0.05 △ ○ ▮ ○ -1.0 ○ ▮ ○ 0.2 ▮ △ ○ ▮ 0.8 ▮ △ ▮ △ ▮ △ ○ ○ n = 100 △ n = 200 ▮ n = 400 α = 0.05 ○ △ 0.2 ▮ ○ △ ▮ △ ○ ○ ○ ○ △ △ ○ ▮ ○ ○ -0.5 0.5 1.0 θ2 In the second part of this section we compare the new test defined by ( 3.5) with the CUSUM test in Qu (2008) which uses quantile regression. The test statistic for the median in Qu (2008) is defined by SQ0.5 = sup kHλ,n (β̂) − λH1,n (β̂)k, (4.1) λ∈[0,1] where k · k is the sup norm, β̂ is the median regressor, 0 −1/2 Hλ,n = (X X ) [λn] X 0 |yt − Xt−1 β̂|Xt−1 , i=1 and the matrix X is given by X = (X1 , . . . , Xn )0 . In Figures 4-6, we display the rejection probabilities of the test based on the statistic Tn in ( 2.5), T̃n in ( 3.1) and SQ0.5 in ( 4.1) for the hypothesis ( 2.2), where the nominal level is chosen as α = 0.05. The horizontal and vertical axes show, respectively, the values of θ2 and the rejection rate of the hypothesis H : θ1 = θ2 at this point (θ1 is fixed as 0.3). The distribution of the innovation process is a standard normal distribution (Figure 4), a t-distribution with 2 degree of freedom (Figure 5) and a Cauchy distribution (Figure 6) and the sample sizes are given by n = 100, 200 and 400 in each case. Again we consider two different locations for the change point k ∗ corresponding to the values r = 0.5 and r = 0.8. 13 We observe that all tests derived from the three statistics Tn in ( 2.5) (corresponding to the weight function h(r) ≡ 1), T̃n in ( 3.1) (corresponding to the weight function h(r) = r(1 − r)) and SQ0.5 in ( 4.1) are slightly conservative and that the approximation of the nominal level improves with increasing sample size [see Figure 4-6 for the value θ2 = θ1 = 0.3]. The approximation is usually more accurate for r = 0.5. Next we compare the power of the different tests (i.e. θ2 6= θ1 = 0.3) for different distributions of the innovations. In the case of Gaussian innovations all tests shows a similar behavior (see Figure 4) and only if the case n = 200 and r = 0.8 the ELR test based on the (unweighted) statistic Tn shows a better performance as the tests based on T̃n and SQ0.5 . Moreover, for Gaussian innovations all three tests show a remarkable robustness against non-stationarity, that is |θ2 | = 1. In Figure 5 we display corresponding results for t2 -distributed innovations. The differences in the approximation of the nominal level are negligible (θ2 = θ1 = 0.3). If r = 0.5 we do not observe substantial differences in the power between the three tests (independently of the sample size). On the other hand, if r = 0.8 the tests based on ELR statistics T̃n and Tn yield larger rejection probabilities than the test SQ0.5 (see the right part of Figure Figure 5). Interestingly the unweighted test based on Tn shows a better performance than the test based on T̃n in these cases. Again, all tests are robust with respect to non-stationarity. Finally, in Figure 6 we display the rejection probabilities of the three tests for Cauchy distributed innovations, where we again do not observe differences in the approximation of the nominal level (θ2 = θ1 = 0.3). On the other hand the differences in power between the tests based on ELR and quantile regression are remarkable. In all cases the ELR tests based on Tn and T̃n have substantially more power than the test based on SQ0.5 . The ELR test based on the unweighted statistic Tn shows a better performance than the ELR test based on T̃n . This superiority is less pronounced in the case r = 0.5 but clearly visible for r = 0.8. Finally, in contrast to the test based on SQ0.5 the ELR tests based on Tn and T̃n are robust against non-stationarity (i.e. |θ2 | = 1) for Cauchy distributed innovations and clearly detect a change in the parameters in these cases. 14 Figure 4: Simulated rejection probabilities of various change point tests based on the statistics Tn , T̃n and SQ0.5 defined in ( 2.5), ( 3.1) and ( 4.1), respectively. The model is given by an AR(1) model with normal distributed innovations. (i) n = 100 (a) r = 0.5 (b) r = 0.8 rejection rate 1.0 ○ △ ○ △ ○ ▮ ▮ ▮ ▮ △ ○ △ rejection rate ▮ △ 0.8 ▮ ○ △ △ △ ▮ ○ 0.4 ˜ Tn △ Tn ▮ SQ0.5 ○ ▮ △ ○ ▮ △ ○ ▮ △ ○ ▮ △ ○ ▮ △ ○ ▮0.2 △ ○ ▮ △ ○ -1.0 0.5 -0.5 1.0 0.6 ○ ▮ △ α = 0.05 ▮ ▮ ○ ▮ △ ▮ ○ ▮ ▮ △ ○ △ ▮ ○ ▮ △ ○ △ ○ △ ○ △ △ △ ○ ○ 0.6 ▮ ○ 0.8 ○ ▮ θ2 -1.0 ▮ 0.4 △ ○ ˜ Tn △ Tn ▮ SQ0.5 α = 0.05 ▮ ○ 0.2 △ ▮ ○ ▮ △ ○ ▮ △ ○ ○ ▮ ▮ ○ △ ▮ △ ▮ ▮ ▮ ○ ▮ △ ▮ △ ○ △ ○ △ ○ △ ○ △ ○ △ ○ 0.5 -0.5 1.0 θ2 (ii) n = 200 (a) r = 0.5 (b) r = 0.8 rejection rate ▮ △ ○ ○ ▮ ▮ △ ○ △ ○ ▮ △ ○ ▮ △ rejection rate 1.0 ▮ ○ △ ▮ ○ 0.8 0.6 △ ▮ ▮ ○ ○ ▮ ○ ▮0.4 ○ ▮ ○ △ ˜ Tn △ 1.0 △ △ Tn SQ0.5 θ2 -1.0 ○ ˜ Tn △ Tn ▮ SQ0.5 α = 0.05 ○ ▮ △ ▮ ○ 0.2△ ▮ ○ 1.0 ▮ ○ △0.4 ▮ ○ ○ ▮ 0.5 ▮ △ △ -0.5 0.6 ▮ ○ α = 0.05 ▮ ▮ ○ ○ △ ▮ ▮ △ ○ ▮ △ ○ △ △ ○ △ 0.8 △ ▮ ○ 0.2 △ △ ▮ ○ ▮ △ △ -1.0 △ △ △ △ ○ ▮ ○ ▮ ▮ ○ ○ ▮ △ △ ▮ ○ ○ △ △ ○ △ ○ ▮ ▮ ▮ ○ ○ ▮ ▮ △ ○ ▮ △ ○ △ ○ 0.5 -0.5 1.0 θ2 (iii) n = 400 (a) r = 0.5 (b) r = 0.8 rejection rate ▮ ▮ ▮ ▮ ▮ ○ △ ○ △ ○ △ ○ △ ○ △ ○ ▮ △ ○ ▮ △ rejection rate 1.0 △ ○ △ ○ △ ○ ○ ▮ ▮ △ △ ▮ ▮ ○ ▮ △ ○ ▮ ○ △ ▮ ○ ▮ △ ▮ ○ △ ▮ ○ 0.8 ▮ ○ △ △0.6 ▮ ○ ▮ ○ 0.4 0.2 △ -0.5 ˜ Tn △ Tn ▮ SQ0.5 0.5 0.8 △ △0.4 ▮ ○ -1.0 15 -0.5 ˜ Tn △ Tn ▮ SQ0.5 α = 0.05 ▮ △ ○ △ ○ ▮ 1.0 ○ △ ○ △ 0.2○ ▮ θ2 ▮ △ ○ ▮ 0.6 ▮ ○ ▮ ○ △ ▮ ○ △ △ ▮ △ ○ ○ ▮ α = 0.05 △ ▮ ▮ ○ ○ △ ○ ▮ △ △ -1.0 ○ 1.0 ▮ ▮ ○ △ ▮ △ ○ △ ○ ▮ △ ○ 0.5 1.0 θ2 Figure 5: Simulated rejection probabilities of various change point tests based on the statistics Tn , T̃n and SQ0.5 defined in ( 2.5), ( 3.1) and ( 4.1), respectively. The model is given by an AR(1) model with t2 -distributed innovations. (i) n = 100 (a) r = 0.5 (b) r = 0.8 rejection rate rejection rate 1.0 ○ △ ○ △ ○ △ ○ ▮ △ ○ ▮ ▮ △ ○ ▮ ▮ ▮ △ △ ○ ○ △ 0.8 ○ ○ 0.6 ▮ ○ ▮ △ ○ △ △ ○ ▮ △ 0.4 ▮ ○ ▮ ▮ ▮ △ ○ ▮ △ Tn ▮ SQ0.5 0.6 0.5 1.0 θ2 ▮ △ ○ △ ○ ▮ α = 0.05 △ ○ ▮ △ ▮ △ ○ ▮ ○ △ △ ○ ▮ ○ △ △ ▮ △ ○ -0.5 0.8 △ ○ △ ○ ▮ ▮ ○ 0.2▮ -1.0 ▮ ˜ Tn -1.0 ▮ 0.4 △ ○ ▮ ○ ˜ Tn △ Tn ▮ SQ0.5 α = 0.05 ▮ △ ○ △ ○ ▮ 0.2 ▮ △ ○ △ ▮ ○ ▮ ○ △ △ ○ ▮ ○ ▮ ▮ ▮ ○ ▮ △ △ ○ ▮ △ ○ △ ○ △ △ ○ 0.5 -0.5 1.0 θ2 (ii) n = 200 (a) r = 0.5 (b) r = 0.8 rejection rate rejection rate 1.0 △ ○ △ ○ △ ○ ○ △ ○ △ ○ △ ○ ▮ ▮ ▮ ▮ ▮ △ ▮ ▮ ○ ▮ ○ △ ○ ▮ △ 0.8 △ ▮ ○ 0.6 ▮ ▮ ○ △ ▮ ○ △ 0.2 ▮ ○ △ ▮ ○ ˜ Tn △ Tn ▮ SQ0.5 △ 0.4 -1.0 ▮ △ ○ △ △ △ △ ○ ○ ▮ ○ ▮ ○ △ △ 1.0 △ △0.6 ▮ △ ▮ ○ ▮ ▮ ○ 0.4 ○ ▮ △ ▮ ▮ ○ ○ △ △ ○ ▮ △ -0.5 0.5 1.0 θ2 0.8 ▮ ○ ○ α = 0.05 -1.0 △ ○ ▮ △ ○ ▮ △ △ ▮ ○ ˜ Tn △ Tn ▮ SQ0.5 ○ △ α = 0.05 ▮ △ ○0.2 ○ ▮ △ ○ ▮ ▮ ○ ▮ ▮ △ ○ ▮ △ ▮ ○ △ ○ ○ 0.5 -0.5 1.0 θ2 (iii) n = 400 (a) r = 0.5 (b) r = 0.8 rejection rate ○ △ ○ △ ○ △ ○ △ ○ △ ○ △ ○ △ ○ ▮ △ ▮ ▮ ▮ ▮ ▮ ▮ ▮ rejection rate 1.0 ○ ▮ △ 0.8 ▮ ○ △ ▮ ○ 0.6△ ○ ˜ Tn △ Tn ▮ SQ0.5 ▮ ▮ ○ 0.4 -1.0 -0.5 △ ○ △ ▮ ○ ▮ △ ○ ▮ 0.8 ▮ △ ○ ▮ ○ ▮0.4△ ▮ ○ △ ▮ ○ △ 0.2 ▮ ○ △ 0.5 1.0 ▮ △ ○ △ ▮ ○ ▮ ▮ ○ △ △ ○ △ ○ ▮ θ2 -1.0 16 -0.5 ○ ˜ Tn △ Tn ▮ SQ0.5 α = 0.05 ○ ▮ △ 0.2 1.0 △0.6 α = 0.05 △ ○ ○ △ ○ △ ○ △ ○ △ ○ △ △ ▮ ▮ ○ △ ▮ ○ ▮ ▮ △ ▮ ○ ▮ △ △ ○ ○ △ ○ ▮ ▮ ▮ 0.5 1.0 θ2 Figure 6: Simulated rejection probabilities of various change point tests based on the statistics Tn , T̃n and SQ0.5 defined in ( 2.5), ( 3.1) and ( 4.1), respectively. The model is given by an AR(1) model with Cauchy distributed innovations. (i) n = 100 (a) r = 0.5 (b) r = 0.8 rejection rate rejection rate 1.0 ○ △ ○ △ ○ △ ○ ○ △ △ ○ △ ○ ○ △ 0.8 △ ○ ○ △ ○ △ ○ ○ △ 0.6 ▮ ▮ ▮ ▮ ▮ 0.4 △ ▮ ▮ -1.0 ○ △ ○ ▮ △ ▮ ○ ▮0.2△ ○ ▮ △ ▮ ▮ ˜ Tn 0.8 △ ○ △ △ Tn SQ0.5 ○ △ ▮ ▮ α = 0.05 ▮ ○ ▮ ▮ △ ○ ▮ △ ▮ ○ ▮ △ ○ ▮ △ 0.5 1.0 θ2 -1.0 ▮ ▮ △ ○ 0.4 ○ △ ○ ▮ -0.5 △ ○ 0.6 ○ △ ▮ ▮ △ ○ △ ○ ▮ ○ ˜ Tn △ Tn ▮ SQ0.5 ▮ α = 0.05 △ ○ △ ▮ 0.2 ○ △ ▮ △ ○ ○ ○ ○ △ ▮ ▮ △ ○ △ ▮ ▮ ▮ ○ ▮ △ ▮ △ ○ ▮ 0.5 -0.5 1.0 θ2 (ii) n = 200 (a) r = 0.5 (b) r = 0.8 rejection rate △ ○ △ ○ △ ○ △ ○ △ ○ ○ △ ○ △ ○ △ rejection rate 1.0 ○ △ ○ △ △ △ ○ ○ △ ○ △ ○ △ ○ △ △ △ △ ○ ○ ○ 0.8 ○ ▮ ▮ ▮ ▮ ▮ 0.6△ ▮ ▮ ▮ △ ○ ▮0.4 ▮ △ ○ △ ▮ ▮ 0.2 -1.0 ○ ○ ▮ △ ▮ ▮ ▮ ▮ △ Tn ▮ SQ0.5 1.0 1.0 0.8 ○ ▮ △ ○ △ 0.6 ▮ ○ ▮ △ ▮ -1.0 ▮ 0.2 ▮ ˜ Tn △ Tn ▮ SQ0.5 α = 0.05 ▮ ○ ○ ▮ ○ ▮ ○0.4 ▮ ▮ △ ○ ○ △ ○ θ2 △ △ △ ▮ 0.5 -0.5 ˜ Tn α = 0.05 ○ △ ▮ △ ○ ○ ▮ △ ▮ △ ▮ ▮ ○ △ ○ ○ ▮ ▮ ○ △ ▮ ▮ 0.5 -0.5 1.0 θ2 (iii) n = 400 (a) r = 0.5 (b) r = 0.8 rejection rate rejection rate △ ○ △ ○ △ ○ △ ○ △ ○ △ ○ △ ○ △ ○ ○ △1.0 ○ △ ○ △ △ ○ △ ○ △ ○ △ ○ △ ○ △ ○ △ ○ △ ○ △ ○ ○ △ ○ △ △ ○ ○ 0.8 △ ▮ ▮ ▮ ▮ ▮ ▮ ▮ ▮ 0.6 ▮ ▮ ▮ ▮ 0.4 ▮ ▮ ▮ ○ ▮ ○ ▮ △ ˜ Tn △ Tn ▮ SQ0.5 ○ ▮ △ ▮ ▮ 1.0 θ2 0.4 ▮ ▮ -1.0 17 ▮ △ -0.5 ▮ ▮ ○ ▮ ▮ 0.5 ▮ △ ○ 0.6○ ▮ α = 0.05 △ ▮ ○ △ ▮ -0.5 △ △ ○ △ ○ ○ △ ○ 0.8 ○ 0.2 -1.0 1.0 △ 0.2 ▮ ▮ ▮ △ ○ ▮ △ ○ ▮ ˜ Tn △ Tn ▮ SQ0.5 α = 0.05 ▮ △ ○ ▮ 0.5 ○ 1.0 θ2 5 Proofs This section gives rigorous proofs of all results in this paper. In what follows, C will denote a generic positive constant that varies in different places. “with probability approaching one” will be abbreviated as w.p.a.1. Moreover, we use the following notations throughout this section: gi (β) = g(Yi p , β), g(β) = E[g(Yi p , β)], k P̂k1 (β, λ) = 2 P̂n,k (β, η) 1X log{1 − λ0 gi (β)}, k i=1 n X 1 = log{1 − η 0 gj (β)}, n − k j=k+1 Λ̂1k (β) = {λ ∈ Rm : |λ0 gi (β)| < 1 for all i = 1, . . . , k} , Λ̂2n,k (β) = {η ∈ Rm : |η 0 gj (β)| < 1 for all j = k + 1, . . . , n} , n n 1X 1X p g(Yi , β) = gi (β), ĝ(β) = n i=1 n i=1 k ĝk1 (β) 5.1 1X = gi (β) k i=1 and 2 ĝn,k (β) n X 1 gj (β). = n − k j=k+1 Proof of Theorem 3.1 We start proving several auxiliary results which are required in the proof of Theorem 3.1. Lemma 5.1. Suppose that Assumption 3.4 (i) holds. For 1/γ < ζ < 1/2, let Λn,k = {(λ, η) ∈ R2m : kλk ≤ Ck −ζ , kηk ≤ C(n − k)−ζ }. Then, as n → ∞, we have sup β∈B,λ∈Λn,k∗ P max |λ0 gi (β)| − → 0, 1≤i≤k∗ sup β∈B,η∈Λn,k∗ Also, Λn,k∗ ⊂ Λ̂1k∗ (β) × Λ̂2n,k∗ (β) for all β ∈ B w.p.a.1. 18 max k∗ +1≤j≤n P |η 0 gj (β)| − → 0. Proof. Let bi = supβ∈B kgi (β)k. By Assumption 3.4 (i), we can choose γ > 2 such that K = E[bγ1 ]1/γ is finite. Then, for any δ > 0, we can define M (δ) = K/δ 1/γ and obtain ∗ P  max∗ bi ≥ M (δ)k ∗ 1/γ 1≤i≤k  ≤ k X ∗  P bi ≥ M (δ)k ∗ 1/γ  = i=1 ≤ k∗ X i=1 k X P (bγi ≥ M (δ)γ k ∗ ) i=1 E[bγi ] = δ. M (δ)γ k ∗ Consequently, maxi bi = Op (k ∗ 1/γ ) and by the Cauchy-Schwartz inequality we have sup β∈B,λ∈Λn,k∗ max |λ0 gi (β)| ≤ sup kλk max∗ bi = Op (k ∗ −ζ+1/γ ), 1≤i≤k∗ 1≤i≤k λ∈Λn,k∗ which implies sup P max∗ |λ0 gi (β)| − → 0. β∈B,λ∈Λn,k∗ 1≤i≤k Similarly, it follows that sup β∈B,η∈Λn,k∗ max k∗ +1≤j≤n P |η 0 gj (β)| − → 0. Therefore, Λn,k∗ ⊂ Λ̂1k∗ (β) × Λ̂2n,k∗ (β) for all β ∈ B w.p.a.1, which completes the proof of Lemma 5.1. Lemma 5.2. Suppose that Assumptions 3.1 – 3.4 hold, and there exists a sequence {β n,k∗ } ⊂ B such that P ∗ −1/2 2 β n,k∗ − → β0 , ĝk1∗ (β n,k∗ ) = Op (k ∗ −1/2 ) and ĝn,k ) ∗ (β n,k ∗ ) = Op ((n − k ) as n → ∞. Denote β n,k∗ by β. Then, under H0 , λ := arg max P̂k1∗ (β, λ) and λ∈Λ̂1k∗ (β) η := arg max η∈Λ̂2n,k∗ (β) 2 P̂n,k ∗ (β, η) exist w.p.a.1. Moreover, as n → ∞ we have λ = Op (k ∗ −1/2 ), η = Op ((n − k ∗ )−1/2 ), 2 ∗ −1 P̂k1∗ (β, λ) = Op (k ∗ −1 ), P̂n,k ). ∗ (β, η) = Op ((n − k ) 19 Proof. We only show the statement for λ, the corresponding statement for η follows by similar arguments. Since Λn,k∗ is a closed set, it follows that λ̌ := arg max P̂k1∗ (β, λ) λ∈Λn,k∗ exists (note that P̂k∗ (β, λ) is a concave function of λ). From Lemma 5.1 it follows that P̂k1∗ (β, λ) is continuously twice differentiable with respect to λ w.p.a.1. By a Taylor expansion at λ = 0m , there exists a point λ̇ on the line joining λ̌ and 0m such that 0 = P̂k1∗ (β, 0m ) ≤ P̂k1∗ (β, λ̌) k∗ h1 X i 1 = −λ̌0 ĝk1∗ (β) + λ̌0 ∗ ρ1i (λ̇)gi (β)gi (β)0 λ̌, 2 k i=1 (5.1) where ρ1i (λ) = −1/(1 − λ0 gi (β))2 . Note that the definition of gi (β) implies 1 gi (β)gi (β)0 = a∗ (Xi−1 )a∗ (Xi−1 )0 4 for any β ∈ B. By Lemma 5.1 we have ρ1i (λ̇) ≥ −C uniformly with respect to i w.p.a.1. Furthermore, the ergodicity of {Xt : t ∈ Z} implies that the random variable k∗ X 1 ∗ −1 Ω̂k∗ := (4k ) a∗ (Xi−1 )a∗ (Xi−1 )0 i=1 converges to Ω in probability. Hence the minimum eigenvalue of Ω̂1k∗ is bounded away from 0 w.p.a.1. and we obtain ∗ −λ̌0 ĝk1∗ (β) k i 1 0h 1 X 1 C + λ̌ ∗ ρi (λ̇)gi (β)gi (β)0 λ̌ ≤ kλ̌k kĝk1∗ (β)k − λ̌Ω̂1k∗ λ̌ 2 k i=1 2 ≤ kλ̌kkĝk1∗ (β)k − Ckλ̌k2 w.p.a.1. Dividing both sides of ( 5.2) by kλ̌k, we get kλ̌k = Op (k ∗ −1/2 ) = op (k ∗ −ζ ), 20 (5.2) and hence λ̌ ∈ Int(Λ̂1k∗ ) w.p.a.1. Again by Lemma 5.1, the concavity of P̂k1∗ (β, λ) and the convexity of Λ̂1k∗ (β), it follows that λ = λ̌ exists w.p.a.1 and λ = Op (k ∗ −1/2 ). These results also imply that P̂k1∗ (β, λ) = Op (k ∗ −1 ). By similar arguments, we can 2 show the corresponding results for η and P̂n,k ∗ (β, η). Next, let us consider the estimator β̂n,k of Theorem 3.1. Recall that β̂n,k is the minimizer of ln,k (β, β) = k sup P̂k1 (β, λ) + (n − k) λ∈Λ̂1k (β) sup 2 P̂n,k (β, η). η∈Λ̂2n,k (β) Let us define 2 P̂n,k (β, λ, η) := k P̂k1 (β, λ) + (n − k)P̂n,k (β, η) (5.3) and λ̂n,k := arg max λ∈Λ̂1k (β̂n,k ) P̂k1 (β̂n,k , λ), η̂n,k := arg max η∈Λ̂2n,k (β̂n,k ) 2 P̂n,k (β̂n,k , η). (5.4) Lemma 5.3. Suppose that Assumptions 3.1 – 3.4 hold. Then, under the null hypothesis H0 of no change point we have 2 ∗ −1/2 ĝk1∗ (β̂n,k∗ ) = Op (k ∗ −1/2 ), ĝn,k ) ∗ (β̂n,k ∗ ) = Op ((n − k ) as n → ∞. l Proof. Define ĝˆn,k := ĝ l (β̂n,k ) for l = 1, 2, 1 1 λ̃n,k := −k −1/2 ĝˆn,k /kĝˆn,k k, 2 2 η̃n,k := −(n − k)−1/2 ĝˆn,k /kĝˆn,k k, (5.5) then it follows from ( 5.4) that 2 2 (β̂n,k , η̃n,k ) ≤ P̂n,k (β̂n,k , η̂n,k ), P̂k1 (β̂n,k , λ̃n,k ) ≤ P̂k1 (β̂n,k , λ̂n,k ) and P̂n,k which implies the inequality P̂n,k (β̂n,k , λ̃n,k , η̃n,k ) ≤ P̂n,k (β̂n,k , λ̂n,k , η̂n,k ). 21 (5.6) By similar arguments as used in ( 5.1) and ( 5.2) we have 1 ∗ 1/2 ˆ2 P̂n,k∗ (β̂n,k∗ , λ̃n,k∗ , η̃n,k∗ ) ≥ k ∗ 1/2 kĝˆn,k kĝn,k∗ k − c0 ∗ k + (n − k ) (5.7) w.p.a.1, where c0 is the same constant as in the proof of Lemma 5.2. On the other hand, we have the following inequality: P̂n,k (β̂n,k , λ̂n,k , η̂n,k ) = inf β∈B ≤ sup P̂n,k (β, λ, η) λ∈Λ̂1k (β̂n,k ), η∈Λ̂2n,k (β̂n,k ) sup P̂n,k (β0 , λ, η) λ∈Λ̂1k (β0 ), η∈Λ̂2n,k (β0 ) ≤ k sup P̂k1 (β0 , λ) + (n − k) λ∈Λ̂1k (β0 ) sup 2 P̂n,k (β0 , η). (5.8) η∈Λ̂2n,k (β0 ) Applying Lemma 5.2 with β n,k∗ = β0 yields sup P̂k1∗ (β0 , λ) = Op (k ∗ −1 ), λ∈Λ̂1k∗ (β0 ) sup 2 ∗ −1 P̂n,k ), ∗ (β0 , η) = Op ((n − k ) (5.9) η∈Λ̂2n,k∗ (β0 ) and from ( 5.8) and ( 5.9), we get P̂n,k∗ (β̂n,k∗ , λ̂n,k∗ , η̂n,k∗ ) = Op (1). (5.10) Finally, from ( 5.6), ( 5.7) and ( 5.10), we have 1 ∗ 1/2 ˆ2 −c0 ≤ −c0 + k ∗ 1/2 kĝˆn,k kĝn,k∗ k ≤ P̂n,k∗ (β̂n,k∗ , λ̂n,k∗ , η̂n,k∗ ) = Op (1), ∗ k + (n − k ) which implies 1 1 ∗ −1/2 2 2 ∗ −1/2 kĝˆn,k ) and kĝˆn,k ), ∗ k = kĝn,k ∗ (β̂n,k ∗ )k = Op ((n−k ) ∗ k = kĝk ∗ (β̂n,k ∗ )k = Op (k establishing the assertion of Lemma 5.3. Proof. [Proof of Theorem 3.1] By Lemma 5.3 we have ĝ(β̂n,k∗ ) = op (1). Then, it follows from the triangular inequality and uniform law of large numbers that kg(β̂n,k∗ )k ≤ kg(β̂n,k∗ ) − ĝ(β̂n,k∗ )k + kĝ(β̂n,k∗ )k 22 ≤ sup kg(β) − ĝ(β)k + kĝ(β̂n,k∗ )k = op (1). β∈B Since g(β) has a unique zero at β0 , the function kg(β)k must be bounded away from zero outside any neighborhood of β0 . Therefore, β̂n,k∗ must be inside any P neighborhood of β0 w.p.a.1. and therefore, β̂n,k∗ − → β0 . Next, we show that β̂n,k∗ − β0 = Op (n−1/2 ). As k ∗ = rn, by Lemma 5.3, we have n o 2 ĝ(β̂n,k∗ ) = n−1 k ∗ ĝk1∗ (β̂n,k∗ ) + (n − k ∗ )ĝn,k = Op (n−1/2 ) ∗ (β̂n,k ∗ ) and the central limit theorem implies h n oi ĝ(β0 ) = Op n−1 k ∗ 1/2 + (n − k ∗ )1/2 = Op (n1/2 ). Further, kĝ(β̂n,k∗ ) − ĝ(β0 ) − g(β̂n,k∗ )k ≤ (1 + √ nkβ̂n,k∗ − β0 k)op (n−1/2 ), (5.11) which yields kg(β̂n,k∗ )k ≤ kĝ(β̂n,k∗ ) − ĝ(β0 ) − g(β̂n,k∗ )k + kĝ(β̂n,k∗ )k + kĝ(β0 )k h n oi √ = (1 + nkβ̂n,k∗ − β0 k)op (n−1/2 ) + Op n−1 k ∗ 1/2 + (n − k ∗ )1/2 . Moreover, similar arguments as given in Newey and McFadden (1994) on page 2191, the differentiability of kg(β)k and the estimate kg(β̂n )k ≥ Ckβ̂n − β0 k w.p.a.1. show that h n oi √ kβ̂n,k∗ − β0 k = (1 + nkβ̂n,k∗ − β0 k)op (n−1/2 ) + Op n−1 k ∗ 1/2 + (n − k ∗ )1/2 , and hence h n oi {1 + op (1)}kβ̂n,k∗ − β0 k = op (n−1/2 ) + Op n−1 k ∗ 1/2 + (n − k ∗ )1/2 . (5.12) If k ∗ = rn the right-hand side of ( 5.12) is of order Op (n−1/2 ), which completes the proof of Theorem 3.1. 23 5.2 Proof of Theorem 3.2 We first show that P̂n,k∗ (β, λ, η) in ( 5.3) is well approximated by some function near its optima using a similar reasoning as in Parente and Smith (2011). For this purpose let us define 1 L̂1k (β, λ) = {−G(β − β0 ) − ĝk1 (β0 )}0 λ − λ0 Ωλ, 2 1 2 2 0 L̂n,k (β, η) = {−G(β − β0 ) − ĝn,k (β0 )} η − η 0 Ωη 2 and L̂n,k (β, λ, η) := k L̂1k (β, λ) + (n − k)L̂2n,k (β, η). Furthermore, hereafter redefine β̃n,k := arg min sup β∈B λ∈Rm ,η∈Rm λ̃n,k := arg max L̂1k (β̃, λ) m λ∈R L̂n,k (β, λ, η), and η̃n,k := arg max L̂2n,k (β̃, η). m η∈R Lemma 5.4. Suppose that Assumptions 3.1-3.4 hold. Then, under H0 , P̂n,k∗ (β̂n,k∗ , λ̂n,k∗ , η̂n,k∗ ) = L̂n,k∗ (β̃n,k∗ , λ̃n,k∗ , η̃n,k∗ ) + op (1) as n → ∞. Proof. It is sufficient to show that (i) P̂n,k∗ (β̂n,k∗ , λ̂n,k∗ , η̂n,k∗ ) − L̂n,k∗ (β̂n,k∗ , λ̂n,k∗ , η̂n,k∗ ) = op (1), (ii) L̂n,k∗ (β̂n,k∗ , λ̂n,k∗ , η̂n,k∗ ) − L̂n,k∗ (β̃n,k∗ , λ̂n,k∗ , η̂n,k∗ ) = op (1), (iii) L̂n,k∗ (β̃n,k∗ , λ̂n,k∗ , η̂n,k∗ ) − L̂n,k∗ (β̃n,k∗ , λ̃n,k∗ , η̃n,k∗ ) = op (1). For a proof of (i) we note that a Taylor expansion leads to k P̂k1 (β̂n,k , λ̂n,k ) = 1 −λ̂0n,k ĝˆn,k i 1 0 h1 X 1 ∗ ∗ 0 + λ̂n,k ρ (λ̈)a (Xi−1 )a (Xi−1 ) λ̂n,k , 2 k i=1 i 24 where λ̈ is on the line joining the points λ̂n,k and 0m . Observing the definition of L̂1 (β̂n,k , λ̂n,k ) this yields the estimate  0 1 P̂k1 (β̂n,k , λ̂n,k ) − L̂1 (β̂n,k , λ̂n,k ) ≤ − ĝˆn,k − ĝk1 (β0 ) − G(β̂ − β0 ) λ̂n,k (5.13) k + i 1 0 h1 X 1 ∗ ∗ 0 λ̂ ρ̇ a (Xi−1 )a (Xi−1 ) + Ω λ̂n,k . 2 n,k k i=1 i P Since β̂n,k∗ − → β0 by Theorem 3.1, we can take β n,k∗ = β̂n,k∗ in Lemma 5.2, and obtain λ̂n,k∗ = Op (n−1/2 ). Then, recalling ( 5.11), the first term in ( 5.13) (where k is replaced by k ∗ ) becomes  0 1 1 − ĝˆn,k λ̂n,k∗ ∗ − ĝk ∗ (β0 ) − G(β̂n,k ∗ − β0 ) n o 1 1 ∗ ∗ ∗ ≤ ĝˆn,k − ĝ λ̂n,k∗ (β ) − g( β̂ ) + g( β̂ ) − G( β̂ − β ) ∗ 0 n,k n,k n,k 0 k∗ n   2 o √ = 1 + n β̂n,k∗ − β0 op (n−1/2 ) + Op β̂n,k∗ − β0 Op (n−1/2 ) =op (n−1 ). Moreover, the second term in ( 5.13) is of order op (k ∗ −1 ). Hence, we get P̂k1∗ (β̂n,k∗ , λ̂n,k∗ ) − L̂1 (β̂n,k , λ̂n,k∗ ) = op (k ∗ −1 ) and similarly 2 2 ∗ −1 P̂n,k ). ∗ (β̂n,k ∗ , η̂n,k ∗ ) − L̂ (β̂n,k ∗ , η̂n,k ∗ ) = op ((n − k ) Combining these estimates yields P̂n,k∗ (β̂n,k∗ , λ̂n,k∗ , η̂n,k∗ ) − L̂n,k∗ (β̂n,k∗ , λ̂n,k∗ , η̂n,k∗ ) = op (1), which is the statement (i). For a proof of (ii) we first show P̂n,k∗ (β̃n,k∗ , λ̂n,k∗ , η̂n,k∗ ) − L̂n,k∗ (β̃n,k∗ , λ̂n,k∗ , η̂n,k∗ ) = op (1). Note that the function L̂n,k (β, λ, η) is smooth in β, λ and η. Then, the first order conditions for an interior global maximum 0p = ∂ L̂n,k (β, λ, η) = −G0 {kλ + (n − k)η} , ∂β 25  ∂ L̂n,k (β, λ, η) = −k G(β − β0 ) + ĝk1 (β0 ) + Ωλ , ∂λ  ∂ L̂n,k (β, λ, η) 2 0m = = −(n − k) G(β − β0 ) + ĝn,k (β0 ) + Ωη ∂η 0m = 0 0 ). These conditions can be , λ̃0n,k , η̃n,k are satisfied for the point (β 0 , λ0 , η 0 ) = (β̃n,k rewritten in matrix form as      Op×p G0 G0 β̃n,k − β0 0p     1  k −1 Ω Om×m k λ̃n,k  G   +  ĝk (β0 )  = 0p+2m . (5.14) 2 G Om×m (n − k)−1 Ω (n − k)η̃n,k ĝn,k (β0 ) With the notations Σ := (G0 Ω−1 G)−1 , H := Ω−1 GΣ, n−k k 2 := Ω−1 − HΣ−1 H 0 , Pk1 := Ω−1 − HΣ−1 H 0 , Pn,k n n the system ( 5.14) is equivalent to   β̃n,k − β0   k λ̃n,k   (n − k)η̃n,k    0p n−1 Σ −kn−1 H 0 −(n − k)n−1 H 0    =  −kn−1 H −kPk1 k(n − k)n−1 HΣ−1 H 0   ĝk1 (β0 )  2 2 ĝn,k (β0 ) −(n − k)n−1 H k(n − k)n−1 HΣ−1 H 0 −(n − k)Pn,k   −H 0 ĝ(β0 )   = (5.15) −k {Ω−1 ĝk1 (β0 ) − HΣ−1 H 0 ĝ(β0 )} .  −1 2 −(n − k) Ω ĝn,k (β0 ) − HΣ−1 H 0 ĝ(β0 ) Consequently, β̃n,k∗ − β0 , λ̃n,k∗ and η̃n,k∗ are of order Op (n−1/2 ), Op (k ∗ −1/2 ) and Op ((n − k ∗ )−1/2 ), respectively. Therefore, by the same arguments as given in the proof of (i), it follows that |P̂n,k∗ (β̃n,k∗ , λ̂n,k∗ , η̂n,k∗ ) − L̂n,k∗ (β̃n,k∗ , λ̂n,k∗ , η̂n,k∗ )| = op (1). 26 0 0 0 0 0 0 0 0 This relationship and the fact that (β̂n,k ∗ , λ̂n,k ∗ , η̂n,k ∗ ) and (β̃n,k ∗ , λ̃n,k ∗ , η̃n,k ∗ ) are the saddle points of the functions P̂n,k∗ (β, λ, η) and L̂n,k∗ (β, λ, η), respectively, imply that L̂n,k∗ (β̂n,k∗ , λ̂n,k∗ , η̂n,k∗ ) = P̂n,k∗ (β̂n,k∗ , λ̂n,k∗ , η̂n,k∗ ) + op (1) ≤ P̂n,k∗ (β̃n,k∗ , λ̂n,k∗ , η̂n,k∗ ) + op (1) = L̂n,k∗ (β̃n,k∗ , λ̂n,k∗ , η̂n,k∗ ) + op (1). (5.16) On the other hand, L̂n,k∗ (β̃n,k∗ , λ̂n,k∗ , η̂n,k∗ ) ≤ L̂n,k∗ (β̃n,k∗ , λ̃n,k∗ , η̃n,k∗ ) ≤ L̂n,k∗ (β̂n,k∗ , λ̃n,k∗ , η̃n,k∗ ) = P̂n,k∗ (β̂n,k∗ , λ̃n,k∗ , η̃n,k∗ ) + op (1) ≤ P̂n,k∗ (β̂n,k∗ , λ̂n,k∗ , η̂n,k∗ ) + op (1) = L̂n,k∗ (β̂n,k∗ , λ̂n,k∗ , η̂n,k∗ ) + op (1). (5.17) Thus, ( 5.16) and ( 5.17) lead to L̂n,k∗ (β̂n,k∗ , λ̂n,k∗ , η̂n,k∗ ) − L̂n,k∗ (β̃n,k∗ , λ̂n,k∗ , η̂n,k∗ ) = op (1). Finally, we can prove (iii) by similar arguments that L̂n,k∗ (β̃n,k∗ , λ̃n,k∗ , η̃n,k∗ ) ≤ L̂n,k∗ (β̂n,k∗ , λ̃n,k∗ , η̃n,k∗ ) = P̂n,k∗ (β̂n,k∗ , λ̃n,k∗ , η̃n,k∗ ) + op (1) ≤ P̂n,k∗ (β̂n,k∗ , λ̂n,k∗ , η̂n,k∗ ) + op (1) ≤ P̂n,k∗ (β̃n,k∗ , λ̂n,k∗ , η̂n,k∗ ) + op (1) = L̂n,k∗ (β̃n,k∗ , λ̂n,k∗ , η̂n,k∗ ) + op (1) and L̂n,k∗ (β̃n,k∗ , λ̂n,k∗ , η̂n,k∗ ) ≤ L̂n,k∗ (β̃n,k∗ , λ̃n,k∗ , η̃n,k∗ ). Consequently, L̂n,k∗ (β̃n,k∗ , λ̂n,k∗ , η̂n,k∗ ) = L̂n,k∗ (β̃n,k∗ , λ̃n,k∗ , η̃n,k∗ )+op (1), which implies (iii). 27 Proof. [Proof of Theorem 3.2] By ( 5.3), ( 5.4), Lemma 5.4 and ( 5.15) it follows that sup{−ln,k∗ (β, β)} = P̂n,k∗ (β̂n,k∗ , λ̂n,k∗ , η̂n,k∗ ) β∈B = L̂n,k∗ (β̃n,k∗ , λ̃n,k∗ , η̃n,k∗ ) + Rn,k∗ n − k∗ 0 k∗ η̃n,k∗ Ωη̃n,k∗ + Rn,k∗ + op (1) = λ̃0n,k∗ Ωλ̃n,k∗ + 2 2 k∗ n − k∗ 2 2 = ĝk1∗ (β0 )0 Ω−1 ĝk1∗ (β0 ) + ĝn,k∗ (β0 )0 Ω−1 ĝn,k ∗ (β0 ) 2 2 n − ĝ(β0 )0 HΣ−1 H 0 ĝ(β0 ) + Rn,k∗ + op (1) 2 = M̂n,k∗ + Rn,k∗ + op (1), (5.18) where M̂n,k Ŵn (k/n) − (k/n)Ŵn (1) = 2φ(k/n) 2 + Ŵn (1)0 QŴn (1) , 2 [rn] 1 X −1/2 Ω g(Yt p , β0 ), Ŵn (r) = √ n t=1 Rn,k = P̂n,k (β̂n,k , λ̂n,k , η̂n,k ) − L̂n,k (β̃n,k , λ̃n,k , η̃n,k ), φ(u) = u(1 − u) and [x] denotes the integer part of real number x. As shown in Lemma 5.4, max |Rn,k∗ | = sup |Rn,rn | = op (1). ∗ k1n ≤k ≤k2n r1 ≤r≤r2 Second, from Assumption 3.4 and Lemma 2.2 in Phillips (1987), it follows that n o L c0 Ŵn (r) : r ∈ [0, 1] − → {c0 B(r) : r ∈ [0, 1]} , for any vector c ∈ Rm , where {B(r) : r ∈ [0, 1]} is an m-dimensional standard Brownian motion. Hence, the Cramér-Wold device and the continuous mapping theorem lead to n k o M̂n,k T̃n = 2 max h k1n ≤k≤k2n n n h(k/n) o 2 = sup Ŵn (r) − ([rn]/n)Ŵn (1) + h([rn]/n)Ŵn (1)0 QŴn (1) k1n /n≤r≤k2n /n φ(k/n) 28 L − → sup r1 ≤r≤r2 5.3 n h(r) φ(r) o kB(r) − rB(1)k + h(r)B(1) QB(1) . 2 0 Proof of Theorem 3.3 Proof. Without loss of generality, suppose that θ2 6= β0 . This implies that there exist a neighborhood U (β0 ) of β0 and a neighborhood U (θ2 ) of θ2 such that U (β0 ) ∩ U (θ2 ) = ∅. Under the alternative it follows that β̂n,k∗ 6∈ U (β0 ) or β̂n,k∗ 6∈ U (θ2 ). Note that E[g(Ytp , θ2 )] 6= 0 for 1 ≤ t ≤ k ∗ and E[g(Ytp , β0 )] 6= 0 for k ∗ + 1 ≤ t ≤ n. From a 2 uniform law of large numbers, ĝk1∗ (β̂n,k∗ ) or ĝn,k ∗ (β̂n,k ∗ ) is outside a neighborhood of 0 for any sufficiently large n. 2 2 Now, if we consider ĝk1 (β̂n,k∗ ) instead of ĝk1 (β0 ) and ĝn,k (β̂n,k∗ ) instead of ĝn,k (β0 ) in ( 5.14), we find, as in ( 5.18), that supβ∈B {−ln,k∗ (β, β)} can be approximated by n − k∗ 2 k∗ 1 2 ĝk∗ (β̂n,k∗ )0 Ω−1 ĝk1∗ (β̂n,k∗ ) + ĝn,k∗ (β̂n,k∗ )0 Ω−1 ĝn,k ∗ (β̂n,k ∗ ) 2 2 n − ĝ(β̂n,k∗ )0 HΣ−1 H 0 ĝ(β̂n,k∗ ) + Rn,k∗ + op (1). 2 This time, however, we have k∗ 1 n − k∗ 2 2 ĝk∗ (β̂n,k∗ )0 Ω−1 ĝk1∗ (β̂n,k∗ ) + ĝn,k∗ (β̂n,k∗ )0 Ω−1 ĝn,k ∗ (β̂n,k ∗ ) → ∞, 2 2 2 0 −1 2 since ĝk1∗ (β̂n,k∗ )0 Ω−1 ĝk1∗ (β̂n,k∗ ) + ĝn,k ĝn,k∗ (β̂n,k∗ ) > 0 for any sufficiently ∗ (β̂n,k ∗ ) Ω large n. This completes the proof of Theorem 3.3. Acknowledgements. The authors would like to thank Martina Stein who typed this manuscript with considerable technical expertise. The work of authors was supported by JSPS Grant-in-Aid for Young Scientists (B) (16K16022), Waseda University Grant for Special Research Projects (2016S-063) and the Deutsche Forschungsgemeinschaft (SFB 823: Statistik nichtlinearer dynamischer Prozesse, Teilprojekt A1 and C1). 29 References Andrews, D. W. (1993). Tests for parameter instability and structural change with unknown change point. Econometrica: Journal of the Econometric Society 61 (4), 821–856. Aue, A. and L. Horváth (2013). Structural breaks in time series. Journal of Time Series Analysis 34 (1), 1–16. Bai, J. (1993). On the partial sums of residuals in autoregressive and moving average models. Journal of Time Series Analysis 14, 247–260. Bai, J. (1994). Convergence of the sequential empirical processes of residuals in ARMA models. Annals of Statistics 22 (4), 2051–2061. Baragona, R., F. Battaglia, D. Cucina, et al. (2013). Empirical likelihood for break detection in time series. Electronic Journal of Statistics 7, 3089–3123. Berkes, I., Horváth, S. Ling, and J. Schauer (2011). Testing for structural change of AR model to threshold AR model. Journal of Time Series Analysis 32 (5), 547–565. Chen, K., Z. Ying, H. Zhang, and L. Zhao (2008). Analysis of least absolute deviation. Biometrika 95 (1), 107–122. Chuang, C.-S. and N. H. Chan (2002). Empirical likelihood for autoregressive models, with applications to unstable time series. Statistica Sinica 12, 387–407. Ciuperca, G. and Z. Salloum (2015). Empirical likelihood test in a posteriori change-point nonlinear model. Metrika 78, 919–952. Cressie, N. and T. R. Read (1984). Multinomial goodness-of-fit tests. Journal of the Royal Statistical Society. Series B (Methodological) 46 (3), 440–464. Csörgö, M. and L. Horváth (1997). Limit Theorems in Change-Point Analysis. John Wiley. Davis, R. A., D. Huang, and Y.-C. Yao (1995). Testing for a change in the parameter values and order of an autoregressive model. Annals of Statistics 23 (1), 282–304. Gombay, E. and L. Horváth (1990). Asymptotic distributions of maximum likelihood tests for change in the mean. Biometrika 77 (2), 411–414. Lee, S., J. Ha, O. Na, and S. Na (2003). The cusum test for parameter change in time series models. Scandinavian Journal of Statistics 30 (4), 781–796. Ling, S. (2005). Self-weighted least absolute deviation estimation for infinite variance autoregressive models. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 67 (3), 381–393. Newey, W. K. and D. McFadden (1994). Large sample estimation and hypothesis testing. 30 Handbook of Econometrics 4, 2111–2245. Nolan, J. P. (2015). Stable Distributions - Models for Heavy Tailed Data. Boston: Birkhauser. In progress, Chapter 1 online at academic2.american.edu/∼jpnolan. Owen, A. B. (1988). Empirical likelihood ratio confidence intervals for a single functional. Biometrika 75 (2), 237–249. Page, E. S. (1954). Continuous inspection schemes. Biometrika 41 (1/2), 100–115. Page, E. S. (1955). Control charts with warning lines. Biometrika 42(1-2), 243–257. Pan, J., H. Wang, and Q. Yao (2007). Weighted least absolute deviations estimation for ARMA models with infinite variance. Econometric Theory 23 (05), 852–879. Parente, P. M. and R. J. Smith (2011). GEL methods for nonsmooth moment indicators. Econometric Theory 27 (01), 74–113. Phillips, P. C. (1987). Time series regression with a unit root. Econometrica 55 (2), 277– 301. Qin, J. and J. Lawless (1994). Empirical likelihood and general estimating equations. The Annals of Statistics 22 (1), 300–325. Qu, Z. (2008). Testing for structural change in regression quantiles. Journal of Econometrics 146 (1), 170–184. Samoradnitsky, G. and M. S. Taqqu (1994). Stable non-Gaussian Random Processes: Stochastic Models with Infinite Variance, Volume 1. CRC Press. Su, L. and Z. Xiao (2008). Testing for parameter stability in quantile regression models. Statistics & Probability Letters 78 (16), 2768–2775. Zhou, M., H. J. Wang, and Y. Tang (2015). Sequential change point detection in linear quantile regression models. Statistics & Probability Letters 100, 98–103. 31
10math.ST
Feedback Generation for Performance Problems in Introductory Programming Assignments ∗ Sumit Gulwani Ivan Radiček Microsoft Research, USA TU Wien, Austria arXiv:1403.4064v2 [cs.PL] 17 Sep 2014 sumitg@microsoft.com radicek@forsyte.at Florian Zuleger TU Wien, Austria zuleger@forsyte.at ABSTRACT General Terms Providing feedback on programming assignments manually is a tedious, error prone, and time-consuming task. In this paper, we motivate and address the problem of generating feedback on performance aspects in introductory programming assignments. We studied a large number of functionally correct student solutions to introductory programming assignments and observed: (1) There are different algorithmic strategies, with varying levels of efficiency, for solving a given problem. These different strategies merit different feedback. (2) The same algorithmic strategy can be implemented in countless different ways, which are not relevant for reporting feedback on the student program. We propose a light-weight programming language extension that allows a teacher to define an algorithmic strategy by specifying certain key values that should occur during the execution of an implementation. We describe a dynamic analysis based approach to test whether a student’s program matches a teacher’s specification. Our experimental results illustrate the effectiveness of both our specification language and our dynamic analysis. On one of our benchmarks consisting of 2316 functionally correct implementations to 3 programming problems, we identified 16 strategies that we were able to describe using our specification language (in 95 minutes after inspecting 66, i.e., around 3%, implementations). Our dynamic analysis correctly matched each implementation with its corresponding specification, thereby automatically producing the intended feedback. Algorithms, Languages, Performance. Categories and Subject Descriptors D.2.5 [SOFTWARE ENGINEERING]: Testing and Debugging; I.2.2 [ARTIFICIAL INTELLIGENCE]: Automatic Programming—Automatic analysis of algorithms ∗ The second and third author were supported by the Vienna Science and Technology Fund (WWTF) grant ICT12-059. 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 the author(s) 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 Permissions@acm.org. SIGSOFT/FSE’14, November 16 - 22 2014, Hong Kong, China Copyright is held by the owner/author(s). Publication rights licensed to ACM. ACM 978-1-4503-3056-5/14/11 ...$15.00. http://dx.doi.org/10.1145/2635868.2635912. Keywords Education, MOOCs, performance analysis, trace specification, dynamic analysis. 1. INTRODUCTION Providing feedback on programming assignments is a very tedious, error-prone, and time-consuming task for a human teacher, even in a standard classroom setting. With the rise of Massive Open Online Courses (MOOCs) [15], which have a much larger number of students, this challenge is even more pressing. Hence, there is a need to introduce automation around this task. Immediate feedback generation through automation can also enable new pedagogical benefits such as allowing resubmission opportunity to students who submit imperfect solutions and providing immediate diagnosis on class performance to a teacher who can then adapt her instruction accordingly [9]. Recent research around automation of feedback generation for programming problems has focused on guiding students to functionally correct programs either by providing counterexamples [25] (generated using test input generation tools) or generating repairs [21]. However, non-functional aspects of a program, especially performance, are also important. We studied several programming sessions of students who submitted solutions to introductory C# programming problems on the Pex4Fun [4] platform. In such a programming session, a student submits a solution to a specified programming problem and receives a counterexample based feedback upon submitting a functionally incorrect attempt (generated using Pex [24]). The student may then inspect the counterexample and submit a revised attempt. This process is repeated until the student submits a functionally correct attempt or gives up. We studied 24 different problems, and observed that of the 3993 different programming sessions, 3048 led to functionally correct solutions. However, unfortunately, on average around 60% of these functionally correct solutions had (different kinds of) performance problems. In this paper, we present a methodology for semiautomatically generating appropriate performance related feedback for such functionally correct solutions. From our study, we made two observations that form the basis of our semi-automatic feedback generation methodology. (i) There are different algorithmic strategies with varying levels of efficiency, for solving a given problem. Algo- rithmic strategies capture the global high-level insight of a solution to a programming problem, while also defining key performance characteristics of the solution. Different strategies merit different feedback. (ii) The same algorithmic strategy can be implemented in countless different ways. These differences originate from local low-level implementation choices and are not relevant for reporting feedback on the student program. In order to provide meaningful feedback to a student it is important to identify what algorithmic strategy was employed by the student program. A profiling based approach that measures running time of a program or use of static bound analysis techniques [10, 11] is not sufficient for our purpose, because different algorithmic strategies that necessitate different feedback may have the same computational complexity. Also, a simple pattern matching based approach is not sufficient because the same algorithmic strategy can have syntactically different implementations. Our key insight is that the algorithmic strategy employed by a program can be identified by observing the values computed during the execution of the program. We allow the teacher to specify an algorithmic strategy by simply annotating (at the source code level) certain key values computed by a sample program (that implements the corresponding algorithm strategy) using a new language construct, called observe. Fortunately, the number of different algorithmic strategies for introductory programming problems is often small (at most 7 per problem in our experiments). These can be easily enumerated by the teacher in an iterative process by examining any student program that does not match any existing algorithmic strategy; we refer to each such step in this iterative process as an inspection step. We propose a novel dynamic analysis that decides whether the student program (also referred to as an implementation) matches an algorithm strategy specified by the teacher in the form of an annotated program (also referred to as a specification). Our dynamic analysis executes a student’s implementation and the teacher’s specification to check whether the key values computed by the specification also occur in the corresponding traces generated from the implementation. We have implemented the proposed framework in C# and evaluated our approach on 3 pre-existing programming problems on Pex4Fun (attempted by several hundreds of students) and on 21 new problems that we hosted on Pex4Fun as part of a programming course (attempted by 47 students in the course). Experimental results show that: (i) The manual teacher effort required to specify various algorithmic strategies is a small fraction of the overall task that our system automates. In particular, on our MOOC style benchmark of 2316 functionally correct implementations to 3 pre-existing programming problems, we specified 16 strategies in 95 minutes after inspecting 66 implementations. On our standard classroom style benchmark of 732 functionally correct implementations to 21 programming problems, we specified 66 strategies in 266 minutes after inspecting 149 implementations. (ii) Our methodology for specifying and matching algorithmic strategies is both expressive and precise. In particular, we were able to specify all 82 strategies using our specification language and our dynamic analysis correctly matched each implementation with the intended strategy. This paper makes the following contributions: • We observe that there are different algorithmic strategies used in functionally correct attempts to introductory programming assignments; these strategies merit different performance related feedback. • We describe a new language construct, called observe, for specifying an algorithmic strategy (§3). • We describe a dynamic analysis based approach to test whether a student’s implementation matches the teacher’s specification (§4). • Our experimental results illustrate the effectiveness of our specification language and dynamic analysis (§6). 2. OVERVIEW In this section we motivate our problem definition and various aspects of our solution by means of various examples. 2.1 Motivation Fig. 1 shows our running examples. Programs (a)-(i) (IM) show some sample implementations for the anagram problem (which involves testing whether the two input strings can be permuted to become equal) on the Pex4Fun platform. All 9 programs are examples of inefficient implementations, because of their quadratic asymptotic complexity. An efficient solution, for example, is to first collect (e.g. in an array) the number of occurrences of each character in both strings and then compare them, leading to linear asymptotic complexity. Algorithmic strategies. In implementations IM we identify three different algorithmic strategies. Implementations C1-C3 iterate over one of the input strings and for each character in that string count the occurrences of that character in both strings (counting strategy). Implementations S1-S3 sort both input strings and check if they are equal (sorting strategy). Implementations R1-R3 iterate over one of the input strings and remove corresponding characters from the other string (removing strategy). Implementation details. An algorithmic strategy can have several implementations. In case of counting strategy: Implementation C1 calls manually implemented method countChar to count the number of characters in a string (lines 5 and 6), while implementation C2 uses a special C# construct (lines 6 and 7) and implementation C3 uses the library function Split for that task (lines 4 and 5). In case of the sorting strategy: Implementation S1 employs binary insertion sort, while implementation S2 employs bubble sort and implementation S3 uses a library call (lines 4 and 5). We also observe different ways of removing a character from a string in implementations R1-R3. Desired feedback. Each of the three identified strategies requires separate feedback (independent of the underlying implementation details), to help a student understand and fix the performance issues. For the first strategy (implementations C1-C3), a possible feedback might be: ”Calculate the number of characters in each string in a preprocessing phase, instead of each iteration of the main loop”; for the second strategy (S1-S3), it might be: ”Instead of sorting input strings, compare the number of character occurrences in each string”; and for the third strategy (R1-R3): ”Use a more efficient data-structure to remove characters”. 2.2 Specifying Algorithmic Strategies Key values. Our key insight is that different implementations that employ the same algorithmic strategy generate the same key values during their execution on the same input. 1 1 bool Puzzle(string s, string t) { 2 2 if (s.Length != t.Length) 3 3 return false; 4 4 else 5 5 return s.All(c => 6 s.Where(c2 => c2 == c).Count() == 6 7 t.Where(c2 => c2 == c).Count() 7 8 8 ); 9 9 } 10 (b) Counting/Library (C2) 11 1 bool Puzzle(string s, string t) { 12 2 if(s.Length != t.Length) return false; 13 3 foreach (var item in s) { 14 4 if(s.Split(item).Length 15 5 != t.Split(item).Length) 16 17 6 return false; 18 7 } 8 return true; } 19 (a) Counting/Manual (C1) (c) Counting/Split (C3) 1 bool Puzzle(string s, string t) { bool Puzzle(string s, string t) { 1 if (s.Length != t.Length) return false; 2 var sa = s.ToCharArray(); 2 3 var ta = t.ToCharArray(); char[] sa = s.ToCharArray(); 3 4 Array.Sort(sa); char[] ta = t.ToCharArray(); 4 5 Array.Sort(ta); for (int j=0; j < sa.Length; j++) { 5 6 return sa.SequenceEqual(ta);} for (int i=0; i<sa.Length - 1;i++) { 6 if (sa[i]<sa[i+1]){ char temp=sa[i]; (f) Sorting/Library (S3) 7 sa[i]=sa[i+1]; sa[i+1]=temp;} 8 1 bool Puzzle(string s, string t) { 9 if (ta[i]<ta[i+1]){ char temp=ta[i]; 2 if (s.Length != t.Length) return false; 10 ta[i] = ta[i+1]; ta[i+1] = temp;} 3 foreach (char c in t.ToCharArray()) { 11 }} 4 int index = s.IndexOf(c); 12 for (int k = 0; k < sa.Length; k++) { 5 if (index < 0) return false; 13 6 s = s.Remove(index, 1); } if (sa[k] != ta[k]) return false; } 14 return true; } 7 return true; } (e) Sorting/Bubble (S2) (g) Removing/Library (R1) 1 Puzzle(string s, string t) { 1 2 if (nd1) { string tt = t; t = s; s = tt; } 2 bool Puzzle(string s, string t) { 3 for (int i = 0; i < s.Length; ++i) { 3 char[] sc = s.ToCharArray(); 4 int cnt1 = 0, cnt2 = 0; 4 char[] tc = t.ToCharArray(); 5 for (int j = 0; j < s.Length; ++j) { 5 Char c = ’#’; 6 if (s[j] == s[i]) { 6 if(sc.Length!=tc.Length) return false; 7 if (nd2) observe(s[j]); 7 for(int i=0;i<sc.Length;i++) { 8 cnt1++; c = sc[i]; 9 }} 1 for(int j=0;j<tc.Length;j++) { 10 if (!nd2) observeFun(Split()); 2 if(tc[j]==c){ 11 observe(nd2 ? cnt1 : cnt1 + 1); 3 tc[j]=’#’; 12 for (int j = 0; j < t.Length; ++j) { 4 13 if (t[j] == s[i]) { break;} 5 14 if (nd2) observe(t[j]); if(j==tc.Length-1) { 6 15 cnt2++; return false; }}} 7 16 }} return true; } 8 17 if (!nd2) observeFun(Split()); 9 18 observe(nd2 ? cnt2 : cnt2 + 1); }} (i) Removing/Manual (R3) (j) Counting Specification (CS) bool Puzzle(string s, string t) { 1 if(s.Length != t.Length) return false; 2 Char[] taux = t.ToCharArray(); 3 for(int i = 0; i < s.Length; i++) { 4 1 bool CompareLetterString (string a,string b){5 Char sc = s[i]; 2 var la = a.Where(x=>char.IsLetter(x)); Boolean exists = false; 6 3 var lb = b.Where(x=>char.IsLetter(x)); for(int j = 0; j < t.Length; j++) { 7 4 return la.SequenceEqual(lb); if(sc == taux[j]) { 8 5 } exists = true; taux[j] = ’ ’; 9 break; }} 10 11 if(exists == false) return false; } 12 return true; } (m) Removing/Manual 2 (R4) (n) Custom Data Equality (CDE) 1 1 void Puzzle(string s, string t) { bool Puzzle(string s, string t) { 2 2 if (nd1){string tt = t; t = s; s = tt;} if (s.Length != t.Length) 3 int[] cs = new int[256],ct = new int[256]; 3 return false; 4 4 cover(ToCharArray()); char[] cs = s.ToCharArray(); 5 5 cover(ToCharArray()); char[] ct = t.ToCharArray(); 6 6 cover(255); int[] hash = new int[256]; 7 7 for (int i = 0; i < s.Length; ++i) { for (int i=0; i<255; ++i) { 8 8 cs[(int)s[i]]++; hash[i] = 0; 9 9 observe(cs); } } 10 foreach (char ch in cs) { 10 for (int i = 0; i < t.Length; ++i) { hash[(int)ch]++; } 11 11 if (nd2) { cs[(int)t[i]]--; foreach (char ch in ct) { 12 12 observe(cs); hash[(int)ch]--; } 13 13 } else { ct[(int)t[i]]++; for (int i=0; i<255; ++i) { 14 observe(ct); 14 if (hash[i] < 0) 15 } 15 return false; } 16 } 16 return true; } 17 cover(255); } 17 1 bool Puzzle(string s, string t) { 2 if (s.Length != t.Length) return false; 3 4 foreach (Char ch in s.ToCharArray()){ 5 if (countChars(s, ch) 6 != countChars(t, ch)){ 7 return false; 8 }} 9 return true;} 10 11 int countChars(String s, Char c){ 12 int number = 0; 13 14 foreach (Char ch in s.ToCharArray()){ 15 if (ch == c){ 16 number++; 17 }} 18 return number;} 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 (p) Efficient/Difference (E2) (q) Efficient Specification (ES) int BinarySearch(List<char> xs, char y) { int low = 0, high = xs.Count; while (low < high) { int mid = (high - low) / 2 + low; if (y < xs[mid]) high = mid; else if (y > xs[mid]) low = mid + 1; else return mid;} return low;} char[] Sort(string xs) { var res = new List<char>(); foreach (var x in xs) { var pos = BinarySearch(res, x); res.Insert(pos, x);} return res.ToArray(); } bool Puzzle(string s, string t) { return String.Join("", Sort(s)) == String.Join("", Sort(t)); } (d) Sorting/Binary Insertion (S1) bool Puzzle(string s, string t) { return IsPermutation(s, t); } bool IsPermutation(String s, string t) { if (s == t) return true; if (s.Length != t.Length) return false; int index = t.IndexOf(s[0]); if (index == -1) return false; s = s.Substring(1); t = t.Remove(index, 1); return IsPermutation(s, t); } (h) Removing/Recursive (R2) Puzzle(string s, string t) { if (nd1) s = s.ToUpperInvariant(); char[] ca = s.ToCharArray(); Array.Sort(ca); if (nd2) Array.Reverse(ca); observe(ca); } (k) Sorting Specification (SS) Puzzle(string s, string t) { if (nd1) {string tt = t; t = s; s = tt;} for (int i = 0; i < s.Length; ++i) { if (s.Substring(i) == t) return; int ni = nd2 ? i : s.Length - i - 1; int k = nd3 ? t.IndexOf(s[ni]) : t.LastIndexOf(s[ni]); t = t.Remove(k, 1); observe(t, CompareLetterString); }} (l) Removing Specification (RS) bool Puzzle(string s, string t) { if (s.Length !=t.Length) return false; int [] cs=new int [256]; int [] ct=new int [256]; for(int i=0;i<s.Length;i++) cs[(int) s[i]]++; for(int i=0;i<t.Length;++i) ct[(int) t[i]]++; for (int i=0;i<256;i++) if(cs[i] != ct[i]) return false; return true; } (o) Efficient/Compare (E1) bool Puzzle(string s, string t) { if (s.Length != t.Length) return false; string cp = t; for(int i=0; i<s.Length; i++) { char k = s[i]; bool found = false; for(int j=0; j<cp.Length; j++) { if (cp[j] == k) { if (j == 0) { cp = (Char)0+cp.Substring(1) ;} else if(j == cp.Length - 1) { cp = cp.Substring(0, j)+(Char)0;} else { cp = cp.Substring(0, j) + (Char) 0 + cp.Substring(j + 1);} found = true; break; }} if (!found) return false; } return true; } (r) Removing/Separate computation (R5) Figure 1: Running example: Implementations and Specifications of Anagram assignment. For example, (the underlined expressions in) the implementations C1 and C2 both produce the key value sequence (a, b, a, 2, b, a, a, 2, a, b, a, 1, b, a, a, 1, a, b, a, 2, b, a, a, 2) on the input strings “aba” and “baa”. Our framework allows a teacher to describe an algorithmic strategy by simply annotating certain expressions in a sample implementation using a special language statement observe. Our framework decides whether or not a student implementation matches a teacher specification by comparing their execution traces on common input(s). We say that an implementation Q matches a specification P , if (1) the execution trace of P is a subsequence of the execution trace of Q, and (2) for every observed expression in P there is an expression in Q that has generated the same values. We call this matching criterion a trace embedding. The notion of trace embedding establishes a fairly strong connection between specification and implementation: basically, both programs produce the same values at corresponding locations in the same order. Our notion of trace embedding is an adaptation of the notion of a simulation relation [16] to dynamic analysis. Non-deterministic choice. Because of minor differences between implementations of the same strategy, keyvalues can differ. For example, implementation C3 uses a library function to obtain the number of characters, while implementations C1 and C2 explicitly count them by explicitly iterating over the string. Moreover, counted values in C3 are incremented by one compared to those in C1 and C2. C3 thus yields a different, but related, trace (Split, 3, Split, 3, Split, 2, Split, 2, Split, 3, Split, 3) on input strings ”aba” and ”baa”. To address variations in implementation details, we include a non-deterministic choice construct in our specification language. The non-determinism is fixed before the execution; thus such a choice is merely a syntactic sugar to succinctly represent multiple similar specifications (n non-deterministic variables = 2n specifications). Specifications. CS, SS, and RS denote the specifications for the counting strategy (used in implementations C1-C3), sorting strategy (used in S1-S3), and removing strategy (used in R1-R3) respectively. In CS, the teacher observes the characters that are iterated over (lines 7 and 14), the results of counting the characters (lines 11 and 18), and use of library function Split (lines 10 and 17). Also the teacher uses non-deterministic Boolean variables: nd1 (line 2) to choose the string over which the main loop iterates (as the input strings are symmetric in the anagram problem); and nd2 to choose between manual and library function implementations (which also decides on observed counted values on lines 18 and 11). In SS the teacher observes one of the input strings after sorting, and non-deterministically allows that implementations convert input string to uppercase (nd1 on line 2), and sort the string in reverse order (nd2 on line 5). Notice that it is enough to observe only one sorted input, as in the case that the input strings are anagrams, the sorted strings are the same. In RS the teacher observes the string with removed characters and non-deterministcally chooses which string is iterated (nd1 on line 2), direction of the iteration (nd2 on line 5) and the direction in which the remove candidate is searched for (nd3 on line 6). 3. SPECIFICATIONS AND IMPLEMENTATIONS Expression e ::= d | v | v1 opbin v2 | opun v | v1 [v2 ] Statement s ::= | | | | v := e | v1 [v2 ] := e | v := f(v1 , . . . , vn ) s0 ; s1 | while v do s | skip if v then s0 else s1 observe(v, [E]) observeFun(f[v1 , . . . , vn ], [E]) Figure 2: The syntax of L language. In this section we introduce an imperative programming language L that supports standard constructs for writing implementations, and has some novel constructs for writing specifications. 3.1 The Language L The syntax of the language L is stated in Fig. 2. We discuss the features of the language below. Expressions. A data value d is any value from some data domain set D, which contains all values in the language (e.g., in C#, all integers, characters, arrays, hashsets, ...). A variable v belongs to a (finite) set of variables Var . An expression is either a data value d, a variable v, an operator applied to variables v1 , v2 or an array access v1 [v2 ]. Here, opbin represents a set of binary operators (e.g., +, ·, =, <, ∧) and opun a set of unary operators (e.g., ¬, | · |). We point out that the syntax of L ensures that programs are in three address code: operators can only be applied to variables, but not to arbitrary expressions. The motivation for this choice is that three address code enables us to observe any expression in the program by observing only variables. We point out that any program can be (automatically) translated into three address code by assigning each subexpression to a new variable. For example, the statement v1 := v2 + (a + b) can be translated into three-address code as follows: v3 := a + b; v1 := v2 + v3 . This enables us to observe the subexpression a + b by observing v3 . Statements. The statements of L allow to build simple imperative programs: assignments (to variables and array elements), skip statement, composition of statements, looping and branching constructs. We also allow library function calls in L, denoted by v := f(v1 , . . . , vn ), where f ∈ F is a library function name, from a set of all library functions F . There are two special observe constructs, which are only available to the teacher (and not to the student). We discuss the observe statements in §3.3 below. We assume that each statement s is associated with a unique program location ℓ, and write ℓ : s. Functions. For space reasons we do not define functions here. We could easily extend the language to (recursive) functions. In fact we allow (recursive) functions in our implementation. Semantics. We assume some standard imperative semantics to execute programs written in the language L (e.g., for C# we assume the usual semantics of C#). The two observe statements have the same semantic meaning of the skip statement. Computation domain. We extend the data domain D by a special symbol ?, which we will use to represent any data value. We define the computation domain Val associated with our language L as Val = D ∪ (F × D∗ ). We assume the data domain D is equipped with some equality relation =D ⊆ D × D (e.g., for C# we have (x, y) ∈ =D iff a and b are of the same type and comparison by the equals method returns true). We denote by E = 2Val ×Val the set of all relations over Val. We define a default equality relation Edef ∈ E as follows: We have (x, y) ∈ Edef iff x =? or y =? or (x, y) ∈=D . We have ((f, x1 , . . . , xn ), (f′ , y1 , . . . , yn )) ∈ Edef iff f = f′ and (xi , yi ) ∈ Edef for all 1 ≤ i ≤ n. Computation trace. A (computation) trace γ over some finite set of (programming) locations Loc is a finite sequence of location-value pairs (Loc × Val)∗ . We use the notation ΓLoc to denote the set of all computation traces over Loc. Given some γ ∈ ΓLoc and Loc ′ ⊆ Loc, we denote by γ|Loc′ the sequence that we obtain by deleting all pairs (ℓ, val ) from γ, where ℓ 6∈ Loc ′ . strings — to define value representations of both implementations, regardless of used characters, as equal. We call a function δ : Loc → E a comparison function. We define δ(ℓ) = E for every statement ℓ : observe(v, E) or ℓ : observeFun(f[v1 , . . . , vn ], E). For statements, where [E] has been left out, we set the default value δ(ℓ) = Edef . Non-deterministic choice. We assume that the teacher can use some finite set of non-deterministic Boolean variables B = {nd 1 , . . . , nd n } ⊆ Var (these are not available to the student). Non-deterministic choice allows the teacher to specify variations in implementations, as discussed in §2. Non-deterministic variables are similar to the input variables, in the sense that are assigned before program is executed. We note that this results into 2n different program behaviors for a given input. 3.2 Student Implementation 4. MATCHING In the following we describe how a computation trace γ is generated for a student implementation Q on a given input σ. The computation trace is initialized to the empty sequence γ = ǫ. Then the implementation is executed on σ according to the semantics of L. During the execution we append location-value pairs to γ for every assignment statement: For ℓ : v1 := e or ℓ : v1 [v2 ] := e we append (ℓ, σ(v1 )) to γ (we denote by σ(v1 ) the current value of v1 ). We point out that we add the complete array σ(v1 ) to the trace for an assignment to an array variable v1 . For a library function call ℓ : v := f(v1 , . . . , vn ) we append (ℓ, (f, σ(v), σ(v1 ), . . . , σ(vn ))) to γ. We denote the resulting trace γ by JQK(σ). This construction of a computation trace can be achieved by instrumenting the implementation in an appropriate manner. 3.3 Teacher Specification The teacher uses observe and observeFun for specifying the key values she wants to observe during the execution of the specification and for defining an equality relation over computation domain. As usual the rectangular brackets ‘[’ and ‘]’ enclose optional arguments. In the following we describe how a computation trace γ is generated for a specification P on a given input σ. The computation trace is initialized to the empty sequence γ = ǫ. Then the specification is executed according to the semantics of L. During the execution we append location-value pairs to γ only for observe and observeFun statements: For ℓ : observe(v, [E]) we append (ℓ, σ(v)) to γ (we denote by σ(v) the current value of v). For ℓ : observeFun(f[v1 , . . . , vn ], [E]) we append (ℓ, (f, x1 , . . . , xn )) to γ, where xi = σ(vi ), if the ith argument to f has been specified, and xi =?, if it has been left out. We denote the resulting trace γ by JP K(σ). Custom data equality. The possibility of specifying an equality relation E ∈ E at some location ℓ is very useful for the teacher. We point out that in practice the teacher has to specify E by an equality function (Val × Val) → {true, false}. The teacher can use E to define the equality of similar computation values. We show its usage on examples R3 and R4 (Fig. 1); both examples implement the removing strategy (discussed in §2) in almost identical ways — the only difference is on lines 10 and 9, respectively, where implementations use different characters to denote a character removed from a string: ’#’ and ’ ’. In specification RS the teacher uses the equality function CompareLetterString (defined in CDE) — which compares only letters of two In this section, we define what it means for an implementation to (partially) match or fully match a specification and describe the corresponding matching algorithms. The teacher has to determine for each specification which definition of matching has to be applied. In case of partial matching we speak of inefficient specifications and in case of full matching of efficient specifications. 4.1 Trace Embedding We start out by discussing the problem of Trace Embedding that we use as a building block for the matching algorithms. Subsequence. We call c ∈ {partial , full} a matching criterion. Let γ1 = (ℓ1 , val 1 )(ℓ2 , val 2 ) · · · (ℓn , val n ) and γ2 = (ℓ′1 , val ′1 )(ℓ′2 , val ′2 ) · · · (ℓ′m , val ′m ) be two computation traces over some set of locations Loc, and let δ be some comparison function (as defined in §3.3). We say γ1 is a subsequence of γ2 w.r.t. to δ, c, written γ1 ⊑δ,c γ2 , if there are indices 1 ≤ k1 < k2 < · · · < kn ≤ m such that for all 1 ≤ i ≤ n we have ℓi = ℓ′ki and (val i , val ′ki ) ∈ δ(ℓi ); in case of c = full we additionally require that γ1 and γ2 |{ℓ1 ,...,ℓn } have the same length. We refer to (val i , val ′ki ) ∈ δ(ℓi ) as equality check. If δ(ℓi ) = Id (the identity relation over Val ) for all 1 ≤ i ≤ n, we obtain the usual definition of subsequence. Since deciding subsequence, i.e., γ1 ⊑δ,c γ2 , is a central operation in this paper, we state complexity of this decision problem. It is easy to see that deciding subsequence requires only O(m) equality checks; basically one iteration over γ2 is sufficient. Mapping Function. Let Loc 1 and Loc 2 be two disjoint sets of locations. We call an injective function π : Loc 1 → Loc 2 a mapping function. We lift π to a function π : ΓLoc1 → ΓLoc2 by applying it to every location, i.e., we set π(γ) = for γ = (π(ℓ1 ), val 1 )(π(ℓ2 ), val 2 ) · · · (ℓ1 , val 1 )(ℓ2 , val 2 ) · · · ∈ ΓLoc1 . Given a comparison function δ, a matching criterion c, and computation traces γ1 ∈ ΓLoc 1 and γ2 ∈ ΓLoc2 we say that γ1 can be embedded in γ2 by π, iff π(γ1 ) ⊑δ◦π−1 ,c γ2 , and write γ1 ⊑πδ,c γ2 . We refer to π as embedding witness. Executing a program on set of assignments I gives rise to a set of traces, one for each assignment σ ∈ I. We say that the set of traces (γ1,σ )σ∈I can be embedded in (γ2,σ )σ∈I by π iff γ1,σ ⊑πδ,c γ2,σ for all σ ∈ I. Definition 1 (Trace Embedding). Trace Embedding is the problem of deciding for given sets of traces (γ1,σ )σ∈I and (γ2,σ )σ∈I , a comparison function δ, and a matching criterion c, if there is a witness mapping function π, such that γ1,σ ⊑πδ,c γ2,σ for all σ ∈ I. Complexity. Clearly, Trace Embedding is in NP (assuming equality checks can be done in polynomial time): we first guess the mapping function π : Loc 1 → Loc 2 and then check γ1,σ ⊑πδ,c γ2,σ for all σ ∈ I (which is cheap as discussed above). However, it turns out that Trace Embedding is NPcomplete even for a singleton set I, a singleton computation domain Val , and the full matching criterion. Theorem 1. Trace Embedding is NP-complete (assuming equality checks can be done in polynomial time). Proof. In order to show NP-hardness we reduce Permutation Pattern [6] to Trace Embedding. First, we formally define Permutation Pattern. Let n, k be positive integers with k ≤ n. Let σ be a permutation of {1, · · · , n} and let τ be a permutation of {1, · · · , k}. We say τ occurs in σ, if there is an injective function π : {1, · · · , k} → {1, · · · , n} such that π is monotone, i.e., for all 1 ≤ r < s ≤ k we have π(r) < π(s) and π(τ (1)) · · · π(τ (k)) is a subsequence of σ(1)σ(2) · · · σ(n). Permutation Pattern is the problem of deciding whether τ occurs in σ. We now give the reduction of Permutation Pattern to Trace Embedding. We will construct two traces γ1 and γ2 over a singleton computation domain Val, and over the sets of locations Loc 1 = {1, . . . , k} and Loc 2 = {1, . . . , n}. We set δ(i) = Id (the identity function on Val ) for every i ∈ Loc 1 . Because Val is singleton, we can ignore values in the rest of the proof. We set γ1 = 12 · · · kτ (1)τ (2) · · · τ (k) and γ2 = 12 · · · nσ(1)σ(2) · · · σ(n). Because every i ∈ {1, · · · , k} occurs exactly twice in γ1 and γ2 , partial and full matching criteria are equivalent so we can ignore the difference. We now show that τ occurs in σ iff there is an injective function π : Loc 1 → Loc 2 with γ1 ⊑π γ2 . We establish this equivalence by two observations: First, because every i ∈ {1, · · · , k} occurs exactly twice in γ1 and γ2 we have 12 · · · k ⊑π 12 · · · n and τ (1)τ (2) · · · τ (k) ⊑π σ(1)σ(2) · · · σ(n) iff γ1 ⊑π γ2 . Second, 12 · · · k ⊑π 12 · · · n iff π : Loc 1 → Loc 2 is monotone. Algorithm. Fig. 3 shows our algorithm, Embed, for the Trace Embedding problem. A straightforward algorithmic solution for the trace embedding problem is to simply test all possible mapping functions. However, there is an exponential number of such mapping functions w.r.t. to the cardinality of Loc 1 and Loc 2 . This exponential blowup seems unavoidable as the combinatorial search space is responsible for the NP hardness. The core element of our algorithm is a pre-analysis that narrows down the space of possible mapping functions effectively. We observe that if ℓ2 = π(ℓ1 ) and γ1 ⊑πδ,c γ2 , then there exists a trace embedding restricted {ℓ 7→ℓ } to locations ℓ1 and ℓ2 , formally: γ1 |{ℓ1 } ⊑δ,c1 2 γ2 |{ℓ2 } . The algorithm uses this insight to create a (bipartite) graph G ⊆ Loc 1 × Loc 2 of potential mapping pairs in lines 2-7. A pair of locations (ℓ1 , ℓ2 ) ∈ G is a potential mapping pair iff there exists a trace embedding restricted to locations ℓ1 and ℓ2 , as described above. The key idea in finding an embedding witness π is to construct a maximum bipartite matching in G. A maximum bipartite matching has an edge connecting every program 1: Embed((γ1,σ )σ∈I , (γ2,σ )σ∈I , Loc 1 , Loc 2 , δ, c): 2: G ← Loc 1 × Loc 2 3: for all ℓ1 ∈ Loc 1 , ℓ2 ∈ Loc 2 : 4: for all σ ∈ I: {ℓ 7→ℓ } 5: if γ1,σ |{ℓ1 } 6⊑δ,c1 2 γ2,σ |{ℓ2 } : 6: G ← G \ {(ℓ1 , ℓ2 )} 7: break 8: for all π ∈ MaximumBipartiteMatching(G): 9: found ← true 10: for all σ ∈ I: 11: if γ1,σ 6⊑πδ,c γ2,σ : 12: found ← false 13: break 14: if found = true: return true 15: return false Figure 3: Algorithm for Trace Embedding problem. location from Loc 1 to a distinct location in Loc 2 and thus gives rise to an injective function π. We point out that such an injective function π does not need to be an embedding witness, because, by observing only a single location pair at a time, it ignores the order of locations. Thus, for each maximum bipartite matching [26] π the algorithm checks (in lines 8-14) if it is indeed an embedding witness. The key strength of our algorithm is that it reduces the search space for possible embedding witnesses π. The experimental evidence shows that this approach significantly reduces the number of possible matchings and enables a very efficient algorithm in practice, as discussed in §6. 4.2 Partial Matching We now define the notion of partial matching (also referred to simply as matching) which is used to check whether an implementation involves (at least) those inefficiency issues that underlie a given inefficient specification. Definition 2 (Partial Matching). Let P be a specification with observed locations Loc 1 , let δ be the comparison function specified by P , and let Q be an implementation whose assignment statements are labeled by Loc 2 . Then implementation Q (partially) matches specification P , on a set of inputs I, if and only if there exists a mapping function π : Loc 1 → Loc 2 and an assignment to the non-deterministic variables σnd such that γ1,σ ⊑πδ,c γ2,σ , for all input values σ ∈ I, where γ1,σ = JP K(σ ∪ σnd ), γ2,σ = JQK(σ) and c = partial . Fig. 4 describes an algorithm for testing if an implementation (partially) matches a given specification over a given set of input valuations I. In lines 6-7, the implementation Q is executed on all input values σ ∈ I. In line 9, the algorithm iterates through all assignments σnd to the non-deterministic variables BP of the specification P . In lines 10-11, the specification P is executed on all inputs σ ∈ I. With both sets of traces available, line 12 calls subroutine Embed which returns true iff there exists a trace embedding witness. Example. We now give an example that demonstrates our notion of programs and that contains example applications of algorithms Embed and Matches. In Fig. 5 we state two implementations, (a) and (b), and one specification (c). These programs represent simplified versions (transformed into three adress code) of R1 (after function inlining), R3 1: Matches(Specification P, Implementation Q, Inputs I): 2: Loc 1 = observed locations in P 3: δ = comparison function specified by P 4: c = matching criterion 5: Loc 2 = assignment locations of Q 6: for all σ ∈ I: 7: γ2,σ ← JQK(σ) 8: BP = non-deterministic variables in P 9: for all assignments σnd to BP : 10: for all σ ∈ I: 11: γ1,σ ← JP K(σ ∪ σnd ) 12: if Embed((γ1,σ )σ∈I , (γ2,σ )σ∈I , Loc 1 , Loc 2 , δ, c): 13: return true 14: return false Figure 4: Matching algorithm. 1 Puzzle(s, t) { 2 i = 0; 3 n = |s|; 4 while (i < n) { 5 c = s[i]; 6 j = 0; 7 cnt1 = 0; 8 while (j < n) { 9 c2 = s[j]; 10 if (c == c2) { 11 cnt1 = cnt1 + 1; } 12 j = j + 1; } 13 j = 0; 14 cnt2 = 0; 15 while (j < n) { 16 c2 = t[j]; 17 if (c == c2) { 18 cnt2 = cnt2 + 1; } 19 j = j + 1; } 20 i = i + 1; }} 1 Puzzle(s, t) { 2 i = 0; 3 n = |s|; 4 while (i < n) { 5 c = s[i]; 6 ss = Split(s,c); 7 cnt1 = |ss|; 8 st = Split(t,c); 9 cnt2 = |st|; 10 i = i + 1; }} (a) (c) 1 Puzzle(s, t) { 2 i = 0; 3 n = |s|; 4 while (i < n) { 5 c = s[i]; 6 observe(c); 7 j = 0; 8 cnt1 = 0; 9 while (j < n) { 10 c2 = s[j]; 11 if (nd1) 12 observe(c2); 13 j = j + 1; } 14 j = 0; 15 if (!nd1) 16 observeFun(Split()); 17 while (j < n) { 18 c2 = t[j]; (b) 19 if (nd1) 20 observe(c2); 21 j = j + 1; } 22 if (!nd1) 23 observeFun(Split()); 24 i = i + 1; }} Figure 5: Implementations (a), (b) and Spec. (c). and SC (Fig. 1). Note, that every assignment and observe statement is on its own line; we denote line i in program x by by location ℓx,i . The argument [E] has been left out for all locations in the specification, thus we have δ(ℓ) = Edef for all specification locations ℓ. Algorithm Matches runs all three programs on input values s = ”aab” and t = ”aba”. For program (a) we obtain the following computation trace: γa = (ℓa,2 , 0)(ℓa,3 , 3)(ℓa,5 , a)(ℓa,6 , 0)(ℓa,7 , 0)(ℓa,9 , a)(ℓa,11 , 1) (ℓa,12 , 1)(ℓa,9 , a)(ℓa,11 , 2)(ℓa,12 , 2)(ℓa,9 , b)(ℓa,12 , 3)(ℓa,13 , 0) · · · Similarly, for program (b) we obtain: γb = (ℓb,2 , 0)(ℓb,3 , 3)(ℓb,5 , a)(ℓb,6 , (Split, aab, a))(ℓb,7 , 3) (ℓb,8 , (Split, aba, a))(ℓb,9 , 3)(ℓb,10 , 1)(ℓb,5 , a) · · · For specification (c) we obtain two traces, depending on the choice for the non-deterministic variable nd1 : γc,t = (ℓc,6 , a)(ℓc,12 , a)(ℓc,12 , a)(ℓc,12 , b)(ℓc,20 , a)(ℓc,20 , b) · · · γc,f = (ℓc,6 , a)(ℓc,16 , (Split, ?, ?))(ℓc,23 , (Split, ?, ?)) · · · Algorithm Matches then calls Embed to check for trace embedding. Algorithm Embed first constructs a potential graph G, which contains an edge for two locations of the specification and the implementation that show the same values. For implementation (a), we obtain the following graph: Ga = {(ℓc,6 , ℓa,5 ), (ℓc,6 , ℓa,9 ), (ℓc,6 , ℓa,16 ), (ℓc,12 , ℓa,9 ), (ℓc,20 , ℓa,16 )}. Notice that ℓc,6 shows the same values as the locations ℓa,5 , ℓa,9 , ℓa,16 in the implementation (a). However, there is only one maximal matching in Ga , πa = {(ℓc,6 , ℓa,5 ), (ℓc,12 , ℓa,9 ), (ℓc,20 , ℓa,16 )}, which is also an embedding witness; thus implementation (a) matches specification (c). For implementation (b) and nd1 = true, we obtain the graph Gb,t = {(ℓc,6 , ℓb,5 )}, from which we cannot construct a maximal matching. However, for nd1 = false, we obtain Gb,f = {(ℓc,6 , ℓb,5 ), (ℓc,16 , ℓb,6 ), (ℓc,23 , ℓb,8 )}, which is also an embedding witness; thus implementation (b) matches specification (c). 4.3 Full Matching Below we will define the notion of full matching, which is used to match implementations against efficient specifications. We will require that for every loop and every library function call in the implementation there is a corresponding loop and library function call in the matching specification. In order to do so, we need some helper definitions. Observed loop iterations. We extend the construction of the implementation trace (defined in §3.2): For each statement ℓ : while v do s, we additionally append element (ℓ, ⊥) to the trace whenever the loop body s is entered. We call (ℓ, ⊥) a loop iteration. Let π be a embedding witness s.t., γ1 ⊑π γ2 . We say that π observes all loop iterations iff between every two loop iterations (ℓ, ⊥) in γ2 there exists a pair (ℓ′ , val ), such that ∃ℓ′′ .π(ℓ′′ ) = ℓ′ . In other words, we require that between any two iterations of the same loop, there exists some observed location ℓ′ . Observed library function calls. We say that π observes all library function calls iff for every (ℓ, f(val 1 , . . . , val n )) in γ2 there is a ℓ′ such that π(ℓ′ ) = ℓ. Definition 3 (Full Matching). Let P be a specification with observed locations Loc 1 , let δ be the comparison function specified by P , and let Q be an implementation whose assignment statements are labeled by Loc 2 . Then implementation Q fully matches specification P , on a set of inputs I, if and only if there exists a mapping function π : Loc 1 → Loc 2 and an assignment to the non-deterministic variables σnd such that γ1,σ ⊑πδ,c γ2,σ , for all input valuations σ ∈ I, where γ1,σ = JP K(σ ∪ σnd ), γ2,σ = JQK(σ), c = full and π observes all loop iterations and library function calls. We note that procedure Embed (Fig. 3) can easily check at line 11 whether the current mapping π observes all loop iterations and library function calls. It is tedious for a teacher to exactly specify all possible loop iterations and library function calls used in different efficient implementations. We add two additional constructs to the language L to simplify this specification task. Cover statement. We extend L by two cover statements: ℓ : cover(f[v1 , . . . , vm ], [E]) and ℓ : cover(v). The first statement is the same as the statement ℓ : observeFun( f[v1 , . . . , vm ], [E]), except that we allow the embedding witness π to not map ℓ to any location in the implementation. This enables the teacher to specify that function f(v1 , . . . , vm ) may appear in the implementation. The second statement allows π to map ℓ to a location ℓ′ that appears at most σ(v) times for each appearance of ℓ, where σ(v) is the current value of the specified variable v. Thus cover(v) enables the teacher to cover any loop with up to σ(v) iterations. Example. Now we present examples for efficient implementations (E1 and E2) and specification (ES) for the Anagram problem (Fig. 1). The teacher observes computed values on lines 9, 12 and 14, and uses a non-deterministic choice (on line 11) to choose if implementations count the number of characters in each string, or decrement one number from another. Also the teacher allows up to two library function calls and two loops with at most 255 iterations, defined by cover statements on lines 4,5,6 and 17. 5. EXTENSIONS In this section, we discuss useful extensions to the core material presented above. These extensions are part of our implementation, but we discuss them separately to make the presentation easier to follow. One-to-many Mapping. According to definition of Trace Embedding, an embedding witness π maps one implementation location to a specification location, i.e., it constructs a one-to-one mapping. However, it is possible that a student splits a computation of some value over multiple locations. For example, in the implementation stated in R5 (Fig. 1), the student removes a character from a string across three different locations (on lines 9, 11, 13 and 14), depending on the location of the removed character in the string. This requires to map a single location from the specification to multiple locations in the implementation! For this reason, we extend the notion of trace embedding to one-to-many mappings π : Loc 1 → 2Loc 2 where π(ℓ′ ) ∩ π(ℓ) = ∅ for all ℓ 6= ℓ′ . It is easy to extend procedure Embed (Fig. 3) to this setting: the potential graph G is also helpful to enumerate every possible one-to-many mapping. However, it is costly (and unnecessary) to search for arbitrary one-to-many mappings. We use heuristics to consider only a few one-tomany mappings. For example, one of the heuristics in our implementation checks if the same variable is assigned in different branches of an if-statement (e.g., in example R5, for all three locations there is an assignment to variable cp). Although many-to-many mappings may seem more powerful, we point out that the teacher can always write a specification that is more succinct than the implementation of the student, i.e., the above described one-to-many mappings provide enough expressivity to the teacher. Non-deterministic behaviour. Trace Embedding requires equal values in the same order in the specification and implementation traces. However, an implementation can use a library function with non-deterministic behaviour, e.g., the values returned by a random generator or the iteration order over a set data structure. For such library functions we eliminate non-determinism by fixing one particular behaviour, i.e, we fix the values returned by a random generator or the iteration order over a set during program instrumentation. These fixes do not impact functionally correct programs because they cannot rely on some non-deterministic behaviour but allow us to apply our matching techniques. 6. IMPLEMENTATION AND EXPERIMENTS We now describe our implementation and present an experimental evaluation of our framework. More details on our experiments can we found on the website [1]. 6.1 Experimental Setup Our implementation of algorithm Matches (Fig. 4) is in C# and analyzes C# programs (i.e., implementations and specifications are in C#). We used Microsoft’s Roslyn compiler framework [3] for instrumenting every sub-expression to record value during program execution. Data. We used 3 preexisting problems from Pex4Fun (as mentioned in §1): (1) the Anagram problem, where students are asked to test if two strings could be permuted to become equal, (2) the IsSorted problem, where students are asked to test if the input array is sorted, and (3) the Caesar problem, where students are asked to apply Caesar cipher to the input string. We have chosen these 3 specific problems because they had a high number of student attempts, diversity in algorithmic strategies and a problem was explicitly stated (for many problems on Pex4Fun platform students have to guess the problem from failing input-output examples). We also created a new course on the Pex4Fun platform with 21 programming problems. These problems were assigned as a homework to students in a second year undergraduate course. We created this course to understand performance related problems that CS students make, as opposed to regular Pex4Fun users who might not have previous programming experience. We encouraged our students to write efficient implementations by giving more points for performance efficiency than for mere functional correctness. We omit the description of the problems here, but all descriptions are available on the original course page [2]. 6.2 Methodology In the following we describe the methodology by which we envision the technique in the paper to be used. The teacher maintains a set of efficient and inefficient specifications. A new student implementation is checked against all available specifications. If the implementation matches some specification, the associated feedback is automatically provided to the student; otherwise the teacher is notified that there is a new unmatched implementation. The teacher studies the implementation and identifies one of the following reasons for its failure to match any existing specification: (i) The implementation uses a new strategy not seen before. In this case, the teacher creates a new specification. (ii) The existing specification for the strategy used in the implementation is too specific to capture the implementation. In this case, the teacher refines that existing specification. This overall process is repeated for each unmatched implementation. New specification. A teacher creates a new specification using the following steps: (i) Copy the code of the unmatched implementation. (ii) Annotate certain values and function calls with observe statements. (iii) Remove any unnecessary code (not needed in the specification) from the implementation. (iv) Identify input values for the dynamic analysis for matching. (v) Associate a feedback with the specification. Specification refinement. To refine a specification, the teacher identifies one of the following reasons as to why an implementation did not match it: (i) The implementation differs in details specified in the specification; (ii) The (b) time required to write/refine specifications (1/3) (a) # of required inspection steps (1/3) 1,500 # of matched implementations # of matched implementations 1,500 1,000 500 1,000 500 0 0 0 5 10 15 20 0 25 10 30 40 time [min] (c) # of required inspection steps (2/3) (d) time required to write/refine specifications (2/3) LongestEqual 80 DoubleChar LongestWord RunLength Vigenere BaseToBase CatDog MinimalDelete 60 CommonElement Order3 40 20 40 20 0 0 0 5 10 0 15 10 (c) # of required inspection steps (3/3) # of matched implementations 50 40 30 20 10 0 0 2 4 6 8 # of inspection steps 20 30 40 time [min] # of inspection steps # of matched implementations 20 # of inspection steps # of matched implementations # of matched implementations Anagram IsSorted Caesar 10 12 (d) time required to write/refine specifications (3/3) 2DSearch TableAggSum 80 Intersection ReverseList SortingStrings MinutesBetween MaxSum Median 60 DigitPermutation Coins Seq235 40 20 0 0 10 20 30 time [min] Figure 6: The number of inspection steps and time required to completely specify assignments. Problem Name Correct Implement. Inefficient Implement. N S I ND Anagram IsSorted Caesar 290 (37.9%) 1460 (90.1%) 566 (81.2%) 261 (90.0%) 139 (9.5%) 343 (60.6%) 5 3 5 25 23 18 1 2 1 3 2 1 46 37 39 43 41 15 41 15 43 40 37 11 14 39 41 45 42 47 36 27 33 31 1 13 32 32 14 8 8 32 30 36 10 12 0 34 0 17 47 1 14 30 1 1 2 1 3 2 2 1 4 6 3 1 3 0 5 0 2 1 1 2 4 5 3 6 6 5 5 18 8 14 12 7 5 7 3 11 5 7 1 3 6 12 1 1 2 1 1 1 1 2 2 1 1 1 2 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 3 1 2 1 1 1 0 1 0 1 0 0 1 2 DoubleChar LongestEqual LongestWord RunLength Vigenere BaseToBase CatDog MinimalDelete CommonElement Order3 2DSearch TableAggSum Intersection ReverseList SortingStrings MinutesBetween MaxSum Median DigitPermutation Coins Seq235 (97.9%) (78.7%) (83.0%) (97.7%) (93.2%) (39.5%) (87.2%) (39.5%) (95.6%) (87.0%) (84.1%) (25.0%) (31.8%) (97.5%) (91.1%) (100.0%) (95.5%) (100.0%) (100.0%) (65.9%) (89.2%) (67.4%) (2.7%) (33.3%) (74.4%) (78.0%) (93.3%) (19.5%) (53.3%) (74.4%) (75.0%) (97.3%) (90.9%) (85.7%) (0.0%) (82.9%) (0.0%) (40.5%) (100.0%) (2.8%) (51.9%) (90.9%) LS /L Performance Avg. Max. OS OI M 1.41 1.45 1.10 11 6 7 89 51 39 28357 13 172 0.42 0.33 0.37 7.67 1.31 0.83 0.72 0.57 1.31 0.90 0.64 0.35 2.02 2.21 0.97 1.45 1.09 0.80 0.89 0.35 1.48 0.64 1.14 0.39 0.26 1.65 1.79 3 1 7 8 3 3 21 4 6 6 2 3 4 4 13 8 2 1 4 4 3 23 35 46 37 84 64 53 75 79 78 67 144 73 34 110 101 51 100 29 93 232 2 2 15 54 6 13 1629 10 107 19 1 1 5 1 866 1 3 1 4 175 3 0.31 0.33 0.35 0.33 0.34 0.36 0.36 0.86 0.36 0.40 0.34 0.40 0.37 0.34 0.55 0.37 0.35 0.34 0.32 2.41 0.94 0.42 0.44 0.47 0.44 0.50 0.48 0.58 4.36 0.53 0.59 0.45 0.53 0.56 0.44 14.59 0.48 0.47 0.44 0.44 15.44 22.08 I Table 1: List of all assignments with the experimental results. specification observes more values than those that appear in the implementation; (iii) The implementation uses different data representation. In case (i) the teacher adds a new nondeterministic choice, and, if necessary, observes new values or function calls; in case (ii) the teacher observes less values; and in case (iii) the teacher creates or refines a custom data-equality. Input values. Our dynamic analysis approach requires the teacher to associate input values with specifications. These input values should cause the corresponding implementations to exhibit their worst-case behavior; otherwise an inefficient implementation might behave similar to an efficient implementation and for this reason match the specification of the efficient implementation. This implies that trivial inputs should be avoided. For example, two strings with unequal lengths constitute a trivial input for the counting strategy since each of its three implementations C1-C3 (Fig. 1) then exit immediately. Similarly, providing a sorted input for the sorting strategy is meaningless. We remark that it is easy for a teacher (who understands the various strategies) to provide good input values. Granularity of feedback. We want to point out that the granularity of a feedback depends on the teacher. For example, in a programming problem where sorting the input value is an inefficient strategy, the teacher might not want to distinguish between different sorting algorithms, as they do not require a different feedback. However, in a programming problem where students are asked to implement a sorting algorithm it makes sense to provide a different feedback for different sorting algorithms. 6.3 Evaluation We report results on the 24 problems discussed above in Table 1. Results from manual code study. We first observe that a large number of students managed to write a functionally correct implementation on most of the problems (col- umn Correct Implementations). This shows that Pex4Fun succeeds in guiding students towards a correct solution. Our second observation is that for most problems a large fraction of implementations is inefficient (column Inefficient Implementations), especially for Anagram problem: 90%. This shows that although students manage to achieve functional correctness, efficiency is still an issue (recall that in our homework the students were explicitly asked and given extra points for efficiency). We also observe that for all, except two, problems there is at least one inefficient algorithmic strategy, and for most problems (62.5%) there are several inefficient algorithmic strategies (column N ). These results highly motivate the need for a tool that can find inefficient implementations and also provide a meaningful feedback on how to fix the problem. Precision and Expressiveness. For each programming assignment we used the above described methodology and wrote a specification for each algorithmic strategy (both efficient and inefficient). We then manually verified that each specification matches all implementations of the strategy, hence providing desired feedback for implementations. This shows that our approach is precise and expressive enough to capture the algorithmic strategy, while ignoring low level implementation details. Teacher Effort. To provide manual feedback to students the teacher would have to go through every implementation and look at its performance characteristics. In our approach the teacher has to take a look only at a few representative implementations. In column S we report the total number of inspection steps that we required to fully specify one programming problem, i.e., the number of implementations that the teacher would had to go through to provide feedback on all implementations. For the 3 pre-existing problems the teacher would only have to go through 66 out of 2316 (or around 3%) implementations to provide full feedback. Fig. 6 shows the number of matched implementations with each inspection step, as well the time it took us to create/refine all specifications (we measured the time it takes from seeing an unmatched implementation, until writing/refining a matching specification for it). In column LS /LI we report the largest ratio of specification and average matched implementation in terms of lines of code. We observe that in half of the cases the largest specification is about the same size or smaller than the average matched implementation. Furthermore, the number of the input values that need to be provided by the teacher is 1-2 across all problems (column I). In all but one problem (IsSorted) one set of input values is used for all specifications. Also, in about one third of the specifications there was no need for non-deterministic variables, and the largest number used in one specification is 3 (column ND). Overall, our semi-automatic approach requires considerably less teacher effort than providing manual feedback. Performance. We plan to integrate our framework in a MOOC platform, so performance, as for most web applications, is critical. Our implementation consists of two parts. The first part is the execution of the implementation and the specification (usually small programs) on relatively small inputs and obtaining execution traces, which is, in most cases, neglectable in terms of performance. The second part is the Embed algorithm. As discussed in §4.1 the challenge consists in finding an embedding witness π. With OS observed variables in the specification and OI obI! served variables in the implementation, there are (OIO−O S )! possible injective mapping functions. E.g., for the SortingStrings problem that gives ≈ 1026 possible mapping functions (OI = 110, OS = 13). However, our algorithm reduces this huge search space by constructing a bipartite graph G of potential mappings pairs. In M we report the number of mapping functions that our tool had to explore. E.g., for SortingStrings only 866 different mapping functions had to be explored. For all values (OS , OI and M ) we report the maximal number across all specifications. In the last column we state the total execution time required to decide if one implementation matches the specification (average and maximal). Note that this time includes execution of both programs, exploration of all assignments to non-deterministic Boolean variables and finding an embedding witness π. Our tool runs, in most cases, under half a second per implementation. These results show that our tool is fast enough to be used in an interactive teaching environment. 6.4 Threats to Validity Unsoundness. Our method is unsound in general since it uses a dynamic analysis that explores only a few possible inputs. However, we did not observe any unsoundness in our large scale experiments. If one desires provable soundness, an embedding witness could be used as a guess for a simulation relation that can then be formally verified by other techniques. Otherwise, a student who suspects an incorrect feedback can always bring it to the attention of the teacher. Program size. We evaluated our approach on introductory programming assignments. Although questions about applicability to larger programs might be raised, our goal was not to analyze arbitrary programs, but rather to develop a framework to help teachers who teach introductory programming with providing performance feedback — currently a manual, error-prone and time-consuming task. Difficulty of the specification language. Although we did not perform case study with third-party instructors, we report our experiences with using the proposed language. We would also like to point out that writing specifications is a one-time investment, which could be performed by an experienced personnel. 7. RELATED WORK 7.1 Automated Feedback There has been a lot of work in the area of generating automated feedback for programming assignments. This work can be classified along three dimensions: (a) aspects on which the feedback is provided such as functional correctness, performance characteristics or modularity (b) nature of the feedback such as counterexamples, bug localization or repair suggestions, and (c) whether static or dynamic analysis is used. Ihantola et.al. [13] present a survey of various systems developed for automated grading of programming assignments. The majority of these efforts have focussed on checking for functional correctness. This is often done by examining the behavior of a program on a set of test inputs. These test inputs can be manually written or automatically generated [25]. There has only been little work in testing for non-functional properties. The ASSYST system uses a simple form of tracing for counting execution steps to gather performance measurements [14]. The Scheme-robo system counts the number of evaluations done, which can be used for very coarse complexity analysis. The authors conclude that better error messages are the most important area of improvement [20]. The AI community has built tutors that aim at bug localization by comparing source code of the student and the teacher’s programs. LAURA [5] converts teacher’s and student’s program into a graph based representation and compares them heuristically by applying program transformations while reporting mismatches as potential bugs. TALUS [17] matches a student’s attempt with a collection of teacher’s algorithms. It first tries to recognize the algorithm used and then tentatively replaces the top-level expressions in the student’s attempt with the recognized algorithm for generating correction feedback. In contrast, we perform trace comparison (instead of source code comparison), which provides robustness to syntactic variations. Striewe and Goedicke have proposed localizing bugs by trace comparisons. They suggested creating full traces of program behavior while running test cases to make the program behavior visible to students [22]. They have also suggested automatically comparing the student’s trace to that of a sample solution [23] for generating more directed feedback. However, no implementation has been reported. We also compare the student’s trace with the teacher’s trace, but we look for similarities as opposed to differences. Recently it was shown that automated techniques can also provide repair based feedback for functional correctness. Singh’s SAT solving based technology [21] can successfully generate feedback (of up to 4 corrections) on around 64% of all incorrect solutions (from an MIT introductory programming course) in about 10 seconds on average. While test inputs provide guidance on why a given solution is incorrect and bug localization techniques provide guidance on where the error might be, repairs provide guidance on how to fix an incorrect solution. We also provide repair suggestions that are manually associated with the various teacher specifica- tions, but for performance based aspects. Furthermore, our suggestions are not necessarily restricted to small fixes. 7.2 Performance Analysis The Programming Languages and Software Engineering communities have explored various kinds of techniques to generate performance related feedback for programs. Symbolic execution based techniques have been used for identifying non-termination related issues [12, 7]. The SPEED project investigated use of static analysis techniques for estimating symbolic computational complexity of programs [27, 10, 11]. Goldsmith et.al. used dynamic analysis techniques for empirical computational complexity [8]. The Toddler tool reports a specific pattern: computations with repetitive and similar memory-access patterns [19]. The Cachetor tool reports memoization opportunities by identifying operations that generate identical values [18]. In contrast, we are interested in not only identifying whether or not there is a performance issue, but also identifying its root cause and generating repair suggestions. 8. REFERENCES [14] [15] [16] [17] [18] [19] [1] http://forsyte.at/static/people/radicek/fse14. [2] Making Programs Efficient. http://pexforfun.com/makingprogramsefficient. [3] Microsoft ”Roslyn” CTP. http://msdn.microsoft.com/en-us/vstudio/roslyn.aspx. [20] [4] Pex for fun. http://www.pexforfun.com/. [5] A. Adam and J.-P. H. Laurent. LAURA, a system to debug student programs. Artif. Intell., 15(1-2), 1980. [6] P. Bose, J. F. Buss, and A. Lubiw. Pattern matching for permutations. Inf. Process. Lett., 65(5):277–283, [21] 1998. [7] J. Burnim, N. Jalbert, C. Stergiou, and K. Sen. Looper: Lightweight detection of infinite loops at runtime. In ASE, pages 161–169, 2009. [22] [8] S. Goldsmith, A. Aiken, and D. S. Wilkerson. Measuring empirical computational complexity. In ESEC/SIGSOFT FSE, 2007. [23] [9] S. Gulwani. Example-based learning in computer-aided STEM education. To appear in [24] Commun. ACM, 2014. [10] S. Gulwani, K. K. Mehra, and T. M. Chilimbi. Speed: [25] precise and efficient static estimation of program computational complexity. In POPL, pages 127–139, 2009. [11] S. Gulwani and F. Zuleger. The reachability-bound [26] problem. In PLDI, pages 292–304, 2010. [12] A. Gupta, T. A. Henzinger, R. Majumdar, A. Rybalchenko, and R.-G. Xu. Proving [27] non-termination. In POPL, pages 147–158, 2008. [13] P. Ihantola, T. Ahoniemi, V. Karavirta, and O. Seppälä. Review of recent systems for automatic assessment of programming assignments. In Proceedings of the 10th Koli Calling International Conference on Computing Education Research, Koli Calling ’10, pages 86–93, New York, NY, USA, 2010. ACM. D. Jackson and M. Usher. Grading student programs using ASSYST. In SIGCSE, pages 335–339, 1997. K. Masters. A brief guide to understanding MOOCs. The Internet Journal of Medical Education, 1(2), 2011. R. Milner. An algebraic definition of simulation between programs. Technical report, Stanford, CA, USA, 1971. W. R. Murray. Automatic program debugging for intelligent tutoring systems. Computational Intelligence, 3, 1987. K. Nguyen and G. Xu. Cachetor: Detecting cacheable data to remove bloat. In Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering, ESEC/FSE 2013, pages 268–278, New York, NY, USA, 2013. ACM. A. Nistor, L. Song, D. Marinov, and S. Lu. Toddler: Detecting performance problems via similar memory-access patterns. In Proceedings of the 2013 International Conference on Software Engineering, ICSE ’13, pages 562–571, Piscataway, NJ, USA, 2013. IEEE Press. R. Saikkonen, L. Malmi, and A. Korhonen. Fully automatic assessment of programming exercises. In Proceedings of the 6th Annual Conference on Innovation and Technology in Computer Science Education, ITiCSE ’01, pages 133–136, New York, NY, USA, 2001. ACM. R. Singh, S. Gulwani, and A. Solar-Lezama. Automated feedback generation for introductory programming assignments. In PLDI, pages 15–26, 2013. M. Striewe and M. Goedicke. Using run time traces in automated programming tutoring. In ITiCSE, pages 303–307, 2011. M. Striewe and M. Goedicke. Trace alignment for automated tutoring. In CAA, 2013. N. Tillmann and J. de Halleux. Pex-white box test generation for .NET. In TAP, pages 134–153, 2008. N. Tillmann, J. de Halleux, T. Xie, S. Gulwani, and J. Bishop. Teaching and learning programming and software engineering via interactive gaming. In ICSE, 2013. T. Uno. Algorithms for enumerating all perfect, maximum and maximal matchings in bipartite graphs. In ISAAC, pages 92–101, 1997. F. Zuleger, S. Gulwani, M. Sinn, and H. Veith. Bound analysis of imperative programs with the size-change abstraction. In SAS, pages 280–297, 2011.
6cs.PL
arXiv:1711.06299v1 [cs.LG] 16 Nov 2017 Bayesian Best-Arm Identification for Selecting Influenza Mitigation Strategies Pieter Libin1,2 , Timothy Verstraeten1 , Diederik M. Roijers1 , Jelena Grujic1 , Kristof Theys2 , Philippe Lemey2 , and Ann Nowé1 1 Artificial Intelligence Lab, Department of computer science, Vrije Universiteit Brussel, Brussels, Belgium 2 KU Leuven University of Leuven, Department of Microbiology and Immunology, Rega Institute for Medical Research, Clinical and Epidemiological Virology, Leuven, Belgium November 20, 2017 Abstract Pandemic influenza has the epidemic potential to kill millions of people. While various preventive measures exist (i.a., vaccination and school closures), deciding on strategies that lead to their most effective and efficient use, remains challenging. To this end, individual-based epidemiological models are essential to assist decision makers in determining the best strategy to curve epidemic spread. However, individual-based models are computationally intensive and therefore it is pivotal to identify the optimal strategy using a minimal amount of model evaluations. Additionally, as epidemiological modeling experiments need to be planned, a computational budget needs to be specified a priori. Consequently, we present a new sampling method to optimize the evaluation of preventive strategies using fixed budget best-arm identification algorithms. We use epidemiological modeling theory to derive knowledge about the reward distribution which we exploit using Bayesian best-arm identification algorithms (i.e., Top-two Thompson sampling and BayesGap). We evaluate these algorithms in a realistic experimental setting and demonstrate that it is possible to identify the optimal strategy using only a limited number of model evaluations, i.e., 2-to-3 times faster compared to the uniform sampling method, the predominant technique used for epidemiological decision making in the literature. Finally, we contribute and evaluate a statistic for Top-two Thompson sampling to inform the decision makers about the confidence of an arm recommendation. 1 1 Introduction The influenza virus is responsible for the deaths of half of a million people each year [52]. In addition, seasonal influenza epidemics cause a significant economic burden [45]. While transmission is primarily local, a newly emerging variant may spread to pandemic proportions in a naive (i.e., fully susceptible) host population [46]. Pandemic influenza occurs less frequently than seasonal influenza but the outcome with respect to morbidity and mortality can be much more severe, potentially killing millions of people worldwide [47, 48]. Consequently, it is essential to study mitigation strategies to control influenza pandemics. For influenza, different preventive measures exist: i.a., vaccination, social measures (e.g. school closures and travel restrictions) and antiviral drugs. However, the efficiency of strategies greatly depends on the availability of preventive compounds, as well as on the characteristics of the targeted epidemic. Furthermore, governments typically have limited resources to implement such measures. Therefore, it remains challenging to formulate public health strategies that make effective and efficient use of these preventive measures within the existing resource constraints. Epidemiological models (i.e., compartment models and individual-based models) are essential to study the effects of preventive measures in silico [8, 27]. While individual-based models are usually associated with a greater model complexity and computational cost than compartment models, they allow for a more accurate evaluation of preventive strategies [12, 19, 44]. To capitalize on these advantages and make it feasible to employ individual-based models, it is essential to use the available computational resources as efficiently as possible. In the literature, a set of possible preventive strategies is typically evaluated by simulating each of the strategies an equal number of times [25, 5, 30, 41, 20, 22, 13]. However, this approach is inefficient to identify the optimal preventive strategy, as a large proportion of computational resources will be used to explore sub-optimal strategies. Furthermore, a consensus on the required number of model evaluations per strategy is currently lacking [57]. Moreover, as we show in this paper, this number depends on the hardness of the evaluation problem [6]. For this reason, we propose to combine individual-based epidemiological models with multi-armed bandits [32]. In a preliminary study [39], the potential of multi-armed bandits was explored in a regret minimization setting, using default strategies (i.e., ǫ-greedy [53] and UCB1 [7]). However, in this work, we recognize that epidemiological modeling experiments need to be planned and that a computational budget needs to be specified a priori. Within this constraint, we aim to minimize the number of required model evaluations to determine the most promising preventive strategy. Therefore, we present a novel approach formulating the evaluation of preventive strategies as a best-arm identification problem using a fixed budget of model evaluations. As running an individual-based model is computationally intensive (i.e., minutes to hours, depending on the complexity of the model), minimizing the number of required model evaluations reduces the total time required to evaluate 2 a given set of preventive strategies. This renders the use of individual-based models attainable in studies where it would otherwise not be computationally feasible. Additionally, reducing the number of model evaluations can also free up computational resources in studies that already use individual-based models, capacitating researchers to explore different model scenarios. Considering a wider range of scenarios increases the confidence about the overall utility of preventive strategies [58]. In our model, an arm’s reward distribution corresponds to the epidemic size distribution of the epidemiological model. We employ epidemiological modeling theory to derive that this distribution is approximately Gaussian, and exploit this knowledge using Bayesian best-arm identification algorithms. In this paper, we contribute a novel method to evaluate preventive strategies as a best-arm identification problem. This method enables decision makers to obtain recommendations in a reduced number of model evaluations and supports their decision process by providing a confidence recommendation statistic. In Section 4 we employ concepts from epidemiological model theory and we adapt Bayesian best-arm identification algorithms to incorporate this knowledge. In Section 5, we evaluate these algorithms in an experimental setting, where we aim to find the best vaccine allocation strategy in a realistic simulation environment that models Seattle’s social network. We repeat the experiment for a wide range of basic reproduction numbers (i.e., R0 , the number of infections that is, by average, generated by one single infection) that are typically used in the influenza literature. The obtained experimental results show that our approach is able to identify the best preventive strategy 2-to-3 times faster compared to uniform sampling, the predominant technique used for epidemiological decision making in the literature. Furthermore, we contribute (Section 4) and evaluate (Section 5) a statistic to inform the decision makers about the confidence of a particular recommendation. 2 2.1 Background Pandemic influenza and vaccine production The primary preventive strategy to mitigate seasonal influenza is to produce vaccine prior to the epidemic, anticipating the virus strains that are expected to circulate. This vaccine pool is used to inoculate the population before the start of the epidemic. While seasonal influenza may have a restricted susceptible population due to vaccination and pre-existing immunity, a newly emerging strain can become pandemic by spreading rapidly among naive human hosts worldwide [46]. While it is possible to stockpile vaccines to prepare for seasonal influenza, this is not the case for new variants of influenza viruses, as the vaccine should be specifically tailored to the virus that is the source of the pandemic. Therefore, before an appropriate vaccine can be produced, the responsible virus needs to be identified. Hence, vaccine will be available only in limited supply at the 3 beginning of the pandemic [56]. In addition, production problems can result in vaccine shortages [18]. When the number of vaccine doses is limited, it is imperative to identify an optimal vaccine allocation strategy [43]. 2.2 Modeling influenza There is a long tradition to use individual-based models to study influenza epidemics [8, 27, 25], as it allows for a more accurate evaluation of preventive strategies. A state-of-the-art individual-based model, that has been the driver for many high impact research efforts [8, 27, 29], is FluTE [12]. FluTE implements a contact model where the population is divided into communities of households [12]. The population is organized in a hierarchy of social mixing groups where the contact intensity is inversely proportional with the size of the group (e.g., closer contact between members of a household than between colleagues). Additionally, FluTE implements an individual disease progression model, that associates different disease stages with different levels of infectiousness. To support the evaluation of preventive strategies, FluTE implements the simulation of therapeutic interventions (i.e., vaccines, antiviral compounds) and non-therapeutic interventions (i.e., school closure, case isolation, household quarantine). 2.3 Bandits and best-arm identification The multi-armed bandit game [6] concerns a K-armed bandit (i.e., a slot machine with K levers), where each arm Ak returns a reward rk when it is pulled (i.e., rk represents a sample from Ak ’s reward distribution). A common use of the bandit game is to pull a sequence of arms such that the cumulative regret is minimized [32]. To fulfill this goal, the player needs to carefully balance between exploitation (i.e., choose the arms with the highest expected reward) and exploration (i.e., explore the other arms to potentially identify even more promising arms). In this paper, the objective is to recommend the best arm A∗ (i.e., the arm with the highest average reward µ∗ ) after a fixed number of arm pulls. This is referred to as the fixed budget best-arm identification problem [6], an instance of the pure-exploration problem [10]. For a given budget T , the objective is to minimize the simple regret µ∗ − µJ , where µJ is the average reward of the recommended arm AJ at time T [11]. Simple regret is inversely proportional to the probability of recommending the correct arm A∗ [38]. 3 Related work In this work, we recognize that a computational budget needs to be specified a priori to meet the realities associated with high performance computational infrastructure. For this reason we consider the fixed budget best-arm identification setting, in contrast to techniques that attempt to identify the best arm with 4 a predefined confidence: i.e., racing strategies [21], strategies that exploit the confidence bound of the arms’ means [37, 35] and more recently fixed confidence best-arm identification algorithms [26]. While other algorithms exist to rank or select bandit arms, e.g. [49], bestarm identification is best approached using adaptive sampling methods [36], as the ones we study in this paper. Moreover, the use of best-arm identification methods clears the way for interesting future work with respect to evaluating preventive strategies while considering multiple objectives (see Section 6). 4 Methods We formulate the evaluation of preventive strategies as a multi-armed bandit game with the aim of identifying the best arm using a fixed budget of model evaluations. The presented method is generic with respect to the type of epidemic that is modeled (i.e., pathogen, contact network, preventive strategies). The method is evaluated in the context of pandemic influenza in the next section. 4.1 Preventive bandits Definition 1. A stochastic epidemiological model E is defined in terms of a model configuration c ∈ C and can be used to evaluate a preventive strategy p ∈ P. Evaluating the model E results in a sample of the model’s outcome distribution: outcome ∼ E(c, p), where c ∈ C and p ∈ P (1) Note that a model configuration c ∈ C describes the complete model environment, i.e., both aspects inherent to the model (e.g., FluTE’s mixing model) and options that the modeler can provide (e.g., population statistics, vaccine properties). The result of a model evaluation is referred to as the model outcome (e.g., prevalence, proportion of symptomatic individuals, morbidity, mortality, societal cost). Our objective is to find the optimal preventive strategy from a set of alternative strategies {p1 , ..., pK } ⊂ P for a particular configuration c0 ∈ C of a stochastic epidemiological model, where c0 corresponds to the studied epidemic. Definition 2. A preventive bandit [39] has K = |{p1 , ..., pK }| arms. Pulling arm pk corresponds to evaluating pk by running a simulation in the epidemiological model E(c0 , pk ). A preventive bandit is thus a multi-armed bandit, that has preventive strategies as arms with reward distributions corresponding to the outcome distribution of a stochastic epidemiological model E(c0 , pk ). While the parameters of the reward distribution are known (i.e., the parameters of the epidemiological model), it is intractable to determine the optimal reward analytically from the epidemiological model. Hence, we must learn about the outcome distribution via interaction with the epidemiological model. 5 4.2 Outcome distribution As previously defined, the reward distribution associated with a preventive bandit’s arm corresponds to the outcome distribution of the epidemiological model that is evaluated when pulling that arm. Therefore, employing insights from epidemiological modeling theory allows us to specify prior knowledge about the reward distribution. It is well known that a disease outbreak has two possible outcomes: either it is able to spread beyond a local context and becomes a fully established epidemic or it fades out [55]. Most stochastic epidemiological models reflect this reality and hence its epidemic size distribution is bimodal [55]. When evaluating preventive strategies, the objective is to determine the preventive strategy that is most suitable to mitigate an established epidemic. As in practice we can only observe and act on established epidemics, epidemics that faded out in simulation would bias this evaluation. Consequently, it is necessary to focus on the mode of the distribution that is associated with the established epidemic. Therefore we censor (i.e., discard) the epidemic sizes that correspond to the faded epidemic. The size distribution that remains (i.e., the one that corresponds with the established epidemic) is approximately Gaussian [9]. In this study, we consider a scaled epidemic size distribution, i.e., the proportion of symptomatic infections. Hence we can assume bimodality of the full size distribution and an approximately Gaussian size distribution of the established epidemic. We verified experimentally that these assumptions hold for all the reward distributions that we observed in our experiments (see Section 5). To censor the size distribution, we use a threshold that represents the number of infectious individuals that are required to ensure an outbreak will only fade out with a low probability. 4.3 Epidemic fade-out threshold For heterogeneous host populations (i.e., a population with a significant variance among individual transmission rates, as is the case for influenza epidemics [16, 24]), the number of secondary infections can be accurately modeled using a negative binomial offspring distribution NB(R0 , γ) [40], where R0 is the basic reproductive number and γ is a dispersion parameter that specifies the extent of heterogeneity. The probability of epidemic extinction pext can be computed by solving g(s) = s, where g(s) is the probability generating function (pgf) of the offspring distribution [40]. For an epidemic where individuals are targeted with preventive measures (i.e., vaccination in our use case), we obtain the following pgf −γ R0 (1 − s) (2) g(s) = popc + (1 − popc ) 1 + γ where popc signifies the random proportion of controlled individuals [40]. From pext we can compute a threshold T0 to limit the probability of extinction to a cutoff ℓ [31]. 6 4.4 Best-arm identification with a fixed budget Our objective is to identify the best preventive strategy (i.e., the strategy that minimizes the expected outcome) out of a set of preventive strategies, for a particular configuration c0 ∈ C using a fixed budget T of model evaluations. Successive Rejects was the first algorithm to solve the best-arm identification in a fixed budget setting [6]. For a K-armed bandit, Successive Rejects operates in (K − 1) phases. At the end of each phase, the arm with the lowest average reward is discarded. Thus, at the end of phase (K − 1) only one arm survives, and this arm is recommended. At phase f ∈ {1, . . . , K − 1}, each arm that is still available is played mf − mf −1 times, where with m0 = 0  T −K 1  mf = K + 1 − f log(K) (3) K log(K) = 1 X1 + 2 k (4) k=2 Successive Rejects serves as a useful baseline, however, it has no support to incorporate any prior knowledge. Bayesian best-arm identification algorithms are able to take into account such knowledge by defining an appropriate prior and posterior on the arms’ reward distribution. As we will show, such prior knowledge can increase the best-arm identification accuracy. Additionally, at the time an arm is recommended, the posteriors contain valuable information that can be used to formulate a variety of statistics helpful to assist decision makers. We consider two state-of-the-art Bayesian algorithms: BayesGap [33] and Top-two Thompson sampling [51]. For Top-two Thompson sampling, we derive a statistic based on the posteriors to inform the decision makers about the confidence of an arm recommendation: the probability of success. As we established in the previous section, each arm of our preventive bandit has a reward distribution that is approximately Gaussian with unknown mean and variance. To make our method generic for any type of preventive bandit problem, we assume an uninformative Jeffreys prior (σk )−3 on (µk , σk2 ) [34]. Honda and Takemura [34] demonstrate that this prior leads to the following posterior on µk at the nth k pull: s n2k (5) (µk − xk,nk ) | xk,nk , Sk,nk ∼ Tnk Sk,nk where xk,nk is the reward mean, Sk,nk is the sum of squares Sk,nk = nk X (rk,m − xk,nk )2 m=1 and Tnk is the standard student t-distribution with nk degrees of freedom. 7 (6) BayesGap is a gap-based Bayesian algorithm [33]. The algorithm requires that for each arm Ak , a high-probability upper bound Uk (t) and lower bound Lk (t) is defined on the posterior of µk at each time step t. Using these bounds, the gap quantity Bk (t) = max Ul (t) − Lk (t) (7) l6=k is defined for each arm Ak . Bk (t) represents an upper bound on the simple regret (as defined in Section 2.3). At each step t of the algorithm, the arm J(t) that minimizes the gap quantity Bk (t) is compared to the arm j(t) that maximizes the upper bound Uk (t). From J(t) and j(t), the arm with the highest confidence diameter Uk (t) − Lk (t) is pulled. The reward that results from this pull is observed and used to update Ak ’s posterior. When the budget is consumed, the arm J(argmin BJ(t) (t)) (8) t≤T is recommended. This is the arm that minimizes the simple regret bound over all times t ≤ T . In order to use BayesGap in the preventive bandit setting, we contribute problem-specific bounds. Given our posteriors (Equation 5), we define Uk (t) = µ̂k (t) + β σ̂k (t) Lk (t) = µ̂k (t) − β σ̂k (t) (9) where µ̂k (t) and σ̂k (t) are the mean and standard deviation of the posterior of arm Ak at time step t, and β is the exploration coefficient. The amount of exploration that is feasible given a particular bandit game, is proportional to the available budget, and inversely proportional to the game’s complexity [33]. This complexity can be modeled taking into account the game’s hardness [6] and the variance of the rewards. Following Hoffman et al. [33], we define a hardness quantity X −2 Hǫ = Hk,ǫ (10) k with arm-dependent hardness 1 Hk,ǫ = max( (∆k + ǫ), ǫ) 2 ∆k = max(µl ) − µk (11) l6=k Considering the budget T , hardness Hǫ and a generalized reward variance 2 σG over all arms, we define s T − 3K (12) β= 2 4Hǫ σG Theorem 1 in the Supplementary Information1 formally proves that using these bounds results in a probability of simple regret that asymptotically reaches the exponential lower bound presented by Hoffman et al. [33]. 1 Supplementary Information is available at the end of this manuscript 8 2 As both Hǫ and σG are unknown, in order to compute β, these quantities need to be estimated. Firstly, we estimate Hǫ ’s upper bound Ĥǫ by estimating ∆k as follows   ˆ k = max ∆ µ̂l (t) + 3σ̂l (t) − µ̂k (t) − 3σ̂k (t) (13) 1≤l<K;l6=k 2 as in Hoffman et al. [33]. Secondly, for σG we need a measure of variance that is representative for the reward distribution of all arms. To this end, when the arms are initialized, we observe their sample variance s2k , and compute their average PK 2 s 2 s̄G = k=1 k (14) K As our bounds depend on the standard deviation σ̂k (t) of the t-distributed posterior, each arm’s posterior needs to be initialized 3 times to ensure that σ̂k (t) is defined, this initialization also ensures proper posteriors [34]. Top-two Thompson sampling is a reformulation of the Thompson sampling algorithm [54], such that it can be used in a pure-exploration context [51]. Thompson sampling operates directly on the arms’ posterior of the mean µk . At each time step, Thompson sampling obtains one sample for each arm’s posterior. The arm with the highest sample is pulled, and its reward is subsequently used to update that arm’s posterior. While this approach has been proven highly successful to minimize cumulative regret [14, 3, 34], as it balances the exploration-exploitation trade-off, it is sub-optimal to identify the best arm [10]. To adapt Thompson sampling to minimize simple regret, Top-two Thompson sampling increases the amount of exploration. To this end, an exploration probability ω needs to be specified. At each time step, one sample is obtained for each arm’s posterior. The arm Atop with the highest sample is only pulled with probability ω. With probability 1 − ω we repeat sampling from the posteriors until we find an arm Atop-2 that has the highest posterior sample and where Atop 6= Atop-2 . When the arm Atop-2 is found, it is pulled and the observed reward is used to update the posterior of the pulled arm. When the available budget is consumed, the arm with the highest average reward is recommended. As Top-two Thompson sampling only requires samples from the arms’ posteriors, we can use the t-distributed posteriors from Equation 5 as is. To avoid improper posteriors, each arm needs to be initialized 2 times [34]. As specified in the previous subsection, the reward distribution is censored. We observe each reward, but only consider it to update the arm’s value when it exceeds the threshold T0 (i.e., when we receive a sample from the mode of the epidemic that represents the established epidemic). 4.5 Probability of success The probability that an arm recommendation is correct presents a useful confidence statistic to support policy makers with their decisions. As Top-two Thompson sampling recommends the arm with the highest average reward, the 9 probability of success is P (µJ = max µk ) 1≤k≤K (15) where µJ is the random variable that represents the mean of the recommended arm. As we assume that the arm’s reward distributions are independent, this probability can be computed using the recommended arm’s posterior probability density function fµJ and the other arms’ cumulative density function Fµk : P (µJ = max µk ) = P (∩K k6=J (µk ≤ µJ )) 1≤k≤K Z = P (∩K k6=J (µk ≤ x))P (µJ = x)dx x∈R = Z x∈R = Z x∈R K Y k6=J K Y k6=J  P (µk ≤ x) P (µJ = x)dx  Fµk (x) fµJ (x)dx As this integral cannot be computed analytically, we estimate it using Gaussian quadrature [2]. It is important to notice that, while aiming for generality, we made some conservative assumptions: the reward distributions are approximated as Gaussian and the uninformative Jeffreys prior is used. These assumptions imply that the derived probability of success will be an under-estimator for the actual recommendation success. 5 Experiments We composed and performed an experiment in the context of pandemic influenza, where we analyze the mitigation strategy to vaccinate a population when only a limited number of vaccine doses is available (details about the rationale behind this scenario in Section 2.1). In our experiment, we extend the simulation environment presented in [39] to accommodate a realistic setting to evaluate vaccine allocation. In contrast to [39], we consider a large and realistic social network (i.e., the city of Seattle) and a wide range of R0 values. We consider the scenario when a pandemic is emerging in a particular geographical region and vaccines becomes available, albeit in a limited number of doses. When the number of vaccine doses is limited, it is imperative to identify an optimal vaccine allocation strategy [43]. In our experiment, we explore the allocation of vaccines over five different age groups: pre-school children, school-age children, young adults, older adults and the elderly as presented by Chao et al. [12]. We consider this experiment for a wide range of R0 values. 10 5.1 Influenza model and configuration The epidemiological model used in the experiments is the FluTE stochastic individual-based model. In our experiment we consider the population of Seattle (United states) that includes 560,000 individuals [12]. This population is realistic both with respect to the number of individuals and its community structure, and provides an adequate setting for the validation of vaccine strategies [57]. At the first day of the simulated epidemic, 10 random individuals are seeded with an infection. The epidemic is simulated for 180 days, during this time no more infections are seeded. Thus, all new infections established during the run time of the simulation, result from the mixing between infectious and susceptible individuals. We assume no pre-existing immunity towards the circulating virus variant. We choose the number of vaccine doses to allocate to be approximately 4.5% of the population size [43]. In this experiment, we explore the efficacy of different vaccine allocation strategies. We consider that only one vaccine variant is available in the simulation environment. FluTE allows vaccine efficacy to be configured on 3 levels: efficacy to protect against infection when an individual is susceptible (i.e., V ESus ), efficacy to avoid an infected individual from becoming infectious (i.e., V EInf ) and efficacy to avoid an infected individual from becoming symptomatic (i.e., V ESym ). In our experiment we choose V ESus = 0.5 [42], V EInf = 0.5 [42] and V ESym = 0.67 [59]. The influenza vaccine only becomes fully effective after a certain period upon its administration, and the effectiveness increases gradually over this period [1]. In our experiment, we assume the vaccine effectiveness to build up exponentially over a period of 2 weeks [1]. We perform our experiment for a set of R0 values within the range of 1.4 to 2.4, in steps of 0.2. This range is considered representative for the epidemic potential of influenza pandemics [8, 12, 43]. We refer to this set of R0 values as R0 . Note that the setting described in this subsection, in conjunction with a particular R0 value, corresponds to a model configuration (i.e., c0 ∈ C, Definition 2). The computational complexity of FluTE simulations depends both on the size of the susceptible population and the proportion of the population that becomes infected. For the population of Seattle, the simulation run time was up to 11 21 minutes (median of 10 21 minutes), on state-of-the-art hardware (details in Supplementary Information, section 7). 5.2 Formulating vaccine allocation strategies We consider 5 age groups to which vaccine doses can be allocated: pre-school children (i.e., 0-4 years old), school-age children (i.e., 5-18 years old), young adults (i.e., 19-29 years old), older adults (i.e., 30-64 years old) and the elderly (i.e., > 65 years old) [12]. An allocation scheme can be encoded as a Boolean 5tuple, where each position in the tuple corresponds to the respective age group. The Boolean value at a particular position in the tuple denotes whether vaccines 11 should be allocated to the respective age group. When vaccine is to be allocated to a particular age group, this is done proportional to the size of the population that is part of this age group [43]. To decide on the best vaccine allocation strategy, we enumerate all possible combinations of this tuple. The tuple can be encoded as a binary number, and as such the different allocation strategies can be represented by integers (i.e., {0, ..., 31}). 5.3 An influenza preventive bandit The influenza preventive bandit BF lu has exactly 32 arms. Each arm Ak is associated with the allocation strategy for which the integer encoding is k. Given a model configuration c0 ∈ C (Definition 2), when an arm Ak of BF lu is pulled, FluTE is invoked with c0 and the vaccine allocation strategy pk ∈ P (Definition 2) associated with the arm Ak . When FluTE finishes, it outputs the proportion of the population that experienced a symptomatic infection pI , from which the reward rk = 1 − pI is computed. 5.4 Outcome distributions To establish a proxy for the ground truth concerning the outcome distributions of the 32 considered preventive strategies, all strategies were evaluated 1000 times, for each of the R0 values in R0 . We will use this ground truth as a reference to validate the correctness of the recommendations obtained throughout our experiments. R0 presents us with an interesting evaluation problem. To demonstrate this, we visualize the outcome distribution for R0 = 1.4 in Figure 1 and for R0 = 2.4 in Figure 2 (the outcome distributions for the other R0 values are shown in Section 3 of the Supplementary Information). Firstly, we observe that for different values of R0 , the distances between top arms’ means differ. Additionally, outcome distribution variances vary over the set of R0 values in R0 . These differences produce distinct levels of evaluation hardness (see Section 4.4), and demonstrate the setting’s usefulness as benchmark to evaluate preventive strategies. Secondly, we expect the outcome distribution to be bimodal, however, the probability to sample from the mode of the outcome distribution that represents the non-established epidemic decreases as R0 increases [40]. This expectation is confirmed when we inspect Figure 1, that shows a bimodal distribution for R0 = 1.4, while Figure 2 shows a unimodal outcome distribution for R0 = 2.4, as only samples from the established epidemic were obtained. Our analysis identified that the best vaccine allocation strategy was h0, 1, 0, 0, 0i (i.e., allocate vaccine to school children, strategy 8) for all R0 values in R0 . 5.5 Best-arm identification experiment To assess the performance of the different best-arm identification algorithms (i.e., Successive Rejects, BayesGap and Top-two Thompson sampling) we run 12 0.3 epidemic size 0.2 0.1 0 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 29 30 31 0.0 vaccine allocation strategy Figure 1: Violin plot that depicts the density of the outcome distribution (i.e., epidemic size) for 32 vaccine allocation strategies (Ro = 1.4). 13 epidemic size 0.52 0.51 0.50 0 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 29 30 31 0.49 vaccine allocation strategy Figure 2: Violin plot that depicts the density of the outcome distribution (i.e., epidemic size) for 32 vaccine allocation strategies (Ro = 2.4). 14 each algorithm for all budgets in the range of 32 to 500. This evaluation is performed on the influenza bandit game that we defined earlier. For each budget, we run the algorithms 100 times, and report the recommendation success rate. In the previous section, the optimal vaccine allocation strategy was identified to be h0, 1, 0, 0, 0i (i.e. vaccine allocation strategy 8) for all R0 in R0 . We thus consider a recommendation to be correct when it equals this vaccine allocation strategy. We evaluate the algorithm’s performance with respect to each other and with respect to uniform sampling, the current state-of-the art to evaluate preventive strategies. The uniform sampling method pulls arm Au for each step t of the given budget T , where Au ’s index u is sampled from the uniform distribution U(1, K). To consider different levels of hardness and obtain insight in the effect of the unestablished outcome distribution, we perform this analysis for each R0 value in R0 . For the Bayesian best-arm identification algorithms, the prior specifications are detailed in Section 4.4. BayesGap requires an upper and lower bound that is defined in terms of the used posteriors. In our experiments, we use upper bound Uk (t) and lower bound Lk (t) that were established in Section 4.4. Toptwo Thompson sampling requires a parameter that modulates the amount of exploration ω. As it is important for best-arm identification algorithms to differentiate between the top two arms, we choose ω = 0.5, such that, in the limit, Top-two Thompson sampling will explore the top two arms uniformly. We censor the reward distribution based on the threshold T0 we defined in Section 4.3. This threshold depends on basic reproductive number R0 and dispersion parameter γ. R0 is defined explicitly for each of our experimental settings. For the dispersion parameter we choose γ = 0.5, which is a conservative choice according to the literature [16, 24]. We define the probability cutoff ℓ = 10−10 . Figure 3 and Figure 4 show recommendation success rate for each of the best-arm identification algorithms, respectively for R0 = 1.4 and R0 = 2.4. The results for the other R0 values are visualized in Section 4 of the Supplementary Information. The results for different values of R0 clearly indicate that our selection of best-arm identification algorithms significantly outperform the uniform sampling method. In our experiment, where we consider different R0 values, the uniform sampling method requires more than double the amount of evaluations to achieve a similar recommendation performance. For the harder problems (e.g., setting with R0 = 2.4), recommendation uncertainty remains considerable even after consuming 3 times the budget required by Top-two Thompson sampling. All best-arm identification algorithms require an initialization phase in order to output a well-defined recommendation. Successive Rejects needs to pull each arm at least once, while Top-two Thompson sampling and BayesGap need to pull each arm respectively 2 and 3 times (details in Section 4.4). For this reason, these algorithms’ performance can only be evaluated after this initialization phase. BayesGap’s performance is on par with Successive Rejects, except 15 for the hardest setting we studied (i.e., R0 = 2.4). In comparison, Top-two Thompson sampling consistently outperforms Successive Rejects 30 pulls after the initialization phase. Top-two Thompson sampling needs to initialize each arm’s posterior with 2 pulls, i.e., double the amount of uniform sampling and Successive Rejects. However, our experiments clearly show that none of the other algorithms reach any acceptable recommendation rate using less than 64 pulls, thereby alleviating concerns using a t-distributed posterior. 1.0 success rate 0.8 0.6 0.4 BG SR TtTs Uni 0.2 0.0 100 200 300 budget 400 500 Figure 3: In this figure, we present the results for the experiment with R0 = 1.4. Each curve represents the rate of successful arm recommendations (y-axis) for a range of budgets (x-axis). A curve is shown for each of the considered algorithms: BayesGap (legend: BG), Successive Rejects (legend: SR), Top-two Thompson sampling (legend: TtTs) and Uniform sampling (legend: Uni). In Section 4 we derived a statistic to express the probability of success (Ps ) concerning a recommendation made by Top-two Thompson sampling. We analyzed this probability for all the Top-two Thompson sampling recommendations that were obtained in the experiment described above. To provide some insights on how this statistic can be used to support policy makers, we show the Ps values of all Top-two Thompson sampling recommendations for R0 = 2.4 in Figure 5 (Figures for the other R0 values in Section 5 of the Supplementary Information). Figure 5 indicates that Ps closely follows recommendation correctness and that 16 1.0 success rate 0.8 0.6 0.4 BG SR TtTs Uni 0.2 0.0 100 200 300 budget 400 500 Figure 4: In this figure, we present the results for the experiment with R0 = 2.4. Each curve represents the rate of successful arm recommendations (y-axis) for a range of budgets (x-axis). A curve is shown for each of the considered algorithms: BayesGap (legend: BG), Successive Rejects (legend: SR), Top-two Thompson sampling (legend: TtTs) and Uniform sampling (legend: Uni). the uncertainty of Ps is inversely proportional to the size of the available budget. Additionally, in Figure 6 (Figures for the other R0 values in Section 6 of the Supplementary Information) we confirm that Ps underestimates recommendation correctness. These observations indicate that Ps has the potential to serve as a conservative statistic to inform policy makers about the confidence of a particular recommendation, and thus can be used to define meaningful cutoffs to guide policy makers in their interpretation of the recommendation of preventive strategies. 6 Conclusion We formulate the objective to select the best preventive strategy in an individualbased model as a fixed budget best-arm identification problem. An experiment was set up to evaluate this setting in the context of pandemic influenza. To assess the best arm recommendation performance of the preventive bandit, we report a success rate over 100 independent bandit runs. 17 1.0 probability of success 0.9 0.8 0.7 0.6 0.5 0.4 success failure 0.3 100 200 300 budget 400 500 Figure 5: Top-two Thompson sampling was run 100 times for each budget for the experiment with R0 = 2.4. For each of the recommendations, Ps was computed. These Ps values are shown as a scatter plot, where each point’s color reflects the correctness of the recommendation (see legend). We demonstrate that it is possible to efficiently identify the optimal preventive strategy using only a limited number of model evaluations, even if there is a large number of preventive strategies to consider. Compared to uniform sampling, our method is able to recommend the best preventive strategy reducing the number of required model evaluations 2-to-3 times. Additionally, we show that by using Bayesian best-arm identification algorithms, statistics can be defined to support policy makers with their decisions. As such, we are confident that our method has the potential to be used as a decision support tool for mitigating epidemics. This will enable the use of individual-based models in studies where it would otherwise be computationally too prohibitive, and allow researchers to explore a wider variety of model scenarios. We identify two particular directions for future work. Firstly, while our method is evaluated in the context of pandemic influenza, it is important to stress that it can be used to evaluate preventive strategies for other infectious diseases. Since recently, a Dengue vaccine is available [28], and the optimal allocation of this vaccine remains an important research topic [23, 4], we recognize that Dengue epidemics are an interesting use case. Secondly, in this paper, our 18 empirical success rate 1.0 0.9 0.8 0.7 0.6 0.5 0.5 0.6 0.7 0.8 0.9 estimated probability of succes 1.0 Figure 6: Top-two Thompson sampling was run 100 times for each budget for the experiment with R0 = 2.4. For each of the recommendations, Ps was computed. The Ps values were binned: 0.5 to 1 in steps of 0.05. Per bin, we thus have a set of Bernoulli trials, for which we show the empirical success rate (blue scatter) and the Clopper-Pearson confidence interval (blue confidence bounds) [15]. The orange reference line denotes perfect correlation between the empirical success rate and the estimated probability of success. preventive bandits only learn with respect to a single model outcome (i.e., the proportion of symptomatic infections). However, for many pathogens it is interesting to incorporate multiple objectives (e.g., morbidity, mortality, cost). In the future, we aim to use multi-objective multi-armed bandits [17] in contrast to the current single-objective preventive bandits. With this approach, we plan to learn a coverage set containing an optimal strategy for every possible preference profile the decision makers might have [50]. Statement with respect to the reproducibility of our research: if this manuscript is accepted, all source code used in our experiments will be made publicly available. 19 Acknowledgments Pieter Libin was supported by a PhD grant of the FWO (Fonds Wetenschappelijk Onderzoek Vlaanderen) and the VUB research council (VUB/OZR2714). Timothy Verstraeten was supported by a PhD grant of the FWO (Fonds Wetenschappelijk Onderzoek Vlaanderen) and the VUB research council (VUB/OZR2884). Kristof Theys was supported by a postdoctoral grant of the FWO (Fonds Wetenschappelijk Onderzoek Vlaanderen). Diederik Roijers was supported by a postdoctoral grant of the FWO (Fonds Wetenschappelijk Onderzoek Vlaanderen). The computational resources and services used in this work were provided by the Hercules Foundation and the Flemish Government department EWI-FWO Krediet aan Navorsers (Theys, KAN2012 1.5.249.12.). 20 Supplementary Information S1 Introduction In this Supplementary Information we provide a proof for BayesGap’s simple regret bound (Section 2). Furthermore, we provide additional figures that were omitted from the main manuscript: figures for the outcome (i.e., epidemic size) distributions (Section 3), figures for the experimental success rates (Section 4), figures for the probabilities of success (i.e., Ps values) per budget (Section 5) and figures for the binned distribution over Ps values (Section 6). Finally, in Section 7, we describe the computational resources that were used to execute the simulations. S2 BayesGap simple regret bound for T-distributed posteriors Lemma 1. Consider a Jeffrey’s prior (µk , σk2 ) ∼ σk−3 over the parameters of the Gaussian reward distributions. Then the posterior mean of arm k has the following nonstandardized t-distribution at pull nk : p µk | x̄k,nk , Sk,nk ∼ Tnk (x̄k,nk , n−1 Sk,nk ) k where nk is the number of pulls for arm k, x̄k,nk is the sample mean and Sk,nk is the sum of squares. Proof. This lemma was presented and proved by Honda et al. [34]. Lemma 2. Consider a random variable X ∼ Tν (µ, λ) with variance σ 2 = ν 2 ν−2 λ , ν > 2 and β > 0. The probability that X is within a radius βσ from its mean can then be written as: P (|X − µ| < βσ) ≥ 1 − 2 where C(ν) = ν C(ν) ν−1 β  −0.5(ν−1) β2 1+ ν Γ(0.5ν + 0.5) √ Γ(0.5ν) πν is the normalizing constant of a standard t-distribution. Proof. Consider a random variable Z ∼ Tν (0, 1), ν > 2 and β > 0. Then the 1 probability of Z being greater than β P (Z > β r Z ν (1) )= ν−2 +∞ β √ ν ν−2 q ν ν−2 is: Tν (z | 0, 1)dz  −0.5(ν+1) z2 1 + dz √ ν ν β ν−2  −0.5(ν+1) Z +∞ (2) z2 z q 1+ dz ≤ C(ν) √ ν ν ν β ν−2 β ν−2 √ −0.5(ν+1)  Z +∞ ν−2 ν ν −1 z2 √ C(ν) √ =− − z 1+ dz ν ν−1 β ν ν ν β ν−2 p  −0.5(ν−1) +∞ ν(ν − 2) C(ν) z2 (3) 1+ = − ν−1 β ν √ ν = C(ν) Z +∞ β ν−2 p  −0.5(ν−1) ν(ν − 2) C(ν) β2 (4) 1+ = ν −1 β ν −2 q ν The probability of Z being greater than the lower bound β ν−2 is the integral over its probability density function, starting from that lower bound (1). In the integral, we introduce a factor β √z ν , which is greater than 1 for the considered ν−2 values of z (2). We then take note of the following derivative, and use this result to analytically solve the integral (3): d dx  −0.5(ν−1) −0.5(ν+1)  x2 x2 ν −1 1+ x 1+ =− ν ν ν Finally, we solve the primitive from β √z ν to infinity (4). ν−2 Next, we apply a union bound to obtain q a lower bound on the probability ν that the magnitude of Z is smaller than β ν−2 : P (|Z| < β r ν )≥1−2 ν −2 Finally, consider Z = P (|X − µ| < β r p  −0.5(ν−1) ν(ν − 2) C(ν) β2 1+ ν −1 β ν −2 (X−µ) : λ ν λ) ≥ 1 − 2 ν −2 p  −0.5(ν−1) ν(ν − 2) C(ν) β2 1+ ν −1 β ν −2 Lemma 3. Consider a K-armed bandit problem with budget T and K arms. Let Uk (t) and Lk (t) be upper and lower bounds that hold for all times t ≤ T and 2 all arms k ≤ K with probability 1 − δk (t). Finally, let gk be a monotonically K P gk−1 (Hk,ǫ ) ≤ decreasing function such that Uk (t) − Lk (t) ≤ gk (nk (t − 1)) and T − K. We can then bound the simple regret RT as: P (RT < ǫ) ≥ 1 − K X T X k=1 δk (t) k=1 t=1 Proof. First, we define E as the event in which every mean µk is bounded by its associated bounds (i.e., Uk (t) and Lk (t)) for each time step [33]. E := ∀k ≤ K, ∀t ≤ T : Lk (t) ≤ µk ≤ Uk (t) The probability of µk deviating from a single bound at time t is by definition T K P P δk (t). δk (t). When applying the union bound, we obtain P (E) ≥ 1 − k=1 t=1 The probability of regret is equal to the probability of the event E occuring, as proven in [33]. Theorem 1. Consider a K-armed Gaussian bandit problem with budget T and 2 unknown variance. Let σG be a generalization of that variance over all arms, and Uk (t) and Lk (t) respectively be the upper and lower bounds for each arm k at time t, where Uk (t) = µ̂k (t) + β σ̂k (t) and Lk (t) = µ̂k (t) − β σ̂k (t). The simple regret is then bounded as: p  −0.5(nk (t)−1) nk (t)(nk (t) − 2) C(nk (t)) β2 P (RT ≤ ǫ) ≥ 1 − 2 1+ nk (t) − 1 β nk (t) − 2 k=1 t=1    −0.5 min nk (t) k,t 2 β     ≥ 1 − O KT 1 +  min nk (t) K X T X k,t where: β= s T − 3K 2 4Hǫ σG Note that when min nk (t) → +∞, the bound decreases exponentially in β, simik,t lar to the problem setting presented in [33]. Intuitively, this result makes sense, as for known variances, a Gaussian can be used to describe the posterior means, and indeed, as the number of pulls approaches infinity, our t-distributions converge to Gaussians. Proof. According to Lemma 1, the posterior over the average reward is a t- 3 distribution with scaling factor λk (t) = nk (t)−1 p Sk,nk (t) . Therefore, Uk (t + 1) − Lk (t + 1) = 2β σ̂k (t) p (1) = 2β nk (t)(nk (t) − 2)−1 λk (t)2 q (2) = nk (t)(nk (t) − 2)−1 nk (t)−2 Sk,nk (t) s Sk,nk (t) = (nk (t) − 2)−1 nk (t) q (3) = (nk (t) − 2)−1 s2k (t) (4) = gk (nk (t)) k (t) λk (t)2 for arm k at time t, with The variance of a t-distribution equals nkn(t)−2 scaling factor λk (t) as described in Lemma 1 (1 + 2). We denote the variance over rewards per arm as s2k (t) (3) and define gk (nk (t)) to be the upper bound expression as specified in Lemma 3 (4). Next, we compute the inverse of gk (n): gk−1 (m) = 4β 2 s2k (t) +2 m2 2 We generalize s2k (t) to a variance σG representative for all arms.2 Approximating P −2 the hardness of the problem as Hǫ = k Hk,ǫ , where Hk,ǫ is the arm-dependent hardness defined in [33], we obtain β as follows: K X k=1 2 gk−1 (Hkǫ ) ≈ 4β 2 σG Hǫ + 2K = T − K ⇔β= s T − 3K 2 4Hǫ σG Finally, as the conditions in Lemma 3 on the function gk are now satisfied, the simple regret bound can be obtained using Lemma 3 and the probability that the true mean is out of the arm-specific bounds Uk (t) and Lk (t), given in Lemma 2. 2 In the main paper, we choose σ 2 = s̄2 to be the mean over all arm-specific variances G G obtained after the initialization phase. 4 S3 vaccine allocation strategy vaccine allocation strategy 0.0 0.1 0.2 0.3 Outcome (i.e., epidemic size) distributions 0.3 0.2 0.1 0.0 (b) Outcome distributions for R0 = 1.6. 0.4 0.3 0.2 0.1 vaccine allocation strategy 0.0 0.50 0.51 0.52 (d) Outcome distributions for R0 = 2.0. vaccine allocation strategy (a) Outcome distributions for R0 = 1.4. 0.4 0.3 0.2 0.1 0.0 0.5 (c) Outcome distributions for R0 = 1.8. 0.4 0.3 0.2 0.49 (f) Outcome distributions for R0 = 2.4. vaccine allocation strategy 0 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 29 30 31 0.1 vaccine allocation strategy (e) Outcome distributions for R0 = 2.2. 0.0 5 0 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 29 30 31 epidemic size 0 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 29 30 31 epidemic size epidemic size epidemic size epidemic size epidemic size 0 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 29 30 31 0 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 29 30 31 0 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 29 30 31 Bandit run success rates 1.0 1.0 0.8 0.8 success rate success rate S4 0.6 0.4 BG SR TtTs Uni 0.2 0.0 100 200 300 budget 400 100 1.0 0.8 0.8 0.6 0.4 BG SR TtTs Uni 0.0 100 200 300 budget 400 100 success rate 0.8 0.4 BG SR TtTs Uni 400 200 300 budget 400 500 (d) Bandit run results for R0 = 2.0. 0.6 300 budget BG SR TtTs Uni 0.0 500 0.8 200 500 0.4 1.0 100 400 0.6 1.0 0.0 300 budget 0.2 (c) Bandit run results for R0 = 1.8. 0.2 200 (b) Bandit run results for R0 = 1.6. 1.0 0.2 BG SR TtTs Uni 0.0 500 success rate success rate 0.4 0.2 (a) Bandit run results for R0 = 1.4. success rate 0.6 0.6 0.4 BG SR TtTs Uni 0.2 0.0 500 100 (e) Bandit run results for R0 = 2.2. 200 300 budget 400 500 (f) Bandit run results for R0 = 2.4. 6 S5 Ps values for Top-two Thompson sampling 1.0 0.9 probability of success probability of success 1.0 0.8 0.7 0.6 0.5 success failure 0.4 100 200 300 budget 400 0.9 0.8 0.7 500 100 1.0 1.0 0.9 0.9 0.8 0.7 0.5 success failure 100 200 300 budget 400 500 100 0.9 probability of success probability of success 200 300 budget 400 500 (d) Ps values for R0 = 2.0. 0.8 0.7 0.6 0.5 0.8 0.7 0.6 0.5 0.4 success failure 400 success failure 0.5 1.0 300 budget 500 0.6 0.9 200 400 0.7 1.0 100 300 budget 0.8 (c) Ps values for R0 = 1.8. 0.4 200 (b) Ps values for R0 = 1.6. probability of success probability of success (a) Ps values for R0 = 1.4. 0.6 success failure 0.6 success failure 0.3 500 100 (e) Ps values for R0 = 2.2. 200 300 budget 400 500 (f) Ps values for R0 = 2.4. 7 S6 Binned distribution of Ps values for Top-two Thompson sampling 1.0 0.9 empirical success rate empirical success rate 1.0 0.8 0.7 0.6 0.5 0.4 0.5 0.6 0.7 0.8 0.9 estimated probability of succes 0.4 0.2 0.5 0.6 0.7 0.8 0.9 estimated probability of succes 1.0 (b) Binned distribution for R0 = 1.6. 1.0 1.0 0.8 empirical success rate empirical success rate 0.6 0.0 1.0 (a) Binned distribution for R0 = 1.4. 0.6 0.4 0.2 0.8 0.6 0.4 0.2 0.0 0.5 0.6 0.7 0.8 0.9 estimated probability of succes 1.0 0.5 (c) Binned distribution for R0 = 1.8. 0.6 0.7 0.8 0.9 estimated probability of succes 1.0 (d) Binned distribution for R0 = 2.0. 1.0 1.0 0.9 0.9 empirical success rate empirical success rate 0.8 0.8 0.7 0.6 0.5 0.4 0.8 0.7 0.6 0.5 0.5 0.6 0.7 0.8 0.9 estimated probability of succes 1.0 0.5 (e) Binned distribution for R0 = 2.2. 0.6 0.7 0.8 0.9 estimated probability of succes 1.0 (f) Binned distribution for R0 = 2.4. 8 S7 Computational resources The simulations were run on a high performance cluster (HPC). On this HPC, we used “Ivy Bridge” nodes, more specifically nodes with two 10-core ”Ivy Bridge” Xeon E5-2680v2 CPUs (2.8 GHz, 25 MB level 3 cache) and 64 GB of RAM. This infrastructure allowed us to run 20 FluTE simulations per node. 9 References [1] Abul K Abbas, Andrew H H Lichtman, and Shiv Pillai. Cellular and molecular immunology. Elsevier Health Sciences, 2014. [2] Milton Abramowitz and Irene A Stegun. Handbook of mathematical functions: with formulas, graphs, and mathematical tables, volume 55. Courier Corporation, 1964. [3] Shipra Agrawal and Navin Goyal. Analysis of Thompson sampling for the multi-armed bandit problem. In Conference on Learning Theory, pages 31–39, 2012. [4] Maira Aguiar and Nico Stollenwerk. Dengvaxia efficacy dependency on serostatus: a closer look at more recent data. Clinical Infectious Diseases, 2017. [5] Sigrún Andradóttir, Wenchi Chiu, David Goldsman, Mi Lim Lee, KwokLeung Tsui, Beate Sander, David N Fisman, and Azhar Nizam. Reactive strategies for containing developing outbreaks of pandemic influenza. BMC public health, 11(1):S1, 2011. [6] Jean-Yves Audibert and Sébastien Bubeck. Best arm identification in multi-armed bandits. In COLT-23th Conference on Learning Theory, 2010. [7] Peter Auer, Nicolò Cesa-Bianchi, and Paul Fischer. Finite-time analysis of the multiarmed bandit problem. Machine Learning, 47(2-3):235–256, 2002. ISSN 08856125. [8] Nicole E Basta, Dennis L Chao, M Elizabeth Halloran, Laura Matrajt, and Ira M Longini. Strategies for pandemic and seasonal influenza vaccination of schoolchildren in the United States. American journal of epidemiology, 170(6):679–686, 2009. [9] Tom Britton. Stochastic epidemic models: a survey. Mathematical biosciences, 225(1):24–35, 2010. [10] Sébastien Bubeck, Rémi Munos, and Gilles Stoltz. Pure exploration in multi-armed bandits problems. In International conference on Algorithmic learning theory, pages 23–37. Springer, 2009. [11] Sébastien Bubeck, Rémi Munos, and Gilles Stoltz. Pure exploration in finitely-armed and continuous-armed bandits. Theoretical Computer Science, 412(19):1832–1852, 2011. [12] Dennis L Chao, M Elizabeth Halloran, Valerie J Obenchain, and Ira M Longini Jr. FluTE, a publicly available stochastic influenza epidemic simulation model. PLoS Computational Biology, 6(1):e1000656, 2010. 10 [13] Dennis L. Chao, Scott B. Halstead, M. Elizabeth Halloran, and Ira M. Longini. Controlling Dengue with Vaccines in Thailand. PLoS Neglected Tropical Diseases, 6(10), 2012. ISSN 19352727. [14] Olivier Chapelle and Lihong Li. An empirical evaluation of thompson sampling. In Advances in neural information processing systems, pages 2249– 2257, 2011. [15] Charles J Clopper and Egon S Pearson. The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika, pages 404–413, 1934. [16] Ilaria Dorigatti, Simon Cauchemez, Andrea Pugliese, and Neil Morris Ferguson. A new approach to characterising infectious disease transmission dynamics from sentinel surveillance: application to the Italian 2009/2010 A/H1N1 influenza pandemic. Epidemics, 4(1):9–21, 2012. [17] Madalina M. Drugan and Ann Nowe. Designing multi-objective multiarmed bandits algorithms: A study. In Proceedings of the International Joint Conference on Neural Networks, 2013. ISBN 9781467361293. [18] Martin Enserink. Crisis underscores fragility of vaccine production system. Science, 306(5695):385, 2004. [19] S.G. Eubank, V.S.a. Kumar, M.V. Marathe, A. Srinivasan, and N. Wang. Structure of social contact networks and their impact on epidemics. DIMACS Series in Discrete Mathematics and Theoretical Computer Science, 70(0208005):181, 2006. ISSN 1052-1798. [20] Stephen G. Eubank, Hasan Guclu, V S Anil Kumar, Madhav V Marathe, Aravind Srinivasan, Zoltan Toroczkai, and Nan Wang. Modelling disease outbreaks in realistic urban social networks. Nature, 429(6988):180–184, 2004. [21] Eyal Even-Dar, Shie Mannor, and Yishay Mansour. Action elimination and stopping conditions for the multi-armed bandit and reinforcement learning problems. Journal of machine learning research, 7(Jun):1079–1105, 2006. [22] Neil M Ferguson, Derek A T Cummings, Simon Cauchemez, Christophe Fraser, and Others. Strategies for containing an emerging influenza pandemic in Southeast Asia. Nature, 437(7056):209, 2005. [23] Neil M Ferguson, Isabel Rodrı́guez-Barraquer, Ilaria Dorigatti, Luis Mier-y Teran-Romero, Daniel J Laydon, and Derek A T Cummings. Benefits and risks of the Sanofi-Pasteur dengue vaccine: Modeling optimal deployment. Science, 353(6303):1033–1036, 2016. ISSN 00429686. [24] Christophe Fraser, Derek A T Cummings, Don Klinkenberg, Donald S Burke, and Neil M Ferguson. Influenza transmission in households during the 1918 pandemic. American journal of epidemiology, 174(5):505–514, 2011. 11 [25] Laura Fumanelli, Marco Ajelli, Stefano Merler, Neil M. Ferguson, and Simon Cauchemez. Model-Based Comprehensive Analysis of School Closure Policies for Mitigating Influenza Epidemics and Pandemics. PLoS Computational Biology, 12(1), 2016. ISSN 15537358. [26] Aurélien Garivier and Emilie Kaufmann. Optimal best arm identification with fixed confidence. In Conference on Learning Theory, pages 998–1027, 2016. [27] T. C. Germann, K. Kadau, I. M. Longini, and C. A. Macken. Mitigation strategies for pandemic influenza in the United States. Proceedings of the National Academy of Sciences, 103(15):5935–5940, 2006. ISSN 0027-8424. [28] Sri Rezeki Hadinegoro, Jose Luis Arredondo-Garcı́a, Maria Rosario Capeding, Carmen Deseda, Tawee Chotpitayasunondh, Reynaldo Dietze, H.I. Hj Muhammad Ismail, Humberto Reynales, Kriengsak Limkittikul, Doris Maribel Rivera-Medina, Huu Ngoc Tran, Alain Bouckenooghe, Danaya Chansinghakul, Margarita Cortés, Karen Fanouillere, Remi Forrat, Carina Frago, Sophia Gailhardou, Nicholas Jackson, Fernando Noriega, Eric Plennevaux, T. Anh Wartel, Betzana Zambrano, and Melanie Saville. Efficacy and Long-Term Safety of a Dengue Vaccine in Regions of Endemic Disease. New England Journal of Medicine, 373(13):1195–1206, 2015. ISSN 0028-4793. [29] M Elizabeth Halloran, Ira M Longini, Azhar Nizam, and Yang Yang. Containing bioterrorist smallpox. Science (New York, N.Y.), 298(5597):1428– 1432, 2002. ISSN 00368075. [30] M Elizabeth Halloran, Neil M Ferguson, Stephen Eubank, Ira M Longini, Derek A T Cummings, Bryan Lewis, Shufu Xu, Christophe Fraser, Anil Vullikanti, Timothy C Germann, and Others. Modeling targeted layered containment of an influenza pandemic in the United States. Proceedings of the National Academy of Sciences, 105(12):4639–4644, 2008. [31] Matthew Hartfield and Samuel Alizon. Introducing the outbreak threshold in epidemiology. PLoS Pathog, 9(6):e1003277, 2013. [32] Robbins Herbert. Some Aspects of the Sequential Design of Experiments. Bulletin of the American Mathematical Society, 58(5):527–535, 1952. ISSN 02730979. [33] Matthew Hoffman, Bobak Shahriari, and Nando Freitas. On correlation and budget constraints in model-based bandit optimization with application to automatic machine learning. In Artificial Intelligence and Statistics, pages 365–374, 2014. [34] Junya Honda and Akimichi Takemura. Optimality of Thompson Sampling for Gaussian Bandits Depends on Priors. In AISTATS, pages 375–383, 2014. 12 [35] Kevin Jamieson, Matthew Malloy, Robert Nowak, and Sébastien Bubeck. lil’ucb: An optimal exploration algorithm for multi-armed bandits. In Conference on Learning Theory, pages 423–439, 2014. [36] Christopher Jennison, Iain M Johnstone, and Bruce W Turnbull. Asymptotically optimal procedures for sequential adaptive selection of the best of several normal means. Statistical decision theory and related topics III, 2: 55–86, 1982. [37] Emilie Kaufmann and Shivaram Kalyanakrishnan. Information complexity in bandit subset selection. In Conference on Learning Theory, pages 228– 251, 2013. [38] Emilie Kaufmann, Olivier Cappé, and Aurélien Garivier. On the complexity of best arm identification in multi-armed bandit models. Journal of Machine Learning Research, 17(1):1–42, 2016. [39] Pieter Libin, Timothy Verstraeten, Kristof Theys, Diederik Roijers, Peter Vrancx, and Ann Nowe. Efficient evaluation of influenza mitigation strategies using preventive bandits. AAMAS 2017 Visionary Papers, Lecture Notes in AI, Volume 10643, page In press, 2017. [40] James O Lloyd-Smith, Sebastian J Schreiber, P Ekkehard Kopp, and Wayne M Getz. Superspreading and the effect of individual variation on disease emergence. Nature, 438(7066):355–359, 2005. [41] Ira M Longini Jr, M Elizabeth Halloran, Azhar Nizam, and Yang Yang. Containing pandemic influenza with antiviral agents. American journal of epidemiology, 159(7):623–633, 2004. [42] Huong Q. McLean, Mark G. Thompson, Maria E. Sundaram, Burney A. Kieke, Manjusha Gaglani, Kempapura Murthy, Pedro A. Piedra, Richard K. Zimmerman, Mary Patricia Nowalk, Jonathan M. Raviotta, Michael L. Jackson, Lisa Jackson, Suzanne E. Ohmit, Joshua G. Petrie, Arnold S. Monto, Jennifer K. Meece, Swathi N. Thaker, Jessie R. Clippard, Sarah M. Spencer, Alicia M. Fry, and Edward A. Belongia. Influenza vaccine effectiveness in the United States during 2012-2013: Variable protection by age and virus type. Journal of Infectious Diseases, 211(10): 1529–1540, 2015. ISSN 15376613. [43] Jan Medlock and Alison P Galvani. Optimizing influenza vaccine distribution. Science, 325(5948):1705–1708, 2009. ISSN 0036-8075. [44] Lauren Ancel Meyers, M. E J Newman, Michael Martin, and Stephanie Schrag. Applying network theory to epidemics: Control measures for Mycoplasma pneumoniae outbreaks. Emerging Infectious Diseases, 9(2):204– 210, 2003. ISSN 10806040. 13 [45] N. A M Molinari, Ismael R. Ortega-Sanchez, Mark L. Messonnier, William W. Thompson, Pascale M. Wortley, Eric Weintraub, and Carolyn B. Bridges. The annual impact of seasonal influenza in the US: Measuring disease burden and costs. Vaccine, 25(27):5086–5096, 2007. ISSN 0264410X. [46] Henry Nicholls. Pandemic influenza: the inside story. PLoS Biol, 4(2):e50, 2006. ISSN 1545-7885. [47] K David Patterson and Gerald F Pyle. The geography and mortality of the 1918 influenza pandemic. Bulletin of the History of Medicine, 65(1):4, 1991. [48] Catharine Paules and Kanta Subbarao. Influenza. The Lancet, pages –, 2017. ISSN 0140-6736. [49] Warren B Powell and Ilya O Ryzhov. Optimal learning, volume 841. John Wiley & Sons, 2012. [50] Diederik M. Roijers, Peter Vamplew, Shimon Whiteson, and Richard Dazeley. A survey of multi-objective sequential decision-making. Journal of Artificial Intelligence Research, 48:67–113, 2013. ISSN 10769757. [51] Daniel Russo. Simple bayesian algorithms for best arm identification. In Conference on Learning Theory, pages 1417–1418, 2016. [52] Klaus Stöhr. Influenza: WHO cares. The Lancet infectious diseases, 2(9): 517, 2002. [53] R S Sutton and A G Barto. Reinforcement learning: an introduction. 1998. ISBN 0262193981. [54] William R Thompson. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. Biometrika, 25 (3/4):285–294, 1933. [55] Duncan J Watts, Roby Muhamad, Daniel C Medina, and Peter S Dodds. Multiscale, resurgent epidemics in a hierarchical metapopulation model. Proceedings of the National Academy of Sciences of the United States of America, 102(32):11157–11162, 2005. [56] WHO. WHO guidelines on the use of vaccines and antivirals during influenza pandemics. 2004. [57] Lander Willem, Sean Stijven, Ekaterina Vladislavleva, Jan Broeckhove, Philippe Beutels, and Niel Hens. Active Learning to Understand Infectious Disease Models and Improve Policy Making. PLoS Comput Biol, 10(4): e1003563, 2014. 14 [58] Joseph T Wu, Steven Riley, Christophe Fraser, and Gabriel M Leung. Reducing the impact of the next influenza pandemic using household-based public health interventions. PLoS medicine, 3(9):e361, 2006. [59] Wan Yang, Jonathan D Sugimoto, M Elizabeth Halloran, Nicole E Basta, Dennis L Chao, Laura Matrajt, Gail Potter, Eben Kenah, and Ira M Longini. The transmissibility and control of pandemic influenza A (H1N1) virus. Science (New York, N.Y.), 326(2009):729–33, 2009. ISSN 1095-9203. 15
2cs.AI
Convex and non-convex regularization methods for spatial point processes intensity estimation Achmad Choiruddin1 , Jean-François Coeurjolly1, 2 , and Frédérique Letué1 arXiv:1703.02462v1 [stat.ME] 7 Mar 2017 1 Laboratory Jean Kuntzmann, Department of Probability and Statistics, Université Grenoble Alpes, France 2 Department of Mathematics, Université du Québec à Montréal (UQAM), Canada March 8, 2017 Abstract This paper deals with feature selection procedures for spatial point processes intensity estimation. We consider regularized versions of estimating equations based on Campbell theorem derived from two classical functions: Poisson likelihood and logistic regression likelihood. We provide general conditions on the spatial point processes and on penalty functions which ensure consistency, sparsity and asymptotic normality. We discuss the numerical implementation and assess finite sample properties in a simulation study. Finally, an application to tropical forestry datasets illustrates the use of the proposed methods. 1 Introduction Spatial point pattern data arise in many contexts where interest lies in describing the distribution of an event in space. Some examples include the locations of trees in a forest, gold deposits mapped in a geological survey, stars in a cluster star, animal sightings, locations of some specific cells in retina, or road accidents (see e.g. Møller and Waagepetersen, 2004; Illian et al., 2008; Baddeley et al., 2015). Interest in methods for analyzing spatial point pattern data is rapidly expanding accross many fields of science, notably in ecology, epidemiology, biology, geosciences, astronomy, and econometrics. One of the main interests when analyzing spatial point pattern data is to estimate the intensity which characterizes the probability that a point (or an event) occurs in an infinitesimal ball around a given location. In practice, the intensity is often assumed to be a parametric function of some measured covariates (e.g. Waagepetersen, 1 2007; Guan and Loh, 2007; Møller and Waagepetersen, 2007; Waagepetersen, 2008; Waagepetersen and Guan, 2009; Guan and Shen, 2010; Coeurjolly and Møller, 2014). In this paper, we assume that the intensity function ρ is parameterized by a vector β and has a log-linear specification ρ(u; β) = exp(β > z(u)), (1.1) where z(u) = {z1 (u), . . . , zp (u)}> are the p spatial covariates measured at location u and β = {β1 , . . . , βp }> is a real p-dimensional parameter. When the intensity is a function of many variables, covariates selection becomes inevitable. Variable selection in regression has a number of purposes: provide regularization for good estimation, obtain good prediction, and identify clearly the important variables (e.g. Fan and Lv, 2010; Mazumder et al., 2011). Identifying a set of relevant features from a list of many features is in general combinatorially hard and computationally intensive. In this context, convex relaxation techniques such as lasso (Tibshirani, 1996) have been effectively used for variable selection and parameter estimation simultaneously. The lasso procedure aims at minimizing: − log L(β) + λkβk1 where L(β) is the likelihood function for some model of interest. The `1 penalty shrinks coefficients towards zero, and can also set coefficients to be exactly zero. In the context of variable selection, the lasso is often thought of as a convex surrogate for the best-subset selection problem: − log L(β) + λkβk0 . P The `0 penalty kβk0 = pi=1 I(|βi | > 0) penalizes the number of nonzero coefficients in the model. Since lasso can be suboptimal in model selection for some cases (e.g. Fan and Li, 2001; Zou, 2006; Zhang and Huang, 2008), many regularization methods then have been developped, motivating to go beyond `1 regime to more aggressive non-convex penalties which bridges the gap between `1 and `0 such as SCAD (Fan and Li, 2001) and MC+ (Zhang, 2010). More recently, there were several works on implementing variable selection for spatial point processes in order to reduce variance inflation from overfitting and bias from underfitting. Thurman and Zhu (2014) focused on using adaptive lasso to select variables for inhomogeneous Poisson point processes. This study then later was extended to the clustered spatial point processes by Thurman et al. (2015) who established the asymptotic properties of the estimates in terms of consistency, sparsity, and normality distribution. They also compared their results employing adaptive lasso to SCAD and adaptive elastic net in the simulation study and application, using both regularized weighted and unweighted estimating equations derived from the Poisson likelihood. Yue and Loh (2015) considered modelling spatial point data with Poisson, pairwise interaction point processes, and Neyman-Scott cluster models, incorporated lasso, adaptive lasso, and elastic net regularization methods into generalized linear model framework for fitting these point models. Note that the 2 study by Yue and Loh (2015) also used an estimating equation derived from the Poisson likelihood. However, Yue and Loh (2015) did not provide the theoretical study in detail. Although, in application, many penalty functions have been employed to regularization methods for spatial point processes intensity estimation, the theoretical study is still restricted to some specific penalty functions. In this paper, we propose regularized versions of estimating equations based on Campbell formula derived from the Poisson and the logistic regression likelihoods to estimate the intensity of the spatial point processes. We consider both convex and non-convex penalty functions. We provide general conditions on the penalty function to ensure an oracle property and a central limit theorem. Thus, we extend the work by Thurman et al. (2015) and obtain the theoretical results for more general penalty functions and under less restrictive assumptions on the asymptotic covariance matrix (see Remark 3). The logistic regression method proposed by Baddeley et al. (2014) is as easy to implement as the Poisson likelihood method, but is less biased since it does not require deterministic numerical approximation. We prove that the estimates obtained by regularizing the logistic regression likelihood can also satisfy asymptotic properties (see Remark 2). Our procedure is straightforward to implement since we only need to combine the spatstat R package with the two R packages glmnet and ncvreg. The remainder of the paper is organized as follows. Section 2 gives backgrounds on spatial point processes. Section 3 describes standard parameter estimation methods when there is no regularization, while regularization methods are developed in Section 4. Section 5 develops numerical details induced by the methods introduced in Sections 3-4. Asymptotic properties following the work by Fan and Li (2001) for generalized linear models are presented in Section 6. Section 7 investigates the finite-sample properties of the proposed method in a simulation study, followed by an application to tropical forestry datasets in Section 8, and finished by conclusion and discussion in Section 9. Proofs of the main results are postponed to Appendices A-C. 2 Spatial point processes Let X be a spatial point process on Rd . Let D ⊂ Rd be a compact set of Lebesgue measure |D| which will play the role of the observation domain. We view X as a locally finite random subset of Rd , i.e. the random number of points of X in B, N (B), is almost surely finite whenever B ⊂ Rd is a bounded region. Suppose x = {x1 , x2 , . . . , xm } denotes a realization of X observed within a bounded region D, where xi , i = 1, . . . , m represent the locations of the observed points, and m is the number of points. Note that m is random and 0 ≤ m < ∞. If m = 0 then x = ∅ is the empty point pattern in D. For further background material on spatial point processes, see for example Møller and Waagepetersen (2004). 3 2.1 Moments The first and second-order properties of a point process are described by intensity measure and second-order factorial moment measure. First-order properties of a point process indicate the spatial distribution events in domain of interest. The intensity measure µ on Rd is given by µ(B) = EN (B), B ⊆ Rd . If the intensity measure µ can be written as Z µ(B) = ρ(u)du, B ⊆ Rd , B where ρ is a nonnegative function, then ρ is called the intensity function. If ρ is constant, then X is said to be homogeneous or first-order stationary with intensity ρ. Otherwise, it is said to be inhomogeneous. We may interpret ρ(u)du as the probability of occurence of a point in an infinitesimally small ball with centre u and volume du. Second-order properties of a point process indicate the spatial coincidence of events in the domain of interest. The second-order factorial moment measure α(2) on Rd × Rd is given by (2) α (C) = E 6= X I[(u, v) ∈ C], C ⊆ Rd × Rd . u,v∈X where the 6= over the summation sign means that the sum runs over all pairwise different points u, v in X, and I[.] is the indicator function. If the second-order factorial moment measure α(2) can be written as Z Z (2) α (C) = I[(u, v) ∈ C]ρ(2) (u, v)dudv, C ⊆ Rd × Rd , where ρ(2) is a nonnegative function, then ρ(2) is called the second-order product density. Intuitively, ρ(2) (u, v)dudv is the probability for observing a pair of points from X occuring jointly in each of two infinitesimally small balls with centres u, v and volume du, dv. Fore more detail description of moment measures of any order, see appendix C in Møller and Waagepetersen (2004). Suppose X has intensity function ρ and second-order product density ρ(2) . Campbell theorem (see e.g. Møller and Waagepetersen, 2004) states that, for any function k : Rd → [0, ∞) or k : Rd × Rd → [0, ∞) Z X E k(u) = k(u)ρ(u)du (2.1) u∈X E 6= X Z Z k(u, v) = k(u, v)ρ(2) (u, v)dudv. u,v∈X 4 (2.2) In order to study whether a point process deviates from independence (i.e., Poisson point process), we often consider the pair correlation function given by g(u, v) = ρ(2) (u, v) ρ(u)ρ(v) when both ρ and ρ(2) exist with the convention 0/0 = 0. For a Poisson point process (Section 2.2.1), we have ρ(2) (u, v) = ρ(u)ρ(v) so that g(u, v) = 1. If, for example, g(u, v) > 1 (resp. g(u, v) < 1), this indicates that pair of points are more likely (resp. less likely) to occur at locations u, v than for a Poisson point process with the same intensity function as X. In the same spirit, we can define ρ(k) the k-th order intensity function (see Møller and Waagepetersen, 2004, for more details). If for any u, v, g(u, v) depends only on u − v, the point process X is said to be second-order reweighted stationary. 2.2 Modelling the intensity function We discuss spatial point process models specified by deterministic or random intensity function. Particularly, we consider two important model classes, namely Poisson and Cox processes. Poisson point processes serve as a tractable model class for no interaction or complete spatial randomness. Cox processes form major classes for clustering or aggregation. For conciseness, we focus on the two later classes of models. We could also have presented determinantal point processes (e.g. Lavancier et al., 2015) which constitute an interesting class of repulsive point patterns with explicit moments. This has not been further investigated for sake of brevity. In this paper, we focus on log-linear models of the intensity function given by (1.1). 2.2.1 Poisson point process A point process X on D is a Poisson point process with intensity function ρ, assumed to be locally integrable, if the following conditions are satisfied: 1. for any B ⊆ D with 0 ≤ µ(B) < ∞, N (B) ∼ P oisson(µ(B)), 2. conditionally on N (B), the points in X ∩ B are i.i.d. with joint density proportional to ρ(u), u ∈ B. A Poisson point process with a log-linear intensity function is also called a modulated Poisson point process (e.g. Møller and Waagepetersen, 2007; Waagepetersen, 2008). In particular, for Poisson point processes, ρ(2) (u, v) = ρ(u)ρ(v), and g(u, v) = 1, ∀u, v ∈ D. 2.2.2 Cox processes A Cox process is a natural extension of a Poisson point process, obtained by considering the intensity function of the Poisson point process as a realization of a random field. Suppose that Λ = {Λ(u) : u ∈ D} is a nonnegative random field. If the 5 conditional distribution of X given Λ is a Poisson point process on D with intensity function Λ, then X is said to be a Cox process driven by Λ (see e.g. Møller and Waagepetersen, 2004). There are several types of Cox processes. Here, we consider two types of Cox processes: a Neyman-Scott point process and a log Gaussian Cox process. Neyman-Scott point processes. Let C be a stationary Poisson process (mother process) with intensity κ > 0. Given C, let Xc , c ∈ C, be independent Poisson processes (offspring processes) with intensity function ρc (u; β) = exp(β > z(u))k(u − c; ω)/κ, where k is a probability density function determining the distribution of offspring points around the mother points parameterized by ω. Then X = ∪c∈C Xc is a special case of an inhomogeneous Neyman-Scott point process with mothers C and offspring Xc ,P c ∈ C. The point process X is a Cox process driven by Λ(u) = > exp(β z(u)) c∈C k(u − c, ω)/κ (e.g. Waagepetersen, 2007; Coeurjolly and Møller, 2014) and we can verify that the intensity function of X is indeed ρ(u; β) = exp(β > z(u)). One example of Neyman-Scott point process is the Thomas process where k(u) = (2πω 2 )−d/2 exp(−kuk2 /(2ω 2 )) is the density for Nd (0, ω 2 Id ). Conditionally on a parent event at location c, children events are normally distributed around c. Smaller values of ω correspond to tighter clusters, and smaller values of κ correspond to fewer number of parents. The parameter vector ψ = (κ, ω)> is referred to as the interaction parameter as it modulates the spatial interaction (or, dependence) among events. Log Gaussian Cox process. Suppose that log Λ is a Gaussian random field. Given Λ, the point process X follows Poisson process. Then X is said to be a log Gaussian Cox process driven by Λ (Møller and Waagepetersen, 2004). If the random intensity function can be written as log Λ(u) = β > z(u) + φ(u) − σ 2 /2, where φ is a zero-mean stationary Gaussian random field with covariance function c(u, v; ψ) = σ 2 R(v − u; ζ) which depends on parameter ψ = (σ 2 , ζ)> (Møller and Waagepetersen, 2007; Coeurjolly and Møller, 2014). The intensity function of this log Gaussian Cox process is indeed given by ρ(u; β) = exp(β > z(u)). One example of correlation function is the exponential form (e.g. Waagepetersen and Guan, 2009) R(v − u; ζ) = exp(−ku − vk/ζ), for ζ > 0. Here, ψ = (σ 2 , ζ)> constitutes the interaction parameter vector, where σ 2 is the variance and ζ is the correlation scale parameter. 6 3 Parametric intensity estimation One of the standard ways to fit models to data is by maximizing the likelihood of the model for the data. While maximum likelihood method is feasible for parametric Poisson point process models (Section 3.1), computationally intensive Markov chain Monte Carlo (MCMC) methods are needed otherwise (Møller and Waagepetersen, 2004). As MCMC methods are not yet straightforward to implement, estimating equations based on Campbell theorem have been developed (see e.g. Waagepetersen, 2007; Møller and Waagepetersen, 2007; Waagepetersen, 2008; Guan and Shen, 2010; Baddeley et al., 2014). We review the estimating equations derived from the Poisson likelihood in Section 3.2-3.3 and from the logistic regression likelihood in Section 3.4. 3.1 Maximum likelihood estimation For an inhomogeneous Poisson point process with intensity function ρ parameterized by β, the likelihood function is Z  Y  L(β) = ρ(u; β) exp 1 − ρ(u; β) du , D u∈X∩D and the log-likelihood function of β is `(β) = Z X log ρ(u; β) − where we have omitted the constant term has log-linear form (1.1), (3.1) reduces to `(β) = X ρ(u; β)du, (3.1) D u∈X∩D R 1du = |D|. As the intensity function D Z > β z(u) − exp(β > z(u))du. D u∈X∩D Rathbun and Cressie (1994) showed that the maximum likelihood estimator is consistent, asymptotically normal and asymptotically efficient as the sample region goes to Rd . 3.2 Poisson likelihood Let β 0 be the true parameter vector. By applying Campbell theorem (2.1) to the score function, i.e. the gradient vector of `(β) denoted by `(1) (β), we have Z X (1) E` (β) = E z(u) − z(u) exp(β > z(u))du D Z u∈X∩D Z > = z(u) exp(β 0 z(u))du − z(u) exp(β > z(u))du D ZD > = z(u)(exp(β > 0 z(u)) − exp(β z(u)))du = 0 D 7 when β = β 0 . So, the score function of the Poisson log-likelihood appears to be an unbiased estimating equation, even though X is not a Poisson point process. The estimator maximizing (3.1) is referred to as the Poisson estimator. The properties of the Poisson estimator have been carefully studied. Schoenberg (2005) showed that the Poisson estimator is still consistent for a class of spatio-temporal point process models. The asymptotic normality for a fixed observation domain was obtained by Waagepetersen (2007) while Guan and Loh (2007) established asymptotic normality under an increasing domain assumption and for suitable mixing point processes. Regarding the parameter ψ (see Section 2.2.2), Waagepetersen and Guan (2009) studied a two-step procedure to estimate both β and ψ, and they proved that, under certain mixing conditions, the parameter estimates (β̂, ψ̂) enjoy the properties of consistency and asymptotic normality. 3.3 Weighted Poisson likelihood Although the estimating equation approach derived from the Poisson likelihood is simpler and faster to implement than maximum likelihood estimation, it potentially produces a less efficient estimate than that of maximum likelihood (Waagepetersen, 2007; Guan and Shen, 2010) because information about interaction of events is ignored. To regain some lack of efficiency, Guan and Shen (2010) proposed a weighted Poisson log-likelihood function given by Z X w(u)ρ(u; β)du, (3.2) `(w; β) = w(u) log ρ(u; β) − D u∈X∩D where w(·) is a weight surface. By regarding (3.2), we see that a larger weight w(u) makes the observations in the infinitesimal region du more influent. By Campbell theorem, `(1) (w; β) is still an unbiased estimating equation. In addition, Guan and Shen (2010) proved that, under some conditions, the parameter estimates are consistent and asymptotically normal. Guan and Shen (2010) showed that a weight surface w(·) that minimizes the trace of the asymptotic variance-covariance matrix of the estimates maximizing (3.2) can result in more efficient estimates than Poisson estimator. In particular, the proposed weight surface is w(u) = {1 + ρ(u)f (u)}−1 , R where f (u) = D {g(kv − uk; ψ) − 1}du and g(·) is the pair correlation function. For a Poisson point process, note that f (u) = 0 and hence w(u) = 1, which reduces to maximum likelihood estimation. For general point processes, the weight surface depends on both the intensity function and the pair correlation function, thus incorporates information on both inhomogeneity and dependence of the spatial point processes. When clustering is present so that g(v − u) > 1, then f (u) > 0 and hence the weight decreases with ρ(u). The weight surface can be achieved by setting ŵ(u) = {1 + ρ̂(u)fˆ(u)}−1 . To get the estimate ρ̂(u), β is substituted by β̃ given by Poisson estimates, that is, ρ̂(u) = ρ(u; β̃). Alternatively, ρ̂(u) can also 8 be computed nonparametrically by kernel method. Furthermore, Guan and Shen (2010) suggessted to approximate f (u) by K(r) − πr2 , where K(·) is the Ripley’s K−function estimated by K̂(r) = 6= X I[ku − vk ≤ r] . ρ̂(u)ρ̂(v)|D ∩ D u−v | u,v∈X∩D Guan et al. (2015) extended the study by Guan and Shen (2010) and considered more complex estimating equations. Specifically, w(u)z(u) is replaced by a function h(u; β) in the derivative of (3.2) with respect to β. The procedure results in a slightly more efficient estimate than the one obtained from (3.2). However, the computational cost is more important and since we combine estimating equations and penalization methods (see Section 4.1), we have not considered this extension. 3.4 Logistic regression likelihood Although the estimating equations discussed in Section 3.2 and 3.3 are unbiased, these methods do not, in general, produce unbiased estimator in practical implementations. Waagepetersen (2008) and Baddeley et al. (2014) proposed another estimating function which is indeed close to the score of the Poisson log-likelihood but is able to obtain less biased estimator than Poisson estimates. In addition, their proposed estimating equation is in fact the derivative of the logistic regression likelihood. Following Baddeley et al. (2014), we define the weighted logistic regression loglikelihood function by   X ρ(u; β) `(w; β) = w(u) log δ(u) + ρ(u; β) u∈X∩D   Z ρ(u; β) + δ(u) w(u)δ(u) log − du, (3.3) δ(u) D where δ(u) is a nonnegative real-valued function. Its role as well as an explanation of the name ’logistic method’ will be explained further in Section 5.2. Note that the score of (3.3) is an unbiased estimating equation. Waagepetersen (2008) showed asymptotic normality for Poisson and certain clustered point processes for the estimator obtained from a similar procedure. Furthermore, the methodology and results were studied by Baddeley et al. (2014) considering spatial Gibbs point processes. To determine the optimal weight surface w(·) for logistic method, we follow Guan and Shen (2010) who minimized the trace of the asymptotic covariance matrix of the estimates. We obtain the weight surface defined by w(u) = ρ(u) + δ(u) , δ(u){1 + ρ(u)f (u)} where ρ(u) and f (u) can be estimated as in Section 3.3. 9 4 Regularization techniques This section discusses convex and non-convex regularization methods for spatial point process intensity estimation. 4.1 Methodology Regularization techniques were introduced as alternatives to stepwise selection for variable selection and parameter estimation. In general, a regularization method Pp attempts to maximize the penalized log-likelihood function `(θ) − η j=1 pλj (|θj |), where `(θ) is the log-likelihood function of θ, η is the number of observations, and pλ (θ) is a nonnegative penalty function parameterized by a real number λ ≥ 0. Let `(w; β) be either the weighted Poisson log-likelihood function (3.2) or the weighted logistic regression log-likelihood function (3.3). In a similar way, we define the penalized weighted log-likelihood function given by p X Q(w; β) = `(w; β) − |D| pλj (|βj |), (4.1) j=1 where |D| is the volume of the observation domain, which plays the same role as the number of observations η in our setting, λj is a nonnegative tuning parameter corresponding to βj for j = 1, . . . , p, and pλ is a penalty function described in details in the next section. 4.2 Penalty functions and regularization methods For any λ ≥ 0, we say that pλ (·) : R+ → R is a penalty function if pλ is a nonnegative function with pλ (0) = 0. Examples of penalty function are the • `2 norm: pλ (θ) = 21 λθ2 , • `1 norm: pλ (θ) = λθ, • Elastic net: for 0 < γ < 1, pλ (θ) = λ{γθ + 12 (1 − γ)θ2 },    λθ 1 2 2 if θ ≤ λ γλθ− 2 (θ +λ ) • SCAD: for any γ > 2, pλ (θ) = if λ ≤ θ ≤ γλ γ−1  2 (γ 2 −1)  λ  if θ ≥ γλ, 2(γ−1) ( λθ − • MC+: for any γ > 1, pλ (θ) = 1 2 γλ 2 θ2 2γ if θ ≤ γλ if θ ≥ γλ. The first and second derivatives of the above functions are given by Table 1. It is to be noticed that p0λ is not differentiable at θ = λ, γλ (resp. θ = γλ) for SCAD (resp. for MC+) penalty. 10 Table 1: The first and the second derivatives of several penalty functions. Penalty p0λ (θ) p00λ (θ) `2 λθ λ `1 λ 0 Elastic net λ{(1 − γ)θ + γ}   if θ ≤ λ λ γλ−θ SCAD if λ ≤ θ ≤ γλ γ−1   0 if θ ≥ γλ ( θ λ − γ if θ ≤ γλ MC+ 0 if θ ≥ γλ λ(1 − γ)   if θ < λ 0 −1 if λ < θ < γλ γ−1   0 if θ > γλ ( −1 if θ < γλ γ 0 if θ > γλ As a first penalization technique to improve ordinary least squares, ridge regression (e.g. Hoerl and Kennard, 1988) works by minimizing the residual sum of squares subject to a bound on the `2 norm of the coefficients. As a continuous shrinkage method, ridge regression achieves its better prediction through a bias-variance trade-off. Ridge can also be extended to fit generalized linear models. However, the ridge cannot reduce model complexity since it always keeps all the predictors in the model. Then, it was introduced a method called lasso (Tibshirani, 1996), where it employs `1 penalty to obtain variable selection and parameter estimation simultaneously. Despite lasso enjoys some attractive statistical properties, it has some limitations in some senses (Fan and Li, 2001; Zou and Hastie, 2005; Zou, 2006; Zhang and Huang, 2008; Zhang, 2010), making huge possibilities to develop other methods. In the scenario where there are high correlations among predictors, Zou and Hastie (2005) proposed an elastic net technique which is a convex combination between `1 and `2 penalties. This method is particularly useful when the number of predictors is much larger than the number of observations since it can select or eliminate the strongly correlated predictors together. The lasso procedure suffers from nonnegligible bias and does not satisfy an oracle property asymptotically (Fan and Li, 2001). Fan and Li (2001) and Zhang (2010), among others, introduced non-convex penalties to get around these drawbacks. The idea is to bridge the gap between `0 and `1 , by trying to keep unbiased the estimates of nonzero coefficients and by shrinking the less important variables to be exactly zero. The rationale behind the non-convex penalties such as SCAD and MC+ can also be understood by considering its first derivative (see Table 1). They start by applying the similar rate of penalization as the lasso, and then continuously relax that penalization until the rate of penalization drops to zero. However, employing non-convex penalties in regression analysis, the main challenge is often in the minimization of the possible non-convex objective function when the non-convexity of the penalty is no longer dominated by the convexity of the likelihood function. This issue has been carefully studied. Fan and Li (2001) proposed the local quadratic approximation (LQA). Zou and Li (2008) proposed a local linear approximation (LLA) 11 which yields an objective function that can be optimized using least angle regression (LARS) algorithm (Efron et al., 2004). Finally, Breheny and Huang (2011) and Mazumder et al. (2011) investigated the application of coordinate descent algorithm to non-convex penalties. Table 2: Details of some regularization methods. Method Pp Ridge Pp Lasso Pp λ|βj | * Enet Pp λ{γ|βj | + 21 (1 − γ)βj2 } AL* Pp λj |βj | Aenet* Pp SCAD MC+ * j=1 pλj (|βj |) 1 2 j=1 2 λβj j=1 j=1 j=1 λj {γ|βj | + 21 (1 − γ)βj2 }    λθ 1 2 2 if (θ ≤ λ) Pp γλθ− 2 (θ +λ ) p (|β |), with p (θ) = if (λ ≤ θ ≤ γλ) j λ j=1 λ γ−1    λ2 (γ 2 −1) if (θ ≥ γλ) 2(γ−1)  o Pp n βj2 1 2 λ|βj | − 2γ I(|βj | ≤ γλ) + 2 γλ I(|βj | ≥ γλ) j=1 j=1 Enet, AL and Aenet, respectively, stand for elastic net, adaptive lasso and adaptive elastic net In (4.1), it is worth emphasizing that we allow each direction to have a different regularization parameter. By doing this, the `1 and elastic net penalty functions are extended to the adaptive lasso (e.g. Zou, 2006) and adaptive elastic net (e.g. Zou and Zhang, 2009). Table 2 details the regularization methods considered in this study. 5 Numerical methods We present numerical aspects in this section. For nonregularized estimation, there are two approaches that we consider. Weighted Poisson regression is explained in Section 5.1, while logistic regression is reviewed in Section 5.2. Penalized estimation procedure is done by employing coordinate descent algorithm (Section 5.3). We separate the use of the convex and non-convex penalties in Section 5.3.1 and 5.3.2. 5.1 Weighted Poisson regression Berman and Turner (1992) developed a numerical quadrature method to approximate maximum likelihood estimation for an inhomogeneous Poisson point process. They approximated the likelihood by a finite sum that had the same analytical form as the weighted likelihood of generalized linear model with Poisson response. This method was then extended to Gibbs point processes by Baddeley and Turner (2000). 12 Suppose we approximate the integral term in (3.1) by Riemann sum approximation Z M X ρ(u; β)du ≈ vi ρ(ui ; β) D i where ui , i = 1, . . . , M are points in D consisting of the m data points P and M − m dummy points. The quadrature weights vi > 0 are such that i vi = |D|. To implement this method, the domain is firstly partitioned into M rectangular pixels of equal area, denoted by a. Then one dummy point is placed in the center of the pixel. Let ∆i be an indicator whether the point is an event of point process (∆i = 1) or a dummy point (∆i = 0). Without loss of generality, let ui , . . . , um be the observed events and um+1 , . . . , uM be the dummy points. Thus, the Poisson log-likelihood function (3.1) can be approximated and rewritten as `(β) ≈ M X vi {yi log ρ(ui ; β) − ρ(ui ; β)}, where yi = vi−1 ∆i . (5.1) i Equation (5.1) corresponds to a quasi Poisson log-likelihood function. Maximizing (5.1) is equivalent to fitting a weighted Poisson generalized linear model, which can be performed using standard statistical software. Similarly, we can approximate the weighted Poisson log-likelihood function (3.2) using numerical quadrature method by `(w; β) ≈ M X wi vi {yi log ρ(ui ; β) − ρ(ui ; β)}. (5.2) i where wi is the value of the weight surface at point i. The estimate ŵi is obtained as suggested by Guan and Shen (2010). The similarity beetween (5.1) and (5.2) allows us to compute the estimates using software for generalized linear model as well. This fact is in particular exploited in the ppm function in the spatstat R package (Baddeley and Turner, 2005; Baddeley et al., 2015) with option method="mpl". To make the presentation becomes more general, the number of dummy points is denoted by nd2 for the next sections. 5.2 Logistic regression To perform well, the Berman-Turner approximation often requires a quite large number of dummy points. Hence, fitting such generalized linear models can be computationally intensive, especially when dealing with a quite large number of points. When the unbiased estimating equations are approximated using deterministic numerical approximation as in Section 5.1, it does not always produce unbiased estimator. To achieve unbiased estimator, we estimate (3.3) by     X X δ(u) ρ(u; β) + w(u) log , `(w; β) ≈ w(u) log δ(u) + ρ(u; β) ρ(u; β) + δ(u) u∈D∩D u∈X∩D (5.3) 13 where D is dummy point process independent of X and with intensity function δ. The form (5.3) is related to the estimating equation defined by Baddeley et al. (2014, eq. 7). Besides that, we consider this form since if we apply Campbell theorem to the last term of (5.3), we obtain  Z    X ρ(u; β) + δ(u) δ(u) = w(u)δ(u) log du, E w(u) log ρ(u; β) + δ(u) δ(u) D u∈D∩D which is exactly what we have in the last term of (3.3). In addition, conditional on X∪D, (5.3) is the weighted likelihood function for Bernoulli trials, y(u) = 1{u ∈ X} for u ∈ X ∪ D, with  exp − log δ(u) + β > z(u) ρ(u; β) . P{y(u) = 1} = = δ(u) + ρ(u; β) 1 + exp − log δ(u) + β > z(u) Precisely, (5.3) is a weighted logistic regression with offset term − log δ. Thus, parameter estimates can be straightforwardly obtained using standard software for generalized linear models. This approach is in fact provided in the spatstat package in R by calling the ppm function with option method="logi" (Baddeley et al., 2014, 2015). In spatstat, the dummy point process D generates nd2 points in average in D from a Poisson, binomial, or stratified binomial point process. Baddeley et al. (2014) suggested to choose δ(u) = 4m/|D|, where m is the number of points (so, nd2 = 4m). Furthermore, to determine δ, this option can be considered as a starting point for a data-driven approach (see Baddeley et al., 2014, for further details). 5.3 Coordinate descent algorithm LARS algorithm (Efron et al., 2004) is a remarkably efficient method for computing an entire path of lasso solutions. For linear models, the computational cost is of order O(M p2 ), which is the same order as a least squares fit. Coordinate descent algorithm (Friedman et al., 2007, 2010) appears to be a more competitive algorithm for computing the regularization paths by costs O(M p) operations. Therefore we adopt cyclical coordinate descent methods, which can work really fast on large datasets and can take advantage of sparsity. Coordinate descent algorithms optimize a target function with respect to a single parameter at a time, iteratively cycling through all parameters until convergence criterion is reached. We detail this for some convex and non-convex penalty functions in the next two sections. Here, we only present the coordinate descent algorithm for fitting generalized weighted Poisson regression. A similar approach is used to fit penalized weighted logistic regression. 5.3.1 Convex penalty functions Since `(w; β) given by (5.2) is a concave function of the parameters, the NewtonRaphson algorithm used to maximize the penalized log-likelihood function can be done using the iteratively reweighted least squares (IRLS) method. If the current 14 estimate of the parameters is β̃, we construct a quadratic approximation of the weighted Poisson log-likelihood function using Taylor’s expansion: M 1 X 2 `(w; β) ≈ `Q (w; β) = − νi (yi∗ − z> i β) + C(β̃), 2M i (5.4) where C(β̃) is a constant, yi∗ are the working response values and νi are the weights, νi = wi vi exp(z> i β̃) yi∗ = z> i β̃ + yi − exp(z> i β̃) exp(z> i β̃) . Regularized Poisson linear model works by firstly identifying a decreasing sequence of λ ∈ [λmin , λmax ], for which starting with minimum value of λmax such that the entire vector β̂ = 0. For each value of λ, an outer loop is created to compute `Q (w; β) at β̃. Secondly, a coordinate descent method is applied to solve a penalized weighted least squares problem minp Ω(β) = minp {−`Q (w; β) + β∈R β∈R p X pλj (|βj |)}. (5.5) j=1 The coordinate descent method is explained as follows. Suppose we have the estimate β̃l for l 6= j, l, j = 1, . . . , p. The method consists in partially optimizing (5.5) with respect to βj , that is min Ω(β̃1 , . . . , β̃j−1 , βj , β̃j+1 , . . . , β̃p ). βj Friedman et al. (2007) have provided the form of the coordinate-wise update for penalized regression using several penalties such as nonnegative garrote (Breiman, 1995), lasso, elastic net, fused lasso (Tibshirani et al., 2005), group lasso (Yuan and Lin, 2006), Berhu penalty (Owen, 2007), and LAD-lasso (Wang et al., 2007a). For instance, the coordinate-wise update for the elastic net, which embraces the ridge and lasso regularization by setting respectively γ to 0 or 1, is ! M X (j) S νj zij (yi − ỹi ), λγ β̃j ← i=1 M X , (5.6) νj zij2 + λ(1 − γ) i=1 (j) P where ỹi = β̃0 + l6=j zil β̃l is the fitted value excluding the contribution from covariate zij , and S(z, λ) is the soft-thresholding operator with value   z − λ if z > 0 and λ < |z| S(z, λ) = sign(z)(|z| − λ)+ = z + λ if z < 0 and λ < |z|   0 if λ ≥ |z|. 15 (5.7) The update (5.6) is repeated for j = 1, . . . , p until convergence. Coordinate descent algorithm for several convex penalties is implemented in the R package glmnet (Friedman et al., 2010). For (5.6), we can set γ = 0 to implement ridge and γ = 1 to lasso, while we set 0 < γ < 1 to apply elastic net regularization. For adaptive lasso, we follow Zou (2006), take γ = 1 and replace λ by λj = λ/|β̃j |τ , where β̃ is an initial estimate, say β̃(ols) or β̃(ridge), and τ is a positive tuning parameter. To avoid the computational evaluation for choosing τ , we follow Zou (2006, Section 3.4) and Wasserman and Roeder (2009) who also considered τ = 1, so we choose λj = λ/|β̃j (ridge)|, where β̃(ridge) is the estimates obtained from ridge regression. Implementing adaptive elastic net follows along similar lines. 5.3.2 Non-convex penalty functions Breheny and Huang (2011) have investigated the application of coordinate descent algorithm to fit penalized generalized linear model using SCAD and MC+, for which the penalty is non-convex. Mazumder et al. (2011) also studied the coordinatewise optimization algorithm in linear models considering more general non-convex penalties. Mazumder et al. (2011) concluded that, for a known current estimate θ̃, the univariate penalized least squares function Qu (θ) = 12 (θ − θ̃)2 + pλ (|θ|) should be convex to ensure that the coordinate-wise procedure converges to a stationary point. Mazumder et al. (2011) found that this turns out to be the case for SCAD and MC+ penalty, but it cannot be satisfied by bridge (or power) penalty and some cases of log-penalty. Breheny and Huang (2011) derived the solution of coordinate descent algorithm for SCAD and MC+ in generalized linear models cases, and it is implemented in the ncvreg package of R. Let β̃ l be a vector containing estimates β̃l for l 6= j, l, j = 1, . . . , p, and we wish to partially optimize (5.5) with respect to βj . If we PM P (j) 2 ) and η̃ = ν z (y − ỹ define g̃j = M j j ij i i i=1 νj zij , the coordinate-wise update for i=1 SCAD is  S(g̃j ,λ)  if |g̃j | ≤ λ(η̃j + 1)   η̃j S(g̃j ,γλ/(γ−1)) if λ(η̃j + 1) ≤ |g̃j | ≤ η̃j λγ β̃j ← η̃j −1/(γ−1)    g̃j if |g̃j | ≥ η̃j λγ, η̃j for any γ > maxj (1 + 1/η̃j ). Then, for γ > maxj (1/η̃j ) and the same definition of g̃j and η̃j , the coordinate-wise update for MC+ is ( S(g̃ ,λ) j if |g̃j | ≤ η̃j λγ β̃j ← η̃g̃jj −1/γ if |g̃j | ≥ η̃j λγ, η̃j where S(z, λ) is the soft-thresholding operator given by (5.7). 5.4 Selection of regularization or tuning parameter It is worth noticing that coordinate descent procedures (and other computation procedures computing the penalized likelihood estimates) rely on the tuning parameter 16 λ so that the choice of λ is also becoming an important task. The estimation using a large value of λ tends to have smaller variance but larger biases, whereas the estimation using a small value of λ leads to have zero biases but larger variance. The trade-off between the biases and the variances yields an optimal choice of λ (Fan and Lv, 2010). To select λ, it is reasonable to identify a range of λ values extending from a maximum value of λ for which all penalized coefficients are zero to λ = 0 (e.g. Friedman et al., 2010; Breheny and Huang, 2011). After that, we select a λ value which optimizes some criterion. By fixing a path of λ ≥ 0, we select the tuning parameter λ which minimizes WQBIC(λ), a weighted version of the BIC criterion, defined by WQBIC(λ) = −2`(w; β̂(λ)) + s(λ) log |D|, P where s(λ) = pj=1 I{β̂j (λ) 6= 0} is the number of selected covariates with nonzero regression coefficients and |D| is the observation volume which represents the sample size. For linear regression models, Y = X> β̂ +, Wang et al. (2007b) proposed BICtype criterion for choosing λ by BIC(λ) = log kY − X> β̂(λ)k2 1 + log(η)DF(λ), η η where η is the number of observations and DF(λ) is the degree of freedom. This criterion is consistent, meaning that, it selects the correct model with probability approaching 1 in large samples when a set of candidate models contains the true model. Their findings is in line with the study of Zhang et al. (2010) for which the criterion was presented in more general way, called generalized information criterion (GIC). The criterion WQBIC is the specific form of GIC proposed by Zhang et al. (2010). The selection of γ for SCAD and MC+ is another task, but we fix γ = 3.7 for SCAD and γ = 3 for MC+, following Fan and Li (2001) and Breheny and Huang (2011) respectively, to avoid more complexities. 6 Asymptotic theory In this section, we present the asymptotic results for the regularized weighted Poisson likelihood estimator when considering X as a d-dimensional point process observed over a sequence of observation domain D = Dn , n = 1, 2, . . . which expands to Rd as n → ∞. The regularization parameters λj = λn,j for j = 1, . . . , p are now indexed by n. These asymptotic results also hold for the regularized unweighted Poisson likelihood estimator. For sake of conciseness, we do not present the asymptotic results for the regularized logistic regression estimate. The results are very similar. The main difference is lying in the conditions (C.6) and (C.7) for which the matrices An , Bn , and Cn have a different expression (see Remark 2). 17 6.1 Notation and conditions We recall the classical definition of strong mixing coefficients adapted to spatial point processes (e.g. Politis et al., 1998): for k, l ∈ N ∪ {∞} and q ≥ 1, define αk,l (q) = sup{|P(A ∩ B) − P(A)P(B)| : A ∈ F (Λ1 ), B ∈ F (Λ2 ), Λ1 ∈ B(Rd ), Λ2 ∈ B(Rd ), |Λ1 | ≤ k, |Λ2 | ≤ l, d(Λ1 , Λ2 ) ≥ q}, (6.1) where F is the σ-algebra generated by X ∩ Λi , i = 1, 2, d(Λ1 , Λ2 ) is the minimal distance between sets Λ1 and Λ2 , and B(Rd ) denotes the class of Borel sets in Rd . > > > > > Let β 0 = {β01 , . . . , β0s , β0(s+1) , . . . , β0p }> = {β > 01 , β 02 } = (β 01 , 0 ) denote the p-dimensional vector of true coefficient values, where β 01 is the s-dimensional vector of nonzero coefficients and β 02 is the (p-s)-dimensional vector of zero coefficients. We define the p × p matrices An (w; β 0 ), Bn (w; β 0 ), and Cn (w; β 0 ) by Z An (w; β 0 ) = w(u)z(u)z(u)> ρ(u; β 0 )du, ZDn w(u)2 z(u)z(u)> ρ(u; β 0 )du, and Bn (w; β 0 ) = ZDn Z Cn (w; β 0 ) = w(u)w(v)z(u)z(v)> {g(u, v) − 1}ρ(u; β 0 )ρ(v; β 0 )dvdu. Dn Dn Consider the following conditions (C.1)-(C.8) which are required to derive our asymptotic results, where o denotes the origin of Rd : (C.1) For every n ≥ 1, Dn = nE = {ne : e ∈ E}, where E ⊂ Rd is convex, compact, and contains o in its interior. (C.2) We assume that the intensity function has the log-linear specification given by (1.1) where β ∈ Θ and Θ is an open convex bounded set of Rp . (C.3) The covariates z and the weight function w satisfy sup ||z(u)|| < ∞ and u∈Rd sup |w(u)| < ∞. u∈Rd (C.4) There exists an integer t ≥ 1 such that for k = 2, . . . , 2+t, the product density ρ(k) exists and satisfies ρ(k) < ∞. (C.5) For the strong mixing coefficients (6.1), we assume that there exists some t̃ > d(2 + t)/t such that α2,∞ (q) = O(q −t̃ ). (C.6) There exists a p × p positive definite matrix I0 such that for all sufficiently large n, |Dn |−1 {Bn (w; β 0 ) + Cn (w; β 0 )} ≥ I0 . (C.7) There exists a p × p positive definite matrix I00 such that for all sufficiently large n, we have |Dn |−1 An (w; β 0 ) ≥ I00 . 18 (C.8) The penalty function pλ (·) is nonnegative on R+, continuously differentiable on R+ \ {0} with derivative p0λ assumed to be a Lipschitz function on R+ \ {0}. Furthermore, given (λn,j )n≥1 , for j = 1, . . . , s, we assume that there exists (r̃n,j )n≥1 , where |Dn |1/2 r̃n,j → ∞ as n → ∞, such that, for n sufficiently large, pλn,j is thrice continuously differentiable in the ball centered at |β0j | with radius r̃n,j and we assume that the third derivative is uniformly bounded. Under the condition (C.8), we define the sequences an , bn and cn by an = max |p0λn,j (|β0j |)|, (6.2) j=1,...s bn = cn = inf inf p0λn,j (θ), j=s+1,...,p |θ|≤n θ6=0 00 max |pλn,j (|β0j |)|. j=1,...s for n = K1 |Dn |−1/2 , (6.3) (6.4) These sequences an , bn and cn , detailed in Table 3 for the different methods considered in this paper, play a central role in our results. Even if this will be discussed later in Section 6.3, we specify right now that we require that an |Dn |1/2 → 0, bn |Dn |1/2 → ∞ and cn → 0. Table 3: Details of the sequences an , bn and cn for a given regularization method. Method an Ridge λn max {|β0j |} Lasso λn Enet AL Aenet * j=1,...s bn cn 0 λn λ   n λn (1 − γ) max {|β0j |} + γ γλn 0 (1 − γ)λn max {λn,j } 0 j=1,...s min {λn,j } j=1,...s j=s+1,...p  max {λn,j (1 − γ)|β0j | + γ } γ min {λn,j } (1 − γ) max {λn,j } j=1,...s j=s+1,...p SCAD 0* λn ** MC+ 0* λn − j=1,...,s 0* K1 ** γ|Dn |1/2 0* if λn → 0 as n → ∞ if |Dn |1/2 λn → ∞ as n → ∞ ** 6.2 Main results We state our main results here. Proofs are relegated to Appendices A-C. We first show in Theorem 1 that the penalized weighted Poisson likelihood estimator converges in probability and exhibits its rate of convergence. Theorem 1. Assume the conditions (C.1)-(C.8) hold and let an and cn be given by (6.2) and (6.4). If an = O(|Dn |−1/2 ) and cn = o(1), then there exists a local maximizer β̂ of Q(w; β) such that kβ̂ − β 0 k = OP (|Dn |−1/2 + an ). 19 This implies that, if an = O(|Dn |−1/2 ) and cn = o(1), the penalized weighted Poisson likelihood estimator is root-|Dn | consistent. Furthermore, we demonstrate in Theorem 2 that such a root-|Dn | consistent estimator ensures the sparsity of β̂; that is, the estimate will correctly set β 2 to zero with probability tending to 1 as n → ∞, and β̂ 1 is asymptotically normal. Theorem 2. Assume the conditions (C.1)-(C.8) hold. If an |Dn |1/2 → 0, bn |Dn |1/2 → ∞ and cn → 0 as n → ∞, the root-|Dn | consistent local maximiz> > ers β̂ = (β̂ 1 , β̂ 2 )> in Theorem 1 satisfy: (i) Sparsity: P(β̂ 2 = 0) → 1 as n → ∞, d (ii) Asymptotic Normality: |Dn |1/2 Σn (w; β 0 )−1/2 (β̂ 1 − β 01 ) → − N (0, Is ), where Σn (w; β 0 ) =|Dn |{An,11 (w; β 0 ) + |Dn |Πn }−1 {Bn,11 (w; β 0 ) + Cn,11 (w; β 0 )} {An,11 (w; β 0 ) + |Dn |Πn }−1 , (6.5) 00 00 Πn =diag{pλn,1 (|β01 |), . . . , pλn,s (|β0s |)}, (6.6) and where An,11 (w; β 0 ) (resp. Bn,11 (w; β 0 ), Cn,11 (w; β 0 )) is the s × s top-left corner of An (w; β 0 ) (resp. Bn (w; β 0 ), Cn (w; β 0 )). As a consequence, Σn (w; β 0 ) is the asymptotic covariance matrix of β̂ 1 . Note that Σn (w; β 0 )−1/2 is the inverse of Σn (w; β 0 )1/2 , where Σn (w; β 0 )1/2 is any square > matrix with Σn (w; β 0 )1/2 Σn (w; β 0 )1/2 = Σn (w; β 0 ). Remark 1. For lasso and adaptive lasso, Πn = 0. For other penalties, since cn = o(1), then kΠn k = o(1). Since kAn,11 (w; β 0 )k = O(|Dn |) from conditions (C.2) and (C.3), |Dn | kΠn k is asymptotically negligible with respect to kAn,11 (w; β 0 )k. Remark 2. Theorems 1 and 2 remain true for the regularized weighted logistic regression likelihood estimates if we extend the condition (C.3) by replacing in the expression of the matrices An , Bn , and Cn , w(u) by w(u)δ(u)/(ρ(u; β) + δ(u)), u ∈ Dn and by adding supu∈Rd δ(u) < ∞. Remark 3. We want to highlight here the main theoretical differences with the work by Thurman et al. (2015). First, the methodology and results are available for the logistic regression likelihood. Second, we consider very general penalty function while Thurman et al. (2015) only considered the adaptive lasso method. Third, we do not assume, as in Thurman et al. (2015), that |Dn |−1 Mn → M as n → ∞ (where Mn is An , Bn , or Cn ), when M is a positive definite matrix. Instead we assume sharper condition assuming limn→∞ νmin (|Dn |−1 Mn ) > 0, where Mn is either An or Bn +Cn and νmin (M0 ) is the smallest eigenvalue of a positive definite matrix M0 . This makes the proofs a little bit more technical. 20 6.3 Discussion of the conditions We adopt the conditions (C.1)-(C.6) based on the paper from Coeurjolly and Møller (2014). In condition (C.1), the assumption that E contains o in its interior can be made without loss of generality. If instead u is an interior point of E, then condition (C.1) could be modified to that any ball with centre u and radius r > 0 is contained in Dn = nE for all sufficiently large n. Condition (C.3) is quite standard. From conditions (C.2)-(C.5), the matrices An (w; β 0 ), Bn (w; β 0 ) and Cn (w; β 0 ) are bounded by |Dn | (see e.g. Coeurjolly and Møller, 2014). Combination of conditions (C.1)-(C.6) are used to establish a central limit theo(1) rem for |Dn |−1/2 `n (w; β 0 ) using a general central limit theorem for triangular arrays of nonstationary random fields obtained by Karácsony (2006), which is an extension from Bolthausen (1982), then later extended to nonstationary random fields by Guyon (1995). As pointed out by Coeurjolly and Møller (2014), condition (C.6) is a spatial average assumption like when establishing asymptotic normality of ordinary least square estimators for linear models. This condition is also useful to make sure that the matrix |Dn |−1 {Bn (w; β 0 ) + Cn (w; β 0 )} is invertible. Conditions (C.6)-(C.7) ensure that the matrix Σn (w; β 0 ) is invertible for sufficiently large n. Conditions (C.1)-(C.6) are discussed in details for several models by Coeurjolly and Møller (2014). They are satisfied for a large class of intensity functions and a large class of models including Poisson and Cox processes discussed in Section 2.2. Condition (C.8) controls the higher order terms in Taylor expansion of the penalty function. Roughly speaking, we ask the penalty function to be at least Lipschitz and thrice differentiable in a neighborhood of the true parameter vector. As it is, the condition looks technical, however, it is obviously satisfied for ridge, lasso, elastic net (and the adaptive versions). According to the choice of λn , it is satisfied for SCAD and MC+ when |β0j |, for j = 1, . . . , s, is not equal to γλn and/or λn . Theorem 2 requires the conditions an |Dn |1/2 → 0, bn |Dn |1/2 → ∞ and cn → 0 as n → ∞ simultaneously. By requiring these assumptions, the corresponding penalized weighted Poisson likelihood estimators possess the oracle property and perform as well as weighted Poisson likelihood estimator which estimates β 1 knowing the fact that β 2 = 0. For the ridge regularization method, bn = 0, preventing from applying Theorem 2 for this penalty. For lasso and elastic net, an = K2 bn for some constant K2 > 0 (K2 =1 for lasso). The two conditions an |Dn |1/2 → 0 and bn |Dn |1/2 → ∞ as n → ∞ cannot be satisfied simultaneously. This is different for the adaptive versions where a compromise can be found by adjusting the λn,j ’s, as well as the two non-convex penalties SCAD and MC+, for which λn can be adjusted. For the regularization methods considered in this paper, the condition cn → 0 is implied by the condition an |Dn |1/2 → 0 as n → ∞. 7 Simulation study We conduct a simulation study with three different scenarios, described in Section 7.1, to compare the estimates of the regularized Poisson likelihood (PL) and that 21 of the regularized weighted Poisson likelihood (WPL). We also want to explore the behaviour of the estimates using different regularization methods. Empirical findings are presented in Section 7.2. Furthermore, we compare, in Section 7.3, the estimates of the regularized (un)weighted logistic likelihood and the ones of the regularized (un)weighted Poisson likelihood. 7.1 Simulation set-up The setting is quite similar to that of Waagepetersen (2007) and Thurman et al. (2015). The spatial domain is D = [0, 1000] × [0, 500]. We center and scale the 201 × 101 pixel images of elevation (x1 ) and gradient of elevation (x2 ) contained in the bei datasets of spatstat library in R (R Core Team, 2016), and use them as two true covariates. In addition, we create three different scenarios to define extra covariates: Scenario 1. We generate eighteen 201 × 101 pixel images of covariates as standard Gaussian white noise and denote them by x3 , . . . , x20 . We define z(u) = x(u) = {x1 (u), . . . , x20 (u)}> as the covariates vector. The regression coefficients for z3 , . . . , z20 are set to zero. Scenario 2. First, we generate eighteen 201 × 101 pixel images of covariates as in the scenario 1. Second, we transform them, together with x1 and x2 , to have multicollinearity. Third, we define z(u) = V> x(u), where x(u) = {x1 (u), . . . , x20 (u)}> . More precisely, V is such that Ω = V> V, and (Ω)ij = (Ω)ji = 0.7|i−j| for i, j = 1, . . . , 20, except (Ω)12 = (Ω)21 = 0, to preserve the correlation between x1 and x2 . The regression coefficients for z3 , . . . , z20 are set to zero. Scenario 3. We consider a more complex situation. We center and scale the 13 soil nutrients covariates obtained from the study in tropical forest of Barro Colorado Island (BCI) in central Panama (see Condit, 1998; Hubbell et al., 1999, 2005), and use them as the extra covariates. Together with x1 and x2 , we keep the structure of the covariance matrix to preserve the complexity of the situation. In this setting, we have z(u) = x(u) = {x1 (u), . . . , x15 (u)}> . The regression coefficients for z3 , . . . , z15 are set to zero. The different maps of the covariates obtained from scenarios 2 and 3 are depicted in Appendix D. Except for z3 which has high correlation with z2 , the extra covariates obtained from scenario 2 tend to have a constant value (Figure 3). This is completely different from the ones obtained from scenario 3 (Figure 4). The mean number of points over the domain D, µ, is chosen to be 1600. We set the true intensity function to be ρ(u; β 0 ) = {β0 + β1 z1 (u) + β2 z2 (u)}, where β1 = 2 represents a relatively large effect of elevation, β2 = 0.75 reflects a relatively small effect of gradient, and β0 is selected such that each realization has 1600 points in average. Furthermore, we erode regularly the domain D such that, with the 22 same intensity function, the mean number of points over the new domain D R becomes 400. The erosion is used to observe the convergence of the procedure as the observation domain expands. We consider the default number of dummy points for the Poisson likelihood, denoted by nd2 , as suggested in the spatstat R package, i.e. nd2 ≈ 4m, where m is the number of points. With these scenarios, we simulate 2000 spatial point patterns from a Thomas point process using the rThomas function in the spatstat package. We also consider two different κ parameters (κ = 5 × 10−4 , κ = 5 × 10−5 ) as different levels of spatial interaction and let ω = 20. For each of the four combinations of κ and µ, we fit the intensity to the simulated point pattern realizations. We also fit the oracle model which only uses the two true covariates. All models are fitted using modified internal function in spatstat (Baddeley et al., 2015), glmnet (Friedman et al., 2010), and ncvreg (Breheny and Huang, 2011). A modification of the ncvreg R package is required to include the penalized weighted Poisson and logistic likelihood methods. 7.2 Simulation results To better understand the behaviour of Thomas processes designed in this study, Figure 1 shows the plot of the four realizations using different κ and µ. The smaller value of κ, the tighter the clusters since there are fewer parents. When µ = 400, i.e. by considering the realizations observed on D R, the mean number of points over the 2000 replications and standard deviation are 396 and 47 (resp. 400 and 137) when κ = 5×10−4 (resp. κ = 5×10−5 ). When µ = 1600, the mean number of points and standard deviation are 1604 and 174 (resp. 1589 and 529) when κ = 5 × 10−4 (resp. κ = 5 × 10−5 ). Figure 1: Realizations of a Thomas process for µ = 400 (row 1), µ = 1600 (row 2), κ = 5 × 10−4 (column 1), and κ = 5 × 10−5 (column 2). Tables 4 and 5 present the selection properties of the estimates using the penalized PL and the penalized WPL methods. Similarly to Bühlmann and Van De Geer (2011), the indices we consider are the true positive rate (TPR), the false positive rate (FPR), and the positive predictive value (PPV). TPR corresponds to the ratio of the selected true covariates over the number of true covariates, while FPR 23 Table 4: Empirical selection properties (TPR, FPR, and PPV in %) based on 2000 replications of Thomas processes on the domain D R (µ = 400) for different values of κ and for the three different scenarios. Different penalty functions are considered as well as two estimating equations, the regularized Poisson likelihood (PL) and the regularized weighted Poisson likelihood (WPL). κ = 5 × 10−4 κ = 5 × 10−5 Method Regularized PL Regularized WPL Regularized PL Regularized WPL TPR FPR PPV TPR FPR PPV TPR FPR PPV TPR FPR PPV Scenario 1 Ridge 100 100 10 100 100 10 100 100 10 100 100 10 Lasso 100* 27 35 56 0* 98 89 35 34 33 0* 62 31 0 * 57 * 67 Enet 100 * 59 18 39 4 36 AL * 100 1 93 58 0 Aenet 100* 6 72 59 0* 66 0 * 0 * SCAD MC+ 100 * 100 * 18 21 41 36 68 * 91 * 60 21 100 88 7 72 35 0 99 89 12 61 34 0* 64 31 0 * 56 * 54 98 90 96 90 17 46 21 42 30 0 100 10 100 100 10 * 55 Scenario 2 Ridge 100 100 10 100 100 10 100 100 * 25 35 52 1 88 90 38 29 31 0 Enet 100 * 52 19 49 4 62 90 60 20 24 1 AL 99 4 80 52 0* 100* 87 9 67 36 0* 67 53 0 * 35 0 * 65 * * 50 Lasso Aenet 99 8 * 65 SCAD 100 17 43 64 0 MC+ 100* 18 41 59 1 99 88 14 54 38 92 88 17 45 28 0 87 88 21 41 27 0* 50 Scenario 3 Ridge 100 100 13 100 100 13 100 100 13 100 100 13 Lasso 100* 56 24 52 2 87 98 89 15 13 2 20 Enet 100* 76 18 47 4 99 94 14 8 2 11 AL 100 * 29 42 52 63 0 * * 100 95 77 17 18 2 30 * 99 96 82 16 15 1 25 Aenet 100 38 33 54 0 SCAD 100* 34 33 58 0* 85 95 71 18 13 1 22 56 * 84 95 71 18 13 1 23 MC+ * * 100 * 35 32 0 Approximate value corresponds to the ratio of the selected noisy covariates over the number of noisy covariates. TPR explains how the model can correctly select both z1 and z2 . Finally, FPR investigates how the model uncorrectly select among z3 to zp (p = 20 for scenarios 1 and 2 and p = 15 for scenario 3). PPV corresponds to the ratio 24 Table 5: Empirical selection properties (TPR, FPR, and PPV in %) based on 2000 replications of Thomas processes on the domain D (µ = 1600) for different values of κ and for the three different scenarios. Different penalty functions are considered as well as two estimating equations, the regularized Poisson likelihood (PL) and the regularized weighted Poisson likelihood (WPL). κ = 5 × 10−4 κ = 5 × 10−5 Method Regularized PL Regularized WPL Regularized PL Regularized WPL TPR FPR PPV TPR FPR PPV TPR FPR PPV TPR FPR PPV Scenario 1 Ridge 100 100 10 100 100 10 100 100 10 100 100 10 Lasso 100 26 35 52 0* 100* 98 48 22 56 0* 96 Enet 100 64 16 55 6 50 99 76 14 50 5 45 AL 100 0 * Aenet 100 4 SCAD MC+ 100 17 100 22 * 98 98 50 0 100 96 6 77 55 0 79 54 0* 100* 97 11 60 57 0* 96 60 0 * * 52 0 * 90 0 * * 79 50 47 60 100 97 98 98 18 47 23 42 44 0 Scenario 2 Ridge 100 100 10 100 100 10 100 100 10 100 100 10 * 97 98 43 24 52 1 91 62 Lasso 100 26 33 51 0 Enet 100 56 18 51 5 55 99 69 15 49 4 AL 100 1 92 51 0 100 96 10 67 53 0* 99 * 98 Aenet 100 4 78 51 0 SCAD 100 21 37 53 MC+ 100 24 35 47 * * 100 97 15 52 53 0 1 85 96 16 50 45 1 77 2 76 97 19 47 42 2 72 Scenario 3 Ridge 100 100 13 100 100 13 100 100 13 100 100 13 Lasso 100 69 19 52 1 96 100 95 14 48 4 75 Enet 100 85 16 52 5 100 97 14 43 5 62 AL * 100 43 32 51 71 0 * * 100 99 86 15 51 2 86 * 99 99 89 15 50 3 82 Aenet 100 49 27 52 0 SCAD 100 47 27 43 2 72 99 78 17 40 2 63 MC+ 100 48 26 44 2 75 99 79 17 37 2 61 Approximate value of the selected true covariates over the total number of selected covariates in the model. PPV describes how the model can approximate the oracle model in terms of selection. Therefore, we want to find the methods which have a TPR and a PPV close to 100%, and a FPR close to 0. 25 Generally, for both the penalized PL and the penalized WPL methods, the best selection properties are obtained for a larger value of κ which shows weaker spatial dependence. For a more clustered one, indicated by a smaller value of κ, it seems more difficult to select the true covariates. As µ increases from 400 (Table 4) to 1600 (Table 5), the TPR tends to improve, so the model can select both z1 and z2 more frequently. Ridge, lasso, and elastic net are the regularization methods that cannot satisfy our theorems. It is firstly emphasized that all covariates are always selected by the ridge so that the rates are never changed whatever method used. For the penalized PL with lasso and elastic net regularization, it is shown that they tend to have quite large value of FPR, meaning that they wrongly keep the noisy covariates more frequently. When the penalized WPL is applied, we gain smaller FPR, but we suffer from smaller TPR at the same time. This smaller TPR actually comes from the unselection of z2 which has smaller coefficient than that of z1 . When we apply adaptive lasso, adaptive elastic net, SCAD, and MC+, we achieve better performance, especially for FPR which is closer to zero which automatically improves the PPV. Adaptive elastic net (resp. elastic net) has slightly larger FPR than adaptive lasso (resp. lasso). Among all regularization methods considered in this paper, adaptive lasso seems to outperform the other ones. Considering scenarios 1 and 2, we observe best selection properties for the penalized PL combined with adaptive lasso. As the design is getting more complex for scenario 3, applying the penalized PL suffers from much larger FPR, indicating that this method may not be able to overcome the complicated situation. However, when we use the penalized WPL, the properties seem to be more stable for the different designs of simulation study. One more advantage when considering the penalized WPL is that we can remove almost all extra covariates. It is worth noticing that we may suffer from smaller TPR when we apply the penalized WPL, but we lose the only less informative covariates. From Tables 4 and 5, when we are faced with complex situation, we would recommend the use of the penalized WPL method with adaptive lasso penalty if the focus is on selection properties. Otherwise, the use of the penalized PL combined with adaptive lasso penalty is more preferable. Tables 6 and 7 give the prediction properties of the estimates in terms of biases, standard deviations (SD), and square root of mean squared errors (RMSE), some criterions we define by " p " p # 12 # 21 " p # 21 X X X σ̂j2 , RMSE = Ê(β̂j − βj )2 , Bias = {Ê(β̂j ) − βj }2 , SD = j=1 j=1 j=1 where Ê(β̂j ) and σ̂j2 are respectively the empirical mean and variance of the estimates β̂j , for j = 1, . . . , p, where p = 20 for scenarios 1 and 2, and p = 15 for scenario 3. In general, the properties improve with larger value of κ and µ due to weaker spatial dependence and larger sample size. For the oracle model where the model contains only z1 and z2 , the WPL estimates are more efficient than the PL estimates, particularly in the more clustered case, agreeing with the findings by Guan and Shen (2010). 26 Table 6: Empirical prediction properties (Bias, SD, and RMSE) based on 2000 replications of Thomas processes on the domain D R (µ = 400) for different values of κ and for the three different scenarios. Different penalty functions are considered as well as two estimating equations, the regularized Poisson likelihood (PL) and the regularized weighted Poisson likelihood (WPL). κ = 5 × 10−4 κ = 5 × 10−5 Method Regularized PL Regularized WPL Regularized PL Regularized WPL Bias SD RMSE Bias SD RMSE Bias SD RMSE Bias SD RMSE Scenario 1 Oracle 0.11 0.18 0.21 0.64 0.20 0.67 0.29 0.81 0.86 0.57 0.54 0.78 Ridge 0.11 0.38 0.40 0.72 0.69 1.00 0.28 1.26 1.29 0.98 1.03 1.42 Lasso 0.28 0.32 0.42 1.06 0.32 1.11 0.47 0.99 1.10 1.40 0.73 1.58 Enet 0.24 0.38 0.44 1.28 0.28 1.31 0.45 1.04 1.13 1.59 0.58 1.70 AL 0.10 0.29 0.31 0.87 0.32 0.92 0.38 0.96 1.03 1.18 0.93 1.50 Aenet 0.14 0.30 0.33 0.93 0.39 1.01 0.40 0.96 1.04 1.29 0.82 1.53 SCAD 0.26 0.27 0.38 1.06 0.37 1.12 0.46 0.79 0.91 1.49 0.67 1.64 MC+ 0.28 0.28 0.39 1.04 0.38 1.11 0.47 0.78 0.92 1.48 0.70 1.64 Scenario 2 Oracle 0.12 0.23 0.26 0.71 0.26 0.76 0.30 0.78 0.84 0.59 0.62 0.84 Ridge 0.14 0.46 0.48 0.69 0.93 1.16 0.32 1.23 1.27 0.92 1.15 1.47 Lasso 0.34 0.33 0.48 1.20 0.37 1.26 0.45 0.96 1.06 1.50 0.69 1.65 Enet 0.38 0.40 0.55 1.40 0.35 1.44 0.44 1.03 1.12 1.78 0.49 1.85 AL 0.20 0.33 0.39 0.85 0.32 0.91 0.37 0.93 1.00 1.17 0.86 1.45 Aenet 0.25 0.33 0.42 0.96 0.34 1.02 0.40 0.94 1.02 1.29 0.78 1.51 SCAD 0.38 0.30 0.48 0.95 0.48 1.06 0.44 0.80 0.91 1.53 0.70 1.68 MC+ 0.39 0.30 0.49 1.01 0.49 1.13 0.44 0.80 0.92 1.52 0.71 1.68 Scenario 3 Oracle 0.12 0.46 0.48 0.70 0.26 0.75 0.65 1.14 1.31 0.87 0.88 1.24 Ridge 0.13 1.03 1.04 0.71 1.45 1.62 0.52 3.10 3.14 0.90 2.86 3.00 Lasso 0.20 0.69 0.71 1.26 0.40 1.32 0.51 2.91 2.95 1.93 0.68 2.04 Enet 0.21 0.83 0.86 1.53 0.40 1.58 0.52 2.94 2.99 2.03 0.60 2.12 AL 0.18 0.57 0.60 0.91 0.33 0.97 0.52 2.80 2.85 1.77 0.84 1.96 Aenet 0.22 0.61 0.65 1.04 0.36 1.10 0.52 2.80 2.85 1.86 0.73 2.00 SCAD 0.27 0.61 0.67 1.18 0.59 1.32 0.48 2.49 2.54 1.91 0.64 2.02 MC+ 0.27 0.62 0.68 1.20 0.58 1.33 0.48 2.49 2.54 1.89 0.67 2.00 27 Table 7: Empirical prediction properties (Bias, SD, and RMSE) based on 2000 replications of Thomas processes on the domain D (µ = 1600) for different values of κ and for the three different scenarios. Different penalty functions are considered as well as two estimating equations, the regularized Poisson likelihood (PL) and the regularized weighted Poisson likelihood (WPL). κ = 5 × 10−4 κ = 5 × 10−5 Method Regularized PL Regularized WPL Regularized PL Regularized WPL Bias SD RMSE Bias SD RMSE Bias SD RMSE Bias SD RMSE Scenario 1 Oracle 0.05 0.11 0.12 0.33 0.15 0.37 0.16 0.45 0.48 0.41 0.22 0.46 Ridge 0.04 0.21 0.21 0.70 0.55 0.90 0.13 0.72 0.73 0.74 0.58 0.94 Lasso 0.14 0.19 0.24 1.03 0.20 1.05 0.23 0.60 0.64 0.99 0.43 1.08 Enet 0.11 0.22 0.24 1.14 0.29 1.17 0.20 0.62 0.65 1.12 0.43 1.20 AL 0.04 0.18 0.18 0.87 0.18 0.89 0.16 0.58 0.60 0.87 0.42 0.96 Aenet 0.05 0.18 0.18 0.96 0.22 0.99 0.17 0.58 0.60 0.90 0.48 1.02 SCAD 0.19 0.18 0.26 1.30 0.34 1.34 0.14 0.53 0.55 1.37 0.51 1.46 MC+ 0.20 0.18 0.27 1.33 0.28 1.36 0.15 0.53 0.55 1.38 0.52 1.48 Scenario 2 Oracle 0.05 0.15 0.16 0.36 0.17 0.40 0.18 0.46 0.49 0.39 0.26 0.47 Ridge 0.05 0.27 0.27 0.69 0.62 0.94 0.17 0.74 0.80 0.78 0.64 1.01 Lasso 0.16 0.20 0.25 1.16 0.24 1.18 0.23 0.60 0.64 1.14 0.43 1.22 Enet 0.17 0.23 0.29 1.24 0.24 1.26 0.23 0.63 0.67 1.33 0.42 1.40 AL 0.07 0.18 0.20 0.85 0.18 0.87 0.18 0.58 0.61 0.83 0.41 0.93 Aenet 0.09 0.19 0.21 0.94 0.20 0.96 0.20 0.59 0.62 0.92 0.41 1.01 SCAD 0.26 0.20 0.33 1.26 0.51 1.36 0.19 0.51 0.55 1.31 0.60 1.44 MC+ 0.26 0.20 0.33 1.31 0.55 1.42 0.19 0.51 0.55 1.32 0.61 1.46 Scenario 3 Oracle 0.13 0.31 0.34 0.43 0.18 0.47 0.31 0.96 1.01 0.75 0.35 0.83 Ridge 0.11 0.84 0.86 0.70 0.96 1.19 0.23 2.50 2.51 1.02 1.43 1.76 Lasso 0.12 0.64 0.65 1.14 0.29 1.17 0.22 2.41 2.42 1.40 0.61 1.52 Enet 0.13 0.71 0.73 1.35 0.30 1.39 0.23 2.42 2.43 1.63 0.56 1.73 AL 0.14 0.55 0.57 0.89 0.18 0.91 0.22 2.37 2.38 1.12 0.67 1.31 Aenet 0.15 0.56 0.58 1.00 0.22 1.03 0.22 2.36 2.37 1.26 0.64 1.41 SCAD 0.24 0.58 0.62 1.41 0.40 1.47 0.24 2.09 2.10 1.50 0.68 1.65 MC+ 0.24 0.58 0.63 1.44 0.42 1.50 0.24 2.09 2.10 1.49 0.71 1.65 28 When the regularization methods are applied, the bias increases in general, especially when we consider the penalized WPL method. The regularized WPL has a larger bias since this method does not select z2 much more frequently. Furthermore, weighted method seems to introduce extra bias, even though the regularization is not considered as in the oracle model. For a low clustered process, the SD using the penalized WPL is similar to that of the penalized PL which may be because of the weaker dependence represented by larger κ, making weight surface w(·) closer to 1. However, a larger RMSE is obtained from the penalized WPL. When we observe the more clustered process, we obtain smaller SD using the penalized WPL which explains why in some cases (mainly scenario 3) the RMSE gets smaller. For the ridge method, the bias is closest to that of the oracle model, but it has the largest SD. Among the regularization methods, the adaptive lasso method has the best performance in terms of prediction. Considering scenarios 1 and 2, we obtain best properties when we apply the penalized PL with adaptive lasso penalty. As the design is getting much more complex for scenario 3, when we use the penalized PL with adaptive lasso, the SD is doubled and even quadrupled due to the overselection of many unimportant covariates. In particular, for the more clustered process, the better properties are even obtained by applying the regularized WPL combined with adaptive lasso. From Tables 6 and 7, when the focus is on prediction properties, we would recommend to apply the penalized WPL combined with adaptive lasso penalty when the observed point pattern is very clustered and when covariates have a complex stucture of covariance matrix. Otherwise, the use of the penalized PL combined with adaptive lasso penalty is more favorable. Our recommendations in terms of prediction support as what we recommend in terms of selection. 7.3 Logistic regression Our concern here is to compare the estimates of the penalized (un)weighted logistic likelihood to that of the penalized (un)weighted Poisson likelihood with different number of dummy points. We remind that the number of dummy points comes up when we discretize the integral terms in (3.2) and in (3.3). In the following, to ease the presentation, we use the term Poisson estimates (resp. logistic estimates) for parameter estimates obtained using the regularized Poisson likelihood (resp. the regularized logistic regression likelihood). We consider three different numbers of dummy points denoted by nd2 . By these different numbers of dummy points, we want to observe the properties with three different situations: (a) nd2 < m, (b) nd2 ≈ m, and (c) nd2 > m, where m is the number of points. In the following, m ≈ 1600 and nd2 = 400, 1600, and 6400. Note that the choice by default from the Poisson likelihood in spatstat corresponds to case (c). Baddeley et al. (2014) showed that for datasets with very large number of points and for very structured point processes, the logistic likelihood method is clearly preferable as it requires a smaller number of dummy points to perform quickly and efficiently. We want to investigate a similar comparison when these methods are regularized. 29 Table 8: Empirical selection properties (TPR, FPR, and PPV in %) based on 2000 replications of Thomas processes on the domain D (µ = 1600) for κ = 5 × 10−5 , for two different scenarios, and for three different numbers of dummy points. Different estimating equations are considered, the regularized (un)weighted Poisson and (un)weighted logistic regression likelihoods, employing adaptive lasso regularization method. Scenario 2 Method nd Unweighted Scenario 3 Weighted Unweighted Weighted TPR FPR PPV TPR FPR PPV TPR FPR PPV TPR FPR PPV 20 35 32 53 0* 96 98 82 16 47 2 79 * 95 98 83 16 46 2 77 Poisson 40 95 6 77 52 0 80 95 4 83 50 0* 94 98 83 16 43 2 74 49 0 * 91 98 72 20 41 2 73 * 93 99 81 16 43 2 74 93 99 83 16 42 2 73 20 * 96 94 11 60 Logistic 40 94 8 67 50 0 80 94 5 77 50 0* Approximate value We only repeat the results for κ = 5 × 10−5 and µ = 1600, and for scenarios 2 and 3. We use the same selection and prediction indices examined in Section 7.2 and consider only the adaptive lasso method. Table 8 presents selection properties for the Poisson and logistic likelihoods with adaptive lasso regularization. For unweighted versions of the procedure, the regularized logistic method outperforms the regularized Poisson method when nd = 20, i.e. when the number of dummy points is much smaller than the number of points. When nd2 ≈ m or nd2 > m, the methods tend to have similar performances. When we consider weighted versions of the regularized logistic and Poisson likelihoods, the results do not change that much with nd and the regularized Poisson likelihood method slightly outperforms the regularized logistic likelihood method. In addition, for scenario 3 which considers a more complex situation, the methods tend to select the noisy covariates much more frequently. Empirical biases, standard deviation and square root of mean squared errors are presented in Table 9. We include all empirical results for the standard Poisson and logistic estimates (i.e. no regularization is considered). Let us first consider the unweighted methods with no regularization. The logistic method clearly has smaller bias, especially when nd = 20, which explains why in most situations the RMSE is smaller. However, for the weighted methods, although the logistic method has smaller bias in general, it produces much larger SD, leading to larger RMSE for all cases. When we compare the weighted and the unweighted methods for logistic estimates, in general, not only do we fail to reduce the SD, but we also have larger bias. When the adaptive lasso regularization is considered, combined with the unweighted methods, we can preserve the bias in general and simultaneously improve the SD, and hence improve the RMSE. The logistic likelihood method 30 Table 9: Empirical prediction properties (Bias, SD, and RMSE) based on 2000 replications of Thomas processes on the domain D (µ = 1600) for κ = 5 × 10−5 , for two different scenarios, and for three different numbers of dummy points. Different estimating equations are considered, the regularized (un)weighted Poisson and (un)weighted logistic regression likelihoods, employing adaptive lasso regularization method. Scenario 2 Method nd Unweighted Scenario 3 Weighted Unweighted Weighted Bias SD RMSE Bias SD RMSE Bias SD RMSE Bias SD RMSE No regularization 20 0.37 0.64 0.74 0.29 0.74 0.79 0.28 2.15 2.16 0.42 2.06 2.11 Poisson 40 0.14 0.63 0.65 0.16 0.73 0.75 0.33 2.47 2.50 0.42 2.32 2.35 80 0.17 0.64 0.66 0.11 0.75 0.76 0.26 2.57 2.58 0.43 2.40 2.43 20 0.03 0.69 0.69 0.32 1.34 1.37 0.20 2.31 2.32 0.36 2.95 2.97 Logistic 40 0.07 0.60 0.61 0.12 0.96 0.97 0.23 2.31 2.32 0.37 2.56 2.58 80 0.10 0.60 0.61 0.14 0.81 0.82 0.25 2.36 2.38 0.42 2.38 2.42 Adaptive lasso 20 0.30 0.59 0.67 0.86 0.47 0.98 0.30 2.00 2.03 1.14 0.68 1.33 Poisson 40 0.20 0.58 0.61 0.86 0.49 0.99 0.33 2.33 2.35 1.18 0.70 1.37 80 0.18 0.59 0.62 0.88 0.51 1.02 0.28 2.41 2.43 1.22 0.71 1.41 20 0.19 0.50 0.53 0.95 0.55 1.09 0.23 2.06 2.07 1.26 0.73 1.45 Logistic 40 0.18 0.52 0.55 0.89 0.52 1.03 0.23 2.15 2.16 1.22 0.72 1.42 80 0.18 0.55 0.58 0.89 0.52 1.03 0.25 2.21 2.22 1.24 0.71 1.43 slightly outperforms the Poisson likelihood method. When the weighted methods are considered, we obtain smaller SD, but we have larger bias. For weighted versions of the Poisson and logistic likelihoods, the results do not change that much with nd and the weighted Poisson method slightly outperforms the weighted logistic method. From Tables 8 and 9, when the number of dummy points can be chosen as nd2 ≈ m or nd2 > m, we would recommend to apply the Poisson likelihood method. When the number of dummy points should be chosen as nd2 < m, the logistic likelihood method is more favorable. Our recommendations regarding whether weighted or unweighted methods follow the ones as in Section 7.2. 8 Application to forestry datasets In a 50-hectare region (D = 1, 000m × 500m) of the tropical moist forest of Barro Colorado Island (BCI) in central Panama, censuses have been carried out where all free-standing woody stems at least 10 mm diameter at breast height were identified, tagged, and mapped, resulting in maps of over 350,000 individual trees with more 31 than 300 species (see Condit, 1998; Hubbell et al., 1999, 2005). It is of interest to know how the very high number of different tree species continues to coexist, profiting from different habitats determined by e.g. topography or soil properties (see e.g. Waagepetersen, 2007; Waagepetersen and Guan, 2009). In particular, the selection of covariates among topological attributes and soil minerals as well as the estimation of their coefficients are becoming our most concern. Figure 2: Maps of locations of BPL trees (top left), elevation (top right), slope (bottom left), and concentration of phosporus (bottom right). We are particularly interested in analyzing the locations of 3,604 Beilschmiedia pendula Lauraceae (BPL) tree stems. We model the intensity of BPL trees as a loglinear function of two topological attributes and 13 soil properties as the covariates. Figure 2 contains maps of the locations of BPL trees, elevation, slope, and concentration of Phosporus. BPL trees seem to appear in greater abundance in the areas of high elevation, steep slope, and low concentration of Phosporus. The covariates maps are depicted in Figure 4. We apply the regularized (un)weighted Poisson and the logistic likelihoods, combined with adaptive lasso regularization to select and estimate parameters. Since we do not deal with datasets which have very large number of points, we can set the default number of dummy points for Poisson likelihood as in the spatstat package, i.e. the number of dummy points can be chosen to be larger than the number of points, to perform quickly and efficiently. It is worth emphasizing that we center and scale the 15 covariates to observe which one has the largest effect on the intensity. The results are presented in Table 10: 12 covariates for the Poisson likelihood and 11 for the logistic method are selected out of the 15 covariates using the unweighted methods while only 5 covariates (both for the Poisson and logistic methods) are selected using the weighted versions. The unweighted methods tend to overfit the model by overselecting unimportant covariates. The weighted methods tend to keep out the uninformative covariates. Both Poisson and logistic estimates own similar selection and estimation results. First, 32 Table 10: Barro Colorado Island data analysis: Parameter estimates of the regression coefficients for Beilschmiedia pendula Lauraceae trees applying regularized (un)weighted Poisson and logistic regression likelihoods with adaptive lasso regularization. Unweighted method Weighted method Poisson estimates Logistic estimates Poisson estimates Logistic estimates Elev 0.39 0.40 0.41 0.45 Slope 0.26 0.32 0.51 0.60 Al 0 0 0 0 B 0.30 0.30 0 0 Ca 0.10 0.15 0 0 Cu 0.10 0.12 0 0 Fe 0.05 0 0 0 K 0 0 0 0 Mg -0.17 -0.18 0 0 Mn 0.12 0.13 0.23 0.24 P -0.60 -0.60 -0.50 -0.52 Zn -0.43 -0.46 -0.35 -0.37 N 0 0 0 0 N.min -0.12 -0.10 0 0 pH -0.14 -0.14 0 0 12 11 5 5 Nb of cov. we find some differences on estimation between the unweighted and the weighted methods, especially for slope and Manganese (Mn), for which the weighted methods have approximately two times larger estimators. Second, we may loose some nonzero covariates when we apply the weighted methods, even though it is only for the covariates which have relatively small coefficient. Boron (B) has high correlation with many of the other covariates, particularly with those which are not selected. This is possibly why Boron, which is selected and may have nonnegligible coefficient in the unweighted methods, is not chosen in the model. This may explain why the weighted methods introduce extra biases. However, since the situation appears to be quite close to the scenario 3 from the simulation study, the weighted methods are more favorable in terms of both selection and prediction. In this application, we do not face any computational problem. Nevertheless, if we have to model a species of trees with much more points, the default value for nd will lead to numerical problems. In such a case, the logistic likelihood would be a good alternative. These results suggest that BPL trees favor to live in areas of higher elevation 33 and slope. This result is different from the findings by Waagepetersen (2007) and Guan and Loh (2007) which concluded based on standard error estimation that BPL trees do not really prefer either high or low altitudes. However, we have the same conclusion with the analysis by Guan and Shen (2010) and Thurman et al. (2015) that BPL trees prefer to live on higher altitudes. Further, higher levels of Manganese (Mn) and lower levels of both Phosporus (P) and Zinc (Zn) concentrations in soil are associated with higher appearance of BPL trees. 9 Conclusion and discussion We develop regularized versions of estimating equations based on Campbell theorem derived from the Poisson and the logistic likelihoods. Our procedure is able to estimate intensity function of spatial point processes, when the intensity is a function of many covariates and has a log-linear form. Furthermore, our procedure is also generally easy to implement in R since we need to combine spatstat package with glmnet and ncvreg packages. We study the asymptotic properties of both regularized weighted Poisson and logistic estimates in terms of consistency, sparsity, and normality distribution. We find that, among the regularization methods considered in this paper, adaptive lasso, adaptive elastic net, SCAD, and MC+ are the methods that can satisfy our theorems. We carry out some scenarios in the simulation study to observe selection and prediction properties of the estimates. We compare the penalized Poisson likelihood (PL) and the penalized weighted Poisson likelihood (WPL) with different penalty functions. From the results, when we deal with covariates having a complex covariance matrix and when the point pattern looks quite clustered, we recommend to apply the penalized WPL combined with adaptive lasso regularization. Otherwise, the regularized PL with adaptive lasso is more preferable. The further and more careful investigation to choose the tuning parameters may be needed to improve the selection properties. We note the bias increases quite significantly when the regularized WPL is applied. When the penalized WPL is considered, a two-step procedure may be needed to improve the prediction properties: (1) use the penalized WPL combined with adaptive lasso to chose the covariates, then (2) use the selected covariates to obtain the estimates. This post-selection inference procedure has not been investigated in this paper. We also compare the estimates obtained from the Poisson and the logistic likelihoods. When the number of dummy points can be chosen to be either similar to or larger than the number of points, we recommend the use of the Poisson likelihood method. Nevertheless, when the number of dummy points should be chosen to be smaller than the number of points, the logistic method is more favorable. A further work would consist in studying the situation when the number of the covariates is much larger than the sample size. In such a situation, the coordinate descent algorithm used in this paper may cause some numerical troubles. The Dantzig selector procedure introduced by Candes and Tao (2007) might be a good alternative as the implementaion for linear models (and for generalized linear mod34 els) results in a linear programming. It would be interesting to bring this approach to spatial point process setting. Acknowledgements We thank A. L. Thurman who kindly shared the R code used for the simulation study in Thurman et al. (2015) and P. Breheny who kindly provided his code used in ncvreg R package. We also thank R. Drouilhet for technical help. The research of J.-F. Coeurjolly is funded by ANR-11-LABX-0025 Persyval-lab (2011, project Oculo-Nimbus and Persyvact). The research of F. Letué is funded by ANR-11-LABX-0025 Persyval-lab (project Persyvact2). The BCI soils data sets were collected and analyzed by J. Dalling, R. John, K. Harms, R. Stallard and J. Yavitt with support from NSF DEB021104,021115, 0212284,0212818 and OISE 0314581, and STRI Soils Initiative and CTFS and assistance from P. Segre and J. Trani. Datasets are available at the Center for Tropical Forest Science website http://ctfs.si.edu/webatlas/datasets/bci/soilmaps/BCIsoil.html. References Adrian Baddeley and Rolf Turner. Practical maximum pseudolikelihood for spatial point patterns. Australian & New Zealand Journal of Statistics, 42(3):283–322, 2000. Adrian Baddeley and Rolf Turner. Spatstat: An R package for analyzing spatial point pattens. Journal of Statistical Software, 12(6):1–42, 2005. Adrian Baddeley, Jean-François Coeurjolly, Ege Rubak, and Rasmus Plenge Waagepetersen. Logistic regression for spatial Gibbs point processes. Biometrika, 101(2):377–392, 2014. Adrian Baddeley, Ege Rubak, and Rolf Turner. Spatial Point Patterns: Methodology and Applications with R. CRC Press, 2015. Mark Berman and Rolf Turner. Approximating point process likelihoods with glim. Applied Statistics, 41(1):31–38, 1992. Erwin Bolthausen. On the central limit theorem for stationary mixing random fields. The Annals of Probability, 10(4):1047–1050, 1982. Patrick Breheny and Jian Huang. Coordinate descent algorithms for nonconvex penalized regression, with applications to biological feature selection. The Annals of Applied Statistics, 5(1):232–253, 2011. Leo Breiman. Better subset regression using the nonnegative garrote. Technometrics, 37(4):373–384, 1995. 35 Peter Bühlmann and Sara Van De Geer. Statistics for high-dimensional data: methods, theory and applications. Springer Science & Business Media, 2011. Emmanuel Candes and Terence Tao. The Dantzig selector: statistical estimation when p is much larger than n. The Annals of Statistics, 35(6):2313–2351, 2007. Jean-François Coeurjolly and Jesper Møller. Variational approach to estimate the intensity of spatial point processes. Bernoulli, 20(3):1097–1125, 2014. Richard Condit. Tropical forest census plots. Springer-Verlag and R. G. Landes Company, Berlin, Germany, and Georgetown, Texas, 1998. Bradley Efron, Trevor Hastie, Iain Johnstone, Robert Tibshirani, et al. Least angle regression. The Annals of Statistics, 32(2):407–499, 2004. Jianqing Fan and Runze Li. Variable selection via nonconcave penalized likelihood and its oracle properties. Journal of the American Statistical Association, 96(456): 1348–1360, 2001. Jianqing Fan and Jinchi Lv. A selective overview of variable selection in high dimensional feature space. Statistica Sinica, 20(1):101–148, 2010. Jerome Friedman, Trevor Hastie, Holger Höfling, Robert Tibshirani, et al. Pathwise coordinate optimization. The Annals of Applied Statistics, 1(2):302–332, 2007. Jerome Friedman, Trevor Hastie, and Rob Tibshirani. Regularization paths for generalized linear models via coordinate descent. Journal of Statistical Software, 33(1):1–22, 2010. Yongtao Guan and Ji Meng Loh. A thinned block bootstrap variance estimation procedure for inhomogeneous spatial point patterns. Journal of the American Statistical Association, 102(480):1377–1386, 2007. Yongtao Guan and Ye Shen. A weighted estimating equation approach for inhomogeneous spatial point processes. Biometrika, 97(4):867–880, 2010. Yongtao Guan, Abdollah Jalilian, and Rasmus Plenge Waagepetersen. Quasilikelihood for spatial point processes. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 77(3):677–697, 2015. Xavier Guyon. Random fields on a network: modeling, statistics, and applications. Springer Science & Business Media, 1995. Arthur E Hoerl and Robert W Kennard. Ridge regression. Encyclopedia of statistical sciences, 1988. Stephen P Hubbell, Robin B Foster, Sean T O’Brien, KE Harms, Richard Condit, B Wechsler, S Joseph Wright, and S Loo De Lao. Light-gap disturbances, recruitment limitation, and tree diversity in a neotropical forest. Science, 283(5401): 554–557, 1999. 36 Stephen P Hubbell, Richard Condit, and Robin B Foster. Barro Colorado forest census plot data. 2005. URL http://ctfs.si.edu/datasets/bci. Janine Illian, Antti Penttinen, Helga Stoyan, and Dietrich Stoyan. Statistical analysis and modelling of spatial point patterns, volume 70. John Wiley & Sons, 2008. Zsolt Karácsony. A central limit theorem for mixing random fields. Miskolc Mathematical Notes, 7:147–160, 2006. Frédéric Lavancier, Jesper Møller, and Ege Rubak. Determinantal point process models and statistical inference. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 77(4):853–877, 2015. Rahul Mazumder, Jerome H Friedman, and Trevor Hastie. Sparsenet: Coordinate descent with nonconvex penalties. Journal of the American Statistical Association, 106(495):1125–1138, 2011. Jesper Møller and Rasmus Plenge Waagepetersen. Statistical inference and simulation for spatial point processes. CRC Press, 2004. Jesper Møller and Rasmus Plenge Waagepetersen. Modern statistics for spatial point processes. Scandinavian Journal of Statistics, 34(4):643–684, 2007. Art B Owen. A robust hybrid of lasso and ridge regression. Contemporary Mathematics, 443:59–72, 2007. Dimitris N Politis, Efstathios Paparoditis, and Joseph P Romano. Large sample inference for irregularly spaced dependent observations based on subsampling. Sankhyā: The Indian Journal of Statistics, Series A, 60(2):274–292, 1998. R Core Team. R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria, 2016. URL https: //www.R-project.org/. Stephen L Rathbun and Noel Cressie. Asymptotic properties of estimators for the parameters of spatial inhomogeneous Poisson point processes. Advances in Applied Probability, 26:122–154, 1994. Frederic Paik Schoenberg. Consistent parametric estimation of the intensity of a spatial–temporal point process. Journal of Statistical Planning and Inference, 128(1):79–93, 2005. Andrew L Thurman and Jun Zhu. Variable selection for spatial Poisson point processes via a regularization method. Statistical Methodology, 17:113–125, 2014. Andrew L Thurman, Rao Fu, Yongtao Guan, and Jun Zhu. Regularized estimating equations for model selection of clustered spatial point processes. Statistica Sinica, 25(1):173–188, 2015. 37 Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 58(1):267–288, 1996. Robert Tibshirani, Michael Saunders, Saharon Rosset, Ji Zhu, and Keith Knight. Sparsity and smoothness via the fused lasso. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 67(1):91–108, 2005. Rasmus Plenge Waagepetersen. An estimating function approach to inference for inhomogeneous Neyman–Scott processes. Biometrics, 63(1):252–258, 2007. Rasmus Plenge Waagepetersen. Estimating functions for inhomogeneous spatial point processes with incomplete covariate data. Biometrika, 95(2):351–363, 2008. Rasmus Plenge Waagepetersen and Yongtao Guan. Two-step estimation for inhomogeneous spatial point processes. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 71(3):685–702, 2009. Hansheng Wang, Guodong Li, and Guohua Jiang. Robust regression shrinkage and consistent variable selection through the lad-lasso. Journal of Business & Economic Statistics, 25(3):347–355, 2007a. Hansheng Wang, Runze Li, and Chih-Ling Tsai. Tuning parameter selectors for the smoothly clipped absolute deviation method. Biometrika, 94(3):553–568, 2007b. Larry Wasserman and Kathryn Roeder. High-dimensional variable selection. The Annals of Statistics, 37(5A):2178–2201, 2009. Ming Yuan and Yi Lin. Model selection and estimation in regression with grouped variables. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 68(1):49–67, 2006. Yu Ryan Yue and Ji Meng Loh. Variable selection for inhomogeneous spatial point process models. Canadian Journal of Statistics, 43(2):288–305, 2015. Cun-Hui Zhang. Nearly unbiased variable selection under minimax concave penalty. The Annals of Statistics, 38(2):894–942, 2010. Cun-Hui Zhang and Jian Huang. The sparsity and bias of the lasso selection in high-dimensional linear regression. The Annals of Statistics, 36(4):1567–1594, 2008. Yiyun Zhang, Runze Li, and Chih-Ling Tsai. Regularization parameter selections via generalized information criterion. Journal of the American Statistical Association, 105(489):312–323, 2010. Hui Zou. The adaptive lasso and its oracle properties. Journal of the American Statistical Association, 101(476):1418–1429, 2006. 38 Hui Zou and Trevor Hastie. Regularization and variable selection via the elastic net. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 67(2): 301–320, 2005. Hui Zou and Runze Li. One-step sparse estimates in nonconcave penalized likelihood models. The Annals of Statistics, 36(4):1509–1533, 2008. Hui Zou and Hao Helen Zhang. On the adaptive elastic-net with a diverging number of parameters. The Annals of Statistics, 37(4):1733–1751, 2009. A Auxiliary Lemma The following result is used in the proof of Theorems 1-2. Throughout the proofs, the notation Xx = OP (xn ) or Xb = oP (xn ) for a random vector Xn and a sequence of real numbers xn means that kXn k = OP (xn ) and kXn k = oP (xn ). In the same way for a vector Vn or a squared matrix Mn , the notation Vn = O(xn ) and Mn = O(xn ) mean that kVn k = O(xn ) and kMn k = O(xn ). Lemma 1. Under the conditions (C.1)-(C.6), the following convergence holds in distribution as n → ∞ d {Bn (w; β 0 ) + Cn (w; β 0 )}−1/2 `(1) − N (0, Ip ). n (w; β 0 ) → Moreover as n → ∞, 1 |Dn |− 2 `(1) n (w; β 0 ) = OP (1). (A.1) (A.2) Proof. Let us first note that using Campbell Theorems (2.1)-(2.2) Var[`(1) n (w; β 0 )] = Bn (w; β 0 ) + Cn (w; β 0 ). The proof of (A.1) follows Coeurjolly and Møller (2014). Let Ci = i + (−1/2, 1/2]d be the [ unit box centered at i ∈ Zd and define In = {i ∈ Zd , Ci ∩ Dn 6= ∅}. Set Dn = Ci,n , where Ci,n = Ci ∩ Dn . We have i∈In `(1) n (w; β 0 ) = X Yi,n i∈In where Yi,n = X Z w(u)z(u) exp(β > 0 z(u))du. w(u)z(u) − Ci,n u∈X∩Ci,n For any n ≥ 1 and any i ∈ In , Yi,n has zero mean, and by condition (C.4), sup sup E(kYi,n k2+δ ) < ∞. n≥1 i∈In 39 (A.3) If we combine (A.3) with conditions (C.1)-(C.6), we can apply Karácsony (2006, Theorem 4), a central limit theorem for triangular arrays of random fields, to obtain (A.1) which also implies that {Bn (w; β 0 ) + Cn (w; β 0 )}−1/2 `(1) n (w; β 0 ) = OP (1) as n → ∞. The second result (A.2) is deduced from condition (C.6) which in particular implies that |Dn |1/2 {Bn (w; β 0 ) + Cn (w; β 0 )}−1/2 = O(1). B Proof of Theorem 1 In the proof of this result and the following ones, the notation κ stands for a generic constant which may vary from line to line. In particular this constant is independent of n, β 0 and k. Proof. Let dn = |Dn |−1/2 +an , and k = {k1 , k2 , . . . , kp }> ∈ Rp . We remind the reader that the estimate of β 0 is defined as the maximum of the function Q (given by (4.1)) over Θ, an open convex bounded set of Rp . For any k such that kkk ≤ K < ∞, β 0 + dn k ∈ Θ for n sufficiently large. Assume this is valid in the following. To prove Theorem 1, we follow the main argument by Fan and Li (2001) and aim at proving that for any given  > 0, there exists K > 0 such that for n sufficiently large   P sup ∆n (k) > 0 ≤ , where ∆n (k) = Q(w; β 0 + dn k) − Q(w; β 0 ). (B.1) kkk=K Equation (B.1) will imply that with probability at least 1 − , there exists a local maximum in the ball {β 0 + dn k : kkk ≤ K}, and therefore a local maximizer β̂ such that kβ̂ − β 0 k = OP (dn ). We decompose ∆n (k) as ∆n (k) = T1 + T2 where T1 =`n (w; β 0 + dn k) − `n (w; β 0 ) p X  T2 =|Dn | pλn,j (|β0j |) − pλn,j (|β0j + dn kj |) . j=1 (2) Since ρ(u; ·) is infinitely continuously differentiable and `n (w; β) = −An (w; β), then using a second-order Taylor expansion there exists t ∈ (0, 1) such that 1 2 > T1 = dn k> `(1) n (w; β 0 ) − dn k An (w; β 0 )k 2 1 2 > + dn k (An (w; β 0 ) − An (w; β 0 + tdn k)) k. 2 Since Θ is convex and bounded and since w(·) and z(·) are uniformly bounded by conditions (C.2)-(C.3), there exists a nonnegative constant κ such that 1 kAn (w; β 0 ) − An (w; β 0 + tdn k)k ≤ κdn |Dn |. 2 40 Let νmin (M) be the smallest eigenvalue of a squared matrix M. By condition (C.7), k> (|Dn |−1 An (w; β 0 )) k ν̌ := lim inf νmin (|Dn | An (w; β 0 )) = lim inf > 0. n→∞ n→∞ kkk2 −1 Hence ν̌ 2 2 3 T1 ≤ dn k`(1) n (w; β 0 )k kkk − dn |Dn |kkk + κdn |Dn |. 2 Regarding the term T2 , T2 ≤ T20 s X  := |Dn | pλn,j (|β0j |) − pλn,j (|β0j + dn kj |) j=1 since for any j the penalty function pλn,j is nonnegative and pλn,j (|β0j |) = 0 for j = s + 1, . . . , p. Since dn |Dn |1/2 = O(1), then by (C.8), for n sufficiently large, pλn,j is twice continuously differentiable for every βj = β0j + tdn kj with t ∈ (0, 1). Therefore using a third-order Taylor expansion, there exist tj ∈ (0, 1), j = 1, . . . , s such that −T20 = dn |Dn | s X kj p0λn,j (|β0j |) sign(β0,j ) j=1 s X 1 2 kj2 p00λn,j (|β0j |) + dn |Dn | 2 j=1 s X 1 3 + dn |Dn | kj3 p000 λn,j (|β0j + tj dn kj |). 6 j=1 Now by definition of an and cn and from condition (C.8), we deduce that there exists κ such that 1 T20 ≤ an dn |Dn | |k> 1| + cn d2n |Dn |kkk2 + κd3n |Dn | 2 √ 1 ≤ san dn |Dn |kkk + cn d2n |Dn |kkk2 + κd3n |Dn | 2 from Cauchy-Schwarz inequality. Since cn = o(1), dn = o(1) and an dn |Dn | = O(d2n |Dn |), then for n sufficiently large √ 2 ν̌ 2 2 ∆n (k) ≤ dn k`(1) n (w; β 0 )k kkk − dn |Dn |kkk + 2 sdn |Dn |kkk 4 We now return to (B.1): for n sufficiently large     √ ν̌ (1) P sup ∆n (k) > 0 ≤ P k`n (w; β 0 )k > dn |Dn |K − 2 sdn |Dn | 4 kkk=K Since dn |Dn | = O(|Dn |1/2 ), by choosing K large enough, there exists κ such that for n sufficiently large     1/2 (1) P sup ∆n (k) > 0 ≤ P k`n (w; β 0 )k > κ|Dn | ≤ kkk=K for any given  > 0 from (A.2). 41 C Proof of Theorem 2 To prove Theorem 2(i), we provide Lemma 2 as follows. Lemma 2. Assume the conditions (C.1)-(C.6) and condition (C.8) hold. If an = O(|Dn |−1/2 ) and bn |Dn |1/2 → ∞ as n → ∞, then with probability tending to 1, for any β 1 satisfying kβ 1 − β 01 k = OP (|Dn |−1/2 ), and for any constant K1 > 0,     Q w; (β 1 > , 0> )> = max Q w; (β 1 > , β 2 > )> . kβ 2 k≤K1 |Dn |−1/2 Proof. It is sufficient to show that with probability tending to 1 as n → ∞, for any β 1 satisfying kβ 1 − β 01 k = OP (|Dn |−1/2 ), for some small εn = K1 |Dn |−1/2 , and for j = s + 1, . . . , p, ∂Q(w; β) <0 ∂βj ∂Q(w; β) >0 ∂βj for 0 < βj < εn , and (C.1) for − εn < βj < 0. (C.2) (1) First note that by (A.2), we obtain k`n (w; β 0 )k = OP (|Dn |1/2 ). Second, by conditions (C.2)-(C.3), there exists t ∈ (0, 1) such that p X ∂`n (w; β) ∂`n (w; β 0 ) ∂ 2 `n (w; β 0 + t(β − β 0 )) = +t (βl − β0l ) ∂βj ∂βj ∂β j ∂βl l=1 = OP (|Dn |1/2 ) + OP (|Dn ||Dn |−1/2 ) = OP (|Dn |1/2 ). Third, let 0 < βj < εn and bn the sequence given by (6.3). By condition (C.8), bn is well-defined and since by assumption bn |Dn |1/2 → ∞, in particular, bn > 0 for n sufficiently large. Therefore, for n sufficiently large,     ∂Q(w; β) ∂`n (w; β) 0 P <0 =P − |Dn |pλn,j (|βj |) sign(βj ) < 0 ∂βj ∂βj   ∂`n (w; β) 0 =P < |Dn |pλn,j (|βj |) ∂βj   ∂`n (w; β) ≥P < |Dn |bn ∂βj   ∂`n (w; β) 1/2 1/2 =P < |Dn | |Dn | bn . ∂βj P (∂Q(w; β)/∂βj < 0) → − 1 as n → ∞ since ∂`n (w; β)/∂βj = OP (|Dn |1/2 ) and bn |Dn |1/2 → − ∞. This proves (C.1). We proceed similarly to prove (C.2). 42 Proof. We now focus on the proof of Theorem 2. Since Theorem 2(i) is proved by Lemma 2, we only need to prove Theorem 2(ii), which is the asymptotic normality of β̂ 1 . As shown in Theorem 1, there is a root-|Dn | consistent local maximizer β̂ of Q(w; β), and it can be shown that there exists  an estimator β̂ 1 in Theorem 1 that > > > is a root-(|Dn |) consistent local maximizer of Q w; (β 1 , 0 ) , which is regarded as a function of β 1 , and that satisfies ∂Q(w; β̂) =0 ∂βj > for j = 1, . . . , s, and β̂ = (β̂ 1 , 0> )> . There exists t ∈ (0, 1) and β̆ = β̂ + t(β 0 − β̂) such that ∂`n (w; β̂) − |Dn |p0λn,j (|β̂j |) sign(β̂j ) ∂βj s ∂`n (w; β 0 ) X ∂ 2 `n (w; β̆) = + (β̂l − β0l ) − |Dn |p0λn,j (|β̂j |) sign(β̂j ) ∂βj ∂βj ∂βl l=1 0= s s X ∂`n (w; β 0 ) X ∂ 2 `n (w; β 0 ) = + (β̂l − β0l ) + Ψn,jl (β̂l − β0l ) ∂βj ∂β j ∂βl l=1 l=1 − |Dn |p0λn,j (|β0j |) sign(β0j ) − |Dn |φn,j , (C.3) where Ψn,jl = ∂ 2 `n (w; β̆) ∂ 2 `n (w; β 0 ) − ∂βj ∂βl ∂βj ∂βl and φn,j = p0λn,j (|β̂j |) sign(β̂j ) − p0λn,j (|β0j |) sign(β0j ). We decompose φn,j as φn,j = T1 + T2 where T1 = φn,j I(|β̂j − β0j | ≤ r̃n,j ) and T2 = φn,j I(|β̂j − β0j | > r̃n,j ) and where r̃n,j is the sequence defined in the condition (C.8). Under this condition, the following Taylor expansion can be derived for the term T1 : there exists t ∈ (0, 1) and β̌j = β̂j + t(β0j − β̂j ) such that T1 = p00λn,j (|β0j |)(β̂j − β0j )I(|β̂j − β0j | ≤ r̃n,j ) 1 + (β̂j − β0j )2 p000 λn,j (|β̆j |)sign(β̌j )I(|β̂j − β0j | ≤ r̃n,j ) 2 = p00λn,j (|β0j |)(β̂j − β0j )I(|β̂j − β0j | ≤ r̃n,j ) + OP (|Dn |−1 ) where the latter equation ensues from Theorem 1 and condition (C.8). Again, from L1 P Theorem 1, I(|β̂j − β0j | ≤ r̃n,j ) −→ 1 which implies that I(|β̂j − β0j | ≤ r̃n,j ) − → 1, so  00 −1 T1 = pλn,j (|β0j |)(β̂j − β0j ) 1 + oP (1) + OP (|Dn | ). Regarding the term T2 , since p0λ is a Lipschitz function, there exists κ ≥ 0 such that T2 ≤ κ|β̂j − β0j | I(|β̂j − β0j | > r̃n,j ). 43 By Theorem 1, |β̂j − β0j | = OP (|Dn |−1/2 ) and I(|β̂j − β0j | > r̃n,j ) = oP (1), so T2 = oP (|Dn |−1/2 ) and we deduce that  (C.4) φn,j = p00λn,j (|β0j |)(β̂j − β0j ) 1 + oP (1) + oP (|Dn |−1/2 ). (1) (2) Let `n,1 (w; β 0 ) (resp. `n,1 (w; β 0 )) be the first s components (resp. s × s top-left (1) (2) corner) of `n (w; β 0 ) (resp. `n (w; β 0 )). Let also Ψn be the s × s matrix containing Ψn,jl , j, l = 1, . . . , s. Finally, let the vector p0n , the vector φn and the s × s matrix Mn be p0n = {p0λn,1 (|β01 |) sign(β01 ), . . . , p0λn,s (|β0s |) sign(β0s )}> , φn = {φn,1 , . . . , φn,s }> , and Mn = {Bn,11 (w; β 0 ) + Cn,11 (w; β 0 )}−1/2 . We rewrite both sides of (C.3) as (1) (2) `n,1 (w; β 0 ) + `n,1 (w; β 0 )(β̂ 1 − β 01 ) + Ψn (β̂ 1 − β 01 ) − |Dn |p0n − |Dn |φn = 0. (C.5) By definition of Πn given by (6.6) and from (C.4), we obtain φn = Πn (β̂ 1 −β 01 ) 1+  oP (1) + oP (|Dn |−1/2 ). Using this, we deduce, by premultiplying both sides of (C.5) by Mn , that  (1) Mn `n,1 (w; β 0 )−Mn An,11 (w; β 0 ) + |Dn |Πn (β̂ 1 − β 01 ) = O(|Dn | kMn p0n k) + oP (|Dn | kMn Πn (β̂ 1 − β 01 )k) + oP (kMn k |Dn |1/2 ) + OP (kMn Ψn (β̂ 1 − β 01 )k). The condition (C.6) implies that there exists an s × s positive definite matrix I000 such that for all sufficiently large n, we have |Dn |−1 (Bn,11 (w; β 0 ) + Cn,11 (w; β 0 )) ≥ I000 , hence kMn k = O(|Dn |−1/2 ). Now, kΨn k = OP (|Dn |1/2 ) by conditions (C.2)-(C.3) and by Theorem 1, and kβ̂ 1 − β 01 k = OP (|Dn |−1/2 ) by Theorem 1 and by Theorem 2(i). Finally, since by assumption an = o(|Dn |−1/2 ), we deduce that kMn Ψn (β̂ 1 − β 01 )k = OP (|Dn |−1/2 ) = oP (1), |Dn | kMn Πn (β̂ 1 − β 01 )k = oP (1), kMn k |Dn |1/2 = O(1), |Dn | kMn p0n k = O(an |Dn |1/2 ) = o(1). Therefore, we have that  (1) Mn `n,1 (w; β 0 ) − Mn An,11 (w; β 0 ) + |Dn |Πn (β̂ 1 − β 01 ) = oP (1). From (A.1), Theorem 2(i) and by Slutsky’s Theorem, we deduce that d {Bn,11 (w; β 0 ) + Cn,11 (w; β 0 )}−1/2 {An,11 (w; β 0 ) + |Dn |Πn }(β̂ 1 − β 01 ) → − N (0, Is ) 44 as n → ∞, which can be rewritten, in particular under (C.7), as d |Dn |1/2 Σn (w; β 0 )−1/2 (β̂ 1 − β 01 ) → − N (0, Is ) where Σn (w, β 0 ) is given by (6.5). D Map of covariates Figure 3: Maps of covariates designed in scenario 2. The first two top left images are the elevation and the slope. The other 18 covariates are generated as standard Gaussian white noise but transformed to get multicollinearity. Figure 4: Maps of covariates used in scenario 3 and in application. From left to right: Elevation, slope, Aluminium, Boron, and Calcium (1st row), Copper, Iron, Potassium, Magnesium, and Manganese (2nd row), Phosporus, Zinc, Nitrogen, Nitrigen mineralisation, and pH (3rd row). 45
10math.ST
1 Wireless Network Design for Control Systems: A Survey arXiv:1708.07353v1 [cs.SY] 24 Aug 2017 Pangun Park, Sinem Coleri Ergen, Carlo Fischione, Chenyang Lu, and Karl Henrik Johansson Abstract—Wireless networked control systems (WNCS) are composed of spatially distributed sensors, actuators, and controllers communicating through wireless networks instead of conventional point-to-point wired connections. Due to their main benefits in the reduction of deployment and maintenance costs, large flexibility and possible enhancement of safety, WNCS are becoming a fundamental infrastructure technology for critical control systems in automotive electrical systems, avionics control systems, building management systems, and industrial automation systems. The main challenge in WNCS is to jointly design the communication and control systems considering their tight interaction to improve the control performance and the network lifetime. In this survey, we make an exhaustive review of the literature on wireless network design and optimization for WNCS. First, we discuss what we call the critical interactive variables including sampling period, message delay, message dropout, and network energy consumption. The mutual effects of these communication and control variables motivate their joint tuning. We discuss the effect of controllable wireless network parameters at all layers of the communication protocols on the probability distribution of these interactive variables. We also review the current wireless network standardization for WNCS and their corresponding methodology for adapting the network parameters. Moreover, we discuss the analysis and design of control systems taking into account the effect of the interactive variables on the control system performance. Finally, we present the state-of-the-art wireless network design and optimization for WNCS, while highlighting the tradeoff between the achievable performance and complexity of various approaches. We conclude the survey by highlighting major research issues and identifying future research directions. Index Terms—wireless networked control systems, wireless sensor and actuator networks, joint design, delay, reliability, sampling rate, network lifetime, optimization. I. I NTRODUCTION Recent advances in wireless networking, sensing, computing, and control are revolutionizing how control systems interact with information and physical processes such as Cyber-Physical Systems (CPS), Internet of Things (IoT), and Tactile Internet [1], [2], [3]. In Wireless Networked Control Systems (WNCS), sensor nodes attached to the physical plant sample and transmit their measurements to the controller over a wireless channel; controllers compute control commands P. Park is with the Department of Radio and Information Communications Engineering, Chungnam National University, Korea (email: pgpark@cnu.ac.kr). S. Coleri Ergen is with the Department of Electrical and Electronics Engineering, Koc University, Istanbul, Turkey (email: sergen@ku.edu.tr). C. Lu is with the Department of Computer Science and Engineering, Washington University in St. Louis, St. Louis, USA (e-mail: lu@cse.wustl.edu). C. Fischione and K. H. Johansson are with the ACCESS Linnaeus Center, Electrical Engineering, Royal Institute of Technology, Stockholm, Sweden (e-mail: carlofi, kallej@ee.kth.se). P. Park and S. Coleri Ergen contributed equally to this work. based on these sensor data, which are then forwarded to the actuators in order to influence the dynamics of the physical plant [4], [5]. In particular, WNCS are strongly related to CPS and Tactile Internet since these emerging techniques deal with the real-time control of physical systems over the networks. There is a strong technology push behind WNCS through the rise of embedded computing, wireless networks, advanced control, and cloud computing as well as a pull from emerging applications in automotive [6], [7], avionics [8], building management [9], and industrial automation [10], [11]. For example, WNCS play a key role in Industry 4.0 [12]. The ease of installation and maintenance, large flexibility, and increased safety make WNCS a fundamental infrastructure technology for safety-critical control systems. WNCS applications have been backed up by several international organizations such as Wireless Avionics Intra-Communications Alliance [8], Zigbee Alliance [13], Z-wave Alliance [14], International Society of Automation [15], Highway Addressable Remote Transducer communication foundation [16], and Wireless Industrial Networking Alliance [17]. WNCS require novel design mechanisms to address the interaction between control and wireless systems for maximum overall system performance and efficiency. Conventional control system design is based on the assumption of instantaneous delivery of sensor data and control commands with extremely high reliabilities. The usage of wireless networks in the data transmission introduces non-zero delay and message error probability at all times. Transmission failures or deadline misses may result in the degradation of the control system performance, and even more serious economic losses or reduced human safety. Hence, control system design needs to include mechanisms to tolerate message loss and delay. On the other hand, wireless network design needs to consider the strict delay and reliability constraints of control systems. The data transmissions should be sufficiently reliable and deterministic with the latency on the order of seconds, or even milliseconds, depending on the time constraints of the closedloop system [10], [11]. Furthermore, removing cables for the data communication of sensors and actuators motivates the removal of the power supply to these nodes to achieve full flexibility. The limited stored battery or harvested energy of these components brings additional limitation on the energy consumption of the wireless network [18], [19], [20]. The interaction between wireless networks and control systems can be illustrated by an example. A WNCS connects sensors attached to a plant to a controller via the single-hop wireless networking protocol IEEE 802.15.4. Fig. 1 shows the control cost of the WNCS using the IEEE 802.15.4 protocol 2 Message loss probability 0.2 Sfrag replacements 0.18 5.5 0.16 5 III. Wireless Networked Control Systems 0.14 4.5 0.12 4 IV. Critical Interactive System Variables 0.1 3.5 0.08 3 Sampling Period Network Delay 0.06 Message Dropout Network Energy Consumption 2.5 0.04 allowable control cost 2 0.02 Network constraints 1.5 V. Wireless Network 0 50 100 150 200 250 300 Sampling period (ms) (a) Control cost for various sampling periods and message loss probabilities. Standardization Wireless Network Parameters 150 VI. Control System Analysis and Design Time-Triggered Sampling Event-Triggered Sampling Message delay (ms) 5.5 5 100 VII. Wireless Network Design Techniques for Control Systems 4.5 4 Interactive Design Joint Design 50 Sfrag replacements 3.5 allowable control cost Network constraints Fig. 2: Main section structure and relations. 3 0 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 Message loss probability (b) Control cost for various message delays and message loss probabilities. Fig. 1: Control cost of a WNCS using IEEE 802.15.4 protocol for various sampling periods, message delays and message loss probabilities. for different sampling periods, message delays and message loss probabilities [21]. The quadratic control cost is defined as a sum of the deviations of the plant state from its desired setpoint and the magnitude of the control input. The maximum allowable control cost is set to 6. The transparent region indicates that the maximum allowable control cost or network requirements are not feasible. For instance, the control cost would be minimized when there is no message loss and no delay, but this point is infeasible since these requirements cannot be met by the IEEE 802.15.4 protocol. The control cost generally increases as the message loss probability, message delay, and sampling period increase. Since short sampling periods increase the traffic load, the message loss probability, and the message delay are then closer to their critical values, above which the system is unstable [22]. Hence, the area and shape of the feasible region significantly depends on the network performance. Determining the optimal parameters for minimum network cost while achieving feasibility is not trivial because of the complex interdependence of the control and communication systems. Recently, Lower-Power Wide-Area Network (LPWAN) such as Long-Range WAN (LoRa) [23] and NarrowBand IoT (NB- IoT) [24] are developed to enable IoT connections over long-ranges (10–15 km). Even though some related works of WNCS are applicable for LPWAN-based control applications such as Smart Grid [25], Smart Transportation [26], and Remote Healthcare [27], this survey focuses on wireless control systems based on Low-Power Wireless Personal Area Networks (LoWPAN) with short-range radios and their applications. Some recent excellent surveys exist on wireless networks, particularly for industrial automation [28], [29], [30]. Specifically, [28] discusses the general requirements and representative protocols of Wireless Sensor Networks (WSNs) for industrial applications. [29] compares popular industrial WSN standards in terms of architecture and design. [30] mainly elaborates on real-time scheduling algorithms and protocols for WirelessHART networks, experimentation and joint wireless-control design approaches for industrial automation. While [30] focused on WirelessHART networks and their control applications, this article provides a comprehensive survey of the design space of wireless networks for control systems and the potential synergy and interaction between control and communication designs. Specifically, our survey touches on the importance of interactions between recent advanced works of NCS and WSN, as well as different approaches of wireless network design and optimization for various WNCS applications. The goal of this survey is to unveil and address the requirements and challenges associated with wireless network design for WNCS and present a review of recent advances in novel design approaches, optimizations, algorithms, and protocols for effectively developing WNCS. The section structure and relations are illustrated in Fig. 2. Section II introduces some 3 inspiring applications of WNCS in automotive electronics, avionics, building automation, and industrial automation. Section III describes WNCS where multiple plants are remotely controlled over a wireless network. Section IV presents the critical interactive variables of communication and control systems, including sampling period, message delay, message dropout, and energy consumption. Section V introduces basic wireless network standardization and key network parameters at various protocol layers useful to tune the distribution of the critical interactive variables. Section VI then provides an overview of recent control design methods incorporating the interactive variables. Section VII presents various optimization techniques for wireless networks integrating the control systems. We classify the design approaches into two categories based on the degree of the integration: interactive designs and joint designs. In the interactive design, the wireless network parameters are tuned to satisfy given requirements of the control system. In the joint design, the wireless network and control system parameters are jointly optimized considering the tradeoff between their performances. Section VIII describes three experimental testbeds of WNCS. We conclude this article by highlighting promising research directions in Section IX. II. M OTIVATING A PPLICATIONS This section explores some inspiring applications of WNCS. A. Intra-Vehicle Wireless Network In-vehicle wireless networks have been recently proposed with the goal of reducing manufacturing and maintenance cost of a large amount of wiring harnesses within vehicles [6], [7]. The wiring harnesses used for the transmission of data and power delivery within the current vehicle architecture may have up to 4 000 parts, weigh as much as 40 kg and contain up to 4 km of wiring. Eliminating these wires would additionally have the potential to improve fuel efficiency, greenhouse gas emission, and spur innovation by providing an open architecture to accommodate new systems and applications. An intra-vehicular wireless network consists of a central control unit, a battery, electronic control units, wireless sensors, and wireless actuators. Wireless sensor nodes send their data to the corresponding electronic control unit while scavenging energy from either one of the electronic control units or energy scavenging devices attached directly to them. Actuators receive their commands from the corresponding electronic control unit, and power from electronic control units or an energy scavenging device. The reason for incorporating energy scavenging into the envisioned architecture is to eliminate the lifetime limitation of fixed storage batteries. The applications that can exploit a wireless architecture fall into one of three categories: powertrain, chassis, and body. Powertrain applications use automotive sensors in engine, transmission, and onboard diagnostics for control of vehicle energy use, driveability, and performance. Chassis applications control vehicle handling and safety in steering, suspension, braking, and stability elements of the vehicle. Body applications include sensors mainly used for vehicle occupant needs such as occupant safety, security, comfort, convenience, and information. The first intra-vehicle wireless network applications are the Tire Pressure Monitoring System (TPMS) [31] and Intelligent Tire [32]. TPMS is based on the wireless transmission of tire pressure data from the in-tire sensors to the vehicle body. It is currently being integrated into all new cars in both U.S.A and Europe. Intelligent Tire is based on the placement of wireless sensors inside the tire to transfer accelerometer data to the coordination nodes in the body of the car with the goal of improving the performance of active safety systems. Since accelerometer data are generated at much higher rate than the pressure data and batteries cannot be placed within the tire, Intelligent Tire contains an ultralow power wireless communication system powered by energy scavenging technology, which is now being commercialized by Pirelli [33]. B. Wireless Avionics Intra-Communication Wireless Avionics Intra-Communications (WAIC) have a tremendous potential to improve an aircraft’s performance through more cost-effective flight operations, reduction in overall weight and maintenance costs, and enhancement of the safety [8]. Currently, the cable harness provides the connection between sensors and their corresponding control units to sample and process sensor information, and then among multiple control units over a backbone network for the safetycritical flight control [8], [34]. Due to the high demands on safety and efficiency, the modern aircraft relies on a large wired sensor and actuator networks that consist of more than 5 000 devices. Wiring harness usually represents 2–5% of an aircraft’s weight. For instance, the wiring harness of the Airbus A350-900 weights 23 000 kg [35]. The WAIC alliance considers wireless sensors of avionics located at various locations both within and outside the aircraft. The sensors are used to monitor the health of the aircraft structure, e.g., smoke sensors and ice detectors, and its critical systems, e.g., engine sensors and landing gear sensors. The sensor information is communicated to a central onboard entity. Potential WAIC applications are categorized into two broad classes according to application data rate requirements [36]. Low and high data rate applications have data rates less than and above 10 kbit/s, respectively. At the World Radio Conference 2015, the International Telecommunication Union voted to grant the frequency band 4.2–4.4 GHz for WAIC systems to allow the replacement of the heavy wiring used in aircraft [37]. The WAIC alliance is dedicating efforts to the performance analysis of the assigned frequency band and the design of the wireless networks for avionics control systems [8]. Space shuttles and international space stations have already been using commercially available wireless solutions such as EWB MicroTAU and UltraWIS of Invocon [38]. C. Building Automation Wireless network based building automation provides significant savings in installation cost, allowing a large retrofit market to be addressed as well as new constructions. Building 4 automation aims to achieve optimal level occupant comfort while minimizing energy usage [39]. These control systems are the integrative component to fans, pumps, heating/cooling equipment, dampers, and thermostats. The modern building control systems require a wide variety of sensing capabilities in order to control temperature, pressure, humidity, and flow rates. The European environment agency [40], [41] shows that the electricity and water consumption of buildings are about 30% and 43% of the total resource consumptions, respectively. An On World survey [42] reports that 59% of 600 early adopters in five continents are interested in new technologies that will help them better manage their energy consumption, and 81% are willing to pay for energy management equipment if they could save up to 30% on their energy bill for smart energy home applications. An example of energy management systems using WSNs is the intelligent building ventilation control described in [9]. An underfloor air distribution indoor climate regulation process is set with the injection of a fresh airflow from the floor and an exhaust located at the ceiling level. The considered system is composed of ventilated rooms, fans, plenums, and wireless sensors. A well-designed underfloor air distribution systems can reduce the energy consumption of buildings while improving the thermal comfort, ventilation efficiency and indoor air quality by using the low-cost WSNs. D. Industrial Automation Wireless sensor and actuator network (WSAN) is an effective smart infrastructure for process control and factory automation [11], [43], [44]. Emerson Process Management [45] estimates that WSNs enable cost savings of up to 90% compared to the deployment cost of wired field devices in the industrial automation domain. In industrial process control, the product is processed in a continuous manner (e.g., oil, gas, chemicals). In factory automation or discrete manufacturing, instead, the products are processed in discrete steps with the individual elements (e.g., cars, drugs, food). Industrial wireless sensors typically report the state of a fuse, heating, ventilation, or vibration levels on pumps. Since the discrete product of the factory automation requires sophisticated operations of robot and belt conveyors at high speed, the sampling rates and real-time requirements are often stricter than those of process automation. Furthermore, many industrial automation applications might in the future require battery-operated networks of hundreds of sensors and actuators communicating with access points. According to TechNavio [46], WSN solutions in industrial control applications is one of the major emerging industrial trends. Many wireless networking standards have been proposed for industrial processes, e.g., WirelessHART by ABB, Emerson, and Siemens and ISA 100.11a by Honeywell [47]. Some industrial wireless solutions are also commercially available and deployed such as Tropos of ABB and Smart Wireless of Emerson. III. W IRELESS N ETWORKED C ONTROL S YSTEMS Fig. 3 depicts the generalized closed-loop diagram of WNCS where multiple plants are remotely controlled over a Actuators Sensors Plant Sensors Actuators Plant Wireless Networks Controller Controller Fig. 3: Overview of the considered NCS setup. Multiple plants are controlled by multiple controllers. A wireless network closes the loop from sensor to controller and from controller to actuator. The network includes not only nodes attached to the plant or controller, but also relay nodes. wireless network [48]. The wireless network includes sensors and actuators attached to the plants, controllers, and relay nodes. A plant is a continuous-time physical system to be controlled. The inputs and outputs of the plant are continuoustime signals. Outputs of plant i are sampled at periodic or aperiodic intervals by the wireless sensors. Each packet associated to the state of the plant is transmitted to the controller over a wireless network. When the controller receives the measurements, it computes the control command. The control commands are then sent to the actuator attached to the plant. Hence, the closed-loop system contains both a continuous-time and a sampled-data component. Since both sensor–controller and controller–actuator channels use a wireless network, general WNCS of Fig. 3 are also called two-channel feedback NCS [48]. The system scenario is quite general, as it applies to any interconnection between a plant and a controller. A. Control Systems The objective of the feedback control system is to ensure that the closed-loop system has desirable dynamic and steadystate response characteristics, and that it is able to efficiently attenuate disturbances and handle network delays and loss. Generally, the closed-loop system should satisfy various design objectives: stability, fast and smooth responses to setpoint changes, elimination of steady-state errors, avoidance of excessive control actions, and a satisfactory degree of robustness to process variations and model uncertainty [49]. In particular, the stability of a control system is an extremely important requirement. Most NCS design methods consider subsets of these requirements to synthesize the estimator and the controller. In this subsection, we briefly introduce some fundamental aspects of modeling, stability, control cost, and controller and estimator design for NCSs. 1) NCS Modeling: NCSs can be modeled using three main approaches, namely, the discrete-time approach, the sampleddata approach, and the continuous-time approach, dependent on the controller and the plant [50]. The discrete-time approach considers discrete-time controllers and a discrete-time plant model. The discrete-time representation leads often to an uncertain discrete-time system in which the uncertainties appear in the matrix exponential form due to discretization. 5 Typically, this approach is applied to NCS with linear plants and controllers since in that case exact discrete-time models can be derived. Secondly, the sampled-data approach considers discretetime controllers but for a continuous-time model that describes the sampled-data NCS dynamics without exploiting any form of discretization [51]. Delay-differential equations can be used to model the sampled-data dynamics. This approach is able to deal simultaneously with time-varying delays and time-varying sampling intervals. Finally, the continuous-time approach designs a continuoustime controller to stabilize a continuous-time plant model. The continuous-time controller then needs to be approximated by a representation suitable for computer implementation [49], whereas typical WNCS consider the discrete-time controller. We will discuss more details of the analysis and design of WNCS to deal with the network effects in Section VI. 2) Stability: Stability is a base requirement for controller design. We briefly describe two fundamental notions of stability, namely, input-output stability and internal stability [52]. While the input-output stability is the ability of the system to produce a bounded output for any bounded input, the internal stability is the system ability to return to equilibrium after a perturbation. For linear systems, these two notions are closely related, but for nonlinear system they are not the same. Input-output stability concerns the forced response of the system for a bounded input. A system is defined to be Bounded-Input-Bounded-Output (BIBO) stable if every bounded input to the system results in a bounded output. If for any bounded input the output is not bounded the system is said to be unstable. Internal stability is based on the magnitude of the system response in steady state. If the steady-state response is unbounded, the system is said to be unstable. A system is said to be asymptotically stable if its response to any initial conditions decays to zero asymptotically in the steady state. A system is defined to be exponentially stable if the system response in addition decays exponentially towards zero. The faster convergence often means better performance. In fact, many NCS researches analyze exponential stability conditions [53], [54]. Furthermore, if the response due to the initial conditions remains bounded but does not decay to zero, the system is said to be marginally stable. Hence, a system cannot be both asymptotically stable and marginally stable. If a linear system is asymptotically stable, then it is BIBO stable. However, BIBO stability does not generally imply internal stability. Internal stability is stronger in some sense, because BIBO stability can hide unstable internal behaviors, which do not appear in the output. 3) Control Cost: Besides stability guarantees, typically a certain closed-loop control performance is desired. The closedloop performance of a control system can be quantified by the control cost as a function of plant state and control inputs [52]. A general regulation control goal is to keep the state error from the setpoint close to zero, while minimizing the control actions. Hence, the control cost often consists of two terms, namely, the deviations of plant state from their desired setpoint and the magnitude of the control input. A common controller design approach is via a Linear Quadratic control formulation for linear systems and a quadratic cost function [55]. The quadratic control cost is defined as a sum of the quadratic functions of the state deviation and the control effort. In such formulation, the optimal control policy that minimizes the cost function can be explicitly computed from a Riccati equation. 4) Controller Design: The controller should ensure that the closed-loop system has desirable dynamic and steady state response characteristics. For NCS, the network delay and loss may degrade the control performance and even destabilize the system. Some surveys present controller design for NCSs [48], [56]. For a historical review, see the survey [57]. We briefly describe three representative controllers, namely, ProportionalIntegral-Derivative (PID) controller [58], Linear Quadratic Regulator (LQR) control [55], and Model Predictive Control (MPC) [59]. PID control is almost a century old and has remained the most widely used controller in process control until today [58]. One of the main reasons for this controller to be so widely used is that it can be designed without precise knowledge of the plant model. A PID controller calculates an error value as the difference between a desired setpoint and a measured plant state. The control signal is a sum of three terms: the Pterm (which is proportional to the error), the I-term (which is proportional to the integral of the error), and the D-term (which is proportional to the derivative of the error). The controller parameters are proportional gain, integral time, and derivative time. The integral, proportional, and derivative part can be interpreted as control actions based on the past, the present and the future of the plant state. Several parameter tuning methods for PID controllers exist [58], [60]. Historically, PID tuning methods require a trial and error process in order to achieve a desired stability and control performance. The linear quadratic problem is one of the most fundamental optimal control problems where the objective is to minimize a quadratic cost function subject to plant dynamics described by a set of linear differential equations [55]. The quadratic cost is a sum of the plant state cost, final state cost, and control input cost. The optimal controller is a linear feedback controller. The LQR algorithm is basically an automated way to find the state-feedback controller. Furthermore, the LQR is an important subproblem of the general Linear Quadratic Gaussian (LQG) problem. The LQG problem deals with uncertain linear systems disturbed by additive Gaussian noise. While the LQR problem assumes no noise and full state observation, the LQG problem considers input and measurement noise and partial state observation. Finally, MPC solves an optimal linear quadratic control problems over a receding horizon [59]. Hence, the optimization problem is similar to the controller design problem of LQR but solved over a moving horizon in order to handle model uncertainties. In contrast to non-predictive controllers, such as a PID or a LQR controller, which compute the current control action as a function of the current plant state using the information about the plant from the past, predictive controllers compute the control based on the systems predicted future behaviour [61]. MPC tries to optimize the system behaviour in a receding horizon fashion. It takes control 6 commands and sensing measurements to estimate the current : Message generated Sampling Period and future state of plant based on the control system model. The control command is optimized to get the desired plant Plant state based on a quadratic cost. In practice, there are often Time Message delay hard constraints imposed on the state and the control input. PSfrag replacements Compared to the PID and LQR control, the MPC framework Maximum allowable control cost Controller efficiently handles constraints. Moreover, MPC can handle Network constraints Disordered missing measurements or control commands [62], [63], which Message dropout Packet loss Message Arrivals Message delay (ms) can appear in a NCS setting. Packet loss probability 5) Estimator Design: Due to network uncertainties, plant Sampling period (ms) Actuator state estimation is a crucial and significant research field of Fig. 4: Timing diagram for closed-loop control over a wireless NCSs [48], [22]. An estimator is used to predict the plant state network with sampling period, message delay, and message dropouts. by using partially received plant measurements. Moreover, the estimator typically compensates measurement noise, network Energy harvesting techniques, on the other hand, may rely delays, and packet losses. This predicted state is sometimes on natural sources, such as solar, indoor lighting, vibrational, used in the calculation of the control command. Kalman filter thermal [71], inductive and magnetic resonant coupling [72], is one of the most popular approaches to obtain the estimated and radio frequency [73]. Efficient usage of energy harvesting plant states for NCS [64]. Modified Kalman filters are pro- may attain infinite lifetime for the sensor and actuator nodes. posed to deal with different models of the network delay and In most situations, the actuations need to be powered sepaloss [22], [63], [65], [66]. The state estimation problem is often rately because significant amount of energy is required for the formulated by probabilistically modeling the uncertainties oc- actuation commands (e.g., opening a valve). curring between the sensor and the controller [22], [64], [65], [67]. However, a non-probabilistic approach by time-stamping IV. C RITICAL I NTERACTIVE S YSTEM VARIABLES the measurement packets is proposed in [68]. The critical system variables creating interactions between In LQG control, a Kalman filter is used to estimate the WNCS control and communication systems are sampling state from the plant output. The optimal state estimator and period, message delay, and message dropout. Fig. 4 illustrates the optimal state feedback controller are combined for the the timing diagram of the closed-loop control over a wireless LQG problem. The controller is the linear feedback controller of LQR. The optimal LQG estimator and controller network with sampling period, message delay, and message can be designed separately if the communication protocol dropouts. We distinguish messages of the control application supports the acknowledgement of the packet transmission of layer with packets of the communication layer. The control both sensor–controller and controller–actuator channels [22]. system generates messages such as the sensor samples of In sharp contrast, the separation principle between estimator the sensor–controller channel or the control commands of and controller does not hold if the acknowledgement is not the controller–actuator channel. The control system generally supported [69]. Hence, the underlying network operation is determines the sampling period. The communication protocols critical in the design of the overall estimator and the controller. then convert the message to the packet format and transmit the packet to the destination. Since the wireless channel is lossy, the transmitter may have multiple packet retransmissions B. Wireless Networks associated to one message depending on the communication For the vast majority of control applications, most of the protocol. If all the packet transmissions of the message fail traffic over the wireless network consists of real-time sensor due to a bursty channel, then the message is considered to be data from sensor nodes towards one or more controllers. lost. The controller either sits on the backbone or is reachable In Fig. 4, the message delay is the time delay between when via one or more backbone access points. Therefore, data the message was generated by the control system at a sensor or flows between sensor nodes and controllers are not necessarily a controller and when it is received at the destination. Hence, symmetric in WNCS. In particular, asymmetrical link cost the message delay of a successfully received message depends and unidirectional routes are common for the most part of on the number of packet retransmissions. Furthermore, since the sensor traffic. Furthermore, multiple sensors attached to a the routing path or network congestion affects the message single plant may independently transmit their measurements delay, the message arrivals are possibly disordered as shown to the controller [70]. In some other process automation in Fig. 4. environments, multicast may be used to deliver data to multiple The design of the wireless network at multiple protocol nodes that may be functionally similar, such as the delivery layers determines the probability distribution of message delay of alerts to multiple nodes in an automation control room. and message dropout. These variables together with the samWireless sensors and actuators in control environments can pling period influence the stability of the closed-loop NCS be powered by battery, energy scavenging, or power cable. and the energy consumption of the network. Fig. 5 presents Battery storage provides a fixed amount of energy and requires the dependences between the critical system variables. Since replacement once the energy is consumed. Therefore, efficient WNCS design requires an understanding of the interplay usage of energy is vital in achieving high network lifetime. between communication and control, we discuss the effect 7 PSfrag replacements aximum allowable control cost Network constraints Message delay (ms) Packet loss probability Sampling period (ms) Communication System Aspect Control System Aspect Sampling Period Energy Consumption Message Delay Message Dropout Time-Triggered Sensor-Controller Sensor-Controller Event-Triggered Controller-Actuator Controller-Actuator Message Discard Message Loss Packet Delay Packet Loss Transmission Shadow fading Medium access Multipath fading Queueing Doppler shift Interference Fig. 5: Complex interactions between critical system variables. The arrows represent some of the explicit relationships. of these system variables on both control and communication system performance. A. Sampling Period 1) Control System Aspect: Continuous-time signals of the plant need to be sampled before they are transmitted through a wireless network. It is important to note that the choice of the sampling should be related to the desired properties of the closed-loop system such as the response to reference signals, influence of disturbances, network traffic, and computational load [74]. There are two methods to sample continuoustime signals in WNCS: time-triggered and event-triggered sampling [75]. In time-triggered sampling, the next sampling instant occurs after the elapse of a fixed time interval, regardless of the plant state. Periodic sampling is widely used in digital control systems due to the simple analysis and design of such systems. Based on experience and simulations, a common rule for the selection of the sampling period is to make sure ω h be in the range [0.1, 0.6] , where ω is the desired natural frequency of the closed-loop system and h is the sampling period [74]. This implies typically that we are sampling up to 20 samples per period of the dominating mode of the closed-loop system. In a traditional digital control system based on point-topoint wired connections, the smaller the sampling period is chosen, the better the performance is achieved for the control system [76]. However, in wireless networks, the decrease in sampling period increases the network traffic, which in turn increases the message loss probability and message delay. Therefore, the decrease in sampling period eventually degrades the control performance, as illustrated in Fig. 1. Recently, event-based control schemes such event- and self-triggered control systems have been proposed, where sensing and actuating are performed when the system needs attention [75]. Hence, the traffic pattern of event- and selftriggered control systems is asynchronous rather than periodic. In event-triggered control, the execution of control tasks is determined by the occurrence of an event rather than the elapse of a fixed time period as in time-triggered control. Events are triggered only when stability or a pre-specified control performance are about to be lost [77], [78], [79]. Event-triggered control can significantly reduce the traffic load of the network with no or minor control performance degradation since the traffic is generated only if the signal changes by a specified amount [80], [81]. However, since most trigger conditions depend on the instantaneous state, the plant state is required to be monitored [77], [79]. Self-triggered control has been proposed to prevent such monitoring [82]. In self-triggered control, an estimation of the next event time instant is made. The online detection of plant disturbances and corresponding control actions cannot be generated with selftriggered control. A combination of event- and self-triggered control is therefore often desirable [81], [83]. 2) Communication System Aspect: The choice of timetriggered and event-triggered sampling in the control system determines the pattern of message generation in the wireless network. Time-triggered sampling results in regular periodic message generation at predetermined rate. If random medium access mechanism is used, the increase in network load results in worse performance in the other critical interactive system variables, i.e., message delay, message dropout, and energy consumption [84]. The increase in control system performance with higher sampling rates, therefore, does not hold due to these network effects. On the other hand, the predetermined nature of packet transmissions in time-triggered sampling allows explicit scheduling of sensor node transmissions before- 8 hand, reducing the message loss and delay caused by random medium access [85], [86]. A scheduled access mechanism can predetermine the transmission time of all the components such that additional nodes have minimal effect on the transmission of existing nodes [6], [87]. When the transmission of the periodically transmitting nodes are distributed uniformly over time rather than being allocated immediately as they arrive, additional nodes may be allocated without causing any jitter in their periodic allocation. The optimal choice of medium access control mechanism is not trivial for event-triggered control [81], [88]. The overall performance of event-triggered control systems significantly depends on the plant dynamics and the number of control loops. The random access mechanism is a good alternative if a large number of slow dynamical plants share the wireless network. In this case, the scheduled access mechanism may result in significant delay between the triggering of an event and a transmission in its assigned slot due to the large number of control loops. However, most time slots are not utilized since the traffic load is low for slow plants. On the other hand, the scheduled access mechanism performs well when a small number of the fast plants is controlled by the event-triggered control algorithm. Contention-based random access generally degrades the reliability and delay performance for the high traffic load of fast plants. When there are packet losses in the random access scheme, the event-triggered control further increases the traffic load, which may eventually incur stability problems [88]. The possible event-time prediction of self-triggered control alleviates the high network load problem of time-triggered sampling and random message generation nature of eventtriggered sampling by predicting the evolution of the triggering threshold crossings of the plant state [75]. The prediction allows the explicit scheduling of sensor node transmissions, eliminating the high message delays and losses of random medium access. Most existing works of event-triggered and self-triggered control assume that message dropouts and message disorders do not occur. This assumption is not practical when the packets of messages are transmitted through a wireless network. Dealing with message dropouts and message disorders in these control schemes is challenging for both the wireless network and the control system. B. Message Delay 1) Control System Aspect: There are mainly two kinds of message delays of NCSs: sensor–controller delay and controller–actuator delay, as illustrated in Fig. 4. The sensor– controller delay represents the time interval from the instant when the physical plant is sampled to the instant when the controller receives the sampled message; and the controller– actuator delay indicates the time duration from the generation of the control message at the controller until its reception at the actuator. The increase in both delays prevents the timely delivery of the control feedback, which degrades system performance, as exemplified in Fig. 1. In control theory, these delays cause phase shifts that limit the control bandwidth and affect closed-loop stability [74]. Since delays are especially pernicious for closed-loop systems, some forms of modeling and prediction are essential to overcome their effects. Techniques proposed to overcome sensor–controller delays use predictive filters including Kalman filter [74], [89], [64], [65]. In practice, message delay can be estimated from time stamped data if the receiving node is synchronized through the wireless network [15], [16]. The control algorithm compensates the measured or predicted delay unless it is too large [89]. Such compensation is generally impossible for controller–actuator delays. Hence, controller– actuator delays are more critical than the sensor–controller delays [22], [48]. The packet delay variation is another interesting metric since it significantly affects the control performance and causes possible instability even when the mean delay is small. In particular, a heavy tail of the delay distribution significantly degrades the stability of the closed-loop system [90]. The amount of degradation depends on the dynamics of the process and the distribution of the delay variations. One way to eliminate delay variations is to use a buffer, trading delay for its variation. 2) Communication System Aspect: Message delay in a multihop wireless network consists of transmission delay, access delay, and queueing delay at each hop in the path from the source to the destination. Transmission delay is defined as the time required for the transmission of the packet. Transmission delay depends on the amount of data to be transmitted to the destination and the transmission rate, which depends on the transmit power of the node itself and its simultaneously active neighboring nodes. As the transmit power of the node increases, its own transmission rate increases, decreasing its own transmission delay; while causing more interference to simultaneously transmitting nodes, increasing their delay. The optimization of transmission power and rate should take into account this tradeoff [91]. Medium access delay is defined as the time duration required to start the actual transmission of the packet. Access delay depends on the choice of medium access control (MAC) protocol. If contention-based random access mechanism is used, this delay depends on the network load, encoding/decoding mechanism used in the transmitter and receiver, and random access control protocol. As the network load increases, the access delay increases due to the increase in either busy sensed channel or failed transmissions. The receiver decoding capability determines the number of simultaneously active neighboring transmitters. The decoding technique may be based on interference avoidance, in which only one packet can be received at a time [91]; self-interference cancellation, where the node can transmit another packet while receiving [92]; or interference cancellation, where the node may receive multiple packets simultaneously and eliminate interference [93]. Similarly, a transmitter may have the capability to transmit multiple packets simultaneously [94]. The execution of the random access algorithm together with its parameters also affect the message delay. On the other hand, if schedule-based access is used, the access delay in general increases as the network load increases. However, this effect may be minimized by designing 9 efficient scheduling algorithms adopting uniform distribution of transmissions via exploiting the periodic transmission of time-triggered control [6], [87]. Similar to random access, more advanced encoding/decoding capability of the nodes may further decrease this access delay. Moreover, packet losses over the channel may require retransmissions, necessitating the repetition of medium access and transmission delay over time. This further increases message delay, as illustrated in Fig. 4. Queueing delay depends on the message generation rate at the nodes and amount of data they are relaying in the multihop routing path. The message generation and forwarding rate at the nodes should be kept at an acceptable level so as not to allow packet build up at the queue. Moreover, scheduling algorithms should consider the multihop forwarding in order to minimize the end-to-end delay from the source to the destination [66], [86], [95]. The destination may observe disordered messages since the packet associated to the message travels several hops with multiple routing paths or experiences network congestion [15], [96]. C. Message Dropout 1) Control System Aspect: Generally, there are two main reasons for message dropouts, namely, message discard due to the control algorithm and message loss due to the wireless network itself. The logical Zero-Order Hold (ZOH) mechanism is one of the most popular and simplest approaches to discard disordered messages [48], [97], [98]. In this mechanism, the latest message is kept and old messages are discarded based on the time stamp of the messages. However, some alternatives are also proposed to utilize the disordered messages in a filter bank [99], [100]. A message is considered to be lost if all packet transmissions associated to the message have eventually failed. The effect of message dropouts is more critical than message delay since it increases the updating interval with a multiple of the sampling period. There are mainly two types of dropouts: sensor–controller message dropouts and controller–actuator message dropouts. The controller estimates the plant state to compensate possible message dropouts of the sensor–controller channel. Remind that Kalman filtering is one of the most popular approaches to estimate the plant state and works well if there is no significant message loss [22]. Since the control command directly affects the plant, controller–actuator dropouts are more critical than sensor–controller dropouts [101], [102]. Many practical NCSs have several sensor–controller channels whereas the controllers are collocated with the actuators, e.g., heat, ventilation and air-conditioning control systems [103]. NCS literatures often model the message dropout as a stochastic variable based on different assumptions of the maximum consecutive message dropouts. In particular, significant work has been devoted for deriving upper bounds on the updating interval for which stability can be guaranteed [104], [53], [105]. The upper bounds could be used as the update deadline over the network as we will discuss in more detail in Section VI. The bursty message dropout is very critical for control systems since it directly affects the upper bounds on the updating interval. 2) Communication System Aspect: Data packets may be lost during their transmissions, due to the susceptibility of wireless channel to blockage, multipath, doppler shift, and interference [106]. Obstructions between transmitter and receiver, and their variation over time, cause random variations in the received signal, called shadow fading. The probabilistic distribution of the shadow fading depends on the number, size, and material of the obstructions in the environment. Multipath fading, mainly caused by the multipath components of the transmitted signal reflected, diffracted or scattered by surrounding objects, occurs over shorter time periods or distances than shadow fading. The multipath components arriving at the receiver cause constructive and destructive interference, changing rapidly over distance. Doppler shift due to the relative motion between the transmitter and the receiver may cause the signal to decorrelate over time or impose lower bound on the channel error rate. Furthermore, unintentional interference from the simultaneous transmissions of neighboring nodes and intentional interference in the form of cyber-attacks can disturb the successful reception of packets as well. D. Network Energy Consumption A truly wireless solution for WNCS requires removing power cables in addition to the data cables to provide full flexibility of installation and maintenance. Therefore, the nodes need to rely on either battery storage or energy harvesting techniques. Limiting the energy consumption in the wireless network prolongs the lifetime of the nodes. If enough energy scavenging can be extracted from natural sources, inductive or magnetic resonant coupling, or radio frequency, then infinite lifetime may be achieved [71], [73]. Decreasing sampling period, message delay, and message dropout improves the performance of the control system, but at the cost of higher energy consumption in the communication system [107]. The higher the sampling rate, the greater the number of packets to be transmitted over the channel. This increases the energy consumption of the nodes. Moreover, decreasing message delay requires increasing the transmission rate or data encoding/decoding capability at the transceivers. This again comes at the cost of increased energy consumption [108]. Finally, decreasing message dropout requires either increasing transmit power to combat fading and interference, or increasing data encoding/decoding capabilities. This again translates into energy consumption. V. W IRELESS N ETWORK A. Standardization The most frequently adopted communication standards for WNCS are IEEE 802.15.4 and IEEE 802.11 with some enhancements. Particularly, WirelessHART, ISA-100.11a, and IEEE 802.15.4e are all based on IEEE 802.15.4. Furthermore, some recent works of IETF consider Internet Protocol version 6 (IPv6) over low-power and lossy networks such as 6LoWPAN, Routing Protocol for Low-Power and Lossy Networks (RPL), and 6TiSCH, which are all compatible with IEEE 10 Physical Layer Medium Access Control Data Link Layer IEEE 802.15.4 DSSS CSMA/CA, GTS allocation WirelessHART IEEE 802.15.4 PHY IEEE 802.15.4 MAC TDMA, Channel hoping, Channel blacklisting TDMA, Channel hoping, Channel blacklisting Compaction, Fragmentation Management, Resource allocation, Performance monitoring - ISA-100.11a IEEE 802.15.4 PHY IEEE 802.15.4 MAC IEEE 802.15.4e 6LoWPAN RPL IEEE 802.15.4 PHY IEEE 802.15.4 PHY Any TSCH, DSME, LLDN IEEE 802.15.4 MAC Any 6TiSCH IEEE 802.15.4 PHY TSCH IEEE 802.11 IEEE 802.11e DSSS, OFDM DSSS, OFDM DCF, PCF EDCA, HCCA Routing Source routing, Graph routing Source routing, Graph routing Source routing, Distance vector routing - TABLE I: Comparison of wireless standards 802.15.4 [109]. IEEE 802.15.4 is originally developed for lowrate, low-power and low-cost Personal Area Networks (PANs) without any concern on delay and reliability. The standards such as WirelessHART, ISA-100.11a and IEEE 802.15.4e are built on top of the physical layer of IEEE 802.15.4 with additional Time Division Multiple Access (TDMA), frequency hopping and multiple path features to provide delay and reliable packet transmission guarantees while further lowering energy consumption. In this subsection, we first introduce IEEE 802.15.4 and then discuss WirelessHART, ISA-100.11a, IEEE 802.15.4e, and the higher layers of IETF activities such as 6LoWPAN, RPL, and 6TiSCH. On the other hand, although the key intentions of the IEEE 802.11 family of Wireless Local Area Network (WLAN) standards are to provide high throughput and a continuous network connection, several extensions have been proposed to support QoS for wireless industrial communications [110], [111]. In particular, the IEEE 802.11e specification amendment introduces significant enhancements to support the soft real-time applications. In this subsection, we will describe the fundamental operations of basic IEEE 802.11 and IEEE 802.11e. The standards are summarized in Table I. 1) IEEE 802.15.4: IEEE 802.15.4 standard defines the physical and MAC layers of the protocol stack [112]. A PAN consists of a PAN coordinator that is responsible of managing the network and many associated nodes. The standard supports both star topology, in which all the associated nodes directly communicate with the PAN coordinator, and peer-topeer topology, where the nodes can communicate with any neighbouring node while still being managed by the PAN coordinator. The physical layer adopts direct sequence spread spectrum, which is based on spreading the transmitted signal over a large bandwidth to enable greater resistance to interference. A single channel between 868 and 868.6 MHz, 10 channels between 902.0 and 928.0 MHz, and 16 channels between 2.4 and 2.4835 GHz are used. The transmission data rate is 250 kbps in the 2.4 GHz band, 40 kbps in 915 MHz and 20 kbps in 868 MHz band. The standard defines two channel access modalities: the beacon enabled modality, which uses a slotted CSMA/CA and the optional Guaranteed Time Slot (GTS) allocation mechanism, and a simpler unslotted CSMA/CA without beacons. The communication is organized in temporal windows denoted superframes. Fig. 6 shows the superframe structure of the beacon enabled mode. beacon 0 1 2 beacon SO aBaseSlotDuration ×2 3 4 5 6 7 8 9 10 GTS 11 12 13 14 15 GTS GTS Inactive period >= min SO = aBaseSuperframeDuration×2 = aBaseSuperframeDuration ×2BO Fig. 6: Superframe structure of IEEE 802.15.4. In the following, we focus on the beacon enabled modality. The network coordinator periodically sends beacon frames in every beacon interval TBI to identify its PAN and to synchronize nodes that communicate with it. The coordinator and nodes can communicate during the active period, called the superframe duration TSD , and enter the low-power mode during the inactive period. The structure of the superframe is defined by two parameters, the beacon order (BO) and the superframe order (SO), which determine the length of the superframe and its active period, given by TBI = aBaseSuperframeDuration × 2BO , TSD = aBaseSuperframeDuration × 2 SO , (1) (2) respectively, where 0 ≤ SO ≤ BO ≤ 14 and aBaseSuperframeDuration is the number of symbols forming a superframe when SO is equal to 0. In addition, the superframe is divided into 16 equally sized superframe slots of length aBaseSlotDuration. Each active period can be further divided into a Contention Access Period (CAP) and an optional Contention Free Period (CFP), composed of GTSs. A slotted CSMA/CA mechanism is used to access the channel of non time-critical data frames and GTS requests during the CAP. In the CFP, the dedicated bandwidth is used for time-critical data frames. Fig. 7 illustrates the date transfer mechanism of the beacon enabled mode for the CAP and CFP. In the following, we describe the data transmission mechanism for both CAP and CFP. CSMA/CA mechanism of CAP: CSMA/CA is used both during the CAP in beacon enabled mode and all the time in non-beacon enabled mode. In CAP, the nodes access the network by using slotted CSMA/CA as described in Fig. 8. The major difference of CSMA/CA in different channel access modes is that the backoff timer starts at the beginning of the next backoff slot in beacon enabled mode, and immediately in non-beacon enabled mode. Upon the request of the transmission of a packet, the following steps of the CSMA/CA 11 PAN coordinator Device PAN coordinator Device GTS request Beacon (with CAP length) Data NB = 0, CW = 2, BE = macM inBE Acknowledgement CAP CAP Delay for random [0, 2BE − 1] unit backoff periods Beacon (with GTS descriptor) Acknowledgement (optional) Data CFP Acknowledgement (optional) Perform CCA (a) Non time-critical data packet or (b) Time-critical data packet transGTS request transmission. mission. Channel idle ? Fig. 7: Data transfers of beacon enabled mode during the CAP and CFP. Yes CW = CW − 1 No CW = 2, NB = NB + 1 No CW = 0 ? BE = min(BE + 1, macM axBE) algorithms are performed: 1) The channel access variables are initialized. Contention window size, denoted by CW, is initialized to 2 for the slotted CSMA/CA. The backoff exponent, called BE, and number of backoff stages, denoted by NB, are set to 0 and macM inBE, respectively. 2) A backoff time is chosen randomly from [0, 2BE − 1] interval. The node waits for the backoff time in units of backoff period slots. 3) When the backoff timer expires, the clear channel assessment is performed. a) If the channel is free in nonbeacon enabled mode, the packet is transmitted. b) If the channel is free in beacon enabled mode, CW is updated by subtracting 1. If CW = 0, the packet is transmitted. Otherwise, the second channel assessment is performed. c) If the channel is busy, the variables are updated as follows: NB = NB + 1, BE = min(BE+1, macM axBE), CW = 2. The algorithm continues with step 2 if NB < macM axCSM ABackof f s, otherwise the packet is discarded. GTS allocation of CFP: The coordinator is responsible for the GTS allocation and determines the length of the CFP in a superframe. To request the allocation of a new GTS, the node sends the GTS request command to the coordinator. The coordinator confirms its receipt by sending an ACK frame within CAP. Upon receiving a GTS allocation request, the coordinator checks whether there are sufficient resources and, if possible, allocates the requested GTS. We recall that Fig. 7(b) illustrates the GTS allocation mechanism. The CFP length depends on the GTS requests and the current available capacity in the superframe. If there is sufficient bandwidth in the next superframe, the coordinator determines a node list for GTS allocation based on a first-come-first-served policy. Then, the coordinator transmits the beacon including the GTS descriptor to announce the node list of the GTS allocation information. Note that on receipt of the ACK to the GTS request command, the node continues to track beacons and waits for at most aGTSDescPersistenceTime superframes. A node uses the dedicated bandwidth to transmit the packet within the CFP. 2) WirelessHART: WirelessHART was released in September 2007 as the first wireless communication standard for process control applications [96]. The standard adopts the IEEE 802.15.4 physical layer on channels 11–25 at 2.4 GHz. TDMA is used to allow the nodes to put their radio in sleep when they are not scheduled to transmit or receive a packet for better energy efficiency and eliminate collisions for better reliability. The slot size of the TDMA is fixed at 10 ms. Yes Yes N B < macM axCSM ABackof f s Transmission No Failure Fig. 8: Slotted CSMA/CA algorithm of IEEE 802.15.4 beacon enabled mode To increase the robustness to interference in the harsh industrial environments, channel hopping and channel blacklisting mechanisms are incorporated into the direct sequence spread spectrum technique adopted in the IEEE 802.15.4 standard. Frequency hopping spread spectrum is used to alternate the channel of transmission on a packet level, i.e., the channel does not change during the packet transmission. The frequency hopping pattern is not explicitly defined in the standard but needs to be determined by the network manager and distributed to the nodes. Channel blacklisting may also be used to eliminate the channels containing high interference levels. The network manager performs the blacklisting based on the quality of reception at different channels in the network. WirelessHART defines two primary routing approaches for multihop networks: source routing and graph routing. Source routing provides a single route of each flow, while graph routing provides multiple redundant routes [113]. Since the source routing approach only establishes a fixed single path between source and destination, any link or node failure disturbs the end-to-end communication. For this reason, source routing is mostly used for network diagnostics purposes to test the end-to-end connection. Multiple redundant routes in the graph routing provide significant improvement over source routing in terms of the routing reliability. The routing paths are determined by the network manager based on the periodic reports received from the nodes including the historical and instantaneous quality of the wireless links. 3) ISA-100.11a: ISA-100.11a standard was released in September 2009 with many similar features to WirelessHART but providing more flexibility and adaptivity [15]. Similar to WirelessHART, the standard adopts the IEEE 802.15.4 physical layer on channels 11–25 at 2.4 GHz but with the optional additional usage of channel 26. TDMA is again used for better energy consumption and reliability performance but with a configurable slot size on a superframe base. ISA-100.11a adopts channel hopping and blacklisting mech- 12 anism to improve the communication robustness similar to WirelessHART but with more flexibility. The standard adopts three channel hopping mechanisms: slotted hopping, slow hopping, and hybrid hopping. In slotted hopping, the channel is varied in each slot, same as WirelessHART. In slow hopping, the node stays on the same channel for consecutive time slots, a number which is configurable. Slow hopping facilitates the communication of nodes with imprecise synchronization, join process of new nodes, and transmission of event-driven packets. Transmissions in a slow hopping period is performed by using CSMA/CA. This mechanism decreases the delay of event-based packets while increasing energy consumption due to unscheduled transmission and reception times. In hybrid hopping, slotted hopping is combined with slow hopping by accommodating slotted hopping for periodical messages and slow hopping for less predictable new or event-driven messages. There are five predetermined channel hopping patterns in this standard, in contrast to WirelessHART that does not explicitly define hopping patterns. 4) IEEE 802.15.4e: This standard has been released in 2012 with the goal of introducing new access modes to address the delay and reliability constraints of industrial applications [114]. IEEE 802.15.4e defines three major MAC modes, namely, Time Slotted Channel Hopping (TSCH), Deterministic and Synchronous Multichannel Extension (DSME), and Low Latency Deterministic Network (LLDN). Time Slotted Channel Hopping: TSCH is a medium access protocol based on the IEEE 802.15.4 standard for industrial automation and process control [115]. The main idea of TSCH is to combine the benefits of time slotted access with multichannel and channel hopping capabilities. Time slotted access increases the network throughput by scheduling the collision-free links to meet the traffic demands of all nodes. Multichannel allows more nodes to exchange their packets at the same time by using different channel offsets. Since TSCH is based on the scheduling of TDMA slot and FDMA, the delay is deterministically bounded depending on the timefrequency pattern. Furthermore, the packet based frequency hopping is supported to achieve a high robustness against interference and other channel impairments. TSCH also supports various network topologies, including star, tree, and mesh. TSCH mode exhibits many similarities to WirelessHART and ISA-100.11a, including slotted access, multichannel communication, and frequency hopping for mesh networks. In fact, it defines more details of the MAC operation with respect to WirelessHART and ISA-100.11a. In the TSCH mode, nodes synchronize on a periodic slotframe consisting of a number of time slots. Each node obtains synchronization, channel hopping, time slot and slotframe information from Enhanced Beacons (EBs) that are periodically sent by other nodes in order to advertise the network. The slots may be dedicated to one link or shared among links. A dedicated link is defined as the pairwise assignment of a directed communication between nodes in a given time slot on a given channel offset. Hence, a link between communicating nodes can be represented by a pair specifying the time slot in the slotframe and the channel offset used by the nodes in that time slot. However, the TSCH standard does not specify how to derive an appropriate link schedule. Since collisions may occur in shared slots, the exponential backoff algorithm is used to retransmit the packet in the case of a transmission failure to avoid repeated collisions. Differently from the original IEEE 802.15.4 CSMA/CA algorithm, the backoff mechanism is activated only after a collision is experienced rather than waiting for a random backoff time before the transmission. Deterministic and Synchronous Multichannel Extension: DSME is designed to support stringent timeliness and reliability requirements of factory automation, home automation, smart metering, smart buildings and patient monitoring [114]. DSME extends the beacon enabled mode of the IEEE 802.15.4 standard, relying on the superframe structure, consisting of CAPs and CFPs, by increasing the number of GTS time slots and frequency channels used [112]. The channel access of DSME relies on a specific structure called multi-superframe. Each multi-superframe consists of a collection of superframes defined in IEEE 802.15.4. The beacon transmission interval is a multiple number of multi-superframes without inactive period. By adopting a multi-superframe structure, DSME tries to support both periodic and aperiodic (or event-driven) traffic, even in large multihop networks. In a DSME network, some coordinators periodically transmit an EB, used to keep all the nodes synchronized and allow new nodes to join the network. The distributed beacon and GTS scheduling algorithms of DSME allow to quickly react to time-varying traffic and changes in the network topology. Specifically, DSME allows to establish dedicated links between any two nodes of the network for the multihop mesh networks with deterministic delay. DSME is scalable and does not suffer from a single point of failure because beacon scheduling and slot allocation are performed in a distributed manner. This is the major difference with TSCH, which relies on a central entity. Given the large variety of options and features, DSME turns out to be one of the most complex modes of the IEEE 802.15.4e standard. Due to the major complexity issue, DSME still lacks a complete implementation. Moreover, all the current studies on DSME are limited to single-hop or cluster-tree networks, and do not investigate the potentialities of mesh topologies. Low Latency Deterministic Network: LLDN is designed for very low latency applications of the industrial automation where a large number of devices sense and actuate the factory production in a specific location [116]. Differently from TSCH and DSME, LLDN is designed only for star topologies, where a number of nodes need to periodically send data to a central sink using just one channel frequency. Specifically, the design target of LLDN is to support the data transmissions from 20 sensor nodes every 10 ms. Since the former IEEE 802.15.4 standard does not fulfill this constraint, the LLDN mode defines a fine granular deterministic TDMA access. Similarly to IEEE 802.15.4, each LLDN device can obtain the exclusive access for a time slot in the superframe to send data to the PAN coordinator. The number of time slots in a superframe determines how many nodes can access the channel. If many nodes need to send their packets, the PAN coordinator needs to equip with multiple transceivers, so as to allow simultaneous 13 communications on different channels. In LLDN, short MAC frames with just a 1-octet MAC header are used to accelerate frame processing and reduce transmission time. Moreover, a node can omit the address fields in the header, since all packets are destined to the PAN coordinator. Compared with TSCH, LLDN nodes do not need to wait after the beginning of the time slot in order to start transmitting. Moreover, LLDN provides a group ACK feature. Hence, time slots can be much shorter than the one of TSCH, since it is not necessary to accommodate waiting times and ACK frames. 5) 6LoWPAN: 6LoWPAN provides a compaction and fragmentation mechanism to efficiently transport IPv6 packets in IEEE 802.15.4 frames [109]. The IPv6 header is compressed by the removal of the fields that are not needed or always have the same contents, and inferring IPv6 addresses from link layer addresses. Moreover, fragmentation rules are defined so that multiple IEEE 802.15.4 frames can form one IPv6 packet. 6LoWPAN allows low-power devices to communicate by using IP. 6) RPL: RPL is an IPv6 routing protocol for Low-Power and Lossy Networks (LLNs) proposed to meet the delay, reliability and high availability requirements of critical applications in industrial and environmental monitoring [117]. RPL is a distance vector and source routing protocol. It can operate on top of any link layer mechanism including IEEE 802.15.4 PHY and MAC. RPL adopts Destination Oriented Directed Acyclic Graphs (DODAGs), where most popular destination nodes act as the roots of the directed acyclic graphs. Directed acyclic graphs are tree-like structures that allow the nodes to associate with multiple parent nodes. The selection of the stable set of parents for each node is based on the objective function. The objective function determines the translation of routing metrics, such as delay, link quality and connectivity, into ranks, where the rank is defined as an integer, strictly decreasing in the downlink direction from the root. RPL left the routing metric open to the implementation [118]. 7) 6TiSCH: 6TiSCH integrates an Internet-enabled IPv6based upper stack, including 6LoWPAN, RPL and IEEE 802.15.4 TSCH link layer [119]. This integration allows achieving industrial performance in terms of reliability and power consumption while providing an IP-enabled upper stack. 6TiSCH Operation Sublayer (6top) is used to manage TSCH schedule by allocating and deallocating resources within the schedule, monitor performance and collect statistics. 6top uses either centralized or distributed scheduling. In centralized scheduling, an entity in the network collects topology and traffic requirements of the nodes in the network, computes the schedule and then sends the schedule to the nodes in the network. In distributed scheduling, nodes communicate with each other to compute their own schedule based on the local topology information. 6top labels the scheduled cells as either hard or soft depending on their dynamic reallocation capability. A hard cell is scheduled by the centralized entity and can be moved or deleted inside the TSCH schedule only by that entity. 6top maintains statistics about the network performance in the scheduled cells. This information is then used by the centralized scheduling entity to update the schedule as needed. Moreover, this information can be used in the objective function of RPL. On the other hand, a soft cell is typically scheduled by a distributed scheduling entity. If a cell performs significantly worse than other cells scheduled to the same neighbor, it is reallocated, providing an interference avoidance mechanism in the network. The distributed scheduling policy, called on-the-fly scheduling, specifies the structure and interfaces of the scheduling [120]. If the outgoing packet queue of a node fills up, the onthe-fly scheduling negotiates additional time slots with the corresponding neighbors. If the queue is empty, it negotiates the removal of the time slots. 8) IEEE 802.11: The basic 802.11 MAC layer uses the Distributed Coordination Function (DCF) with a simple and flexible exponential backoff based CSMA/CA and optional RTS/CTS for medium sharing [121]. If the medium is sensed idle, the transmitting node transmits its frame. Otherwise, it postpones its transmission until the medium is sensed free for a time interval equal to the sum of an Arbitration InterFrame Spacing (AIFS) and a random backoff interval. DCF experiences a random and unpredictable backoff delay. As a result, the periodic real-time NCS packets may miss their deadlines due to the long backoff delay, particularly under congested network conditions. To enforce a timeliness behavior for WLANs, the original 802.11 MAC defines another coordination function called the Point Coordination Function (PCF). This is available only in infrastructure mode, where nodes are connected to the network through an Access Point (AP). APs send beacon frames at regular intervals. Between these beacon frames, PCF defines two periods: the Contention Free Period (CFP) and the Contention Period (CP). While DCF is used for the CP, in the CFP, the AP sends contention-free-poll packets to give them the right to send a packet. Hence, each node has an opportunity to transmit frames during the CFP. In PCF, data exchange is based on a periodically repeated cycle (e.g., superframe) within which time slots are defined and exclusively assigned to nodes for transmission. PCF does not provide differentiation between traffic types, and thus does not fulfill the deadline requirements for the real-time control systems. Furthermore, this mode is optional and is not widely implemented in WLAN devices. 9) IEEE 802.11e: As an extension of the basic DCF mechanism of 802.11, the 802.11e enhances the DCF and the PCF by using a new coordination function called the Hybrid Coordination Function (HCF) [122]. Similar to those defined in the legacy 802.11 MAC, there are two methods of channel accesses, namely, Enhanced Distributed Channel Access (EDCA) and HCF Controlled Channel Access (HCCA) within the HCF. Both EDCA and HCCA define traffic categories to support various QoS requirements. The IEEE 802.11e EDCA provides differentiated access to individual traffic known as Access Categories (ACs) at the MAC layer. Each node with high priority traffic basically waits a little less before it sends its packet than a node with low priority traffic. This is accomplished through the variation of CSMA/CA using a shorter AIFS and contention window range for higher priority packets. Considering the real-time 14 requirements of NCSs, the periodic NCS traffic should be defined as an AC with a high priority [123] and saturation must be avoided for high priority ACs [124]. HCCA extends PCF by supporting parametric traffic and comes close to actual transmission scheduling. Both PCF and HCCA enable contention-free access to support collisionfree and time-bounded transmissions. In contrast to PCF, the HCCA allows for CFPs being initiated at almost anytime to support QoS differentiation. The coordinator drives the data exchanges at runtime according to specific rules, depending on the QoS of the traffic demands. Although HCCA is quite appealing, like PCF, HCCA is also not widely implemented in network equipment. Hence, some researches adapt the DCF and EDCA mechanisms for practical real-time control applications [125], [126], [127], [128]. B. Wireless Network Parameters To fulfill the control system requirements, the bandwidth of the wireless networks needs to be allocated to high priority data for sensing and actuating with specific deadline requirements. However, existing QoS-enabled wireless standards do not explicitly consider the deadline requirements and thus lead to unpredictable performance of WNCS [129], [125]. The wireless network parameters determine the probability distribution of the critical interactive system variables. Some design parameters of different layers are the transmission power and rate of the nodes, the decoding capability of the receiver at the physical layer, the protocol for channel access and energy saving mechanism at the MAC layer, and the protocol for packet forwarding at the routing layer. 1) Physical Layer: The physical layer parameters that determine the values of the critical interactive system variables are the transmit power and rate of the network nodes. The decoding capability of the receiver depends on the signal-tointerference-plus-noise ratio (SINR) at the receiver and SINR criteria. SINR is obviously the ratio of the signal power to the total power of noise and interference, while SINR criteria is determined by the transmission rate and decoding capability of the receiver. The increase in the transmit power of the transmitter increases SINR at the receiver. However, the increase in the transmit power at the neighboring nodes causes a decrease at the SINR, due to the increase in interference. Optimizing the transmit power of neighboring nodes is, therefore, critical in achieving SINR requirements at the receivers. The transmit rate determines the SINR threshold at the receivers. As the transmit rate increases, the required SINR threshold increases. Moreover, depending on the decoding capability of the receiver, there may be multiple SINR criteria. For instance, in successive interference cancellation, multiple packets can be received simultaneously based on the extraction of multiple signals from the received composite signal, through successive decoding [93], [130]. IEEE 802.15.4 allows the adjustment of both transmit power and rate. However, WirelessHART and ISA-100.11a use fixed power and rate, operating at the suboptimal region. 2) Medium Access Control: MAC protocols fall into one of three categories: contention-based access, schedule-based access, and hybrid access protocols. Contention-based Access Protocol: Contention-based random access protocols used in WNCS mostly adopt the CSMA/CA mechanism of IEEE 802.15.4. The values of the parameters that determine the probability distribution of delay, message loss probability, and energy consumption include the minimum and maximum value of backoff exponent, denoted by macM inBE and macM axBE, respectively, and maximum number of backoff stages, called macM axCSM ABackof f s. Similarly to IEEE 802.15.4, the corresponding parameters for IEEE 802.11 MAC include the IFS time, contention window size, number of tries to sense the clean channel, and retransmission limits due to missing ACKs. The energy consumption of CSMA/CA has been shown to be mostly dominated by the constant listening to the channel [85], [84]. Therefore, various energy conservation mechanisms adopting low duty-cycle operation have later been proposed [131]–[134]. In low duty-cycle operation, the nodes periodically cycle between a sleep and listening state, with the corresponding durations of sleep time and listen time, respectively. Low duty-cycle protocols may be synchronous or asynchronous. In synchronous duty-cycle protocols, the listen and sleep time of neighboring nodes are aligned in time [131], [132]. However, this requires an extra overhead for synchronization and exchange of schedules. In asynchronous duty-cycle protocols, on the other hand, the transmitting node sends a long preamble [133] or multiple short preambles [134] to guarantee the wakeup of the receiver node. The duty-cycle parameters, i.e., sleep time and listen time, significantly affect the delay, message loss probability, and energy consumption of the network. Using a larger sleep time reduces the energy consumption in idle listening at the receiver, while increasing the energy consumption at the transmitter due to the transmission of longer preamble. Moreover, the increase in sleep time significantly degrades the performance of message delay and reliability due to the high contention in the medium with increasing traffic. Schedule-based Access Protocol: Schedule-based protocols are based on assigning time slots, of possibly variable length, and frequency bands to a subset of nodes for concurrent transmission. Since the nodes know when to transmit or receive a packet, they can put their radio in sleep mode when they are not scheduled for any activity. The scheduling algorithms can be classified into two categories: fixed priority scheduling and dynamic priority scheduling [135]. In fixed priority scheduling, each flow is assigned a fixed priority off-line as a function of its periodicity parameters, including sampling period and delay constraint. For instance, in rate monotonic and deadline monotonic scheduling, the flows are assigned priorities as a function of their sampling periods and deadlines, respectively: The shorter the sampling period and deadline, the higher the priority. Fixed priority scheduling algorithms are preferred due to their simplicity and lower scheduling overhead but are typically non-optimal since they do not take the urgency of transmissions into account. On the other hand, in dynamic priority scheduling algorithms, the priority of the flow changes over time depending on the execution of the schedule. For instance, in Earliest Deadline First 15 (EDF) Scheduling, the transmission closest to the deadline will be given highest priority, so, scheduled next; whereas in least laxity first algorithm, the priority is assigned based on the slack time, which is defined as the amount of time left after the transmission if the transmission started now. Although dynamic priority scheduling algorithms have higher scheduling overhead, they perform much better due to the dynamic adjustment of priorities over time. Hybrid Access Protocol: Hybrid protocols aim to combine the advantages of contention-based random access and schedule-based protocols: Random access eliminates the overhead of scheduling and synchronization, whereas scheduled access provides message delay and reliability guarantees by eliminating collisions. IEEE 802.15.4 already provides such a hybrid architecture for flexible usage depending on the application requirements [112]. 3) Network Routing: On the network layer, the routing protocol plays an extremely important role in achieving high reliability and real-time forwarding together with energy efficiency for large scale WNCS, such as large-scale aircraft avionics and industrial automation. Various routing protocols are proposed to achieve energy efficiency for traditional WSN applications [136], [137]. However, to deal with much harsher and noisier environments, the routing protocol must additionally provide reliable real-time transmissions [28]. Multipath routing has been extensively studied in wireless networks for overcoming wireless errors and improving routing reliability [138], [139]. Most of previous works focus on identifying multiple link/node-disjoint paths to guarantee energy efficiency and robustness against node failures [138], [140]. ISA 100.11a and WirelessHART employ a simple and reliable routing mechanism called graph routing to enhance network reliability through multiple routing paths. When using graph routing, the network manager builds multiple graphs of each flow. Each graph includes some device numbers and forwarding list with unique graph identification. Based on these graphs, the manager generates the corresponding subroutes for each node and transmits to every node. Hence, all nodes on the path to the destination are pre-configured with graph information that specifies the neighbors to which the packets may be forwarded. For example, if the link of the sub-routes is broken, then the node forwards the packet to another neighbor of other sub-routes corresponding to the same flow. There has been an increasing interest in developing new approaches for graph routing with different routing costs dependent on reliability, delay, and energy consumption [113], [141], [142]. RPL employs the objective function to specify the selection of the routes in meeting the QoS requirements of the applications. Various routing metrics have been proposed in the objective function to compute the rank value of the nodes in the network. The rank represents the virtual coordinate of the node, i.e., its distance to the DODAG root with respect to a given metric. Some approaches propose the usage of a single metric, including link expected transmission count [143], [144], node remaining energy, link delay [145], MAC based metrics considering packet losses due to contention [146] and queue utilization [147], [148]. [149] proposes two methods, VI. Control System Analysis and Design VI.A. Time-Triggered Sampling Hard Sampling Period Unbounded Consecutive Message Dropout Bounded Consecutive Message Dropout VI.B. Event-Triggered Sampling Event-Triggered Control Self-Triggered Control Soft Sampling Period VI.C. Comparison Between Time- and Event-Triggered Sampling Fig. 9: Subsection structure of Section VI namely, simple combination and lexical combination, for combining two routing metrics among the hop count, expected transmission count, remaining energy, and received signal strength indicator. In simple combination, the rank of the node is determined by using a composition function as the weighted sum of the ranks of two selected metrics. In lexical combination, the node selects the neighbor with the lower value of the first selected metric, and if they are equal in the first metric, the node selects the one with the lower value of the second composition metric. Finally, [150] combines a set of these metrics in order to provide a configurable routing decision depending on the application requirements based on the fuzzy parameters. VI. C ONTROL S YSTEM A NALYSIS AND D ESIGN This section provides a brief overview of the analysis and design of control systems to deal with the non-ideal critical interactive system variables resulting from the wireless network. The presence of an imperfect wireless network degrades the performance of the control loop and can even lead to instability. Therefore, it is important to understand how these interactive system variables influence the closedloop performance in a quantitative manner. Fig. 9 illustrates the section structure and relations. Control system analysis has two main usages here: requirement definition for the network design and the actual control algorithm design. First, since the control cost depends on the network performance such as message loss and delay, the explicit set of requirements for the wireless network design are determined to meet a certain control performance. This allows the optimization of the network design to meet the given constraints imposed by the control system instead of just improving the reliability, delay, or energy efficiency. Second, based on the control system analysis, the controller is designed to guarantee the control performance under imperfect network operation. Despite the interdependence between the three critical interactive variables of sampling period, message delay, and message dropout, as we have discussed in Section IV, much of the available literature on NCS considers only a subset of these variables due to the high complexity of the problem. Since any practical wireless network incurs imperfect network performance, the WNCS designers must carefully consider the performance feasibility and tradeoffs. Previous studies in the 16 literature analyze the stability of control systems by considering either only wireless sensor–controller channel, e.g., [151], [152], [153] or both sensor–controller and controller–actuator, e.g., [104], [53], [154], [155], [156], [157], [158], [159]. Hybrid system and Markov jump linear system have been applied for the modeling and control of NCS under message dropout and message delay. The hybrid or switched system approach refers to continuous-time dynamics with (isolated) discrete switching events [160]. Mathematically, these components are usually described by a collection of indexed differential or difference equations. For NCS, a continuous-time control system can be modelled as the continuous dynamics and network effects such as message dropouts and message delays are modelled as the discrete dynamics [154], [155], [156], [157], [161]. Compared to switched systems, in Markov jump linear system the mode switches are governed by a stochastic process that is statistically independent from the state values [162]. Markov systems may provide less conservative requirements than switched systems. However, the network performance must support the independent transitions between states. In other words, this technique is effective if the network performance is statistically independent or modelled as a simple Markov model. The above theoretical approaches can be used to derive network requirements as a function of the sampling period, message dropout, and message delay. Some network requirements are explicitly related to the message dropout and message delay, such as maximum allowable message dropout probability, number of consecutive message dropouts, and message delay. Furthermore, since various analytical tools only provide sufficient conditions for closed-loop stability, their requirements might be too conservative. In fact, many existing results are shown to be conservative in simulation studies and finding tighter bounds on the network is an area of great interest [53], [152], [54]. To highlight the importance of the sampling mechanism, we classify NCS analysis and design methods into time-triggered sampling and event-triggered sampling. A. Time-Triggered Sampling Time-triggered NCSs can be classified into two categories based on the relationship between sampling period and message delay: hard sampling period and soft sampling period. The message delay of hard sampling period is smaller than the sampling period. The network discards the message if is not successfully transmitted within its sampling period and tries to transmit the latest sampled message for the hard sampling period. On the other hand, the node of the soft sampling period continues to transmit the outdated messages even after its sampling period. The wireless network design must take into account which time-triggered sampling method is implemented. 1) Hard Sampling Period: The message dropouts of NCSs are generally modelled as stochastic variables with and without limited number of consecutive message dropouts. Hence, we classify hard sampling period into unbounded consecutive message dropout and bounded consecutive message dropout. Unbounded Consecutive Message Dropout: When the controller is collocated with the actuators, a Markov jump linear system can be used to analyze the effect of the message dropout [151], [153], [64], [163]. In [151], [153], the message dropout is modelled as a Bernoulli random process with dropout probability p ∈ [0, 1). Under the Bernoulli dropout model, the system model of the augmented state is a special case of a discrete-time Markov jump linear system. The matrix theory is used to show exponential stability of the NCS with dropout probability p. The stability condition interpreted as a linear matrix inequality is a useful tool to design the output feedback controller as well as requirement derivation of the maximum allowable probability of message dropouts for the network design. However, the main results of [151], [153] are hard to apply for wireless network design since they ignore the message delay for a fixed sampling period. Furthermore, the link reliability of wireless networks does not follow a Bernoulli random process since wireless links are highly correlated over time and space in practice [164], [165]. While the sensor–controller communication is considered without any delays in [151], [153], the sensor–controller and controller–actuator channels are modelled as two switches indicating whether the corresponding message is dropped or not in [157]. A discrete-time switched system is used to model the closed-loop NCS with message dropouts when the message delay and sampling period are fixed. By using switched system theory, sufficient conditions for exponential stability are presented in terms of nonlinear matrix inequalities. The proposed methods provide an explicit relation between the message dropout rate and the stability of the NCS. Such a quantitative relation enables the design of a state feedback controller guaranteeing the stability of the closed-loop NCS under a certain message dropout rate. The network may assign a fixed time slot for a single packet associated to the message to guarantee the constant message delay. However, since this does not allow any retransmissions, it will significantly degrade the message dropout rate. Another way to achieve constant message delay may be to buffer the received packet at the sink. However, this will again degrade the control performance with higher average delay. In order to apply the results of [151], [153], [157], the wireless network needs to monitor the message dropout probability and adapt its operation in order to meet the maximum allowable probability of message dropouts. These results can further be used to save network resources while preserving the stability of the NCS by dropping messages at a certain rate. In fact, most NCS research focuses on the stability analysis and design of the control algorithm rather than explicit derivation of network requirements useful for the wireless network design. Since the joint design of controller and wireless networks necessitates the derivation of the required message dropout probability and message delay to achieve the desired control cost, [166] provides the formulation of the control cost function as a function of the sampling period, message dropout probability, and message delay. Most NCS researches use the linear quadratic cost function as the control objective. The model combines the stochastic models of the message dropout [22] and the message delay [100]. Furthermore, the 17 estimator and controller are obtained by extending the results of the optimal stochastic estimator and controller of [22], [100]. Given a control cost, numerical methods are used to derive a set of the network requirements imposed on the sampling period, message dropout, and message delay. One of the major drawbacks is the high computation complexity to quantify the control cost in order to find the feasible region of the network requirements. Bounded Consecutive Message Dropout: Some NCS literatures [155], [161] assume limited number of consecutive message dropouts, such hard requirements are unreasonable for wireless networks where the packet loss probability is greater than zero at any point in time. Hence, some other approaches [15], [167], [168] set stochastic constraints on the maximum allowable number of consecutive message dropouts. Control theory provides deterministic bounds on the maximum allowable number of consecutive message dropouts [155], [161]. In [161], a switched linear system is used to model NCSs with constant message delay and arbitrary but finite message dropout over the sensor–controller channel. The message dropout is said to be arbitrary if the sampling sequence of the successfully applied actuation is an arbitrary variable within the maximum number of consecutive message dropouts. Based on the stability criterion of the switched system, a linear matrix inequality is used to analyze sufficient conditions for stability. Then, the maximum allowable bound of consecutive message dropouts and the feedback controllers are derived via the feasible solution of a linear matrix inequality. A Lyapunov-based characterization of stability is provided and explicit bounds on the Maximum Allowable Transfer Interval (MATI) and the Maximally Allowable Delay (MAD) are derived to guarantee the control stability of NCSs, by considering time-varying sampling period and time-varying message delays, in [155]. If there are message dropouts for the time-triggered sampling, its effect is modelled as a timevarying sampling period from receiver point-of-view. MATI is the upper bound on the transmission interval for which stability can be guaranteed. If the network performance exceeds the given MATI or MAD, then the stability of the overall system could not be guaranteed. The developed results lead to tradeoff curves between MATI and MAD. These tradeoff curves provide effective quantitative information to the network designer when selecting the requirements to guarantee stability and a desirable level of control performance. Many control applications, such as wireless industrial automation [15], air transportation systems [167], and autonomous vehicular systems [168], set a stochastic MATI constraint in the form of keeping the time interval between subsequent state vector reports above the MATI value with a predefined probability to guarantee the stability of control systems. Stochastic MATI constraint is an efficient abstraction of the performance of the control systems since it is directly related to the deadline of the real-time scheduling of the network design [101]. 2) Soft Sampling Period: Sometimes it is reasonable to relax the strict assumption on the message delay being smaller than the sampling period. Some works assume the eventual successful transmission of all messages with various types of deterministic or stochastic message delays [104], [53]. Since the packet retransmission corresponding to the message is allowed beyond its sampling period, one can consider the packet loss as a message delay. While the actuating signal is updated after the message delay of each sampling period if the delay is smaller than its sampling period [104], [54], the delays longer than one sampling period may result in more than one (or none) arriving during a single sampling period. It makes the derivation of recursive formulas of the augmented matrix of closed-loop system harder, compared to the hard sampling period case. To avoid high computation complexity, an alternative approach defines slightly different augmented state to use the stability results of switched systems in [53]. Even though the stability criterion defines the MATI and MAD requirements, there are fundamental limits of this approach to apply for wireless networks. The stability results hold if there is no message dropout for the fixed sampling period and constant message delay, since the augmented matrix consiered is a function of the fixed sampling period with the constant message delay. Hence, the MATI and MAD requirements are only used to set the fixed sampling period and message delay deadline. On the other hand, the NCS of [155] uses the time-varying sampling and varying message delay to take into account the message dropout and stochastic message delay. Hence, the MATI and MAD requirements of [155] are more practical control constraints than the ones of [53] to apply to wireless network design. In [159], a stochastic optimal controller is proposed to compensate long message delays of the sensor–controller channel for fixed sampling period. The stochastic delay is assumed to be bounded with a known probability density function. Hence, the network manager needs to provide the stochastic delay model by analyzing delay measurements. In both [53] and [159], the NCSs assume the eventual successful transmission of all messages. This approach is only reasonable if MATI is large enough compared to the sampling period to guarantee the eventual successful transmission of messages with high probability. However, it is not applicable for fast dynamical system (i.e., small MATI requirement). While [53], [159] do not explicitly consider message dropouts, [152] jointly considers the message dropout and message delay longer than the fixed sampling period over the sensor–controller channel. From the derived stability criteria, the controller is designed and the MAD requirement is determined under a fixed message dropout rate by solving a set of matrix inequalities. Even though the message dropout and message delay are considered, the tradeoff between performance measures is not explicitly derived. However, it is still possible to obtain tradeoff curves by using numerical methods. The network is allowed to transmit the packet associated to the message within the MAD. The network also monitors the message dropout rate. Stability is guaranteed if the message dropout rate is lower than its maximum allowable rate. Furthermore, the network may discard outdated messages to efficiently utilize the network resource as long as the message dropout rate requirement is satisfied. 18 B. Event-Triggered Sampling Event-triggered control is reactive since it generates sensor measurements and control commands when the plant state deviates more than a certain threshold from a desired value. On the other hand, self-triggered control is proactive since it computes the next sampling or actuation instance ahead of current time. Event- and self-triggered control have been demonstrated to significantly reduce the network traffic load [75], [80]. Motivated by those advantages, a systematic design of eventbased implementations of stabilizing feedback control laws was performed in [77]. Event-triggered and self-triggered control systems consist of two elements, namely, a feedback controller that computes the control command, and a triggering mechanism that determines when the control input has to be updated again. The triggering mechanism directly affects the traffic load [80]. There are many proposals for the triggering rule in the event-triggered literature. Suppose that the state x(t) of the physical plant is available. One of the traditional objectives of event-triggered control is to maintain the condition k x(t) − x(tk ) k≤ δ, (3) where tk denotes the time instant when the last control task is executed (the last event time) and δ > 0 is a threshold [79]. The next event time instant is defined as tk+1 = inf {t > tk | k x(t) − x(tk ) k> δ} . (4) The sensor of the event-triggered control loop continuously monitors the current plant state and evaluates the triggering condition. Network traffic is generated if the plant state deviates by the threshold. The network design problem is particularly challenging because the wireless network must support the randomly generated traffic. Furthermore, eventtriggered control does not provide high energy efficiency since the node must continuously activate the sensing part of the hardware platform. Self-triggered control determines its next execution time based on the previously received data and the triggering rule [82]. Self-triggered control is basically an emulation of an event-triggered rule, where one considers the model of the plant and controller to compute the next triggering time. Hence, it is predictive sampling based on the plant models and controller rules. This approach is generally more conservative than the event-triggered approach since it is based on approximate models and predicted events. The explicit allocation of network resources based on these predictions improves the real-time performance and energy efficiency of the wireless network. However, since event- and selftriggered control generate fewer messages, the message loss and message delay might seem to be more critical than for time-triggered control [75]. C. Comparison Between Time- and Event-Triggered Sampling One of the fundamental issues is to compare the performance of time-triggered sampling and event-triggered sampling approaches by using various channel access mechanisms [169], [88], [170]. In fact, many event-based control researches show performance improvement since it often reduces the network utilization [81], [169]. However, recent works of the event-based control using the random access show control performance limitations in the case when there are a large number of control loops [88], [170]. [169] considers a control system where a number of time-triggered or event-triggered control loops are closed over a shared communication network. This research is one of the inspiring works of WNCS codesign problem, where both the control policy and network scheduling policy have been taken into account. The overall target of the framework is to minimize the sum of the stationary state variance of the control loops. A Dirac pulse is applied to achieve the minimum plant state variance as the control law. The sampling can be either time-triggered or event-triggered, depending on the MAC schemes such as the traditional TDMA, FDMA, and CSMA schemes. Intuitively, TDMA is used for the time-triggered sampling, while the event-triggered sampling is applied for CSMA. Based on the previous work [171], the event-triggered approach is also used for FDMA since the event-triggered sampling with a minimum event interval T performs better than the one using the time-triggered sampling with the same time interval T . The authors of [169] assume that once the MAC protocol gains the network resource, the network is busy for specific delay from sensor to actuator, after which the control command is applied to the plant. The simulation results show that eventtriggered control using CSMA gives the best performance. Even though the main tradeoffs and conclusions of the paper are interesting, some assumptions are not realistic. In practice, the Dirac pulse controls are unrealistic due to the capability limit of actuators. For simplicity, the authors assume that the contention resolution time of CSMA is negligible compared to the transmission time. This assumption is not realistic for general wireless channel access schemes such as IEEE 802.15.4 and IEEE 802.11. Furthermore, the total bandwidth resource of FDMA is assumed to scale in proportion to the number of plants, such that the transmission delay from sensor to actuator is inversely proportional to the number of plants. These assumptions are not practical since the frequency spectrum is a limited resource for general wireless networks, thus further studies are needed. While most previous works on event-based control consider a single control loop or small number of control loops, [88] compares time-triggered control and event-based control for a NCS consisting of a large number of plants. The pure ALOHA protocol is used for the event-based control of NCSs. The authors show that packet losses due to collisions drastically reduce the performance of event-based control if packets are transmitted whenever the event-based control generates an event. Remark that the instability of the ALOHA network itself is a well known problem in communications [172]. It turns out that in this setup time-triggered control is superior to event-based control. The same authors also analyze the tradeoff between delay and loss for event-based control with slotted ALOHA [170]. They show that the slotted ALOHA significantly improve the control cost of the state variance respect to the one of the pure ALOHA. However, the timetriggered control still performs better. Therefore, it is hard to generalize the performance comparison between time- 19 triggered sampling and event-triggered sampling approaches since it really depends on the network protocol and topology. VII. W IRELESS N ETWORK D ESIGN T ECHNIQUES C ONTROL S YSTEMS V. Wireless Network VI. Control System Analysis and Design V.A. Standardization VI.A. Time-Triggered Sampling V.B. Wireless Network Parameters VI.B. Event-Triggered Sampling FOR This section presents various design and optimization techniques of wireless networks for WNCS. We distinguish interactive design approach and joint design approach. In the interactive design approach, the wireless network parameters are tuned to satisfy given constraints on the critical interactive system variables, possibly enforced by the required control system performance. In the joint design approach, the wireless network and control system parameters are jointly optimized considering their interaction through the critical system variables. Fig. 10 illustrates the section structure related to previous Sections V and VI. In Table II, we summarize the characteristics of the related works. In the table, we have demonstrated whether indications of requirements and communication and control parameters have been included in the network design or optimization for WNCS. Table III classifies previous design approaches of WNCS based on control and communication aspects. Furthermore, Table IV categorizes previous works based on the wireless standards described in Section V-A. A. Interactive Design Approach In the interactive design approach, wireless network parameters are tuned to satisfy the given requirements of the control system. Most of the interactive design approaches assume time-triggered control systems, in which sensor samples are generated periodically at predetermined rates. They generally assume that the requirements of the control systems are given in the form of upper bounds on the message delay or message dropout with a fixed sampling period. The adoption of wireless communication technologies for supporting control applications heavily depends on the ability to guarantee the bounded service times for messages, at least from a probabilistic point of view. This aspect is particularly important in control systems, where the real-time requirement is considered much more significant than other performance metrics, such as throughput, that are usually important in other application areas. Note that the real-time performance of wireless networks heavily depends on the message delay and message dropout. Hence, we mainly discuss the deadline-constrained MAC protocols of IEEE 802.15.4 and IEEE 802.11. Different analytical techniques can provide the explicit requirements of control systems for wireless networks, as we discussed in Section VI. The focus of previous research is mainly on the design and optimization of MAC, network resource scheduling, and routing layer, with limited efforts additionally considering physical layer parameters. 1) Medium Access Control: Research on real-time 802.15.4 and 802.11 networks can be classified into two groups. The first group of solutions called contention-based access includes adaptive MAC protocols for QoS differentiations. They adapt the parameters of backoff mechanism, retransmissions, and duty-cycling dependent on the constraints. The second group VII.A. Interactive Design Approach Medium Access Control VII.B. Joint Design Approach Time-Triggered Sampling Contention-based Access Contention-based Access Schedule-based Access Schedule-based Access Physical Layer Extension Routing and Traffic Generation Control Network Resource Schedule Scheduling Algorithm Robustness Enhancement Network Routing Event-Triggered Sampling Contention-based Access Self-Triggered and Mixed Approach Disjoint Path Routing Graph Routing Controlled Flooding VII. Wireless Network Design Technique for Control Systems Energy/QoS-aware Routing Fig. 10: Subsection structure of Section VII related to previous Sections V and VI called schedule-based access relies on the contention free scheduling of a single-hop netowrk. Contention-based Access: Contention-based random access protocols for WNCS aim to tune the parameters of the CSMA/CA mechanism of IEEE 802.15.4 and IEEE 802.11, and duty-cycling to improve delay, packet loss probability, and energy consumption performance. The adaptive tuning algorithms are either measurement-based or model-based adaptation. The measurement-based adaptation techniques do not require any network model but rather depend on the local measurements of packet delivery characteristics. Early works of IEEE 802.15.4 propose adaptive algorithms to dynamically change the value of only a single parameter. [212], [213] adaptively determine minimum contention window size, denoted by macM inBE, to decrease the delay and packet loss probability of nodes and increase overall throughput. The references [175], [174] extend these studies to autonomously adjust all the CSMA/CA parameters. The ADAPT protocol [175] adapts the parameter values with the goal of minimizing energy consumption while meeting packet delivery probability based on their local estimates. However, ADAPT tends to oscillate between two or more parameters sets. This results in high energy consumption. [174] solves this oscillation problem by triggering the adaptation mechanism only upon the detection of a change in operating conditions. Furthermore, [214] aims to optimize duty-cycle parameters based on a linear increase/linear decrease of the duty-cycle depending on the comparison of the successfully received packet rate and its target value while minimizing the energy consumption. Model-based parameter optimization mainly use theoretical or experimental-based derivations of the probability distribu- 20 L TABLE II: Comparison of related works. The circle with plus denotes that the paper explicitly considers the indication of the column. The dot denotes that the paper does not include the indication and hence cannot control it, but simulation or experiment results include it. The terms “the”, “sim”, “exp” of evaluation column mean that the proposed solution is evaluated through theoretical analysis, simulation, or realistic experiment, respectively. Requirements [125] [173] [129] [174] [175] [126] [127] [176] [177] [178] [86] [179] [180], [181] [182] [183] [184] [185] [186] [87] [187] [188] [141], [142] [138] [6] [102] [18] [189] [4] [190] [66] [191] [192], [193] [194], [195], [196] [63] [197] [107] [198] [199] [113] [200] [128] [201] [81] [202] [203] [166] [204] [205] [62] [83] [206], [207], [208], [209], [210] [211] Loss L L L Delay L L Sampling Period System Parameters Communication Parameters Control Cost Power Rate Schedule L L L Energy L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L Routing L L L L L L L L L Control Parameters Sampling Control Period Algorithm L L L L L L L Contention L L L L L L L L L L L L L L L L L L L L L L Scenarios Evaluation 1-hop 1-hop 1-hop 1-hop multihop 1-hop 1-hop 1-hop 1-hop 1-hop multihop multihop multihop multihop multihop 1-hop multihop 1-hop 1-hop multihop multihop multihop multihop 1-hop multihop multihop multihop 1-hop 1-hop multihop multihop 1-hop the/sim the/exp the/exp the/sim the/sim the/sim/exp the/sim/exp the sim exp the/sim the/sim the/sim the/sim/exp the/exp the/sim the/exp the/sim/exp the/sim the/sim/exp the/sim the/sim the/sim the/sim the/sim the/exp the/sim/exp the/sim the/sim the/sim the/sim the/sim/exp 1-hop the/sim sim/exp sim the/sim/exp the/sim the/sim/exp sim the/exp sim sim the/exp sim the/sim the/sim the the/sim the/sim the/sim/exp L L L L L L L L L L L L L multihop multihop 1-hop multihop multihop multihop multihop multihop multihop 1-hop 1-hop multihop 1-hop 1-hop 1-hop 1-hop 1-hop L L L L 1-hop the/sim L L L L 1-hop the/sim tion of delay, packet error probability, and energy consumption. A Markov model per node of IEEE 802.15.4 is used [84] to capture the state of each node at each moment in time. These individual Markov chains are then coupled by the memory introduced by fixed duration two slot clear channel assessment. The proposed Markov model is used to derive an analytical formulation of both throughput and energy consumption in such networks. The extension of this work in [107] leads to the derivation of the reliability, delay, and energy consumption as a function of all the CSMA/CA protocol parameters for IEEE 802.15.4. The paper [215] provides analytical models of delay, reliability, and energy consumption as a function of duty-cycle parameters by considering their effects on random backoff of IEEE 802.15.4 before successful transmissions. These models are then used to minimize energy consumption given constraints on delay and reliability. On the other hand, [173] derives experimental based models by using curve fitting techniques and validation through extensive experiments. An adaptive algorithm was also proposed to adjust the coefficients of these models by introducing a learning phase without any explicit information about data traffic, network topology, and 21 TABLE III: Classification of WNCS design techniques Interactive Design Contention-based Access Medium Access Control Schedule-based Access Physical Layer Extension Network Resource Schedule Scheduling Algorithm Robustness Enhancement Disjoint Path Graph Network Routing Controlled Flooding Energy/QoS-aware Traffic Generation Control [212], [213], [175], [174], [214], [129], [84], [107], [215], [173], [125] [126], [127], [176], [177], [178] [6], [87], [183], [219], [220], [221] [86], [198], [179], [180], [182], [187], [181] [199], [184], [185], [186] [138], [140] [141], [142], [113], [200] [188], [222] [18], [128], [197], [201] - Joint Design Approach Time-Triggered Sampling Event-Triggered Sampling [166], [202], [194], [195], [216], [196], [217] [204], [211], [206], [207], [208], [209], [210] [4], [190], [203], [202], [192], [193] [81], [218], [205], [62], [83] - - [191], [66], [189] - [63] [102], [101] - TABLE IV: Classification of WNCS design techniques based on the wireless standards Interactive Design Physical Layer 802.15.4 Contention Hybrid Schedule WirelessHART Routing Contention 802.11 Schedule 802.11 e/g/n [183], [219], [220] [212], [213], [175], [174], [84], [107], [186] [198], [179], [187], [199], [180], [182], [181] [141], [142], [113], [200], [188], [222] [125], [128] [126], [127], [176], [177], [178], [184] [129], [221] MAC parameters. By considering IEEE 802.11, a deadline-constrained MAC protocol with QoS differentiation is presented for soft realtime NCSs [125]. It handles periodic traffic by using two specific mechanisms, namely, a contention-sensitive backoff mechanism and a deadline-sensitive retry limit assignment mechanism. The backoff algorithm offers bounded backoff delays, whereas the deadline-sensitive retry limit assignment mechanism differentiates the retry limits for periodic traffic in terms of their respective deadline requirements. A Markov chain model is established to describe the proposed MAC protocol and evaluate its performance in terms of throughput, delay, and reliability under the critical real-time traffic condition. [129] provides experimental measures and the analysis of 802.11g/e network to better understand the statistical distribution of delay for real-time industrial applications. The statistical distribution of network delay is first evaluated experimentally when the traffic patterns they support resemble the realistic industrial scenarios under the varying background traffic. Then, experimental results have been validated by means of a theoretical analysis for unsaturated traffic condition, which is a quite common condition in well-designed industrial communication systems. The performance evaluation shows that delays are generally bounded if the traffic on the industrial WLAN is light (below 20%). If the traffic grows higher (up to 40%), the QoS mechanism provided by EDCA is used to achieve quasi-predictable behavior and bounded delays for selected high priority messages. Schedule-based Access: The explicit scheduling of transmissions allows to meet the strict delay and reliability constraints of the nodes, by giving priority to the nodes with tighter con- Joint Design Approach Time-Triggered Sampling Event-Triggered Sampling [166] - - [81], [218], [83] [191], [66], [189] - [63] - [195], [196] - [192], [193] - - - straint. To support soft real-time industrial applications, [126] combines a number of various mechanisms of IEEE 802.11 such as transmission and retransmission scheduling, seamless channel redundancy, and basic bandwidth management to improve the deterministic network performance. The proposed protocol relies on centralized transmission scheduling of a coordinator according to the EDF strategy. Furthermore, the coordinator takes care of the number of retransmissions to achieve both delay and reliability over lossy links. In addition to scheduling, the seamless channel redundancy concurrently transmits the copies of each frame on multiple distinct radio channels. This mechanism is appealing for real-time systems since it improves the reliability without affecting timeliness. Moreover, the bandwidth manager reallocates the unused bandwidth of failed data transmission to additional attempts of other data transmissions within their deadlines. [127] presents the design and implementation of a real-time wireless communication protocol called RT-WiFi to support high-speed control systems which typically require 1KHz or higher sampling rate. RT-WiFi is a TDMA data link layer protocol based on IEEE 802.11 physical layer. It provides deterministic timing performance on packet delivery. Since different control applications have different communication requirements on data delivery, RT-WiFi provides a configurable platform to adjust the design tradeoffs including sampling rate, delay variance, and reliability. The middleware proposed in [176] uses a TDMA-based method on top of 802.11 CSMA to assign specific time slots to each real-time node to send its traffic. In [177], a pollingbased scheduling using the EDF policy on top of 802.11 MAC is incorporated with a feedback mechanism to adjust the maximum number of transmission attempts. Moreover, [178] 22 Maximum delay implements a real-time communication architecture based on the 802.11 standard and on the real-time networking framework RTnet [223]. Wireless Ralink RT2500 chipset of RTnet is (a) Robust schedule used to support the strict network scheduling requirements of real-time systems. The performance indicators suchreplacements as packet PSfrag loss ratio and delay are experimentally evaluated by varying protocol parameters for a star topology. Experimental results (b) EDF schedule show that a proper tuning of system parameters can support Fig. 11: Illustrative example of two schedulers robust real-time network performance. 6 Physical Layer Extension: [6], [87] propose a priority Optimal assignment and scheduling algorithm as a function of sampling SSF periods and transmission deadlines to provide maximum level 5 EDF of adaptivity, to accommodate the packet losses of timeLeast Laxity First triggered nodes and the transmissions of event-triggered nodes. 4 The adaptivity metric is illustrated using the following example. Let us assume that the network consists of 4 sensor 3 nodes, denoted by sensor node i for i ∈ [1, 4]. The packet generation period and transmission time of sensor 1 are 1 ms and t1 = 0.15 ms, respectively. The packet generation 2 period of sensor nodes 2, 3 and 4 is 2 ms, whereas packet transmission times are given by t2 = 0.20 ms, t3 = 0.25 1 ms and t4 = 0.30 ms, respectively. Figs. 11(a) and 11(b) PSfrag replacements show a robust schedule where the time slots are uniformly 0 distributed over time and the EDF schedule, respectively. The 0 20 40 60 80 100 Number of nodes schedule given in Fig. 11(a), is more robust to packet losses than the EDF schedule given in Fig. 11(b). Indeed, suppose Fig. 12: Comparison of the maximum delay experienced by eventthat the data packet of sensor 1 in the first 1 ms is not triggered components for SSF, EDF, least laxity first, and optimal scheduling algorithms. successfully transmitted. In Fig. 11(a), the robust schedule includes enough unallocated intervals for the retransmission of sensor 1, whereas the EDF schedule does not. Furthermore, authors present both theoretical analysis and its validation the robust scheduler can accommodate event-triggered traffic through a set of experiments. The experimental analysis shows with smaller delay than the EDF schedule, as shown in Fig. 11. the possibility to select the IEEE 802.11n parameters to ensure To witness, suppose that an additional packet of 0.2 ms the deterministic behavior for the real-time applications. In transmission time is generated by an event-triggered sensor particular, it is shown that a good MIMO configuration of node at the beginning of the scheduling frame. Then the event- the standard enhances the communication reliability while triggered packet transmission can be allocated with a delay sacrificing the network throughput. 2) Network Resource Schedule: Several scheduling algoof 0.60 ms in the robust schedule and 1.15 ms in the EDF rithms are proposed to efficiently assign the time slot and the schedule. This uniform distribution paradigm is quantified as min- channel of the multihop networks in order to meet the strict imizing the maximum total active length of all subframes, delay and reliability requirements. Scheduling Algorithm: Some scheduling algorithms focus where the subframe length is the minimum packet generation period among the components and the total active length of a on meeting a common deadline for all the packets generated subframe is the sum of the transmission time of the compo- within a sampling period [86], [198], [179]. [86] formulates nents allocated to that subframe. The proposed Smallest Period the delay minimization of the packet transmissions from the into the Shortest Subframe First (SSF) algorithm has been sensor nodes to the common access point. The optimization demonstrated to significantly decrease the maximum delay problem has been shown to be NP-hard. The proposed schedulexperienced by the packet of an event-triggered component ing algorithms provide upper bounds on the packet delivery compared to the EDF schedule, as shown in Fig. 12. Moreover, time, by considering many-to-one transmission characteristics. when time diversity, in the form of the retransmission of The formulation and scheduling algorithms, however, do not the lost packets, is included in this framework, the proposed take packet losses into account. [198], [179] introduce novel adaptive framework decreases the average number of missed procedures to provide reliability in case of packet failures. deadlines per unit time, which is defined as the average number [179] proposes an optimal schedule increment strategy based of packets that cannot be successfully transmitted within their on the repetition of the most suitable slot until the comdelay constraint, significantly compared to the EDF schedule. mon deadline. The objective of the optimization problem Since IEEE 802.11n encompasses several enhancements at is to maximize end-to-end reliability while providing endboth PHY and MAC layers of WLAN, [221] analyzes the to-end transmission delay guarantees. The physical network performance indicators such as service time and reliability nodes have been reorganized into logical nodes for improved of IEEE 802.11n for industrial communication systems. The scheduling flexibility. Two scheduling algorithms have been 23 evaluated: dedicated scheduling and shared scheduling. In dedicated scheduling, the packets are only transmitted in the scheduled time slots, whereas in shared scheduling, the packets share scheduled time slots for better reliability. [198] proposes a faster scheduling algorithm for the same problem introduced in [179]. The algorithm is based on gradually increasing a network model from one to multiple transmitted packets as a function of given link qualities to guarantee end-toend reliability. These scheduling algorithms can be combined with multiple path routing algorithms. The authors assume Bernoulli distribution for the arrival success of the packets over each link. Moreover, they do not consider the transmission power, rate and packet length as a variable, assigning exactly one time slot to each transmission. The scheduling algorithms that consider the variation of sampling periods and deadlines of the nodes over the network fall into one of two categories: fixed priority and dynamic priority. The end-to-end delay analysis of periodic real-time flows from sensors to actuators in a WirelessHART network under fixed priority scheduling policy has been performed in [180]. The upper bound on the end-to-end delay of the periodic flows is obtained by mapping their scheduling to real-time multi-processor scheduling and then exploiting the response time analysis of the scheduling. Both the channel contention and transmission conflict delay due to higher priority flows have been considered. Channel contention happens when all channels are assigned to higher priority flows in a transmission slot, whereas transmission conflict occurs when there exists a common node with a transmission of higher priority flow. This study has later been extended for reliable graph routing to handle transmission failures through retransmissions and route diversity in [182]. Similarly, both worst-case and probabilisitic delay bounds have been derived by considering channel contention and transmission conflicts. These analyses consider multihop multichannel networks with fixed time slots without incorporating any transmit power or rate adjustment mechanism. The real-time dynamic priority scheduling of periodic deadline-constrained flows in a WirelessHART network has been shown to be NP-hard in [187]. Upon determining necessary condition for schedulability, an optimal branch-andbound scheduling is proposed, effectively discarding infeasible branches in the search space. Moreover, a faster heuristic conflict-aware least laxity first algorithm is developed by assigning priorities to the nodes based on the criticality of their transmission. The conflict-aware laxity is defined as the laxity after discarding time slots that can be wasted while waiting to avoid transmission conflicts. The lower the conflict-aware laxity, the higher the transmission criticality. The algorithm does not provide any guarantee on the timely packet delivery. [181] provides the end-to-end delay analysis of periodic realtime flows from sensors to actuators under EDF policy. The delay is bounded by considering the channel contention and transmission conflict delays. The EDF has been shown to outperform fixed priority scheduling in terms of real-time performance. Robustness Enhancement: The predetermined nature of schedule-based transmissions allows the incorporation of var- ious retransmission mechanisms in case of packet losses at random time instants. Although explicit scheduling is used to prevent various types of conflict and contention, still transmission failures may occur due to multipath fading and external interference in harsh and unstable environments. Some of the retransmission mechanisms have been introduced at the link layer [183], [219], [220]. Since schedule is known apriori by the nodes in the network, the retransmissions can be minimized by exploiting the determinism in the packet headers to recover the unknown bytes of the header [183]. Moreover, various efficient retransmission procedures can be used to minimize the number of bits in the retransmissions [219], [220]. [219] uses symbol decoding confidence, whereas [220] uses received signal strength variations to determine the parts of the packet received in error, so, should be retransmitted. The retransmission mechanisms at the network layer aim to determine the best timing and quantity of shared and/or separate time slots given the link quality statistics [199], [184], [185], [186]. [184] combines the retransmissions with realtime worst-case scheduling analysis. The number of possible retransmissions of a packet is limited considering the corresponding deadline and already guaranteed delay bounds of other packets. [185] proposes a scheduling algorithm that provides delay guarantees for the periodic real-time flows considering both link bursts and interference. A new metric called maximum burst length is defined as the maximum length of error burst, estimated by using empirical data. The algorithm then provides reliability guarantee by allocating each link one plus its corresponding maximum burst length time slots. A novel least-burst-route algorithm is used in conjunction with this scheduling algorithm to minimize the sum of worst case burst lengths over all links in the route. Similarly, [186] increases the spacing between the actual transmission and the first retransmission for maximum reliability instead of allocating all the time slots in between. [199] improves the retransmission efficiency by using limited number of shared slots efficiently through fast slot competition and segmented slot assignment. Shared resources are allocated for retransmission due to its unpredictability. Fast slot competition is introduced by embedding more than one clear channel assessment at the beginning of the shared slots to reduce the rate of collision. On the other hand, segmented slot assignment provides the retransmission chances for a routing hop before its following hop arrives. 3) Network Routing: There has been increasing interest in developing efficient multipath routing to improve the network reliability and energy efficiency of wireless networks. Previous works of the multipath routings are classified into four categories based on the underlying key ideas of the routing metric and the operation: disjoint path routing, graph routing, controlled flooding, and energy/QoS-aware routing. Disjoint Path Routing: Most of previous works focus on identifying multiple disjoint paths from source to destination to guarantee the routing reliability against node or link failures since multiple paths may fail independently [138], [140]. The disjoint paths have two types: node-disjoint and link-disjoint. While node-disjoint paths do not have any relay node in common, link-disjoint paths do not have any common link but 24 may have common nodes. [138] provides the node-disjoint and braided multipath schemes to provide the resilience against node failures. Ad-hoc On-demand Multipath Distance Vector (AOMDV) is a multipath extension of a well-studied single path routing protocol of Ad-hoc On-demand Distance Vector (AODV) [140]. Graph Routing: Graph routing of ISA 100.11a and WirelessHART leads to significant improvement over a single path in terms of worst-case reliability due to the usage of multiple paths. Since the standards do not explicitly define the mechanism to build these multiple paths, it is possible to use the existing algorithms of the disjoint path. Multiple routing paths from each node to the destination are formed by generating the subgraphs containing all the shortest paths for each source and destination pair [141]. Real-time link quality estimation is integrated into the generation of subgraphs for better reliability in [142]. [113] proposes an algorithm to construct three types of reliable routing graphs, namely, uplink graph, downlink graph, and broadcast graph for different communication purposes. While the uplink graph is a graph that connects all nodes upward to the gateway, the downlink graph of the gateway is a graph to send unicast messages to each node of the network. The broadcast graph connects gateway to all nodes of the network for the transmission of operational control commands. Three algorithms are proposed to build these graphs based on the concepts of (k, m)-reliability where k and m are the minimum required number of incoming and outgoing edges of all nodes excluding the gateway, respectively. The communication schedule is constructed based on the traffic load requirements and the hop sequence of the routing paths. Recently, the graph routing problem has been formulated as an optimization problem where the objective function is to maximize network lifetime, namely, the time interval before the first node exhausts its battery, for a given connectivity graph and battery capacity of nodes [200]. This optimization problem has been shown to be NP-hard. A suboptimal algorithm based on integer programming and a greedy heuristic algorithm have been proposed for the optimization problem. The proposed algorithm shows significant improvement in the network lifetime while guaranteeing the high reliability of graph routing. Controlled Flooding: Previous approaches of disjoint routing and graph routing focus on how to build the routing paths and distribute the traffic load over the network. Some control applications may define more stringent requirements on the routing reliability in the harsher and noisier environments. To address the major reliability issue, a reliable Real-time Flooding-based Routing protocol (REALFLOW) is proposed for industrial applications [188]. REALFLOW controls the flooding mechanism to further improve the multipath diversity while reducing the overhead. Each node transmits the received packet to the corresponding multiple routing paths instead of all feasible outgoing links. Furthermore, it discards the duplicated packets and outdated packets to reduce the overhead. For both uplink and downlink transmissions, the same packets are forwarded according to the related node lists in all relay nodes. Due to redundant paths and flooding mechanism, REALFLOW can be tolerant to network topology changes. Furthermore, since related node lists are distributively generated, the workloads of the gateway are greatly reduced. The flooding schedule is also extended by using the received signal strength in [222]. Energy/QoS-aware Routing: Even though some multipath routings such as disjoint path, graph routing, and controlled flooding lead to significant reliability improvement, they also increase the cost of the energy consumption. Energy/QoSaware routing jointly considers the application requirements and energy consumption of the network [21]. Several energybalanced routing strategies are proposed to maximize the network lifetime while meeting the strict requirements for industrial applications. Breath is proposed to ensure a desired packet delivery and delay probabilities while minimizing the energy consumption of the network [18]. The protocol is based on randomized routing, MAC, and duty-cycling jointly optimized for energy efficiency. The design approach relies on a constrained optimization problem, whereby the objective function is the energy consumption and the constraints are the packet reliability and delay. The optimal working point of the protocol is achieved by a simple algorithm, which adapts to traffic variations and channel conditions with negligible overhead. EARQ is another energy aware routing protocol for reliable and real-time communications for industrial applications [128]. EARQ is a proactive routing protocol, which maintains an ongoing routing table updated through the exchange of beacon messages among neighboring nodes. A beacon message contains expected values such as energy cost, residual energy of a node, reliability and end-to-end message delay. Once a node gets a new path to the destination, it will broadcast a beacon message to its neighbors. When a node wants to send a packet to the destination, next hop selections are based on the estimations of energy consumption, reliability, and deadlines. If the packet chooses a path with low reliability, the source will forward a redundant packet via other paths. [224] proposes the minimum transmission power cooperative routing algorithm, reducing the energy consumption of a single route while guaranteeing certain throughput. However, the algorithm ignores the residual energy and communication load of neighboring nodes, which result in unbalanced energy consumption among nodes. In addition, in [225], a loadbalanced routing algorithm is proposed where each node always chooses the next-hop based on the communication load of neighboring nodes. However, the algorithm has heavy computation complexity and the communication load is high. [197], [201] propose a two-hop information-based routing protocol, aiming at enhancing real-time performance with energy efficiency. The routing decision in [197] is based on the integration of the velocity information of two-hop neighbors with energy balancing mechanism, whereas the routing decision in [201] is based on the number of hops from source to destination and two-hop information of the velocity. B. Joint Design Approach In the joint design approach, the wireless network and control system parameters are jointly optimized considering 25 0.7 18 i J∞ Control cost 14 ag replacements 0.65 r J∞ 0.6 Throughput 12 0.55 10 0.5 8 0.45 6 0.4 Throughput 16 Jreq 4 0.35 L S 2 0.3 0 0.25 0.05 0.1 0.15 0.2 0.25 0.3 Sampling period (s) Fig. 13: Quadratic control cost of control systems and throughput of i r wireless networks over different sampling periods. J∞ and J∞ refer to the control cost bound by using the ideal network and the realistic 802.15.4 network, respectively. the tradeoff between their performances. These parameters include the sampling period for time-triggered control and level crossings for event-triggered control in the control system, and transmission power and rate at the physical layer, the access parameters and algorithm of the MAC protocol, duty-cycle parameters, and routing paths in the communication system. The high complexity of the problem led to different abstractions of control and communication systems, many of which considering only a subset of these parameters. 1) Time-Triggered Sampling: The joint design approaches of the time-triggered control are classified into three categories based on the communication layers: contention-based access, schedule-based access, and routing and traffic generation control. Contention-based Access: The usage of contention-based protocols in the joint optimization of control and communication systems requires modeling the probabilistic distribution of delay and packet loss probability in the wireless network and its effect on the control system [166], [202], [194]. A general framework for the optimization of the sampling period together with link layer parameters has been first proposed in [202]. The objective of the optimization problem is to maximize control system performance given the delay distribution and the packet error probability constraints. The linear quadratic cost function is used as the control performance measure. Simplified models of packet loss and delay are assumed for the contention-based random access mechanism without considering spatial reuse. The solution strategy is based on an iterative numerical method due to the complexity of the control cost used as an objective function of the optimization problem. [194] aims to minimize the mean-square error of the state estimation subject to delay and packet loss probability induced by the contention-based random access. The mean-square error of the estimator is derived as a function of sampling period and delay distribution under the Bernoulli random process of the packet losses. [166] discusses several fundamental tradeoffs of WNCS over IEEE 802.15.4 networks. Fig. 13 shows the quadratic control cost and communication throughput over different i r sampling periods. In the figure, J∞ and J∞ refer to the control cost bound using an ideal network (no packet loss and no delay) and a realistic lossy network of IEEE 802.15.4, respectively. Due to the absence of packet delays and losses, the control performance using an ideal network increases monotonically as the sampling period increases. However, when using a realistic network, a shorter sampling period does not minimize the control cost, because of the higher packet loss probability and delay when the traffic load is i high. In addition, the two curves of the control cost J∞ r and J∞ coincide for longer sampling periods, meaning that when the sampling period is larger, the sampling period is the dominant factor in the control cost compared to the packet loss probability and delay. In Fig. 13, if we consider a desired maximum control cost Jreq greater than the minimum value of the control cost, then we have the feasible range of the sampling periods between S and L. However, the performance of the wireless network is still heavily affected by the operating point of the sampling period. Let us consider two feasible sampling periods S and L. By choosing L, the throughput of the network is stabilized (cf., [172]), the control cost is also stabilized with respect to small perturbations of the network operation. Furthermore, the longer sampling period L leads to lower network energy consumption than the one of the shorter sampling period S. Based on these observations, an adaptation of the WNCS is proposed by considering a constrained optimization problem. The objective is to minimize the total energy consumption of the network subject to a desired control cost. The variables of the problem include both sampling period and MAC parameters of IEEE 802.15.4. The network manager predicts the energy consumption corresponding to each feasible network requirement. The optimal network requirements are obtained to minimize the energy consumption of the network out of the feasible set of network requirements. [195] proposes an interesting approach to the design of WNCS by decomposing the overall concerns into two design spaces. In the control layer, a passive control structure of [216] is used to guarantee the stability of NCSs. The overall NCS performance is then optimized by adjusting the retransmission limits of the IEEE 802.11 standard. At the control layer, the authors leverage their passivity-based architecture to handle the message delay and message loss. The authors consider a passive controller which produces a trajectory of the plant to track and define the control performance as its absolute tracking error. Through extensive simulation results, a convex relationship between the retransmission limit of IEEE 802.11 and the control performance is shown. Based on this observation, a MAC parameter controller is introduced to dynamically adjust the retransmission limit to track the optimal tradeoff between packet losses and delays and thus to optimize the overall control system performance. Simulation results show that the MAC adaptation can converge to a proper retransmission limit which optimizes the performance of the control system. Even though the proposed approach is interesting, the fundamental tradeoff relationships between communication parameters and control performance are not trivial to derive in practice. [196] presents a MPC-based NCS and its implementation 26 over wireless relay networks of IEEE 802.11 and cooperative MAC protocol [217]. The proposed approach deals with the problem from the control perspective. It basically employs a MPC, an actuator state, and an adaptive IEEE 802.11 MAC to reduce unbounded packet delay and improve the tolerance against the packet loss. Furthermore, the cooperative MAC protocol [217] is used to improve the control performance by enabling reliable and timely data transmission under harsh wireless channel conditions. Schedule-based Access: A novel framework for the communication–control joint optimization is proposed encompassing efficient abstraction of control system in the form of stochastic MATI and MAD constraints [4], [190], [87]. We should remember that MATI and MAD are defined as the maximum allowed time interval between subsequent state vector reports and the maximum allowed packet delay for the transmission, respectively, as we have discussed in Section VI. Since such hard real-time guarantees cannot be satisfied by a wireless network with non-zero packet loss probability, stochastic MATI is introduced with the goal of keeping the time interval between subsequent state vector reports above the MATI value with a predefined probability to guarantee the stability of control systems. Further, a novel schedulability constraint in the form of forcing an adaptive upper bound on the sum of the utilization of the nodes, defined as the ratio of their delay to their sampling periods, is included to guarantee the schedulability of transmission under variable transmission rate and sampling period values. The objective of the optimization is to minimize the total energy consumption of the network while guaranteeing MATI and MAD requirements of the control system and maximum transmit power and schedulability constraints of the wireless communication system. The solution for the specific case of M-ary quadrature amplitude modulation and EDF scheduling is based on the reduction of the resulting mixed-integer programming problem into an integer programming problem based on the analysis of the optimality conditions, and relaxation of this reduced problem [4]. The formulation is also extended for any nondecreasing function of the power consumption of the nodes as the objective, any modulation scheme, and any scheduling algorithm in [190], [87]. First, an exact solution method based on the analysis of the optimality conditions and smart enumeration techniques is introduced. Then, two polynomialtime heuristic algorithms adopting intelligent search space reduction and smart searching techniques are proposed. The energy saving has been demonstrated to increase up to 70% for a network containing up to 40 nodes. [203] studies utility maximization problem subject to wireless network capacity and delay requirement of control system. The utility function is defined as the ratio of root-mean-square of the discrete-time system to that of the continuous-time counterpart. This utility function has been demonstrated to be a strictly concave function of the sampling period and inversely proportional to tracking error induced by discretization, based on the assumption that the plants follow the reference trajectories provided by the controllers. The wireless network capacity is derived by adopting slotted time transmission over a conflict graph, where each vertex represents a wireless link and there is an edge between two vertices if their corresponding links interfere with each other. The sampling period is used as the multihop end-to-end delay bound. The solution methodology is based on embedded-loop approach. In the inner loop, a relaxed problem with fixed delay bound, independent of sampling period, is solved via dual decomposition. The outer loop then determines optimal delay bounds based on the sampling period as an output of the inner loop. [191] proposes a mathematical framework for modeling and analyzing multihop NCSs. The authors present the formal syntax and semantics for the dynamics of the composed system, providing an explicit translation of multihop control networks to switched systems. The proposed method jointly considers control system, network topology, routing, resource scheduling, and communication error. The formal models are applied to analyze the robustness of NCSs, where data packet is exchanged through a multihop communication network subject to disruptions. The authors consider two communication models, namely, permanent error model and transient error model, dependent on the length of the communication disruptions. The authors address the robustness of the multihop NCS in the non-deterministic case by worst case analysis of scheduling, routing, and packet losses, and in the stochastic case by the stability analysis of node fault probability and packet loss probability. The joint optimization of the sampling period of sensors, packet forwarding policy and control law for computing actuator command is addressed in [66] for a multihop WirelessHART network. The objective of the optimization problem is to minimize the closed-loop control cost subject to the energy and delay constraints of the nodes. The linear quadratic cost function is used as the control cost similar to the one in [202]. The solution methodology is based on the separation of joint design problem for the fixed sampling rate: transmission scheduling for maximizing the deadlineconstrained reliability subject to a total energy budget and optimal control under packet loss. The optimal solution for transmission scheduling is based on dynamic programming, which allows nodes to find their optimal forwarding policy based on the statistics of their outgoing links in a distributed fashion. The bounds on the continuous-time control loss function are derived for optimal time-varying Kalman filter estimator and static linear feedback control law. The joint optimal solution is then found by a one-dimensional search over the sampling period. Some recent researches of WNCS investigate fault detection and fault tolerant issues [192], [193]. [192] develops a design framework of fault-tolerant NCSs for industrial automation applications. The framework relies on an integrated design and parametrization of the TDMA MAC protocols, the controller, and the fault diagnosis algorithms in a multilayer system. The main objective is to determine the data transmission of wireless networks and reduce the traffic load while meeting the requirements of the control and the fault detection and identification performance. By considering the distributed control groups, the hierarchical WNCS configuration is considered. While the lower layer tightly integrates with sensors, actuators and microprocessors of (local) feedback control loops and its 27 TDMA resource, the higher layer implements a fault-tolerant control in the context of resource management. The TDMA MAC protocol is modeled as a scheduler, whose design and parameterization are achieved with the development of the control and the fault detection and identification algorithms at the different functional layers. In a similar way, [193] investigates the fault estimation problem based on the deterministic model of the TDMA mechanism. The discrete periodic model of control systems is integrated with periodic information scheduling model without packet collisions. By adopting the linearity of state equations, the fault estimator is proposed for the periodic system model with arbitrary sensor inputs. The fault estimation is obtained after solving a deterministic quadratic minimization problem of control systems by means of recursive calculation. However, the scheduler of the wireless network does not consider any realistic message delays and losses. Routing and Traffic Generation Control: In [189], the cross-layer optimized control (CLOC) protocol is proposed for minimizing the worst-case performance loss of multiple control systems. CLOC is designed for a general wireless sensor and actuator network where both sensor–controller and controller–actuator connections are over a multihop mesh network. The design approach relies on a constrained maxmin optimization problem, where the objective is to maximize the minimum resource redundancy of the network and the constraints are the stability of the closed-loop control systems and the schedulability of the communication resources. The stability condition of the control system has been formulated in the form of stochastic MATI constraint [155]. The optimal operation point of the protocol is automatically set in terms of the sampling period, slot scheduling, and routing, and is achieved by solving a linear programming problem, which adapts to system requirements and link conditions. The performance analysis shows that CLOC ensures control stability and fulfills communication constraints while maximizing the worst-case system performance. [63] presents a case study on a wireless process control system that integrates the control design and the wireless routing of the WirelessHART standard. The network supports two routing strategies, namely, single-path source routing and multi-path graph routing. Remind that the graph routing of the WirelessHART standard reduces packet loss through path diversity at the cost of additional overhead and energy consumption. To mitigate the effect of packet loss in the WNCS, the control design integrates an observer based on an extended Kalman filter with a MPC and an actuator buffer of recent control inputs. The experimental results show that sensing and actuation can have different levels of robustness to packet loss under this design approach. Specifically, while the plant state observer is highly effective in mitigating the effects of packet loss from the sensors to the controller, the control performance is more sensitive to packet loss from the controller to the actuators despite the buffered control inputs. Based on this observation, the paper proposes an asymmetric routing configuration for sensing and actuation (source routing for sensing and graph routing for actuation) to improve control performance. [102] addresses the sampling period optimization with the goal of minimizing overall control cost while ensuring end-toend delay constraints for a multihop WirelessHART network. The linear quadratic cost function is used as the control performance measure, which is a function of the sampling period. The optimization problem relies on the multihop problem formulation of the end-to-end delay bound in [180]. Due to the difficulty of the resulting optimization problem, the solution methodologies based on a subgradient method, simulated annealing-based penalty method, greedy heuristic method and approximated convex optimization method are proposed. The tradeoff between execution time and achieved control cost is analyzed for these methods. 2) Event-Triggered Sampling: The communication system design for event-triggered sampling has mostly focused on the MAC layer. In particular, most researches focus on contentionbased random access since it is suitable for these control systems due to the unpredictability of the message generation time. Contention-based Access: The tradeoff between the level threshold crossings in the control system and the packet losses in the communication system have been analyzed in [204], [211], [206], [207], [208], [209], [210]. [204] studies the eventtriggered control under lossy communication. The information is generated and sent at the level crossings of the plant output. The packet losses are assumed to have a Bernoulli distribution independent over each link. The dependence between the stochastic control criterion on the level crossings and the message loss probability is derived for a class of integrator plants. This allows the generation of a design guideline on the assignment of the levels for the optimal usage of communication resources. [211] provides an extension to [204] by considering a multi-dimensional Markov chain model of the attempted and successful transmissions over lossy channel. In particular, a threshold-based event-triggering algorithm is used to transmit the control command from the controller to the actuator. By combining the communication model of the retransmissions with an analytical model of the closed-loop performance, a theoretical framework is proposed to analyze the tradeoff between the communication cost and the control performance and it is used to adapt an event threshold. However, the proposed Markov chain only considers the packet loss as a Bernoulli process and it does not capture the contention between multiple nodes. On the other hand, schedule-based access, in which the nodes are assigned fixed time slots independent of their message generation times, is considered as an alternative to random access for event-triggered control [81]. However, this introduces extra delay between the triggering of an event and a transmission in its assigned slot. [206] analyzes the event-based NCS consisting of multiple linear time-invariant control systems over a multichannel slotted ALOHA protocol. The multichannel slotted ALOHA system is considered as the random access model of the Long Term Evolution [226]. The authors separate the resource allocation problem of the multichannel slotted ALOHA system into two problems, namely, the transmission attempt problem and the channel selection problem. Given a time slot, each 28 control loop decides locally whether to attempt a transmission based on some error thresholds. A local threshold-based algorithm is used to adapt the error thresholds based on the knowledge of the network resource. When the control loop decides to transmit, then it selects one of the available channels in uniform random fashion. Given plant and controller dynamics, [207] proposes control-aware random access policies to address the coupling between control loops over the shared wireless channel. In particular, the authors derive a sufficient mathematical condition for the random access policy of each sensor so that it does not violate the stability criterion of other control loops. The authors only assume the packet loss due to the interference between simultaneous transmissions of the network. They propose a mathematical condition decoupling the control loops. Based on this condition, a control-aware random access policy is proposed by adapting to the physical plant states measured by the sensors online. However, it is still computationally challenging to verify the condition. Some event-triggered sampling appproaches [208], [209], [210] use the CSMA protocol to share the network resource. [208] analyzes the performance of the event-based NCSs with the CSMA protocol to access the shared network. The authors present a Markov model that captures the joint interactions of the event-triggering policy and a contention resolution mechanism of CSMA. The proposed Markov model basically extends Bianchi’s analysis of IEEE 802.11 [227] by decoupling interactions between multiple event-based systems of the network. [209] investigates the event-triggered data scheduling of multiple loop control systems communicating over a shared lossy network. The proposed error-dependent scheduling scheme combines deterministic and probabilistic approaches. This scheduling policy deterministically blocks transmission requests with lower errors not exceeding predefined thresholds. Subsequently, the medium access is granted to the remaining transmission requests in a probabilistic manner. The message error is modeled as a homogeneous Markov chain. The analytical uniform performance bounds for the error variance is derived under the proposed scheduling policy. Numerical results show a performance improvement in terms of error level with respect to the one with periodic and random scheduling policies. [210] proposes a distributed adaptation algorithm for an event-triggered control system, where each system adjusts its communication parameter and control gain to meet the global control cost. Each discrete-time stochastic linear system is coupled by the CSMA model that allows to close only a limited number of feedback loops in every time instant. The backoff intervals of CSMA are assumed to be exponentially distributed with homogeneous backoff exponents. Furthermore, the data packets are discarded after the limited number of retransmission trials. The individual cost function is defined as the linear quadratic cost function. The design objective is to find the optimal control laws and optimal eventtriggering threshold that minimize the control cost. The design problem is formulated as an average cost Markov Decision Process (MDP) problem with unknown global system param- eters that are to be estimated during execution. Techniques from distributed optimization and adaptive MDPs are used to develop distributed self-regulating event-triggers that adapt their request rate to accommodate a global resource constraint. In particular, the dual price mechanism forces each system to adjust their event-triggering thresholds according to the total transmission rate. Self-triggered Control and Mixed Approach: Self-triggered sampling allows to save energy consumption and reduce the contention delay by predicting the level crossings in the future, so, explicitly scheduling the corresponding transmissions [81], [218], [205], [62]. The sensor nodes are set to sleep mode until the predicted level crossing. [218] proposes a new approach to ensure the stability of the controlled processes over a shared IEEE 802.15.4 network by self-triggered control. The selftriggered sampler selects the next sampling time as a function of current and previous measurements, measurement time delay, and estimated disturbance. The superframe duration and transmission scheduling in the contention free period of IEEE 802.15.4 are adapted to minimize the energy consumption while meeting the deadlines. The joint selection of the sampling time of processes, protocol parameters and scheduling allows to address the tradeoff between closed-loop system performance and network energy consumption. However, the drawback of this sampling methodology is the lack of its robustness to uncertainties and disturbances due to the predetermined control and communication models. The explicit scheduling for self-triggered sampling is, therefore, recently extended to include additional time slots in the communication schedule not assigned apriori to any nodes [81]. In the case of the presence of disturbance, these extra slots are used in an event-triggered fashion. The contention-based random access is used in these slots due to the unpredictability of the transmissions. In [205], a joint optimization framework is presented, where the objective is a function of process state, cost of the actuations, and energy consumption to transmit control commands, subject to communication constraints, limited capabilities of the actuators, and control requirements. While the self-triggered control is adopted, with the controller dynamically determining the next task execution time of the actuator, including command broadcasting and changing of action, the sensors are assumed to perform sampling periodically. A simulated annealing based algorithm is used for online optimization, which optimizes the sampling intervals. In addition, the authors propose a mechanism for estimating and predicting the system states, which may not be known exactly due to packet losses and measurement noise. [62] proposes a joint design approach of control and adaptive sampling for multiple control loops. The proposed method computes the optimal control signal to be applied as well as the optimal time to wait before taking the next sample. The basic idea is to combine the concept of the self-triggered sampling with MPC, where the cost function penalizes the plant state and control effort as well as the time interval until the next sample is taken. The latter is considered to generate an adaptive sampling scheme for the overall system such that the sampling time increases as the system state error goes 29 to zero. In the multiple loop case, the authors also present a transmission scheduling algorithm to avoid the conflicts. [83] proposes a mixed self-triggered sampling and eventtriggered sampling scheme to ensure the control stability of NCSs, while improving the energy efficiency of the IEEE 802.15.4 wireless networks. The basic idea of the mixed approach is to combine the self-triggered sampling and the event-triggered sampling schemes. The self-triggered sampling scheme first predicts the next activation time of the eventtriggered sampler when the controller receives the sensing information. The event-triggered sampler then begins to monitor the predefined triggering condition and computes the next sampling instance. Compared to the typical event-triggered sampling, the sensor does not continuously check the eventtriggered condition, since the self-triggered sampling component of the proposed mixed scheme estimates the next sampling a priori. Furthermore, compared with the alone utilization of self-triggered sampling, the conservativeness is reduced, since the event-triggered sampling component extends the sampling interval. By coupling the self-triggered and event-triggered sampling in a unified framework, the proposed scheme extends the inactive period of the wireless network and reduces the conservativeness induced by the selftriggered sampling to guarantee the high energy-efficiency while preserving the desired control performance. VIII. E XPERIMENTAL T ESTBEDS In contrast to previous surveys of WSN testbeds [228], [229], [230], we introduce some of our representative WNCS testbeds. Existing WNCS research often relies on small-scale experiments. However, they usually suffers from limited size, and cannot capture delays and losses of realistic large wireless networks. Several simulation tools [231], [232], [233] are developed to investigate the NCS research. Unfortunately, simulation tools for control systems often lack realistic models of wireless networks that exhibit complex and stochastic behavior in real-world environments. In this section, we describe three WNCS testbeds, namely, cyber-physical simulator and WSN testbed, building automation testbed, and industrial process testbed. Fig. 14: WSN testbed in Bryan Hall and Jolley Hall of Washington University in St. Louis. are then fed again into TOSSIM, which delays or drops the packets and sends the outputs to the actuators. Furthermore, it is also possible to use the experimental wireless traces of a WSN testbed as inputs to the TOSSIM simulator. The Cyber-Physical Laboratory of Washington University in St. Louis has developed an experimental WSN testbed to study and evaluate WSN protocols [237]. The system comprises a network manager on a server and a network protocol stack implementation on TinyOS and TelosB nodes [238]. Each node is equipped with a TI MSP430 microcontroller and a TI CC2420 radio compatible with the IEEE 802.15.4 standard. Fig. 14 shows the deployment of the nodes in the campus building. The testbed consists of 79 nodes placed throughout several office areas. The testbed architecture is hierarchical in nature, consisting of three different levels of deployment: sensor nodes, microservers, and a desktop class host/server machine. At the lowest tier, sensor nodes are placed throughout the physical environment in order to take sensor readings and/or perform actuation. They are connected to microservers at the second tier through a USB infrastructure consisting of USB 2.0 compliant hubs. Messages can be exchanged between sensor nodes and microservers over this interface in both directions. In the testbed, two nodes are connected to each microserver, typically with one microserver per room. The final tier includes a dedicated server that connects to all of the microservers over an Ethernet backbone. The server machine is used to host, among other things, a database containing information about the different sensor nodes and the microservers they are connected to. A. Cyber-Physical Simulator and WSN Testbed Wireless cyber-physical simulator (WCPS) [234] is designed to provide a realistic simulation of WNCS. WCPS employs a federated architecture that integrates Simulink for simulating the physical system dynamics and controllers, and TOSSIM [235] for simulating wireless networks. Simulink is commonly used by control engineers to design and study control systems, while TOSSIM has been widely used in the sensor network community to simulate WSNs based on realistic wireless link models [236]. WCPS provides an opensource middleware to orchestrate simulations in Simulink and in TOSSIM. Following the software architecture in WCPS, the sensor data generated by Simulink is fed into the WSN simulated using TOSSIM. TOSSIM then returns the packet delays and losses according to the behavior of the network, which are then fed to the controller of Simulink. Controller commands B. Building Automation Testbed Heating, Ventilation and Air Conditioning (HVAC) systems guarantee indoor air quality and thermal comfort levels in buildings, at the price of high energy consumption [39]. To reduce the energy required by HVAC systems, researchers have been trying to efficiently use thermal storage capacities of buildings by proposing advanced estimation and control schemes by using wireless sensor nodes. An example HVAC testbed is currently comprised of the second floor of the electrical engineering building of the KTH campus and is depicted in Fig. 15. This floor houses four laboratories, an office room, a lecture hall, one storage room and a boiler room. Each room of the testbed is considered to be a thermal zone and has a set of wireless sensors and actuators that can be individually controlled. The WSN testbed is implemented 30 !% ! *%"+ !' A1 4% *,-./012,,3 &' L1 &% a1 Wireless Actuator &( & Wireless Sensors L2 &7,089/ 2,,3 & & !%%$ !# Lower Tank Pump &$ &# !%"$ &) Tap A2 ! &" !" Upper Tank Vp a2 56* :8; !%'" !$ Fig. 15: HVAC testbed at the second floor of the Q-building at KTH. Each of the five rooms considered contain sensors and actuators used for HVAC control. Additional sensors are located in the corridor and outside of the building. Fig. 17: Coupled tank system setup and its diagram. code is integrated in the application through a MathScript zone. C. Industrial Process Testbed Fig. 16: HVAC system architecture. Users are able to design experiments through a LabVIEW application and remotely connect to the HVAC testbed. Additionally, through a web browser any user can download experimental data from the testbed database. on TinyOS and TelosB nodes [238]. The testbed consists of 12 wireless sensors measuring indoor and outdoor temperature, humidity, CO2 concentrations, light intensity, occupancy levels, and events like door/windows openings/closings in several rooms. Note that the nodes are equipped with on-board humidity, temperature, and light sensors, and external sensors such as CO2 sensors by using an analog-to-digital converter channel on the 16-pin Telosb expansion area. Furthermore, laboratory A225 includes a people counter to measure the occupancy of the laboratory. The collection tree protocol is used to collect the sensor measurements through the multihop networks [239]. The actuators are the flow valve of the heating radiator, the flow valve for the air conditioning system, the air vent for fresh air flow at constant temperature, and the air vent for air exhaust to the corridor. An overview of the testbed architecture is shown in Fig. 16. The HVAC testbed is developed in LabVIEW and is comprised of two separate components; the experimental application and a database/web server system [240]. The database is responsible for logging the data from all HVAC components in real-time. On the other hand, the experimental application is developed by each user and interacts with the data-logging and supervisory control module in the testbed server, which connects to the programmable logic controller. This component allows for real-time sensing, computation, and actuation. Even though the application is developed in LabVIEW, MATLAB The control of liquid levels in tanks and flows between tanks are basic problems in process industry [241]. Liquids need to be processed by chemicals or mixed treatment in tanks, while the levels of the tanks must be controlled and the flows between tanks must be regulated. Fig. 17 depicts the experimental apparatus and a diagram of the physical system used in [81]. The coupled tank system consists of a pump, a water basin and two tanks of uniform cross sections [242]. The system is simple, yet representative testbed of dynamics of water tanks used in practice. The water in the lower tank flows to the water basin. A pump is responsible for pumping water from the basin to the upper tank, which then flows to the lower tank. The holes in each of the tanks have the same diameter. The controller regulates the level of water in the upper or lower tank. The sensing of the water levels is performed by pressure sensors placed under each tank. The process control testbed is built on multiple control systems of Quanser coupled tanks [243] with a wireless network consisting of TelosB nodes. The control loops are regulating two coupled tank processes, where the tanks are collocated with the sensors and actuators and communicate wirelessly with a controller node. A wireless node interfaces the sensors with an analogto-digital converter, in order to sample the sensors for both tanks. The actuation is implemented through the digital-toanalog converter of the wireless actuator node, connected to an amplification circuit that will convert the output voltage of the pump motor. IX. O PEN C HALLENGES AND F UTURE R ESEARCH D IRECTIONS Although a large number of results on WSN and NCSs are reported in the literature, there are still a number of challenging problems to be solved out, some of them are presented as follows. A. Tradeoff of Joint Design The joint design of communication and control layers is essential to guarantee the robustness, fault-tolerance, and resilience of the overall WNCS. Several different approaches of WNCS design are categorized dependent on the degree of the interaction. Increasing the interaction may improve 31 the control performance but at the risk of high complexity of the design problem and thus eventually leading to the fundamental scalability and tractability issues. Hence, it is critical to quantify the benefit of the control performance and cost of the complexity depending on the design approaches. The benefit of the adaptation of the design parameters significantly depends on the dynamics of control systems. Most researches of control and communication focus on the design of the controller or the network protocol with certain optimization problems for the fixed sampling period. Some NCS researches propose possible alternatives to set the sampling periods based on the stability analysis [104], [53], [105]. However, they do not consider the fundamental tradeoff between QoS and sampling period of wireless networks. While the adaptive sampling period might provide control performance improvement, it results in the complex stability problem of the control systems and requires the real-time adaptation of wireless networks. Real-time adaptation of the sampling period might be needed for the fast dynamical system. On the other hand, it may just increase the complexity and implementation overhead for slow control systems. Hence, it is critical to quantify the benefit and cost of the joint design approach for control and communication systems. B. Control System Requirement Various technical approaches such as hybrid system, Markov jump linear system, and time-delay system are used to analyze the stability of NCSs for different network assumptions. The wireless network designers must carefully consider the detailed assumptions of NCS before using their results in wireless network design. Similarly, control system designers need to consider wireless network imperfections encompassing both message dropout and message delay in their framework. While some assumptions of control system design affect the protocol operation, other assumptions may be infeasible to meet for overall network. For instance, the protocol operation should consider the hard/soft sampling period to check whether it is allowed to retransmit the outdated messages over the sampling period. On the other hand, if the NCS design requires a strict bound on the maximum allowable number of consecutive packet losses, this cannot be achieved by the wireless system, in which the packet error probability is non-zero at all times. Numerical methods are mostly used to derive feasible sets of wireless network requirements in terms of message loss probability and delay to achieve a certain control system performance. Even though all these feasible requirements meet the control cost, it may give significantly different network costs such as energy consumption and robustness and thus eventually affect the overall control systems. There are two ways to solve these problems. The first one is to provide efficient tools quantifying feasible sets and corresponding network costs. Previous researches of WNCS still lack of the comparison of different network requirements and their effect on the network design and cost. The second one is to provide efficient abstractions of both control and communication systems enabling the usage of non-numerical methods. For instance, the usage of stochastic MATI and MAD constraints for the control system in [4], [190] enables the generation of efficient solution methodologies for the joint optimization of these systems. C. Communication System Abstraction Efficient abstractions of communication systems need to be included to achieve the benefit of joint design while reducing complexity for WNCS. Both interactive and joint design approaches mostly focus on the usage of constant transmit power and rate at the physical layer to simplify the problem. However, variable transmit power and rate have already been supported by network devices. The integration of the variability of time slots with variable transmit power and rate has been demonstrated to improve the communication energy consumption significantly [6], [87]. This work should be extended to integrate power and rate variability into the WNCS design approaches. Bernouilli distribution has been commonly used as a packet loss model to analyze the control stability for simplicity. However, most wireless links are highly correlated over time and space in practice [164], [165]. The time dependence of packet loss distribution can significantly affect the control system performance due to the effect of consecutive packet losses on the control system performance. The packet loss dependencies should be efficiently integrated into the interactive and joint design approaches. D. Network Lifetime Safety-critical control systems must continuously operate the process without any interruptions such as oil refining, chemicals, power plants, and avionics. The continuous operation requires infrequent maintenance shut-downs such as semiannual or annual since its effects of the downtime losses may range from production inefficiency and equipment destruction to irreparable financial and environmental damages. On the other hand, energy constraints are widely regarded as a fundamental limitation of wireless devices. The limited lifetime due to the battery constraint is particularly challenging for WNCS, because the sensors/actuators are attached to the main physical process or equipment. In fact, the battery replacement may require the maintenance shut-downs since it may be not possible to replace while the control process is operating. Recently, two major technologies of energy harvesting and wireless power transfer have emerged as a promising technology to address lifetime bottlenecks of wireless networks. Some of these solutions are also commercially available and deployed such as ABB WISA [17] based on the wireless power transfer for the industrial automation and EnOcean [244] based on the energy harvesting for the building automation. WNCS using these energy efficient technologies encounters new challenges at all layers of the network design as well as the overall joint design approach. In particular, the joint design approach must balance the control cost and the network lifetime while considering the additional constraint on the arrival of energy harvesting. The timing and amount of energy harvesting may be random for the generation of energy from 32 natural sources such as solar, vibration, or controlled for the RF, inductive and magnetic resonant coupling. E. Ultra-Reliable Ultra-Low Latency Communication Recently, machine-type communication with ultra-reliable and ultra-low latency requirements has attracted much interest in the research community due to many control related applications in industrial automation, autonomous driving, healthcare, and virtual and augmented reality [245], [246], [247]. In particular, the Tactile Internet requires the extremely low latency in combination with high availability, reliability and security of the network to deliver the real-time control and physical sensing information remotely [3]. Diversity techniques, which have been previously proposed to maximize total data rate of the users, are now being adapted to achieve reliability corresponding to packet error probability on the order of 10−9 within latency down to a millisecond or less. The ultra-low latency requirement may prohibit the sole usage of time diversity in the form of automatic-repeat-request (ARQ), where the transmitter resends the packet in the case of packet losses, or hybrid ARQ, where the transmitter sends incremental redundancy rather than the whole packet assuming the processing of all the information available at the receiver. Therefore, [248], [249], [250], [251] have investigated the usage of space diversity in the form of multiple antennas at the transmitter and receiver, and transmission from multiple base stations to the user over one-hop cellular networks. These schemes, however, mostly focus on the reliability of a single user [248], [251], multiple users in a multi-cell interference scenario [249], or multiple users to meet a single deadline for all nodes [250]. [252] extended these works to consider the separate packet generation times and individual packet transmission deadlines of multiple users in the high reliability communication. The previous work on WNCS only investigated the time and path diversity to achieve very high reliability and very low latency communication requirements of corresponding applications, as explained in detailed above. The time diversity mechanisms either adopt efficient retransmission mechanisms to minimize the number of bits in the retransmissions at the link layer or determine the best timing and quantity of time slots given the link quality statistics. On the other hand, path diversity is based on the identification of multiple disjoint paths from source to destination to guarantee the routing reliability against node and link failures. The extension of these techniques to include other diversity mechanisms, such as space and frequency in the context of ultra-reliable ultra low latency communication, requires reformulation of the joint design balancing control cost and network lifetime and addressing new challenges at all layers of the network design. F. Low-Power Wide-Area Networks One of the major issues for large scale Smart Grid [25], Smart Transportation [26], and Industry 4.0 [12] is to allow long-range communications of sensors and actuators using very low-power levels. Recently, several LPWAN protocols such as LoRa [23], NB-IoT [24], Sigfox [253], and LTEM [254] are proposed to provide the low data rate communications of battery operated devices. LTE-M and NB-IoT use a licensed spectrum supported by 3rd Generation Partnership Project standardization. On the other hand, LoRa and Sigfox rely on an unlicensed spectrum. The wireless channel behavior of LPWANs is significantly different from the behavior of the short-range wireless channel commonly used in WNCS standards, such as WirelessHART, Bluetooth, and Z-wave, due to different multi-path fading characteristics and spectrum usage. Thus, the design of the physical and link layers is completely different. Moreover, the protocol design needs to consider the effect of the interoperation of different protocols of LPWANs on the overall message delay. Hence, the control system engineers must validate the feasibility of the traditional assumptions of wireless networks for WNCS based on LPWANs. Furthermore, the network architecture of LPWAN must carefully adapt its operation in order to support the real-time requirements and control message priority of large scale control systems. X. C ONCLUSIONS Wireless networked control systems are the fundamental technology of the safety-critical control systems in many areas, including automotive electronics, avionics, building automation, and industrial automation. This article provided a tutorial and reviewed recent advances of wireless network design and optimization for wireless networked control systems. We discussed the critical interactive variables of communication and control systems, including sampling period, message delay, message dropout, and energy consumption. We then discussed the effect of wireless network parameters at all protocol layers on the probability distribution of these interactive variables. Moreover, we reviewed the analysis and design of control systems that consider the effect of various subsets of interactive variables on the control system performance. By considering the degree of interactions between control and communication systems, we discussed two design approaches: interactive design and joint design. We also describe some practical testbeds of WNCS. Finally, we highlighted major existing research issues and identified possible future research directions in the analysis of the tradeoff between the benefit of the control performance and cost of the complexity in the joint design, efficient abstractions of control and communication systems for their usage in the joint design, inclusion of energy harvesting and diversity techniques in the joint design and extension of the joint design to wide-area wireless networked control systems. R EFERENCES [1] J. Sztipanovits, X. Koutsoukos, G. Karsai, N. Kottenstette, P. Antsaklis, V. Gupta, B. Goodwine, J. Baras, and S. Wang, “Toward a science of cyber-physical system integration,” Proceedings of the IEEE, vol. 100, no. 1, pp. 29–44, 2012. [2] O. Bello and S. Zeadally, “Intelligent device-to-device communication in the internet of things,” IEEE Systems Journal, vol. 10, no. 3, pp. 1172–1182, 2016. [3] G. P. Fettweis, “The tactile internet: Applications and challenges,” IEEE Vehicular Technology Magazine, vol. 9, no. 1, pp. 64–70, 2014. 33 [4] Y. Sadi, S. C. Ergen, and P. Park, “Minimum energy data transmission for wireless networked control systems,” IEEE Transactions on Wireless Communications, vol. 13, no. 4, pp. 2163–2175, 2014. [5] A. W. Al-Dabbagh and T. Chen, “Design considerations for wireless networked control systems,” IEEE Transactions on Industrial Electronics, vol. 63, no. 9, pp. 5547–5557, 2016. [6] Y. Sadi and S. C. Ergen, “Optimal power control, rate adaptation, and scheduling for UWB-based intravehicular wireless sensor networks,” IEEE Transactions on Vehicular Technology, vol. 62, no. 1, pp. 219– 234, 2013. [7] U. Demir and S. C. Ergen, “ARIMA based time variation model for beneath the chassis UWB channel,” EURASIP Journal on Wireless Communications and Networking, 2016, accepted. [8] “Technical characteristics and spectrum requirements of wireless avionics intra-communications systems to support their safe operation,” ITUR, Tech. Rep., 2013, m.2283-0. [9] E. Witrant, P. D. Marco, P. Park, and C. Briat, “Limitations and performances of robust control over WSN: UFAD control in intelligent buildings,” IMA Journal of Mathematical Control and Information, vol. 27, no. 4, pp. 527–543, 2010. [10] A. Willig, “Recent and emerging topics in wireless industrial communication,” IEEE Transactions on Industrial Informatics, vol. 4, no. 2, pp. 102–124, 2008. [11] V. Gungor and G. Hancke, “Industrial wireless sensor networks: Challenges, design principles, and technical approaches,” IEEE Transactions on Industrial Electronics, vol. 56, no. 10, pp. 4258–4265, 2009. [12] H. Kagermann, W. Wahlster, and J. Helbig, “Recommendations for implementing the strategic initiative industrie 4.0,” Forschungsunion acatech, Tech. Rep., 2013. [13] ZigBee Crosses the Chasm: A Market Dynamics Report on IEEE 802.15.4 and ZigBee, On World, 2010, http://onworld.com/zigbee/. [14] Z-Wave Technical Basics, Z-Wave Alliance, http://www.z-wave.com/. [15] ISA-100.11a-2009 Wireless systems for industrial automation: Process control and related applications, ISA, 2009. [16] Wirelesshart overview, HART Communication Foundation, 2014, http://en.hartcomm.org/main article/wirelesshart.html. [17] R. Steigman, and J. Endresen, “Introduction to WISA and WPS, WISA-wireless interface for sensors and actuators and WPS-wireless proximity switches,” White paper, 2004, http://www.eit.uni-kl.de/litz/WISA.pdf. [18] P. Park, C. Fischione, A. Bonivento, K. H. Johansson, and A. Sangiovanni-Vincentelli, “Breath: An adaptive protocol for industrial control applications using wireless sensor networks,” IEEE Transactions on Mobile Computing, vol. 10, no. 6, pp. 821–838, 2011. [19] J.-H. Chang and L. Tassiulas, “Maximum lifetime routing in wireless sensor networks,” IEEE/ACM Transactions on Networking, vol. 12, no. 4, pp. 609–619, 2004. [20] J. Ploennigs, V. Vasyutynskyy, and K. Kabitzsch, “Comparative study of energy-efficient sampling approaches for wireless control networks,” IEEE Transactions on Industrial Informatics, vol. 6, no. 3, pp. 416– 424, 2010. [21] P. Park, “Modeling, analysis, and design of wireless sensor network protocols,” Ph.D. dissertation, KTH Royal Institute of Technology, 2011. [22] L. Schenato, B. Sinopoli, M. Franceschetti, K. Poola, and S. Sastry, “Foundations of control and estimation over lossy networks,” Proceedings of the IEEE, vol. 95, no. 1, pp. 163–187, 2007. [23] “A technical overview of LoRa and LoRaWAN,” LoRa Alliance, Tech. Rep., 2015. [24] “3GPP low power wide area technologies,” GSMA, Tech. Rep., 2016. [25] X. Yu and Y. Xue, “Smart grids: A cyber-physical systems perspective,” Proceedings of the IEEE, vol. 104, no. 5, pp. 1058–1070, 2016. [26] J. Zhang, F. Y. Wang, K. Wang, W. H. Lin, X. Xu, and C. Chen, “Datadriven intelligent transportation systems: A survey,” IEEE Transactions on Intelligent Transportation Systems, vol. 12, no. 4, pp. 1624–1639, 2011. [27] J. Marescaux, J. Leroy, M. Gagner, F. Rubino, D. Mutter, M. Vix, S. E. Butner, and M. K. Smith, “Transatlantic robot-assisted telesurgery,” Nature, vol. 413, no. 6854, pp. 379–380, 2001. [28] A. A. Kumar, K. Ovsthus, and L. M. Kristensen., “An industrial perspective on wireless sensor networks - a survey of requirements, protocols, and challenges,” IEEE Communications Surveys Tutorials, vol. 16, no. 3, pp. 1391–1412, 2014. [29] Q. Wang and J. Jiang, “Comparative examination on architecture and protocol of industrial wireless sensor network standards,” IEEE Communications Surveys Tutorials, vol. 18, no. 3, pp. 2197–2219, 2016. [30] C. Lu, A. Saifullah, B. Li, M. Sha, H. Gonzalez, D. Gunatilaka, C. Wu, L. Nie, and Y. Chen, “Real-time wireless sensor-actuator networks for industrial cyber-physical systems,” Proceedings of the IEEE, vol. 104, no. 5, pp. 1013–1024, 2016. [31] S. Velupillai and L. Guvenc, “Tire pressure monitoring [applications of control],” IEEE Control Systems, vol. 27, pp. 22–25, Dec. 2007. [32] S. C. Ergen, A. Sangiovanni-Vincentelli, X. Sun, R. Tebano, S. Alalusi, G. Audisio, and M. Sabatini, “The tire as an intelligent sensor,” IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, vol. 28, no. 7, pp. 941–955, July 2009. [33] “Pirelli cyber tyre: the intelligent tyre that “speaks” to the car,” Pirelli, Tech. Rep., 2010. [34] Software Considerations in Airborne Systems and Equipment Certification, RTCA, 1992, DO-178B. [35] O. Elgezabal, “Fly-by-wireless (FBWSS): Benefits, risks and technical challenges,” in CANEUS Fly-by-Wireless Workshop, 2010. [36] “Technical characteristics and operational objectives for wireless avionics intra-communications (WAIC),” ITU-R, Tech. Rep., 2010, m.2197. [37] “World radiocommunication conference 2015,” International Telecommunication Union, Tech. Rep., 2015. [38] Invocon, “Enhanced wide-band micro-miniature tri-axial accelerometer unit,” White paper, 2004. [39] A. Aswani, N. Master, J. Taneja, D. Culler, and C. Tomlin, “Reducing transient and steady state electricity consumption in HVAC using learning-based model predictive control,” Proceedings of the IEEE, vol. 100, no. 1, pp. 240–253, 2012. [40] Final electricity consumption by sector, European Environment Agency, 2013, http://www.eea.europa.eu/data-andmaps/indicators/final-electricity-consumption-by-sector/finalelectricity-consumption-by-sector-3. [41] Use of freshwater resources, European Environment Agency, 2009, http://www.eea.europa.eu/data-and-maps/indicators/use-of-freshwaterresources. [42] Smart Energy Homes: A Market Dynamics Report, On World, 2010, http://onworld.com/smartenergyhomes/. [43] J. Chen, X. Cao, P. Cheng, Y. Xiao, and Y. Sun, “Distributed collaborative control for industrial automation with wireless sensor and actuator networks,” IEEE Transactions on Industrial Electronics, vol. 57, no. 12, pp. 4219–4230, 2010. [44] K. Pister, P. Thubert, C. Systems, S. Dwars, and T. Phinney, Industrial Routing Requirements in Low-Power and Lossy Networks, IETF, 2009. [45] J. Blaney, “Wireless proves its value,” Power engineering, 2009. [46] Global Industrial Automation Control Market 2014-2018, TechNavio, 2014, http://www.technavio.com/report/global-industrial-automation-control-market-2014-20 [47] S. Petersen and S. Carlsen, “WirelessHART versus ISA100.11a: The format war hits the factory floor,” IEEE Industrial Electronics Magazine, vol. 5, no. 4, pp. 23–34, 2011. [48] J. P. Hespanha, P. Naghshtabrizi, and Y. Xu, “A survey of recent results in networked control systems,” Proceedings of the IEEE, vol. 95, no. 1, pp. 138–162, 2007. [49] K. J. Åström and B.Wittenmark, Computer-Controlled Systems: Theory and Design. Prentice-Hall, 1997. [50] A. Bemporad, M. Heemels, and M. Johansson, Networked Control Systems. Springer, 2010. [51] T. Chen and B. A. Francis, Optimal Sampled-Data Control Systems. Springer-Verlag London, 1995. [52] R. C. Dorf and R. H. Bishop, Modern Control Systems. Pearson Education, 2008. [53] W. Zhang, M. S. Branicky, and S. M. Phillips, “Stability of networked control systems,” IEEE Control Systems, vol. 21, no. 1, pp. 84–99, 2001. [54] G. Walsh, H. Ye, and L. Bushnell, “Stability analysis of networked control systems,” IEEE Transactions on Control Systems Technology, vol. 10, no. 3, pp. 438–446, 2002. [55] M. Athans, “The role and use of the stochastic linear-quadratic-gaussian problem in control system design,” IEEE Transactions on Automatic Control, vol. 16, no. 6, pp. 529–552, 1971. [56] Y. Tipsuwan and M.-Y. Chow, “Control methodologies in networked control systems,” Control Engineering Practice, vol. 11, no. 10, pp. 1099 – 1111, 2003. [57] K. J. Åström and P. Kumar, “Control,” Automatica, vol. 50, no. 1, pp. 3–43, 2014. [58] K. J. Åström and T. Hägglund, PID Controllers: Theory, Design, and Tuning. ISA, 1995. 34 [59] S. Qin and T. A. Badgwell, “A survey of industrial model predictive control technology,” Control Engineering Practice, vol. 11, no. 7, pp. 733 – 764, 2003. [60] R. S. Barbosa, J. A. T. Machado, and I. M. Ferreira, “Tuning of PID controllers based on bode’s ideal transfer function,” Nonlinear Dynamics, vol. 38, no. 1, pp. 305–321, 2004. [61] C. E. Garcia, D. M. Prett, and M. Morari, “Model predictive control: Theory and practiceła survey,” Automatica, vol. 25, no. 3, pp. 335–348, 1989. [62] E. Henriksson, D. E. Quevedo, E. G. W. Peters, H. Sandberg, and K. H. Johansson, “Multiple-loop self-triggered model predictive control for network scheduling and control,” IEEE Transactions on Control Systems Technology, vol. 23, no. 6, pp. 2167–2181, 2015. [63] B. Li, Y. Ma, T. Westenbroek, C. Wu, H. Gonzalez, and C. Lu, “Wireless routing and control: A cyber-physical case study,” in ACM/IEEE ICCPS, 2016. [64] B. Sinopoli, L. Schenato, M. Franceschetti, K. Poolla, M. I. Jordan, and S. S. Sastry, “Kalman filtering with intermittent observations,” IEEE Transactions on Automatic Control, vol. 49, no. 9, pp. 1453–1464, 2004. [65] M. Sahebsara, T. Chen, and S. L. Shah, “Optimal h2 filtering in networked control systems with multiple packet dropout,” IEEE Transactions on Automatic Control, vol. 52, no. 8, pp. 1508–1513, 2007. [66] B. Demirel, Z. Zou, P. Soldati, and M. Johansson, “Modular design of jointly optimal controllers and forwarding policies for wireless control,” IEEE Transactions on Automatic Control, vol. 59, no. 12, pp. 3252– 3265, 2014. [67] L. Schenato, “Optimal estimation in networked control systems subject to random delay and packet drop,” IEEE Transactions on Automatic Control, vol. 53, no. 5, pp. 1311–1317, 2008. [68] M. Moayedi, Y. K. Foo, and Y. C. Soh, “Filtering for networked control systems with single/multiple measurement packets subject to multiplestep measurement delays and multiple packet dropouts,” International Journal of Systems Science, vol. 42, no. 3, p. 335C348, 2011. [69] M. Rabi, C. Ramesh, and K. H. Johansson, “Separated design of encoder and controller for networked linear quadratic optimal control,” SIAM Journal on Control and Optimization, vol. 54, no. 2, pp. 662– 689, 2016. [70] A. S. Matveev and A. V. Savkin, “The problem of state estimation via asynchronous communication channels with irregular transmission times,” IEEE Transactions on Automatic Control, vol. 48, no. 4, pp. 670–676, 2003. [71] X. Jiang, J. Polastre, and D. Culler, “Perpetual environmentally powered sensor networks,” in ACM/IEEE IPSN, 2005. [72] L. Xie, Y. Shi, Y. T. Hou, and A. Lou, “Wireless power transfer and applications to sensor networks,” IEEE Wireless Communications, no. 4, pp. 140–145, 2013. [73] X. Lou, P. Wang, D. Niyato, D. I. Kim, and Z. Han, “Wireless power transfer and applications to sensor networks,” IEEE Communications Surveys and Tutorials, vol. 17, no. 2, pp. 757–789, 2015. [74] B. Wittenmark, K. J. Aström, and K.-E. Arzen, “Computer control: An overview,” IFAC Professional Brief, Tech. Rep., 2002. [75] W. P. M. H. Heemels, K. H. Johansson, and P. Tabuada, “An introduction to event-triggered and self-triggered control,” in IEEE CDC, 2012. [76] G. Franklin, J. Powell, and M.Workman, Digital Control of Dynamic Systems. Addison Wesley Longman, 1997. [77] P. Tabuada, “Event-triggered real-time scheduling of stabilizing control tasks,” IEEE Transactions on Automatic Control, vol. 52, no. 9, pp. 1680–1685, 2007. [78] X. Wang and M. D. Lemmon, “Self-triggered feedback control systems with finite-gain L2 stability,” IEEE Transactions on Automatic Control, vol. 54, no. 3, pp. 452–467, 2009. [79] J. Lunze and D. Lehmann, “A state-feedback approach to event-based control,” Automatica, vol. 46, no. 1, pp. 211–215, 2010. [80] K. Arzen, “A simple event-based pid controller,” in IFAC World Congress, 1999. [81] J. Araujo, M. Mazo, A. Anta, P. Tabuada, and K. H. Johansson, “System architectures, protocols and algorithms for aperiodic wireless control systems,” IEEE Transactions of Industrial Informatics, vol. 10, no. 1, pp. 175–184, 2014. [82] X. Wang and M. D. Lemmon, “Self-triggered feedback control systems with finite-gain l2 stability,” IEEE Transactions on Automatic Control, vol. 54, no. 3, pp. 452–467, 2009. [83] C. Peng, D. Yue, and M. R. Fei, “A higher energy-efficient sampling scheme for networked control systems over IEEE 802.15.4 wireless [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] networks,” IEEE Transactions on Industrial Informatics, vol. 12, no. 5, pp. 1766–1774, 2016. S. Pollin, M. Ergen, S. C. Ergen, B. Bougard, L. Perre, I. Moerman, A. Bahai, P. Varaiya, and F. Catthoor, “Performance analysis of slotted carrier sense IEEE 802.15.4 medium access layer,” IEEE Transactions on Wireless Communications, vol. 7, no. 9, pp. 3359 – 3371, 2008. S. Ergen and P. Varaiya, “PEDAMACS: power efficient and delay aware medium access protocol for sensor networks,” IEEE Transactions on Mobile Computing, vol. 5, no. 7, pp. 920–930, 2006. S. C. Ergen and P. Varaiya, “TDMA scheduling algorithms for wireless sensor networks,” Wireless Networks, vol. 16, no. 4, pp. 985 – 997, 2010. Y. Sadi and S. C. Ergen, “Energy and delay constrained maximum adaptive schedule for wireless networked control systems,” IEEE Transactions on Wireless Communications, vol. 14, no. 7, pp. 3738– 3751, 2015. R. Blind and F. Allgöwer, “Analysis of networked event-based control with a shared communication medium: Part I - pure ALOHA,” in IFAC World Congress, 2011. O. Smith, “Closed control of loops with dead time,” Chemical Engineering Progress, vol. 53, pp. 217–219, 1957. A. Seuret, “A novel stability analysis of linear system under asynchronous samplings,” Automatica, vol. 48, no. 1, pp. 177–182, 2012. Y. Sadi and S. C. Ergen, “Minimum length scheduling with packet traffic demands in wireless networks,” IEEE Transactions on Wireless Communications, vol. 13, no. 7, pp. 3738–3751, 2014. D. Kim, H. Lee, and D. Hong, “A survey of in-band full-duplex transmission: From the perspective of PHY and MAC layers,” IEEE Communication Surveys and Tutorials, vol. 17, no. 4, pp. 2017–2046, 2015. M. Kontik and S. C. Ergen, “Scheduling in successive interference cancellation based wireless multi-hop networks,” IEEE Communications Letters, vol. 19, no. 9, pp. 1524–1527, 2015. A. Sridharan, C. E. Koksal, and E. Uysal-Biyikoglu, “A greedy link scheduler for wireless networks with gaussian multiple-access and broadcast channels,” IEEE/ACM Transactions on Networking, vol. 20, no. 1, pp. 100–113, 2012. M. Baldi, R. Giacomelli, and G. Marchetto, “Time-driven access and forwarding for industrial wireless multihop networks,” IEEE Transactions on Industrial Informatics, vol. 5, no. 2, pp. 99–112, 2009. HART Field Communication Protocol Specification, Revision 7.0, HART Communication Foundation, 2007. J. Xiong and J. Lam, “Stabilization of networked control systems with a logic zoh,” IEEE Transactions on Automatic Control, vol. 54, no. 2, pp. 358–363, 2009. M. Cloosterman, L. Hetel, N. van de Wouw, W. Heemels, J. Daafouz, and H. Nijmeijer, “Controller synthesis for networked control systems,” Automatica, vol. 46, no. 10, pp. 1584 – 1594, 2010. J. R. Moyne and D. M. Tilbury, “The emergence of industrial control networks for manufacturing control, diagnostics, and safety data,” Proceedings of the IEEE, vol. 95, no. 1, pp. 29–47, 2007. J. Nilsson, “Real-time control systems with delays,” Ph.D. dissertation, Lund Institute of Technology, 1998. P. Park, “Traffic generation rate control of wireless sensor and actuator networks,” IEEE Communications Letters, vol. 19, no. 5, pp. 827–830, 2015. A. Saifullah, C. Wu, P. B. Tiwari, Y. Xu, Y. Fu, C. Lu, and Y. Chen, “Near optimal rate selection for wireless control systems,” ACM Transactions on Embedded Computing Systems, vol. 13, no. 4, pp. 1–25, 2014. T. Arampatzis, J. Lygeros, and S. Manesis, “A survey of applications of wireless sensors and wireless sensor networks,” in IEEE MCCA, 2005. M. S. Branicky, S. M. Phillips, and W. Zhang, “Stability of networked control systems: explicit analysis of delay,” in ACC, 2000. W.-A. Zhang and L. Yu, “A robust control approach to stabilization of networked control systems with time-varying delays,” Automatica, vol. 45, no. 10, pp. 2440 – 2445, 2009. A. Goldsmith, Wireless Communications. Cambridge University Press, 2005. P. Park, P. D. Marco, C. Fischione, and K. H. Johansson, “Modeling and optimization of the ieee 802.15.4 protocol for reliable and timely communications,” IEEE Transactions on Parallel and Distributed Systems, vol. 24, no. 3, pp. 550–564, 2013. E. Uysal-Biyikoglu, B. Prabhakar, and A. E. Gamal, “Energy-efficient packet transmission over a wireless link,” IEEE/ACM Transactions on Networking, vol. 10, no. 4, pp. 487–499, 2002. 35 [109] M. R. Palattella, N. Accettura, X. Vilajosana, T. Watteyne, L. A. Grieco, G. Boggia, and M. Dohler, “Standardized protocol stack for the internet of (important) things,” IEEE Communications Surveys Tutorials, vol. 15, no. 3, pp. 1389–1406, 2013. [110] A. Willig, M. Kubisch, C. Hoene, and A. Wolisz, “Measurements of a wireless link in an industrial environment using an IEEE 802.11compliant physical layer,” IEEE Transactions on Industrial Electronics, vol. 49, no. 6, pp. 1265–1282, 2002. [111] G. Tian and Y.-C. Tian, “Modelling and performance evaluation of the IEEE 802.11 DCF for real-time control,” Computer Networks, vol. 56, no. 1, pp. 435 – 447, 2012. [112] IEEE 802.15.4 standard: Wireless Medium Access Control and Physical Layer Specifications for Low-Rate Wireless Personal Area Networks, IEEE, 2006, http://www.ieee802.org/15/pub/TG4.html. [113] S. Han, X. Zhu, A. Mok, D. Chen, and M. Nixon, “Reliable and realtime communication in industrial wireless mesh networks,” in IEEE RTAS, 2011. [114] “IEEE Standard for Local and metropolitan area networks–Part 15.4: Low-Rate Wireless Personal Area Networks (LR-WPANs) Amendment 1: MAC sublayer,” IEEE Std 802.15.4e-2012 (Amendment to IEEE Std 802.15.4-2011), pp. 1–225, 2012. [115] N. Accettura, E. Vogli, M. R. Palattella, L. A. Grieco, G. Boggia, and M. Dohler, “Decentralized traffic aware scheduling in 6TiSCH networks: Design and experimental evaluation,” IEEE Internet of Things Journal, vol. 2, no. 6, pp. 455–470, 2015. [116] C. Ouanteur, D. Aı̈ssani, L. Bouallouche-Medjkoune, M. Yazid, and H. Castel-Taleb, “Modeling and performance evaluation of the IEEE 802.15.4e LLDN mechanism designed for industrial applications in WSNs,” Wireless Networks, vol. 23, no. 5, pp. 1343–1358, 2017. [117] T. Winter, P. Thubert, A. Brandt, J. Hui, and R. Kelsey, RPL: IPv6 Routing Protocol for Low Power and Lossy Networks, IETF, 2012. [118] P. Thubert, Objective Function Zero, IETF, 2012. [119] ——, “An architecture for IPv6 over the TSCH mode of IEEE 802.15.4,” Tech. Rep., 2015. [120] D. Dujovne, L. A. Grieco, M. R. Palattella, and N. Accettura, “6TiSCH on-the-fly scheduling,” Tech. Rep., 2015. [121] “IEEE Standard for Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) specifications,” IEEE Std 802.11-1997, pp. 1–445, 1997. [122] “IEEE Standard for Information technology–Local and metropolitan area networks–Specific requirements–Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications Amendment 8: Medium Access Control (MAC) Quality of Service Enhancements,” IEEE Std 802.11e-2005 (Amendment to IEEE Std 802.11, 1999 Edition (Reaff 2003), pp. 1–212, 2005. [123] G. Cena, L. Seno, A. Valenzano, and C. Zunino, “On the performance of IEEE 802.11e wireless infrastructures for soft-real-time industrial applications,” IEEE Transactions on Industrial Informatics, vol. 6, no. 3, pp. 425–437, 2010. [124] M. Sojka, M. Molnar, and Z. Hanzalek, “Experiments for real-time communication contracts in IEEE 802.11e EDCA networks,” in IEEE International Workshop on Factory Communication Systems, 2008. [125] G. Tian, S. Camtepe, and Y. C. Tian, “A deadline-constrained 802.11 MAC protocol with QoS differentiation for soft real-time control,” IEEE Transactions on Industrial Informatics, vol. 12, no. 2, pp. 544– 554, 2016. [126] L. Seno, G. Cena, S. Scanzio, A. Valenzano, and C. Zunino, “Enhancing communication determinism in Wi-Fi networks for soft real-time industrial applications,” IEEE Transactions on Industrial Informatics, vol. 13, no. 2, pp. 866–876, 2017. [127] Y. H. Wei, Q. Leng, S. Han, A. K. Mok, W. Zhang, and M. Tomizuka, “RT-WiFi: Real-time high-speed communication protocol for wireless cyber-physical control applications,” in IEEE Real-Time Systems Symposium, 2013. [128] J. Heo, J. Hong, and Y. Cho, “EARQ: Energy aware routing for real-time and reliable communication in wireless industrial sensor networks,” IEEE Transactions on Industrial Informatics, vol. 5, no. 1, pp. 3–11, 2009. [129] G. Cena, I. C. Bertolotti, A. Valenzano, and C. Zunino, “Evaluation of response times in industrial WLANs,” IEEE Transactions on Industrial Informatics, vol. 3, no. 3, pp. 191–201, 2007. [130] M. Kontik and S. C. Ergen, “Scheduling in single-hop multiple access wireless networks with successive interference cancellation,” IEEE Wireless Communications Letters, vol. 3, no. 2, pp. 197–200, 2014. [131] W. Ye, J. Heidemann, and D. Estrin, “Medium access control with coordinated adaptive sleeping for wireless sensor networks,” IEEE/ACM Transactions on Networking, vol. 12, no. 3, pp. 493–506, 2004. [132] T. V. Dam and K. Langendoen, “An adaptive energy-efficient MAC protocol for wireless sensor networks,” in ACM SenSys, 2003. [133] J. Polastre, J. Hill, and D. Culler, “Versatile low power media access for wireless sensor networks,” in ACM SenSys, 2004. [134] E. A. M. Buettner, G. Yee and R. Han, “X-MAC: A short preamble MAC protocol for duty-cycled wireless sensor networks,” in ACM SenSys, 2006. [135] J. W. S. Liu, Real-Time Systems. Prentice Hall, 2000. [136] J. M. Winter, G. Kunzel, I. Muller, C. E. Pereira, and J. C. Netto, “Study of routing mechanisms in a WirelessHART network,” in IEEE ICIT, 2013. [137] Z. Z. Wu, “Research of WirelessHART network layer routing algorithm,” Industrial Instrumentation and Control Systems, vol. 336, pp. 1827–1832, 2013. [138] D. Ganesan, R. Govindan, S. Shenker, and D. Estrin, “Highly-resilient, energy-efficient multipath routing in wireless sensor networks,” SIGMOBILE Mob. Comput. Commun. Rev., vol. 5, no. 4, pp. 11–25, 2001. [139] M. Tarique, K. E. Tepe, S. Adibi, and S. Erfani, “Survey of multipath routing protocols for mobile ad hoc networks,” Journal of Network and Computer Applications, vol. 32, no. 6, pp. 1125 – 1143, 2009. [140] M. K. Marina and S. R. Das, “On-demand multipath distance vector routing in ad hoc networks,” in IEEE ICNP, 2001. [141] Z. Jindong, L. Zhenjun, and Z. Yaopei, “ELHFR: A graph routing in industrial wireless mesh network,” in IEEE ICIA, 2009. [142] G. Gao, H. Zhang, and L. Li, “A reliable multipath routing strategy for WirelessHART mesh networks using subgraph routing,” Journal of Computational Information Systems, vol. 9, no. 5, pp. 2001–2008, 2013. [143] L. B. Saad, C. Chauvenet, and B. Tourancheau, “Simulation of the RPL routing protocol for IPv6 sensor networks,” in International Conference on Sensor Technologies and Applications, 2011. [144] O. Gaddour, A. Koubaa, S. Chaudhry, M. Tezeghdanti, and M. Abid, “Simulation and performance evaluation of DAG construction with RPL,” in International Conference on Communications and Networking, 2012. [145] P. Gonizzi, R. Monica, and G. Ferrari, “Design and evaluation of a delay-efficient RPL routing metric,” in International Wireless Communications and Mobile Computing Conference, 2013. [146] P. D. Marco, C. Fischione, G. Athanasiou, and P.-V. Mekikis, “MACaware routing metrics for low power and lossy networks,” in IEEE INFOCOM, 2013. [147] X. Liu, J. Guo, G. Bhatti, P. Orlik, and K. Parsons, “Load balanced routing for low power and lossy networks,” in IEEE WCNC, 2013. [148] H. S. Kim, H. Kim, J. Paek, and S. Bahk, “Load balancing under heavy traffic in RPL routing protocol for low power and lossy networks,” IEEE Transactions on Mobile Computing, vol. 16, no. 4, pp. 964–979, 2017. [149] P. Karkazis, H. C. Leligou, P. Trakadas, L. Sarakis, and T. H. Velivassaki, “Design of primary and composite routing metrics for RPL-compliant wireless sensor networks,” in Telecommunications and Multimedia, 2012. [150] P. Gaddour, A. Koubaa, N. Baccour, and M. Abid, “OF-FL: QoS aware fuzzy logic objective function for the RPL routing protocol,” in International Symposium on Modeling and Optimization in Mobile, Ad Hoc and Wireless Networks, 2014. [151] P. Seiler and R. Sengupta, “An H∞ approach to networked control,” IEEE Transactions on Automatic Control, vol. 50, no. 3, pp. 356–364, 2005. [152] D. Yue, Q.-L. Han, and C. Peng, “State feedback controller design of networked control systems,” IEEE Transactions on Circuits and Systems II: Express Briefs, vol. 51, no. 11, pp. 640–644, 2004. [153] P. Seiler and R. Sengupta, “Analysis of communication losses in vehicle control problems,” in ACC, 2001. [154] J. Xiong and J. Lam, “Stabilization of linear systems over networks with bounded packet loss,” Automatica, vol. 43, no. 1, pp. 80 – 87, 2007. [155] W. P. M. H. Heemels, A. R. Teel, N. van de Wouw, and D. Nesic, “Networked control systems with communication constraints: Tradeoffs between transmission intervals, delays and performance,” IEEE Transactions on Automatic Control, vol. 55, no. 8, pp. 1781–1796, 2010. [156] W.-A. Zhang and L. Yu, “Modelling and control of networked control systems with both network-induced delay and packet-dropout,” Automatica, vol. 44, no. 12, pp. 3206 – 3210, 2008. [157] ——, “Output feedback stabilization of networked control systems with packet dropouts,” IEEE Transactions on Automatic Control, vol. 52, no. 9, pp. 1705–1710, 2007. 36 [158] J. Nilsson, “Stochastic analysis and control of real-time systems with random time delays,” Automatica, vol. 34, no. 1, pp. 57–64, 1998. [159] H. Shousong and Z. Qixin, “Stochastic optimal control and analysis of stability of networked control systems with long delay,” Automatica, vol. 39, no. 11, pp. 1877 – 1884, 2003. [160] H. Lin and P. J. Antsaklis, “Stability and stabilizability of switched linear systems: A survey of recent results,” IEEE Transactions on Automatic Control, vol. 54, no. 2, pp. 308–322, 2009. [161] M. Yu, L. Wang, G. Xie, and T. Chu, “Stabilization of networked control systems with data packet droupout via switched system approach,” in IEEE CACSD, 2004. [162] O. Costa and M. Fragoso, “Stability results for discrete-time linear systems with markovian jumping parameters,” Journal of Mathematical Analysis and Applications, vol. 179, no. 1, pp. 154–178, 1993. [163] S. Tatikonda and S. Mitter, “Control under communication constraints,” IEEE Transactions on Automatic Control, vol. 49, no. 7, pp. 1056– 1068, 2004. [164] K. Srinivasan, M. A. Kazandjieva, S. Agarwal, and P. Levis, “The betafactor: measuring wireless link burstiness,” in ACM SenSys, 2008. [165] K. Srinivasan, M. Jain, J. I. Choi, T. Azim, E. S. Kim, P. Levis, and B. Krishnamachari, “The kappa factor: Inferring protocol performance using inter-link reception correlation,” in ACM MobiCom, 2010. [166] P. Park, J. Araujo, and K. H. Johansson, “Wireless networked control system co-design,” in IEEE ICNSC, 2011. [167] P. Park, H. Khadilkar, H. Balakrishnan, and C. J. Tomlin, “High confidence networked control for next generation air transportation systems,” IEEE Transactions on Automatic Control, vol. 59, no. 12, pp. 3357–3372, 2014. [168] G. Karagiannis, O. Altintas, E. Ekici, G. Heijenk, B. Jarupan, K. Lin, and T. Weil, “Vehicular networking: A survey and tutorial on requirements, architectures, challenges, standards and solutions,” IEEE Communications Surveys Tutorials, vol. 13, no. 4, pp. 584–616, 2011. [169] A. Cervin and T. Henningsson, “Scheduling of event-triggered controllers on a shared network,” in IEEE CDC, 2008. [170] R. Blind and F. Allgöwer, “Analysis of networked event-based control with a shared communication medium: Part II - slotted ALOHA,” in IFAC World Congress, 2011. [171] E. Johannesson, T. Henningsson, and A. Cervin, “Sporadic control of first-order linear stochastic systems,” in HSCC. Springer Berlin Heidelberg, 2007. [172] R. Rom and M. Sidi, Multiple access protocols: performance and analysis. Springer-Verlag, 1990. [173] P. Park, S. C. Ergen, C. Fischione, and A. Sangiovanni-Vincentelli, “Duty-cycle optimization for IEEE 802.15.4 wireless sensor networks,” ACM Transactions on Sensor Networks, vol. 10, no. 1, 2013. [174] S. Brienza, M. Roveri, D. D. Guglielmo, and G. Anastasi, “Just-in-time adaptive algorithm for optimal parameter setting in 802.15.4 WSNs,” ACM Transactions on Autonomous and Adaptive Systems, vol. 10, no. 4, pp. 1–26, 2016. [175] M. D. Francesco, G. Anastasi, M. Conti, S. K. Das, and V. Neri, “Reliability and energy-efficiency in IEEE 802.15.4/ZigBee sensor networks: An adaptive and cross-layer approach,” IEEE Journal on Selected Areas in Communications, vol. 29, no. 8, pp. 1–18, 2011. [176] R. Moraes, F. Vasques, and P. Portugal, “A TDMA-based mechanism to enforce real-time behavior in WiFi networks,” in IEEE International Workshop on Factory Communication Systems, 2008. [177] E. Toscano and L. L. Bello, “A middleware for reliable soft real-time communication over IEEE 802.11 WLANs,” in IEEE International Symposium on Industrial and Embedded Systems, 2011. [178] G. Boggia, P. Camarda, L. A. Grieco, and G. Zacheo, “Toward wireless networked control systems: An experimental study on real-time communications in 802.11 WLANs,” in IEEE International Workshop on Factory Communication Systems, 2008. [179] M. Yan, K.-Y. Lam, S. Han, E. Chan, Q. Chen, P. Fan, D. Chen, and M. Nixon, “Hypergraph-based data link layer scheduling for reliable packet delivery in wireless sensing and control networks with endto-end delay constraints,” Information Sciences, vol. 278, pp. 34–55, 2014. [180] A. Saifullah, Y. Xu, C. Lu, and Y. Chen, “End-to-end communication delay analysis in industrial wireless networks,” IEEE Transactions on Computers, vol. 64, no. 5, pp. 1361–1374, 2015. [181] C. Wu, M. Sha, D. Gunatilaka, A. Saifullah, C. Lu, and Y. Chen, “Analysis of EDF scheduling for wireless sensor-actuator networks,” in IEEE IWQoS, 2014. [182] A. Saifullah, D. Gunatilaka, P. Tiwari, M. Sha, C. Lu, B. Li, C. Wu, and Y. Chen, “Schedulability analysis under graph routing in WirelessHART networks,” in IEEE RTSS, 2015. [183] F. Barac, M. Gidlund, and T. Zhang, “PREED: Packet recovery by exploiting the determinism in industrial WSN communication,” in IEEE DCOSS, 2015. [184] M. Jonsson and K. Kunert, “Towards reliable wireless industrial communication with real-time guarantees,” IEEE Transactions on Industrial Informatics, vol. 5, no. 4, pp. 429–442, 2009. [185] S. Munir, S. Lin, E. Hoque, S. M. S. Nirjon, J. A. Stankovic, and K. Whitehouse, “Addressing burstiness for reliable communication and latency bound generation in wireless sensor networks,” in ACM/IEEE IPSN, 2010. [186] G. Gamba, F. Tramarin, and A. Willig, “Retransmission strategies for cyclic polling over wireless channels in the presence of interference,” IEEE Transactions on Industrial Informatics, vol. 6, no. 3, pp. 405– 415, 2010. [187] A. Saifullah, Y. Xu, C. Lu, and Y. Chen, “Real-time scheduling for WirelessHART networks,” in IEEE RTSS, 2010. [188] K. Yu, Z. Pang, M. Gidlund, J. Akerberg, and M. Bjorkman, “REALFLOW: Reliable real-time flooding-based routing protocol for industrial wireless sensor networks,” International Journal of Distributed Sensor Networks, vol. 10, no. 7, pp. 1–17, 2014. [189] P. Park, P. D. Marco, and K. H. Johansson, “Cross-layer optimization for industrial control applications using wireless sensor and actuator mesh networks,” IEEE Transactions on Industrial Electronics, vol. 64, no. 4, pp. 3250–3259, 2017. [190] Y. Sadi and S. C. Ergen, “Joint optimization of communication and controller components of wireless networked control systems,” in IEEE ICC, 2015. [191] R. Alur, A. D’Innocenzo, K. H. Johansson, G. J. Pappas, and G. Weiss, “Compositional modeling and analysis of multi-hop control networks,” IEEE Transactions on Automatic Control, vol. 56, no. 10, pp. 2345– 2357, 2011. [192] S. X. Ding, P. Zhang, S. Yin, and E. L. Ding, “An integrated design framework of fault-tolerant wireless networked control systems for industrial automatic control applications,” IEEE Transactions on Industrial Informatics, vol. 9, no. 1, pp. 462–471, 2013. [193] Y. Wang, S. X. Ding, D. Xu, and B. Shen, “An H∞ fault estimation scheme of wireless networked control systems for industrial realtime applications,” IEEE Transactions on Control Systems Technology, vol. 22, no. 6, pp. 2073–2086, 2014. [194] M. Rabi, L. Stabellini, A. Proutiere, and M. Johansson, “Networked estimation under contention-based medium access,” International Journal of Robust and Nonlinear Control, vol. 20, no. 2, pp. 140–155, 2010. [195] J. Bai, E. P. Eyisi, Y. Xue, and X. D. Koutsoukos, “Dynamic tuning retransmission limit of IEEE 802.11 MAC protocol for networked control systems,” in IEEE/ACM CPSCom, 2010. [196] A. Ulusoy, O. Gurbuz, and A. Onat, “Wireless model-based predictive networked control system over cooperative wireless network,” IEEE Transactions on Industrial Informatics, vol. 7, no. 1, pp. 41–51, 2011. [197] Y. Li, C. S. Chen, Y. Q. Song, Z. Wang, and Y. Sun, “Enhancing realtime delivery in wireless sensor networks with two-hop information,” IEEE Transactions on Industrial Informatics, vol. 5, no. 2, pp. 113– 122, 2009. [198] F. Dobslaw, T. Zhang, and M. Gidlund, “End-to-end reliability-aware scheduling for wireless sensor networks,” IEEE Transactions on Industrial Informatics, vol. 12, no. 2, pp. 758–767, 2016. [199] D. Yang, Y. Xu, H. Wang, T. Zheng, H. Zhang, H. Zhang, and M. Gidlund, “Assignment of segmented slots enabling reliable real-time transmission in industrial wireless sensor networks,” IEEE Transactions on Industrial Electronics, vol. 62, no. 6, pp. 3966–3977, 2015. [200] C. Wu, D. Gunatilaka, A. Saifullah, M. Sha, P. B. Tiwari, C. Lu, and Y. Chen, “Maximizing network lifetime of WirelessHART networks under graph routing,” in IEEE IoTDI, 2016. [201] P. T. A. Quang and D.-S. Kim, “Enhancing real-time delivery of gradient routing for industrial wireless sensor networks,” IEEE Transactions on Industrial Informatics, vol. 8, no. 1, pp. 61–68, 2012. [202] X. Liu and A. Goldsmith, “Wireless network design for distributed control,” in IEEE CDC, 2004. [203] J. Bai, E. P. Eyisi, F. Qiu, Y. Xue, and X. D. Koutsoukos, “Optimal cross-layer design of sampling rate adaptation and network scheduling for wireless networked control systems,” in ACM/IEEE ICCPS, 2012. [204] M. Rabi and K. H. Johansson, “Scheduling packets for event-triggered control,” in ECC, 2009, pp. 3779–3784. [205] X. Cao, P. Cheng, J. Chen, and Y. Sun, “An online optimization approach for control and communication codesign in networked cyberphysical systems,” IEEE Transactions on Industrial Informatics, vol. 9, no. 1, pp. 439–450, 2013. 37 [206] M. Vilgelm, M. H. Mamduhi, W. Kellerer, and S. Hirche, “Adaptive decentralized MAC for event-triggered networked control systems,” in HSCC, 2016. [207] K. Gatsis, A. Ribeiro, and G. J. Pappas, “Control-aware random access communication,” in ACM/IEEE ICCPS, 2016. [208] C. Ramesh, H. Sandberg, and K. H. Johansson, “Performance analysis of a network of event-based systems,” IEEE Transactions on Automatic Control, vol. 61, no. 11, pp. 3568–3573, 2016. [209] M. H. Mamduhi, D. Tolic, A. Molin, and S. Hirche, “Event-triggered scheduling for stochastic multi-loop networked control systems with packet dropouts,” in IEEE CDC, 2014. [210] A. Molin and S. Hirche, “Price-based adaptive scheduling in multiloop control systems with resource constraints,” IEEE Transactions on Automatic Control, vol. 59, no. 12, pp. 3282–3295, 2014. [211] B. Demirel, V. Gupta, and M. Johansson, “On the trade-off between control performance and communication cost for event-triggered control over lossy networks,” in ECC, 2013. [212] J. G. Ko, Y. H. Cho, and H. Kim, “Performance evaluation of IEEE 802.15.4 MAC with different backoff ranges in wireless sensor networks,” in IEEE ICCS, 2006. [213] A. C. Pang and H. W. Tseng, “Dynamic backoff for wireless personal networks,” in IEEE GLOBECOM, 2004. [214] C. Merlin and W. Heinzelman, “Duty cycle control for low-powerlistening MAC protocols,” IEEE Transactions on Mobile Computing, vol. 9, no. 11, pp. 1508–1521, 2010. [215] C. Fischione, P. Park, and S. C. Ergen, “Analysis and optimization of duty cycle in preamble-based random access networks,” Wireless Networs, vol. 19, no. 7, pp. 1691–1707, 2013. [216] N. Kottenstette, X. Koutsoukos, J. Hall, J. Sztipanovits, and P. Antsaklis, “Passivity-based design of wireless networked control systems for robustness to time-varying delays,” in IEEE Real-Time Systems Symposium, 2008. [217] M. S. Gokturk and O. Gurbuz, “Cooperation in wireless sensor networks: Design and performance analysis of a MAC protocol,” in IEEE ICC, 2008. [218] U. Tiberi, C. Fischione, M. Di Benedetto, and K. H. Johansson, “Energy-efficient sampling of networked control systems over IEEE 802.15.4 wireless networks,” Automatica, vol. 49, no. 3, pp. 712–724, 2013. [219] K. Jamieson and H. Balakrishnan, “PPR: Partial packet recovery for wireless networks,” ACM SIGCOMM Computer Communication Review, vol. 37, no. 4, pp. 409–420, 2007. [220] J.-H. Hauer, A. Willig, and A. Wolisz, “Mitigating the effects of RF interference through RSSI-based error recovery,” in EWSN, 2010. [221] F. Tramarin, S. Vitturi, M. Luvisotto, and A. Zanella, “On the use of IEEE 802.11n for industrial communications,” IEEE Transactions on Industrial Informatics, vol. 12, no. 5, pp. 1877–1886, 2016. [222] K. Yu, M. Gidlund, J. Akerberg, and M. Bjorkman, “Reliable RSSbased routing protocol for industrial wireless sensor networks,” in IEEE IECON, 2012. [223] J. Kiszka and B. Wagner, “RTnet - a flexible hard real-time networking framework,” in IEEE Conference on Emerging Technologies and Factory Automation, 2005. [224] A. S. Ibrahim, Z. Han, and K. J. R. Liu, “Distributed energy-efficient cooperative routing in wireless networks,” IEEE Transactions on Wireless Communications, vol. 7, no. 10, pp. 3930–3941, 2008. [225] Y. Dai, Q. Wang, and X. Li, “MEBRS: Energy balancing route scheduling in centralized wireless sensor networks,” in ASQED, 2009. [226] R. R. Tyagi, F. Aurzada, K. D. Lee, S. G. Kim, and M. Reisslein, “Impact of retransmission limit on preamble contention in lte-advanced network,” IEEE Systems Journal, vol. 9, no. 3, pp. 752–765, 2015. [227] G. Bianchi, “Performance analysis of the IEEE 802.11 distributed coordination function,” IEEE Journal on Selected Areas in Communications, vol. 18, no. 3, pp. 535–547, 2000. [228] L. P. Steyn and G. P. Hancke, “A survey of wireless sensor network testbeds,” in IEEE AFRICON, 2011. [229] A. S. Tonneau, N. Mitton, and J. Vandaele, “A survey on (mobile) wireless sensor network experimentation testbeds,” in IEEE DCOSS, 2014. [230] J. Horneber and A. Hergenröder, “A survey on testbeds and experimentation environments for wireless sensor networks,” IEEE Communications Surveys Tutorials, vol. 16, no. 4, pp. 1820–1838, 2014. [231] A. Cervin, D. Henriksson, B. Lincoln, J. Eker, and K. E. Arzen, “How does control timing affect performance? analysis and simulation of timing using jitterbug and truetime,” IEEE Control Systems, vol. 23, no. 3, pp. 16–30, 2003. [232] E. Eyisi, J. Bai, D. Riley, J. Weng, W. Yan, Y. Xue, X. Koutsoukos, and J. Sztipanovits, “NCSWT: An integrated modeling and simulation tool for networked control systems,” Simulation Modelling Practice and Theory, vol. 27, pp. 90 – 111, 2012. [233] B. Aminian, J. Araujo, M. Johansson, and K. H. Johansson, “GISOO: A virtual testbed for wireless cyber-physical systems,” in IEEE IECON, 2013. [234] B. Li, L. Nie, C. Wu, H. Gonzalez, and C. Lu, “Incorporating emergency alarms in reliable wireless process control,” in ACM/IEEE ICCPS, 2015. [235] P. Levis, N. Lee, M. Welsh, and D. Culler, “TOSSIM: Accurate and scalable simulation of entire TinyOS applications,” in ACM SenSys, 2003. [236] H. Lee, A. Cerpa, and P. Levis, “Improving wireless simulation through noise modeling,” in ACM/IEEE IPSN, 2007. [237] M. Sha, D. Gunatilaka, C. Wu, and C. Lu, “Implementation and experimentation of industrial wireless sensor-actuator network protocols,” in EWSN, 2015. [238] J. Polastre, R. Szewczyk, and D. Culler, “Telos: enabling ultra-low power wireless research,” in ACM/IEEE IPSN, 2005. [239] O. Gnawali, R. Fonseca, K. Jamieson, D. Moss, and P. Levis, “Collection tree protocol,” in ACM SenSys, 2009. [240] G. Pattarello, L. Wei, A. Ebadat, B. Wahlberg, and K. H. Johansson, “The KTH open testbed for smart HVAC control,” in ACM BuildSys, 2013. [241] R.C.Dorf and R.H.Bishop, Modern Control Systems. Addison Wesley, 2010. [242] K. H. Johansson, “The quadruple-tank process: a multivariable laboratory process with an adjustable zero,” IEEE Transactions on Control Systems Technology, vol. 8, no. 3, pp. 456–465, 2000. [243] Coupled Water Tanks, Quanser, http://www.quanser.com/products/coupled tanks. [244] EnOcean, “Enocean - the world of energy harvesting wireless technology,” White paper, 2015. [245] N. A. Johansson, Y.-P. E. Wang, E. Eriksson, and M. Hessler, “Radio access for ultra-reliable and low-latency 5G communications,” in IEEE ICC, 2015. [246] O. N. C. Yilmaz, Y.-P. E. Wang, N. A. Johansson, N. Brahmi, S. A. Ashraf, and J. Sachs, “Analysis of ultra-reliable and low-latency 5G communication for a factory automation use case,” in IEEE ICC, 2015. [247] M. Luvisotto, Z. Pang, and D. Dzung, “Ultra high performance wireless control for critical applications: Challenges and directions,” IEEE Transactions on Industrial Informatics, vol. PP, no. 99, pp. 1–11, 2016. [248] D. Ohmann, M. Simsek, and G. P. Fettweis, “Achieving high availability in wireless networks by an optimal number of rayleigh-fading links,” in IEEE Globecom Workshop - Ultra-Low Latency and UltraHigh Reliability in Wireless Communications, 2014. [249] G. Pocovi, B. Soret, M. Lauridsen, K. I. Pedersen, and P. Mogensen, “Signal quality outage analysis for ultra-reliable communications in cellular networks,” in IEEE Globecom Workshop - Ultra-Low Latency and Ultra-High Reliability in Wireless Communications, 2015. [250] M. Serror, C. Dombrowski, K. Wehrle, and J. Gross, “Channel coding versus cooperative ARQ: Reducing outage probability in ultra-low latency wireless communications,” in IEEE Globecom Workshop - UltraLow Latency and Ultra-High Reliability in Wireless Communications, 2015. [251] D. B. Cheikh, J. Kelif, M. Coupechoux, and P. Godlewski, “Analytical joint processing multi-point cooperation performance in rayleigh fading,” IEEE Wireless Communications Letters, vol. 1, no. 4, pp. 272– 275, 2012. [252] B. Farayev, Y. Sadi, and S. C. Ergen, “Optimal power control and rate adaptation for ultra-reliable M2M control applications,” in IEEE Globecom Workshop - Ultra-Low Latency and Ultra-High Reliability in Wireless Communications, 2015. [253] “The cellular network operator enabling the internet of things,” Sigfox, Tech. Rep., 2015. [254] M. Condoluci, G. Araniti, T. Mahmoodi, and M. Dohler, “Enabling the IoT machine age with 5G: Machine-type multicast services for innovative real-time applications,” IEEE Access, vol. 4, pp. 5555–5569, 2016.
3cs.SY
arXiv:1701.07735v4 [math.AC] 19 Mar 2018 NOTES ON FINITELY GENERATED FLAT MODULES ABOLFAZL TARIZADEH Abstract. In this article, the projectivity of a finitely generated flat module of a commutative ring is studied through its exterior powers and invariant factors. Consequently, the related results of Endo, Vasconcelos, Wiegand, Cox-Rush and Puninski-Rothmaler on the projectivity of f.g. flat modules are generalized. 1. Introduction The main purpose of the present article is to investigate the projectivity of finitely generated flat modules of a commutative ring. It is worthy to mention that this has been the main topic of many articles in the literature over the years and it is still of current interest, see e.g. [1], [2], [4], [6], [7], [8]. Note that in general there are f.g. flat modules which are not necessarily projective, see Example 3.17, also see [3, Tag 00NY] for another example. We use f.g. in place of “finitely generated”. In this paper, the projectivity of a finitely generated flat module of a commutative ring is studied through its exterior powers and invariant factors. The important outcome of this study is that some major results in the literature on the projectivity of f.g. flat modules are re-proved directly (e.g. without using the homological methods) and at the same time most of them are vastly generalized. In particular, Theorem 3.10 vastly generalizes [2, Theorem 1], Theorem 3.12 generalizes [7, Theorem 2.1] and Theorem 3.13 generalizes [8, Theorem 2], [1, Proposition 2.3], it also generalizes [6, Proposition 5.5 and Corollary 5.6] in the commutative case. In fact, Theorem 3.13 can be viewed as a generalization of all of the above mentioned results. The main motivation to investigate the projectivity of f.g. flat modules essentially originates from the fact that “every f.g. flat module over a local ring is free”. In this article we also prove a more general result, Theorem 3.3. This result, in particular, implies the above fact, 0 2010 Mathematics Subject Classification: 13C10, 19A13, 13C11, 13E99. Key words and phrases: flat module; invariant factor; projectivity; S-ring. 1 2 ABOLFAZL TARIZADEH see Corollary 3.5. For reading the present article having a reasonable knowledge from the “exterior powers of a module” is necessary. In this article, all of the rings are commutative. 2. Preliminaries Lemma 2.1. Let M be a f.g. R−module, let I = AnnR (M) and let S be a multiplicative subset of R. Then S −1 I = AnnS −1 R (S −1 M). Proof. Easy.  It is well-known that if R → S is a ring map and M is an R−module then Λn (M) ⊗R S as S−module is canonically isomorphic to ΛnS (M ⊗R S). It is also well-known that if M is a projective (resp. flat) R−module then for each natural number n, Λn (M) is a projective (resp. flat) R−module. Finally, if M is a f.g. R−module then Λn (M) is a f.g. R−module. We shall use these facts freely throughout this article. 3. Main results Lemma 3.1. The annihilator of a f.g. projective module is generated by an idempotent element. Proof. Let M be a R−module, let I = AnnR (M) and let J be the ideal of R which is generated by the elements f (m) where f : M → R is a R−linear map and m ∈ M. Clearly IJ = 0. Consider a free R−module F with basis {ei } and an onto R−linear map ψ : F → M. For each i there is a R−linear map hi : F → R such that hi (ej ) = δi,j . If M is R−projective then there exists a R−linear map ϕ : M → F such that ψ ◦ ϕ is the identity map.PPut fi = hi ◦ ϕ for all i. Then for each m ∈ M we may write m = fi (m)ψ(ei ) where fi (m) = 0 for i all but a finite number of indices i. This implies that JM = M. If moreover M is a f.g. R−module then, by [3, Tag 00DW], we may find an element b ∈ J such that 1 + b ∈ I. Let a = 1 + b. Then clearly a = a2 and I = Ra.  NOTES ON FINITELY GENERATED FLAT MODULES 3 Remark 3.2. In a flat module both of the scalars and vectors involved in a linear relation have very peculiar properties. More precisely, let n P ai xi = 0 in M M be a R−module and consider a linear relation i=1 where ai ∈ R and xi ∈ M for all i. Let I = (a1 , ..., an ) and consider the map ψ : Rn → I which maps each n-tuple (r1 , ..., rn ) of Rn n P into ri ai . Then we get the following exact sequence of R−modules i=1 ψ⊗1 i⊗1 / I ⊗R M where K = Ker ψ. If moreRn ⊗R M n P over M is R−flat then ǫi ⊗ xi ∈ Ker(ψ ⊗ 1) where ǫi = (δi,k )1≤k≤n K ⊗R M / i=1 for all i. Because by the flatness of M, I ⊗R M is canonically isomorphic to IM. Therefore there exist a natural number m ≥ 1 and also elements sj = (r1,j , ..., rn,j ) ∈ K and yj ∈ M with 1 ≤ j ≤ m such that n m P P ǫi ⊗ xi . Now by applying the canonical isomor(i ⊗ 1)( sj ⊗ yj ) = i=1 j=1 phism Rn ⊗R M → M n which maps each pure tensor (r1 , ..., rn ) ⊗ x m P into (r1 x, ..., rn x) we obtain that xi = ri,j yj for all i. Moreover for each j, n P j=1 ri,j ai = 0 since ψ(sj ) = 0. i=1 Under the light of Remark 3.2, the following result is obtained. Theorem 3.3. Let (R, m) be a local ring and let M be a flat R−module. Let S be a subset of M such that its image under the canonical map M → M/mM is linearly independent over k = R/m. Then S is linearly independent over R. Proof. Suppose n P ai xi = 0 where ai ∈ R and {x1 , ..., xn } ⊆ S. i=1 To prove the assertion we shall use an induction argument on n. If n = 1 then by Remark 3.2, there are elements z1 , ..., zd ∈ M and d P r1 , ..., rd ∈ R such that x1 = rj zj and rj a1 = 0 for all j. By the j=1 hypotheses, x1 ∈ / mM. Therefore rj ∈ / m for some j. It follows that a1 = 0. Now let n > 1. Again by Remark 3.2, there are elements m n P P ri,j yj and ri,j ai = 0 y1 , ..., ym ∈ M and ri,j ∈ R such that xi = j=1 i=1 for all i, j. There is some j such that rn,j ∈ / m since xn ∈ / mM. It 4 ABOLFAZL TARIZADEH follows that an = n−1 P i=1 −1 rn,j ri,j ai . Then we get n−1 P i=1 −1 ai (xi + rn,j ri,j xn ) = 0. −1 Let ci = rn,j ri,j . Note that the image of {xi + ci xn : 1 ≤ i ≤ n − 1} under the canonical map M → M/mM is linearly independent (because if {x1 , ..., xn } is a linearly independent subset of a module then {xi + ri xn : 1 ≤ i ≤ n − 1} is also a linearly independent subset where the ri are arbitrary scalars). Therefore, by the induction hypothesis, ai = 0 for all 1 ≤ i ≤ n − 1. This also implies that an = 0.  Corollary 3.4. Let (R, m) be a local ring and let M be a flat R−module. Then there is a free R−submodule F of M such that M = F + mM. In particular, if either M/F is finitely generated or the maximal ideal is nilpotent then M is a free R−module. Proof. Every vector space has a basis. So let {xi + mM : P i ∈ I} Rxi be a k-basis of M/mM where k = R/m. By Theorem 3.3, F = i∈I is a free R−module. Clearly M = F + mM. If M/F is finitely generated then by the Nakayama lemma, M = F . If m is nilpotent then there is a natural number n ≥ 1 such that mn = 0. It follows that M/F = mn (M/F ) = 0.  As an immediate consequence of the above corollary we obtain the following result which plays a major role in this article: Corollary 3.5. Every f.g. flat module over a local ring is free.  As a first application of Corollary 3.5 we obtain: Lemma 3.6. The annihilator of a f.g. flat module is an idempotent ideal. Proof. Let M be a f.g. flat module over a ring R. Let I = AnnR (M). Let p be a prime ideal of R. By Lemma 2.1, Ip = AnnRp (Mp ). By Corollary 3.5, Mp is a free Rp −module. Therefore Ip is either the whole localization or the zero ideal. If Ip = 0 then (I 2 )p = 0 since I 2 ⊆ I. But if Ip = Rp then I is not contained in p. Thus we may choose some a ∈ I \ p. Clearly a2 ∈ I 2 \ p and so (I 2 )p = Rp . Therefore I = I 2 .  NOTES ON FINITELY GENERATED FLAT MODULES 5 If M is a R−module then the n-th invariant factor of M, denoted by In (M), is defined as the annihilator  of the n-th exterior power of M. n Therefore In (M) = AnnR Λ (M) . We have: Lemma 3.7. The invariant factors of a f.g. flat module are idempotent ideals. Proof. If M is a f.g. flat R−module then Λn (M) is as well. Thus, by Lemma 3.6, In (M) is an idempotent ideal.  Remark 3.8. Let M be a f.g. flat R−module. Then Corollary 3.5 leads us to a function ψ : Spec R → N = {0, 1, 2, ...} which is defined as p rankRp (Mp ). It is called the rank map of M. It is also easy to see that Supp Λn (M) = {p ∈ Spec(R) : rankRp (Mp ) ≥ n}. Theorem 3.9. Let M be a f.g. flat R−module. Then the following conditions are equivalent. (i) M is R−projective. (ii) The invariant factors of M are f.g. ideals. (iii) The rank map of M is locally constant. Proof. (i) ⇒ (ii) : It is well-known that Λn (M) is a f.g. projective R−module and so by Lemma 3.1, In (M) is a principal ideal. (ii) ⇒ (iii) : It suffices to show that the rank map of M is Zariski continuous. By Lemma 3.7 and [3, Tag 00DW], there exists some a ∈ In (M) such that (1 − a)In (M) = 0. Clearly a = a2 and In (M) = Ra. By Remark 3.8, ψ −1 ({n}) = Supp N ∩ Spec(R) \ Supp N ′ where N = Λn (M) and N ′ = Λn+1  (M). But Supp N = D(1 − a). Moreover, Supp N ′ = V In+1 (M) since N ′ is a f.g. R−module. Therefore ψ −1 ({n}) is an open subset of Spec R. (iii) ⇒ (i) : Apply Corollary 3.5 and [3, Tag 00NX].  The following result vastly generalizes [2, Theorem 1]. Theorem 3.10. Let A ⊆ B be an extension of rings and let M be a f.g. flat A−module. If M ⊗A B is B−projective then M is A−projective. Proof. First we shall prove that I = AnnA (M) is a principal ideal. Let L = AnnB (N) where N = M ⊗A B. We claim that IB = L. Let 6 ABOLFAZL TARIZADEH q be a prime ideal of B. Clearly N is a f.g. B−module. Thus, by Corollary 3.5, Lq is either the whole localization or the zero ideal. If Lq = 0 then (IB)q = 0 since IB ⊆ L. But if Lq = Bq then L is not contained in q and so Nq = 0. Again by Corollary 3.5, Ip is either the whole localization or the zero ideal where p = A ∩ q. If Ip = 0 then Mp 6= 0 and so, by Corollary 3.5, Mp ⊗Ap Bq 6= 0. But Mp ⊗Ap Bq is isomorphic to Nq . This is a contradiction. Therefore Ip = Ap . It follows that (IB)q = Bq . This establishes the claim. By Lemma 3.1, there is an idempotent e ∈ B such that IB = Be. Let J = B(1−e)∩A. Clearly IJ = 0. We have I + J = A. If not, then there exists a prime ideal p of A such that I + J ⊆ p. Thus, by Corollary 3.5, Ip = 0. Therefore the extension of IB under the canonical map B → B ⊗A Ap is zero. Thus there exists an element s ∈ A \ p such that se = 0 and so s = s(1 − e). Hence s ∈ J. But this is a contradiction. Therefore I + J = A. It follows that there is an element c ∈ I such that c = c2 and I = Ac. Now, let n ≥ 1. But Λn (M) is a f.g. flat A−module. Moreover, Λn (M) ⊗A B is B−projective since it is canonically isomorphic to ΛnB (M ⊗A B). Thus, by what we have proved above, In (M) is a principal ideal. Hence, by Theorem 3.9, M is A−projective.  Lemma 3.11. Let M be a f.g. flat R−module and let J be an ideal of R. Let I = AnnR (M) and L = AnnR (M/JM). Then L = I + J. Proof. Clearly I + J ⊆ L. Let p be a prime ideal of R. By Lemma 2.1, Ip = AnnRp (Mp ). Thus, by Corollary 3.5, Ip is either the whole localization or the null ideal for all primes p. If Ip = Rp then (I + J)p = Lp = Rp since I ⊆ I + J ⊆ L. But if Ip = 0 then Mp 6= 0 and so AnnRp (Mp /Jp Mp ) = Jp (recall that if F is a nonzero free R−module then AnnR (F/JF ) = J). On the other hand, by Lemma 2.1, Lp = AnnRp (Mp /Jp Mp ). Thus (I + J)p = Jp = Lp . Hence L = I + J.  The following result generalizes [7, Theorem 2.1]. Theorem 3.12. Let M be a f.g. flat R−module and let J be an ideal of R which is contained in the radical Jacobson of R. If M/JM is R/J−projective then M is R−projective. Proof. First we shall prove that I = AnnR (M) is a principal ideal. By Lemma 3.11, L = I + J. Also, by Lemma 3.1, AnnR/J (M/JM) = NOTES ON FINITELY GENERATED FLAT MODULES 7 L/J is a principal ideal. This implies that I = Rx + I ∩ J for some x ∈ R since L/J = I + J/J is canonically isomorphic to I/(I ∩ J). But I = Rx. Because let m be a maximal ideal of R. By Corollary 3.5, Im is either the whole localization or the zero ideal. If Im = 0 then (Rx)m = 0 since Rx ⊆ I. But if Im = Rm then I is not contained in m. Thus Rx is also not contained in m since I ∩ J ⊆ J ⊆ m. Hence (Rx)m = Rm . Therefore I = Rx. Now let n ≥ 1 and let N = Λn (M). Then N/JN is R/J−projective. Because, N/JN as R/J−module is isomorphic to ΛnR/J (M/JM) and ΛnR/J (M/JM) is R/J−projective. But N is a f.g. flat R−module. Therefore, by what we have proved above, In (M) = AnnR (N) is a principal ideal. Thus the invariant factors of M are f.g. ideals and so by Theorem 3.9, M is R−projective.  A ring R is called an S-ring (“S” refers to Sakhajev) if every f.g. flat R−module is R−projective. Theorem 3.13. Let ϕ : A → B be a ring map whose kernel is contained in the radical Jacobson of A. If M is a f.g. flat A−module such that M ⊗A B is B−projective then M is A−projective. In particular, if B is an S-ring then A is as well. Proof. Clearly M/JM is a f.g. flat A/J−module and M/JM ⊗A/J B ≃ M ⊗A B is B−projective where J = Ker ϕ. Moreover A/J can be viewed as a subring of B via ϕ. Therefore, by Theorem 3.10, M/JM is A/J−projective. Then apply Theorem 3.12. Finally, assume that B is an S-ring. If M is a f.g. flat A−module then M ⊗A B is a f.g. flat B−module and so, by the hypothesis, it is B−projective. Therefore M is A−projective.  Remark 3.14. Let S be a subset of a ring R. The polynomial ring R[xs : s ∈ S] modulo I is denoted by S (−1) R where the ideal I is generated by elements of the form sx2s − xs and s2 xs − s with s ∈ S. We call S (−1) R the pointwise localization of R with respect to S. Amongst them, the pointwise localization of R with respect to itself, namely R(−1) R, has more interesting properties; for further information please b instead consult with [5]. Note that Wiegand [8] utilizes the notation R (−1) 2 of R R. Clearly η(s) = η(s) (xs + I) and xs + I = η(s)(xs + I)2 where η : R → S (−1) R is the canonical map and the pair (S (−1) R, η) satisfies in the following universal property: “for each such pair (A, ϕ) where ϕ : R → A is a ring map and for each s ∈ S there is some c ∈ A 8 ABOLFAZL TARIZADEH such that ϕ(s) = ϕ(s)2 c and c = ϕ(s)c2 then there exists a unique ring map ψ : S (−1) R → A such that ϕ = ψ ◦ η.” Now let p be a prime ideal of R and consider the canonical map π : R → κ(p) where κ(p) is the residue field of R at p. By the above universal property, there is a (unique) ring map ψ : S (−1) R → κ(p) such that π = ψ ◦ η. Thus η induces a surjection between the corresponding spectra. This, in particular, implies that the kernel of η is contained in the nil-radical of R. Using this, then the following result vastly generalizes [8, Theorem 2]. Corollary 3.15. Let M be a f.g. flat R−module. If there exists a subset S of R such that M ⊗R S (−1) R is S (−1) R−projective then M is R−projective. Proof. It is an immediate consequence of Theorem 3.13.  Proposition 3.16. Let I be an ideal of a ring R. Then R/I is R−flat if and only if AnnR (f ) + I = R for all f ∈ I. Proof. First assume that R/I is R−flat. Suppose there is some f ∈ I such that AnnR (f ) + I 6= R. Thus there exists a prime p of R such that AnnR (f ) + I ⊆ p. Therefore, by Corollary 3.5, Ip = 0 and so there is an element s ∈ R \ p such that sf = 0. But this is a contradiction and we win. Conversely, let ϕ : M → N be an injective R−linear map. To prove the assertion it suffices to show that the induced map M/IM → N/IN given by m + IM ϕ(m) + IN n P is injective. If ϕ(m) ∈ IN then we may write ϕ(m) = fi xi where i=1 fi ∈ I and xi ∈ N for all i. By the hypothesis, there are elements bi ∈ AnnR (fi ) and ci ∈ I such that 1 = bi + ci . It follows that 1 = (b1 + c1 )(b2 + c2 )...(bn + cn ) = b + c where b = b1 b2 ...bn and c ∈ I. Thus ϕ(m) = bϕ(m) + cϕ(m) = ϕ(cm). Therefore m = cm ∈ IM.  As a final result in the following we give an example of a f.g. flat module which is not projective. Note that finding explicit examples of f.g. flat modules but not projective is not as easy as one may think at first. Example 3.17. Let R = Q A be an infinite direct product of copies of L a non-zero ring A and let I = A which is an ideal of R. Let f = (fi ) i≥1 i≥1 NOTES ON FINITELY GENERATED FLAT MODULES 9 be an element of I. There exists a finite subset D of {1, 2, 3, ...} such that fi = 0 for all i ∈ {1, 2, 3, ...} \ D. Now consider the sequences g = (gi ) and h = (hi ) of elements of R with gi = 0 and hi = 1 for all i ∈ D and gi = 1 and hi = 0 for all i ∈ {1, 2, 3, ...} \ D. Clearly g ∈ AnnR (f ), h ∈ I and 1R = g + h. Thus, by Proposition 3.16, R/I is R−flat. Suppose R/I is R−projective. Then, by Lemma 3.1, there is a sequence e = (ei ) ∈ R such that I = Re. Thus there exists a finite subset E of {1, 2, 3, ...} such that ei = 0 for all i ∈ {1, 2, 3, ...} \ E. Clearly {1, 2, 3, ...} \ E 6= ∅. Pick some k ∈ {1, 2, 3, ...} \ E. There is some r = (ri ) ∈ R such that (δi,k )i≥1 = re where δi,k is the Kronecker delta. In particular, 1A = rk ek = rk 0A = 0A . This is a contradiction. Therefore R/I is not R−projective. References [1] Cox, S.H. and Pendleton, R.L. Rings for which certain flat modules are projective. Trans. Amer. Math. Soc. 150 (1970), 139-156. [2] Endo, S. On flat modules over commutative rings, J. Math. Soc. Japan 14 (3) (1962) 284-291. [3] Aise Johan de Jong et al. Stacks Project, see http://stacks.math.columbia.edu. [4] Jondrup, S. On finitely generated flat modules, Math. Scand. 26 (1972), 233240. [5] Olivier, Jean-Pierre. Anneaux absolument plats universels et épimorphismes à buts réduits, Séminaire Samuel. Algèbre commutative, tomme 2 (1967-1968). [6] Puninski, G. and Rothmaler, P. When every finitely generated flat module is projective, Journal of Algebra 277 (2004), 542-558. [7] Vasconcelos, W. On finitely generated flat modules, Trans. Amer. Math. Soc. 138 (1969), 505-512. [8] Wiegand, R. Golobalization theorems for locally finitely generated modules, Pacific Journal of Math. Vol. 39, No. 1, 1971. Department of Mathematics, Faculty of Basic Sciences, University of Maragheh, P. O. Box 55136-553, Maragheh, Iran. E-mail address: ebulfez1978@gmail.com
0math.AC
IntPhys: A Framework and Benchmark for Visual Intuitive Physics Reasoning Ronan Riochet Ecole Normale Superieure INRIA Mario Ynocente Castro ycmario@gmail.com arXiv:1803.07616v1 [cs.AI] 20 Mar 2018 ronan.riochet@inria.fr Mathieu Bernard Ecole Normale Superieure INRIA mathieu.a.bernard@inria.fr Adam Lerer Facebook AI Research Rob Fergus Facebook AI Research alerer@fb.com robfergus@fb.com Véronique Izard Université Paris Descartes CNRS veronique.izard@parisdescartes.fr Emmanuel Dupoux CoML, ENS/CNRS/EHESS/INRIA/PSL Research University emmanuel.dupoux@gmail.com Abstract to predict how they interact in the physical world. Experimental evidence shows that very young infants and many animals do have an intuitive grasp of how objects interact in the world, and that they exploit this ”intuitive physics” to make predictions about future outcomes and plan their actions [4]. At 2-4 months, infants are able to parse visual inputs in terms of permanent, solid and spatiotemporally continuous objects ([29], [65]). At 6 months, they understand the notion of stability, support and causality ([63], [6], [5]). Between 8 and 10 months, they grasp the notions of gravity, inertia, and conservation of momentum in collision; between 10 and 12 months, shape constancy [70], and so on. Such tacit knowledge is intuitive and nonverbal (as opposed to formal knowledge as taught in physics classes) and follows a developmental path parallel to early language acquisition. Both occur quickly, spontaneously, and without explicit training by caregivers [53]. In living organisms, intuitive physics is a latent construct: it can only be observed and measured indirectly through its effects on specific tasks like planning, problem solving, or in humans, verbal descriptions and explanations. It can also be revealed through the measurement of surprise reactions to ”magic tricks”, i.e., physically impossible events, such as objects disappearing or appearing out of nowhere, passing through each other, or defying gravity ([11] for a review). The latent nature of intuitive physics raises two difficult challenges for vision systems: an evaluation challenge and an engineering challenge. The evaluation challenge can be formulated as follows: given an artificial vision system, define a measure which quantifies how much this system understands about (intu- In order to reach human performance on complex visual tasks, artificial systems need to incorporate a significant amount of understanding of the world in terms of macroscopic objects, movements, forces, etc. Inspired by work on intuitive physics in infants, we propose an evaluation framework which diagnoses how much a given system understands about physics by testing whether it can tell apart well matched videos of possible versus impossible events. The test requires systems to compute a physical plausibility score over an entire video. It is free of bias and can test a range of specific physical reasoning skills. We then describe the first release of a benchmark dataset aimed at learning intuitive physics in an unsupervised way, using videos constructed with a game engine. We describe two Deep Neural Network baseline systems trained with a future frame prediction objective and tested on the possible versus impossible discrimination task. The analysis of their results compared to human data gives novel insights in the potentials and limitations of next frame prediction architectures. 1. Introduction Despite impressive progress in machine vision on many tasks (face recognition [68], object recognition [33], [26], object segmentation [52], etc.), artificial systems are still far from human-level understanding of complex scenes. Scene understanding involves not only segmenting and tracking of objects across time, but also representing the spatial and temporal relationships between these objects and being able 1 Figure 1: Popular end-to-end applications involving scene understanding and proposed evaluation method based on physical plausibility judgments. itive) physics. One possible answer would be to measure intuitive physics through real-worlds applications like Visual Question Answering (VQA), object tracking or action planning (see Figure 1). However, this runs into two risks: (a) dataset bias (b) noisy measure. The first risk (also known as the Clever Hans problem [28]), is that real life application datasets often contain inherent statistical biases, which make it sometimes possible to achieve good performance with only minimal involvement in solving the problem at hand. The second risk is that the overall performance of a system is a complicated function of the performance of its parts; therefore, if a VQA system has a better performance than another one, it could be, not because it better understands physics, but because it has a better language model. We propose a framework, which we call the ”physical plausibility test”, which directly evaluates intuitive physics in a task-free and model-free fashion. This framework is inspired by research on infant and animal intuitive physics. It recasts physical reasoning as a simple yes-no classification problem: presented with the video of a simple scene, the question is whether the depicted event is physically possible or not. The trick is in preparing matched sets of videos where the physical violation introduces minimal differences between the frames of possible vs impossible movies. By varying the nature of the physical violation, one can probe different types of reasoning (laws regarding objects and their properties, laws regarding objects movement and interactions, etc.). Given that our method involves videos of events that could not arise spontaneously in nature, it should be taken as a diagnostic test, and in no way as a practical method for training physical reasoning systems. Yet, it’s advantage is that it can be applied to a variety of systems that have been engineered or trained on some other task, so long as these systems have the minimal requirement to compute a global scalar number for a given scene, which we can interpret as a ’plausibility’ score. Any system based on probability or reconstruction error can easily derive such a score. The engineering challenge can be formulated as follows: construct a system which incorporates as much intuitive physics as possible (at least as much as infants have, for a start). We already discarded the use of impossible movies to train such a system on the grounds of practicality. Another approach using supervised learning with high level annotations (physical entities, laws or relations, etc.) would also be impractical. First, a system could have a good physical understanding of a scene without performing full 3D reconstruction. Second, as shown by infants, it is possible to learn intuitive physics without being fed with any high level tag or label. In fact, they only experience ’positive’ physical instances (physically possible events). Additionally, infants get useful feedback from their environment, as they become more competent at motor control, although such feedback only consists in possible events. One way to address the challenge would be therefore to construct an unsupervised or weakly supervised system that learns the laws of physics using the same type of data available to infants (i.e., abundant amount of observational sensory data, limited but informative environmental feedback, only positive instances). Here, we propose IntPhys, an intuitive physics benchmark which aims at getting a first stab at both the engineering and the evaluation challenges. It consists of synthetic videos constructed with a python interfaced game engine (UnrealEngine 4), enabling both realistic physics and precise control. The training set consists only of positive cases, i.e. possible movies, as seen from a first-person perspective by an immobile agent. This is probably a more difficult task than the one faced by infants, because they can explore and interact with their environment. It is however interesting to establish how far one can get with such simplified inputs, which are easy to gather in abundant amounts in the real world with video cameras. In addition, this enables an easier comparison of models, because they all get the same training data. The test set is constructed according to our evaluation framework, i.e., it requires the system to output a plausibility score, and is evaluated on its ability to separate possible from impossible movies. The test set can also be used as a standalone diagnostic evaluation of systems trained in other ways (real videos, interactive training in a virtual environment, etc., see [58, 27, 10]) The structure of this paper is as follows: in Section 2, we review related work in high level vision evaluation and models. In Section 3, we detail our intuitive physics evaluation framework. In Section 4, we present the first release of IntPhys Benchmark (V1.0) which addresses the most basic component of intuitive physics, namely object permanence. In Section 5, we present two baseline systems trained with a frame prediction cost on this dataset only, and analyze their results compared to human performance. 2. Related work Most of the previous work relevant for intuitive physics has been conducted in the context of particular end-to-end applications. We distinguish three broad classes of applications depending on the type of data they use. The first class includes tasks at the vision-language interface, where a model’s ability to reason about an image is assessed through a language task (e.g. generating a caption or answering a question about the image). The second class includes tasks which only use images or videos as input, such as predicting future events in a video or tracking objects through time. The third class involves vision-action interface, with applications in robotics. In that case, systems require vision reasoning to control actions and predict their outcome. 2.1. Vision-Language Interface Going beyond the standard object classification tasks [62, 33, 26], some of the more recent work in the visionlanguage interface have focused on classifying relations between objects [31, 28]. This requires in principle some understanding of the underlying physics (e.g. the distinction between hanging and supporting). Two tasks are currently receiving a lot of attention: captioning and VQA. Scene captioning ([14, 18, 42, 71]) consists in generating a sentence that describes an image, or matching an image with one or several captions. This task requires not only to recognize objects in an image, but also understand spatial relations and interactions between these objects. Visual Question Answering ([3, 23, 31, 43, 59, 72, 75]), requires to provide a verbal answer to a verbal question about an image; alternatively, one is only required to rank several potential answers. Like in image captioning, this task requires to understand spatial relations between objects, but in addition it has to understand the question and extract the right information to answer it. Some datasets ([66]) use videos as input, instead of static images. Because they go beyond a closed set of predefined outputs, these two tasks raise evaluation difficulties. As shown in [1] and [73], VQA systems can ”cheat” and obtain good performance by exploiting statistical biases in the images/questions dataset. For example, if the question ”What covers the ground?” is highly correlated with images of snow-covered ground, a statistical learner would perform well on that question by always answering snow, whatever the image. These biases make it harder to understand models’ weaknesses and strengths. In the CLEVR dataset [28], authors focus on testing visual reasoning ability while minimizing questionconditional biases. They provide ground-truth representations for both images and questions, as well as detailed annotations describing the kind of reasoning each question requires. In a similar spirit, we aim to propose a diagnostic tool for visual reasoning systems, providing systematically constructed tasks minimizing statistical biases. Our proposed task gets rid of language altogether and directly taps into understanding of objects and their interactions. 2.2. High level Vision Many research projects in vision define tasks which aim at recovering high level structure from low level (pixel) information. One example is the recovery of 3D structure from static or moving images ([12, 64, 69, 15, 60]). Two tasks have been proposed to tackle the temporal dynamics of objects in videos: object tracking and future prediction. Classic formulations of object tracking focus on matching instance labels through video frames. For a given video, it results in a collection of object instances, with their location at every time step. This is a well-studied problem with its own literature [51, 44, 55, 9] and challenges [32, 34]. Contrary to learning systems, hand-crafted tracking models use priors regarding objects motion, assuming for instance that objects have constant speed when they are occluded, or that their appearance only have small changes through time. 2.3. Intuitive Physics and Forward Modelling Prediction can be seen as a more general task than object tracking. Given an image, or a stack of images around time t, the task is to produce a predicted image some time in the future. Recent studies have investigated models for predicting the stability and forward modeling the dynamics of towers of blocks ([8, 35, 74, 39, 46, 40]). [8] proposes a model based on an intuitive physics engine, [35] and [39] follow a supervised approach using Convolutional Neural Networks (CNNs), [74] makes a comparison between simulation-based models and CNN-based models, [46] improves the predictions of a CNN model by providing it with a prediction of a generative model. In [45], authors propose different feature learning strategies (multi-scale architecture, adversarial training method, image gradient difference loss function) to predict future frames in raw videos. Even though next frame prediction tasks could be used to learned aspects of intuitive physics through observed regularities of object motion, current pixel-based forward models still struggle to predict outcomes beyond a few frames. Other models use more structured representation of objects to derive longer-term predictions. In [7] and [13], authors learn objects dynamics by modelling their pairwise interactions and predicting the resulting objects states representation (e.g. position / velocity / object intrinsic properties) . In [67], [21] and [17] authors combine factored latent object representations, object centric dynamic models and visual encoders. Each frame is parsed into a set of object state representations, which are used as input of a dynamic model. In [21] and [17], authors use a visual decoder to reconstruct the future frames, allowing the model to learn from raw (though synthetic) videos. 2.4. Vision-Action Interface Other studies have focused on vision-action interface, with potential applications in robotics. The main tasks are of two kinds: i) predicting the outcome of an action in a visual environment (forward modelling) and ii) predicting the optimal action to make in order to reach the desired outcome (action planning). Forward modelling has been studied in [19], where authors train a model to predict the outcome of interactions between a robot and an object. Conditioned with an input image, the state and the action of the robot, their model is trained to predict the resulting image after the action. In [20] they use this forward model to train the robot to execute a given action on an object. In [49], authors construct 10355 indoor scenes in a physics simulator and apply forces to various objects in these scenes. They train a deep neural network to predict effects of forces on objects, the ground truth being simulated by the physics simulator, using properties like mass, friction, gravity and solidity. In [48], they train a model to predict the dynamics of object from static images. Other studies focused on learning control from visual inputs. In [54] and [38], authors train deep neural networks to coordinate robotic vision and action, on the specific task of object grasping. Learning visual control policies with reinforcement learning has been investigated either in simulation ([41]) or in the real world [37]. Some systems use a prediction model in the purpose of action planning. In [50], authors train a model to predict future frames in videos, using these predictions to train a Q-controller for playing Atari games. Integrating a model of the dynamic of the external world to an agent was also done in [25], to plan novel actions by running multiple internal simulations. Finally, robots pushing (”poking”) objects was investigated in [2], where the model does not predict the image directly but rather a latent representation of it. This latent representation and the forward model are learned jointly with an inverse model that predicts how to move the object to a desired position, so that the latent representation has to keep information about object location. Being able to manipulate objects or predict dynamics in billiard game ([22]) seems to require notions like solidity, mass, collisions and causality. Even though the proposed framework for testing intuitive physics involves vision only, integrating vision and action during training may help to learn these notions. 3. A diagnostic test for intuitive physics As we just saw, there is a great diversity of systems and applications that rely in some way or other on physical understanding. We propose a single diagnostic test which can be run (provided minor modifications) on any of these systems (captioning and VQA systems, systems performing 3D reconstruction, tracking, planning, etc), be they engineered by hand or trained using statistical learning. The main idea is to draw from work in developmental or comparative psychology (infants or animals), to construct a well controlled test avoiding potential statistical biases and cheap tricks, and to obtain relatively pure tests measuring different types of physical reasoning abilities. Intuitive physics is best described at the latent body of knowledge which allow organisms to predict events and plan actions and, when applicable, describe them. This body of knowledge may be incomplete, not totally coherent, and not used in all situations due to variations in attention, memory etc. Here, we will take the view that it is a rudimentary version of Newtonian physics, in so far as it deals with solid macroscopic objects existing in a 3D world with their intrinsic properties (mass, shape, position, velocities, etc.). We illustrate our diagnostic test on object permanence, one of the most basic principle of intuitive physics which states that an object continue to exist even when not seen. We present the design features of our test: minimal sets, parametric task difficulty, and evaluation metric. We then show how this can be extended to a wide range of intuitive physics reasoning problems. 3.1. Minimal sets design An important design principle of our evaluation framework relates to the organization of the possible and impossible movies in extremely well matched sets to avoid the Clever Hans problem. This is illustrated in Figure 2 for object permanence. We constructed matched sets comprising four movies, which contain an initial scene at time t1 (either one or two objects), and a final scene at time t2 (either one or two objects), separated by a potential occlusion by a screen which is raised and then lowered for a variable amount of time. At its maximal height, the screen completely occludes the objects so that it is impossible to know in this frame how many objects are behind the occluder. The four movies are constructed by combining the two possible beginnings with the two possible endings, giving rise to two possible (1→1 and 2→2) and two impossible (1→2 and 2→1) movies. Importantly, across these 4 movies, the possible and impossible ones are made of the exact same frames, the only factor distinguishing them being the temporal coherence of these frames. Such a design is intended to make it difficult for algorithms to use cheap tricks to distinguish possible from impossible movies by focusing on low level details, but rather requires models to focus on higher level temporal dependencies between frames. 3.2. Parametric manipulation of task complexity Our second design principle is that in each block, we will vary the stimulus complexity in a parametric fashion. In the 3.4. A hierarchy of intuitive physics problems Figure 2: Illustration of the minimal sets design with object permanence. Schematic description of a static condition with one vs. two objects and one occluder. In the two possible movies (green arrows), the number of objects remains constant despite the occlusion. In the two impossible movies (red arrows), the number of objects changes (goes from 1 to 2 or from 2 to 1). case of the object permanence block, for instance, stimulus complexity can vary according to three dimensions. The first dimension is whether the change in number of objects occurs in plain view (visible) or hidden behind an occluder (occluded). A change in plain view is evidently easier to detect whereas a hidden change requires an element of short term memory in order to keep a trace of the object’s through time. The second dimension is the complexity of the object’s motion. Tracking an immobile object is easier than if the object has a complicated motion. The third dimension is the number of objects involved in the scene. This tests for the attentional capacity of the system as defined by the number of objects it can track simultaneously. Manipulating stimulus complexity is important to establish the limit of what a vision system can do, and where it will fail. For instance, humans are well known to fail when the number of objects to track simultaneously is greater than four ([56]). 3.3. The physical possibility metrics Our evaluation metrics depend on the system’s ability to compute a plausibility score P (x) given a movie x. Because the test movies are structured in N matched k-uplets (in Figure 2, k = 4) of positive and negative movies Si=1..N = {P os1i ..P oski , Imp1i ..Impki }, we derive two different metrics. The relative error rate LR computes a score within each set. It requires only that within a set, the positive movies are more plausible than the negative movies. 1 X P LR = 1 j P (P osji )<Pj P (Impji ) (1) N i The absolute error rate LA requires that globally, the score of the positive movies is greater than the score of the negative movies. It is computed as: LA = 1 − AU C({i, j; P (P osji )}, {i, j; P (Impji )}) (2) Where AU C is the Area Under the ROC Curve, which plots the true positive rate against the false positive rate at various threshold settings. We now explain how the design principles we presented above can be applied to study physical reasoning with progressively more complicated problems. Taking advantage of behavioral work on intuitive studies [4], we organize the tests into levels and blocks, each one corresponding to a core principle of intuitive physics, and each raising its particular machine vision challenge. Our typology of problems is presented in Table 1. It is organized in two levels: at the level 1, the problems only deal with properties and movement characteristics of single objects. At the level 2, the problems involve interactions between objects. In the first level, we define 5 blocks as follows. The first two are related to the conservation through time of intrinsic properties of objects. Object permanence (O1), already discussed, corresponds to the fact that objects continuously exist through time and do not pop in or out of existence. This turns into the computational challenge of tracking objects through occlusion. The second block, shape constancy (O2) describes the tendancy of rigid objects to preserve their shape through time. This principle is more challenging than the preceding one, because even rigid objects undergo a change in appearance due to other factors (illumination, distance, viewpoint, partial occlusion, etc.). The other three blocks (O3-5) relate to object’s movement through time, and the conservation laws which govern these movements for rigid inanimate macroscopic objects. These principles map into progressively more challenging problems of trajectory prediction. Regarding the interactions between objects (level 2), we also define 5 blocs, in increasing order of complexity. The first two test for very basic principles. Solidity (I1) states that two objects cannot occupy the same physical space. Causality (I2) states that object’s interactions can only occur through physical contact. This is of course not true for gravitational and electromagnetic forces, but still the principle of contact is deeply entrenched in human perception [36, 61]. Further, forces acting at a distance would have limited practical value for many applications, another reason to leave them for further extensions. The last three blocks (I3-5) correspond to modes of interactions between objects through contact (elastic collision, support and containment). All of these blocks raise difficult challenges for action planning, and some of them also for correctly describing a scene or an event using language (causality, support, containment). 4. The IntPhys Benchmark (V1.0) We present the first release of IntPhys, a benchmark designed to address both the engineering and evaluation challenges for intuitive physics in vision systems. This first release (V1.0) is focused on unsupervised learning, and tests only the first Block of our hierarchy of problems (O1, ob- Table 1: List of the conceptual blocks of the Intuitive Physics Framework. Block Name O1. Object permanence O2. Shape constancy O3. Spatio-temporal continuity O4. Energy / Momentum O5. Gravity I1. Solidity I2. Causality Physical principles Computational challenge Objects & objects attributes Objects don’t pop in and out of existence Occlusion-resistant object tracking Objects keep their shapes Appearance-robust object tracking Trajectories of objects are continuous Tracking/predicting object trajectories Constant kinetic energy and momentum Tracking/predicting object trajectories Downwards gravitational field Predicting objects trajectories Relations & Interactions Two objects cannot occupy the same space Predicting objects trajectories/planning Mechanical interactions require spatio- Planning/event description I3. Mass, elastic collisions temporal proximity Objects keep their mass; conservation of system’s momentum Planning I4. Support I5. Containment gravity + solidity (polygon of support) solidity + continuity Event prediction/planning/event description Solving the shell game/planning/event ject permanence). Future releases will include more of the blocks of Table 1. The benchmark consists of three components: (1) a training set containing only physically possible events involving simple inanimate objects moving and interacting in a virtual environment - (2) a dev and test set containing both physically possible and physically impossible videos, carefully matched in tuples as described above - (3) an evaluation software. We describe these three components, as well as the results of humans plausibility judgments on the test set, which can serve as a reference for algorithms modeling human perception. 4.1. The training set The training set has been constructed using Unreal Engine 4.0; it contains a large variety of objects interacting one with another, occluders, textures, etc. See Figure 3 for some examples. It is composed of 15K videos of possible events (around 7 seconds each at 15fps), totalling 21 hours of videos. Each video is delivered as stacks of raw image (288 x 288 pixels), totalling 157Gb of uncompressed data. We also release the source code for data generation, allowing users to generate a larger training set if desired. Even though the spirit of IntPhys is the unsupervised learning of intuitive physics, we do provide additional information which may help the learner. The first one is the depth field for each image. This is not unreasonable, given that in infants, stereo vision and motion cues could provide an approximation of this information. We also deliver object instance segmentation masks. Given that this information it is probably not available as such in infants, we provide it only in the training set, not in the test set, for pretraining purposes. Figure 3: Examples of frames from the training set. 4.2. The dev and test sets This section describes the dev and test sets for block O1 (object permanence). The design of these dev and test sets follow the general structure of matched sets described in section 3.2. As for parametric complexity, we vary the number of objects (1, 2 or 3), the presence and absence of occluder(s) and the complexity of the movement (static, dynamic 1 and dynamic 2). In the static case, the objects do not move; in the dynamic 1 case, they bounce or roll from left to right or right to left. In both these types of events, one occluder may be present on the scene, and objects may sometimes pop into existence (a 0→1 event), or disappear suddenly (1→0) - these impossible events occur behind the occluder when it is present, or in full view otherwise. In dynamic 2 events (illustrated in Supplementary Material, Figure 4), two occluders are present and the existence of objects may change twice. For example, one object may be present on the scene at first, then disappear after going behind the first occluder, later reappearing behind the sec- ond occluder (1→0→1). Dynamic 2 events were designed to prevent systems from detecting inconsistencies merely by comparing the number of objects visible at the beginning and at the end of the movie. Matched sets contain four videos: two possible events (0→0→0 and 1→1→1) and two impossible events (0→1→0 and 1→0→1). In total, the Block O1 test set contains 18 types of movies (3 objects, 2 occlusions and 3 types of movements). The dev set is instantiated by 20 different renderings of these 18 scenarios, objects positions, shapes, trajectories, resulting in 360 movies. The test set is instantiated by 200 different renderings of these scenarios (for a total of 3600 movies) and uses different objects, textures, motions, etc. All of the objects and textures of the dev and test sets are present in the training set. The purpose of the dev set released in IntPhys V1.0 is to help in the selection of an appropriate plausibility score, and in the comparison of various architectures (hyperparameters), but it should not serve to train the model’s parameters (this should be done only with the training set). This is why the dev set is kept intentionally small. The test set has more statistical power and enables a fine grained evaluation of the results across the different movie subtypes. 4.3. Evaluation software For each movie, the model should issue a scalar plausibility score. This number together with the movie ID is then fed to the evaluation software which outputs two tables of results, one for the absolute score and the other for the relative score. The evaluation software is provided for the dev set, but not the test set. For evaluating on the test set, participants are invited to submit their system and results (see www.intphys.com) and their results will be registered and time-stamped on the website leaderboard. 4.4. Human Judgments We presented the 3600 videos from the test set (Block O1) to human participants using Amazon Mechanical Turk. The experiment and human judgements results are detailed in Supplementary Section 8. 5. Baseline Systems In this section, we present two baseline systems which attempt to learn intuitive physics in an unsupervised setting, i.e., using only the possible movies of the training set. The two baselines consist in training deep neural networks with a future frame prediction objective. Based on the literature on next frame prediction, we propose two neural network models, predicting a future frame given a set of current frames. Our first model has a CNN encoder-decoder structure and the second is a conditional Generative Adversarial Network (GAN, [24]), with a similar structure as DCGAN ([57]). For both model architectures, we investigate two different training procedures: in the first, we train models to predict short-future images with a prediction span of 5 frames; in the second, we predict long-future images with a prediction span of 35 frames. Preliminary work with predictions at the pixel level revealed that our models failed at predicting convincing object motions, especially for small objects on a rich background. For this reason, we switched to computing predictions at a higher level, using object masks. We use the metadata provided in the benchmark training set to train a semantic mask Deep Neural Network (DNN). This DNN uses a resnet-18 pretrained on Imagenet to extract features from the image, from which a deconvolution network is trained to predict the semantic mask which only distinguished three types of entities: background, occluders and objects. We then use this mask as input to a prediction component which predicts future masks based on past ones. To evaluate these models on our benchmark, our system needs to output a plausibility score for each movie. For this, we compute the prediction loss along the movie. Given past frames, a plausibility score for the frame ft can be derived by comparing ft with the prediction fˆt . Like in [22], we use the analogy with an agent running an internal simulation (visual imagination); here we assimilate a greater distance between prediction and observation with a lower plausibility. In subsection 5.2 we detail how we aggregate the scores of all frames into a plausibility score for the whole video. 5.1. Models Through out the movie, our models take as input two frames (fi1 , fi2 ) and predict a future frame ftarget . The prediction span is independent from the model’s architecture and depends only on the triplets (fi1 , fi2 , ftarget ) provided during the training phase. Our two architectures are trained either on a short term prediction task (5 frames in the future), or a long term prediction task (35 frames). Intuitively, short-term prediction will be more robust, but long-term prediction will allow the model to grasp long-term dependencies and deal with long occlusions. CNN encoder-decoder We use a resnet-18 ([26]) pretrained on Imagenet ([62]) to extract features from input frames (fi1 , fi2 ). A deconvolution network is trained to predict the semantic mask of future frame ftarget conditioned to these features, using a L2 loss. Generative Adversarial Network As a second baseline, we propose a conditional generative adversarial network (GAN, [47]) that takes as input predicted semantic masks from frames (fi1 , fi2 ), and predicts the semantic mask of future frame ftarget . In this setup, the discriminator has to distinguish between a mask predicted from ftarget directly (real), and a mask predicted from past frames (fi1 , fi2 ). Like in [16], our model combines a conditional approach with a similar structure as of DCGAN [57]. At test time, we derive a plausibility score by computing the conditioned discriminator’s score for every conditioned frame. This is a novel approach based on the observation that the optimal discriminator D computes a score for x of Pdata (x) (3) D(x) = PG (x) + Pdata (x) For non-physical events x̂, Pdata (x̂) = 0; therefore, as long as PG (x̂) > 0, D(x̂) should be 0 for non-physical events, and D(x) > 0 for physical events x. Note that this is a strong assumption, as there is no guarantee that the generator will ever have support at the part of the distribution corresponding to impossible videos. All our models’ architectures, as well as training procedures and samples of predicted semantic masks can be found in Supplementary Material (Tables 3, 4, 5, 6 and Figure 6). The code will be made available. 5.2. Video Plausibility Score From forward models presented above, we can compute a plausibility score for every frame ftarget , conditioned to previous frames (fi1 , fi2 ). However, because the temporal positions of impossible events are not given, we must decide of a score for a video, given the scores of all its conditioned frames. An impossible event can be characterized by the presence of one or more impossible frame(s), conditioned to previous frames. Hence, a natural approach to compute a video plausibility score is to take the minimum of all conditioned frames’ scores: Plaus(v) = min (fi1 ,fi2 ,ftarget )∈v Plaus(ftarget |fi1 , fi2 ) (4) where v is the video, and (fi1 , fi2 , ftarget ) are all the frame triplets in v, as given in the training phase. 5.3. Results Short-term prediction The first training procedure is a short-term prediction task; it takes as input frames ft−2 , ft and predicts ft+5 , which we note (ft−2 , ft ) → ft+5 in the following. We train the two architectures presented above on short-term prediction task and evaluate them on the test set. For the relative classification task, CNN encoderdecoder has an error rate of 0.10 when impossible events are visible and 0.53 when they are occluded. The GAN has an error rate of 0.12 when visible and 0.48 when occluded. For the absolute classification task, CNN encoder-decoder has a LA (see eq. 2) of 0.31 when impossible events are visible and 0.50 when they are occluded. The GAN has a LA of 0.27 when visible and 0.51 when occluded. Results are detailed in Supplementary Material (Tables 7, 8, 9, 10). We observe that our short-term prediction models show good performances when the impossible events are visible, especially on the relative classifications task. However they perform poorly when the impossible events are occluded. This is easily explained by the fact that they have a prediction span of 5 frames, which is usually lower than the occlusion time. Hence, these models don’t have enough ”memory” to catch occluded impossible events. Long-term prediction The second training procedure consists in a long-term prediction task: (ft−5 , ft ) → ft+35 . For the relative classification task, CNN encoder-decoder has an error rate of 0.19 when impossible events are visible and 0.49 when they are occluded. The GAN has an error rate of 0.20 when visible and 0.43 when occluded. For the absolute classification task, CNN encoder-decoder has a LA of 0.43 when impossible events are visible and 0.50 when they are occluded. The GAN has a LA of 0.33 when visible and 0.50 when occluded. Results are detailed in Supplementary Material (Tables 11, 12, 13, 14). As expected, long-term models perform better than shortterm models on occluded impossible events. Moreover, results on absolute classification task confirm that it is way more challenging than the relative classification task. Because some movies are more complex than others, the average score of each quadruplet of movies may vary a lot. It results in cases where one model returns a higher plausibility score to an impossible movie M{imp, easy} from an easy quadruplet than to a possible movie M{pos, complex} from a complex quadruplet. Aggregated model To grasp short and long-term dependencies, we aggregate the scores of short-term and longterm models: Pagg (v) = (Pshort-term (v) + Plong-term (v))/2. For the relative classification task, CNN encoder-decoder has an error rate of 0.14 when impossible events are visible and 0.51 when they are occluded. The GAN has an error rate of 0.12 when visible and 0.51 when occluded. For the absolute classification task, CNN encoder-decoder has a LA of 0.35 when impossible events are visible and 50 when they are occluded. The GAN has a LA of 0.27 when visible and 0.51 when occluded. Results are detailed in Supplementary Material (Tables 15, 16, 17, 18, Figure 10). 6. Discussion We defined a general framework for measuring intuitive physics in artificial systems inspired by research on conceptual development in infants. In this framework, a system is asked to return a plausibility score for a video sequence showing physical interaction between objects. The system’s performance is assessed by measuring its ability to discriminate possible from impossible videos illustrating several types of physical principles. In addition we present IntPhys: a benchmark designed to test for the unsupervised learning of intuitive physics (learning from positive examples only). On the first release of this benchmark (V1.0), dedicated to object permanence, we provide both human performance and proof of principle baseline systems. Humans show a generally good performance, although some attentional limitations start to appear when using occlusion and several objects to track simultaneously. The computational system shows that it is possible to obtain above chance performance using a mask prediction task, although occlusion presents a particularly strong challenge. The relative success of the mask prediction system compared to what can be expected from pixel-based systems indicates that operating at a more abstract level is a worth pursuing strategy. As new blocks of the Benchmark are released (see Table 1), the prediction task will become more and more difficult and progressively reach the level of scene comprehension achieved by one-year-old humans. References [1] A. Agrawal, D. Batra, and D. Parikh. Analyzing the behavior of visual question answering models. arXiv preprint arXiv:1606.07356, 2016. 3 [2] P. Agrawal, A. Nair, P. Abbeel, J. Malik, and S. Levine. Learning to poke by poking: Experiential learning of intuitive physics. CoRR, abs/1606.07419, 2016. 4 [3] S. Antol, A. Agrawal, J. Lu, M. Mitchell, D. Batra, C. Lawrence Zitnick, and D. Parikh. Vqa: Visual question answering. In Proceedings of the IEEE International Conference on Computer Vision, pages 2425–2433, 2015. 3 [4] R. Baillargeon and S. Carey. Core cognition and beyond. In S. Pauen, editor, Early childhood development and later outcome, chapter 3, pages 33–65. Cambridge University Press, New York, 2012. 1, 5 [5] R. Baillargeon and S. Hanko-Summers. Is the top object adequately supported by the bottom object? young infants’ understanding of support relations. Cognitive Development, 5(1):29–53, 1990. 1 [6] R. Baillargeon, A. Needham, and J. DeVos. The development of young infants’ intuitions about support. Infant and Child Development, 1(2):69–78, 1992. 1 [7] P. Battaglia, R. Pascanu, M. Lai, D. Jimenez Rezende, and k. kavukcuoglu. Interaction networks for learning about objects, relations and physics. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 4502– 4510. Curran Associates, Inc., 2016. 3 [8] P. W. Battaglia, J. B. Hamrick, and J. B. Tenenbaum. Simulation as an engine of physical scene understanding. Proceedings of the National Academy of Sciences of the United States of America, 110(45), 2013. 3 [9] L. Bertinetto, J. Valmadre, J. F. Henriques, A. Vedaldi, and P. H. Torr. Fully-convolutional siamese networks for object tracking. In European Conference on Computer Vision, pages 850–865. Springer, 2016. 3 [10] G. Brockman, V. Cheung, L. Pettersson, J. Schneider, J. Schulman, J. Tang, and W. Zaremba. Openai gym. CoRR, abs/1606.01540, 2016. 2 [11] S. Carey. The origin of concepts. Oxford series in cognitive development. Oxford University Press, Oxford ; New York, 2009. 1 [12] A. X. Chang, T. Funkhouser, L. Guibas, P. Hanrahan, Q. Huang, Z. Li, S. Savarese, M. Savva, S. Song, H. Su, et al. Shapenet: An information-rich 3d model repository. arXiv preprint arXiv:1512.03012, 2015. 3 [13] M. B. Chang, T. Ullman, A. Torralba, and J. B. Tenenbaum. A compositional object-based approach to learning physical dynamics. arXiv preprint arXiv:1612.00341, 2016. 3 [14] J. Chen, P. Kuznetsova, D. Warren, and Y. Choi. Déjà imagecaptions: A corpus of expressive descriptions in repetition. In HLT-NAACL, pages 504–514, 2015. 3 [15] C. B. Choy, D. Xu, J. Gwak, K. Chen, and S. Savarese. 3dr2n2: A unified approach for single and multi-view 3d object reconstruction. arXiv preprint arXiv:1604.00449, 2016. 3 [16] E. L. Denton, S. Gross, and R. Fergus. Semi-supervised learning with context-conditional generative adversarial networks. CoRR, abs/1611.06430, 2016. 8 [17] S. Ehrhardt, A. Monszpart, N. J. Mitra, and A. Vedaldi. Learning a physical long-term predictor. arXiv preprint arXiv:1703.00247, 2017. 3 [18] A. Farhadi, M. Hejrati, M. Sadeghi, P. Young, C. Rashtchian, J. Hockenmaier, and D. Forsyth. Every picture tells a story: Generating sentences from images. Computer vision–ECCV 2010, pages 15–29, 2010. 3 [19] C. Finn, I. Goodfellow, and S. Levine. Unsupervised learning for physical interaction through video prediction. In Advances in Neural Information Processing Systems, pages 64– 72, 2016. 4 [20] C. Finn and S. Levine. Deep visual foresight for planning robot motion. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pages 2786–2793. IEEE, 2017. 4 [21] M. Fraccaro, S. Kamronn, U. Paquet, and O. Winther. A disentangled recognition and nonlinear dynamics model for unsupervised learning. Advances in Neural Information Processing Systems 30, NIPS, 2017. 3 [22] K. Fragkiadaki, P. Agrawal, S. Levine, and J. Malik. Learning visual predictive models of physics for playing billiards. ICLR, 2016. 4, 7 [23] H. Gao, J. Mao, J. Zhou, Z. Huang, L. Wang, and W. Xu. Are you talking to a machine? dataset and methods for multilingual image question. In Advances in Neural Information Processing Systems, pages 2296–2304, 2015. 3 [24] 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, pages 2672–2680, 2014. 7 [25] J. B. Hamrick, R. Pascanu, O. Vinyals, A. Ballard, N. Heess, and P. Battaglia. Imagination-based decision making with physical models in deep neural networks. 4 [26] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Con- [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] ference on Computer Vision and Pattern Recognition, pages 770–778, 2016. 1, 3, 7 Y. Jiang, J. Liu, A. R. Zamir, G. Toderici, I. Laptev, M. Shah, and R. Sukthankar. Thumos challenge: Action recognition with a large number of classes, 2014. 2 J. Johnson, B. Hariharan, L. van der Maaten, L. Fei-Fei, C. L. Zitnick, and R. Girshick. Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. arXiv preprint arXiv:1612.06890, 2016. 2, 3 P. J. Kellman and E. S. Spelke. Perception of partly occluded objects in infancy. Cognitive psychology, 15(4):483–524, 1983. 1 D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. 12 R. Krishna, Y. Zhu, O. Groth, J. Johnson, K. Hata, J. Kravitz, S. Chen, Y. Kalantidis, L.-J. Li, D. A. Shamma, et al. Visual genome: Connecting language and vision using crowdsourced dense image annotations. International Journal of Computer Vision, 123(1):32–73, 2017. 3 M. Kristan, A. Leonardis, J. Matas, M. Felsberg, R. Pflugfelder, L. Čehovin, T. Vojir, G. Häger, A. Lukežič, and G. Fernandez. The visual object tracking vot2016 challenge results. Springer, Oct 2016. 3 A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In F. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 25, pages 1097–1105. Curran Associates, Inc., 2012. 1, 3 L. Leal-Taixé, A. Milan, I. Reid, S. Roth, and K. Schindler. MOTChallenge 2015: Towards a benchmark for multitarget tracking. arXiv:1504.01942 [cs], Apr. 2015. arXiv: 1504.01942. 3 A. Lerer, S. Gross, and R. Fergus. Learning physical intuition of block towers by example. International Conference on Machine Learning (ICML), 2016. 3 A. M. Leslie and S. Keeble. Do six-month-old infants perceive causality? Cognition, 25(3):265–288, 1987. 5 S. Levine, C. Finn, T. Darrell, and P. Abbeel. End-to-end training of deep visuomotor policies. Journal of Machine Learning Research, 17(39):1–40, 2016. 4 S. Levine, P. Pastor, A. Krizhevsky, J. Ibarz, and D. Quillen. Learning hand-eye coordination for robotic grasping with deep learning and large-scale data collection. The International Journal of Robotics Research, page 0278364917710318, 2016. 4 W. Li, A. Leonardis, and M. Fritz. To fall or not to fall: A visual approach to physical stability prediction. arXiv preprint, 2016. 3 W. Li, A. Leonardis, and M. Fritz. Visual stability prediction and its application to manipulation. arXiv preprint arXiv:1609.04861, 2016. 3 T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015. 4 T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. L. Zitnick. Microsoft coco: Com- [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] mon objects in context. In European Conference on Computer Vision, pages 740–755. Springer, 2014. 3 M. Malinowski and M. Fritz. A multi-world approach to question answering about real-world scenes based on uncertain input. In Advances in Neural Information Processing Systems, pages 1682–1690, 2014. 3 V. Manohar, P. Soundararajan, H. Raju, D. Goldgof, R. Kasturi, and J. Garofolo. Performance Evaluation of Object Detection and Tracking in Video, pages 151–161. Springer Berlin Heidelberg, Berlin, Heidelberg, 2006. 3 M. Mathieu, C. Couprie, and Y. LeCun. Deep multi-scale video prediction beyond mean square error. arXiv preprint arXiv:1511.05440, 2015. 3 M. Mirza, A. Courville, and Y. Bengio. Generalizable features from unsupervised learning. ICLR Workshop submission, 2017. 3 M. Mirza and S. Osindero. Conditional generative adversarial nets. CoRR, abs/1411.1784, 2014. 7 R. Mottaghi, H. Bagherinezhad, M. Rastegari, and A. Farhadi. Newtonian scene understanding: Unfolding the dynamics of objects in static images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3521–3529, 2016. 4 R. Mottaghi, M. Rastegari, A. Gupta, and A. Farhadi. ”what happens if...” learning to predict the effect of forces in images. ECCV, 2016. 4 J. Oh, X. Guo, H. Lee, R. L. Lewis, and S. Singh. Actionconditional video prediction using deep networks in atari games. In Advances in Neural Information Processing Systems, pages 2863–2871, 2015. 4 V. Papadourakis and A. Argyros. Multiple objects tracking in the presence of long-term occlusions. Computer Vision and Image Understanding, 114(7):835–846, 2010. 3 P. O. Pinheiro, R. Collobert, and P. Dollar. Learning to segment object candidates. In Advances in Neural Information Processing Systems, pages 1990–1998, 2015. 1 S. Pinker. The language instinct. Harper, 1994. 1 L. Pinto and A. Gupta. Supersizing self-supervision: Learning to grasp from 50k tries and 700 robot hours. In Robotics and Automation (ICRA), 2016 IEEE International Conference on, pages 3406–3413. IEEE, 2016. 4 H. Pirsiavash, D. Ramanan, and C. C. Fowlkes. Globallyoptimal greedy algorithms for tracking a variable number of objects. In Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on, pages 1201–1208. IEEE, 2011. 3 Z. W. Pylyshyn and R. W. Storm. Tracking multiple independent targets: Evidence for a parallel tracking mechanism. Spatial vision, 3(3):179–197, 1988. 5 A. Radford, L. Metz, and S. Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. CoRR, abs/1511.06434, 2015. 7, 8, 12 E. Real, J. Shlens, S. Mazzocchi, X. Pan, and V. Vanhoucke. Youtube-boundingboxes: A large high-precision human-annotated data set for object detection in video. arXiv preprint arXiv:1702.00824, 2017. 2 [59] M. Ren, R. Kiros, and R. Zemel. Exploring models and data for image question answering. In Advances in Neural Information Processing Systems, pages 2953–2961, 2015. 3 [60] D. J. Rezende, S. A. Eslami, S. Mohamed, P. Battaglia, M. Jaderberg, and N. Heess. Unsupervised learning of 3d structure from images. In Advances in Neural Information Processing Systems, pages 4996–5004, 2016. 3 [61] M. Rolfs, M. Dambacher, and P. Cavanagh. Visual adaptation of the perception of causality. Current Biology, 23(3):250–254, 2013. 5 [62] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211–252, 2015. 3, 7 [63] R. Saxe and S. Carey. The perception of causality in infancy. Acta psychologica, 123(1):144–165, 2006. 1 [64] A. Saxena, M. Sun, and A. Y. Ng. Make3d: Learning 3d scene structure from a single still image. IEEE transactions on pattern analysis and machine intelligence, 31(5):824– 840, 2009. 3 [65] E. S. Spelke, R. Kestenbaum, D. J. Simons, and D. Wein. Spatiotemporal continuity, smoothness of motion and object identity in infancy. British Journal of Developmental Psychology, 13(2):113–142, 1995. 1 [66] M. Tapaswi, Y. Zhu, R. Stiefelhagen, A. Torralba, R. Urtasun, and S. Fidler. Movieqa: Understanding stories in movies through question-answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4631–4640, 2016. 3 [67] N. Watters, A. Tacchetti, T. Weber, R. Pascanu, P. Battaglia, and D. Zoran. Visual Interaction Networks. ArXiv e-prints, June 2017. 3 [68] J. Wright, A. Y. Yang, A. Ganesh, S. S. Sastry, and Y. Ma. Robust face recognition via sparse representation. IEEE transactions on pattern analysis and machine intelligence, 31(2):210–227, 2009. 1 [69] Z. Wu, S. Song, A. Khosla, F. Yu, L. Zhang, X. Tang, and J. Xiao. 3d shapenets: A deep representation for volumetric shapes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1912–1920, 2015. 3 [70] F. Xu and S. Carey. Infants metaphysics: The case of numerical identity. Cognitive psychology, 30(2):111–153, 1996. 1 [71] P. Young, A. Lai, M. Hodosh, and J. Hockenmaier. From image descriptions to visual denotations: New similarity metrics for semantic inference over event descriptions. Transactions of the Association for Computational Linguistics, 2:67– 78, 2014. 3 [72] L. Yu, E. Park, A. C. Berg, and T. L. Berg. Visual madlibs: Fill in the blank description generation and question answering. In Proceedings of the IEEE International Conference on Computer Vision, pages 2461–2469, 2015. 3 [73] P. Zhang, Y. Goyal, D. Summers-Stay, D. Batra, and D. Parikh. Yin and yang: Balancing and answering binary visual questions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5014– 5022, 2016. 3 [74] R. Zhang, J. Wu, C. Zhang, W. T. Freeman, and J. B. Tenenbaum. A comparative evaluation of approximate probabilistic simulation and deep neural networks as accounts of human physical scene understanding. CogSci, 2016. 3 [75] C. L. Zitnick and D. Parikh. Bringing semantics into focus using visual abstraction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3009–3016, 2013. 3 Supplementary Material 7. Framework details ties was reversed, presumably because participants started using heuristics, such as checking that the number of objects at the beginning is the same as at the end, and therefore missed the intermediate disappearance of an object. These results suggest that human participants are not responding according to the gold standard laws of physics due to limitations in attentional capacity - and this, even though the number of objects to track is below the theoretical limit of 4 objects. The performance of human observers can thus serve as a reference besides ground truth, especially for systems intended to model human perception. 9. Models and training procedure Figure 4: Illustration of the ’dynamic 2’ condition. In the two possible movies (green arrows), the number of objects remains constant despite the occlusion. In the two impossible movies (red arrows), the number of objects changes temporarily (goes from 0 to 1 to 0 or from 1 to 0 to 1). 9.1. Detailed models See Tables 3, 4, 5, 6 for models’ architectures, and Figure 6 for samples of predicted semantic masks. The code will be made available on https://github.com/ rronan/IntPhys-Baselines 9.2. Training Procedure 8. Human Judgement - Experiment We presented the 3600 videos from the test set (Block O1) to human participants using Amazon Mechanical Turk. Participants were first presented 8 examples of possible scenes from the training set, some simple, some more complex. They were told that some of the test movies were incorrect or corrupted, in that they showed events that could not possibly take place in the real world (without specifying how). Participants were each presented with 40 randomly selected videos, and labeled them as POSSIBLE or IMPOSSIBLE. They completed the task in about 7 minutes, and were paid $1. A response was counted as an error when a possible movie was classified as impossible or vice versa. A total of 346 persons participated, but for 99 of them the data were discarded because they failed to respond 100% correctly to the easiest condition, i.e., static, one object, visible. A mock sample of the AMT test is available in http://129.199.81.135/naive physics experiment. The average error rates were computed across condition, number of objects and visibility for each remaining participant and are shown in Table 2. The overall error rate was rather low (16.5%), but, in general, observers missed violations more often when the scene was occluded. There was an increase in error going from static to dynamic 1 and from dynamic 1 to dynamic 2, but this pattern was only consistently observed in the occluded condition. For visible scenario, the dynamic 1 appeared more difficult than the dynamic 2. This was probably due to the fact that when objects are visible, the dynamic 2 impossible scenarios contain two local discontinuities and are therefore easier to spot than when one discontinuity only is present. When the discontinuities occurred behind the occluder, the pattern of difficul- We separate 10% of the training dataset to control the overfitting of our forward predictions. All our models are trained using Adam [30]. For the CNN encoder-decoder we use Adam’s default parameters and stop the training after one epoch. For the GAN, we use the same parameters as in [57]: we set the generator’s learning rate to 8e − 4 and discriminator’s learning rate to 2e − 4. On the short-term prediction task, we train the GAN for 1 epoch; on the longterm prediction task we train it for 5 epochs. Learning rate decays are set to 0 and beta1 is set to 0.5 for both generator and discriminator. 10. Detailed baseline results Table 2: Average error rate on plausibility judgments collected in humans using MTurk for the IntPhys(Block O1) test set. * this datapoint has been ”forced” to be zero by our inclusion criterion. Visible Occluded Type of scene 1 obj. 2 obj. 3 obj. Avg. 1 obj. 2 obj. 3 obj. Avg. Static Dynamic (1 violation) Dynamic (2 violations) 0.00* 0.13 0.08 0.09 0.08 0.05 0.07 0.11 0.09 0.06 0.11 0.07 0.22 0.24 0.26 0.20 0.21 0.26 0.20 0.26 0.37 0.21 0.24 0.29 Avg. 0.07 0.07 0.09 0.08 0.24 0.22 0.28 0.25 Figure 5: Results of our baselines in cases where the impossible event occurs in the open (visible) or behind an occluder (occluded). Y-axis represents the losses LR (see Equation 1) for the relative performance and LA (see Equation 2) for the absolute performance. Table 3: Mask predictor (9747011 parameters). BN stands for batch-normalization. Input frame 3 x 64 x 64 7 first layers of resnet-18 (pretrained, frozen weights) Reshape 1 x 8192 FC 8192 → 128 FC 128 → 8192 Reshape 128 x 8 x 8 UpSamplingNearest(2), 3 x 3 Conv. 128 - 1 str., BN, ReLU UpSamplingNearest(2), 3 x 3 Conv. 64 - 1 str., BN, ReLU UpSamplingNearest(2), 3 x 3 Conv. 3 - 1 str., BN, ReLU 3 sigmoid Target mask Table 4: CNN for forward prediction (13941315 parameters). BN stands for batch-normalization. Input frames 2 x 3 x 64 x 64 7 first layers of resnet-18 (pretrained, frozen weights) applied to each frame Reshape 1 x 16384 FC 16384 → 512 FC 512 → 8192 Reshape 128 x 8 x 8 UpSamplingNearest(2), 3 x 3 Conv. 128 - 1 str., BN, ReLU UpSamplingNearest(2), 3 x 3 Conv. 64 - 1 str., BN, ReLU UpSamplingNearest(2), 3 x 3 Conv. 3 - 1 str., BN, ReLU 3 sigmoid Target mask Table 5: Generator G (14729347 parameters). SFConv stands for spatial full convolution and BN stands for batchnormalization. Input masks 2 x 3 x 64 x 64 4 x 4 conv 64 - 2 str., BN, ReLU 4 x 4 conv 128 - 2 str., BN, ReLU Noise ∈ R100 4 x 4 conv 256 - 2 str., BN, ReLU ∼ Unif(−1, 1) 4 x 4 conv 512 - 2 str., BN, ReLU 4 x 4 conv 512, BN, ReLU stack input and noise 4 x 4 SFConv. 512 - 2 str., BN, ReLU 4 x 4 SFConv. 256 - 2 str., BN, ReLU 4 x 4 SFConv. 128 - 2 str., BN, ReLU 4 x 4 SFConv. 64 - 2 str., BN, ReLU 4 x 4 SFConv. 3 - 2 str., BN, ReLU 3 sigmoid Target mask Table 6: Discriminator D (7629698 parameters). BN stands for batch-normalization. history input 2 x 3 x 64 x 64 3 x 64 x 64 Reshape 3 x 3 x 64 x 64 4 x 4 convolution 512 - 2 strides, BN, LeakyReLU 4 x 4 convolution 254 - 2 strides, BN, LeakyReLU 4 x 4 convolution 128 - 2 strides, BN, LeakyReLU 4 x 4 convolution 64 - 2 strides, BN, LeakyReLU 4 x 4 convolution 5 - 2 strides, BN, LeakyReLU fully-connected layer 1 sigmoid Figure 6: Output examples of our semantic mask predictor. From left to right: input image, ground truth semantic mask, predicted semantic mask. Table 7: Detailed relative classification scores for the CNN encoder-decoder with prediction span of 5. Visible Occluded Type of scene 1 obj. 2 obj. 3 obj. Total 1 obj. 2 obj. 3 obj. Total Static Dynamic (1 violation) Dynamic (2 violations) 0.04 0.00 0.00 0.04 0.20 0.04 0.00 0.44 0.16 0.03 0.21 0.07 0.44 0.56 0.60 0.48 0.48 0.48 0.72 0.44 0.56 0.55 0.49 0.55 Total 0.01 0.09 0.20 0.10 0.53 0.48 0.57 0.53 Table 8: Detailed absolute classification scores for the CNN encoder-decoder with prediction span of 5. Visible Occluded Type of scene 1 obj. 2 obj. 3 obj. Total 1 obj. 2 obj. 3 obj. Total Static Dynamic (1 violation) Dynamic (2 violations) 0.16 0.33 0.33 0.12 0.40 0.39 0.11 0.49 0.46 0.13 0.41 0.40 0.50 0.50 0.50 0.50 0.50 0.50 0.50 0.50 0.49 0.50 0.50 0.50 Total 0.27 0.30 0.36 0.31 0.50 0.50 0.50 0.50 Table 9: Detailed relative classification scores for the GAN with prediction span of 5. Visible Occluded Type of scene 1 obj. 2 obj. 3 obj. Total 1 obj. 2 obj. 3 obj. Total Static Dynamic (1 violation) Dynamic (2 violations) 0.00 0.00 0.00 0.08 0.16 0.20 0.00 0.36 0.28 0.03 0.17 0.16 0.44 0.40 0.44 0.60 0.52 0.44 0.40 0.52 0.52 0.48 0.48 0.47 Total 0.00 0.15 0.21 0.12 0.43 0.52 0.48 0.48 Table 10: Detailed absolute classification scores for the GAN with prediction span of 5. Visible Occluded Type of scene 1 obj. 2 obj. 3 obj. Total 1 obj. 2 obj. 3 obj. Total Static Dynamic (1 violation) Dynamic (2 violations) 0.05 0.30 0.22 0.13 0.42 0.39 0.09 0.45 0.42 0.09 0.39 0.34 0.50 0.50 0.50 0.52 0.52 0.50 0.52 0.47 0.51 0.52 0.50 0.50 Total 0.19 0.31 0.32 0.27 0.50 0.52 0.50 0.51 Table 11: Detailed relative classification scores for the CNN encoder-decoder with prediction span of 35. Visible Occluded Type of scene 1 obj. 2 obj. 3 obj. Total 1 obj. 2 obj. 3 obj. Total Static Dynamic (1 violation) Dynamic (2 violations) 0.04 0.00 0.00 0.16 0.36 0.40 0.00 0.28 0.44 0.07 0.21 0.28 0.60 0.44 0.40 0.48 0.40 0.56 0.60 0.52 0.40 0.56 0.45 0.45 Total 0.01 0.31 0.24 0.19 0.48 0.48 0.51 0.49 Table 12: Detailed absolute classification scores for the CNN encoder-decoder with prediction span of 35. Visible Occluded Type of scene 1 obj. 2 obj. 3 obj. Total 1 obj. 2 obj. 3 obj. Total Static Dynamic (1 violation) Dynamic (2 violations) 0.31 0.39 0.40 0.40 0.48 0.48 0.37 0.48 0.50 0.36 0.45 0.46 0.51 0.50 0.50 0.50 0.50 0.49 0.48 0.50 0.50 0.50 0.50 0.50 Total 0.37 0.46 0.45 0.43 0.50 0.50 0.50 0.50 Table 13: Detailed relative classification scores for the GAN with prediction span of 35. Visible Occluded Type of scene 1 obj. 2 obj. 3 obj. Total 1 obj. 2 obj. 3 obj. Total Static Dynamic (1 violation) Dynamic (2 violations) 0.00 0.00 0.00 0.12 0.36 0.44 0.00 0.48 0.40 0.04 0.28 0.28 0.48 0.36 0.24 0.48 0.36 0.52 0.60 0.44 0.36 0.52 0.39 0.37 Total 0.00 0.31 0.29 0.20 0.36 0.45 0.47 0.43 Table 14: Detailed absolute classification scores for the GAN with prediction span of 35. Visible Occluded Type of scene 1 obj. 2 obj. 3 obj. Total 1 obj. 2 obj. 3 obj. Total Static Dynamic (1 violation) Dynamic (2 violations) 0.07 0.31 0.37 0.23 0.43 0.48 0.18 0.45 0.47 0.16 0.40 0.44 0.50 0.47 0.49 0.50 0.49 0.49 0.52 0.50 0.49 0.51 0.49 0.49 Total 0.25 0.38 0.37 0.33 0.49 0.50 0.50 0.50 Table 15: Detailed relative classification scores for the aggregation of CNN models with prediction spans of 5 and 35. Visible Occluded Type of scene 1 obj. 2 obj. 3 obj. Total 1 obj. 2 obj. 3 obj. Total Static Dynamic (1 violation) Dynamic (2 violations) 0.00 0.00 0.00 0.04 0.20 0.32 0.00 0.44 0.24 0.01 0.21 0.19 0.64 0.52 0.48 0.48 0.52 0.44 0.60 0.36 0.52 0.57 0.47 0.48 Total 0.00 0.19 0.23 0.14 0.55 0.48 0.49 0.51 Table 16: Detailed absolute classification scores for the aggregation of CNN models with prediction spans of 5 and 35. Visible Occluded Type of scene 1 obj. 2 obj. 3 obj. Total 1 obj. 2 obj. 3 obj. Total Static Dynamic (1 violation) Dynamic (2 violations) 0.18 0.35 0.38 0.20 0.44 0.43 0.16 0.49 0.47 0.18 0.43 0.43 0.51 0.50 0.50 0.50 0.50 0.49 0.49 0.50 0.50 0.50 0.50 0.50 Total 0.30 0.36 0.37 0.35 0.50 0.50 0.49 0.50 Table 17: Detailed relative classification scores for the aggregation of GAN models with prediction spans of 5 and 35. Visible Occluded Type of scene 1 obj. 2 obj. 3 obj. Total 1 obj. 2 obj. 3 obj. Total Static Dynamic (1 violation) Dynamic (2 violations) 0.00 0.00 0.00 0.12 0.16 0.20 0.00 0.32 0.28 0.04 0.16 0.16 0.52 0.48 0.44 0.60 0.52 0.44 0.48 0.56 0.52 0.53 0.52 0.47 Total 0.00 0.16 0.20 0.12 0.48 0.52 0.52 0.51 Table 18: Detailed absolute classification scores for the aggregation of GAN models with prediction spans of 5 and 35. Visible Occluded Type of scene 1 obj. 2 obj. 3 obj. Total 1 obj. 2 obj. 3 obj. Total Static Dynamic (1 violation) Dynamic (2 violations) 0.01 0.30 0.22 0.17 0.42 0.39 0.07 0.44 0.42 0.08 0.39 0.34 0.51 0.50 0.50 0.52 0.52 0.51 0.52 0.48 0.51 0.52 0.50 0.50 Total 0.17 0.33 0.31 0.27 0.50 0.51 0.50 0.51
2cs.AI
Published as a conference paper at ICLR 2018 W HEN IS L EARN ? A C ONVOLUTIONAL F ILTER E ASY Simon S. Du Carnegie Mellon University ssdu@cs.cmu.edu Jason D. Lee University of Southern California jasonlee@marshall.usc.edu TO Yuandong Tian Facebook AI Research yuandong@fb.com arXiv:1709.06129v2 [cs.LG] 28 Feb 2018 A BSTRACT We analyze the convergence of (stochastic) gradient descent algorithm for learning a convolutional filter with Rectified Linear Unit (ReLU) activation function. Our analysis does not rely on any specific form of the input distribution and our proofs only use the definition of ReLU, in contrast with previous works that are restricted to standard Gaussian input. We show that (stochastic) gradient descent with random initialization can learn the convolutional filter in polynomial time and the convergence rate depends on the smoothness of the input distribution and the closeness of patches. To the best of our knowledge, this is the first recovery guarantee of gradient-based algorithms for convolutional filter on non-Gaussian input distributions. Our theory also justifies the two-stage learning rate strategy in deep neural networks. While our focus is theoretical, we also present experiments that justify our theoretical findings. 1 I NTRODUCTION Deep convolutional neural networks (CNN) have achieved the state-of-the-art performance in many applications such as computer vision (Krizhevsky et al., 2012), natural language processing (Dauphin et al., 2016) and reinforcement learning applied in classic games like Go (Silver et al., 2016). Despite the highly non-convex nature of the objective function, simple first-order algorithms like stochastic gradient descent and its variants often train such networks successfully. On the other hand, the success of convolutional neural network remains elusive from an optimization perspective. When the input distribution is not constrained, existing results are mostly negative, such as hardness of learning a 3-node neural network (Blum & Rivest, 1989) or a non-overlap convolutional filter (Brutzkus & Globerson, 2017). Recently, Shamir (2016) showed learning a simple one-layer fully connected neural network is hard for some specific input distributions. These negative results suggest that, in order to explain the empirical success of SGD for learning neural networks, stronger assumptions on the input distribution are needed. Recently, a line of research (Tian, 2017; Brutzkus & Globerson, 2017; Li & Yuan, 2017; Soltanolkotabi, 2017; Zhong et al., 2017) assumed the input distribution be standard Gaussian N (0, I) and showed (stochastic) gradient descent is able to recover neural networks with ReLU activation in polynomial time. One major issue of these analysis is that they rely on specialized analytic properties of the Gaussian distribution (c.f. Section 1.1) and thus cannot be generalized to the non-Gaussian case, in which real-world distributions fall into. For general input distributions, new techniques are needed. In this paper we consider a simple architecture: a convolution layer, followed by a ReLU activation function, and then average pooling. Formally, we let x ∈ Rd be an input sample, e.g., an image, we generate k patches from x, each with size p: Z ∈ Rp×k where the i-th column is the i-th patch generated by some known function Zi = Zi (x). For a filter with size 2 and stride 1, Zi (x) is the i-th and (i + 1)-th pixels. Since for convolutional filters, we only need to focus on the patches instead of the input, in the following definitions and theorems, we will refer Z as input and let Z as the distribution of Z: (σ(x) = max(x, 0) is the ReLU activation function) 1 Published as a conference paper at ICLR 2018 (a) (b) (c) + ReLU Label (Estimate) Input Figure 1: (a) Architecture of the network we are considering. Given input X, we extract its patches {Zi } and send them to a shared weight vector w. The outputs are then sent to ReLU and then summed to yield the final label (and its estimation). (b)-(c) Two conditions we proposed for convergence. We want the data to be (b) highly correlated and (c) concentrated more on the direction aligned with the ground truth vector w∗ . f (w, Z) = k  1X σ w > Zi . k i=1 (1) See Figure 1 (a) for a graphical illustration. Such architectures have been used as the first layer of many works in computer vision (Lin et al., 2013; Milletari et al., 2016). We address the realizable case, where training data are generated from (1) with some unknown teacher parameter w∗ under 2 input distribution Z. Consider the `2 loss ` (w, Z) = 12 (f (w, Z) − f (w∗ , Z)) . We learn by (stochastic) gradient descent, i.e., wt+1 = wt − ηt g(wt ) (2) where ηt is the step size which may change over time and g(wt ) is a random function where its expectation equals to the population gradient E [g(w)] = EZ∼Z [∇` (w, Z)] . The goal of our analysis is to understand the conditions where w → w∗ , if w is optimized under (stochastic) gradient descent. In this setup, our main contributions are as follows: • Learnability of Filters: We show if the input patches are highly correlated (Section 3), i.e., θ (Zi , Zj ) ≤ ρ for some small ρ > 0, then gradient descent and stochastic gradient descent with random initialization recovers the filter in polynomial time.1 Furthermore, strong correlations imply faster convergence. To the best of our knowledge, this is the first recovery guarantee of randomly initialized gradient-based algorithms for learning filters (even for the simplest one-layer one-neuron network) on non-Gaussian input distribution, answering an open problem in (Tian, 2017). • Distribution-Aware Convergence Rate. We formally establish the connection between the smoothness of the input distribution and the convergence rate for filter weights recovery where the smoothness in our paper is defined as the ratio between the largest and the least eigenvalues of the second moment of the activation region (Section 2). We show that a smoother input distribution leads to faster convergence, and Gaussian distribution is a special case that leads to the tightest bound. This theoretical finding also justifies the twostage learning rate strategy proposed by (He et al., 2016; Szegedy et al., 2017) if the step size is allowed to change over time. 1.1 R ELATED W ORKS In recent years, theorists have tried to explain the success of deep learning from different perspectives. From optimization point of view, optimizing neural network is a non-convex optimization 1 Note since in this paper we focus on continuous distribution over Z, our results do not conflict with previous negative results(Blum & Rivest, 1989; Brutzkus & Globerson, 2017) whose constructions rely on discrete distributions. 2 Published as a conference paper at ICLR 2018 problem. Pioneered by Ge et al. (2015), a class of non-convex optimization problems that satisfy strict saddle property can be optimized by perturbed (stochastic) gradient descent in polynomial time (Jin et al., 2017).2 This motivates the research of studying the landscape of neural networks (Soltanolkotabi et al., 2017; Kawaguchi, 2016; Choromanska et al., 2015; Hardt & Ma, 2016; Haeffele & Vidal, 2015; Mei et al., 2016; Freeman & Bruna, 2016; Safran & Shamir, 2016; Zhou & Feng, 2017; Nguyen & Hein, 2017) However, these results cannot be directly applied to analyzing the convergence of gradient-based methods for ReLU activated neural networks. From learning theory point of view, it is well known that training a neural network is hard in the worst cases (Blum & Rivest, 1989; Livni et al., 2014; Šı́ma, 2002; Shalev-Shwartz et al., 2017a;b) and recently, Shamir (2016) showed either “niceness” of the target function or of the input distribution alone is sufficient for optimization algorithms used in practice to succeed. With some additional assumptions, many works tried to design algorithms that provably learn a neural network with polynomial time and sample complexity (Goel et al., 2016; Zhang et al., 2016; 2015; Sedghi & Anandkumar, 2014; Janzamin et al., 2015; Gautier et al., 2016; Goel & Klivans, 2017). However, these algorithms are tailored for certain architecture and cannot explain why (stochastic) gradient based optimization algorithms work well in practice. Focusing on gradient-based algorithms, a line of research analyzed the behavior of (stochastic) gradient descent for Gaussian input distribution. Tian (2017) showed population gradient descent is able to find the true weight vector with random initialization for one-layer one-neuron model. Brutzkus & Globerson (2017) showed population gradient descent recovers the true weights of a convolution filter with non-overlapping input in polynomial time. Li & Yuan (2017) showed SGD can recover the true weights of a one-layer ResNet model with ReLU activation under the assumption that the spectral norm of the true weights is bounded by a small constant. All the methods use explicit formulas for Gaussian input, which enable them to apply trigonometric inequalities to derive the convergence. With the same Gaussian assumption, Soltanolkotabi (2017) shows that the true weights can be exactly recovered by projected gradient descent with enough samples in linear time, if the number of inputs is less than the dimension of the weights. Other approaches combine tensor approaches with assumptions of input distribution. Zhong et al. (2017) proved that with sufficiently good initialization, which can be implemented by tensor method, gradient descent can find the true weights of a 3-layer fully connected neural network. However, their approach works with known input distributions. Soltanolkotabi (2017) used Gaussian width (c.f. Definition 2.2 of (Soltanolkotabi, 2017)) for concentrations and his approach cannot be directly extended to learning a convolutional filter. In this paper, we adopt a different approach that only relies on the definition of ReLU. We show as long as the input distribution satisfies weak smoothness assumptions, we are able to find the true weights by SGD in polynomial time. Using our conclusions, we can justify the effectiveness of large amounts of data (which may eliminate saddle points), two-stage and adaptive learning rates used by He et al. (2016); Szegedy et al. (2017), etc. 1.2 O RGANIZATION This paper is organized as follows. In Section 2, we analyze the simplest one-layer one-neuron model where we state our key observation and establish the connection between smoothness and convergence rate. In Section 3, we discuss the performance of (stochastic) gradient descent for learning a convolutional filter. We provide empirical illustrations in Section 4 and conclude in Section 5. We place most of our detailed proofs in the Appendix. 1.3 N OTATIONS Let k·k2 denote the Euclidean norm of a finite-dimensional vector. For a matrix A, we use λmax (A) to denote its largest singular value and λmin (A) its smallest singular value. Note if A is a positive semidefinite matrix, λmax (A) and λmin (A) represent the largest and smallest eigenvalues of A, respectively. Let O(·) and Θ(·) denote the standard Big-O and Big-Theta notations that hide absolute 2 Gradient descent is not guaranteed to converge to a local minima in polynomial time (Du et al., 2017; Lee et al., 2016). 3 Published as a conference paper at ICLR 2018 S(w, w⇤ ) (b) (a) L( ) L w⇤ ( ) ( ) S(w, w⇤ ) S( w, w⇤ ) S( w, w⇤ ) Figure 2: (a) The four regions considered in our analysis. (b) Illustration of L (φ) , γ(φ) and L−w∗ (φ) defined in Definition 2.1 and Assumption 2.1. constants. We assume the gradient function is uniformly bounded, i.e., There exists B > 0 such that kg(w)k2 ≤ B. This condition is satisfied as long as patches, w and noise are all bounded. 2 WARM U P : A NALYZING O NE -L AYER O NE -N EURON M ODEL Before diving into the convolutional filter, we first analyze the special case for k = 1, which is equivalent to the one-layer one-neuron architecture. The analysis in this simple case will give us insights for the fully general case. For the ease of presentation, we define following two events and corresponding second moments   S(w, w∗ ) = Z : w> Z ≥ 0, w∗> Z ≥ 0 , S(w, −w∗ ) = Z : w> Z ≥ 0, w∗> Z ≤ 0 , (3)     Aw,w∗ = E ZZ> I {S(w, w∗ )} , Aw,−w∗ = E ZZ> I {S(w, −w∗ )} . where I {·} is the indicator function. Intuitively, S(w, w∗ ) is the joint activation region of w and w∗ and S(w, −w∗ ) is the joint activation region of w and −w∗ . See Figure 2 (a) for the graphical illustration. With some simple algebra we can derive the population gradient. E [∇` (w, Z)] = Aw,w∗ (w − w∗ ) + Aw,−w∗ w. One key observation is we can write the inner product h∇w ` (w) , w − w∗ i as the sum of two non-negative terms (c.f. Lemma A.1). This observation directly leads to the following Theorem 2.1.   Theorem 2.1. Suppose for any w1 , w2 with θ (w1 , w2 ) < π, E ZZ> I {S(w, w∗ )}  0 and the initialization w0 satisfies ` (w0 ) < ` (0) then gradient descent algorithm recovers w∗ . The first assumption is about the non-degeneracy of input distribution. For θ (w1 , w2 ) < π, one case that the assumption fails is that the input distribution is supported on a low-dimensional space, or degenerated. The second assumption on the initialization is to ensure that gradient descent does not converge to w = 0, at which the gradient is undefined. This is a general convergence theorem that holds for a wide class of input distribution and initialization points. In particular, it includes Theorem 6 of (Tian, 2017) as a special case. If the input distribution is degenerate, i.e., there are holes in the input space, the gradient descent may stuck around saddle points and we believe more data are needed to facilitate the optimization procedure This is also consistent with empirical evidence in which more data are helpful for optimization. 2.1 C ONVERGENCE R ATE OF O NE -L AYER O NE -N EURON M ODEL In the previous section we showed if the distribution is regular and the weights are initialized appropriately, gradient descent recovers the true weights when it converges. In practice we also want to know how many iterations are needed. To characterize the convergence rate, we need some quantitative assumptions. We note that different set of assumptions will lead to a different rate and ours is only one possible choice. In this paper we use the following quantities. 4 Published as a conference paper at ICLR 2018 Definition 2.1 (The Largest/Smallest eigenvalue Values of the Second Moment on Intersection of two Half Spaces). For φ ∈ [0, π], define γ(φ) = min λmin (Aw,w∗ ) , L(φ) = max λmax (Aw,w∗ ) , w:∠w,w∗ =φ w:∠w,w∗ =φ These two conditions quantitatively characterize the angular smoothness of the input distribution. For a given angle φ, if the difference between γ(φ) and L(φ) is large then there is one direction has large probability mass and one direction has small probability mass, meaning the input distribution is not smooth. On the other hand, if γ(φ) and L(φ) are close, then all directions have similar probability mass, which means the input distribution is smooth. The smoothest input distributions are rotationally invariant distributions (e.g. standard Gaussian) which have γ(φ) = L(φ). For analogy, we can think of L(φ) as Lipschitz constant of the gradient and γ(φ) as the strong convexity parameter in the optimization literature but here we also allow they change with the angle. Also observe that when φ = π, γ(φ) = L(φ) = 0 because the intersection has measure 0 and both γ(φ) and L(φ) are monotonically decreasing. Our next assumption is on the growth of Aw,−w∗ . Note that when θ (w, w∗ ) = 0, then Aw,−w∗ = 0 because the intersection between w and −w∗ has 0 measure. Also, Aw,−w∗ grows as the angle between w and w∗ becomes larger. In the following, we assume the operator norm of Aw,−w∗ increases smoothly with respect to the angle. The intuition is that as long as input distribution bounded probability density with respect to the angle, the operator norm of Aw,−w∗ is bounded. We show in Theorem A.1 that β = 1 for rotational invariant distribution and in Theorem A.2 that β = p for standard Gaussian distribution. Assumption 2.1. We assume there exists β > 0 that for 0 ≤ φ ≤ π/2, L−w∗ (φ) , maxw,θ(w,w∗ )≤φ λmax (Aw,−w∗ ) ≤ βφ. Now we are ready to state the convergence rate. Theorem the initialization w0 satisfies kw0 − w∗ k2 < kw∗ k2 . Denote φt =  2.2. Suppose  kw −w k2 t ∗ arcsin kw∗ k2 t = 1, 2, . . . then if step size is set as 0 ≤ ηt ≤ min0≤φ≤φt 2 kwt+1 − w∗ k2 ≤ γ(φ) , 2(L(φ)+4β)2 we have for   ηt γ (φt ) 2 1− kwt − w∗ k2 . 2 Note both γ(φ) and L(φ) increases as φ decreases so we can choose a constant step size γ(φ0 ) . This theorem implies that we can find the -close solution of w∗ in ηt = Θ (L(0)+β) 2   (L(0)+β)2 1 O iterations. It also suggests a direct relation between the smoothness of the γ 2 (φ0 ) log  distribution and the convergence rate. For smooth distribution where γ(φ) and L(φ) are close and β 2 is small then (L(0)+β) is relatively small and we need fewer iterations. On the other hand, if L(φ) γ 2 (φ0 ) or β is much larger than γ(φ), we will need more iterations. We verify this intuition in Section 4.   γ(φt ) If we are able to choose the step sizes adaptively ηt = Θ (L(φ , like using meth2 )+β) t ods proposed by Lin & Xiao (2014), we may improve the computational complexity to  (L(φ)+β)2 1 O maxφ≤φ0 γ 2 (φ) log  . This justifies the use of two-stage learning rate strategy proposed by He et al. (2016); Szegedy et al. (2017) where at the beginning we need to choose learning to be γ(φ0 ) small because 2(L(φ is small and later we can choose a large learning rate because as the )+2β)2 0 angle between wt and w∗ becomes smaller, γ(φt ) 2(L(φt )+2β)2 becomes bigger. The theorem requires the initialization satisfying kw0 − w∗ k2 < kw∗ k2 , which can be achieved by random initialization with constant success probability. See Section 3.2 for a detailed discussion. 3 M AIN R ESULTS FOR L EARNING A C ONVOLUTIONAL F ILTER In this section we generalize ideas from the previous section to analyze the convolutional filter. First, for given w and w∗ we define four events that divide the input space of each patch Zi . Each event 5 Published as a conference paper at ICLR 2018 corresponds to a different activation region induced by w and w∗ , similar to (3).   S(w, w∗ )i = Zi : w> Zi ≥ 0, w∗> Zi ≥ 0 , S(w, −w∗ )i = Zi : w> Zi ≥ 0, w∗> Zi ≤ 0 ,   S(−w, −w∗ )i = Zi : w> Zi ≤ 0, w∗> Zi ≤ 0 , S(−w, w∗ )i = Zi : w> Zi ≤ 0, w∗> Zi ≥ 0 . Please check Figure 2 (a) again for illustration. For the ease of presentation we also define the average over all patches in each region ZS(w,w∗ ) = k k 1X 1X Zi I {S(w, w∗ )i } , ZS(w,−w∗ ) = Zi I {S(w, −w∗ )i } , k i=1 k i=1 ZS(−w,w∗ ) = k 1X Zi I {S(−w, w∗ )i } . k i=1 Next, we generalize the smoothness conditions analogue to Definition 2.1 and Assumption 2.1. Here the smoothness is defined over the average of patches. Assumption 3.1. For φ ∈ [0, π], define  h i λmin E ZS(w,w∗ ) Z> , S(w,w∗ ) w:θ(w,w∗ )=φ  h i L(φ) = max λmax E ZS(w,w∗ ) Z> . S(w,w∗ ) γ(φ) = min (4) w:θ(w,w∗ )=φ  h i We assume for all 0 ≤ φ ≤ π/2, maxw:θ(w,w∗ )=φ λmax E ZS(w,−w∗ ) Z> ≤ βφ for S(w,−w∗ ) some β > 0. The main difference between the simple one-layer one-neuron network and the convolution filter is two patches may appear in different regions. For a given sample, there may exists patch Zi and Zj such that Zi ∈ S(w, w∗ )i and Zj ∈ S(w, −w∗ )j and their interaction plays an important role in the convergence of (stochastic) gradient descent. Here we assume the second moment of this interaction, i.e., cross-covariance, also grows smoothly with respect to the angle. Assumption 3.2. We assume there exists Lcross > 0 such that  h i  h i max λmax E ZS(w,w∗ ) Z> +λmax E ZS(w,w∗ ) Z> S(w,−w∗ ) S(−w,w∗ ) w:θ(w,w∗ )≤φ  h i +λmax E ZS(w,−w∗ ) Z> ≤ Lcross φ. S(−w,w∗ ) First note if φ = 0, then ZS(w,−w∗ ) and ZS(−w,w∗ ) has measure 0 and this assumption models the growth of cross-covariance. Next note this Lcross represents the closeness of patches. If Zi and Zj are very similar, then the joint probability density of Zi ∈ S(w, w∗ )i and Zj ∈ S(w, −w∗ )j is small which implies Lcross is small. In the extreme setting, Z1 = . . . = Zk , we have Lcross = 0 because in this case the events {Zi ∈ S(w, w∗ )i } ∩ {Zj ∈ S(w, −w∗ )j }, {Zi ∈ S(w, w∗ )i } ∩ {Zj ∈ S(−w, w∗ )j } and {Zi ∈ S(w, −w∗ )i } ∩ {Zj ∈ S(−w, w∗ )j } all have measure 0. Now we are ready to present our result on learning a convolutional filter by gradient descent. Theorem  3.1. If the initialization satisfies kw0 − w∗ k2 kwt −w∗ k2 which satisfies γ(φ0 ) > 6Lcross . arcsin kw∗ k 2 γ(φ)−6Lcross min0≤φ≤φt 2(L(φ)+10L 2, cross +4β) < kw∗ k2 and denote φt Then if we choose ηt   kwt −w∗ k2 we have for t = 1, 2, . . . and φt , arcsin kw∗ k = ≤ 2   η(γ(φt ) − 6Lcross ) 2 2 kwt+1 − w∗ k2 ≤ 1 − kwt − w∗ k2 2 Our theorem suggests if the initialization satisfies γ(φ0 ) > 6Lcross , we obtain linear convergence rate. In Section 3.1, we give a concrete example showing closeness of patches implies large γ(φ) and small Lcross . Similar to Theorem 2.2, if the step size is chosen so that ηt = 6 Published as a conference paper at ICLR 2018  Θ γ(φ0 )−6Lcross 2 (LS(w,w∗ ) (0)+10Lcross +4β )   2 γ(φ0 )−6Lcross log , in O LS(w,w ) (0)+10Lcross +4β ∗ 1    iterations, we can find the -close solution of w∗ and the proof is also similar to that of Theorem 3.1. In practice,we never get a true population gradient but only stochastic gradient g(w) (c.f. Equation (2)). The following theorem shows SGD also recovers the underlying filter. Theorem 3.2. Let φ∗ = argmaxφ γ(φ) ≥ 6Lcross . Denote r0 = kw0 − w∗ k2 , φ0 =   2    (γ(φ1 )−6Lcross )2 kw∗ k22 0 . For  sufficiently small, if ηt = Θ , arcsin kwr∗0k and φ1 = φ∗ +φ 2 2 B 2    kw0 −w∗ k B2 then we have in T = O 2 (γ(φ )−6L iterations, with probability at log δkw∗ k )2 kw k2 1 cross least 1 − δ we have kwT − w∗ k ≤  kw∗ k2 . ∗ 2 2 Unlike the vanilla gradient descent case, here the convergence rate depends on φ1 instead of φ0 . This is because of the randomness in SGD and we need a more robust initialization. We choose φ1 to be the average of φ0 and φ∗ for the ease of presentation. As will be apparent in the proof we only require φ0 not very close to φ∗ . The proof relies on constructing a martingale and use Azuma-Hoeffding inequality and this idea has been previously used by Ge et al. (2015). 3.1 W HAT DISTRIBUTION IS EASY FOR SGD TO LEARN A CONVOLUTIONAL FILTER ? Different from One-Layer One-Neuron model, here we also requires the Lipschitz constant for closeness Lcross to be relatively small and γ(φ0 ) to be relatively large. A natural question is: What input distributions satisfy this condition? Here we give an example. We show if (1) patches are close to each other (2) the input distribution has small probability mass around the decision boundary then the assumption in Theorem 3.1 is satisfied. See Figure 1 (b)-(c) for the graphical illustrations. Pk Theorem 3.3. Denote Zavg = k1 i=1 Zi . Suppose all patches have unit norm 3 and for all for all i, θ (Zi , Zavg ) ≤ ρ. Further assume there exists L ≥ 0 such that for any φ ≤ ρ and for all Zi h hπ ii h hπ ii π π P θ (Zi , w∗ ) ∈ − φ, + φ ≤ µφ, P θ (Zi , w∗ ) ∈ − − φ, − + φ ≤ µφ, 2 2 2 2 then we have γ (φ0 ) ≥ γavg (φ0 ) − 4 (1 − cos ρ) and Lcross ≤ 3µ.    where γavg (φ0 ) = σmin E ZZ> I w0> Z ≥ 0, w∗> Z ≥ 0 , analogue to Definition 2.1. Several comments are in sequel. We view ρ as a quantitative measure of the closeness between different patches, i.e., ρ small means they are similar. This lower decreasing as a function of ρ and note when ρ = 0, h bound is monotonically i > σmin E ZS(w,w∗ ) ZS(w,w∗ ) = γavg (φ0 ) which recovers Definition 2.1. For the upper bond on Lcross , µ represents the upper bound of theprobability density around the  2 decision boundary. For example if P θ (Zi , w∗ ) ∈ π2 − φ, π2 + φ  π ∝ φπ , thenfor φ in a small neighborhood around π/2, say radius , we have P θ (Zi , w∗ ) ∈ 2 − φ, 2 + φ . φ. This assumption is usually satisfied in real world examples like images because the image patches are not usually close to the decision boundary. For example, in computer vision, the local image patches often form clusters and is not evenly distributed over the appearance space. Therefore, if we use linear classifier to separate their cluster centers from the rest of the clusters, near the decision boundary the probability mass should be very low. 3.2 T HE P OWER OF R ANDOM I NITIALIZATION For one-layer one-neuron model, we need initialization kw0 − w∗ k2 < kw∗ k2 and for the convolution filter, we need a stronger initialization kw0 − w∗ k2 < kw∗ k2 cos (φ∗ ). The following theorem 3 This is condition can be relaxed to the norm and the angle of each patch are independent and the norm of each pair is independent of others. 7 Published as a conference paper at ICLR 2018 shows with uniformly random initialization we have constant probability to obtain a good initialization. Note with this theorem at hand, we can boost the success probability to arbitrary close to 1 by random restarts. The proof is similar to (Tian, 2017). Theorem a p-dimensional ball with radius αkw∗ k so that q 3.4. If we uniformly sample w0 from √ p πp 1 1 α ≤ 2πp , then with probability at least 2 − 1 − α2 kw∗ k. 2 α, we have kw0 − w∗ k2 ≤ To apply this general initialization theorem to our convolution filter case, we can choose α = cos φ∗ . Therefore, with some simple algebra we have the following corollary. Corollary 3.1. Suppose cos (φ∗ ) < √1 , 8πp then if w0 is uniformly sampled from a ball with center p 1 0 and radius kw∗ k cos (φ∗ ), we have with probability at least 12 − cos (φ∗ ) πp 2 > 4. The assumption of this corollary is satisfied if the patches are close to each other as discussed in the previous section. 4 E XPERIMENTS In this section we use simulations to verify our theoretical findings. We first test how the smoothness affect the convergence rate in one-layer one-neuron model described in Section 2 To construct input distribution with different L(φ), γ(φ) and β (c.f. Definition 2.1 and Assumption 2.1), we fix the patch to have unit norm and use a mixture of truncated Gaussian distribution to model on the angle around w∗ and around the −w∗ Specifically, the probability density of ∠Z, w∗ is sampled from 1 1 2 N (0, σ)I[−π/2,π/2] + 2 N (−π, σ)I[−π/2,π/2] . Note by definitions of L(φ) and γ(φ) if σ → 0 the probability mass is centered around w∗ , so the distribution is very spiky and L(φ)/γ(φ) and β will be large. On the other hand, if σ → ∞, then input distribution is close to the rotation invariant distribution and L(φ)/γ(φ) and β will be small. Figure 3a verifies our prediction where we fix the initialization and step size. Next we test how the closeness of patches affect the convergence rate in the convolution setting. We e using the above model with σ = 1, then generate each unit norm first generate a single patch Z e ∠Zi , Z e is sampled from ∠Zi , Z e ∼ N (0, σ2 )I[−π,π) . Figure 3b shows as Zi whose angle with Z, variance between patches becomes smaller, we obtain faster convergence rate, which coincides with Theorem 3.1. We also test whether SGD can learn a filter on real world data. Here we choose MNIST data and generate labels using two filters. One is random filter where each entry is sampled from a standard Gaussian distribution (Figure 4a) and the other is a Gabor filter (Figure 4b). Figure 3a and Figure 3c show convergence rates of SGD with different initializations. Here, better initializations give faster rates, which coincides our theory. Note that here we report the relative loss, logarithm of squared error divided by the square of mean of data points instead of the difference between learned filter and true filter because we found SGD often cannot converge to the exact filter but rather a filter with near zero loss. We believe this is because the data are approximately lying in a low dimensional manifold in which the learned filter and the true filter are equivalent. To justify this conjecture, we try to interpolate the learned filter and the true filter linearly and the result filter has similar low loss (c.f. Figure 5). Lastly, we visualize the true filters and the learned filters in Figure 4 and we can see that the they have similar patterns. 5 C ONCLUSIONS AND F UTURE W ORKS In this paper we provide the first recovery guarantee of (stochastic) gradient descent algorithm with random initialization for learning a convolution filter when the input distribution is not Gaussian. Our analyses only used the definition of ReLU and some mild structural assumptions on the input distribution. Here we list some future directions. One possibility is to extend our result to deeper and wider architectures. Even for two-layer fullyconnected network, the convergence of (stochastic) gradient descent with random initialization is not known. Existing results either requires sufficiently good initialization (Zhong et al., 2017) or 8 0 0 -1 -0.2 -2 log(||w-w *||2 ) * 2 log(||w-w || ) Published as a conference paper at ICLR 2018 -3 -4 =10 =5 =1 =0.5 -5 -6 0 2000 -0.4 -0.6 -0.8 2 -1 2 2 -1.2 2 4000 6000 8000 -1.4 10000 Epochs 0 =10 =2 =1 =0.1 200 400 600 800 1000 Epochs Figure 3: Convergence rates of SGD (a) with different smoothness where larger σ is smoother; (b) with different closeness of patches where smaller σ2 is closer; (c) for a learning a random filter with different initialization on MNIST data; (d) for a learning a Gabor filter with different initialization on MNIST data. (a) Random generated target filters. (b) Gabor filters. Figure 4: Visualization of true and learned filters. For each pair, the left one is the underlying truth and the right is the filter learned by SGD. 9 Published as a conference paper at ICLR 2018 relies on special architecture (Li & Yuan, 2017). However, we believe the insights from this paper is helpful to understand the behaviors of gradient-based algorithms in these settings. Another direction is to consider the agnostic setting, where the label is not equal to the output of a neural network. This will lead to different dynamics of (stochastic) gradient descent and we may need to analyze the robustness of the optimization procedures. This problem is also related to the expressiveness of the neural network (Raghu et al., 2016) where if the underlying function is not equal bot is close to a neural network. We believe our analysis can be extend to this setting. ACKNOWLEDGMENT The authors would like to thank Hanzhang Hu, Tengyu Ma, Yuanzhi Li, Jialei Wang and Kai Zhong for useful discussions. R EFERENCES Avrim Blum and Ronald L Rivest. Training a 3-node neural network is np-complete. In Advances in neural information processing systems, pp. 494–501, 1989. Alon Brutzkus and Amir Globerson. Globally optimal gradient descent for a convnet with gaussian inputs. arXiv preprint arXiv:1702.07966, 2017. Anna Choromanska, Mikael Henaff, Michael Mathieu, Gérard Ben Arous, and Yann LeCun. The loss surfaces of multilayer networks. In Artificial Intelligence and Statistics, pp. 192–204, 2015. Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. arXiv preprint arXiv:1612.08083, 2016. Simon S Du, Chi Jin, Jason D Lee, Michael I Jordan, Barnabas Poczos, and Aarti Singh. Gradient descent can take exponential time to escape saddle points. arXiv preprint arXiv:1705.10412, 2017. C Daniel Freeman and Joan Bruna. Topology and geometry of half-rectified network optimization. arXiv preprint arXiv:1611.01540, 2016. Antoine Gautier, Quynh N Nguyen, and Matthias Hein. Globally optimal training of generalized polynomial neural networks with nonlinear spectral methods. In Advances in Neural Information Processing Systems, pp. 1687–1695, 2016. Rong Ge, Furong Huang, Chi Jin, and Yang Yuan. Escaping from saddle pointsonline stochastic gradient for tensor decomposition. In Proceedings of The 28th Conference on Learning Theory, pp. 797–842, 2015. Surbhi Goel and Adam Klivans. Learning depth-three neural networks in polynomial time. arXiv preprint arXiv:1709.06010, 2017. Surbhi Goel, Varun Kanade, Adam Klivans, and Justin Thaler. Reliably learning the relu in polynomial time. arXiv preprint arXiv:1611.10258, 2016. Benjamin D Haeffele and René Vidal. Global optimality in tensor factorization, deep learning, and beyond. arXiv preprint arXiv:1506.07540, 2015. Moritz Hardt and Tengyu Ma. Identity matters in deep learning. arXiv preprint arXiv:1611.04231, 2016. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. Majid Janzamin, Hanie Sedghi, and Anima Anandkumar. Beating the perils of non-convexity: Guaranteed training of neural networks using tensor methods. arXiv preprint arXiv:1506.08473, 2015. Chi Jin, Rong Ge, Praneeth Netrapalli, Sham M Kakade, and Michael I Jordan. How to escape saddle points efficiently. arXiv preprint arXiv:1703.00887, 2017. 10 Published as a conference paper at ICLR 2018 Kenji Kawaguchi. Deep learning without poor local minima. In Advances in Neural Information Processing Systems, pp. 586–594, 2016. Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012. Jason D Lee, Max Simchowitz, Michael I Jordan, and Benjamin Recht. Gradient descent only converges to minimizers. In Conference on Learning Theory, pp. 1246–1257, 2016. Yuanzhi Li and Yang Yuan. Convergence analysis of two-layer neural networks with relu activation. arXiv preprint arXiv:1705.09886, 2017. Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. arXiv preprint arXiv:1312.4400, 2013. Qihang Lin and Lin Xiao. An adaptive accelerated proximal gradient method and its homotopy continuation for sparse optimization. In International Conference on Machine Learning, pp. 73– 81, 2014. Roi Livni, Shai Shalev-Shwartz, and Ohad Shamir. On the computational efficiency of training neural networks. In Advances in Neural Information Processing Systems, pp. 855–863, 2014. Song Mei, Yu Bai, and Andrea Montanari. The landscape of empirical risk for non-convex losses. arXiv preprint arXiv:1607.06534, 2016. Fausto Milletari, Nassir Navab, and Seyed-Ahmad Ahmadi. V-net: Fully convolutional neural networks for volumetric medical image segmentation. In 3D Vision (3DV), 2016 Fourth International Conference on, pp. 565–571. IEEE, 2016. Quynh Nguyen and Matthias Hein. The loss surface of deep and wide neural networks. arXiv preprint arXiv:1704.08045, 2017. Maithra Raghu, Ben Poole, Jon Kleinberg, Surya Ganguli, and Jascha Sohl-Dickstein. On the expressive power of deep neural networks. arXiv preprint arXiv:1606.05336, 2016. Itay Safran and Ohad Shamir. On the quality of the initial basin in overspecified neural networks. In International Conference on Machine Learning, pp. 774–782, 2016. Hanie Sedghi and Anima Anandkumar. Provable methods for training neural networks with sparse connectivity. arXiv preprint arXiv:1412.2693, 2014. Shai Shalev-Shwartz, Ohad Shamir, and Shaked Shammah. Failures of gradient-based deep learning. In International Conference on Machine Learning, pp. 3067–3075, 2017a. Shai Shalev-Shwartz, Ohad Shamir, and Shaked Shammah. Weight sharing is crucial to succesful optimization. arXiv preprint arXiv:1706.00687, 2017b. Ohad Shamir. Distribution-specific hardness of learning neural networks. arXiv:1609.01037, 2016. arXiv preprint David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016. Jiřı́ Šı́ma. Training a single sigmoidal neuron is hard. Neural Computation, 14(11):2709–2728, 2002. Mahdi Soltanolkotabi. Learning relus via gradient descent. arXiv preprint arXiv:1705.04591, 2017. Mahdi Soltanolkotabi, Adel Javanmard, and Jason D Lee. Theoretical insights into the optimization landscape of over-parameterized shallow neural networks. arXiv preprint arXiv:1707.04926, 2017. 11 Published as a conference paper at ICLR 2018 Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander A Alemi. Inception-v4, inception-resnet and the impact of residual connections on learning. In AAAI, pp. 4278–4284, 2017. Yuandong Tian. An analytical formula of population gradient for two-layered relu network and its applications in convergence and critical point analysis. arXiv preprint arXiv:1703.00560, 2017. Yuchen Zhang, Jason D Lee, Martin J Wainwright, and Michael I Jordan. Learning halfspaces and neural networks with random initialization. arXiv preprint arXiv:1511.07948, 2015. Yuchen Zhang, Jason D Lee, and Michael I Jordan. l1-regularized neural networks are improperly learnable in polynomial time. In International Conference on Machine Learning, pp. 993–1001, 2016. Kai Zhong, Zhao Song, Prateek Jain, Peter L Bartlett, and Inderjit S Dhillon. Recovery guarantees for one-hidden-layer neural networks. arXiv preprint arXiv:1706.03175, 2017. Pan Zhou and Jiashi Feng. arXiv:1705.07038, 2017. The landscape of deep learning algorithms. 12 arXiv preprint Published as a conference paper at ICLR 2018 A P ROOFS AND A DDITIONAL T HEOREMS A.1 P ROOFS OF THE T HEOREM IN S ECTION 2 Lemma A.1. > > h∇w ` (w) , w − w∗ i = (w − w∗ ) Aw,w∗ (w − w∗ ) + (w − w∗ ) Aw,−w∗ w. (5) and both terms are non-negative. Proof. Since Aw,w∗  0 and Aw,−w∗  0 (positive-semidefinite), both the first term and one part of the second term w> Aw,−w∗ w are non-negative. The other part of the second term is      −w∗> Aw,−w∗ w = −E w∗> Z w> Z I w> Z ≥ 0, w∗> Z ≤ 0 ≥ 0. Proof of Theorem 2.1. The assumption on the input distribution ensures when θ (w, w∗ ) 6= π, Aw,w∗  0 and when θ (w, w∗ ) 6= 0, Aw,−w∗  0. Now when gradient descent converges we have ∇w ` (w) = 0. We have the following theorem. By assumption, since ` (w) < ` (0) and gradient descent only decreases function value, we will not converge to w = 0. Note that at any critical points, h∇w ` (w) , w − w∗ i = 0, from Lemma A.1, we have: > (w − w∗ ) Aw,w∗ (w − w∗ ) > (w − w∗ ) Aw,−w∗ w =0 (6) = 0. (7) Suppose we are converging to a critical point w 6= w∗ . There are two cases: > • If θ (w, w∗ ) 6= π, then we have(w − w∗ ) Aw,w∗ (w − w∗ ) > 0, which contradicts with Eqn. 6. • If θ (w, w∗ ) = π, without loss of generality, let w = −αw∗ for some α > 0. By the assumption we know Aw,−w∗  0. Now the second equation becomes > (w − w∗ ) Aw,−w∗ w = (1 + γ)w∗ Aw,−w∗ w∗ > 0, which contradicts with Eqn. 7. Therefore we have w = w∗ . Proof of Theorem 2.2. Our proof relies on the following simple but crucial observation: if kw − w∗ k2 < kw∗ k2 , then   kw − w∗ k2 θ (w, w∗ ) ≤ arcsin . kw∗ k2 We denote θ (wt , w∗ ) = θt and by the observation we have θt ≤ φt . Recall the gradient descent dynamics, wt+1 = wt − η∇wt `(wt )       = wt − η E ZZ> I wt> Z ≥ 0, w∗> Z ≥ 0 (wt − w∗ ) − E w> Z ≥ 0, w∗> Z ≤ 0 wt . Consider the squared distance to the optimal weight 2 kwt+1 − w∗ k2 2 = kwt − w∗ k2       > − η (wt − w∗ ) E ZZ> I wt> Z ≥ 0, w∗> Z ≥ 0 (wt − w∗ ) − E w> Z ≥ 0, w∗> Z ≤ 0 wt      2 + η 2 E ZZ> I wt> Z ≥ 0, w∗> Z ≥ 0 (wt − w∗ ) − E w> Z ≥ 0, w∗> Z ≤ 0 wt 2 . By our analysis in the previous section, the second term is smaller than   >  2 −η (wt − w∗ ) E ZZ> I wt> Z ≥ 0, w∗> Z ≥ 0 (wt − w∗ ) ≤ −ηγ(θt ) kwt − w∗ k2 13 Published as a conference paper at ICLR 2018 where we have used our assumption on the angle. For the third term, we expand it as      2 E ZZ> I wt> Z ≥ 0, w∗> Z ≥ 0 (wt − w∗ ) − E w> Z ≥ 0, w∗> Z ≤ 0 wt 2    2 = E ZZ> I wt> Z ≥ 0, w∗> Z ≥ 0 (wt − w∗ ) 2    >   − 2 E ZZ> I wt> Z ≥ 0, w∗> Z ≥ 0 (wt − w∗ ) E w> Z ≥ 0, w∗> Z ≤ 0 wt   2 + E w> Z ≥ 0, w∗> Z ≤ 0 wt 2  2 kwt − w∗ k2 kwt − w∗ k 2 2 ≤L2 (θt ) kwt − w∗ k2 + 2L(θt ) kwt − w∗ k2 · 2β kwt k2 + 2β kw∗ k2 kw∗ k2  2 kwt − w∗ k2 kwt − w∗ k 2 2 2 ≤L (θt ) kwt − w∗ k2 + 2L(θt ) kwt − w∗ k · 2β · 4 kw∗ k2 · 2 kw∗ k2 + 2β kw∗ k2 kw∗ k2  2 ≤ L2 (θt ) + 8L(θt )β + 16β 2 kw − w∗ k2 . Therefore, in summary,   2 2 2 kwt+1 − w∗ k2 ≤ 1 − ηγ(θt ) + η 2 (L(θt ) + 4β) kwt − w∗ k2   ηγ(θt ) 2 kwt − w∗ k2 ≤ 1− 2   ηγ(φt ) 2 ≤ 1− kwt − w∗ k2 2 where the first inequality is by our assumption of the step size and second is because θt ≤ φt and γ(·) is monotonically decreasing. Theorem A.1 (Rotational Invariant Distribution). For any unit norm rotational invariant input distribution, we have β = 1. Proof of Theorem A.1. Without loss of generality, we only need to focus on the plane spanned by w and w∗ and suppose w∗ = (1, 0)> . Then    Z −π/2+φ   >  1 φ − sin φ cos φ cos θ − sin2 φ E ZZ I {S(w, −w∗ )} = (cos θ, sin θ)dθ = . sin θ − sin2 φ φ + sin φ cos φ 2 −π/2 It has two eigenvalues λ1 (φ) = φ − sin φ φ + sin φ and λ2 (φ) = . 2 2 Therefore, maxw,θ(w,w∗ )≤φ λmax (Aw,−w∗ ) = φ+sin φ 2 ≤ φ for 0 ≤ φ ≤ π. Theorem A.2. If Z ∼ N (0, I), then β ≤ p Proof. Note in previous theorem we can integrate h angle i and radius separately then multiply them 2 together. For Gaussian distribution, we have E kZk2 ≤ p. The result follows. A.2 P ROOFS OF T HEOREMS IN S ECTION 3 Proof of Theorem 3.1. The proof is very similar to Theorem 2.2. Notation-wise, for two events S1 , S2 we use S1 S2 as a shorthand for S1 ∩ S2 and S1 + S2 as a shorthand for S1 ∪ S2 . Denote θt = θ (wt , w∗ ) . First note with some routine algebra, we can write the gradient as ∇wt ` (wt )  (d,d) X =E  (i,j)=(1,1)  n o  (w − w∗ ) Zi Z> j I S(w, w∗ )i S(w, w∗ )j 14 Published as a conference paper at ICLR 2018  (d,d) + E X (i,j)=(1,1)  (d,d) + E X (i,j)=(1,1)  (d,d) − E X (i,j)=(1,1)  n o w Zi Z> j I S(w, w∗ )i S(w, −w∗ )j + S(w, −w∗ )i S(w, w∗ )j  n o w Zi Z> j I S(w, −w∗ )i S(w, −w∗ )j  n o  w∗ Zi Z> j I S(w, w∗ )i S(−w, w∗ )j + S(w, −w∗ )i S(w, w∗ )j + S(w, −w∗ )i S(−w, w∗ )j We first examine the inner product between the gradient and w − w∗ . h∇wt `(w), w − w∗ i  > (d,d) = (w − w∗ ) E  X  (d,d) + (w − w∗ ) E  X  (d,d) − (w − w∗ ) E  X (i,j)=(1,1) > (i,j)=(1,1) > (i,j)=(1,1)  (d,d) ≥ (w − w∗ ) E  X  (d,d) + (w − w∗ ) E  X  (d,d) − (w − w∗ ) E  X > (i,j)=(1,1) > (i,j)=(1,1) > (i,j)=(1,1)  n o Zi Zj I S(w, w∗ )i S(w, w∗ )j  (w − w∗ )  n o Zi Zj I S(w, w∗ )i S(w, −w∗ )j + S(w, −w∗ )i S(w, w∗ )j + S(w, −w∗ )i S(w, −w∗ )j  w  n o Zi Zj I S(w, w∗ )i S(−w, w∗ )j + S(w, −w∗ )i S(w, w∗ )j + S(w, −w∗ )i S(−w, w∗ )j  w∗  n o Zi Zj I S(w, w∗ )i S(w, w∗ )j  (w − w∗ )  n o Zi Zj I S(w, w∗ )i S(w, −w∗ )j  w  n o Zi Zj I S(w, w∗ )i S(−w, w∗ )j + S(w, −w∗ )i S(w, w∗ )j + S(w, −w∗ )i S(−w, w∗ )j  w∗ 2 ≥ γ(θt ) kw − w∗ k2  (d,d) − kw − w∗ k2 kwk2 E  X (i,j)=(1,1)   n o Zi Zj I S(w, w∗ )i S(w, −w∗ )j   (d,d) − kw − w∗ k2 kw∗ k2  E  X op (i,j)=(1,1)  (d,d) + E X (i,j)=(1,1) ≥ γ(θt ) kw −  n o Zi Zj I S(w, w∗ )i S(−w, w∗ )j  op  n o Zi Zj I S(w, −w∗ )i S(w, w∗ )j  op 2 w∗ k2  (d,d) − 2 kw − w∗ k2 kw∗ k2 E  X (i,j)=(1,1)   (d,d) − kw − w∗ k2 kw∗ k2  E  X  (d,d) + E X (i,j)=(1,1)  n o Zi Zj I S(w, −w∗ )i S(−w, w∗ )j  op  n o Zi Zj I S(w, w∗ )i S(−w, w∗ )j  op 15  op  n o Zi Zj I S(w, w∗ )i S(w, −w∗ )j  (i,j)=(1,1)  Published as a conference paper at ICLR 2018  (d,d) + E X (i,j)=(1,1) ≥ γ (θt ) kwt −  n o Zi Zj I S(w, −w∗ )i S(w, w∗ )j   (d,d) + E X op (i,j)=(1,1) − 3Lcross φt kw∗ k2 kwt − w∗ k2 kwt − w∗ k2 2 ≥ γ (θt ) kwt − w∗ k2 − 6Lcross · kw∗ k2 kwt − w∗ k2 kw∗ k2 2 ≥ (γ (θt ) − 6Lcross ) kwt − w∗ k2 where the first inequality we used the definitions of the regions; the second inequality we used the definition of operator norm; the third inequality we used the fact kwt − w∗ k2 ≤ kw∗ k2 ; the fourth inequality we used the definition of Lcross and the fifth inequality we used φ ≤ 2 sin φ for any 0 ≤ φ ≤ π/2. Next we can upper bound the norm of the gradient using similar argument k∇wt `(wt )k2 ≤L (θt ) kwt − w∗ k2 + 10Lcross kwt − w∗ k + 2β kwt − w∗ k2 =(L(θt ) + 10Lcross + 4β) kwt − w∗ k2 . Therefore, using the dynamics of gradient descent, putting the above two bounds together, we have  2 2 kwt+1 − w∗ k2 ≤ 1 − η (γ(θt ) − 6Lcross ) + η 2 (L(θt ) + 10Lcross + 4β)2 kwt − w∗ k2   η(γ(θt ) − 6Lcross ) 2 kwt − w∗ k2 ≤ 1− 2   η(γ(φt ) − 6Lcross ) 2 ≤ 1− kwt − w∗ k2 2 where the last step we have used our choice of ηt and θt ≤ φt . The proof of Theorem 3.2 consists of two parts. First we show if η is chosen properly and T is not to big, then for all 1 ≤ t ≤ T , with high probability the iterates stat in a neighborhood of w∗ . Next, conditioning on this, we derive the rate. Lemma A.2. Denote r0 = kw0 − w∗ k2 < kw∗ k2 sin φ∗ . Given 0 <r1 < kw  ∗ k2 sin φ∗ , number r1 kw∗ k2 then if the step size 0 < 1 − ηγ(φ1 ) + η 2 (L(0) + 10Lcross + 4β)2 < 1 2   r12 − r02 T ≥ log 2 2 2 δ T (1 + 2ηαT ) (2ηB (L(0) + 10Lcross + 4β) r1 + η B ) with α = γ (φ1 ) − η (L(0) + 10Lcross + 4β). Then with probability at least 1 − δ, for all t = 1, . . . , T , we have kwt − w∗ k ≤ r1 . Proof of Lemma A.2. Let g(wt ) = E [∇wt ` (wt )] + ξt . We denote Ft = σ {ξ1 , . . . , ξt }, the sigmaalgebra generated by ξ1 , . . . , ξt and define the event Consider Ct = {∀τ ≤ t, kwτ − w∗ k ≤ r1 } . h i 2 E kwt+1 − w∗ k2 ICt |Ft h i 2 =E kwt − η∇wt `(wt ) − w∗ − ηξt k2 ICt |Ft    2 2 ≤ 1 − ηγ(φ1 ) + η 2 (L(0) + 10Lcross + 4β) kwt − w∗ k2 + η 2 B 2 ICt where the inequality follows by our analysis of gradient descent together with definition of Ct and E [ξt |Ft ] = 0. Define   ηB 2 −t 2 . Gt = (1 − ηα) kwt − w∗ k2 − α 16  op 2 w∗ k2 of iterations T ∈ Z++ and failure probability δ, denote φ1 = arcsin satisfies   n o Zi Zj I S(w, −w∗ )i S(−w, w∗ )j  Published as a conference paper at ICLR 2018 By our analysis above, we have E [Gt+1 ICt |Ft ] ≤ Gt ICt ≤ Gt ICt−1 where the last inequality is because Ct is a subset of Ct−1 . Therefore, Gt ICt−1 is a super-martingale and we may apply Azuma-Hoeffding inequality. Before that, we need to bound the difference between Gt ICt and its expectation. Note h i   2 2 −t Gt ICt−1 − E Gt ICt−1 |Ft−1 = (1 − ηα) kwt − w∗ k2 − E kwt − w∗ k2 |Ft−1 ICt−1 h i −t 2 = (1 − ηα) 2ηhξt , wt − η∇wt `(wt ) − w∗ − η 2 E kξt k2 |Ft−1 ICt−1  −t ≤ (1 − ηα) 2ηB (L(0) + 10Lcross + 4β) kwt − w∗ k2 + η 2 B 2 ICt−1  −t ≤ (1 − ηα) 2ηB (L(0) + 10Lcross + 4β) r1 + η 2 B 2 ,dt . Therefore for all t ≤ T c2t , = t X τ =1 t X τ =1 d2τ (1 − ηα) ≤t (1 − ηα) −2t −2t 2ηB (L(0) + 10Lcross + 4β) r1 + η 2 B 2 2ηB (L(0) + 10Lcross + 4β) r1 + η 2 B 2 2 2 ≤T (1 + 2ηαT ) 2ηB (L(0) + 10Lcross + 4β) r1 + η 2 B 2 2 where the first inequality we used 1 − ηα < 1, the second we used t ≤ T and the third we used our assumption on η. Let us bound at (t + 1)-th step, the iterate goes out of the region, h n oi 2 P [Ct ∩ {kwt+1 − w∗ k2 > r1 }] =P Ct ∩ kwt+1 − w∗ k2 > r12 h n oi 2 =P Ct ∩ kwt+1 − w∗ k2 > r02 + (r12 − r02 )    ηB 2 ηB 2 t 2 2 =P Ct ∩ Gt+1 (1 − ηα) + ≥ G0 + + r1 − r0 α α    ≤P Ct ∩ Gt+1 − G0 ≥ r12 − r02 ( 2 ) r12 − r02 ≤ exp − 2c2t δ T where the second inequality we used Azuma-Hoeffding inequality, the last one we used our assumption of η. Therefore for all 0 ≤ t ≤ T , we have with probability at least 1 − δ, Ct happens. ≤ Now we can derive the rate. Lemma A.3. Denote r0 = kw0 − w∗ k2 < kw∗ k2 sin φ∗ . Given 0 <r1 < kw  ∗ k2 sin φ∗ , number r1 of iterations T ∈ Z++ and failure probability δ, denote φ1 = arcsin kw∗ k then if the step size 2 satisfies 0 < 1 − ηγ(φ1 ) + η 2 (L(0) + 10Lcross + 4β)2 < 1 2   r12 − r02 T ≥ log 2 2 2 δ T (1 + 2ηαT ) (2ηB (L(0) + 10Lcross + 4β) r1 + η B ) !   r02 2 ηT γ(φ1 ) − η (L(0) + 10Lcross + 4β) ≥ log 2 2 kw∗ k2 δ 17 Published as a conference paper at ICLR 2018   2 2 2 γ(φ1 ) − η (L(0) + 10Lcross + 4β) kw∗ k2 ≥ ηB 2 with α = γ (φ1 ) − η (L(0) + 10Lcross + 4β), then we have with probability 1 − 2δ, kwt − w∗ k2 ≤ 2 kw∗ k2 . Proof of Lemma A.3. We use the same notations in the proof of Lemma A.2. By the analysis of Lemma A.2, we know  h i  2 2 E kwt+1 − w∗ k2 ICt |Ft ≤ (1 − ηα) kwt − w∗ k2 + η 2 B 2 ICt . Therefore we have     ηB 2 ηB 2 t 2 E kwt − w∗ k2 ICt − ≤ (1 − ηα) kw0 − w∗ k2 − . α α Now we can bound the failure probability   ηB 2 2 2 2 P [kwT − w∗ k2 ≥ 2 kw∗ k2 ] ≤P kwT − w∗ k2 − ≥  kw∗ k2 α    ηB 2 2 2 2 c ≥  kwk2 ∪ Ct ≤P kwT − w∗ k2 ICt − α   ηB 2 2 2 2 ≤P kwT − w∗ k2 ICt − ≥  kwk2 +δ α i h 2 2 E kwT − w∗ k2 ICt − ηB α +δ ≤ 2 2 kw∗ k2   t 2 (1 − ηα) kw0 − w∗ k2 − ηB α +δ ≤ 2 2 kw∗ k2 ≤2δ. The first inequality we used the last assumption. The second inequality we used the probability of an event is upper bound by any superset of this event. The third one we used Lemma A.2 and the union bound. The fourth one we used Markov’s inequality. Now we can specify the T and η and derive the convergence rate of SGD for learning a convolution filter. Proof of Theorem 3.2. With the choice of η and T , it is straightforward to check they satisfies conditions in Lemma A.3. Proof of Theorem 3.3. We first prove the lower bound of γ (φ0 ).  ! k !>  k X X E Zi I {S(w, w∗ )i } Zi I {S(w, w∗ )i }  i=1  =E kZ + i=1 k X i=1 (Zi I {S(w, w∗ )i } − Z) kZ +   =k 2 E ZZ> + kE Z  k X i=1 " + kE k X i=1 k X i=1 !>  (Zi I {S(w, w∗ )i } − Z) !>  (Zi I {S(w, w∗ )i } − Z) ! # > (Zi I {S(w, w∗ )i } − Z) Z 18   Published as a conference paper at ICLR 2018  + E k X i=1 ! (Zi I {S(w, w∗ )i } − Z1 I {S(w, w∗ )1 }) k X i=1 !>  (Zi I {S(w, w∗ )i } − Z1 I {S(w, w∗ )1 })  !>  k X   <k 2 E ZZ> + kE Z (Zi I {S(w, w∗ )i } − Z)  i=1 " + kE k X i=1 ! # (Zi I {S(w, w∗ )i } − Z) Z> Note because Zi s have unit norm and by law of cosines kZ (Zi I {S(w, w∗ )i } − Z)kop ≤ 2(1 − cos ρ). Therefore,   ! d !>  d X X σmin E  Zi I {S(w, w∗ )i } Zi I {S(w, w∗ )i }  ≥ k 2 (γ1 (φ0 ) − 4(1 − cos ρ)). i=1 i=1 Now we prove the upper bound of Lcross . Notice that h n oi h n oi ≤E kZi k2 kZj k2 I S(w, w∗ )i S(w, −w∗ )j E Zi Z> j I S(w, w∗ )i S(w, −w∗ )j 2 ! Z Z dP (Zi |Zj ) dP (θj ) . = S(w,w∗ )i S(w,−w∗ )j If φ ≤ ψ, then by our assumption, we have ! Z Z Z dP (Zi |Zj ) dP (θj ) ≤ S(w,−w∗ )j S(w,w∗ )i S(w,−w∗ )j dP (Zj ) ≤ Lφ. On the other hand, if φ ≥ γ, let θj be the angle between w∗ and Zj , we have ! ! Z π2 +γ Z Z Z dP (Zi |Zj ) dP (θj ) ≤ dP (Zi |Zj ) dP (θj ) S(w,−w∗ )j π 2 S(w,w∗ )i S(w,w∗ )i ≤Lγ ≤Lφ.  h i Therefore, σmax E ZS(w,w∗ ) Z> ≤ Lφ. Using similar arguments we can show   S(w,−w∗ )   σmax E ZS(w,w∗ ) ZS(−w,w∗ ) ≤ Lφ and σmax E ZS(w,−w∗ ) ZS(−w,w∗ ) ≤ Lφ. Proof of Theorem 3.4. We use the same argument by Tian (2017). Let rinit be the initialization radius. The failure probability is lower bounded  2  kw∗ k2 cos(φ∗ ) rinit δVk−1 (rinit ) 2kw∗ k2 + 2 1 (rinit ) − . 2 Vk (rinit ) Therefore, rinit = cos (φ∗ ) kw∗ k2 maximizes this lower bound. Plugging this optimizer in and using formula for the volume of the Euclidean ball, the failure probability is lower bounded by r 1 πΓ (p/2 + 1) 1 πp − cos (φ∗ ) ≥ − cos (φ∗ ) 2 Γ (p/2 + 1/2) 2 2 where we used Gautschi’s inequality for the last step. B A DDITIONAL E XPERIMENTAL R ESULTS Figure 5 show the loss of linear interpolation between the learned filter w and ground truth filter w∗ . Our interpolation has the form winter = αw + (1 − α)w∗ where α ∈ [0, 1] is the interpolation ratio. Note that for all interpolation ratios, the loss remains very low. 19  Published as a conference paper at ICLR 2018 -6 -9 log(Relative Loss) log(Relative Loss) -10 -11 -12 -13 -14 -8 -10 -12 -14 -15 Gabor Filter Random Filter -16 0 20 40 60 80 -16 100 0 20 40 60 80 Interpolation Ratio % Interpolation Ratio % Figure 5: Loss of linear interpolation between learned filter and the true filter. 20 100
2cs.AI
IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMSŁI: REGULAR PAPERS 1 Optimal Tracking Performance Limitation of Networked Control Systems with Limited Bandwidth and Additive Colored White Gaussian Noise arXiv:1702.02096v1 [cs.SY] 7 Feb 2017 Zhi-Hong Guan, Chao-Yang Chen, Gang Feng, and Tao Li Abstract—This paper studies optimal tracking performance issues for multi-input-multi-output linear time-invariant systems under networked control with limited bandwidth and additive colored white Gaussian noise channel. The tracking performance is measured by control input energy and the energy of the error signal between the output of the system and the reference signal with respect to a Brownian motion random process. This paper focuses on two kinds of network parameters, the basic network parameter-bandwidth and the additive colored white Gaussian noise, and studies the tracking performance limitation problem. The best attainable tracking performance is obtained, and the impact of limited bandwidth and additive colored white Gaussian noise of the communication channel on the attainable tracking performance is revealed. It is shown that the optimal tracking performance depends on nonminimum phase zeros, gain at all frequencies and their directions unitary vector of the given plant, as well as the limited bandwidth and additive colored white Gaussian noise of the communication channel. The simulation results are finally given to illustrate the theoretical results. Index Terms—Networked control systems, bandwidth, additive colored white Gaussian noise, performance limitation. I. I NTRODUCTION M ORE and more researchers are interested in networked control systems in the past decade, please see, for example, [1]–[7] and references therein. Most works focus on analysis and synthesis of networked control systems with quantization effects (e.g. [8]–[12]), time delays [13]–[15], bandwidth constraint [4], [16], [17], data rate constraint [1], [16], and/or data packet dropout [17]–[20]. In spite of the significant progress in those studies, the more inspiring and challenging issues of control performance limitation under such network environment remain largely open. Zhi-Hong Guan and Chao-Yang Chen are with the Department of Control Science and Engineering, Huazhong University of Science and Technology, Wuhan, 430074, P. R. China. Gang Feng is with the Department of Mechanical and Biomedical Engineering, City University of Hong Kong, Kowloon, Hong Kong, SAR, P. R. China. Tao Li is with the College of Electronics and Information, Yangtze University, Jingzhou, 434023, P. R. China. Corresponding Author: zhguan@mail.hust.edu.cn (Z.H. Guan). This work was supported in part by the National Natural Science Foundation of China under Grants 60834002, 60973012, 61073065, 61100076 and the Doctoral Foundation of Ministry of Education of China under Grant 20090142110039 and by a grant from the Research Grants Council of the Hong Kong Special Administrative Region, China (Project No.: CityU 113311). Performance limitations resulting from nonminimum phase (NMP) zeros and unstable poles of given systems have been known for a long time. The issue has been attracting a growing amount of interest in the control community, see [21]–[24] for example. The tracking performance achievable via feedback was studied in [25] with respect to single-input-single-output (SISO) stable systems. The result was extended to multi-inputmulti-output (MIMO) unstable systems in [26], and it was found that the minimal tracking error depends not only on the location of the system nonminimum phase zeros, but also on how the input signal may interact with those zeros, i.e., the angles between the input and zero directions. Optimal tracking and regulation control problems were studied in [22], where objective functions of tracking error and regulated response, defined by integral square measures, are minimized jointly with the control effort, and the latter is measured by the system input energy. In [24], the optimal tracking control problem was studied with both the forward and feedback channel disturbances. The authors of [23] investigated the regulation performance limitations of unstable non-minimum phase singleinput-multi-output (SIMO) continuous-time and discrete-time systems, respectively. However, all these mentioned works have not taken into account the effects of networks, which would make the study of the optimal performance limitation much more challenging. Networked control systems are ubiquitous in industry. More and more control systems are operating over a network. In recent years, the research on the performance limitation of networked control systems attracts some attention. For example, the authors in [10] studied the tracking performance of discrete-time SISO networked feedback systems, by modeling the quantization error as a white noise. The tracking performance of continuous-time MIMO systems with the additive white Gaussian noise (AWGN) was studied through one- and two-parameter control schemes in [27], [29]. The result was further generalized to other noisy channels with bandwidth limitation in [8], where the optimal tracking performance is measured by the achievable minimal tracking error. However, it was showed in [24] that, in the optimal tracking problem, in order to attain the minimal tracking error, the control input of systems is often required to have an infinite energy. This requirement cannot be met in general in practice. Thus the control input energy of systems should be considered in the performance index to address this issue. In this paper, IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMSŁI: REGULAR PAPERS 2 we consider the optimal tracking problem in terms of both the tracking error energy and the control input energy, and meanwhile we consider communication link over bandwidthlimited additive colored Gaussian noise (ACGN) channels, which are more realistic models of communication link than those in [1], [24]. In this paper, we study optimal tracking performance issues pertaining to MIMO feedback control systems. The objective is to minimize the tracking error between the output and the reference signals of a feedback system under the constraint of control input energy. The optimal tracking performance is attained by stabilizing compensators under a two-parameter structure. The tracking error is defined in an square error sense, and the reference signals are considered as a Brownian motion, which can be roughly considered as the integral of a standard white noise [2], [27], [28]. The tracking performance index is given by the weighted sum between the power of the tracking error energy and the system input energy. The rest of the the paper is organized as follows. The problem formulation and preliminaries are given in section II. In section III, the main results of this paper are presented. Results of extensive simulation studies and discussions are shown to validate the theoretical results in section IV. Concluding remarks are made in Section V. associated with s, and kηk = 1. For such a zero, it is always true that η H N (s) = 0, for some unitary vector η. On the other hand, a complex number is said to be a pole of P(s) if P (p) = ∞. If p is an unstable pole of P (s), i.e., p ∈ C+ , then equivalent statement is that M̃ (p)ω = 0 for some unitary vector ω, kωk = 1. In order to facilitate the subsequent proof, we introduce two specific factorization for N (s) : N (s) = L(s)Nm (s) = L̂(s)N̂m (s). and L̂(s) Q zAnd, allpass factor Q L(s) z have the form L(s) := ni=1 Li (s), L̂(s) := ni=1 L̂i (s), and  H   z̄i zi −s 0 ηi z z̄ +s i i , (2) Li (s) :=[ηi Ui ] UiH 0 I  H   s−zi η̂i 0 , (3) L̂i (s) :=[η̂i Ûi ] s+z̄i 0 I ÛiH II. P RELIMINARIES Consider the class of functions in F := {f : f (s) analytic in C+ , limR→∞ maxθ∈[−π/2,π/2] kf (Rejθ )/Rk = 0}.. Lemma 1 and 2 can be found in [22]. Lemma 1: Let f (s) ∈ F and denote f (jω) = h1 (ω) + jh2 (ω). Suppose that f (s) is conjugate symmetric, R∞  i.e., f (s) = f (s̄). Then f ′ (0) = (1/π) ∞ h1 (ω) − h1 (0) /ω 2 dω . Lemma 2: Consider a conjugate symmetric function f (s). Suppose that f (s) is analytic and has no zero in C+ , and that log f (s) ∈ F. Then provided that f ′ (0)/f (0) = R +∞ (1/π) −∞ (1/ω 2 ) log |f (jω)/f (0)|dω , f (0) 6= 0. Lemma 3: Let L and Li be defined P by (3). Then, for any −1 z X ∈ RH∞ , the equality XL−1 = S + N i=1 X(zi )L1 (zi ) −1 −1 −1 −1 · · · Li−1 (zi )Li Li+1 (zi ) · · · LNz (zi ) holds for some S ∈ RH∞ . Proof: We assume that A is an allpass factor. From lemma 4.1 in for some Y ∈ RH∞ , we have A−1 Y = S1 + PNz [30], −1 −1 −1 −1 A (z (zi ) · · · A−1 1 (zi )Y (zi ). i=1 Nz i ) · · · Ai+1 (zi )Ai Ai−1 P Nz H −H H H Then, we have Y A = S1 + i=1 Y (zi )A−H 1 (zi ) · · · −H −H −H H (z ). Let L = A , S = S1H , Ai−1 (zi )Ai Ai+1 (zi ) · · · A−H i Nz P Nz −1 −1 H −1 X = Y , then XL = S+ i=1 X(zi )L1 (zi )Li−1 (zi ) · · · −1 −1 L−1 i Li+1 (zi ) · · · LNz (zi ). Therefore, the proof is completed. We begin by summarizing briefly the notations used throughout this paper. For any complex number s, we denote its complex conjugate by sH . The expectation operator is denoted by E{·}, respectively. For any vector u, we denote its conjugate transpose by uH , and its Euclidean norm by kuk. For a matrix A, we denote its conjugate transpose by AH . All the vectors and matrices involved in the sequel are assumed to have compatible dimensions, and for simplicity their dimensions will be omitted. Let the open right-half plane be denoted by C+ := {s : Re(s) > 0}, the open left-half plane by C− := {s : Re(s) < 0}, and the imaginary axis by RC0 . Define L2 := {f : f (s) measurable in C0 , kf k22 := 2 1 ∞ 2π −∞ kf (jω)kF dω < ∞}. Then,R L2 is a Hilbert space with ∞ 1 H an inner product hf, gi := 2π −∞ tr{f (jω)g(jω)}dω. Next, define H2 as a subspace of functions in L2 with functions f (s) analytic inR C− , H2 := {f : f (s) analytic in C, 1 ∞ kf (σ + jω)k2F dω < ∞}. and the kf k22 := supσ>0 2π −∞ orthogonal complement of H2 in L2 Ras H2⊥ : H2⊥ := {f : 1 ∞ 2 f (s)analyticin C, kf k22 := supσ<0 2π −∞ kf (σ + jω)kF dω ⊥ < ∞}. Thus, for any f ∈ H2 and g ∈ H2, hf, gi = 0. We use the same notation k·k2 to denote the corresponding norm. Finally, we denote by RH∞ the class of all stable, proper rational transfer function matrices. We introduce a factorization formula for non-minimum phase systems. For the right-invertible rational transfer function matrix P , let its right and left coprime factorizations be given by P = N M −1 = M̃ −1 Ñ , (1) where N, M, M̃ , Ñ ∈ RH∞ . A complex number s ∈ C is said to be a zero of P (s), if η H P (s) = 0 for some unitary vector η, where η is called an output direction vector where ηi are unitary vectors obtained by factorizing the zeros one at a time, and Ui are matrices which together with ηi form a unitary matrix. Similarly, η̂i and Ûi have same definition and nature. Likewise, M̃ has the allpass factorization M̃ = M̃m (s) ×B̃(s), where B̃(s) is an allpass factor and M̃m (s) is the minimum phase part M̃ (s). One particular allpass factor is Qnof p B̃i (s), and given by B̃(s) := i=1  s−pi  H  ω̃i 0 s+ p̄ i B̃i (s) :=[ω̃i W̃i ] . (4) W̃iH 0 I III. T RACKING PERFORMANCE LIMITATIONS Consider the control feedback loop shown in Fig.1, where the plant model P is a rational transfer function matrix. The channel model is the bandwidth-limited ACGN channel, where n = [n1 , n2 , · · · , nl ] with ni (1 ≤ i ≤ l) being a zeromean stationary white Gaussian noise process and spectral density γi2 (when l = 1, note γ = γ1 ). The reference signal r is a vector of the step signal generated by passing a standard white noise ω through an integrator, which can IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMSŁI: REGULAR PAPERS be roughly considered as a Brownian motion process [28] and emulate the step signal in the deterministic setting [2], [27]. Therefore, the formulation resembles the tracking of a deterministic step signal. For the channel i, we denote the spectral density of wi by σi2 (when l = 1, note σ = σ1 ). It is assumed that the system reference inputs in different channels are independent, and that the reference input and the noise are uncorrelated. [K1 , K2 ] denotes the two-parameter Fig. 1. Feedback control over bandwidth limited ACGN channels 3 The optimal performance attainable by all possible stabilizing controllers is J ∗ := inf J. k∈Ks Theorem 1: Let ω and n be uncorrelated white Gaussian signals. Suppose that P (s) = Po (s)/sn , for some integer n ≥ 1, such that Po (s) is proper and has no zero at s = 0. P is supposed to be unstable, NMP and invertible (including right invertible and left invertible). Denote the NMP zeros of P (s) and F (s) by zi , (i = 1, · · · , nz + nf ) and assume also that these zeros are distinct. Define f (s) := tr{(1 − ǫ)U T Nm (s) −1 −T T ΘQ o (s)Θo (0)Nm (0)U } and  factorize f (s) as f (s) := Ns s̄ (s − s)(s (s̄ + s)) fm (s), where si ∈ C+ are the i i i=1 i i nonminimum phase zeros of f (s) and fm (s) is minimum phase. It is noted that, f (s), fm (s) ∈ RH∞, f (0) = fm (0) = Pl 2 σ i=1 i . Then, with the two-parameter controller given in Fig.1 " nz +nf l X Re(zi ) X J =2(1 − ǫ) σj2 cos2 ∠(ηi , ej ) 2 |z | i i=1 j=1 ∗ compensators. The communication channel is characterized by three parameters: the AWGN n, the channel transfer functions F and H. The channel transfer function F (s) ∈ RH∞ modeling the bandwidth limitation is assumed to be stable and NMP [4]. Then F (s) = diag[f1 (s), f2 (s), · · · , fl (s)], where f1 (s) = f2 (s) = · · · = fl (s). F (s) has nf distinct NMP zeros. The channel transfer function H(s) ∈ RH∞ , colors the additive white Gaussian noise. The performance index of the system is defined as J = E[(1 − ǫ)(r(t) − y(t))T (r(t) − y(t)) + ǫuTc (t)uc (t)], (5) where the parameter ǫ (0 ≤ ǫ ≤ 1) is pre-set and can be used to weigh the relative importance of tracking objective and the plant control input energy constraint. For the transfer function matrices P and P F , let their right and left coprime factorizations respectively be given by P F = N M −1 = M̃ −1 Ñ , P = N0 M −1 , where N, N0 , M, Ñ , M̃ ∈ RH∞ , and satisfy the double Bezout identity    X̃ −Ỹ M Y = I. (6) N X −Ñ M̃ Then the set of all stabilizing two parameter compensators is characterized by !# Z +∞ Ns l X X 1 log |f (jω)| Res i − dω σi2 ) +( |si |2 π 0 ω2 i=1 i=1 nz +nf + X 4Re(zi )Re(zj ) ωjH Dir (zj )DirH (zi )ωi z̄ + z i j i,j=1 H × ωiH Dil (zi )V H OH (zi )O(zj )V Djl (zj )ωj . Proof: From (7), we have J := (1 − ǫ)tr{Rêr (0) + Ryn (0)} + ǫtr{Rucr (0) + Rucn (0)}, (8) where Rêr (t), Ryn (t), Rucr (t) and Rucn (t), are the autocorrelation functions of the random processes êr (t), yn (t), ucr (t) and ucn (t), respectively. Denote the spectral densities of r and n as Sr (jω) and Sn (jω) respectively. Then we have Z 1 J =(1 − ǫ) 2π −∞ Ks := {K : K = [K1 K2 ] = (X̃ − RÑ )−1 × [Q Ỹ − RM̃ ], Q ∈ RH∞ , R ∈ RH∞ }. According to (5), we may rewrite the performance index J as  2 J := E (1 − ǫ)(kr(t) − yr (t)k  2 2 + kyn (t)k ) + ǫkuc (t)k , (7) where yr (t) and yn (t) are the outputs in response to r and n, respectively. And the tracking error ê is given by ê(t) := r(t) − yr (t). +∞ tr(Têr Sr (jω)TT êr )dω  Z +∞ )dω + tr(Tyn Sn (jω)TT yn −∞ 1 +ǫ 2π =(1 − ǫ) Z +∞ tr(Tucr Sr (jω)TT ucr )dω  Z +∞ )dω + tr(Tucn Sn (jω)TT ucn −∞ ! 2 2 1 + T yn V Têr U s 2 2 ! 2 2 1 + ǫ Tucr U + Tucn V s 2 2 −∞ IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMSŁI: REGULAR PAPERS 2  1  I − (I − P F K2 )−1 P F K1 U s =(1 − ǫ) 2 + (I − P F K2 ) (I − F K2 P )−1 F K1 U 1 s From (9), the following equation can be obtained 2 −1 +ǫ 4 P HV 2 T ΘTo (−jω)Θo (jω) = (1 − ǫ)Nm (−jω)Nm (jω) ! + ǫ(CFT M (−jω)CF M (jω)). From (10), one can define the following matrix function with its module equal to 1,   ΘTi (−jω) Ψ(jω) = . 1 − Θi (jω)ΘTi (−jω) 2 2 2 −1 + (I − F K2 P ) HV 2 ! √  2 1 1− ǫ(I − N Q) √ = U ǫF M Q s 2 √  1 − ǫP M (X̃ − RÑ ) √ + HV ǫM (X̃ − RÑ ) So according to the property of the matrix norm, JU1 becomes  √    √ 2 1 − 1 − ǫI 1 − ǫN m ∗ JU1 = inf Ψ Q U + √ 0 ǫCF M Q∈RH∞ s 2 2 = 2 =JU + JV , inf Q∈RH∞ (A1 + Θo Q)U 1 s 2 + A2 U 2 1 s 2 , 2 where where  √  − 1 − ǫI H = −(1 − ǫ) Θ−H o Nm , 0  √   √  − 1 − εI − 1 − ǫI A2 =(1 − Θi ΘH ) = − Θi A1 i 0 0  √  −1 −H H 1 − ε −I + o Θ o Nm √ (1 − ǫ)Nm Θ−H = . H (1 − ε) ǫCF M Θ−1 Θ o o Nm A1 =ΘH i U = diag[σ1 , σ2 , · · · , σl ], V = diag[γ1 , γ2 , · · · , γl ]. Evidently, we have J ∗ = inf J = K∈K inf Q∈RH∞ JU + inf R∈RH∞ JV = JU∗ + JV∗ . Firstly, for JU , using the allpass factorization (2), we have √  2 1 1− ǫ(I − N Q) ∗ √ JU = inf U ǫF M Q Q∈RH∞ s 2  √ 2 −1 1 1 − ǫ(L − I) = inf U 0 Q∈RH∞ s 2  √   √ 1 1 1 − ǫI − √1 − ǫNm QU + U + ǫCF M 0 s s We then obtain JU∗ 1 = (1 − ǫ)2 2 X Re(zi ) kηiH U k2F + inf JU1 =2(1 − ǫ) 2 Q∈RH∞ |z | i i=1 nz +nf =2(1 − ǫ) m X Re(zi ) X σj2 cos2 ∠(ηi , ej ) + JU∗ 1 , 2 |z | i i=1 j=1 Similar to [22], we may invoke lemma 1, and obtains JU∗ 1 = −(1 − ǫ)f ′ (0). In light of lemma 2, one also obtains " N # Z l s X X Resi 1 +∞ log |f (jω)| 2 ∗ σi ) 2 JU1 = (1−ǫ)( dω . − |si | π −∞ ω2 i=1 i=1 Thus, we have where CF M is the minimum phase part of F M , ηi is the direction vector associated with the zero of P F , ej is unitary a column vector, whose j-th element is 1 and the remaining elements 0, and √     √ 2 1 1 − ǫI − √1 − ǫNm JU∗ 1 = inf Q U + 0 ǫCF M Q∈RH∞ s 2    √  √ 2 1 1 − ǫNm − 1 − ǫI Q U = inf + √ . ǫCF M 0 Q∈RH∞ s 2 Furthermore, we perform an inner-outer factorization given in [32], such that  √ 1 − ǫNm √ = Θi Θo , (9) ǫCF M where Θi ∈ RH∞ is an inner matrix function, and Θo ∈ RH∞ is an outer. According to the definition of an inner matrix function, we have ΘTi (−jω)Θi (jω) = I.  1 1 H + A2 U . − Θ−H o (0)Nm (0) U s s 2 nz +nf H Θ−H o Nm (10) JU∗ " nz +nf l X Re(zi ) X σj2 cos2 ∠(ηi , ej ) =2(1 − ǫ) 2 |z | i j=1 i=1 !# Z Ns l X X Resi 1 +∞ log |f (jω)| 2 σi ) +( − dω . |si |2 π 0 ω2 i=1 i=1 Secondly, for JV , we have  √ 1 − ǫP M (X̃ − RÑ ) √ HV JV = ǫM (X̃ − RÑ ) √  1√− ǫNom = (X̃ − RÑ )HV ǫMm 2 2 2 , 2 where Nom is the minimum phase part of No . Similar to the equation (9), we perform an inner-outer factorization such that  √ 1√− ǫNom = ∆i ∆0 . ǫMm IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMSŁI: REGULAR PAPERS 5 In addition, similar to [31], we factorize Ñ HV = CD, where C is the minimum phase part, D ∈ RH∞ is an allpass factor which can be formed as nz +nf Y D(s) := Di (s), i=1 Di (s) :=[ωi Wi ] s−zi s+z̄i  0 0 I  ωiH WiH  . (11) Fig. 2. Feedback control over AWGN channels Hence, in light of Lemma 3, we have JV = ∆0 (X̃HV − RCD) 2 2 = ∆0 X̃HV D−1 − ∆0 RC 2 2 nz +nf = X O(zi )V Dil (zi )[Di−1 i=1 2 − Di−1 (∞)]Dir (zi ) + R1 − ∆0 RC , 2 where R1 ∈ RH∞ , and O(zi ) =∆0 (zi )X̃(zi )H(zi ) = ∆0 (zi )M −1 (zi )H(zi ), −1 Dil (zi ) =D1−1 (zi )D2−1 (zi ) · · · Di−1 (zi ),  Q Ns and factorize f (s) := i=1 s̄i (si − s)/(si (s̄i + s)) fm (s), where si ∈ C+ are the nonminimum phase zeros of f (s) and fm (s) is minimum phase. that, f (s), fm (s) ∈ PItl is noted 2 RH∞, f (0) = fm (0) = i=1 σi . Then, with the twoparameter controller given in Fig.2, " n m z X Re(zi ) X 2 σj cos2 ∠(ηi , ej ) J ∗ =2(1 − ǫ) 2 |z | i j=1 i=1 !# Z Ns l X X Resi 1 +∞ log |f (jω)| 2 σi ) +( − dω |si |2 π 0 ω2 i=1 i=1 nz X 4Re(zi )Re(zj ) H r + ω̂j D̂i (zj )D̂irH (zi )ω̂i z̄ + z i j i,j=1 −1 −1 Dir (zi ) =Di+1 (zi )Di+2 (zi ) · · · Dn−1 (zi ). z +nf Since ∆0 is right invertible and C left invertible, we have × ÔH (zi )Ô(zj )V D̂jl (zj )ω̂j ω̂iH D̂il nz +nf JV∗ = inf R∈RH∞ X i=1 nz +nf 2 2 + kR1 − ∆0 RCk2 2 nz +nf = 2 Di−1 (∞)]Dir (zi ) O(zi )V 2Re(zi ) Dil (zi ) ωi ωiH Dir (zi ) s − zi (zi )V H . Proof: Similar to the proof of Theorem 1, we have the performance index i=1 − X O(zi )V Dil (zi )[Di−1 H 2 X 4Re(zi )Re(zj ) ωjH Dir (zj )DirH (zi )ωi = z̄ + z i j i,j=1 H ωiH Dil (zi )V H OH (zi )O(zj )V Djl (zj )ωj . The proof is thus completed. Remark 1: When there is no network channel, because the Brownian motion random process is different from the step signal vector with deterministic direction, this result can not be degraded to the results in literature [22]. Corollary 1: If the system P (s) are SISO in Theorem 1, then the optimal tracking performance can be written as  nzX +nf Ns Resi Re(zi ) X + J ∗ =2(1 − ǫ)σ 2 2 |zi | |si |2 i=1 i=1  nz +nf Z X r̃¯i r̃j 1 +∞ log |f (jω)| 2 dω + γ . − π 0 ω2 z̄ + zj i,j=1 i where r̃i = Ress=zi ∆o (zi )M −1 (zi )H(zi )L̂−1 i Corollary 2: Consider the simple channel case with F = I and H = I. Under the assumptions in Theorem 1, de−T T fine f (s) := tr{(1 − ǫ)U T Nm (s)Λ−1 o (s)Λo (0)Nm (0)U }, J :=(1 − ǫ)tr{Rêr (0) + Ryn (0)} + ǫtr{Rucr (0) + Rucn (0)} 1 =(1 − ǫ)(kTêr U k + kTyn V k) s 1 + ǫ(kTucr U k + kTucn V k) s √  2 1 1 −√ǫ(I − N Q) = U ǫM Q s 2 √  2 1 − ǫN (X̃ − RÑ ) √ + V ǫM (X̃ − RÑ ) 2 =JU + JV . √ √ H H H Let 1 − ǫNm ǫMm = Λi Λo , we can obtain JU∗ " = 2(1 − ǫ) nz n X Re(zi ) X i=1 |zi |2 σj2 cos2 ∠(ηi , ej ) j=1 !# Z +∞ Ns l X X Res 1 log |f (jω)| i σi2 ) +( − dω . |si |2 π 0 ω2 i=1 i=1 For JV , we have  √ 2 1 − ǫN (X̃ − RÑ ) √ JV = V ǫM (X̃ − RÑ ) 2  √ 2 1 − ǫNm √ = (X̃ − RÑ )V . ǫMm 2 In addition, we factorize Ñ V = Ĉ D̂, where Ĉ is the minimum phase part, D̂ ∈ RH∞ is an allpass factor which can be formed IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMSŁI: REGULAR PAPERS as D̂(s) := nz Y D̂i (s), i=1 D̂i (s) :=[ω̂i Ŵi ]  s−zi s+z̄i 0 0 I  ω̂iH ŴiH  . Similar to the proof of Theorem 1, we can obtain 6 where P is the predetermined input power threshold. With the performance index (12), for the system to be stabilizable and obtain the optimal tracking performance, the channel SNR must satisfy np X r̄i rj P > + PAd , γ2 p̄ + pj i i,j=1 where nz X 4Re(zi )Re(zj ) H r ω̂j D̂i (zj )D̂irH (zi )ω̂i JV∗ = z̄ + z i j i,j=1 ω̂iH D̂il H np X PAd = Nom (pi )N The proof is thus completed. If there is no channel noise in the configuration of the feedback control system depicted in Fig.2, then the following result can be immediately obtained. Corollary 3: Consider the case of Fig.2, and suppose that the channel is noise-free. Under the same assumptions described in Theorem 1, we have X nz l Re(zi ) X 2 σj cos2 ∠(ηi , ej ) J ∗ =JU∗ = 2(1 − ǫ) 2 |z | i j=1 i=1 ! Z N l s X Resf i X 1 +∞ log |f (jω)| 2 σj ) +( − dω . |sf i |2 π 0 ω2 i=1 j=1 Remark 2: If we do not consider the impact of the system control input, i.e. setting ǫ = 0, and σj = 1, (j = 1, 2, · · · , l). From the expression in corollary 3, it can be observed that for a feedback control system with a two-parameter compensators, when the tracking target is the Brownian motion, the performance limitation depends on the nonminimum phase zeros, the plant gain at all frequencies and their directions unitary vectors. In what follows, we will discuss the relationship between stabilizability, the performance limits and channel characteristics under simplified conditions, we do some appropriate simplifications and assumptions. Consider the SISO system P (s) in Fig.1 and the simplified performance J as  (12) J := E kr(t) − yr (t)k2 + kyn (t)k2 . The relationship between the stabilizability, tracking performance and the channel signal-to-noise ratio (SNR) can be summarized as shown in the following theorem. Theorem 2: Consider the feedback control system of Fig.1. Suppose that P (s) is a scalar transfer function. Under the assumptions in Theorem 1, the system P (s) is stabilizable only if the admissible channel SNR satisfies np X r̄i rj P > , γ2 p̄ + pj i,j=1 i X Nom (zi )M −1 B̃k−1 (pi ) ! nz +nf Y (zi )H(zi ) i=1 Ô(zi ) =Λ0 (zi )M −1 (zi ), L̂−1 k (zi ) k=1,k6=i 2 −1 + S Nm M̃m −1 D̂il (zi ) =D̂1−1 (zi )D̂2−1 (zi ) · · · D̂i−1 (zi ), np Y k=1,k6=i nz +nf − −1 −1 (zi ). =D̂i+1 (zi )D̂i+2 (zi ) · · · D̂n−1 z (pi )H(pi ) i=1 (zi )V H ÔH (zi )Ô(zj )V D̂jl (zj )ω̂j , where D̂ir (zi ) −1 , (13) 2 and the optimal tracking performance is given as nz +nf ∗ J = 2σ 2 nz +nf X Re(zi ) X r̂¯i r̂j 2 + γ |zi |2 (z̄i + zj ) i=1 i,j=1 where ri =Ress=pi Nom (pi )N −1 (pi )H(pi )B̃i−1 ; r̂i =Ress=zi Nom (zi )M −1 (zi )H(zi )L̂−1 i . Proof: Using the equation (12), similar to the proof of the theorem 1, we have  1 J :=tr Rêr (0) + Ryn (0) = Têr U s = (1 − N Q)U =  1 s 2 + Ty n V 2 2 2 2 2 + P M (X − RN )HV  1 (L−1 − 1) + (1 − Nm Q) U s = (L 2 2 2 2 2 + Nom (X L̂−1 − RNm )HV −1 1 − 1)U s 2 1 + (1 − Nm Q)U s 2 2 2 2 2 + Nom (X L̂−1 − RNm )HV nz +nf =2σ 2 X Re(zi ) |zi |2 i=1 2 2 + Nom (X L̂−1 − RNm )HV . (14) 2 Based on the allpass factorization (3) and Lemma 3, we can write nz +nf Nom XH L̂−1 = S + X Nom (zi ) i=1 × X(zi )H(zi )L̂−1 (zi )L̂i (zi )L̂−1 i , IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMSŁI: REGULAR PAPERS 2 where S ∈ RH∞ . Then 2 Nom (X L̂−1 − RNm )HV 2 nz +nf X =γ 2 R1 − Nom RNm H + Nom (zi )X(zi ) i=1 =γ R1 − Nom RNm H × where L̂li (zi )L̂ri (zi ) +γ X 2 2 × np Y B̃i−1 (∞)] − k=1,k6=i ku(t)∗ kPow nz +nf 2 × [B̃i−1  L̂−1 i O1 (zi ) −  L̂i−1 (∞) B̃k−1 (pi ) − Nom RH M̃m = γ2 S (15) O1 (zi )L̂li (zi )L̂ri (zi ). ku∗ (t)kPow nz +nf nz +nf X Re(zi ) X 4Re(zi )Re(zj ) 2 J ∗ =2σ 2 + γ 2 |zi | z̄i + zj i=1 i,j=1  H × O1 (zi )L̂li (zi )L̂ri (zi ) O1 (zi )L̂li (zi )L̂ri (zi ) nz +nf nz +nf X Re(zi ) X 2 O1H (zi )O1 (zi ) + γ 2 |z | i i=1 i,j=1 nz +nf =2σ 2 k=1,k6=i nz +nf (z̄k + zi )(zk + z̄j ) (z̄k − z̄i )(zk − zj ) X Re(zi ) X r̂¯i r̂j + γ2 2 |zi | (z̄i + zj ) i=1 i,j=1 where r̂i is the residue of O1 (pi )L̂−1 (s) at s = zi . In addition, suppose that the input r(t) = 0. The channel input is required to satisfy the power constraint kukPow < P for some predetermined input power level P > 0. ku(t)kPow =E[uT (t)u(t)] = tr[Run (0)] Z +∞  = tr Tun Sn (jw)TuTn dw i=1 k=1,k6=i np Y Nom (pi )Y (pi )H(pi ) B̃k−1 (pi ) k=1,k6=i 2 × np Y SL np X = γ2 np = γ2 X i,j=1 2 r̄i rj p̄i + pj (19) B̃k−1 (pi ) (20) Nom (pi )Y (pi )H(pi ) i=1 B̃k−1 (pi ) k=1,k6=i 2 − Nom RH M̃m ∗ = ku (t)kPow S + γ2 2 2 + γ PAd . np X i,j=1 r̄i rj p̄i + pj where PAd is given by equation (13). Then, P > ku∗ (t)kPow S /γ 2 + PAd . γ2 The proof is now completed. Remark 3: Theorem 2 shows that for a system to achieve for a best tracking performance in addition to stabilization, its signal-to-noise ratio must be greater than that required only for stabilization. IV. S IMULATION STUDIES Consider the plant P = (s − k)/(s(s + 1)). The LTI filters used to model the finite bandwidth F (s) and colored noise H(s) of the communication link are both chosen to be low-pass Butterworth filters of order 1. F (s) = f /(s + f ), −∞ =kTun V k22 = kNo (Ỹ − RM̃ )HV k22  =γ 2 kNom Y H B̃ −1 − RH M̃m k22 np np Y X 2 Nom (pi )Y (pi )H(pi ) =γ 2 This is the result of [4]. However, in many cases, not only the stabilizability needs to be considered, but also the system tracking performance. In this case, via noting equations (16),(18) and (19), we have (17) From equations (14),(15) and (17), we have nz Y (18) np X r̄i rj P > . 2 γ p̄ + pj i,j=1 i (16) O1 (zi ) = Nom (zi )M −1 (zi )H(zi ). 4Re(zi )Re(zj ) (z̄i + zj ) . where ri = Ress=pi Nom (pi )N −1 (pi )H(pi )B̃i−1 is the residue of Nom (pi )N −1 (pi )H(pi )B̃i−1 at s = pi . Therefore, for the feedback system to be stabilizable, the channel SNR must satisfy By using the Bezout identity XM − Y N = 1, O1 (zi ) can be written as × np X × [B̃i−1 − B̃i−1 (∞)] i=1 =2σ 2 2 i=1 nz +nf R1 (s) =S + Nom (pi )Y (pi )H(pi ) i=1 2 i=1 O1 (zi ) = Nom (zi )X(zi )H(zi ), −1 −1 L̂li (zi ) = L̂−1 1 (zi )L̂2 (zi ) · · · L̂i−1 (zi ), −1 −1 L̂ri (zi ) = L̂−1 i+1 (zi )L̂i+2 (zi ) · · · L̂nz (zi ), X +γ np X 2 When only the stabilizability is considered regardless of the tracking performance, we have   × H(zi )L̂li (zi )L̂ri (zi ) L̂i−1 − L̂i−1 (∞) 2 7 H(s) = h/(s + h), where k ∈ [1, 10], and f > 0, h > 0. Clearly, P (s) is of minimum phase. Fig.3 shows the optimal performances plotted for different values of ǫ. Two observations can be obtained from Fig.4, where the optimal performance is plotted with respect to bandwidth of both F(s) and IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMSŁI: REGULAR PAPERS H(s). First, the system tracking performance becomes better as the available bandwidth of the communication channel decreases. Secondly, if the noise is colored by a low pass filter, the decrease of its cutoff frequency would lead to the better tracking performance. Fig.5 shows that the reference signal and ACGN will deteriorate tracking performance. 12 10 8 J* ε=0.99 V. C ONCLUSIONS 6 ε=0.7 4 ε=0.4 2 ε=0.01 0 1 2 3 4 5 6 7 8 9 10 k Fig. 3. J ∗ with respect to k for different ǫ.(f = 3, h = 4, σ = 1, γ = 0.8) 1.6 J* 1.5 1.4 150 60 100 40 50 20 0 H Bandwidth [rad/sec] 0 F Bandwidth [rad/sec] J ∗ with respect to F and H.(k = 2, ǫ = 0.5, σ = 1, γ = 0.8) Fig. 4. In this paper, we have investigated the best attainable tracking performance of networked MIMO control systems in tracking the Brownian motion over a limited bandwidth and additive colored white Gaussian noise channel. We have derived explicit expressions of the best performance in terms of the tracking error and the control input energy. It has been shown that, due to the existence of the network, the best achievable tracking performance will be adversely affected by several factors, such as the nonminimum phase zeros and their directions of the plant, the colored additive white Gaussian noise, the basic network parameters, such as bandwidth. Finally, some simulation results are given to illustrate the obtained results. Furthermore, one possible future work is to consider more realistic network-induced constraints, such as time-delay and dropout issues which is much more challenging. When the networked control system contains the nondeterministic or hybrid switching [33]–[35], the issue of tracking performance also deserves further study. R EFERENCES 1.3 100 80 J* 60 40 20 0 4 3 10 8 2 6 4 1 γ Fig. 5. 8 0 2 0 σ J ∗ with respect to σ and γ.(k = 2, ǫ = 0.5, f = 3, h = 4) [1] J.H. Braslavsky, R.H. Middleton, and J.S. Freudenberg, “Feedback stabilization over signal-to-noise ratio constrained channels,” IEEE Transactions on Automatic Control, vol. 52, no. 8, pp. 1391–1403, 2007. [2] Y. Li, E. Tuncel, and J. Chen, “Optimal tracking over an additive white gaussian noise channel,” Proceedings of the 2009 American Control Conference, MO, USA, 2009, pp. 4026–4031. [3] X. Zhan, Z. Guan, J. Xiao, and Y. Wang, “Performance limitations in tracking of linear system with measurement noise,” Proceedings of the 29nd IEEE Conference on Chinese Control Conference, Beijing, China, 2010, pp. 1614–1617. [4] A.J. Rojas, J.H. Braslavsky, and R.H. Middleton, “Fundamental limitations in control over a communication channel,” Automatica, vol. 44, no. 12, pp. 3147–3151, 2008. [5] N. Xiao and L. Xie, “Feedback stabilization over stochastic multiplicative input channels: Continuous-time case,” Proceedings of the 11th International Conference Control, Automation, Robotics and Vision, Singapore, 2010, pp. 543–548. [6] P.P. Menon and C. Edwards, “Static output feedback stabilisation and synchronisation of complex networks with H2 performance,” International Journal of Robust and Nonlinear Control, vol. 20, no. 6, pp. 703–718, 2010. [7] Z.H. Guan, X.S. Zhan, and G. Feng, “Optimal tracking performance of mimo discrete-time systems with communication constraints,” International Journal of Robust and Nonlinear Control, Wiley Online Library. [8] H. Zhang, H. Yan, F. Yang, and Q. Chen, “Quantized Control Design for Impulsive Fuzzy Networked Systems,” IEEE Transactions on Fuzzy Systems, vol. 19, no. 6, pp. 1153-1162, 2011. [9] SI Azuma and T. Sugie, “Dynamic Quantization of Nonlinear Control Systems,” IEEE Transactions on Automatic Control, vol. 57, no. 4, pp. 875-888, 2012. [10] T. Qi and W. Su, “Optimal tracking and tracking performance constraints from quantization,” Proceedings of the 7th Asian Control Conference, China, 2009, pp. 447–452. [11] K. You, W. Su, M. Fu, and L. Xie, “Optimality of the logarithmic quantizer for stabilization of linear systems: Achieving the minimum data rate,” Proceedings of the 48th IEEE Conference on Decision and Control and 28th Chinese Control Conference, China, 2009, pp. 4075–4080. IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMSŁI: REGULAR PAPERS [12] N. Xiao, L. Xie, and M. Fu, “Stabilization of Markov jump linear systems using quantized state feedback,” Automatica, vol. 46, no. 10, pp. 1696–1702, 2010. [13] X. Luan, P. Shi, and F. Liu, “Stabilization of Networked Control Systems with Random Delays,” IEEE Transactions on Industrial Electronics, vol. 58, no. 9, pp. 4323-4330, 2011. [14] G. Wei, Z. Wang, X. He, and H. Shu, “Filtering for Networked Stochastic Time-Delay Systems With Sector Nonlinearity,” IEEE Transactions on Circuits and Systems II:Express Briefs, vol. 56, no. 1, pp. 71–75, 2009. [15] G.P. Liu, “Predictive Controller Design of Networked Systems With Communication Delays and Data Loss,” IEEE Transactions on Circuits and Systems II: Express Briefs, vol. 57, no. 6, pp. 481–485, 2010. [16] A.J. Rojas, J.H. Braslavsky, and R.H. Middleton, “Output feedback stabilisation over bandwidth limited, signal to noise ratio constrained communication channels,” Proceedings of the 29th American Control Conference, Minnesota, USA, 2006, pp. 14–16. [17] M. Trivellato and N. Benvenuto, “State Control in Networked Control Systems under Packet Drops and Limited Transmission Bandwidth,” IEEE Transactions on Communications, vol. 58, no. 2, pp. 611–622, 2010. [18] J. Wu and T. Chen, “Design of networked control systems with packet dropouts,” IEEE Transactions on Automatic Control, vol. 52, no. 7, pp. 1314–1319, 2007. [19] Y. Wang, W. Liu, X. Zhu, and Z. Du, “A survey of networked control systems with delay and packet dropout,” Proceedings of 2011 Chinese Control and Decision Conference (CCDC), 2011, pp. 2342–2346. [20] K. You, M. Fu, and L. Xie, “Mean square stability for Kalman filtering with Markovian packet losses,” Automatics, vol.47, no.12, pp.2647–2657, 2011. [21] O. Toker, J. Chen, and L. Qiu, “Tracking performance limitations in LTI multivariable discrete-time systems,” IEEE Transactions on Circuits and Systems I, Fundamental Theory and Applications, vol. 49, no. 5, pp. 657–670, 2002. [22] J. Chen, S. Hara, and G. Chen, “Best tracking and regulation performance under control energy constraint,” IEEE Transactions on Automatic Control, vol. 48, no. 8, pp. 1320–1336, 2003. [23] T. Bakhtiar and S. Hara, “Regulation performance limitations for simo linear time-invariant feedback control systems,” Automatica, vol. 44, no. 3, pp. 659–670, 2008. [24] B.X. Wang, Z.H. Guan, and F.S. Yuan, “Optimal tracking and twochannel disturbance rejection under control energy constraint,” Automatica, vol. 47, no. 4, pp. 733–738, 2011. [25] M. Morari and E. Zafiriou, Robust process control. Englewood Cliffs. NJ:Prentice-Hall, 1989. [26] J. Chen, L. Qiu, and O. Toker, “Limitations on maximal tracking accuracy,” IEEE Transactions on Automatic Control, vol. 45, no. 2, pp. 326–331, 2000. [27] L. Ding, H. Wang, Z. Guan, and J. Chen, “Tracking under additive white gaussian noise effect,” IET Control Theory and Application, vol. 4, no. 11, pp. 2471–2478, 2010. [28] L. Qiu, Z. Ren, and J. Chen, “Fundamental performance limitations in estimation problems,” Communications in Information and Systems, vol. 2, no. 4, pp. 371–384, 2002. [29] X.S. Zhan , Z.H. Guan , R.Q. Liao , F.S Yuan. “Optimal Performance in Tracking Stochastic Signal under Disturbance Rejection”. Asian Journal of Control. DOI: 10.1002/asjc.494. [30] H. Wang, L. Ding, Z. Guan, and J. Chen, “Limitations on minimum tracking energy for siso plants,” Proceedings of the Control and Decision Conference, China, 2009, pp. 1432–1437. [31] Y. Li, E. Tuncel, and J. Chen, “Optimal tracking and power allocation over an additive white noise channel,” Proceedings of the IEEE International Conference on Control and Automation, New Zealand, 2009, pp. 1541–1546. [32] B.A. Francis, A Course in H∞ Control Theory, ser. Lecture Notes in Control and Information Science. Berlin, Germany: Springer-Verlag, 1987. [33] Z. H. Guan, D. J. Hill, and X. Shen. On hybrid impulsive and switching systems and application to nonlinear control. IEEE Transactions on Automatic and Control, vol. 50, no. 7, pp. 1058-1062, 2005. [34] L. Zhang, N. Cui, M. Liu, and Y. Zhao, “Asynchronous Filtering of Discrete-Time Switched Linear Systems With Average Dwell Time,” IEEE Transactions on Circuits and Systems I: Regular Papers, vol. 58, no. 5, pp. 1109–1118, 2011. [35] L. Zhang and L. James , “Necessary and Sufficient Conditions for Analysis and Synthesis of Markov Jump Linear Systems With Incomplete Transition Descriptions,” IEEE Transactions on Automatic and Control, vol. 55, no. 7, pp. 1695–1701, 2010. 9 Zhi-Hong Guan received PhD degree in Automatic Control Theory and Applications from the South China University of Technology, Guangzhou, China, in 1994. He was a Full Professor of Mathematics and Automatic Control with the Jianghan Petroleum Institute, Jingzhou, China in 1994. Since December 1997, he has been Full Professor of the Department of Control Science and Engineering, Executive Associate Director of the Centre for Nonlinear and Complex Systems and Director of the Control and Information Technology in the Huazhong University of Science and Technology (HUST), Wuhan, China. Since 1999, he has held visiting positions at the Harvard University, USA, the Central Queensland University, Australia, the Loughborough University, UK, the National University of Singapore, the University of Hong Kong, and the City University of Hong Kong. Currently, he is the Associate Editor of the ”Journal of Control Theory and Applications”, the international ”Journal of Nonlinear Systems and Application”, and severs as a Member of the Committee of Control Theory of the Chinese Association of Automation, Executive Committee Member and also Director of the Control Theory Committee of the Hubei Province Association of Automation. His research interests include complex systems and complex networks, impulsive and hybrid control systems, networked control systems, multi-agent systems. Chao-Yang Chen was born in Hunan, China, 1984. He graduated in mathematics from Hunan University of Science and Technology, Xiangtan, China, in 2003, and received the M.S. degree at Department of Mathematics in Guangxi Teachers Education University. Currently, he is working towards the Ph.D. Degree at the Department of Control Science and Engineering, Huazhong University of Science and Technology, Wuhan, China. His research interests include networked control systems, complex dynamical networks, impulsive and hybrid control systems. Gang Feng received the B.Eng and M.Eng. degrees in Automatic Control from Nanjing Aeronautical Institute, China in 1982 and in 1984 respectively, and the Ph.D. degree in Electrical Engineering from the University of Melbourne, Australia in 1992. He has been with City University of Hong Kong since 2000 where he is at present a Chair Professor. He is a ChangJiang Chair professor at Nanjing University of Science and Technology, awarded by Ministry of Education, China. He was lecturer/senior lecturer at School of Electrical Engineering, University of New South Wales, Australia, 1992-1999. He was awarded an Alexander von Humboldt Fellowship in 1997-1998, and the IEEE Transactions on Fuzzy Systems Outstanding Paper Award in 2007. His current research interests include piecewise linear systems, and intelligent systems & control. Prof. Feng is an IEEE Fellow, an associate editor of IEEE Trans. on Fuzzy Systems, and was an associate editor of IEEE Trans. on Systems, Man & Cybernetics, Part C, Journal of Control Theory and Applications, and the Conference Editorial Board of IEEE Control System Society. Tao Li received the Ph.D degree in Huazhong University of Science and Technology, Wuhan, China, in 2008. He is also currently an Associate Professor in the College of Electronics and Information, Yangtze University, Jingzhou, China. His current research interests include nonlinearity complex network systems, complex network theory & application, complex networks spreading dynamics.
3cs.SY
COMPARING POWERS OF EDGE IDEALS arXiv:1709.08701v1 [math.AC] 25 Sep 2017 MIKE JANSSEN, THOMAS KAMP, AND JASON VANDER WOUDE A BSTRACT. Given a nontrivial homogeneous ideal I ⊆ k[ x1 , x2 , . . . , x d ], a problem of great recent interest has been the comparison of the rth ordinary power of I and the mth symbolic power I ( m) . This comparison has been undertaken directly via an exploration of which exponents m and r guarantee the subset containment I ( m) ⊆ I r and asymptotically via a computation of the resurgence ρ( I ), a number for which any m/r > ρ( I ) guarantees I ( m) ⊆ I r . Recently, a third quantity, the symbolic defect, was introduced; as I t ⊆ I ( t), the symbolic defect is the minimal number of generators required to add to I t in order to get I (t) . We consider these various means of comparison when I is the edge ideal of certain graphs by describing an ideal J for which I ( t) = I t + J. When I is the edge ideal of an odd cycle, our description of the structure of I ( t) yields solutions to both the direct and asymptotic containment questions, as well as a partial computation of the sequence of symbolic defects. 1. I NTRODUCTION Let k be an algebraically closed field, and I a nonzero proper homogeneous ideal in R = k[ x0 , x1 , x2 , . . . , x N ]. Recall that the mth symbolic power of I is the ideal   I (m) = R ∩  \ P ∈Ass( I ) I m RP  . Over the last 10–15 years, the structure of I (m) has been an object of ongoing study; see, e.g., the recent survey [5]. One avenue for this study has been the examination of the relationship between I (m) and the well-understood algebraic structure of I r , the rth ordinary power of I. The naive context in which to examine this relationship is via subset containments, i.e., for which m and r, s, and t do we have I s ⊆ I (t) and I (m) ⊆ I r ? In fact, this line of inquiry has been extremely productive. It is straightforward to see that I s ⊆ I (t) if and only if s > t, but determining which r and m give I (m) ⊆ I r is more delicate. Seminal results of Ein-Lazarsfeld-Smith and Hochster-Huneke [8, 11] established that for such ideals, I (m) ⊆ I r if m/r > N. Additional information about the ideal under consideration generally leads to tighter results (see, e.g., [1, 6, 7]). This phenomenon led to Bocci and Harbourne’s introduction of a quantity known as the o resurgence of I, denoted n ρ( I ); it is the least upper bound of the set T = m/r | I (m) 6⊆ I r . Thus, if m/r > ρ( I ), we have I (m) ⊆ I r . Recently, Galetto, Geramita, Shin, and Van Tuyl introduced a new measure of the difference between I (m) and I m known as the symbolic defect. Since I m ⊆ I (m) , the quotient 1 2 MIKE JANSSEN, THOMAS KAMP, AND JASON VANDER WOUDE I (m) / I m is a finite R-module; thus, we let sdefect ( I, m) denote the number of minimal generators of I (m) / I m as an R-module. This is known as the symbolic defect, and the symbolic defect sequence is the sequence {sdefect ( I, m)}m∈N . In [9], the authors study the symbolic defect sequences of star configurations in Pnk and homogeneous ideals of points in P2k . Our work considers all these questions in the context of a class of edge ideals. Let G = (V, E) be a (simple) graph on the vertex set V = { x1 , x2 , . . . , xn } with edge set E. The edge ideal of G, introduced in [14], is the ideal I (G ) ⊆ R = k[ x1 , x2 , . . . , xn ] given by   I ( G ) = ( xi x j | xi , x j ∈ E ) . That is, I (G ) is generated by the products of pairs of those variables between which are edges in G. In [12], the authors establish that, for an edge ideal I = I (G ), we have I (m) = I m for all m > 1 if and only if G is bipartite. A natural question, then, is to explore the relationship between I (G )(m) and I (G )r when G is not bipartite, which is equivalent to G containing an odd cycle. Thus, [15] sought to explore this relationship when G = C2n+1 is a cycle on 2n + 1 vertices. We continue the problem of exploring the structure of the symbolic power I (G )(t) for certain classes of graphs G, with a focus on when G is an odd cycle. The main results of this work are Theorem 4.4 and Corollary 4.5, which together describe a decomposition of the form I (t) = I t + J, where J is a well-understood ideal. We are then able to use this decomposition to resolve a conjecture of [15], compute ρ( I (C2n+1 )) in Theorem 5.11, and establish a partial symbolic defect sequence in Theorem 5.12. We close by showing that our ideas in Theorem 4.4 apply for complete graphs and graphs which consist of an odd cycle plus an additional vertex and edge. Remark. As preparation of this manuscript was concluding in summer 2017, Dao et. al posted the preprint [5]. In particular, their Theorem 4.13 bears a striking resemblance to our Corollary 5.3. While these similarities are worth noting, in part as evidence that interest in symbolic powers is high, it is also worth noting that the aims of these two works are distinct and complementary. The aim of the relevant sections of [5] is to investigate the packing property for edge ideals, while ours is to more directly describe the difference between the ordinary and symbolic powers by investigating the structure of a set of minimal generators for I (t) . We then use information about these generators to compute invariants related to the containment I (m) ⊆ I r . Acknowledgements. This work was supported by Dordt College’s summer undergraduate research program in the summer of 2017. All three authors wish to express deep gratitude to the Dordt College Office of Research and Scholarship for the opportunity to undertake this project. 2. B ACKGROUND RESULTS Edge ideals are an important class of examples of squarefree monomial ideals, i.e., an ideal generated by elements of the form x1a1 x2a2 · · · xnan , where ai ∈ { 0, 1} for all i. When COMPARING POWERS OF EDGE IDEALS 3 I is squarefree monomial, it is well-known that the minimal primary decomposition is of the form I = P1 ∩ · · · ∩ Pr , with Pj = ( x j1 , . . . , x js ) for j = 1, . . . , r. j When I = I (G ) is an edge ideal, the variables in the Pj ’s are precisely the vertices in the minimal vertex covers of G. Recall that, given a graph G = (V, E), a vertex cover of G is a subset V ′ ⊆ V such that for all e ∈ E, e ∩ V ′ 6= ∅. A minimal vertex cover is a vertex cover minimal with respect to inclusion. The minimal vertex covers will be especially useful to us, as they describe the variables needed to decompose an edge ideal into its minimal primes (see, e.g., [13, Corollary 3.35]). Lemma 2.1. Let G be a graph on the vertices { x1 , x2 , . . . , xn }, I = I (G ) ⊆ k[ x1 , x2 , . . . , xn ] be the edge ideal of G and V1 , V2 , . . . , Vr the minimal vertex covers of G. Let Pj be the monomial prime ideal generated by the variables in V j . Then I = P1 ∩ P2 ∩ · · · ∩ Pr and I (m) = P1m ∩ P2m ∩ · · · ∩ Prm . Symbolic powers of squarefree monomial ideals (and, more specifically, edge ideals) have enjoyed a great deal of recent interest (see, e.g., [4, 3]). In [3], a linear programming approach is used to compute invariants related to the containment question. We adapt this technique in Lemma 5.8 for the edge ideals under consideration in this paper. One result of [3] which will be of use is the following, which reduces the problem of determining whether a given monomial is in I (m) to a problem of checking certain (linear) constraints on the exponents of the variables. Lemma 2.2. Let I ⊆ R be a squarefree monomial ideal with minimal primary decomposition I = P1 ∩ P2 ∩ · · · ∩ Pr with Pj = ( x j1 , . . . , x js ) for j = 1, . . . , r. Then x a1 · · · x an ∈ I (m) if and j only if a j1 + . . . + a js > m for j = 1, . . . , r. j Remark 2.3. Throughout this work, we will be exploring questions related to ideals in R = k[ x1 , x2 , . . . , xn ] related to graphs on the vertex set { x1 , x2 , . . . , xn }. We will use the xi ’s interchangeably to represent both vertices and variables. The specific use should be clear from context, and we see this as an opportunity to emphasize the close connection between the graph and the ideal. 3. FACTORING MONOMIALS ALONG ODD CYCLES In this section, we introduce the main ideas of our approach to studying symbolic powers of edge ideals. We begin by defining a means of writing a monomial in a power of an edge ideal with respect to the minimal vertex covers of the graph. We then study this factorization and describe a situation in which it can be improved. In what follows, let R = k[ x1 , x2 , . . . , x2n+1 ] and let I = I (C2n+1 ) be the edge ideal of the odd cycle C2n+1 , i.e., I = ( x1 x2 , x2 x3 , . . . , x2n x2n+1 , x2n+1 x1 ). 4 MIKE JANSSEN, THOMAS KAMP, AND JASON VANDER WOUDE Definition 3.1. Let m ∈ k[ x1 , x2 , . . . , x2n+1 ] be a monomial. Let e j denote the degree two monomial representing the jth edge in the cycle, i.e., e j = x j x j+1 for 1 6 j 6 2n, and e2n+1 = x2n+1 x1 . We may then write a b m = x1a1 x2a2 · · · x2n2n++11 eb11 eb22 · · · e2n2n++11 , where b(m) := ∑ b j is as large as possible (observe 0 6 2b(m) 6 deg(m)) and ai > 0. When m is written in this way, we will call this an optimal factorization of m, or say that m a is expressed in optimal form. In addition, each xi i with ai > 0 in this form will be called an ancillary factor of the optimal factorization, or just an ancillary for short. Observe that the optimal form representation of m is not unique in the sense that different edges may appear as factors of m; for example, in k[ x1 , . . . , x5 ], if m = x21 x22 x3 x4 x5 we may write m = x1 e1 e2 e4 = x2 e1 e3 e5 . a b Lemma 3.2. Let m = x1a1 x2a2 · · · x2n2n++11 eb11 eb22 · · · e2n2n++11 be an optimal factorization, where m ∈ a′ a′ a′ b′ b′ b′ I (C2n+1 ). Then any m′ = x11 x22 · · · x2n2n++11 e11 e22 · · · e2n2n++11 will also be an optimal factorization if 0 6 ai′ 6 ai and 0 6 b′j 6 b j for all i and j. a′ a′ a′ b′ b′ b′ Proof. Let m′ = x11 x22 · · · x2n2n++11 e11 e22 · · · e2n2n++11 such that for all i, j, 0 6 ai′ 6 ai and 0 6 b′j 6 b j . Since each variable’s exponent from m′ is less than or equal to the corresponding exponent from m, we know that m′ divides m. Thus, there must exist some ) ) (b − b ′ ) (b − b ′ ) (b −b′ (a − a′ ( a1 − a′1 ) ( a2 − a′2 ) x2 · · · x2n2n++11 2n+1 e1 1 1 e2 2 2 · · · e2n2n++11 2n+1 such that m = m′ m′′ . Suppose that m′ is not in optimal form. Then there must exist some other way of expressing m′ such that the sum of the exponents of edge factors will be greater in this new m′′ = x1 c d expression. That is, we can re-express m′ as m′ = xc11 xc22 · · · x2n2n++11 ed11 ed22 · · · e2n2n++11 , such that ( a − a′ + c ) (b − b ′ + d ) i i i ei i i i , m will have an edge exponent sum of ∑ bi′ < ∑ di . As m = m′ m′′ = ∏ xi ∑(bi − bi′ + di ) = ∑ bi − ∑ bi′ + ∑ di . As ∑ bi′ < ∑ di , it must be true that this edge exponent sum is greater than ∑ bi . This contradicts the premise that m was expressed in optimal a′ a′ a′ b′ b′ b′ form, and thus m′ = x11 x22 · · · x2n2n++11 e11 e22 · · · e2n2n++11 is an optimal factorization of m′ .  The next lemma describes a process that will be critical in the proof of the main result. Intuitively, it says that if a monomial is factored as a product of an odd number of consecutive edges with ancillaries on both ends of this path of edges, the monomial is not written in optimal form, i.e., it can be rewritten as a product of strictly more edges. a j b j b j+1 b j+2k a j+2k+1 Lemma 3.3. Let m = x j e j e j+1 · · · e j+2k x j+2k+1 , where a j , a j+2k+1 > 1. If it is the case that b j+2h+1 > 1 for all h ∈ {0, . . . , k − 1}, then m is not in optimal form. a j b j b j+1 b j+2k a j+2k+1 Proof. Let m = x j e j e j+1 · · · e j+2k x j+2k+1 and notice that m is a string of adjacent edges with ancillaries on either end. Our goal is to rewrite m in a more optimal form. For clarity, and without loss of generality, let j = 1, and suppose that bi > 1 for all evenly indexed edge exponents. COMPARING POWERS OF EDGE IDEALS 5 Let p = x1 e2 e4 · · · e2k x2k+2 and note that by Lemma 3.2, p must be in optimal form as m is expressed optimally. However, p = x1 e2 e4 · · · e2k x2k+2 = x1 ( x2 x3 )( x4 x5 ) · · · ( x2k x2k+1 ) x2k+2 = ( x1 x2 )( x3 x4 )( x5 x6 ) · · · ( x2k+1 x2k+2 ) = e1 e3 e5 · · · e2k+1 Since p was not initially expressed in optimal form, we know that m could not have been an optimal factorization.  Example 3.4. Let G be a cycle with 111 vertices and consider m = x31 x42 x23 x34 x55 x36 x27 x28 ∈ I (G ) with edge factorization: m = x1 e21 e22 e34 e25 e6 e7 x8 where ei = xi xi +1 . Note that in this factorization, there is an ancillary at x1 and x8 . We will show that m is not in optimal form. We can graphically represent m by drawing an edge between xi and xi +1 for each ei in m and creating a bold outline for each ancillary, as shown below: x1 x2 x3 x4 x5 x6 x7 x8 Using the method outlined in Lemma 3.3, we will “break” each of the red (bolded) edges back into standard xi notation so that we create new ancillaries at every vertex. x1 x2 x3 x4 x5 x6 x7 x8 x1 x2 x3 x4 x5 x6 x7 x8 Note that if we define a new monomial p based on this graphical representation, where p = x1 x2 x3 x4 x5 x6 x7 x8 e21 e2 e24 e25 e7 , it will still be true that m = p because we are merely changing the factorization of the monomial, not its value. As one can see, there are now 8 consecutive ancillaries, which we can pair up in a new way, as shown below. New edges are highlighted in green (bolded in the second line). x1 x2 x3 x4 x5 x6 x7 x8 x1 x2 x3 x4 x5 x6 x7 x8 Now we have a third possible representation q of this monomial. Note that q = e31 e2 e3 e24 e35 e27 , and it is still true that q = p = m. As you can see, this monomial representation has one more edge than our original representation, which means that m is not optimal. 6 MIKE JANSSEN, THOMAS KAMP, AND JASON VANDER WOUDE Example 3.5. Let G be a cycle with 111 vertices in it, and consider the following edge factorization of m = x41 x42 x23 x34 x55 x36 x27 x38 : m = x1 e31 e2 e3 e24 e35 e27 x8 Again, our goal is to determine whether or not m is optimal. Note that m is equal to the monomial q from Example 3.4, except that there are now ancillaries at x1 and x8 . Again, we will create a graphical representation of m, shown below: x1 x2 x3 x4 x5 x6 x7 x8 However, now it is impossible to remove the right combination of edges so that we create an ancillary at every vertex because no edge exists between x6 and x7 . Therefore, we cannot use Lemma 3.3 conclude that m is not optimal. In fact, we have no conclusive way to determine whether m is an optimal factorization at this point. Despite that, this example has not been without value. Note the nonexistence of an edge between x6 and x7 and the fact we would have been able to prove that m was not optimal if not for the nonexistence of at least one of the following: e2 , e4 , e6 . This will be useful for the latter stages of the proof of Theorem 4.4. 4. P OWERS OF EDGE IDEALS AND THEIR STRUCTURES We will now turn to a decomposition of I (t) in terms of I t and another ideal J so that I (t) = I t + J. Our approach has numerous strengths, including the ability to easily compute the symbolic defect of I for certain powers, as well as determining which additional elements are needed to generate I (t) from I t . Although we will primarily focus on odd cycles in this section, we go on to show that the same underlying principles can be extended to edge ideals of other types of graphs; see Section 6 for more. Definition 4.1. Let V ′ ⊆ V (G ) = { x1 , x2 , . . . , x2n+1 } be a set of vertices. For a monomial x a ∈ k[ x1 , x2 , . . . , x2n+1 ] with exponent vector a = (a1 , a2 , . . . , a2n+1 ), define the vertex weight wV ′ ( x a ) to be w V ′ ( x a ) : = ∑ ai . x i ∈V ′ We will usually be interested in the case when V ′ is a (minimal) vertex cover. Using the language of vertex weights, the definition of the symbolic power of an edge ideal given in Lemma 2.2 becomes I (t) = ({ x a | for all minimal vertex covers V ′ , wV ′ ( x a ) > t}). Now define sets L(t) = { x a | deg( x a ) > 2t and for all minimal vertex covers V ′ , wV ′ ( x a ) > t} and D (t) = { x a | deg( x a ) < 2t and for all minimal vertex covers V ′ , wV ′ ( x a ) > t}, COMPARING POWERS OF EDGE IDEALS 7 and generate ideals ( L(t)) and ( D (t)), respectively. Note that I (t) = ( L(t)) + ( D (t)). The main work of this section is to show, for the edge ideal I of an odd cycle, that I t = ( L(t)), which is the content of the Theorem 4.4. Lemma 4.2. Let R = k[ x1 , . . . , xr ], G be a graph on { x1 , . . . , xr }, I = I (G ), and L(t) is as defined above. Then I t ⊆ ( L(t)). b i, j Proof. Suppose m ∈ I t . Write m in optimal form as m = x1a1 · · · xrar ∏i < j ei, j . We know that given an arbitrary minimal vertex cover V ′ and edge ei, j = xi x j dividing m, it must be true that xi ∈ V ′ or x j ∈ V ′ or both. Thus wV ′ (m) > b(m). Further, since m ∈ I t , we know b(m) > t and deg(m) > 2t, which means that m ∈ ( L(t)).  Lemma 4.3. Let R = k[ x1 , . . . , xr ], G be a graph on { x1 , . . . , xr }, I = I (G ), and L(t) be as defined above. Then for all m 6∈ I t , if m has no ancillaries or a single ancillary of degree 1 then m 6∈ ( L(t)). Proof. If there are no ancillaries in m then deg(m) = 2b(m) < 2t. Thus, m cannot be in L(t), which also means that it is not in ( L(t)) as none of the divisors of m are in L(t) for a similar reason. Furthermore, we reach the same conclusion if there is only one ancillary in m and it has an exponent of 1, as deg(m) = 2b(m) + 1 < 2t + 1, and since 2b(m) + 1 and 2t + 1 are both odd, 2b(m) + 1 < 2t.  For the remainder of this section, let R = k[ x1 , x2 , . . . , x2n+1 ], G be an odd cycle of size 2n + 1 with the vertices V (G ) = { x1 , x2 , . . . , x2n+1 }, I be the edge ideal of G, and V ′ ⊆ V (G ) be a minimal vertex cover of G. We make the following definition, which describes the sum of the exponents of a given monomial relative to a set of vertices. Theorem 4.4. Given I and ( L(t)) as defined above, I t = ( L(t)). Proof. By Lemma 4.2 we know that I t ⊆ ( L(t)) so we must only show the reverse containment. Let m 6∈ I t (which implies that b(m) < t), then we will show that m 6∈ ( L(t)). Lemma 4.3 allows us to consider only cases where m either has multiple ancillaries or has a single ancillary of at least degree 2. aℓ aℓ a b Given an arbitrary monomial m 6∈ I t , let m = xℓ 1 xℓ 2 · · · xℓrℓr eb11 eb22 · · · e2n2n++11 be an optimal factorization of m where 1 aℓq x ℓq 2 is an ancillary and 1 6 ℓ1 < ℓ2 < · · · < ℓr 6 2n + 1. Our goal is to show that there exists some vertex cover with a weight equal to b(m), and as b(m) < t, m cannot be in L(t). Since L(t) is the generating set of ( L(t)), this will be sufficient to claim that m 6∈ ( L(t)) because neither m, nor any of its divisors whose vertex weights can only be less than that of m, will be in the generating set. We will construct a minimal vertex cover S of G out of a sequence of subsets S1 , S2 , . . . , Sr of V, where each Sq is a cover for the induced subgraph Hq of G on o n VHq = xℓq , xℓq +1 , . . . , xℓq+1 −1 , xℓq+1 . a aj a For the sake of simplicity, let xi i and x j be a pair of consecutive ancillaries (or let xi i = a aj aℓ a aj aℓ1 −1 xℓrℓr and x j = xℓ 1 in the wraparound case, or let xi i = xℓ1 and x j = xℓ 1 1 in the case of 8 MIKE JANSSEN, THOMAS KAMP, AND JASON VANDER WOUDE a b b b j−1 a j a single ancillary with degree greater than 1). In addition, let mq = xi i ei i ei +i+11 · · · e j−1 x j . Note that by Lemma 3.2, mq is in optimal form. We will show for each subgraph Hq , there exists some set of vertices Sq ⊆ VHq that covers Hq such that w Sq (mq ) = b(mq ). Case 1: Suppose that VHq has an odd number of elements. Consider S q = { xi + 1 , xi + 3 , . . . , x j − 1 } . We claim that w Sq (mq ) = b(mq ). This can be shown as follows: b j−2 b j−1 a j a b b mq = xi i ei i ei +i+11 · · · e j−2 e j−1 x j a = xiai ( xi xi +1 )bi ( xi +1 xi +2 )bi+1 · · · ( x j−2 x j−1 )b j−2 ( x j−1 x j )b j−1 x j j (b + b ) (b + a ) ( ai + b i ) (b i + b i+1 ) (b i+1 + b i+2 ) xi + 1 xi + 2 · · · x j−j−1 2 j−1 x j j−1 j = xi Intuitively, this is because we are selecting alternating vertices to be in Sq , which would guarantee that no edge of mq contributes to the weight twice because edges can only a connect sequentially indexed vertices. Also, there are no ancillaries in mq other than xi i aj and x j , which would increase the weight if they are included. By Definition 4.1, we know that the weight of a monomial with respect to a set of variables will be equal to the sum of the powers of those variables in the given monomial. In this case, w S q ( m q ) = ( bi + bi + 1 ) + ( bi + 2 + bi + 3 ) + . . . + ( b j − 2 + b j − 1 ) j−1 = ∑ bh h=i = b(m q ) Case 2: Suppose now that VHq has an even number of elements. Note that it must contain more vertices than simply xi and x j , because that would imply that there are no vertices between xi and x j and that the two ancillaries are adjacent and could thus be expressed as ei , which would contradict the statement that m is expressed in optimal form. j −i − 1 From Lemma 3.3, we know that for some h satisfying 1 6 h 6 2 , the edge product ei +2h−1 does not appear in the current optimal form of mq , that is, bi +2h−1 = 0. Consider Sq = { xi +1 , xi +3 , . . . , xi +2h−1 , xi +2h , xi +2h+2 , . . . , x j−1 }. We claim that w Sq (mq ) = b(mq ). We see COMPARING POWERS OF EDGE IDEALS a b b 9 b j−2 b j−1 a j mq = xi i ei i ei +i+11 · · · e j−2 e j−1 x j a = xiai ( xi xi +1 )bi ( xi +1 xi +2 )bi+1 · · · ( x j−2 x j−1 )b j−2 ( x j−1 x j )b j−1 x j j (b + b ) (b + a ) ( ai + b i ) (b i + b i+1 ) (b i+1 + b i+2 ) xi + 1 xi + 2 · · · x j−j−1 2 j−1 x j j−1 j . = xi Then: w Sq (mq ) = (bi + bi +1 ) + (bi +2 + bi +3 ) + . . . + (bi +2h−2 + bi +2h−1 ) + (bi +2h−1 + bi +2h ) + (bi +2h+1 + bi +2h+2 ) + . . . + (b j−2 + b j−1 ) j−1 = bi +2h−1 + ∑ bh h=i = bi +2h−1 + b(mq ) = 0 + b(m q ) = b(m q ). Intuitively, this is because of the same reasons that were given when VHq had an odd number of elements, since alternating vertices are again chosen to be in Sq with the exception of xi +2h−1 and xi +2h . However, because the edge product ei +2h−1 does not appear in mq , we are not including any redundant powers in our weight, which means that w Sq (mq ) = b(mq ). Hence, it does not matter whether VHq has an odd or even number of vertices because w Sq (mq ) = b(mq ) regardless. Now, since each S covers its respective set of vertices, the union of all of these disjoint S q subcovers S = Sq is a vertex cover of G. In addition, as each Sq is completely disjoint from any other subgraph’s cover, w S (m) = ∑ w Sq (mq ) = ∑ b(mq ). As each b(mq ) was the number of edges that existed in that induced subgraph representation, and no two subgraphs contained any of the same edges, ∑ b(mq ) = b(m), the total number of edges in an optimal factorization of m. That is, we have constructed a vertex cover S such that w S (m) = b(m) < t. Thus, m ∈ / ( L(t)), and therefore I t = ( L(t)).  Corollary 4.5. Given I and ( D (t)) as above, I (t) = I t + ( D (t)) Proof. Theorem 4.4 states that I t = ( L(t)). As we also know that I (t) = ( L(t)) + ( D (t)), we can simply substitute ( L(t)) with I t . Thus, I (t) = I t + ( D (t)).  Now that we have proved that I (t) = I t + ( D (t)), we will use this result to carry out various computations related to the interplay between ordinary and symbolic powers. We close this section with a brief remark on the proof of Theorem 4.4. Specifically, it relies on the fact that G is a cycle, but not that G is an odd cycle. However, we focus on the odd cycle case as, when G is an even cycle, it is bipartite, and [12] showed in that case that I t = I (t) for all t > 1. 10 MIKE JANSSEN, THOMAS KAMP, AND JASON VANDER WOUDE 5. A PPLICATIONS TO I DEAL C ONTAINMENT Q UESTIONS Given the edge ideal I of an odd cycle C2n+1 , Corollary 4.5 describes a structural relationship between I (t) and I t given any t > 1. In this section, we will exploit this relationship to establish the conjecture of [15]. We then will compute the resurgence of I (C2n+1 ) and explore the symbolic defect of various powers of I. Given I = I (C2n+1 ) ⊆ R = k[ x1 , x2 , . . . , x2n+1 ], recall the definitions of L(t) and D (t), which generate ideals ( L(t)) = I t and ( D (t)), respectively. L(t) = { x a | deg( x a ) > 2t and for all minimal vertex covers V ′ , wV ′ ( x a ) > t} and D (t) = { x a | deg( x a ) < 2t and for all minimal vertex covers V ′ , wV ′ ( x a ) > t}. We will begin by examining D (t). Lemma 5.1. For a given monomial x a , if there exists some i such that ai = 0, then x a 6∈ ( D (t)). Proof. Recall that ( D (t)) is the ideal generated by D (t). Although each graph can have many different minimal vertex covers, there is a certain type of vertex cover that is guaranteed to exist for any odd cycle. This type of cover includes any two adjacent vertices and alternating vertices thereafter. Without loss of generality, consider x a and suppose a1 = 0. Two such minimal vertex covers that include x1 are { x1 , x2 , x4 , x6 , . . . , x2n } and { x1 , x3 , x5 , . . . , x2n+1 }. In order for x a to be in D (t), it must be true that wV ′ ( x a ) > t. This means that a1 + a2 + a4 + . . . + a2n > t and a1 + a3 + . . . + a2n+1 > t. Adding the inequalities yields 2n + 1 a1 + (a1 + a2 + a3 + . . . + a2n+1 ) > 2t. As a1 = 0, it follows that ∑ ai > 2t, which i=1 contradicts the requirement that deg( x a ) < 2t. Hence, any monomial x a with at least one exponent equal to 0 cannot be an element of D (t) or, by extension, ( D (t)).  Lemma 5.2. For a given monomial x a in D (t), if deg( x a ) = 2t − k, then x a is divisible by ( x1 x2 · · · x2n+1 )k . Proof. Let x a be an element of D (t) such that deg( x a ) = 2t − k, and suppose that x a is not divisible by ( x1 x2 · · · x2n+1 )k . This means that there exists an i0 such that ai0 < k. Moreover, since x a ∈ ( D (t)), we must have a j > 0 for all j. If i0 is odd, consider minimal vertex covers  V1 = x1 , x3 , . . . , xi0 , xi0 +1 , xi0 +3 , . . . , x2n and (if i0 is even, use and  V2 = x2 , x4 , . . . , xi0 −1 , xi0 , xi0 +2 , xi0 +4 , . . . , x2n+1  V1 = x1 , x3 , . . . , xi0 −1 , xi0 , xi0 +2 , . . . , x2n  V2 = x2 , x4 , . . . , xi0 , xi0 +1 , xi0 +3 , . . . , x2n+1 ). In order for x a to be in D (t), it must be true that wV j ( x a ) > t for j = 1, 2. When i0 is odd, this means that a1 + a3 + · · · + ai0 + ai0 +1 + · · · + a2n > t and a2 + a4 + · · · + COMPARING POWERS OF EDGE IDEALS 11 ai0 −1 + ai0 + ai0 +2 + · · · + a2n+1 > t (and similarly if i0 is even).  Combining these, we +1 = 2t − k + ai0 < 2t, a see 2t 6 ai0 + (a1 + a2 + a3 + . . . + a2n+1 ) = ai0 + ∑2n s= 1 as contradiction.  The following corollary partially answers [15, Conjecture 16] in the affirmative. Note that this is a restatement of [5, Theorem 4.13]. Corollary 5.3. Let G be an odd cycle of size 2n + 1 and I be its edge ideal. Then I (t) = I t for 1 6 t 6 n. Proof. Suppose that 1 6 t 6 n, and recall that I (t) = I t + ( D (t)), and any element of the generating set D (t) of ( D (t)) must have degree less than 2t. However, since there are 2n + 1 > 2t variables, at least two of them would need to have an exponent of 0 in order to be an element of D (t). But from Lemma 5.1, we know that none of the variables in a monomial in D (t) can have an exponent of 0. Therefore, there are no monomials that satisfy all of the conditions for being in D (t),  which means that it is empty, and thus I (t) = I t when t 6 n. A recent paper of Galetto, Geramita, Shin, and Van Tuyl [9] introduced the notion of symbolic defect, denoted sdefect ( I, t), to measure the difference between the symbolic power I (t) and ordinary power I t ; it is the number of minimal generators of I (t) / I t as an R-module. Corollary 5.3 thus implies that sdefect ( I, t) = 0 for all t satisfying 1 6 t 6 n. Corollary 5.4. Let G be an odd cycle of size 2n + 1 and I be its edge ideal. Then sdefect ( I, n + 1) = 1. In particular, I (n+1) = I n+1 + ( x1 x2 · · · x2n+1 ). Proof. If we let t = n + 1, Proposition 4.5 states that I (n+1) = I n+1 + ( D (n + 1)). Again, recall that ( D (n + 1)) is the ideal generated by D (n + 1) = { x a | deg( x a ) < 2(n + 1) and for all minimal vertex covers V ′ , wV ′ ( x a ) > n + 1}. From this, we know that the degree of any monomial in D (n + 1) must be strictly less than 2n + 2, and from Lemma 5.1, we also know that all variables have an exponent of at least 1. As there are 2n + 1 variables, we can see that if any of the variables has an exponent of at least 2, the total degree of the monomial becomes at least 2n + 2, which is not valid. Thus every monomial that is not x1 x2 · · · x2n+1 is not in D (n + 1). It is straightforward to check that x1 x2 · · · x2n+1 ∈ ( D (n + 1)) and therefore that ( D (n + 1)) = ( x1 x2 · · · x2n+1 ). Thus, I (n+1) = I n+1 + ( x1 x2 · · · x2n+1 ).  Recall that, if 0 6= I ( R = k[ x1 , x2 , . . . , xn ] is a homogenous ideal, the minimal degree of I, denoted α ( I ), is the least degree of a nonzero polynomial in I. In particular, if I is an edge ideal, α ( I ) = 2, and α ( I r ) = 2r for any r > 1. In general, if α ( I (t) ) < α ( I s ), we may conclude that I (t) 6⊆ I s , but the converse need not hold. When I = I (C2n+1 ), however, it does, as the next lemma demonstrates. Lemma 5.5. Let I be the edge ideal of an odd cycle. Then α ( I (t) ) < α ( I s ) if and only if I (t) 6⊆ I s . 12 MIKE JANSSEN, THOMAS KAMP, AND JASON VANDER WOUDE Proof. The forward direction is clear. For the converse, suppose that α ( I (t) ) > α ( I s ). From our definition of symbolic powers, we know I (t) = (m | for all minimal vertex covers V ′ , wV ′ (m) > t). As I t ⊆ I (t) , we note that 2t = α ( I t ) > α ( I (t) ) > α ( I s ) = 2s. Thus, if m ∈ I (t) , wV ′ (m) > t > s and deg(m) > α ( I (t) ) > α ( I s ) = 2s, and we observe I (t) ⊆ (m | deg(m) > 2s and for all minimal vertex covers V ′ , wV ′ (m) > s) = ( L(s)) = Is, which completes the proof.  Despite providing a condition which guarantees containments of the form I (t) ⊆ I s , Lemma 5.5 does not actually compute α ( I (t) ), which is more delicate than computing α ( I s ). We next adapt Lemma 2.2 and the linear programming approach of [3] to compute it. In order to do so, we make the following definition. Definition 5.6. Fix a list of minimal vertex covers V1 , V2 , . . . , Vr for C2n+1 such that |Vi | 6 |Vi +1 |. We define the minimal vertex cover matrix A = (ai j ) to be the matrix of 0’s and 1’s defined by: ( 0 if x j ∈ / Vi (1) ai j = 1 if x j ∈ Vi . Remark 5.7. Note the minimum cardinality for a minimal vertex cover of C2n+1 is n + 1; in fact, there are 2n + 1 minimal vertex covers of size n + 1. As we have seen, there do exist minimal vertex covers of size greater than n + 1. These covers will be accounted for in rows 2n + 2 and higher of the minimal vertex cover matrix A. We first seek a lower bound of α ( I (t) ) using linear programming. Let t = s(n + 1) + d, where 0 6 d 6 n. Consider the following linear program (⋆), where A is the minimal vertex cover matrix,    1 t . b =  ..  , and c =  ...  : 1 t minimize b T y (†) subject to Ay > c and y > 0. We refer to (⋆) as the alpha program, and observe that if y∗ is the value which realizes (†), we have α ( I (t) ) > b T y∗ . Consider the following partition of A: let A′ be the submatrix of A consisting of the first 2n + 1 rows (and thus corresponding to the 2n + 1 minimal vertex covers which contain exactly n + 1 vertices) and B the matrix consisting of the remaining rows of A. We thus create the following sub-program of (†), COMPARING POWERS OF EDGE IDEALS minimize b T y subject to A′ y > c and y > 0. Lemma 5.8. The value of (‡) is 13 (‡) (2n + 1)t n+1 . Proof. We claim that (2) t n+1  t   n+1    y∗ =  .  ,  ..  t n+1 a (2n + 1) × 1 column vector, is a feasible solution to (‡). Indeed, A′ y∗ is a column vector whose entries are all t = s(n + 1) + d, satisfying the constraint of the LP. In this case, (2n + 1)t b T y∗ = n + 1 . To show that this is the value of (‡), we make use of the fundamental theorem of linear programming by showing the existence of an x∗ which produces the same value for the dual linear program: maximize cT x (⋆) subject to ( A′ )T x 6 b and x > 0 Specifically, let  1  n+1  1    ∗ x =  n+. 1  . .  .  1 n+1 As the rows of ( A′ )T again have exactly n + 1 1’s, we see ( A′ )T x∗ 6 b is satisfied, and it (2n + 1)t  is straightforward to check that cT x∗ = b T y∗ = n+1 . Lemma 5.9. The value of (†) is bounded below by (2n + 1)t n+1 . Proof. Observe that (†) is obtained from (‡) by (possibly) introducing additional con(2n + 1)t  straints. Thus, the value of (†) is at least the value of (‡), which is n+1 .   Proposition 5.10. Let t = s(n + 1) + d, where 0 6 d 6 n. Then α ( I (t) ) = 2t − n+t 1 . Proof. By Lemma 5.9, we see that α ( I (t) ) is bounded below by the value of (†), i.e., + 1)t (2n + 1)(s(n + 1)+ d) d d α ( I (t) ) > (2nn+ = (2n + 1)s + 2d − n+ 1 = n+1 1 . As 0 6 n + 1 < 1, it’s enough to find an element of degree (2n + 1)s + 2d in I (t) . We claim that m = x1s+d x2s+d xs3 xs4 · · · xs2n+1 is such an element. Note that any minimal vertex cover V ′ (and hence minimal prime of I) will contain one of x1 and x2 , and at least n − 1 (if it contains both x1 and x2 ) or n (if it contains only one of x1 and x2 ) other vertices. In the former case, wV ′ (m) > 2(s + d) + s(n − 1) = s(n + 1) + 2d > t, and so m ∈ I (t) . In the latter case, wV ′ (m) > (s + d) + sn = s(n + 1) + d = t, and again we see m ∈ I (t) . 14 MIKE JANSSEN, THOMAS KAMP, AND JASON VANDER WOUDE Thus, α ( I (t) ) is an integer satisfying (2n + 1)s + 2d − 6 α ( I (t) ) 6 (2n + 1)s + k j d ( t ) 2d, whence α ( I ) = (2n + 1)s + 2d = 2(n + 1)s + 2d − s = 2t − s − n+1 = 2t − k j  t  d  s + n+ 1 = 2t − n + 1 . d n+1 Recall that, given a nontrivial homogeneous ideal I ⊆ k[ x1 , x2 , . . . , n x2n+1 ], the resur-o gence of I, introduced in [2] and denoted ρ( I ), is the number ρ( I ) = sup m/r | I (m) 6⊆ I r . 2n + 2 Theorem 5.11. If G is an odd cycle of size 2n + 1 and I its edge ideal, then ρ( I ) = 2n +1 . o n Proof. Let T = m/r | I (m) 6⊆ I r , and suppose that I (m) 6⊆ I r so that mr ∈ T. In order for I (m) to not be a subset of I r , it must be true that α ( I (m) ) < α ( I r ) by Lemma 5.5. Since we m know α ( I r ) = 2r and α ( I (m) ) = 2m − ⌊ nm + 1 ⌋ by 5.10, it follows that 2m − ⌊ n + 1 ⌋ < 2r, and m m m 2n + 2 that 2m − nm + 1 6 2m − ⌊ n + 1 ⌋ < 2r. Thus 2m − n + 1 < 2r, and we conclude that r < 2n + 1 . 2n + 2 Our next goal is to prove that 2n + 1 is the smallest upper bound of T, and we will do mk 2n + 2 this by finding a sequence ak = r ∈ T with lim k→∞ ak = 2n +1 . k We first make the following claim. Claim: If m/r ∈ T, then (m + 2n + 2)/(r + 2n + 1) ∈ T. Proof of Claim: By Lemma 5.5, because m/r ∈ T it follows that α ( I (m) ) < α ( I r ), and it is then enough to show that α ( I (m+2n+2) ) < α ( I r + 2n + 1) to conclude that (m + 2n + 2)/(r + 2n + 1) ∈ T. By Proposition 5.10, we have α(I (m+ 2n + 2)  m + 2n + 2 ) = 2(m + 2n + 2) − n+1   m 2n + 2 = 2m + 4n + 4 − + n+1 n+1    m = 4n + 2 + 2m − n+1  = 4n + 2 + α ( I (m) ) < 2(n + 1) + α ( I r ) = α ( I r+ n + 1 ). Recall that for any odd cycle of size 2n + 1, I (n+1) 6⊆ I n+1, so let m0 = r0 = n + 1 and a0 = mr00 . Then recursively define ak = mr k where mk = mk−1 + 2n + 2 and rk = rk−1 + 2n + k 1. By the claim above, we have ak = mk /rk ∈ T. Note that this definition of the sequence n + 1+ k(2n + 2) +2 ak is equivalent to the explicit formula ak = n+1+k(2n+1) . Moreover, lim k→∞ ak = 2n 2n + 1 , which finally implies that ρ( I ) = 2n + 2 2n + 1 .  In [9], a new measure of the failure of I m to contain I (m) was introduced. This measure is known as the symbolic defect, and, for a given m, is the number µ (m) of minimal generators F1 , F2 , . . . , Fµ (m) such that I (m) = I m + ( F1 , F2 , . . . , Fµ (m) ). Recall that Corollaries COMPARING POWERS OF EDGE IDEALS 15 5.3 and 5.4 imply, for I = I (C2n+1 ), that sdefect ( I, t) = ( 0 1 if t 6 n if t = n + 1. Next, we explore additional terms in the symbolic defect sequence. Our general approach is to rely on the decomposition described in Corollary 4.5. In the parlance of our work, the symbolic defect is the size of a minimal generating set for the ideal ( D (t)). Observe that in general this is not the same as computing the cardinality of the set D (t), as there may be monomials in D (t) which are divisible by other monomials in the set. Thus, our goal is to determine the cardinality of the subset D ′ (t) of D (t) which forms a minimal generating set of ( D (t)). Theorem 5.12. Let I = I (C2n+1 ). Then, for t satisfying n + 2 6 t 6 2n + 1, we have    2n + 1  ℓ 2n + 1 . sdefect ( I, t) = ∑ t − (n + 1) − ℓ ℓ ℓ= 1 Proof. As stated above, we wish to count the number of minimal generators in D ′ (t). Recall that α ( I (t) ) = 2t − ⌊ n+t 1 ⌋ = 2t − 1; by definition, as everything in D (t) has degree less than 2t, we see that D (t) consists only of monomials of degree 2t − 1. The collection of all distinct monomials of degree 2t − 1 is itself linearly independent, and thus D (t) is a minimal generating set for ( D (t)), i.e., D (t) = D ′ (t). Consider an arbitrary m ∈ D (t), and note that deg (m) = 2t − 1 = 2(t − 1) + 1. Since the edge monomials ei = xi xi +1 (where again e2n+1 = x2n+1 x1 ) have degree 2, we see that m is divisible by the product of at most t − 1 edge monomials. Further, as α ( I (t) ) = 2t − 1 > 2(t − 1) = α ( I t−1 ) by Proposition 5.10, Lemma 5.5 gives that m ∈ I t−1 , and thus m is divisible by at least t − 1 edge monomials. Thus, m must be divisible by exactly t − 1 edge monomials, and an optimal factorization of m is b m = xi0 eb11 eb22 · · · e2n2n++11 , where ∑ bi = t − 1. That is, m has a single ancillary with exponent 1. By Lemma 5.2, m must be divisible by x1 x2 · · · x2n+1 . Write x1 x2 · · · x2n+1 in optimal form as x1 x2 · · · x2n+1 = xi0 e1 e3 · · · ei0 −2 ei0 +1 · · · e2n if i0 is odd, and as x1 x2 · · · x2n+1 = xi0 e2 e4 · · · ei0 −2 ei0 +1 · · · e2n+1 if i0 is even. Observe that, in either case, x1 x2 · · · x2n+1 is the product of a single variable and n edge monomials. Thus, the monomial p = m/ x1 x2 · · · x2n+1 is the product of exactly (t − 1) − n edge monomials. We have thus factored any m ∈ D (t) as m = x1 x2 · · · x2n+1 p, where p is the product of exactly t − n − 1 edge monomials. Observe that, if m′ = x1 x2 · · · x2n+1 p′ , where p′ is the product of exactly t − n − 1 edge monomials, deg(m′ ) = 2t − 1 and, if V is any minimal vertex cover of C2n+1, wV (m′ ) = wV ( x1 x2 · · · x2n+1 ) + wV ( p′ ) > n + 1 + t − n − 1 = t, where wV ( p′ ) follows from the fact that p′ ∈ I t−n−1 by definition; thus, m′ ∈ D (t). 16 MIKE JANSSEN, THOMAS KAMP, AND JASON VANDER WOUDE Therefore, to count the monomials in D (t), it suffices to count all monomials p that are products of t − n − 1 edge monomials. We can visualize this problem by counting the number of ways to place these t − n − 1 ‘edges’ around the cycle, assuming that we can place multiple edges between the same two vertices. To that end, let ℓ be the number of pairs  of vertices between which we place at least one edge. Then there are (2nℓ+1) ℓ (t−(n + 1))−ℓ ways to place the t − (n + 1) edges: first we choose from among the (2nℓ+1) choices for pairs  of vertices between which to place ℓ (t−(n + 1))−ℓ the edges, and then we choose from the sdefect ( I, t) = 2n + 1  ∑ ℓ= 1 2n + 1 ℓ   ways to arrange the edges. Thus, ℓ t − (n + 1) − ℓ  .  In particular, sdefect ( I (C2n+1 ), n + 2) = 2n + 1. The computation of sdefect ( I, t) becomes much more complicated as t ≫ 2n + 1. 6. A N ADDITIONAL CONTAINMENT QUESTION Our proof that I (t) = I t + ( D (t)) does not hold for any graph other than a cycle, as it relies on the fact that each path between ancillaries is disjoint from every other path. This is not true for general non-cycles. This leads naturally to the following question. Question 6.1. Let G be a graph on the vertices V = { x1 , x2 , . . . , xd } containing an odd cycle. Suppose I = I (G ) is the edge ideal of G in R = k[ x1 , x2 , . . . , xd ], and let L(t) and D (t) retain their usual definitions with respect to G. Then I (t) = I t + ( D (t)) for all t > 1. The following example answers Question 6.1 in the negative. Example 6.2. Consider the graph G defined by V (G ) = { x1 , x2 , x3 , x4 , x5 , x6 , x7 } and E(G ) = { x1 x2 , x2 x3 , x3 x4 , x4 x5 , x5 x1 , x1 x6 , x6 x7 } (where we write the edges as products of vertices), and let m = x21 x22 x23 x24 x25 x27 . Observe that m ∈ / I 6 , but as every minimal vertex cover V of G contains three of x1 , x2 , x3 , x4 , x5 , we have wV (m) > 2 · 3 = 6. Thus, I 6 6= ( L(6)). However, we observe in the following two theorems that I t = ( L(t)) for certain classes of graphs. One case in which Question 6.1 holds is the case in which G is an odd cycle with one additional vertex connected to exactly one vertex of the cycle (see Figure 1 for an example of such a graph constructed from C9 ). Theorem 6.3. Let G be a graph consisting of 2n + 2 vertices and 2n + 2 edges such that 2n + 1 of them form a cycle and the remaining edge connects the remaining vertex to any existing vertex of the cycle. Further, let I be the edge ideal of G and let L(t) and D (t) retain their usual definitions with respect to G. Then I (t) = I t + ( D (t)). COMPARING POWERS OF EDGE IDEALS 17 F IGURE 1. An additional vertex and edge appended to C9 . Proof. Without loss of generality, consider the cycle formed by x1 , . . . , x2n+1 with e2n+2 = x1 x2n+2 being the newly added edge. Recall that ei = xi xi +1 when i 6 2n and e2n+1 = x2n+1 x1 . a b Let m be a monomial expressed in optimal form m = x1a1 x2a2 · · · x2n2n++22 eb11 eb22 · · · e2n2n++22 , and recall that b(m) = ∑ bi . As with the cycle, if I t = ( L(t)), it will follow that I (t) = I t + ( D (t)). By Lemma 4.2 we know that I t ⊆ ( L(t)) so we must only show the reverse containment. Let m 6∈ I t (which implies that b(m) < t), then we will show that m 6∈ ( L(t)). Lemma 4.3 allows us to consider only cases where m either has multiple ancillaries or has a single ancillary of at least degree 2. Note that deg(m) > 2t, else m ∈ / ( L(t)) by definition. We ′ will construct a minimal vertex cover V of G such that wV ′ (m) = b(m) < t. First, assume that x2n+2 is the only ancillary of m, and observe that a2n+2 > 2. We b a −1 may write m as m = x2n+2 eb11 eb22 · · · e2n2n++22 x2n2n++22 . It cannot be true that bi > 1 for all i ∈ {1, 3, 5, . . . , 2n + 1}, because it would then be possible to divide m by some monomial p = x2n+2 e1 e3 · · · e2n+1 x2n+2 which must be in optimal form by Lemma 3.2; however, in this case, p = e2n+2 e2 e4 · · · e2n e2n+2 , contradicting that p was in optimal form. Thus, at least one b2 j+1 is 0. Then construct V ′ as follows: (1) If b1 = 0, let V ′ = { x1 , x2 , x4 , . . . , x2n }. Then wV ′ (m) = (b2n+1 + b2n+2 + b1 ) + 2n + 2 +2 (b1 + b2 ) + (b3 + b4 ) + · · · + (b2n−1 + b2n ) = b1 + ∑i2n = 1 bi = 0 + ∑ i = 1 bi = b(m) < t.  (2) If b2 j+1 = 0 for some j > 0, let V ′ = x1 , x3 , x5 , . . . , x2 j+1 , x2 j+2 , x2 j+4 , x2 j+6 , · · · , x2n . Then wV ′ (m) = (b2n+1 + b2n+2 + b1 ) + (b2 + b3 ) + · · · + ( x2 j + x2 j+1 ) + ( x2 j+1 + 2n + 2 +2 x2 j+2 ) + · · · + (b2n−1 + b2n ) = b2 j+1 + ∑i2n = 1 bi = 0 + ∑i = 1 bi = b(m ) < t. Now suppose that all ancillaries of m are in the cycle, i.e., the ancillaries come from the set { x1 , x2 , . . . , x2n+1 }. By adapting the argument from Theorem 4.4, we may assume that there is either one ancillary with exponent at least 2, or that there are multiple ancillaries. Use the construction in the proof of Theorem 4.4 to decompose the subgraph C2n+1 of G as a b a b H1 , H2 , . . . , Hr . Define mC2n+1 = x1a1 · · · x2n2n++11 eb11 · · · e2n2n++11 , i.e., mC2n+1 = m/( x2n2n++22 e2n2n++22 ). The proof of Theorem 4.4 provides minimal subcovers S1 , S2 , . . . , Sr such that S = ∪ Sq +1 and w S (mC2n+1 ) = ∑i2n = 1 bi . 18 MIKE JANSSEN, THOMAS KAMP, AND JASON VANDER WOUDE +2 If x1 ∈ S, then S covers G and w S (m) = w S (mC2n+1 ) + b2n+2 = ∑i2n = 1 bi = b(m ) < t. In ′ this case, we may let V = S. On the other hand, if x1 ∈ / S, let V ′ = S ∪ { x2n+2 }. Then wV ′ (m) = w S (m) + b2n+2 = +2 ∑i2n = 1 bi = b(m ) < t. Next, assume that the ancillaries of m are x2n+2 and at least one x j in the cycle (where j 6= 1; if j = 1, we may write x2n+2 x1 = e2n+2 , contradicting the assumption that m is in optimal form). Use the construction of Theorem 4.4 to decompose the cycle into subgraphs H1 , H2 , . . . , Hr and note that x1 is a vertex in Hr . Observe that since x1 is not ancillary, x1 ∈ / Hi for any i 6= r. Let the vertices of Hi be represented by  xℓi , xℓi +1 , . . . , xℓi+1 , where xℓ1 , . . . , xℓr are ancillaries, and we wrap around with xℓr+1 representing xℓ1 . For all i 6= r, the proof of Theorem 4.4 gives a construction of a minimal vertex subcover Si with the required properties. Now construct a subgraph Hr′ of G as follows: V ( Hr′ ) = V ( Hr ) ∪ { x2n+2 } and E( Hr′ ) = E Hr ∪ {{ x1 , x2n+2 }}. Decompose H ′ as two induced subgraphs Hr′ a and Hr′ b of G on the vertices { xℓr , . . . , x1 , x2n+2 } and r x2n+2 , x1 , . . . , xℓ1 . We observe that we may now use the construction in the proof of Theorem 4.4 to build minimal covers of Hr′ a and Hr′ b containing x1 (and not x2n+2 ) whose a aℓ b a b bℓ −1 b 2n+ 2 b 1 r +1 1 union gives a cover Sr of Hr′ . Given mr = xℓrℓr xℓ 1 x2n2n++22 eℓrℓr eℓrℓ+ 1 · · · e2n + 2 e 1 · · · eℓ1 − 1 , note 1 that w Sr′ (mr ) = b(mr ). Then the union V ′ = ∪ri=1 Si has the required property that w V ′ ( m ) = b ( m ). In all cases, m ∈ / L(t), and, by extension, m ∈ / ( L(t)).  We also verify that the answer to Question 6.1 is positive when G is a complete graph. Thus, additional study is needed to identify the precise graph-theoretic property for which Question 6.1 has an affirmative answer. Theorem 6.4. Let R = k[ x1 , . . . , xn ] and let Kn denote the complete graph on { x1 , . . . , xn }. Further, let I = I (Kn ) and L(t) and D (t) maintain their definitions as above. Then I (t) = I t + ( D (t)) Proof. Let ei, j denote the edge between xi and x j such that i < j. We will show that I t = ( L(t)). By Lemma 4.2, we must only show the reverse containment. Let m 6∈ I t (which implies that b(m) < t), and recall that Lemma 4.3 allows us to consider only cases where m either has multiple ancillaries or has a single ancillary of at least degree 2. Let b 1,1 b n,n be a monomial in optimal form. Then m has at most 1 ancillary · · · en,n m = x1a1 · · · xnan e1,1 a aj because if xi i and x j were both ancilaries, then m could be expressed in a more optimal form as b i, j + 1 a j −1 b 1,2 b 1,3 b n,n a −1 e1,3 · · · ei, j · · · en,n · · · xnan e1,2 m = x1a1 · · · xi i · · · x j for some s because there is guaranteed to be an edge between xi and x j as Kn is complete. Thus m has exactly 1 ancillary and it must have a degree of at least 2. Without loss of generality, let x1a1 be the ancillary of Kn . Note that bi, j = 0 if i, j 6= 1. If this was not the case, m could be expressed in a more optimal form as b b b +1 1,2 1,3 e1,3 · · · e1,i1,i m = x1a1 −2 · · · xnan e1,2 b · · · e1,1,jj +1 b −1 · · · ei,i,j j b 1,n · · · enn−−1,n COMPARING POWERS OF EDGE IDEALS 19 Let V ′ = { x2 · · · xn }. Observe that V ′ covers Kn and b + b 2,3+ b 2,4 + ...+ b 2,n b + 0+ ...+ 0 wv′ (m) = wv′ ( x21,2 = wv′ ( x21,2 b + x31,3 b + x31,3 + 0+ ...+ 0 + b 2,3+ b 3,4 + ...+ b3,n b + . . . + xn1,n b + . . . + xn1,n + 0+ ...+ 0 + b 2,n + b 3,n + ...+ b n−1,n ) ) n = ∑ b1, j j=2 n−1 n = ∑ b1, j + j=2 n−1 = n ∑ ∑ b1, j i = 2 j =i + 1 n ∑ ∑ b1, j i = 1 j =i + 1 = b(m ) Thus wv′ (m) = b(m) < t, so m 6∈ L(t) and by the same argument, no divisor of m is in L(t), which means m 6∈ ( L(t)). Therefore, I t = ( L(t)). Because I (t) = ( L(t)) + ( D (t)) by Corollary 4.5, this leads to the desired result that I (t) = I t + ( D (t)).  R EFERENCES [1] C. Bocci, S. Cooper, and B. Harbourne. Containment results for ideals of various configurations of points in P N . J. Pure Appl. Algebra, 218(1):65–75, 2014. [2] C. Bocci and B. Harbourne. Comparing powers and symbolic powers of ideals. J. Algebraic Geom., 19(3):399–417, 2010. [3] Cristiano Bocci, Susan Cooper, Elena Guardo, Brian Harbourne, Mike Janssen, Uwe Nagel, Alexandra Seceleanu, Adam Van Tuyl, and Thanh Vu. The Waldschmidt constant for squarefree monomial ideals. Journal of Algebraic Combinatorics, 44(4):875–904, 2016. [4] Susan M. Cooper, Robert J. D. Embree, Huy Tài Hà, and Andrew H. Hoefel. Symbolic powers of monomial ideals. Proceedings of the Edinburgh Mathematical Society, 60(1):3955, 2017. [5] H. Dao, A. De Stefani, E. Grifo, C. Huneke, and L. Núñez-Betancourt. Symbolic powers of ideals. ArXiv e-prints, August 2017. [6] A. Denkert and M. Janssen. Containment problem for points on a reducible conic in P2 . Journal of Algebra, 394(0):120–138, 2013. [7] Marcin Dumnicki, Tomasz Szemberg, and Halszka Tutaj-Gasińska. Counterexamples to the I ( 3) ⊂ I 2 containment. Journal of Algebra, 393:24 – 29, 2013. [8] L. Ein, R. Lazarsfeld, and K. Smith. Uniform bounds and symbolic powers on smooth varieties. Invent. Math., 144(2):241–252, 2001. [9] F. Galetto, A. V. Geramita, Y.-S. Shin, and A. Van Tuyl. The symbolic defect of an ideal. ArXiv e-prints, October 2016. [10] Le Tuan Hoa and Tran Nam Trung. Castelnuovo-mumford regularity of symbolic powers of twodimensional square-free monomial ideals. J. Commut. Algebra, 8(1):77–88, 02 2016. [11] M. Hochster and C. Huneke. Comparison of symbolic and ordinary powers of ideals. Invent. Math., 147(2):349–369, 2002. [12] A. Simis, W.V. Vasconcelos, and R.H. Villarreal. On the Ideal Theory of Graphs. Journal of Algebra, 167(2):389 – 416, 1994. [13] Adam Van Tuyl. A Beginner’s Guide to Edge and Cover Ideals, pages 63–94. Springer Berlin Heidelberg, Berlin, Heidelberg, 2013. 20 MIKE JANSSEN, THOMAS KAMP, AND JASON VANDER WOUDE [14] Rafael H. Villarreal. Cohen-macaulay graphs. manuscripta mathematica, 66(1):277–293, Dec 1990. [15] Scarlet Worthen Ellis and Lesley Wilson. Symbolic powers of edge ideals. Rose-Hulman Undergraduate Math Journal, 5(2), 2004. M ATHEMATICS /S TATISTICS D EPARTMENT, D ORDT C OLLEGE , S IOUX C ENTER , IA 51250, USA E-mail address: mike.janssen@dordt.edu M ATHEMATICS /S TATISTICS D EPARTMENT, D ORDT C OLLEGE , S IOUX C ENTER , IA 51250, USA E-mail address: thmskmp@dordt.edu M ATHEMATICS /S TATISTICS D EPARTMENT, D ORDT C OLLEGE , S IOUX C ENTER , IA 51250, USA E-mail address: jsnvndrw@dordt.edu
0math.AC
arXiv:1604.01938v3 [math.GR] 19 Mar 2018 On the Noether number of p-groups Kálmán Cziszter ∗ Alfréd Rényi Institute of Mathematics, Hungarian Academy of Sciences Reáltanoda u. 13 – 15, 1053 Budapest, Hungary Abstract A group of order pn (p prime) has an indecomposable polynomial invariant of degree at least pn−1 if and only if the group has a cyclic subgroup of index at most p or it is isomorphic to the elementary abelian group of order 8 or the Heisenberg group of order 27. Keywords: polynomial invariants, degree bounds, zero-sum sequences 1 Introduction Let G be a finite group and V a G-module over a field F of characteristic not dividing the group order |G|. The Noether-number β(G, V ) is the maximal degree in a minimal generating set of the ring of polynomial invariants F[V ]G . It is known that β(G, V ) ≤ |G| (see [16], [9], [8]). Even more, it was observed that β(G) := supV (G, V ) (where V runs over all G-modules over the base field F) is typically much less than |G|. For an algebraically closed base field of characteristic zero it was proved in [17] that β(G) = |G| holds only if G is cyclic. Then it turned out that β(G) ≤ 43 |G| for any non-cyclic group G (see [7] and [19]). Moreover β(G) ≥ 21 |G| holds if and only if G has a cyclic subgroup of index at most two, with the exception of four particular groups of small order (see [2, Theorem 1.1]). Recently some asymptotic extensions of this result were given in [14]. Our goal in the present article is to establish the following strengthening of this kind of results for the class of p-groups: Theorem 1. If G is a finite p-group for a prime p and the characteristic of the base field F is zero or greater than p then the inequality 1 β(G) ≥ |G| p (1) Partially supported by the National Research, Development and Innovation Office (NKFIH) grants PD113138, ERC HU 15 118286, K115799 and K119934. ∗ 1 holds if and only if G has a cyclic subgroup of index at most p or G is the elementary abelian group C2 × C2 × C2 or the Heisenberg group of order 27. The proof of Theorem 1 will be reduced to the study of a single critical case, the Heisenberg group Hp , which is the extraspecial group of order p3 and exponent p for an odd prime p. We prove about this the following result: Theorem 2. For any prime p ≥ 5 and base field F of characteristic 0 or greater than p we have β(Hp ) < p2 . The paper is organised as follows. Section 2 contains some technical results on zero-sum sequences over abelian groups that will be needed later. In Section 3 we reduce the proof of Theorem 1 to that of Theorem 2. Then in Section 4 we explain the main invariant theoretic idea behind the proof of Theorem 2 which is also applicable in a more general setting. The proof itself of Theorem 2 will then be carried out in full detail in Section 5. Finally, Section 6 completes our argument by showing that for the case p = 3 we have β(H3 ) = 9 in any non-modular characteristic. 2 Some preliminaries on zero-sum sequences We follow here in our notations and terminology the usage fixed in [5]. Let A be an abelian group noted additively. By a sequence S over a subset A0 ⊆ A we mean a multiset of elements of A0 . They form a free commutative monoid with respect to concatenation, denoted by S · T , and unit element the empty sequence ∅; this has to be distinguished from 0, the zero element of A. The sequence a · a · · · a, obtained by the k-fold repetition of an element a ∈ A, is denoted by a[k] ; this has to be distinguished from the product ka ∈ A. The multiplicity of an element a ∈ A in a sequence S is denoted by va (S). We also write a ∈ S to indicate that va (S) > 0. We say that T is a subsequence of S, and write T | S, if there is a sequence R such that S = T · R. In this case we also write RP= S · T [−1] . The length of a sequence, denoted by |S|, can be expressed as a∈A va (S), whereas the sum of a sequence S = a1 · · · an is σ(S) := a1 + . . . + an ∈ A and by convention we set σ(∅) = 0. We say that S is a zero-sum sequence if σ(S) = 0. The relevance of zero-sum sequences for our topic is due to the fact that for an abelian group A the Noether number β(A) coincides with the Davenport constant D(A), which is defined as the maximal length of a zero-sum sequence over A not containing any non-empty, proper zero-sum subsequence (see e.g. [5, Chapter 5]). Its value for p-groups is given by the following formula [12, 2 Theorem 5.5.9]: D(C pn1 × · · · × Cpnr ) = r X (pni − 1) + 1. (2) i=1 A variant of this notion is the kth Davenport constant Dk (A) defined for any k ≥ 1 as the maximal length of a zero-sum sequence S that cannot be factored as the concatenation S = S1 · · · Sk+1 of non-empty zero-sum sequences Si over A. Its numerical value is much less known (for some recent results see [10]); we shall only need the fact that according to [12, Theorem 6.1.5.2]: Dk (Cp × Cp ) = kp + p − 1. (3) The following consequence of the definition of Dk (A) will also be used: Lemma 3 ([12], Lemma 6.1.2). Any sequence S over an abelian group A of length at least Dk (A) factors as S = S1 · · · Sk · R with some non-empty zero-sum sequences Si . We define for any sequence S over A the set of all partial sums of S as Σ(S) := {σ(T ) : ∅ = 6 T | S}. If 0 6∈ Σ(S) then S is called zero-sum free. The next result could also be deduced from the Cauchy-Davenport theorem (see [12, Corollary 5.2.8.1]) but we provide here an elementary proof for the reader’s convenience: Lemma 4. Let p be a prime. Then for any sequence S over Cp \ {0} we have |Σ(S)| ≥ min{p, |S|}. Proof. We use induction on the length of S. For |S| = 0 the claim is trivial. Otherwise consider a sequence S · a where the claim holds for S. We have Σ(S ·a) = Σ(S)∪{a}∪(a+Σ(S)), where a+Σ(S) := {a+s : s ∈ Σ(S)}. Then either |Σ(S · a)| ≥ |Σ(S)| + 1, or else a ∈ Σ(S) and a + Σ(S) = Σ(S), that is when Σ(S) is a subgroup of Cp containing a. But since Cp has only two subgroups and by assumption Σ(S) ∋ a 6= 0, this means that Σ(S) = Cp . Lemma 5 ([12], Theorem 5.1.10.1). A sequence S over Cp (p prime) of length |S| = p − 1 is zero-sum free if and only if S = a[p−1] for some a ∈ Cp \ {0}. Lemma 6 ([12], Proposition 5.7.7.1). Let p be a prime and S be a sequence over Cp × Cp of length |S| ≥ 3p − 2. Then S has a zero-sum subsequence X | S of length p or 2p. We close this section with a technical result. Its motivation and relevance will become apparent through its application in the proof of Proposition 14. For any function π defined on A and any sequence S over A we will write π(S) for the sequence obtained from S by applying π element-wise. 3 Lemma 7. Let S be a sequence over Cp of length |S| ≥ p2 − 1. If we have v0 (S) ≥ p + 1 then S = S1 · · · Sℓ · R, where each Si is a non-empty zero-sum sequence and ℓ ≥ 2p − 1. Proof. Let ℓ denote the maximal integer such that S = S1 · · · Sℓ · R for some non-empty zero-sum sequences Si . Then each Si is irreducible, hence |Si | ≤ p and R is zero-sum free, hence |R| ≤ p − 1. Assuming that ℓ ≤ 2p − 2 we get p2 − 1 ≤ |S| ≤ v0 (S) + (ℓ − v0 (S))p + p − 1 ≤ (p − 1)(2p + 1 − v0 (S)) whence v0 (S) ≤ p follows, in contradiction with our assumption. Proposition 8. Let A = Cp × Cp for some prime p ≥ 5 and π : A → Cp the projection onto the first component. If S is a sequence over A with |S| ≥ p2 −1 and v0 (π(S)) ≤ p then for any given subsequence T | S of length |T | ≤ p − 1 there is a a factorisation S = S1 · · · Sp−1 · R, where each Si is a non-empty zero-sum sequence over A, while T | S · (S1 · S2 )[−1] and Σ(π(S1 )) = Cp . Proof. Let S ∗ | S · T [−1] be the maximal subsequence such that 0 6∈ π(S ∗ ). Then by assumption |S ∗ | ≥ |S| − 2p + 1 ≥ 3p, as p ≥ 5, so there is a zero-sum subsequence X | S ∗ of length p or 2p by Lemma 6. We have two cases: (i) If |X| = 2p then X = S1 · S2 for some non-empty zero-sum sequences S1 , S2 such that |S1 | ≥ p and |S2 | ≤ p, as D(Cp × Cp ) = 2p − 1 by (2). (ii) If |X| = p then we can take S1 := X. Then we have |S · (S1 · T )[−1] | ≥ |S| − 2p + 1 ≥ 3p, so again by Lemma 6 we find a non-empty zero-sum sequence S2 | S · (S1 · T )[−1] of length |S2 | ≤ p as above. In both cases T | S · (S1 · S2 )[−1] and |S1 · S2 | ≤ 2p by construction. Consequently |S · (S1 · S2 )[−1] | ≥ |S| − 2p ≥ p2 − 2p − 1 = Dp−3 (Cp × Cp ), hence by Lemma 3 we have a factorisation S · (S1 · S2 )[−1] = S3 · · · Sp−1 · R with non-empty zero-sum sequences Si for each i ≥ 3. Finally, in both cases we had |S1 | ≥ p and 0 6∈ π(S1 ), hence |Σ(π(S1 ))| = p by Lemma 4. 3 Reduction of Theorem 1 to Theorem 2 Our main tool here will be the kth Noether number βk (G, V ) which is defined for any k ≥ 1 as the greatest integer d such that some invariant of degree d exists which is not contained in the ideal of F[V ]G generated by the products of at least k + 1 invariants of positive degree. This notion was introduced in [4, Section 2] with the goal of estimating the ordinary Noether number from information on its composition factors. This was made possible by [2, Lemma 1.4] according to which for any normal subgroup N ⊳ G we have: β(G, V ) ≤ ββ(G/N ) (N, V ). 4 (4) As observed in [5, Chapter 5], if A is an abelian group then βk (A) coincides with Dk (A), so that we can use (3) in the applications of (4). Proof of Theorem 1 (assuming Theorem 2). The “if” part follows from [17, Proposition 5.1] which states that β(C) ≤ β(G) for any subgroup C ≤ G. So if C is cyclic of index at most p then β(G) ≥ β(C) = |C| = |G|/[G : C] ≥ 1 |G|. Moreover β(C23 ) = 4 by (2) and β(H3) ≥ 9 by Proposition 17 below. p The “only if” part for p = 2 follows from [2, Theorem 1.1] so for the rest we may assume that p ≥ 3. Let G be a group of order pn for which (1) holds. If G is non-cyclic then it has a normal subgroup N ∼ = Cp × Cp by [1, Lemma 1.4]. We claim that G/N must be cyclic. For otherwise by applying [1, Lemma 1.4] to the factor group G/N we find a subgroup K such that N ⊳ K ⊳ G and K/N ∼ = Cp × Cp . But then we get using (4) and (3) that 1 β(K) ≤ ββ(Cp ×Cp ) (Cp × Cp ) = p(2p − 1) + p − 1 = 2p2 − 1 < p3 = |K|. p As β(G)/|G| ≤ β(K)/|K| by [2, Lemma 1.2] we get a contradiction with (1). n−2 ∈N Now let g ∈ G be such that gN generates G/N ∼ = Cpn−2 . Then g p has order p or 1. In the first case hgi has index p in G and we are done. In the other case hgi ∩N = {1} hence G ∼ = N ⋊hgi. If g acts trivially on N then G contains a subgroup H ∼ = Cp × Cp × Cp for which we have β(H) = 3p − 2 by (2) hence β(G)/|G| ≤ β(H)/|H| < 3/p2 ≤ 1/p, as p ≥ 3, a contradiction. This shows that g must act non-trivially on Cp × Cp . It is well known that Aut(Cp × Cp ) = GL(2, p) has order (p2 − 1)(p2 − p), so its Sylow p-subgroup must have order p and it is isomorphic to Cp . Therefore g p must act trivially on N, so if n ≥ 4 then g p 6= 1 and the subgroup hN, g pi is isomorphic to Cp × Cp × Cp , but this was excluded before. The only case which remains open is that n = 3 and G ∼ = (Cp × Cp ) ⋊ Cp , where the factor group Cp acts non-trivially on Cp × Cp . This is the Heisenberg group denoted by Hp . By Theorem 2 we have β(Hp ) < p2 for all p > 3 under our assumption on the characteristic of the base field F. So among the Heisenberg groups the inequality (1) can only hold for H3 . Remark 9. The precise value of the Noether number is already known for all the p-groups which satisfy (1) according to Theorem 1. As the Theorem states, equality holds in (1) for C23 and H3 . For the rest, the groups of order pn which have a cyclic subgroup of index p were classified by Burnside (see e.g. [1, Theorem 1.2]) as follows: (i) if G is abelian, then either G is cyclic with β(G) = pn or G = Cpn−1 ×Cp in which case it has β(G) = pn−1 + p − 1 by (2) (ii) if G is non-abelian and p > 2 then G is isomorphic to the modular group Mpn ∼ = Cpn−1 ⋊Cp . We have β(Mpn ) = pn−1 +p−1 by [3, Remark 10.4]. 5 (iii) if G is non-abelian and p = 2 then G is the dihedral group D2n or the semi-dihedral group SD2n or the generalised quaternion group Q2n . We have β(Q2n ) = 2n−1 + 2 and β(D2n ) = β(SD2n ) = 2n−1 + 1 by [3, Theorem 10.3]. Altogether these results imply that for any non-cyclic p-group G we have 1 β(G) ≤ |G| + p p (5) and this inequality is sharp only for the case p = 2. Remark 10. The notion of the Davenport constant D(G), originally defined only for abelian groups as in Section 2, was extended to any finite group G in [11, 13]. For the conjectural connection between the Noether number and this generalisation of the Davenport constant see [5, Section 5.1] and [6]. 4 Invariant theoretic lemmas Let us fix here some notations related to invariant rings. For any vector space V over a field F we denote its coordinate ring by F[V ]. We say that a group G has a left action on V , or that V is a G-module, if a group homomorphism ρ : G → GL(V ) is given and we abbreviate ρ(g)(v) by writing g · v for any g ∈ G and v ∈ V . By setting f g (v) := f (g · v) for any f ∈ F[V ] we obtain a right action of G on F[V ]. The ring of polynomial invariants is defined as F[V ]G := {f ∈ F[V ] : f g = f for all g ∈ G}. If the ring F[V ]N is already known for some normal subgroup N ⊳ G then F[V ]G as a vector space is spanned by its elements of the form τNG (m), where m runs over the set of all monomials and τNG : F[V ]N → F[V ]G is the F[V ]G -module epimorphism defined as 1 X g τNG (m) = m |G/N| g∈G (see e.g. [15, Chapter 2.2]). When N is trivial this definition amounts to G b := Hom(G, F× ) the Reynolds operator τ := τ{1} . Given any character χ ∈ G the set F[V ]G,χ := {f ∈ F[V ] : f g = χ(g)f } constitutes the F[V ]G -module of G-semi-invariants of weight χ. If the restriction of χ to N is trivial, i.e. when [ then these semi-invariants can be obtained by the projection map χ ∈ G/N, τχ : F[V ]N → F[V ]G,χ defined with the analogous formula X 1 χ−1 (g)ug . τχ (u) = |G/N| g∈G/N F[V ] and F[V ]G are graded rings: F[V ]d denotes for any d ≥ 0 the vector G space of degree d homogeneous polynomials and F[V ]G d = F[V ] ∩F[V ]d . The 6 L G G G set F[V ]G + := d≥1 F[V ]d is a maximal ideal in F[V ] , while F[V ]+ F[V ], the ideal of F[V ] generated by all G-invariant polynomials of positive degree, is the so called Hilbert-ideal. This ideal will be our main object of interest since, as observed in [4, Section 3], the graded factor ring F[V ]/ F[V ]G + F[V ] is finite dimensional and its top degree, denoted by b(G, V ), yields an upper bound on the Noether number by an easy argument using the Reynolds operator: β(G, V ) ≤ b(G, V ) + 1. (6) It is well known that β(G, V ) is unchanged when we extend the base field so we will assume throughout this paper that F is algebraically closed. Lemma 11. Let G be a finite group with a normal subgroup N such that G/N is abelian. Let W be a G-module over F and assume that |G| ∈ F× . k G Then (F[W ]N + ) ⊆ F[W ]+ F[W ] for any k ≥ D(G/N). Proof. F[W ]N regarded as a G/N-module has the direct sum decomposition L G,χ . (Here we used both our assumptions on F.) This means [ F[W ] χ∈G/N P that any element u ∈ F[W ]N [ τχ (u). + can be written as a sum u = χ∈G/N N Now for any k ≥ 1 and u1 , . . . , uk ∈ F[W ]+ we have   k k Y Y X X  ui = τχ (ui ) = τχ1 (u1 ) · · · τχk (uk ). (7) i=1 i=1 [ χ∈G/N [ χ1 ,...,χk ∈G/N The term τχ1 (u1) · · · τχk (uk ) belongs to the ideal F[W ]G + F[W ] whenever the se[ ∼ quence (χ1 , . . . , χk ) over G/N = G/N contains a non-empty zero-sum subsequence. But this holds for every term on the right of (7) as k ≥ D(G/N). Lemma 12. If in Lemma 11 the factor group G/N ∼ = Cp is cyclic of prime order then for any g ∈ G/N and any elements u1 , . . . , up−1 ∈ F[W ]N + we have the relation: G u1 · · · up−1 − ug1 u−g 2 u3 · · · up−1 ∈ F[W ]+ F[W ]. (8) Proof. Observe that in (7) with k = p − 1 the weight sequence (χ1 , . . . , χp−1) bp is zero-sum free if and only if χ1 = . . . = χp−1 and χ1 is non-trivial over C (by Lemma 5). As a result we get: X u1 · · · up−1 ∈ τχ (u1 ) · · · τχ (up−1 ) + F[W ]G + F[W ]. bp \{1} χ∈C Replacing here u1 and u2 with ug1 and u−g 2 , respectively, and observing that g by definition we have τχ (u ) = χ(g)τ (u) for any u ∈ F[W ]N we infer that ug1 u−g 2 u3 · · · up−1 must belong to the same residue class modulo the ideal F[W ]G + F[W ] to which u1 · · · up−1 does belong. This proves our claim. 7 5 The Heisenberg group Hp The Heisenberg group Hp = ha, bi can be defined by the presentation: ap = bp = cp = 1 [a, b] = c [a, c] = [b, c] = 1 (9) where [a, b] denotes the commutator a−1 b−1 ab. The subgroups A := ha, ci and B := hb, ci are normal and isomorphic to Cp × Cp . The Frattini-subgroup, the center and the derived subgroup of Hp all coincide with hci, so that Hp is extraspecial. In particular Hp /hci is also isomorphic to Cp × Cp . Taking into account only the subgroup structure of Hp the best upper bound that we can give about its Noether number by means of (4) and (3) is the following: β(Hp ) ≤ ββ(Cp ) (Cp × Cp ) = p2 + p − 1. (10) Our goal in this section will be to enhance this estimate by analysing more closely the invariant rings of Hp . Let F be an algebraically closed field with char(F) 6= p, so that there is a primitive p-th root of unity ω ∈ F that will be regarded as fixed throughout this paper. The irreducible Hp -modules over F are then of two types: (i) Composing any group homomorphism ρ ∈ Hom(Cp × Cp , F× ) with the canonic surjection Hp → Hp /hci ∼ = Cp × Cp yields p2 non-isomorphic 1-dimensional irreducible representations of Hp . (ii) For each primitive p-th root of unity ω i ∈ F, where i = 1, . . . , p − 1, H take the induced representation Vωi := IndA p hvi, where hvi is a 1-dimensional left A-module such that a·v = v and c·v = ω i v. In the basis {v, b·v, ..., bp−1 ·v} this representation is then given in terms of matrices in the following form, with Ip the p × p identity matrix:     0 ··· ··· 1 1 ..     ωi .    1  a 7→   b 7→   c 7→ ω i Ip . (11) . . . . .. ..     . ω i(p−1) 1 0 ′ Each Vωi is irreducible by Mackey’s criterion (see e.g. [18]) and for ω i 6= ω i it is easily seen (e.g. from the matrix corresponding to c) that Vωi and Vωi′ are non-isomorphic as G-modules. Adding the squares of the dimensions of the above irreducible Hp -modules we get p2 · 1 + (p − 1)p2 = p3 = |Hp |, so that no other irreducible Hp -modules exist. As a result an arbitrary Hp -module W over F has the canonic direct sum decomposition W = U ⊕ V1 ⊕ . . . ⊕ Vp−1 8 (12) where U consists only of 1-dimensional irreducible representations of Hp with hci in their kernel, while each Vi is an isotypic Hp -module consisting of the direct sum of ni ≥ 0 isomorphic copies of the irreducible representation Vωi : Vi = Vω i ⊕ . . . ⊕ Vω i . | {z } (13) ni times Next we recall how does the action of G on W extend to the coordinate ring F[W ]. When speaking of a coordinate ring F[Vωi ] = F[xi,0 , ..., xi,p−1 ] we always tacitly assume that the variables xi,k form a dual basis of the basis used at (11). By our convention from Section 4, Hp acts from the right on the variables, i.e. xg (v) = x(g · v) for all g ∈ Hp , so we can rewrite (11) as: xbi,k = xi,(k−1)mod p xai,k = ω ik xi,k xci,k = ω i xi,k . (14) (Here, by some abuse of notation, we identified the integers k = 0, 1, . . . , p−1 occurring as indexes with the modulo p residue classes they represent.) This shows that the action of the subgroup A on a variable xi,k is completely determined by the modulo p residue classes of the exponents ik and i of ω in (14); we will call φ(xi,k ) := (ik, i) ∈ Z/pZ × Z/pZ the weight of the variable xi,k . We shall also refer to the projections φa (xi,k ) = ik and φc (xi,k ) = i. With this notation it is immediate from (14) that for any n ∈ Z and x = xi,k n φa (xb ) = φa (x) − n φc (x) and n φc (xb ) = φc (x) (15) where the subtraction and multiplication with n is understood in Z/pZ. This implies the observation, which will be used frequently later on, that for any variable x with φc (x) 6= 0 and any arbitrarily given w ∈ Z/pZ there is always an element g ∈ hbi such that φa (xg ) = w. Our discussion also shows that for a variable y ∈ F[W ] we have φc (y) = 0 if and only if y ∈ F[U], and otherwise the value φc (y) = i determines the isotypic Hp -module Vi such that y ∈ F[Vi ]. Any monomial u ∈ F[W ] is an A-eigenvector, too, hence we can associate a weight φ(u) := (j, i) ∈ Z/pZ × Z/pZ to it so that ua = ω j u and uc = ω i u. Obviously then φ(uv) = φ(u) + φ(v) for any monomials u, v. If u = y1 · · · yn for some variables yi ∈ F[W ], with repetitions allowed, then we can form the sequence Φ(u) := φ(y1 ) · · · φ(yn ) over A, which will be called the weight sequence of u. Obviously φ(u) = σ(Φ(u)) = φ(y1 ) + · · · + φ(yn ) with the notations of Section 2. Observe that a monomial u is A-invariant if and only if φ(u) = 0, that is if Φ(u) is a zero-sum sequence over A. Finally, we set Φa (u) := (φa (y1 ), . . . , φa (yn )) and Φc (u) := (φc (y1 ), . . . , φc (yn )). Definition 13. We call two monomialsQu, v ∈ F[W ] homologous, denoted by Qd d gn u ∼ v, if deg(u) = deg(v) = d and u = n=1 yn while v = n=1 yn for some variables yn ∈ F[W ] (with repetitions allowed) and group elements gn ∈ hbi. 9 Observe that a monomial v obtained from a monomial u by repeated applications of (8) will be homologous to it in the above sense. Proposition 14. Let p ≥ 5. If u ∈ F[W ] is a monomial with deg(u) ≥ p2 −1, v0 (Φc (u)) ≤ p and v | u is a monomial such that deg(v) ≤ p and 0 6∈ Φc (v) then for any homologous monomial v ′ ∼ v there is a homologous monomial u′ ∼ u such that v ′ | u′ and u′ − u ∈ F[W ]G + F[W ]. Proof. We use induction on the degree d := deg(v) = deg(v ′ ). If d = 0 then v = v ′ = 1, so we are done by taking u′ = u. Suppose now that the claim holds for some d ≤ p − 1. It suffices to prove that for any given divisor xv | u, where x is a variable, deg(v) = d, 0 6∈ Φc (xv), and for any v ′ ∼ v and g ∈ hbi a monomial u′′ ∼ u exists such that xg v ′ | u′′ and u′′ − u ∈ F[W ]G + F[W ]. By the inductive hypothesis we already have a monomial u′ ∼ u such that ′ ′ v ′ | u′ and u′ − u ∈ F[W ]G + F[W ]. As u /v ∼ u/v and x divides u/v there is a t ∈ hbi such that xt divides u′/v ′ . By applying Proposition 8 to the weight sequences S := Φ(u′ ), T := Φ(v ′ ) we obtain a factorisation u′ = u1 · · · up−1up ′ ′ such that ui ∈ F[W ]A + for all i = 1, . . . , p − 1, up ∈ F[W ], v divides u /u1 u2 and Σ(Φc (u1)) = Z/pZ. We have two cases: i) If xt | u1 (or similarly if xt | u2 ) then take u′′ := u−t+g ut−g 1 2 u3 · · · up−1 up . g ′ ′′ ′′ ′ ′′ ′ G We have x v | u and u ∼ u ∼ u, while u −u ∈ F[W ]+ F[W ] by Lemma 12. ii) Otherwise xt | uk for some k > 2. By our assumption on Σ(Φc (u1 )) there is a divisor w | u1 with φc (w) = −φc (xt ). As φc (xt ) = φc (x) 6= 0 there is an h ∈ hbi for which φa (w h ) = −φa (xt ). Then for û := uh1 u−h 2 u3 · · · up−1 r we have û ∼ u and û−u ∈ F[W ]G F[W ] by Lemma 12. Take the factorisation + −h h t h h t û = û1 · · · ûp where û1 = w x , û2 = u2 , ûk = (uk /x )(u1 /w ) and ûi = ui ′ for the rest. By construction ûi ∈ F[W ]A + for all i ≤ p − 1, v divides û/û1 û2 and xt | û1 , so this factorisation of û falls under case i) and we are done. We need some further notations. The decomposition (12) induces an isomorphism F[W ] ∼ = F[U] ⊗ F[V1 ] ⊗ . . . ⊗ F[Vp−1 ] which in turn yields for any monomial m ∈ F[W ] a factorisation m = m0 m1 · · · mp−1 such that m0 ∈ F[U] and mi ∈ F[Vi ] for all i. Then for each i the decomposition (13) gives the N i (j) identifications F[Vi ] = nj=1 F[Vωi ] = F[xi,k : k = 0, . . . , p − 1; j = 1, . . . , ni ], (j) where we set xi,k := 1 ⊗ · · · ⊗ xi,k ⊗ · · · ⊗ 1, i.e. the variable xi,k introduced at (14) is placed in the jth tensor factor. So for any monomial mi ∈ F[Vi ] we (1) (n ) (j) have a factorisation mi = mi · · · mi i where each monomial mi depends (j) only on the set of variables {xi,k : k = 0, 1, . . . , p − 1}. Observe finally that two monomials u, v ∈ F[V1 ⊕ . . . ⊕ Vp−1 ] are homologous, u ∼ v, if and only (j) (j) if deg(ui ) = deg(vi ) for all i = 1, . . . , p − 1 and j = 1, . . . , ni . 10 We shall also need the polarisation operators defined for any polynomial f ∈ F[W ] by the formula ∆s,t i (f ) := p−1 X (t) (s) xi,k ∂i,k f (16) k=0 (s) (s) where ∂i,k denotes partial derivation with respect to the variable xi,k . All polarisation operations ∆ := ∆s,t i are degree preserving, deg(∆(f )) = deg(f ), g and G-equivariant, i.e. ∆(f ) = ∆(f )g . Therefore by the Leibniz rule G ∆(F[W ]G + F[W ]) ⊆ F[W ]+ F[W ] G ∆(F[W ]G + F[W ]+ ) ⊆ F[W ]+ F[W ]+ . and (17) Proposition 15. Let p ≥ 5 and assume that char(F) is 0 or greater than p. If a monomial m ∈ F[W ] has deg(m) ≥ p2 − 1 then m ∈ F[W ]G + F[W ]. Proof. Consider the factorisation m = m0 m1 · · · mp−1 derived from (12) as described above. Observe that for the weight sequence S = Φ(m) we have hci v0 (Φc (m)) = deg(m0 ). So if deg(m0 ) ≥ p + 1 then m ∈ (F[W ]+ )2p−1 F[W ] by Lemma 7 and we are done, as D(G/hci) = D(Cp × Cp ) = 2p − 1 by (2) hci hence (F[W ]+ )2p−1 ⊆ F[W ]G + F[W ] by Lemma 11. It remains that deg(m0 ) ≤ p. Then we must have deg(mi ) ≥ p for some i ≥ 1, say i = 1, as otherwise deg(m) ≤ deg(m0 ) + (p − 1)2 ≤ p2 − p + 1 would (1) (n ) follow. Take the factorisation m1 = m1 · · · m1 1 corresponding to the direct (j) 1 decomposition (13). We proceed by induction on µ(m) := maxnj=1 deg(m1 ). (j) Assume first that µ(m) ≥ p. This means that deg(m1 ) ≥ p for some j, (1) say j = 1. Now let v be an arbitrary divisor of m1 with degree deg(v) = p Q (1) and let v ′ = g∈hbi xg for some variable x ∈ F[Vω1 ]. Then v ′ is b-invariant by construction. Moreover by (15) we have φc (v ′ ) = pφc (x) = 0 and φa (v ′ ) = pφa (x) − (1 + 2 + · · · + p − 1)φc (x) = 0, and consequently v ′ is G-invariant. Now as v ′ ∼ v, we can find by Proposition 14 a monomial m′ ∼ m such that ′ ′ ′ G m − m′ ∈ F[W ]G + F[W ] and v | m . But then m ∈ F[W ]+ F[W ] and we are done for this case. Now let µ(m) < p. As deg(m1 ) ≥ p, we can take a divisor v | m1 such that v = v (i) v (j) for some indices i 6= j ≤ n1 where we have deg(v (i) ) = µ(m) (i) (j) and deg(v (j) ) = 1. Then the monomial v ′ := (x1,1 )µ(m) x1,1 is homologous with this v and consequently, by Proposition 14, a monomial m′ ∈ F[W ] exists ′ ′ such that m − m′ ∈ F[W ]G + F[W ] and v | m . Our claim will now follow by ′ G proving that m ∈ F[W ]+ F[W ]. 11 (i) (j) To this end observe that for the monomial m̃ := x1,1 m′ /x1,1 we have µ(m̃) = µ(m) + 1, hence by the induction hypothesis m̃ ∈ F[W ]G + F[W ] i,j ′ already holds. Moreover ∆1 (m̃) = (µ(m) + 1)m by construction, hence (µ(m) + 1)m′ ∈ F[W ]G + F[W ] by (17) and we are finished because by our assumption on F we are allowed to divide by µ(m) + 1 ≤ p < char(F). Proof of Theorem 2. From Proposition 15 we see that F[W ] as a module over F[W ]G is generated by elements of degree at most p2 − 2. Equivalently, for the top degree in the factor ring F[W ]/ F[W ]G + F[W ] we have the estimate b(G, W ) ≤ p2 − 2, whence by (6) we conclude that β(G, W ) ≤ p2 − 1. 6 The case p=3 Proposition 16. Consider V = Vω for a primitive third root of unity ω ∈ F as given by (11). Then β(H3 , V ) ≥ 9. Proof. Let F[V ] = F[x, y, z] with the variables conforming our conventions. 2 F[V ]H3 is spanned by the elements τ (m) := τAH3 (m) = 13 (m+ mb + mb ) where m is any A-invariant monomial. An easy argument shows that xyz, x3 , y 3, z 3 are the only irreducible A-invariant monomials. Then by enumerating all Ainvariant monomials of degree at most 8 we see that they have degree 3 or 6 so 3 3 3 3 that for d ≤ 8 we have F[V ]H d = Rd , where R := F[xyz, τ (x ), τ (x y )]. Now if we assume that β(H3 , V ) ≤ 8 then F[V ]H3 = R follows. Observe however that all the generators of R are symmetric polynomials, so that R ⊆ F[V ]S3 . On the other hand τ (x6 y 3 ) ∈ F[V ]H3 is not a symmetric polynomial, whence τ (x6 y 3) 6∈ R. This is a contradiction which proves that β(H3 , V ) ≥ 9. The upper bound on β(H3 ) will be obtained by an argument very similar to Propositions 8, 14 and 15, but since there are many different details, too, we preferred to give a self-contained treatment of this case here: Proposition 17. If char(F) 6= 3 then β(H3 ) ≤ 9. Proof. Suppose that β(H3 , W ) ≥ 10 holds for a H3 -module W . Then there is a monomial m ∈ F[W ]A with deg(m) ≥ 10 such that m 6∈ F[W ]G + F[W ]+ (as otherwise for any d ≥ 10 the space F[W ]G spanned by the elements τ (m) d G 2 would be contained in (F[W ]+ ) ). Let S = Φc (m), identify hci with Z/3Z and let di = vi (S) for i ∈ Z/3Z = {0, 1, 2}. Recall that we have the factorisation m = m0 m1 m2 corresponding to the direct decomposition W = U ⊕V1 ⊕V2 , so that deg(mi ) = di for i = 0, 1, 2. We may assume by symmetry that d1 ≥ d2 . A. We claim that d1 ≥ 5. 12 S is a zero-sum sequence over Z/3Z and this is only possible if d1 −d2 ≡ 0 mod 3. So let d1 − d2 = 3k for some integer k ≥ 0. Denoting by ℓ(S) the maximum number of non-empty zero-sum sequences into which S can be factored, we have ℓ(S) = d0 + d2 + k ≤ 5, as otherwise by Lemma 11 applied hci ∼ with N = hci we get m ∈ (F[W ]+ )6 ⊆ F[W ]G + F[W ]+ , since H3 /N = C3 × C3 2 and D(C3 ) = 5 by (2). On the other hand |S| = d0 +d1 +d2 ≥ 10. Subtracting from this inequality the previous one yields d1 − k ≥ 5, whence the claim. B. For any w | m1 with deg(w) ≤ 2 there is a factorisation m = u1 u2 u3 with ui ∈ F[W ]A + such that w | u3 and y | u1 for some variable y | m1 . As deg(m/w) ≥ 8 = D2 (C32 ) there is a factorisation m/w = u1 u2 r with A u1 , u2 ∈ F[W ]A + . Setting u3 = rw enforces u3 ∈ F[W ]+ . Here deg(u3 ) ≤ 2 A 4 G D(A) = 5 as otherwise u3 ∈ (F[W ]A + ) and m ∈ (F[W ]+ ) ⊆ F[W ]+ F[W ]+ by Lemma 11, a contradiction. Therefore we cannot have m1 | u3 , for then by A. we have 5 ≤ deg(m1 ) ≤ deg(u3 ) ≤ 5, so that m1 = u3 and Φc (m1 ) = 1[5] , contradicting the assumption that Φ(u3 ) is a zero-sum sequence over A. As a result there is a variable y | m1 not dividing u3 , whence the claim. C. For any divisor v | m1 with deg(v) ≤ 3 and any monomial v ′ ∼ v there is a monomial m′ ∈ F[W ] such that v ′ | m′ and m − m′ ∈ F[W ]G + F[W ]+ . Let v = xw and v ′ = xg w ′ where deg(w) ≤ 2, w ′ ∼ w and g ∈ hbi. By induction on deg(v) assume that we already have a monomial m′′ ∼ m such t ′ ′′ that m′′ − m ∈ F[W ]G + F[W ]+ and x w | m for some t ∈ hbi. According to ′ B. there are factorisations m′′ = u1 u2 u3 with ui ∈ F[W ]A + such that w | u3 and y | u1 for some variable y ∈ F[V1 ]. We have two cases: i) If we can take ′′ y = xt in one these factorisations then for m′ := u−t+g ut−g 1 2 u3 ∼ m we have ′ ′ m′ −m′′ ∈ F[W ]G + F[W ]+ by Lemma 12 so we are done as v | m . ii) Otherwise t ′ t necessarily x w | u3 and y 6= x . Still however, there is an h ∈ hbi such that ′′ G φ(y h ) = φ(xt ) hence for m̃ := uh1 u−h 2 u3 ∼ m we have m − m̃ ∈ F[W ]+ F[W ]+ by Lemma 12 and we obtain a factorisation m̃ = ũ1 ũ2 ũ3 falling under case i) h t by setting ũ1 = xt uh1 /y h, ũ2 = u−h 2 , ũ3 = y u3 /x , so we are done again. D. Now we proceed as in the proof of Proposition 15. For sake of Nthe 1 simplicity from now on we rename our variables so that F[V1 ] = ni=1 F[Vω ] = s,t F[xi , yi , zi : i = 1, . . . , n1 ]. Moreover we abbreviate ∆s,t 1 as ∆ . (i) 1) If we have deg(m1 ) ≥ 3 for some 1 ≤ i ≤ n1 then we can apply C. with G v ′ := xi yi zi ∈ F[W ]G + , concluding that m ∈ F[W ]+ F[W ]+ , a contradiction. (i) 2) Otherwise if deg(m1 ) = 2 for some i then still there is a j 6= i such (j) that deg(m1 ) ≥ 1. After an application of C. we may assume that m is divisible by x2i xj . But then m = 31 ∆j,i (m̃) for the monomial m̃ := mxi /xj which falls under case 1) hence m ∈ F[W ]G + F[W ]+ by (17), a contradiction. (1) (n1 ) 3) Finally, if deg(m1 ) = . . . = deg(m1 ) = 1 then after an application 13 of C. we may assume that x1 y2 z3 | m. Now consider the relation: ∆1,2 (x1 y1 z3 ) + ∆2,3 (x1 y2 z2 ) + ∆3,1 (x3 y2 z3 ) = 3x1 y2 z3 + τ (x3 y2 z1 ) (18) After multiplying (18) with m′ := m/x1 y2 z3 we get on the left hand side ∆1,2 (my1 /y2 ) + ∆2,3 (mz2 /z3 ) + ∆3,1 (mx3 /x1 ) ∈ F[W ]G + F[W ]+ by (17), as all the three monomials occurring here fall under case 2), and on the right hand ′ G side τ (x3 y2 z1 )m′ ∈ F[W ]G + F[W ]+ , whence 3m = 3x1 y2 z3 m ∈ F[W ]+ F[W ]+ follows. This contradiction completes our proof. Now comparing Proposition 16 and 17 immediately gives: Corollary 18. If char(F) 6= 3 then β(H3) = 9. Remark 19. It would be interesting to know if Theorem 2 also extends to the whole non-modular case, i.e. for any field F whose characteristic does not divide |G|, just as it is the case for p = 3 by the above result. Acknowledgements The author is grateful to Mátyás Domokos for many valuable comments on the manuscript of this paper. He also thanks the anonymous referee for many suggestions to improve the presentation of this material. References [1] Y. Berkovich. Groups of Prime Power Order, volume I of de Gruyter Expositions in Mathematics. de Gruyter, Berlin, New York, 2008. [2] K. Cziszter, M. Domokos. Groups with large Noether bound, Ann. de l’Institut Fourier 64:(3) pp. 909-944. (2014) [3] K. Cziszter, M. Domokos. The Noether number for the groups with a cyclic subgroup of index two, Journal of Algebra 399: pp. 546-560. (2014) [4] K. Cziszter, M. Domokos. On the generalised Davenport constant and the Noether number, Central European Journal of Mathematics 11:(9) pp. 1605-1615. (2013) [5] K. Cziszter, M. Domokos, and A. Geroldinger. The interplay of invariant theory with multiplicative ideal theory and with arithmetic combinatorics, in: Scott T. Chapman, M. Fontana, A. Geroldinger, B. Olberding (Eds.), Multiplicative Ideal Theory and Factorization Theory, Springer-Verlag, 2016, pp. 43-95. 14 [6] K. Cziszter, M. Domokos and I. Szöllősi. The Noether numbers and the Davenport constants of the groups of order less than 32, arXiv:1702.02997. [7] M. Domokos, P. Hegedűs. Noether’s bound for polynomial invariants of finite groups Arch. Math. (Basel) 74 (2000), no. 3, pp. 161-167. [8] P. Fleischmann. The Noether bound in invariant theory of finite groups. Ad. Math., 156(1):23-32, 2000. [9] J. Fogarty. On Noethers bound for polynomial invariants of a finite group, Electron. Res. Announc. Amer. Math. Soc. 7 (2001), 57. [10] M. Freeze, W. A. Schmid. Remarks on a generalization of the Davenport constant Discrete Math. 310, Issue 23, 6 December 2010, pp. 3373-3389 [11] A. Geroldinger and D. J. Grynkiewicz. The large Davenport constant I: Groups with a cyclic index 2 subgroup, J. Pure Appl. Algebra 217 (2013), 863-885. [12] A. Geroldinger, F. Halter-Koch. Non-unique factorizations. Algebraic, combinatorial and analytic theory. Monographs and Textbooks in Pure and Applied Mathematics, Chapman & Hall/CRC, 2006. [13] D. J. Grynkiewicz. The large Davenport constant II: General upper bounds, J. Pure Appl. Algebra 217 (2013), 222-2246. [14] P. Hegedűs, A. Maróti and L. Pyber. Finite groups with large Noether number are almost cyclic, arXiv:1706.08290 [15] M. D. Neusel, L. Smith. Invariant Theory of Finite Groups. Mathematical Surveys and Monographs 94. Providence, R.I.: American Mathematical Society, 2002 [16] E. Noether. Der Endlichkeitssatz der Invarianten endlicher Gruppen. Math. Ann., 77:89-92, 1916 [17] B. J. Schmid. Finite groups and invariant theory. In Malliavin M. P., editor, Topics in invariant theory, number 1478 in Lecture Notes in Mathematics, pages 35–66. Springer, 1989-90. [18] J. P. Serre. Representations linéares des groupes finis. Hermann, Paris, 1998. [19] M. Sezer. Sharpening the generalized Noether bound in the invariant theory of finite groups. J. Algebra 254 (2002), no. 2, 252263. 15
4math.GR
SECRET SHARING AND SHARED INFORMATION arXiv:1706.06998v2 [cs.IT] 10 Nov 2017 JOHANNES RAUH Abstract. Secret sharing is a cryptographic discipline in which the goal is to distribute information about a secret over a set of participants in such a way that only specific authorized combinations of participants together can reconstruct the secret. Thus, secret sharing schemes are systems of variables in which it is very clearly specified which subsets have information about the secret. As such, they provide perfect model systems for information decompositions. However, following this intuition too far leads to an information decomposition with negative partial information terms, which are difficult to interpret. One possible explanation is that the partial information lattice proposed by Williams and Beer is incomplete and has to be extended to incorporate terms corresponding to higher order redundancy. These results put bounds on information decompositions that follow the partial information framework, and they hint at where the partial information lattice needs to be improved. 1. Introduction Williams and Beer (2010) have proposed a general framework to decompose the multivariate mutual information I(S; X1 , . . . , Xn ) between a target random variable S and predictor random variables X1 , . . . , Xn into different terms (called partial information terms) according to different ways in which combinations of the variables X1 , . . . , Xn provide unique, shared or synergistic information about S. Williams and Beer argue that such a decomposition can be based on a measure of shared information. The underlying idea is that any information can be classified according to “who knows what.” But is this true? A situation where the question “who knows what” is easy to answer very precisely is secret sharing, a part of cryptography in which the goal is to distribute information (the secret) over a set of participants such that the secret can only be reconstructed if certain authorized combinations of the participants join their information (see Beimel (2011) for a survey). The set of authorized combinations is called the access structure. Formally, the secret is modelled as a random variable S, and a secret sharing scheme assigns a random variable Xi to each participant i in such a way that, if {i1 , . . . , ik } is an authorized set of participants, then S is a function of Xi1 , . . . , Xik ; that is, H(S|Xi1 , . . . , Xik ) = 0; and, conversely, if {i1 , . . . , ik } is not authorized, then H(S|Xi1 , . . . , Xik ) > 0. It is assumed that the participants know the scheme, and so any authorized combination of participants can reconstruct the secret if they join their information. A secret sharing scheme is perfect if non-authorized sets of participants know nothing about the secret; i.e., H(S|Xi1 , . . . , Xik ) = H(S). Thus, in a perfect secret sharing scheme, it is very clearly specified “who knows what.” In this sense, perfect secret sharing schemes provide model systems for which it should be easy to write down an information decomposition. One connection between secret sharing and information decompositions is that the set of access structures of secret sharing schemes with n participants is in 2000 Mathematics Subject Classification. 94A17; 94A62. Key words and phrases. Information decomposition, partial information lattice, shared information, secret sharing. 1 2 JOHANNES RAUH one-to-one correspondence with the partial information terms of Williams and Beer. This correspondence makes it possible to give another interpretation to all partial information terms: Namely, the partial information term is a measure of how similar a given system of random variables is to a secret sharing scheme with a given access structure. This correspondence also allows to introduce the secret sharing property that makes precise the above intuition: An information decomposition satisfies this property if and only if any perfect secret sharing scheme has just a single partial information term (which corresponds to its access structure). Lemma 2 states the secret sharing property is implied by the Williams and Beer axioms, which shows that the secret sharing property plays well together with the ideas of Williams and Beer. Proposition 1 shows that in an information decomposition that satisfies a natural generalization of this property, it is possible to prescribe arbitrary nonnegative values to all partial information terms. These results suggest that perfect secret sharing schemes fit well together with the ideas of Williams and Beer. However, following this intuition too far leads to inconsistencies. As Theorem 4 shows, extending the secret sharing property to pairs of perfect secret sharing schemes leads to negative partial information terms. While other authors have started to build an intuition for negative partial terms and argue that they may be unavoidable in information decompositions, the concluding section collects arguments against such claims and proposes as another possible solutions that the Williams and Beer framework is incomplete and is missing nodes that represent higher order redundancy. Cryptography, where the goal is not only to transport information (as in coding theory) but also to keep it concealed from unauthorized parties, has initiated many interesting developments in information theory, for example, by introducing new information measures and re-interpreting older ones; see, for example, Maurer and Wolf (1997); Csiszar and Narayan (2004). This manuscript focuses on another contribution of cryptography: probabilistic systems with well-defined distribution of information. The remainder of this article is organized as follows: Section 2 summarizes definitions and results about secret sharing schemes. Section 3 introduces different secret sharing properties that fix the values that a measure of shared information assigns to perfect secret sharing schemes and combinations thereof. The main result of Section 4 is that the pairwise secret sharing property leads to negative partial information terms. Section 5 discusses the implications of this incompatibility result. 2. Perfect secret sharing schemes We consider n participants among whom we want to distribute information about a secret in such a way that we can control which subsets of participants together can decrypt the secret. Definition 1. An access structure A is a family of subsets of {1, . . . , n}, closed to taking supersets. Elements of A are called authorized sets. A secret sharing scheme with access structure A is a family of random variables S, X1 , . . . , Xn such that: • H(XA , S) = H(XA ), whenever A ∈ A. Here, XA = (Xi )i∈A for all subsets A ⊆ {1, . . . , n}. A secret sharing scheme is perfect if • H(XA , S) = H(XA ) + H(S), whenever A ∈ / A. SECRET SHARING AND SHARED INFORMATION 3 The condition for perfection is equivalent to H(S|XA ) = H(S). See Beimel (2011) for a survey on secret sharing. Theorem 1. For any access structure A and any h > 0, there exists a perfect secret sharing scheme with access structure A for which the entropy of the secret S equals H(S) = h. Proof. Perfect secret sharing schemes for arbitrary access structures were first constructed by Ito et al. (1987). In this construction, the entropy of the secret equals 1 bit. Combining n copies of such a secret sharing scheme gives a secret sharing scheme with a secret of n bit. As explained in (Beimel, 2011, Claim 1), the distribution of the secret may be perturbed arbitrarily (as long as the support of the distribution remains the same). In this way it is possible to prescribe the entropy of the secret in a perfect secret sharing scheme.  Example 1. Let Y1 , Y2 , Y3 , S be independent uniform binary random variables, and let A = (Y1 , Y2 ⊕ S), B = (Y2 , Y3 ⊕ S), C = (Y3 , Y1 ⊕ S), where ⊕ denotes addition modulo 2 (or the XOR operation). Then (S, A, B, C) is a perfect secret sharing scheme with access structure {A, B}, {A, C}, {B, C}, {A, B, C}. It may be of little surprise that integer addition modulo k is an important building block in many secret sharing schemes. While existence of perfect secret sharing schemes is solved, there remains the problem of finding efficient secret sharing schemes in the sense that the variables X1 , . . . , Xn should be as small as possible (in the sense of a small entropy), given a fixed entropy of the secret. For instance, in Example 1, H(Xi )/H(S) = 2 for all i. See Beimel (2011) for a survey. Since an access structure A is closed to taking supersets, it is uniquely determined by its inclusion-minimal elements  A := A ∈ A : if B ⊆ A and B 6= A, then B ∈ /A . For instance, in Example 1, the first three elements belong to A. The set A has the property that no element of A is a subset of another element of A. Such a collection of sets is called an antichain. Conversely, any such antichain equals the set of inclusion-minimal elements of a unique access structure. The antichains have a natural lattice structure, which was used by Williams and Beer to order the different values of shared information and organize them into what they call the partial information lattice. The same lattice also has a description in terms of secret sharing. Definition 2. Let (A1 , . . . , Ak ) and (B1 , . . . , Bl ) be antichains. Then (A1 , . . . , Ak )  (B1 , . . . , Bl ) :⇐⇒ for any Bi there exists Aj with Aj ⊆ Bi . The partial information lattice for the case n = 3 is depicted in Figure 1. Lemma 1. Let A be an access structure on {1, . . . , n}, and let (B1 , . . . , Bl ) be an antichain. Then B1 , . . . , Bl are all authorized for A if and only if A  (B1 , . . . , Bl ). Proof. The statement directly follows from the definitions.  4 JOHANNES RAUH 3. Information decompositions of secret sharing schemes Williams and Beer (2010) proposed to decompose the total mutual information I(S; X1 , . . . , Xn ) between a target random variable S and predictor random variables X1 , . . . , Xn according to different ways in which combinations of the variables X1 , . . . , Xn provide unique, shared or synergistic information about S. One of their main ideas is to base such a decomposition on a single measure of shared information I∩ , which is a function I(S; Y1 , . . . , Yk ) that takes as arguments a list of random variables, of which the first, S, takes a special role. To arrive at a decomposition of I(S; X1 , . . . , Xn ), the variables Y1 , . . . , Yk are taken to be combinations XA = (Xi )i∈A of X1 , . . . , Xn , corresponding to subsets A of {1, . . . , n}. For simplicity, I∩ (S; XA1 , . . . , XAk ) is denoted by I∩ (S; A1 , . . . , Ak ) for all A1 , . . . , Ak ⊆ {1, . . . , n}. Williams and Beer proposed a list of axioms that such a measure I∩ should satisfy. It follows from these axioms that it suffices to consider the function I∩ (S; A1 , . . . , Ak ) in the case that (A1 , . . . , Ak ) is an antichain. Moreover, I∩ (S; ·) is a monotone function on the partial information lattice (Definition 2). Thus it is natural to write each value I∩ (S; A1 , . . . , Ak ) on the lattice as a sum of local terms I∂ corresponding to the antichains that lie below (A1 , . . . , Ak ) in the lattice: X I∩ (S; A1 , . . . , Ak ) = I∂ (S; B1 , . . . , Bl ). (B1 ,...,Bl )(A1 ,...,Ak ) The terms I∂ are called partial information terms. This representation always exists, and the partial information terms are uniquely defined (using a Möbius inversion). However, it is not guaranteed that I∂ is always nonnegative. If I∂ is nonnegative, then I∩ is called locally positive. Williams and Beer also defined a function denoted by Imin that satisfies their axioms and that is locally positive. While the framework is intriguing and has attracted a lot of further research (as this special issue illustrates), the function Imin has been critiziced as not measuring the right thing. The difficulty of finding a reasonable measure of shared information that is locally positive (Bertschinger et al., 2013; Rauh et al., 2014) has led some to argue that maybe local positivity is not a necessary requirement for an information decomposition. This issue is discussed further in Section 5. The goal of this section is to present additional natural properties for a measure of shared information that relate secret sharing with the intuition behind information decompositions. In a perfect secret sharing scheme, any combination of participants knows either nothing or everything about S. This motivates the following definition: Definition 3. A measure of shared information I∩ has the secret sharing property if and only if for any access structure A and any perfect secret sharing scheme (X1 , . . . , Xn , S) with access structure A, the following holds: ( H(S), if A1 , . . . , Ak are all authorized, I∩ (S; A1 , . . . , Ak ) = 0, otherwise, for any A1 , . . . , Ak ⊆ {X1 , . . . , Xn }. Lemma 2. The secret sharing property is implied by the Williams and Beer axioms. Proof. The Williams and Beer axioms imply that I∩ (S; A1 , . . . , Ak ) ≤ I(S; Ai ) = 0 whenever Ai is not authorized. On the other hand, when A1 , . . . , Ak are all authorized, then the monotonicity axiom implies I∩ (S; A1 , . . . , Ak ) ≥ I∩ (S; A1 , . . . , Ak , S) = I∩ (S; S) = H(S).  SECRET SHARING AND SHARED INFORMATION 5 Perfect secret sharing schemes lead to information decompositions with a single nonzero partial information term: Lemma 3. If I∩ has the secret sharing property and if (X1 , . . . , Xn , S) is a perfect secret sharing scheme with access structure A, then ( H(S), if A = {A1 , . . . , Ak }, (1) I∂ (S; A1 , . . . , Ak ) = 0, otherwise, for any A1 , . . . , Ak ⊆ {X1 , . . . , Xn }. Proof. Suppose that A = {A01 , . . . , A0k0 }, and let J∂ (S; A1 , . . . , Ak ) be the right hand side of (1). We need to show that I∂ = J∂ . Since the Möbius inversion is unique, it suffices to show that J∩ = I∩ , where X J∩ (S; A1 , . . . , Ak ) = J∂ (S; B1 , . . . , Bl ). (B1 ,...,Bl )(A1 ,...,Ak ) By Lemma 1, ( J∩ (S; A1 , . . . , Ak ) = H(S), 0, if A1 , . . . , Ak are all authorized, otherwise, for any A1 , . . . , Ak ⊆ {X1 , . . . , Xn }, from which the claim follows.  What happens when we have several secret sharing schemes involving the same participants? In order to have a clear intuition, assume that the secret sharing schemes satisfy the following definition: Definition 4. Let A1 , . . . , Al be access structures on {1, . . . , n}. A combination of (perfect) secret sharing schemes with access structures A1 , . . . , Al consists of random variables S1 , . . . , Sl , X1 , . . . , Xn such that (Si , X1 , . . . , Xn ) is a (perfect) secret sharing scheme with access structure Ai for i = 1, . . . , l and such that H(Si |S1 , . . . , Si−1 , Si+1 , . . . , Sl , XA ) = H(Si ) if A ∈ / Ai . This definition ensures that the secrets are independent in the sense that knowing some of the secrets provides no information about the other secrets. Formally, one can see that the secrets are probabilistically independent as follows: For any A ∈ / Ai (for example, A = ∅), H(Si |S1 , . . . , Si−1 , Si+1 , . . . , Sl ) ≥ H(Si |S1 , . . . , Si−1 , Si+1 , . . . , Sl , XA ) = H(Si ). In Definition 4, if two access structures Ai , Aj are identical, then we can replace Si and Sj by a single random variable (Si , Sj ) and obtain a smaller combination of (perfect) secret sharing schemes. In a combination of perfect secret sharing schemes, it is very clear who knows what: Namely, a group of participants knows all secrets for which it is authorized, while it knows nothing about the remaining secrets. This motivates the following definition: Definition 5. A measure of shared information I∩ has the combined secret sharing property if and only if for any combination of perfect secret sharing schemes with access structures A1 , . . . , Al ,   (2) I∩ (S1 , . . . , Sl ); A1 , . . . , Ak = H {Si : A1 , . . . , Ak ∈ Ai } (the entropy of those secrets for which A1 , . . . , Ak are all authorized). I∩ has the pairwise secret sharing property if and only if the same holds true in the special case l = 2. 6 JOHANNES RAUH The combined secret sharing property implies the pairwise secret sharing property. The pairwise secret sharing property does not follow from the Williams and Beer axioms. For example, Imin satisfies the Williams and Beer axioms, but not the pairwise secret sharing property (as will become apparent in Theorem 2). So one can ask whether the pairwise and combined secret sharing properties are compatible with the Williams and Beer axioms. This question is difficult to answer, since currently there are only two proposed measures of shared information that satisfy the Williams and Beer axioms, namely Imin and the minimum of mutual informations (Barrett, 2014) IMMI (S; A1 , . . . , Ak ) := min I(S; Ai ). i=1,...,k Both measures do not satisfy the pairwise secret sharing property. While there has been no further proposal for a function that satisfies the Williams and Beer axioms for arbitrarily many arguments, several measures have been proposed for the “bivariate case” k = 2, notably Ired of Harder et al. (2013) and f of Bertschinger et al. (2014). The appendix shows that SI f at least satisfies the SI combined secret sharing property “as far as possible.” Combinations of l perfect secret sharing schemes lead to information decompositions with at most l nonzero partial information terms. Lemma 4. Assume that I∩ has the combined secret sharing property. If (S1 , . . . , Sl , X1 , . . . , Xn ) is a combination of perfect secret sharing schemes with pairwise different access structures A1 , . . . , Al , then  H(Si ), if Ai = {A1 , . . . , Ak }   I∂ (S1 , . . . , Sl ); A1 , . . . , Ak = for some i ∈ {1, . . . , l},   0, otherwise, for any A1 , . . . , Ak ⊆ {X1 , . . . , Xn }. The proof is similar to the proof of Lemma 3 and omitted. The combined secret sharing property implies that any combination of nonnegative values can be prescribed as partial information values. Proposition 1. Suppose that a nonnegative number hA is given for any antichain A. For any measure of shared information that satisfies the combined secret sharing property, there exist random variables S, X1 , . . . , Xn such that the corresponding partial measure I∂ satisfies I∂ (S; A1 , . . . , Ak ) = hA1 ,...,Ak for all antichains A = (A1 , . . . , Ak ). Proof. By Theorem 1, for each antichain A there exists a perfect secret sharing scheme SA , X1,A , . . . , Xn,A with H(SA ) = hA . Combine independent copies of these perfect secret sharing schemes and let S = (SA )A , X1 = (X1,A )A , ..., Xn = (Xn,A )A , where A runs over all antichains. Then S, X1 , . . . , Xn is an independent combination of perfect secret sharing schemes, and the statement follows from Lemma 4.  Unfortunately, not every random variable S can be decomposed in such a way as a combination of secret sharing schemes. However, Proposition 1 suggests that, given a measure I∩ of shared information that satisfies the combined secret sharing property, I∂ (S; A) can informally be interpreted as a measure that quantifies how much (X1 , . . . , Xn , S) looks like a perfect secret sharing scheme with access structure A. Lemma 5. Suppose that I∩ is a measure of shared information that satisfies the pairwise secret sharing property. If X1 and X2 are independent, then  I∩ (X1 , X2 ); X1 , X2 = 0. SECRET SHARING AND SHARED INFORMATION 7 In the language of Ince (2017), the lemma says that the pairwise secret sharing property implies the independent identity property. S1 , S2 , X1 , X2 is a pair of perfect secret sharing Proof. Let S1 = X1 , S2 = X2 . Then  schemes with access structures A1 = {1} and A2 = {2} . The statement follows from Definition 5, since X1 is not authorized for A2 and X2 is not authorized for A1 .  4. Incompatibility with local positivity Unfortunately, although the combined secret sharing property very much fits the intuition behind the axioms of Williams and Beer, it is incompatible with a nonnegative decomposition according to the partial information lattice: Theorem 2. Let I∩ be a measure of shared information that satisfies the WilliamsBeer axioms and has the pairwise secret sharing property. Then I∂ is not nonnegative. Proof. The XOR example, which was already used by Bertschinger et al. (2013) and Rauh et al. (2014) to prove incompatibility results for properties of information decompositions, can also be used here. Let X1 , X2 be independent binary uniform random variables, let X3 = X1 ⊕ X2 , and let S = (X1 , X2 , X3 ). Observe that the situation is symmetric in X1 , X2 , X3 . In particular, X2 , X3 are also independent, and X1 = X2 ⊕ X3 . The following values of I∩ can be computed from the assumptions:   • I∩ S; X1 , (X2 X3 ) = I∩ S; X1 , (X1 X2 X3 ) = I∩ (S; X1 ) = 1 bit, since X1 is a function of (X2 , X3 ) and by the monotonicity axiom.   • I∩ (S; X1 , X2 ) = I∩ (X1 X2 X3 ); X1 , X2 = I∩ (X1 X2 ); X1 , X2 = 0 by Lemma 5. By monotonicity, I∩ (S; X1 , X2 , X3 ) = 0. Moreover,  I∩ S; (X1 X2 ), (X1 X3 ), (X2 X3 ) ≤ 2 bit, since 2 bit is the total entropy in the system. But then   I∂ S; (X1 X2 ), (X1 X3 ), (X2 X3 ) = I∩ S; (X1 X2 ), (X1 X3 ), (X2 X3 )    − I∩ S; X1 , (X2 X3 ) − I∩ S; X2 , (X1 X3 ) − I∩ S; X3 , (X1 X2 ) ± 0 ≤ 2 bit − 3 bit = −1 bit, where ±0 denotes values of I∩ that vanish. Thus, I∂ is not nonnegative.  Note that the random variables (S = (X1 , X2 , X3 ), X1 , X2 , X3 ) from the proof of Theorem 2 form three perfect secret sharing schemes that do not satisfy the definition of a combination of perfect secret sharing schemes. The three secrets X1 , X2 , X3 are not independent, but they are pair-wise independent (and so Lemma 4 does not apply). Remark 1. The XOR example from the proof of Theorem 2 (which was already used by Bertschinger et al. (2013) and Rauh et al. (2014)) was criticized by Chicharro and Panzeri (2017) on the grounds that it involves random variables that stand in a deterministic functional relation (in the sense that X3 = X1 ⊕ X2 ). Chicharro and Panzeri argue that in such a case it is not appropriate to use the full partial information lattice. Instead, the functional relationship should be used to eliminate (or identify) nodes from the lattice. Thus, while the monotonicity axiom of Williams and Beer implies I∩ (S; X3 , (X2 , X3 )) = I∩ (S; X3 ) (and so {3; 23} is not part of the partial information lattice), the same axiom also implies that I∩ (S; X3 , (X1 , X2 )) = I∩ (S; X3 ) in the XOR example, and so {3; 12} should similarly be excluded from the lattice when analyzing this particular example. But note that the first argument 8 JOHANNES RAUH {123} : 2 {1} : 1 {12} : 2 {13} : 2 {23} : 2 {12}{13} : 2 {12}{23} : 2 {13}{23} : 2 {2} : 1 {3} : 1 {12}{13}{23} : ? {1}{23} : 1 {2}{13} : 1 {3}{12} : 1 {1}{2} : 0 {1}{3} : 0 {2}{3} : 0 {1}{2}{3} : ? Figure 1. The partial information lattice for n = 3. Each node is indexed by an antichain. The values (in bit) of the shared information in the XOR example from the proof of Theorem 2 according to the pairwise secret sharing property are given after the colon. is a formal argument that is valid for all joint distributions of S, X1 , X2 , X3 , while the second argument takes into account the particular underlying distribution. It is easy to work around this objection. The deterministic relationship disappears when an arbitrarily small stochastic noise is added to the joint distribution. To be precise, let X1 , X2 be independent binary random variables, and let X3 be binary with ( 1 − , if x3 = x1 ⊕ x2 , P (X3 = x3 |X1 = x1 , X2 = x2 ) = , otherwise, for 0 ≤  ≤ 1. For  = 0, the example from the proof is recovered. Assuming that the partial information terms depend continuously on this  joint distribution, the partial information term I∂ S; (X1 X2 ), (X1 X3 ), (X2 X3 ) will still be negative for small  > 0. Thus, assuming continuity, the conclusion of Theorem 2 still holds true when the information decomposition according to the full partial information lattice is only considered for random variables that do not satisfy any functional deterministic constraint. Remark 2. Analyzing the proof of Theorem 2, one sees that the independent identity axiom (Lemma 5) is the main ingredient to arrive at the contradiction. The same property also arises in the other uses of the XOR example (Bertschinger et al., 2013; Rauh et al., 2014). 5. Discussion Perfect secret sharing schemes correspond to systems of random variables in which it is very clearly specified “who knows what.” In such a system, it is easy to assign intuitive values to the shared information nodes in the partial information lattice, and one may conjecture that the intuition behind this assignment is the same intuition that underlies the Williams and Beer axioms, which define the partial information lattice. Moreover, following the same intuition, independent combinations of perfect secret sharing schemes can be used as a tool to construct systems of random variables with prescribable (nonnegative) values of partial information. SECRET SHARING AND SHARED INFORMATION 9 Unfortunately, this extension to independent combinations of perfect secret sharing schemes is not without problems: By Theorem 2, it leads to decompositions with negative partial information terms. But what does it mean that the examples derived from the same intuition as the Williams and Beer axioms contradict the same axioms in this way? Is this an indication that the whole idea of information decomposition does not work (and that the question posed in the first paragraph of the introduction cannot be answered affirmatively)? There are several ways out of this dilemma. The first solution is to assign different values to combinations of perfect secret sharing schemes. This solution will not be pursued further in this text, as it would change the interpretation of the information decomposition as measuring “who knows what.” The second solution is to accept negative partial values in the information decomposition. It has been argued that negative values of information can be given an intuitive interpretation in terms of confusing or misleading information. For event-wise (also called “local”) information quantities, such as the event-wise mutual information i(s; x) = log(p(s)/p(s|x)), this interpretation goes back to the early days of information theory Fano (1961). Sometimes, this phenomenon is called “misinformation” (Ince, 2017; Wibral et al., 2015). However, in the usual language, misinformation refers to “false or incorrect information, especially when it is intended to trick someone” Macmillan Publishers Limited (retrieved on 2017/10/05), which is not the effect that is modelled here. Thus, the word misinformation should be avoided, in order not to mislead the reader into the wrong intuition. While negative event-wise information quantities are well-understood, the situation is more problematic for average quantities. When an agent receives sideinformation in the form of the value x of a relevant random variable X, she changes her strategy. While the prior strategy should be based on the prior distribution p(S), the new strategy should be based on the posterior p(S|X = x). Clearly, in a probabilistic setting, any change of strategy can lead to a better or worse result in a single instance. On average, though, side-information never hurts (and it is never advantageous on average to ignore side-information), which is why the mutual information is never negative. Similarly, it is natural to expect non-negativity of other information quantities. It is difficult to imagine how correct side-information (or an aspect thereof) can be misleading on average. The situation is different for incorrect information, where the interpretation of a negative value is much easier. More conceptually, I would suspect that an (averaged) information quantity that may change its sign actually conflates different aspects of information1, just as the interaction information (or co-information) conflates synergy and redundancy Williams and Beer (2010). In any case, allowing negative partial values alters the interpretation of an information decomposition to a point where it is questionable whether the word “decomposition” is still appropriate. When decomposing an object into parts, the parts should in some reasonable way be sub-objects. For example, in a Fourier decomposition of a function, the Fourier components are never larger than the function (in the sense of the L2 -norm), and the sum of the squared L2 -norms of the Fourier coefficients equals the squared L2 -norm of the original function. As another example, given a (positive) amount of money and two investment options, it may indeed be possible to invest a negative share of the total amount into one of the two options in order to increase the funds that can be invested in the second option. 1One can argue whether the same should be true for event-wise quantities. Recently, Ince (2017) suggested to also write the event-wise mutual information as a difference of non-negative quantities. 10 JOHANNES RAUH However, such short selling is regulated in many countries with much stronger rules than ordinary trading. I do not claim that an information decomposition with negative partial information terms cannot possibly make sense. However, it has to be made clear precisely how to interpret negative terms, and it is important to distinguish between correct information that leads to a suboptimal decision due to unlikely events happening (“bad luck”) and incorrect information that leads to decisions being based on the wrong posterior probabilities (as opposed to the “correct” conditional probabilities). A third solution is to change the underlying lattice structure of the decomposition. A first step in this direction was done by Chicharro and Panzeri (2017) who propose to decompose mutual information according to subsets of the partial information lattice. However, it is also conceivable that the lattice has to be enlarged. Williams and Beer derived the partial information lattice from their axioms together with the assumption that everything can be expressed in terms of shared information (that is, according to “who knows what”). Shared information is sometimes equivalently called redundant information, but it may be necessary to distinguish the two. Information that is shared by several random variables is information that is accessible to each single random variable, but redundancy can also arise at higher orders. An example is the infamous XOR example from the proof of Theorem 2: In this example, each pair Xi , Xj is independent and contains of two bits, but the total system X1 , X2 , X3 has only two bits. Therefore, there is one bit of redundancy. However, this redundancy bit is not located anywhere specifically: It is not contained in either of X1 , X2 , X3 , and thus it is not shared information. Since the redundant bit is not part of X1 , it is not “shared” by X1 in this sense. This phenomenon corresponds to the fact that random variables can be pairwise independent without being independent. This kind of higher order redundancy does not have a place in the partial information lattice, so it may be that nodes corresponding to higher order redundancy have to be added. When the lattice is enlarged in this way, the structure of the Möbius inversion is changed, and it is possible that the resulting lattice leads to nonnegative partial information terms, without changing those cumulative information values that are already present in the original lattice. If this approach succeeds, the answer to the question from the introduction will be negative: Simply classifying information according to “who knows what” (i.e. shared information) does not work, since it does not capture higher order redundancy. The analysis of extensions of the partial information lattice is scope for future work. Acknowledgments. I thank Fero Matúš for teaching me about secret sharing schemes. I am grateful to Guido Montúfar and Pradeep Kr. Banerjee for their remarks about the manuscript, and to Nils Bertschinger, Jürgen Jost and Eckehard Olbrich for many inspiring discussions on the topic. I thank the reviewers for many comments, in particular concerning the discussion. I thank the organizers and participants of the PID workshop in December 2016 in Frankfurt, where the material was first presented. SECRET SHARING AND SHARED INFORMATION 11 Appendix A. Combined secret sharing properties for small k This section discusses the defining equation (2) of the combined secret sharing property for k = 1 and k = 2. The case k = 1 is incorporated in the definition of a combination of perfect secret sharing schemes: The following lemma implies that any measure of shared information that satisfies self-redundancy satisfies (2) for k = 1. Recall that Williams and Beer’s self-redundancy axiom implies that I∩ (S; XA ) = I(S; XA ). Lemma 6. Let (S1 , . . . , Sl , X1 , . . . , Xn ) be a combination of perfect secret sharing schemes with access structures A1 , . . . , Al . Then   I (S1 , . . . , Sl ); XA = H {Si : A ∈ Ai } . Proof. Suppose that the secret for which A is authorized are S1 , . . . , Sm . Then H(S1 , . . . , Sl |XA ) = H(S1 , . . . , Sm |XA ) + H(Sm+1 , . . . , Sl |S1 , . . . , Sm , XA ) = H(Sm+1 , . . . , Sl |S1 , . . . , Sm , XA ) ≤ H(Sm+1 , . . . , Sl ) ≤ l X H(Si ). i=m+1 On the other hand, H(Sm+1 , . . . , Sl |S1 , . . . , Sm , XA ) = l X H(Si |S1 , . . . , Si−1 , XA ) i=m+1 ≥ l X i=m+1 H(Si |S1 , . . . , Si−1 , Si+1 , . . . , Sl , XA ) = l X H(Si ). i=m+1 Pl By independence (remark after Definition 4), i=m+1 H(Si ) = H(Sm+1 , . . . , Sl ) Pm and i=1 H(Si ) = H(S1 , . . . , Sm ). Thus,  I (S1 , . . . , Sl ); XA = H(S1 , . . . , Sl ) − H(S1 , . . . , Sl |XA ) = H(S1 , . . . , Sm ).  f The next result shows that the bivariate measure of shared information SI(S; X, Y ) proposed by Bertschinger et al. (2014) satisfies Eq. (2) for k ≤ 2. The reader is f referred to loc. cit. for definitions and elementary properties of SI. Proposition 2. Let (S1 , . . . , Sl , X1 , . . . , Xn ) be a combination of perfect secret sharing schemes with access structures A1 , . . . , Al , Then   f (S1 , . . . , Sl ); XA , XA = H {Si : A ∈ A1 ∩ A2 } . SI 1 2 Proof. For given A1 , A2 , suppose that S1 , . . . , Sm are the secrets for which at least one of A1 or A2 is authorized and that Sm+1 , . . . , Sl are the secrets for which neither A1 nor A2 is authorized alone. Let P be the joint distribution of S1 , . . . , Sl , XA1 , XA2 . Let ∆P be the set of alternative joint distributions for S1 , . . . , Sl , XA1 , XA2 that have the same marginal distributions as P on the subsets (S1 , . . . , Sl , XA1 ) and (S1 , . . . , Sl , XA2 ). According f we need to compare P with the elements of ∆P and find the to the definition of SI,  maximum of HQ (S1 , . . . , Sl ) XA1 , XA2 over Q ∈ ∆P , where the subscript to H indicates with respect to which of these joint distributions the conditional entropy is evaluated. Define a distribution Q∗ for S1 , . . . , Sl , XA1 , XA2 by Q∗ (s1 , . . . , sl , x1 , x2 ) = P (s1 , . . . , sl )P (xA1 = x1 |s1 , . . . , sl )P (xA2 = x2 |s1 , . . . , sl ). Then Q∗ ∈ ∆P . Under P , the secrets Sm+1 , . . . , Sl are independent of XA1 (marginally) and independent of XA2 , and so Sm+1 , . . . , Sl are independent of 12 JOHANNES RAUH the pair (XA1 , XA2 ) under Q∗ . On the other hand, S1 , . . . , Sm are a function of either XA1 or XA2 under P , and so S1 , . . . , Sm is a function of (XA1 , XA2 ) under Q∗ . Thus, HQ∗ (S1 , . . . , Sl |XA1 , XA2 ) = HQ∗ (Sm+1 , . . . , Sl ) = HP (Sm+1 , . . . , Sl ). On the other hand, under any joint distribution Q ∈ ∆P , the secrets S1 , . . . , Sm are functions of XA1 , XA2 , whence HQ (S1 , . . . , Sl |XA1 , XA2 ) ≤ HQ (Sm+1 , . . . , Sl ) = HP (Sm+1 , . . . , Sl ). f It follows that Q∗ solves the optimization problem in the definition of SI. Suppose that the secrets for which XA1 is authorized are S1 , . . . , Sr and that the secrets for which XA2 is authorized are Ss , . . . , Sm (with 1 ≤ r, s ≤ m). One computes s−1 X  IQ∗ (S1 , . . . , Sl ); XA1 XA2 = H(S1 , . . . , Ss−1 ) = H(Si ) and i=1 r X  IQ∗ (S1 , . . . , Sl ); XA1 = H(S1 , . . . , Sr ) = H(Si ), i=1 whence f (S1 , . . . , Sl ); XA , XA SI 1 2    = IQ∗ (S1 , . . . , Sl ); XA1 − IQ∗ (S1 , . . . , Sl ); XA1 XA2 = r X H(Si ) = H(Ss , . . . , Sr ).  i=s References Williams, P.; Beer, R. Nonnegative Decomposition of Multivariate Information. arXiv:1004.2515v1 2010. Beimel, A. Secret-sharing Schemes: A Survey. Proceedings of the Third International Conference on Coding and Cryptology; Springer-Verlag: Berlin, Heidelberg, 2011; pp. 11–46. Maurer, U.; Wolf, S. The intrinsic conditional mutual information and perfect secrecy. Proc. IEEE ISIT, 1997. Csiszar, I.; Narayan, P. Secrecy capacities for multiple terminals. IEEE Transactions on Information Theory 2004, 50, 3047–3061. Ito, M.; Saito, A.; Nishizeki, T. Secret sharing scheme realizing general access structure. Proceedings of the IEEE Global Telecommunication Conf., 1987, pp. 99–102. Bertschinger, N.; Rauh, J.; Olbrich, E.; Jost, J. Shared Information — New Insights and Problems in Decomposing Information in Complex Systems. In Proc. ECCS 2012; Springer, 2013; pp. 251–269. Rauh, J.; Bertschinger, N.; Olbrich, E.; Jost, J. Reconsidering unique information: Towards a multivariate information decomposition. Proc. IEEE ISIT, 2014, pp. 2232–2236. Barrett, A.B. An exploration of synergistic and redundant information sharing in static and dynamical Gaussian systems. CoRR 2014, abs/1411.2832. Harder, M.; Salge, C.; Polani, D. A Bivariate measure of redundant information. Phys. Rev. E 2013, 87, 012130. Bertschinger, N.; Rauh, J.; Olbrich, E.; Jost, J.; Ay, N. Quantifying unique information. Entropy 2014, 16, 2161–2183. SECRET SHARING AND SHARED INFORMATION 13 Ince, R. Measuring multivariate redundant information with pointwise common change in surprisal. Entropy 2017, 19, 318. Chicharro, D.; Panzeri, S. Synergy and Redundancy in Dual Decompositions of Mutual Information Gain and Information Loss. Entropy 2017, 19. Fano, R.M. Transmission of Information; MIT Press: Cambridge, MA, 1961. Wibral, M.; Lizier, J.T.; Priesemann, V. Bits from Brains for Biologically Inspired Computing. Frontiers in Robotics and AI 2015, 2, 5. Macmillan Publishers Limited. Macmillan Dictionary. Available at http://www. macmillandictionary.com/, retrieved on 2017/10/05. Ince, R. The Partial Entropy Decomposition: Decomposing multivariate entropy and mutual information via pointwise common surprisal. arXiv:1702.01591 2017. E-mail address: jrauh@mis.mpg.de Max Planck Institute for Mathematics in the Sciences, Leipzig, Germany
7cs.IT
A New Class of Permutation Trinomials Constructed from Niho Exponents arXiv:1707.00549v2 [cs.IT] 3 Oct 2017 Tao Bai and Yongbo Xia∗ Abstract Permutation polynomials over finite fields are an interesting subject due to their important applications in the areas of mathematics and engineering. In this paper we investigate the trinomial f (x) = x(p−1)q+1 + xpq − xq+(p−1) over the finite field Fq2 , where p is an odd prime and q = pk with k being a positive integer. It is shown that when p = 3 or 5, f (x) is a permutation trinomial of Fq2 if and only if k is even. This property is also true for more general class of polynomials g(x) = x(q+1)l+(p−1)q+1 + x(q+1)l+pq − x(q+1)l+q+(p−1) , where l is a nonnegative integer and gcd(2l + p, q − 1) = 1. Moreover, we also show that for p = 5 the permutation trinomials f (x) proposed here are new in the sense that they are not multiplicative equivalent to previously known ones of similar form. Index Terms Finite fields, Permutation polynomials, Trinomials, Niho exponents, Multiplicative inequivalent. AMS 94B15, 11T71 1 Introduction Let Fq denote the finite field with q elements and F∗q = Fq \ {0}, where q is a prime power. A polynomial f (x) ∈ Fq [x] is called a permutation polynomial of Fq if the associated mapping f : c 7−→ f (c) permutes Fq . Permutation polynomials were firstly studied by Hermite for the finite prime fields and by Dickson for arbitrary finite fields [19]. They have wide applications in coding theory [14], cryptography [5, 25] and combinatorial designs [3]. For a finite field Fq , there are in total q! permutation polynomials of Fq , and all of them can be obtained from the Lagrange interpolation. Permutations with a few terms are of particular interest because of the simple algebraic expressions. Especially, permutation binomials and trinomials attracted particular attention [11, 12, 20, 27, 15, 31]. Recent achievements on the study of permutation polynomials were surveyed in [11, 23]. Let p be a prime and k a positive integer. A Niho exponent over the finite field Fp2k is a positive integer d satisfying d ≡ pj (mod pk − 1) for some nonnegative integer j < k. In the case of j = 0, it is called a normalized Niho exponent. Researches in the past decades demonstrate that Niho exponents ∗ Corresponding author. T. Bai and Y. Xia are with the Department of Mathematics and Statistics, South-Central University for Nationalities, Wuhan 430074, China. Y. Xia is also with the Hubei Key Laboratory of Intelligent Wireless Communications, South-Central University for Nationalities, Wuhan 430074, China (e-mail: xia@mail.scuec.edu.cn). 1 are good resources that lead to desirable objects in sequence design [6, 30], coding theory [2, 32] and cryptography [7]. Recently, a lot of permutation trinomials of the form k F (x) = x + λ1 xs(p −1)+1 k + λ2 xt(p −1)+1 (1) have been proposed, where s and t are two integers, and the coefficients λ1 and λ2 are restricted to {−1, 1}. For p = 2, Li and Helleseth gave a rather detailed list of known pairs (s, t) and some new pairs such that F (x) is a permutation polynomial of F22k [16, 17]. In [21, 8, 34, 28] some permutation trinomials of F22k of similar form were also presented. For p = 3, Li et al. in [21] investigated several permutation trinomials of F32k of the form (1) and proposed three conjectures, which were later confirmed in [18] and [1]. Very recently, for p = 5, Wu and Li in [29] derived a series of sufficient conditions on s, t, λ1 and λ2 for F (x) to permute F52k . There are also some permutation polynomials constructed from Niho exponents over Fq2 with q being a power of an arbitrary prime. Hou in [10] characterized the necessary and sufficient conditions on the coefficients for the polynomial ax + bxq + x2q−1 ∈ Fq2 [x] to be a permutation of Fq2 . In [4], for q 6≡ 3 (mod 3), the necessary and sufficient conditions for x+xt(q−1)+1 +x−t(q−1)+1 to be a permutation polynomial of Fq2 were determined, where t is a positive integer. Let T rq2 /q (·) denote the trace function from Fq2 to Fq [19]. Some permutation trinomials of Fq2 of the form x + γT rq2 /q (xd ) were obtained in [13], where γ ∈ F∗q and d is a Niho exponent over Fq2 . In this paper, we investigate the permutation property of the following trinomial f (x) = x(p−1)q+1 + xpq − xq+(p−1) , (2) where p is an odd prime and q = pk for a positive integer k. It is easily verified that (p − 1)q + 1, pq and q + (p − 1) are Niho exponents over Fp2k . We show that for p = 3 or 5, f (x) in (2) is a permutation polynomial of Fp2k if and only if k is even. However, for the case p > 5, such a result may not hold. Furthermore, we prove that the above property is also true for more general polynomials g(x) = x(q+1)l+(p−1)q+1 + x(q+1)l+pq − x(q+1)l+q+(p−1) , (3) where l is a nonnegative integer and gcd(2l + p, q − 1) = 1. In addition, when p = 5, the permutation polynomials f (x) presented in (2) are shown to be new in the sense that they are not multiplicative equivalent to the permutation polynomials of the form (1) in [21, 18, 29, 22, 9, 10, 4, 13]. The remainder of this paper is organized as follows. Section 2 gives some preliminaries and notation, including some useful lemmas. In Section 3, we give the proofs of our main results. Section 4 is devoted to demonstrating that the permutation trinomials f (x) given in (2) are new when p = 5. Section 5 concludes the study. 2 2 Preliminaries Let p be a prime, k a positive integer and q = pk . The trace function and the norm function from Fq2 to Fq will be denoted by T r(x) and N (x), respectively [19]. Namely, T r(x) = x + xq and N (x) = x · xq , x ∈ Fq2 . The unit circle U of Fq2 is defined by U = {x | xq+1 = 1, x ∈ Fq2 }. (4) In [16, 17, 21, 18, 29], in order to prove the permutation property of the trinomials constructed from Niho exponents, the authors mainly used the following lemma, which was proved by Park and Lee in 2001 and reproved by Zieve in 2009. Lemma 1 ([24, 33]) Let p be a prime and n a positive integer. Assume that d is a positive integer such that d | (pn − 1), h(x) ∈ Fpn [x] and r > 0 is a integer. Then, xr h(x pn −1 d ) is a permutation of Fpn if and only if n (i) gcd(r, p (ii) xr h(x) −1 d ) pn −1 d = 1 and permutes µd , where µd is the set of d-th root of unity in F∗pn . The polynomials constructed from Niho exponents over Fq2 can always be rewritten as the form xr h(x q2 −1 d ) with d = q + 1. To determine the permutation property of the polynomials xr h(x constructed from Niho exponents by Lemma 1, the main task is to decide if xr h(x) unit circle U of Fq2 . However, sometimes the corresponding polynomial xr h(x) q2 −1 d q2 −1 d q2 −1 d ) permutes the leads to fractional polynomial with high degree [26, 16, 17, 21, 18, 29]. It is still a difficult problem in general to verify that xr h(x) q2 −1 d permutes U . Another general approach to investigating the permutation property of the polynomials constructed from Niho exponents over Fq2 is to concentrate on the subset Fq2 \ Fq . More specifically, assume that G(x) is a polynomial constructed from Niho exponents over Fq2 with coefficients in Fq . If we can show that G(x) is a permutation of Fq and a permutation of Fq2 \ Fq respectively, then G(x) is a permutation polynomial of Fq2 . To this end, it is usually required that G(x) has the property G(Fq2 \ Fq ) ∈ Fq2 \ Fq , and the key step in the proof is to prove that G(x) is a permutation of Fq2 \ Fq . This idea originated from [9] and later was used in [21]. In this paper we will use this idea to prove our main result. The following lemma is needed in the sequel. Its proof is trivial and is omitted here. 3 Lemma 2 Let q be a prime power. Denote by T r(x) and N (x) the trace function and the norm function from Fq2 to Fq , respectively. Then, for any c ∈ Fq2 , {c, cq } is uniquely determined by the pair (T r(c), N (c)). The following lemma is obtained by direct computations. Lemma 3 Let q be a prime power, and T r(x) and N (x) be the trace function and the norm function from Fq2 to Fq , respectively. (i) If q = 3k , then for any x ∈ Fq2 , T r(x2 ) = T r2 (x) + N (x) and T r(x4 ) = T r4 (x) − N (x)T r2 (x) − N 2 (x); (ii) If q = 5k , then for any x ∈ Fq2 , T r(x2 ) = T r2 (x) − 2N (x), T r(x3 ) = T r3 (x) + 2N (x)T r(x), T r(x4 ) = T r4 (x) + N (x)T r2 (x) + 2N 2 (x), T r(x6 ) = T r6 (x) − N (x)T r4 (x) − N 2 (x)T r2 (x) − 2N 3 (x), and T r(x8 ) = T r8 (x) + 2N (x)T r6 (x) − N 3 (x)T r2 (x) + 2N 4 (x). Proof: We only give the proof of (ii). In Lemma 1 of [29], the expressions for T r(x2 ), T r(x3 ), T r(x4 ) and T r(x8 ) were given while that for T r(x6 ) was not. Now we compute T r(x6 ) to illustrate how to obtain the above results. Note that T r6 (x) = = = = = = (x + xq )6 (x + xq )5 (x + xq ) (x5 + x5q )(x + xq ) x6 + x5+q + x5q+1 + x6q  T r(x6 ) + x1+q x4 + x4q T r(x6 ) + N (x)T r(x4 ), which implies T r(x6 ) = T r6 (x) − N (x)T r(x4 ). Substituting T r(x4 ) into (5), we get the desired result. Lemma 4 Let U be defined as (4). We have the following results: (i) if q = 3k , then y 2 + 1 = 0 has no root in U if k is even and has two roots in U otherwise; (ii) if q = 5k , then y 2 − y + 1 = 0 has no root in U if k is even and has two roots in U otherwise. 4 (5)  Proof: (i) Let α be a primitive root of Fq2 with q = 3k . Then, the roots of y 2 = −1 are ±α q2 −1 4 , which belong to U if and only if q + 1 is divisible by 4. Since q + 1 is divisible by 4 if and only if k is odd, it follows the desired result. (ii) Note that y 2 − y + 1 is an irreducible polynomial over F5 because it has no solution in F5 . Since the degree of y 2 − y + 1 is 2, it follows that its two roots belong to F52 . We can rewrite y 2 − y + 1 as √ √ (y + 2)2 − 3. Then, the two roots of y 2 − y + 1 in F52 are −2 ± 3, where ± 3 denote the two roots of x2 = 3 in F52 . When k is even, √ q √ √ √ √ 5 √ q 3 = 3 since 3 ∈ F52 and when k is odd, 3 = 3 = − 3. Thus, when k is even, we have −2 ± √ q+1 3 √ q √  = −2 ± 3 −2 ± 3 √ 2 = −2√ ± 3 = 2 ± 3, which is not equal to 1. When k is odd, we have −2 ± Therefore, when k is odd, −2 ± √ q+1 3 = = = −2 ∓ 4−3 1. √  √  3 −2 ± 3 √ 3 ∈ U . From the above computations, it follows the desired result.  The following lemma is a special case of Exercise 7.4 in [19]. For the reader’s convenience, we include a proof here. Lemma 5 Let Fq be a finite field of characteristic p. Then, xp −ux ∈ Fq [x] is a permutation polynomial of Fq if and only if u is not a (p − 1)th power of an element of F∗q . Proof: Note that xp − ux is a p-polynomial over Fq , and it is a permutation polynomial of Fq if and only if it only has the root 0 in Fq . Thus, xp − ux is a permutation polynomial of Fq if and only if xp−1 − u has no root in Fq . The latter exactly means that u is not a (p − 1)th power in Fq . 3  A new class of permutation trinomials from Niho exponents In this section, we present our main results about the permutation property of f (x) defined in (2) and that of g(x) defined in (3). The first main result is given in the following theorem. Theorem 1 Let q = pk and f (x) be the trinomial defined in (2). Then for p = 3 or 5, f (x) is a permutation polynomial of Fq2 if and only if k is even. 5 Before we prove this theorem in detail, we mention some characterizations of f (x) and g(x). The three exponents appearing in f (x) are Niho exponents since (p − 1)q + 1 = (p − 1)(q − 1) + p, pq = p(q − 1) + p, and q + (p − 1) = (q − 1) + p. However, the exponents in g(x) may not be Niho exponents. As we will see in the sequel, the permutation property of f (x) and that of g(x) depend on a same condition after utilizing Lemma 1. If we obtain the condition for f (x) to permute Fq2 , then it is also true for g(x). In addition, a permutation polynomial f (x) of the form (2) is closely related to some permutation polynomial of the form (1). In the next section, we will study the relationship between f (x) in Theorem 1 and the previously known permutation trinomials of the form (1). By comparison, we will show that the permutation polynomial f (x) proposed here is new when p = 5. In order to prove Theorem 1, the following preparatory lemma is needed. Lemma 6 Let q = pk and f (x) be defined in (2). When p = 3 or 5, for any x ∈ Fq2 \ Fq , we have f (x) ∈ Fq2 \ Fq if and only if k is even. Proof: Assume that x ∈ Fq2 \ Fq . Note that f (x) ∈ Fq if and only if x(p−1)q+1 + xpq − xq+(p−1) = xq+(p−1) + xp − x(p−1)q+1 which is equivalent to 2xq+(p−1) + xp − xpq − 2x(p−1)q+1 = 0. Dividing the above equation by xp , we get 2xq−1 + 1 − xp(q−1) − 2x(p−1)(q−1) = 0. (6) Setting z = xq−1 , (6) can be rewritten as 2z + 1 − z p − 2z p−1 = 0, which equals (z − 1)(z 2 + 1) = 0 (7) (z − 1)(z 2 − z + 1)2 = 0 (8) if p = 3, and if p = 5. Note that if x ∈ Fq2 \ Fq , then z = xq−1 ∈ U \ {1}, where U is defined as (4). For p = 3, from (7), we can conclude that for any x ∈ Fq2 \ Fq , we have f (x) ∈ Fq if and only if z = xq−1 satisfies z 2 + 1 = 0. By Lemma 4, if k is even, then z 2 + 1 = 0 has no root in U . Thus, in this case, for any x ∈ Fq2 \ Fq , we have f (x) ∈ / Fq , i.e., f (x) ∈ Fq2 \ Fq . If k is odd, then z 2 + 1 = 0 has two roots in U \ {1}, which 6 shows that there are 2(q − 1) elements x ∈ Fq2 \ Fq such that f (x) ∈ Fq . Similarly, for p = 5, we can obtain the same conclusion by (8) and Lemma 4. From the above discussions, it follows the desired result.  k Proof of Theorem 1. Note that in this proof q = p and p is restricted to {3, 5}. To prove that f (x) is a permutation of Fq2 , it suffices to show that for any c ∈ Fq2 , f (x) = c has exactly one root in Fq 2 . Note that when x ∈ Fq , then f (x) = xp , which is a permutation of Fq since gcd(p, q − 1) = 1. On the other hand, if k is odd, from the proof of Lemma 6, there are 2(q − 1) elements x ∈ Fq2 \ Fq such that f (x) ∈ Fq . Therefore, when k is odd, for some c ∈ Fq there must exist at least two distinct elements x1 , x2 ∈ Fq2 such that f (x1 ) = f (x2 ) = c. Thus, f (x) is not a permutation polynomial of Fq2 when k is odd. Next we prove that when k is even, then f (x) is a permutation polynomial of Fq2 , i.e., f (x) = c has exactly one root in Fq2 . We consider the following two cases. Case 1: c ∈ Fq . Then, by Lemma 6, we can derive from f (x) = c that x must belong to Fq . Thus, in this case f (x) = c is equivalent to that xp = c. Obviously, the latter has only one root in Fq2 . Case 2: c ∈ Fq2 \ Fq . Then, by Lemma 6, the roots of f (x) = c belong to Fq2 \ Fq . Next we will show that f (x) = c has exactly one root in Fq2 \ Fq under the given conditions. Let T r(x) and N (x) be defined as (3). We compute T r(f (x)) and N (f (x)) as follows: T r(f (x))  q = x(p−1)q+1 + xpq − xq+(p−1) + x(p−1)q+1 + xpq − xq+(p−1) = xpq + xp = T rp (x), (9) and N (f (x)) = = =   x(p−1)q+1 + xpq − xq+(p−1) xq+(p−1) + xp − x(p−1)q+1  (p+1)q+(p−1) 3xpq+p + x(p−1)q+(p+1) + x   (2p−2)q+2 2q+(2p−2) − x +x − x(2p−1)q+1 + xq+(2p−1) 3N p (x) + N p−1 (x)T r(x2 ) − N 2 (x)T r(x2p−4 ) − N (x)T r(x2p−2 ). (10) When p = 3 or 5, by Lemma 3, N (f (x)) in (10) can be expressed in terms of T r(x) and N (x) as follows:    −N (x)T r4 (x) + N 2 (x)T r2 (x) + N 3 (x), for p = 3,    N (f (x)) = N 5 (x) + 3N 4 (x)T r2 (x) + N 3 (x)T r4 (x)      + 2N 2 (x)T r6 (x) − N (x)T r8 (x), for p = 5. (11) For any c ∈ Fq2 \ Fq , from f (x) = c, we have T r(f (x)) = T r(c) and N (f (x)) = N (c). 7 (12) In what follows, we will prove that T r(x) and N (x) are uniquely determined by c under the aforementioned conditions. We only give the proof of this conclusion in the case p = 5, and for p = 3 it can be proved in the same way. Thus, in the sequel we always assume that q = 5k . By (9), (11) and (12), we have    T r5 (x) = T r(c), (13)   N 5 (x) + 3N 4 (x)T r2 (x) + N 3 (x)T r4 (x) + 2N 2 (x)T r6 (x) − N (x)T r8 (x) = N (c). Note that gcd(5, q − 1) = 1. Thus, from T r5 (x) = T r(c), one knows that T r(x) is uniquely determined by c. Therefore, it suffices to show that N (x) is also uniquely determined by c. We consider the following two subcases. Subcase 2.1: T r(c) = 0. Then, it follows that T r(x) = 0. From the second equation in (13), we have 5 N (x) = N (c) and thus N (c) is also uniquely determined by c. Subcase 2.2: T r(c) 6= 0. Then, T r(x) 6= 0. For convenience, put r= N (x) N (c) and s = . T r2 (x) T r2 (c) (14) Then, divided by T r10 (x), the second equation in (13) can be rewritten as r5 + 3r4 + r3 + 2r2 − r = s or equivalently (r − 2)4 (r + 1) = s + 1. (15) 2 We claim that s is not equal to −1. Otherwise, we have N (c) + T r2 (c) = 0, which implies (cq − c) = 0 leading to c ∈ Fq , a contradiction to the assumption c ∈ Fq2 \ Fq . Let t = r − 2, (16) t5 + 3t4 = s + 1. (17) then (15) becomes Note that t is not equal to 0 since s is not equal to −1. Therefore, (17) can be further transformed into  5 3 1 1 1 − · = . t s+1 t s+1 If we can show that 1 t 3 s+1 (18) is not a fourth power in Fq , then by (18) and Lemma 5 we can conclude that is uniquely determined by s. Then, from (14) and (16), it follows that N (x) is uniquely determined by c. 8 Thus, it suffices to show that 3 s+1 is not a fourth power in Fq . To this end, we express 3 s+1 in terms of c as follows:   3 3 1 = = 3 1 − . s+1 N (c)/T r2 (c) + 1 c1−q + cq−1 − 2 (19) Since c ∈ Fq2 \ Fq and T r(c) 6= 0, it follows that cq−1 ∈ U \ {±1}. Let u = cq−1 . Suppose, on the contrary, that 3 s+1 is a fourth power in Fq . Then, by (19) we have  3 1− 1 u + u−1 − 2  = ω4 (20) for some ω ∈ Fq . Note that 3 − ω 4 6= 0. Thus, we can rewrite (20) as u2 + which implies 1 + 2ω 4 ·u+1=0 3 − ω4 √ 3ω 4 + 4 ± 3ω 2 u= , 2(3 − ω 2 ) (21) √ where ± 3 denote the two root of x2 = 3 in F52 . Note that when k is even, the two roots of x2 = 3, √ which are ± 3, belong to Fq . From (21), it follows that u ∈ Fq , which contradicts to u ∈ U \ {±1} since Fq ∩ U = {±1}. Therefore, 1 s+1 is not a fourth power in Fq and the desired result follows. The discussions in Subcases 2.1 and 2.2 show that for p = 5, when k is even and c ∈ Fq2 \ Fq , we can derive from f (x) = c that T r(x) and N (x) are uniquely determined by c. For p = 3, this conclusion can be similarly proved. Furthermore, by Lemma 2, when p ∈ {3, 5}, for any c ∈ Fq2 \ Fq , one can conclude from f (x) = c that the set {x, xq } is uniquely determined by c. Note that if one of {x, xq } satisfies f (x) = c, the other q does not. For instance, if f (x) = c, then f (xq ) = (f (x)) = cq 6= c since c ∈ Fq2 \ Fq . Thus, for p = 3 or 5, when k is even, for any c ∈ Fq2 \ Fq , f (x) = c has only one root in Fq2 \ Fq . From Cases 1 and 2, it follows the desired result.  Corollary 1 Let U be defined as (4) with q = pk and p ∈ {3, 5}. Then, the following fractional polynomial x + 1 − xp−1 xp + xp−1 − x (22) permutes U if and only if k is even.  Proof: Note that f (x) in (2) can be written as xp x(p−1)(q−1) + xp(q−1) − xq−1 . Then, by Lemma q−1 1 and Theorem 1, it follows that xp xp−1 + xp − x permutes U if and only if k is even, where 9 q−1 p ∈ {3, 5}. Note that if xp xp−1 + xp − x permutes U , it is not equal to zero when x ∈ U . Thus,  q−1 for each p ∈ {3, 5}, xp xp−1 + xp − x can be written as q xp xp−1 + xp − x , xp−1 + xp − x which is exactly (22) since xq = x−1 when x ∈ U .  Based on Lemma 1 and Corollary 1, we obtain our second main result which gives the permutation property of g(x) defined in (3). Theorem 2 Let q = pk with p ∈ {3, 5}, and l a nonnegative integer satisfying gcd(2l + p, q − 1) = 1. Then, g(x) = x(q+1)l+(p−1)q+1 + x(q+1)l+pq − x(q+1)l+q+(p−1) is a permutation polynomial of Fq2 if and only if k is even. Proof: We can rewrite g(x) as   x(q+1)l+p x(p−1)(q−1) + xp(q−1) − xq−1 . Note that gcd((q + 1)l + p, q − 1) = gcd(2l + p, q − 1) = 1. Then, by Lemma 1, g(x) is a permutation q−1 polynomial of Fq2 if and only if x(q+1)l+p x(p−1) + xp − x permutes U . The latter is equivalent to  q−1 that xp x(p−1) + xp − x permutes U since x(q+1)l = 1 when x ∈ U . The desired result follows now from Corollary 1.  Remark 1 As we have shown in the proofs of Corollary 1 and Theorem 2, f (x) or g(x) is a permutation q−1 polynomial of Fq2 if and only if xp x(p−1) + xp − x permutes U . This shows that the permutation property of f (x) and that of g(x) depend on a same condition. However, it seems difficult to verify directly whether this condition holds. Thus, in this paper we use a different approach to investigate the permutation property of f (x), and then obtain the permutation property of g(x). Remark 2 Let f (x) and g(x) be defined in (2) and (3), respectively. The polynomial g(x) contains f (x) as a special case, and by taking l = 0, g(x) is transformed into exactly f (x). Note that when p = 2, f (x) = xpq , g(x) = x(q+1)l+pq and they are always permutation polynomials of F22k for any positive integer k. For p > 5, Theorems 1 and 2 may not hold. By Magma, we have obtained some numerical results in Table 2. 10 Table 1: Is f (x) or g(x) a permutation over Fp2k ? p 7 7 7 7 7 7 11 11 11 11 13 13 13 4 k 1 2 3 4 5 6 1 2 3 4 1 2 3 Permutation over Fp2k No Yes No No No No No Yes No No No Yes No A comparison with known related permutation trinomials In this section, we will compare the permutation polynomials f (x) proposed in Theorem 1 with previously known ones of the form (1). It is straightforward that the composition of two permutation polynomials of the same finite field is also a permutation polynomial. We recall the definition of multiplicative equivalence from [11, 20, 28]. Definition 1 Let q be a prime power, and H(x) and h(x) be two permutation polynomials of Fq . H(x) and h(x) are called multiplicative equivalent if there exists an integer 1 ≤ d ≤ q − 2 such that gcd(d, q − 1) = 1 and H(x) = ah(xd ) for some a ∈ F∗q . Next we will determine whether or not the permutation trinomials f (x) given in Theorem 1 are multiplicative equivalent to the previously known ones of the form (1) in [21, 18, 29, 22, 9, 10, 4, 13]. We make some preparations as follows. Proposition 1 Let f (x) be defined in (2), and q = pk with k being even and p ∈ {3, 5}. We have the following results: (a) If p = 3, then f (x) is multiplicative equivalent to the following permutation trinomials of Fq2 : k−1 (i) f1 (x) = x + x(2·3 (ii) f2 (x) = x + x −q+2 q +1)(q−1)+1 q k−1 − x(3 +1)(q−1)+1 ; −x ; (iii) f3 (x) = x − x − x2q−1 ; (b) If p = 5, then f (x) is multiplicative equivalent to the following permutation trinomials of Fq2 : 11 k−1 (i) f1 (x) = x + x(4·5 (ii) f2 (x) = x + x +1)(q−1)+1 2q+1 3 (q−1)+1 (iii) f3 (x) = x − xq − x k−1 − x(5 +1)(q−1)+1 ; − xq ; q+5 3 (q−1)+1 . Proof: We only prove the case p = 5. For the case p = 3, the result can be proved in the same k−1 way. When p = 5, note that f1 (x) = f (x5 d1 = (4 · 5 k−1 + 1)(q − 1) + 1 and d2 = (5 ). Thus, f (x) is multiplicative equivalent to f1 (x). Let k−1 + 1)(q − 1) + 1. When k is even, gcd(d1 , q 2 − 1) = gcd(d2 , q 2 − 1) = 1. Then, by extended Euclidean algorithm, we have d1−1 = d−1 = 2 q+5 3 (q 2q+1 3 (q − 1) + 1 and − 1) + 1, where d−1 denotes is the inverse of di modulo q 2 − 1, i = 1, 2. Note that i f2 (x) = f1 (xd1 ) and f3 (x) = −f1 (xd2 ). Therefore, f (x) is multiplicative equivalent to f2 (x) and −1 −1 f3 (x). It is easily seen that f1 (x), f2 (x) and f3 (x) are pairwise multiplicative equivalent to each other.  The following claims are needed. Claim 1: Recall that the inverse d−1 of a (normalized) Niho exponent d over Fp2k , if it exists, is again a (normalized) Niho exponent, and the product of two (normalized) Niho exponents is also a (normalized) Niho exponents [6]. Let F (x) be a permutation polynomial of Fp2k of the form (1), d1 = s(pk −1)+1 and d2 = t(pk −1)+1. If one of d1 and d2 is invertible, say d1 , then λ1 F (xd1 ) is also a permutation polynomial of the form −1 (1) which is multiplicative equivalent to F (x). This analysis together with Claim 1 gives the following claim. Claim 2: Let F (x) be a permutation polynomial of Fp2k of the form (1). Then, all the permutation trinomials of the form (1) that are multiplicative equivalent to F (x) are given by λi F (xdi ) provided −1 gcd(di , p2k − 1) = 1, i = 1, 2. Claims 1 and 2 together with Proposition 1 give the following claim. Claim 3: Let f (x) be a permutation polynomial in Theorem 1. If a permutation trinomial of the form (1) is multiplicative equivalent to f (x), then it must be one of f1 (x), f2 (x) and f3 (x) in Proposition 1. In the sequel, a permutation polynomial F (x) of Fp2k of the form (1) will be denoted by the tuple (λ1 , s, λ2 , t). According to Lemma 1, F (x) is a permutation polynomial of Fp2k if and only if the associated polynomial x 1 + λ1 xs + λ2 xt pk −1 (23) permutes the unit circle U . When F (x) is a permutation polynomial of Fp2k , (23) can be further written 12 Table 2: Known permutation trinomials of F32k of the form (1) (q = 3k ) (λ1 , s, λ2 , t) Fractional polynomial k Ref. (−1, 2, 1, −2) x5 +x3 −x −x4 +x2 +1 4 3 k 6≡ 0 (mod 4) [21, Theorem 3.2] odd k [21, Theorem 3.4] all k [21, Conjecture 5.1 (2)], [18] k 6≡ 2 (mod 4) [21, Conjecture 5.1 (3)], [18] even k [13, Theorem 1.1 (d)] even k [13, Theorem 1.1 (e)] even k [13, Theorem 1.1 (f)] even k [10, Theorem A (iv)] (1, 3, −1, −1) (−1, 4, 1, −2) (−1, −2, 1, 2) −1, −1, q+3 , −1, 3q+5 4 4 √ q, −1, 1 −  √  q √ √  −1, q + 1, −1, − q (−1, 1, −1, 2) x −x + x + 1 x5 + x2 − x x6 + x4 − 1 −x7 + x3 + x −x5 + x3 + x x4 + x2 − 1 3q+5 q+1 x 4 −x 2 −1 q+3 3q+5 x√ 4 − √x − x 2 x q − x2 q−1 − 1 √ √ x√q−1 − x2√q−1 − 1 q+1 2 q+1 x −x −1 √ √ x q − x2 q+1 − 1 x + 1 − x2 x3 + x2 − x as a fractional polynomial x 1 + x−s + x−t 1 + xs + xt since x ∈ U , which is called the fractional polynomial of F (x). For comparison purposes, we collect all known permutation trinomials of F32k and F52k of the form (1). We list them in Tables 2 and 3, respectively. To the best of our knowledge, Tables 2 and 3 contain such permutation trinomials completely. Note that the last one in Table 2 is exactly f3 (x) in Proposition 1 (a)(iii). In [10], Hou determined all permutation trinomials of Fq2 of the form ax + bxq + x2q−1 ∈ Fq2 [x]. When p = 3, according to Theorem A (iv) of [10], −x + xq + x2q−1 is a permutation polynomial of F32k if and only if −1 is a square of F∗3k , which is equivalent to that k is even. The permutation polynomial x − xq − x2q−1 equals  − −x + xq + x2q−1 , and thus its permutation property can be derived from Theorem A (iv) of [10]. According to Tables 2-3, Proposition 1 and Claim 3, we conclude the following result. Proposition 2 Let f (x) be a permutation polynomial proposed in Theorem 1. When p = 3, f (x) is multiplicative equivalent to the permutation polynomial x − xq − x2q−1 (or −x + xq + x2q−1 ) which is contained in Theorem A (iv) of [10]. When p = 5, f (x) is not multiplicative equivalent to any permutation trinomial listed in Table 3. The above proposition shows that f (x) proposed in Theorem 1 is indeed new when p = 5. When p = 3, the permutation polynomial f (x) proposed in Theorem 1 is multiplicative equivalent to a known one contained in [10]. Nevertheless, the method for proving the permutation property in this paper are different from that in [10]. 13 Table 3: Known permutation trinomials of F52k of the form (1) (q = 5k ) (λ1 , s, λ2 , t) 1, q+3 , −1, q+3 4 2  1, q−1 , −1, q+3 2 2  1, −1, −1, −1, q+3 2 q+3 , 1, q+5 2 2 q+3 2  1, 1, −1, q−1 2  −1, 1, 1, q+5 2  1, q+3 , 1, q+5 2 2 q+3 q+5 2 −x−1   x q−1 q−3 2 −x 2 −1 −x x  x  −1, q+3 x q+5 2 x x q−1 2 q−1 2 x q+5 2 q+1 2 −x−1 −x−1 +x−1 −x+1 q−1 +x 2 +x q+5 q+3 x 2 + x 2 + 1 q−1 x2 x 2 − x + 1 q+3 , −1, −1 2  q+5 , −1, 2(q+2) 3 3 q+5 2 q+3 2 −x 2 +1 x + x2 − 1  q+3  x x 2 − x2 + 1 x q+5 2 + x −1 x  2 x2 + 2 −x x2 − 2 (1, 2, −1, −2)  q−1 x 2 − x 2 − 1 q−1 x2 x 2 − x − 1  −1, 2, 1, 1, Fractional polynomial  s 2 q+1 x −2 (s = q+3 −x 2 ) xs +2 4   q+3 q−1 2 2 −x +1 −x x  −x  x2 − 2 x2 + 2 k Ref. all k [29, Theorem 1] odd k [29, Theorem 2] odd k [29, Theorem 3] odd k [29, Theorem 4] even k [29, Theorem 5] even k [29, Theorem 6] even k [29, Theorem 7 (i)] even k [29, Theorem 7 (ii)] even k [29, Theorem 7 (iii)] odd k [29, Proposition 1] [22, Theorem 4.1] 2 even k [29, Proposition 2] [22, Theorem 3.1] 1, −1, −1, q+2 , 1, 3 √ √  2q+4 3 q, −1, 1 − √  q √  q + 1, −1, − q (1, t, 1, −t) x 2q+4 3 +x q+2 3 +1 q+2 2q+1 x√ 3 + x √ 3 +1 x q − x2 q−1 − 1 √ √ x√q−1 − x2√q−1 − 1 q+1 2 q+1 x −x −1 √ √ x q − x2 q+1 − 1 x (1, t, 1, −t) x (±1, 1, 1, 2) 1 x even k [13, Theorem 1.1 (c)] even k [13, Theorem 1.1 (e)] even k [13, Theorem 1.1 (f)] even k [4, Theorem 3.4 (i) ] odd k and exp3 (t) ≥ exp3 (q + 1)∗ even k [4, Theorem 3.4 (iii) ] [9, Theorem A (ii) ] ∗where exp3 (i) denotes the exponent of 3 in the canonical factorization of i. 5 Conclusion In this paper, we construct a class of permutation trinomials of Fq2 with q = 3k and 5k . Precisely, for each p ∈ {3, 5}, we prove that f (x) = x(p−1)q+1 + xpq − xq+(p−1) is a permutation trinomial of Fq2 if and 14 only if k is even. This conclusion is also true for more general polynomials g(x) = x(q+1)l+(p−1)q+1 + x(q+1)l+pq −x(q+1)l+q+(p−1) with l being a nonnegative integer satisfying gcd(2l+p, q−1) = 1. Moreover, when p = 5, we prove that f (x) presented here is not multiplicative equivalent to any known permutation trinomial of the form (1). Numerical experiments show that Theorems 1 and 2 may not hold when p > 5. It would be nice if our construction can be generalized to arbitrary finite field. Namely, the readers are invited to determine the permutation polynomials of Fq2 of the form x(p−1)q+1 + λ1 xpq + λ2 xq+(p−1) , where p is a prime, q = pk for some positive integer k and λ1 , λ2 ∈ Fq . Acknowledgment T. Bai and Y. Xia were supported in part by National Natural Science Foundation of China under Grant 61771021 and Grant 11301552, and in part by Natural Science Foundation of Hubei Province under Grant 2017CFB425. T. Bai was also supported by Graduate Innovation Fund of South-Central University for Nationalities. References [1] D. Bartoli and M. Giulietti, “Permutation polynomials, fractional polynomials, and algebraic curves,” available online: http://arxiv.org/pdf/1708.04841.pdf [2] Y. Chen, N. Li, and X. Zeng, “A class of binary cyclic codes with generalized Niho exponents,” Finite Fields Appl., vol. 43, pp. 123-140, 2016. [3] C. Ding and J. Yuan, “A family of skew Hadamard difference sets,” J. Comb. Theory, Ser. A, vol. 113, pp. 1526-1535, 2006. [4] C. Ding, L. Qu, Q. Wang, J. Yuan and P. Yuan, “Permutation trinomials over finite fields with even characteristic,” SIAM J. Dis. Math., vol. 29, no. 1, pp. 79-92, 2015. [5] H. Dobbertin, “Almost perfect nonlinear power functions on GF (2n ): the Welch case,” IEEE Trans. Inf. Theory, vol. 45, no. 4, pp. 1271-1275, Apr. 1999. [6] H. Dobbertin, P. Felke, T. Helleseth, and P. Rosendahl,“Niho type cross-correlation functions via Dickson polynomials and Kloosterman sums,” IEEE Trans. Inf. Theory, vol. 52, no. 2, pp. 613-627, Feb. 2006. 15 [7] H. Dobbertin, G. Leander, A. Canteaut, C. Carlet, P. Felke, and P. Gaborit,“Construction of bent functions via Niho power functions,” J. Comb. Theory, Ser. A, vol. 113, no. 5, pp. 779-798, 2006. [8] R. Gupta and R. K. Sharma, “Some new classes of permutation trinomials over finite fields with even characteristic,” Finite Fields Appl., vol. 41, pp. 89-96, 2016. [9] X. Hou, “Determination of a type permutation trinomials over finite fields,” Acta Arith., vol. 162, pp. 253-278, 2014. [10] X. Hou, “Determination of a type permutation trinomials over finite fields, II,” Finite Fields Appl., vol. 35, pp. 16-35, 2015. [11] X. Hou, “Permutation polynomials over finite fields-A survey of recent advances,” Finite Fields Appl., vol. 32, pp. 82-119, 2015. [12] X. Hou, “Permutation polynomials of the form xr (a + x2(q−1) )-a nonexistence result,” available online: http://arxiv.org/pdf/1609.03662v1.pdf [13] G. Kyureghyan and M. E. Zieve, “Permutation polynomials of the form X + γT r(X k ),” available online: https://arxiv.org/pdf/1603.01175.pdf [14] Y. Laigle-Chapuy, “Permutation polynomials and applications to coding theory,” Finite Fields Appl., vol. 13, pp. 58-70, 2007. [15] N. Li, T. Helleseth, and X. Tang,“Further results on a class of permutation polynomials over finite fields,” Finite Fields Appl., vol. 22, pp. 16-23, 2013. [16] N. Li and T. Helleseth, “Several classes of permutation trinomials from Niho exponent,” Cryptogr. Commun., vol. 9, no. 6, pp. 693-705, 2017. [17] N. Li and T. Helleseth, “New permutation trinomials from Niho exponents over finite fields with even characteristic,” available online: http://arxiv.org/pdf/1606.03768v1.pdf [18] N. Li, “On two conjectures about permutation trinomials over F32k ,” Finite Fields Appl., vol. 47, pp. 1-10, 2017. [19] R. Lidl and H. Niederreiter, “Finite Fields,” in Encyclopedia of Mathematics and Its Applications, vol. 20. Amsterdam, The Netherlands: Addison-Wesley, 1983. [20] K. Li, L. Qu, and X. Chen, “New classes of permutation binomials and permutation trinomials over finite fields,” Finite Fields Appl., vol. 43, pp. 69-85, 2017. 16 [21] K. Li, L. Qu, C. Li, and S. Fu, “New permutation trinomials constructed from fractional polynomials,” available online: https://arxiv.org/pdf/1605.06216v1.pdf [22] J. Ma and G. Ge, “A note on permutation polynomials over finite fields,” available online: https://arxiv.org/pdf/1703.03158.pdf [23] G. L. Mullen and D. Panario, Handbook of Finite Fields. Boca Raton: Taylor&Francis, 2013. [24] Y. H. Park and J. B. Lee, “Permutation polynomials and group permutation polynomials,” Bull. Austral. Math. Soc., vol. 63, pp. 67-74, 2001. [25] L. Qu, Y. Tan, C. H. Tan, and C. Li, “Constructing differentially 4-uniform permutations over F22k via the switching method,” IEEE Trans. Inf. Theory, vol. 59, no. 7, pp. 4675-4686, July 2013. [26] Z. Tu, X. Zeng, L. Hu, and C. Li, “A class of binomial permutation polynomials,” available online: http://arxiv. org/pdf/1310.0337v1.pdf [27] Z. Tu, X. Zeng, and L. Hu, “Several classes of complete permutation polynomials,” Finite Fields and Appl., vol. 25, pp. 182-193, 2014. [28] D. Wu, P. Yuan, C. Ding, and Y. Ma, “Permutation trinomials over F2m ,” Finite Fields Appl., vol. 46, pp. 38-56, 2017. [29] G. Wu and N. Li, “Several classes of permutation trinomials over F52k from Niho expeonents,” available online: http://arxiv.org/pdf/1702.06446v1.pdf [30] Y. Xia, N. Li, X. Zeng, and T. Helleseth,“An open problem on the distribution of a Niho type cross-correlation function,” IEEE Trans. Inf. Theory, vol. 62, no. 12, pp. 7546-7554, Dec. 2016. [31] X. Zeng, S. Tian, and Z. Tu,“Permutation polynomials from trace functions over finite fields,” Finite Fields and Appl., vol. 35, pp. 36-51, 2015. [32] X. Zeng, L. Hu, W. Jiang, Q. Yue, and X. Cao, “The weight distribution of a class of p-ary cyclic codes,” Finite Fields and Appl., vol. 16, pp. 56-73, 2010. [33] M. E. Zieve, “On some permutation polynomials over Fq of the form xr h(x(q−1)/d ),” Proc. Amer. Math. Soc, vol. 137, no. 7, pp. 2209-2216, 2009. [34] Z. Zha, L. Hu, and S. Fan, “Further results on permutation trinomials over finite fields with even characteristic,” Finite Fields Appl., vol. 45, pp. 43-52, 2017. 17
7cs.IT
DYNAMIC I NTEGRATION OF BACKGROUND K NOWLEDGE IN N EURAL NLU S YSTEMS Dirk Weissenborn German Research Center for AI dirk.weissenborn@dfki.de Tomáš Kočiský & Chris Dyer DeepMind {tkocisky,cdyer}@google.com arXiv:1706.02596v2 [cs.CL] 25 Oct 2017 A BSTRACT Common-sense or background knowledge is required to understand natural language, but in most neural natural language understanding (NLU) systems, the requisite background knowledge is indirectly acquired from static corpora. We develop a new reading architecture for the dynamic integration of explicit background knowledge in NLU models. A new task-agnostic reading module provides refined word representations to a task-specific NLU architecture by processing background knowledge in the form of free-text statements, together with the taskspecific inputs. Strong performance on the tasks of document question answering (DQA) and recognizing textual entailment (RTE) demonstrate the effectiveness and flexibility of our approach. Analysis shows that our models learn to exploit knowledge selectively and in a semantically appropriate way. 1 I NTRODUCTION Understanding natural language depends crucially on common-sense or background knowledge, for example, knowledge about what concepts are expressed by the words being read (lexical knowledge), and what relations hold between these concepts (relational knowledge). As a simple illustration, if an agent needs to understand that the statement “King Farouk signed his abdication” is entailed by “King Farouk was exiled to France in 1952, after signing his resignation”, it must know (among other things) that abdication means resignation of a king. In most neural natural language understanding (NLU) systems, the requisite background knowledge is implicitly encoded in the models’ parameters. That is, what background knowledge is present has been learned from task supervision and also by pre-training word embeddings (where distributional information reliably reflects certain kinds of useful background knowledge, such as semantic relatedness). However, acquisition of background knowledge from static training corpora is limiting for two reasons. First, we cannot expect that all background knowledge that could be important for solving an NLU task can be extracted from a limited amount of training data. Second, as the world changes, the facts that may influence how a text is understood will likewise change. In short: building suitably large corpora to capture all relevant information, and keeping the corpus and derived models up to date with changes to the world would be impractical. In this paper, we develop a new architecture for dynamically incorporating external background knowledge in NLU models. Rather than relying only on static knowledge implicitly present in the training data, supplementary knowledge is retrieved from a knowledge base to assist with understanding text inputs. Since NLU systems must necessarily read and understand text inputs, our approach incorporates background knowledge by repurposing this reading machinery—that is, we read the text being understood together with supplementary natural language statements that assert facts (assertions) which are relevant to understanding the content (§2). Our knowledge-augmented NLU systems operate in a series of phases. First, given the text input that the system must understand, which we call the context, a set of relevant supporting assertions is retrieved. While learning to retrieve relevant information for solving NLU tasks is an important question (Nogueira & Cho, 2017; Narasimhan et al., 2016, inter alia), in this work, we focus on learning how to incorporate retrieved information, and use simple heuristic retrieval methods to identify plausibly relevant background from an external knowledge base. Once the supplementary texts have been retrieved, we use a word embedding refinement strategy that incrementally reads the 1 context and retrieved assertions starting with context-independent word embeddings and building successively refined embeddings of the words that ultimately reflect both the relevant supporting assertions and the input context (§3). These contextually refined word embeddings, which serve as dynamic memory to store newly incorporated knowledge, are used in any task-specific reading architecture. The overall architecture is illustrated in Figure 1. Although we are incorporating a new kind of information into the NLU pipeline, a strength of this approach is that the architecture of the reading module is independent of the final NLU task—the only requirement is that the final architecture use word embeddings. We carry out experiments on several different datasets on the tasks of document question answering (DQA) and recognizing textual entailment (RTE) evaluating the impact of our proposed solution with both basic task architectures and a sophisticated task architecture for RTE (§4). We find that our embedding refinement strategy is quite effective (§5). On four standard benchmarks, we show that refinement helps—even refining the embeddings just using the context (and no additional background information) can improve performance significantly, and adding background knowledge helps further. Our results are very competitive, setting a new state-of-the-art on the recent TriviaQA benchmarks which is remarkable considering the simplicity of the chosen task-specific architecture. Finally, we provide a detailed analysis of how knowledge is being used by an RTE system (§6), including experiments showing that our system is capable of making appropriate counterfactual inferences when provided with “false knowledge”. 2 E XTERNAL K NOWLEDGE AS S UPPLEMENTARY T EXT I NPUTS Knowledge resources make information that could potentially be useful for improving NLU available in a variety different formats, such as (subject, predicate, object)-triples, relational databases, and other structured formats. Rather than tailoring our solution to a particular structured representation, we assume that all supplementary information either already exists in natural language statements or can easily be recoded as natural language. In contrast to mapping from unstructured to structured representations, the inverse problem is not terribly difficult. For example, given a triple (monkey, isA, animal) we can construct the free-text assertion “a monkey is an animal” using a few simple rules. Finally, the free-text format means that knowledge that exists only in unstructured text form is usable by our system. A major question that remains to be answered is: given some text that is to be understood, what supplementary knowledge should be incorporated? The retrieval of contextually relevant information from knowledge sources is a complex research topic by itself, and it is likewise crucially dependent on the format of the underlying knowledge base. There are several statistical (Manning et al., 1999) and more recently neural approaches (Mitra & Craswell, 2017) and approaches based on reinforcement learning (Nogueira & Cho, 2017). In this work we make use of a simple heuristic from which we almost exhaustively retrieve all potentially relevant assertions (see §4), and rely on our reading architecture to learn to extract only relevant information. In the next section, we turn to the question of how to leverage the retrieved supplementary knowledge (encoded as text) in a NLU system. 3 R EFINING W ORD E MBEDDINGS BY R EADING In order to incorporate information from retrieved input texts we propose to compute contextually refined word representations prior to processing the NLU task at hand and pass them to the task in the form of word embeddings. Word embeddings thus serve as a form of memory that not only contains general-purpose knowledge (as in typical neural NLU systems) but also contextual information (including retrieved background knowledge). Our incremental refinement process encodes input texts followed by updates on the word embedding matrix using the encoded input in multiple reading steps. Words are first represented non-contextually (i.e., standard word type embeddings), which can be conceived of as the columns in an embedding matrix E0 . At each progressive reading step ` ≥ 1, a new embedding matrix E` is constructed by refining the embeddings from the previous step E`−1 using (user-specified) contextual information X ` for reading step `, which is a set of natural language sequences (i.e., texts). An illustration of our incremental refinement strategy can be found in Figure 1. 2 group onlookers glance watch people Premise a group of onlookers glance at a person doing a strange trick on her head ... group onlookers glance watch people Hypothesis people watch another person do a trick ... group onlookers glance watch people Assertions onlooker related to watches people is a group ... group onlookers glance watch people ... Task System (RTE) p: a group of onlookers glance at a person doing a strange trick on her head q: people watch another person do a trick Entailment? no update → weighted update → Figure 1: Illustration of our context-dependent, refinement strategy for word representations on an example from the SNLI dataset comprising the premise, hypothesis and additional external information in form of free-text assertions. The reading architecture constructs refinements of word representations incrementally (conceptually represented as columns in a series of embedding matrices) E` are incrementally refined by reading the input text and textual renderings of relevant background knowledge before computing the representations used by the task model (in this figure, RTE). In the following, we define this procedure formally. We denote the hidden dimensionality of our model by n and a fully-connected layer by FC(z) = Wz + b, W ∈ Rn×m , b ∈ Rn , u ∈ Rm . 3.1 U NREFINED W ORD E MBEDDINGS (E0 ) The first representation level consists of non-contextual word representations, that is, word representations that do not depend on any input; these can be conceived of as an embedding matrix E0 whose columns are indexed by words in Σ∗ . The non-contextual word representation e0w for a single 0 word w is computed by using a gated combination of fixed, pre-trained word vectors epw ∈ Rn with n learned character-based embeddings echar w ∈ R . The formal definition of this combination is given in Eq. 1: 0 epw = ReLU(FC(epw ))   0  epw gw = σ FC char ew e0w = gw 0 epw + (1 − gw ) 3 echar w . (1) We compute echar using a single-layer convolutional neural network using n convolutional filters w of width 5 followed by a max-pooling operation over time. Combining pre-trained with character based word embeddings in such a way is common practice. Our approach follows (Seo et al., 2017; Weissenborn et al., 2017). 3.2 C ONTEXTUALLY R EFINED W ORD R EPRESENTATIONS (E` , ` ≥ 1) In order to compute contextually refined word embeddings E` given prior representations E`−1 we assume a given set of texts X ` = {x`1 , x`2 , . . .} that are to be read at refinement iteration `. Each text x`i is a sequence of word tokens. We embed all tokens of every x`i using the embedding matrix from the previous layer, E`−1 . To each word, we concatenate a one-hot vector of length L with position ` set to 1, indicating which layer is currently being processed.1 Stacking the vectors into a matrix, ` we obtain a X`i ∈ Rd×|xi | . This matrix is processed by a bidirectional recurrent neural network, a BiLSTM (Hochreiter & Schmidhuber, 1997) in this work. The resulting output is further projected to X̂`i by a fully-connected layer followed by a ReLU non-linearity (Eq. 2). X̂`i = ReLU(FC(BiLSTM(X`i ))) (2) `−1 of word w, we initially maxpool all representations To finally update the previous embedding ew of occurrences matching the lemma of w in every x ∈ X ` resulting in ê`w (Eq. 3). Finally, we combine the context-independent representation ew with êw to form a context-sensitive representation e`w via a gated addition which lets the model determine how much to revise the embedding with the newly read information (Eq. 5).  ê`w = max x̂`k | x` ∈ X ` , lemma(x`k ) = lemma(w)   `−1  ew ` uw = σ FC ê`w e`w = u`w e`−1 + (1 − u`w ) w ê`w (3) (4) (5) Note that we soften the matching condition for w using lemmatization, lemma(w), during the pooling operation of Eq. 3 because contextual information about certain words is usually independent of the current word form w they appear in. As a consequence, this minor linguistic pre-processing step allows for additional interaction between tokens of the same lemma. The important difference between our contextual refinement step and conventional multi-layer (RNN) architectures is the pooling operation that is performed over occurrences of tokens that share the same lemma. This effectively connects different positions within and between different texts with each other thereby mitigating the problems arising from long-distance dependencies. More importantly, however, it allows models to make use of additional input such as relevant background knowledge. 4 E XPERIMENTAL S ETUP We run experiments on four benchmarks for two popular tasks, namely recognizing textual entailment (RTE) and document question answering (DQA). In the following we describe different aspects of our experimental setup in more detail. Task-specific Models Our primary interest is to explore the value of our refinement strategy with relatively generic task architectures. Therefore, we chose basic single-layer bidirectional LSTMs (BiLSTMs) as encoders with a task-specific, feed-forward neural network on top for the final prediction. Such models are common baselines for NLU tasks and can be considered general reading architectures as opposed to the more highly tuned, task-specific NLU systems that are necessary 1 Adding this one-hot feature lets the refinement model to learn update word embeddings differently in different levels. 4 to achieve state-of-the art results. However, since such models frequently underperform more customized architectures, we also add our refinement module to a reimplementation of a state-of-the-art architecture for RTE called ESIM (Chen et al., 2017b). All models are trained end-to-end jointly with the refinement module. For the DQA baseline system we add a simple lemma-in-question feature (liq) as suggested in Weissenborn et al. (2017) when encoding the context to compare against competitive baseline results. We provide the exact model implementations for our BiLSTM baselines and general training details in Appendix A. Question Answering We apply our DQA models on 2 recent DQA benchmark datasets, SQuAD (Rajpurkar et al., 2016) and TriviaQA (Joshi et al., 2017). The task is to predict an answer span within a provided document p given a question q. Both datasets are large-scale, containing on the order of 100k examples. Because TriviaQA is collected via distant supervision the test set is divided into a large but noisy distant supervision part and a much smaller (on the order of hundreds) human verified part. We report results on both. See Appendix A.1 for implementation details. Recognizing Textual Entailment We test on the frequently used SNLI dataset (Bowman et al., 2015), a collection of 570k sentence pairs, and the more recent MultiNLI dataset (433k sentence pairs) (Williams et al., 2017). Given two sentences, a premise p and a hypothesis q, the task is to determine whether p either entails, contradicts or is neutral to q. See Appendix A.2 for implementation details. Knowledge Source We make use of ConceptNet2 (Speer & Havasi, 2012), a freely-available, multi-lingual semantic network that originated from the Open Mind Common Sense project and incorporates selected knowledge from various other knowledge sources, such as Wiktionary3 , Open Multilingual WordNet4 , OpenCyc and DBpedia5 . It presents information in the form of relational triples.6 Assertion Retrieval We would like to obtain information about the relations of words and phrases between q and p from ConceptNet in order to strengthen the connection between the two sequences. Because assertions a in ConceptNet come in form of (subject, predicate, object)-triples (s, r, o), we retrieve all assertions for which s appears in q and o appears in p, or vice versa. Because still too many such assertions might be retrieved for an instance, we rank all retrievals based on their respective subject and object. To this end we compute a ranking score which is the inverse product of appearances of the subject and the object in the KB, that is score(a) = P P −1 ( a0 I(sa0 = sa ) · a0 I(oa0 = oa )) , where I denotes the indicator function. This is very related to the popular idf score (inverted document frequency) from information retrieval which ranks terms higher that appear less frequently across different documents. During training and evaluation we only retain the top-k assertions which we specify for the individual experiments separately. Note that (although very rarely) it might happen that no assertions are retrieved at all. Refinement Order When employing our embedding-refinement strategy, we first read the document (p) followed by the question (q) in case of DQA, and the premise (p) followed by the hypothesis (q) for RTE, that is, X 1 = {p} and X 2 = {q}. Additional knowledge in the form of a set of assertions A is integrated after reading the task-specific input for both DQA and RTE, that is, X 3 = A. In preliminary experiments we found that the final performance is not significantly sensitive to the order of presentation so we decided to fix our order as defined above. 5 Model SQuAD Dev F1 Exact TriviaQA Wiki Test F1 Exact TriviaQA Web Test F1 Exact BiLSTM + liq + reading + reading + knowledge (20) + reading + knowledge (50) 74.3 77.8 79.2 79.6 63.7 67.3 69.0 69.4 50.9 / 55.1 54.1 / 59.6 54.6 / 60.7 55.1 / 59.9 45.2 / 48.8 47.5 / 52.2 48.4 / 55.1 48.6 / 53.4 50.9 / 60.0 54.7 / 65.9 56.9 / 67.3 56.7 / 68.0 44.2 / 54.7 48.1 / 60.3 50.6 / 61.9 50.6 / 63.2 SotA Results 81.81 82.82 73.21 75.62 46.9 / 55.83 52.9 / 59.51 43.2 / 49.33 46.9 / 54.51 48.3 / 57.63 52.9 / 61.51 44.3 / 53.33 46.7 / 57.01 Table 1: Results on the SQuAD development set as well as TriviaQA-Wikipedia and -Web test sets for n = 300−dimensional models. TriviaQA results are further divided by distant supervision results (left) and human verified results (right). The model using external knowledge is trained with the top-20/50 retrieved ConceptNet assertions. The liq-feature (lemma-in-question) is only used for the baseline. 1 Hu et al. (2017), 2 Wang et al. (2017), 3 Pan et al. (2017). 5 R ESULTS 5.1 Q UESTION A NSWERING : SQ UAD AND T RIVIAQA Table 1 presents our results on two question answering benchmarks. We report results on the SQuAD development set7 and the two more challenging TriviaQA test sets which demonstrate that the introduction of our reading architecture helps consistently with additional gains from using background knowledge. Our systems do even outperform current state-of-the-art models on TriviaQA which is surprising given the simplicity of our task-specific architecture and the complexity of the others. For instance, the system of Hu et al. (2017) uses a complex multi-hop attention mechanism to achieve their results. Even our baseline BiLSTM + liq system reaches very competitive results on TriviaQA which is in line with findings of Weissenborn et al. (2017). To verify that it is not the additional computation that gives the performance boosts when using only our reading architecture (without knowledge), we also ran experiments with 2-layer BiLSTMs (+liq) for our baselines which exhibit similar computational complexity to BiLSTM + reading. We found that the second layer even hurts performance. This demonstrates that pooling over word/lemma occurrences in a given context between layers, which constitutes the main difference to conventional stacked RNNs, is a powerful, yet simple technique. In any case, the most important finding of these experiments is that knowledge actually helps considerably with up to 2.2/2.9% improvements on the F1/Exact measures. 5.2 R ECOGNIZING T EXTUAL E NTAILMENT: SNLI AND M ULTI NLI Table 2 shows the results of our RTE experiments. In general, the introduction of our refinement strategy almost always helps, both with and without external knowledge. When providing additional background knowledge from ConceptNet, our BiLSTM based models improve substantially, while the ESIM-based models improve only on the more difficult MultiNLI dataset. Compared to previously published state-of-the-art systems, our models acquit themselves very well on the MultiNLI benchmark, and competitively on the SNLI benchmark. In parallel to this work, Gong et al. (2017) developed a novel task-specific architecture for RTE that achieves slightly better performance on MultiNLI than our ESIM+reading+knowledge based models.8 It is worth observing that with our knowledge-enhanced embedding architecture, our generic BiLSTM-based task model outperforms ESIM on MultiNLI, which is architecturally much more complex and designed specifically for the RTE task. Finally, we remark that despite careful tuning, our re-implementation of ESIM fails to 2 http://conceptnet.io/ http://wiktionary.org/ 4 http://compling.hss.ntu.edu.sg/omw/ 5 http://dbpedia.org/ 6 We exclude ConceptNet 4 assertions created by only one contributor and from Verbosity to reduce noise. 7 Due to restrictions on code sharing, we are not able to use the public evaluation server to obtain test set scores for SQuAD. However, for the remaining tasks we report both development accuracy and held-out test set performance. 8 Our reading+knowledge refinement architecture can be used of course with this new model. 3 6 Model SNLI Dev Test MNLI Matched Dev Test MNLI Mismatched Dev Test BiLSTM + reading + reading + knowledge 84.4 86.1 86.5 83.4 85.4 85.7 70.0 75.3 76.8 69.8 75.8 77.3 70.2 76.3 77.5 69.4 74.9 76.3 ESIM + reading + reading + knowledge 88.2 88.0 87.8 87.2 87.3 87.3 76.8 77.8 78.8 76.3 77.8 78.2 77.3 78.4 78.8 75.8 77.0 77.0 − − 88.03 88.61 − − 74.52 78.83 − − 73.52 77.83 SotA Results Table 2: Results on the SNLI as well as MultiNLI-Matched and -Mismatched for n = 300−dimensional models. The model using external knowledge is trained with the top-20 retrieved ConceptNet assertions. 1 Chen et al. (2017b), 2 Gong et al. (2017). 3 Chen et al. (2017a). Dim/Data 1/1k 3/3k 10/10k 30/30k 100/100k 300/Full 69.7 71.0(+1.3) 73.8(+2.8) 75.5 75.0(-0.5) 77.4(+2.4) 81.3 80.6(-0.7) 81.3(+0.7) 88.2 88.0(-0.2) 87.8(-0.2) 68.1 70.7(+2.6) 71.3(+0.6) 76.9 78.1(+1.2) 78.8(+0.7) SNLI ESIM + reading + reading + knowledge 52.2 60.9(+8.7) 62.9(+2.0) ESIM + reading + reading + knowledge 44.3 51.8(+7.5) 52.4(+0.6) 59.3 66.0(+6.7) 68.6(+2.6) MultiNLI Matched + Mismatched 50.0 55.8(+5.8) 57.9(+2.1) 55.5 60.1(+4.6) 62.4(+2.3) 61.9 65.0(+3.1) 66.6(+1.6) Table 3: Development set results when reducing training data and embedding dimsensionality with PCA. In parenthesis we report the relative differences to the respective result directly above. match the 88% reported in Chen et al. (2017b); however, with MultiNLI, we find that our implementation of ESIM performs considerably better (by approximately 5%). The instability of the results suggests, as well as the failure of a custom RTE-architecture to consistently perform well suggests that current SotA RTE models may be overfit to the SNLI dataset. 5.3 R EDUCING T RAINING DATA & D IMENSIONALITY OF P RE - TRAINED W ORD E MBEDDINGS We find that there is only little impact when using external knowledge on the RTE task when using a more sophisticated task model such as ESIM. We hypothesize that the attention mechanisms within ESIM jointly with powerful, pre-trained word representations allow for the recovery of some important lexical relations when trained on a large dataset. It follows that by reducing the number of training data and impoverishing pre-trained word representations the impact of using external knowledge should become larger. To test this hypothesis, we gradually impoverish pre-trained word embeddings by reducing their dimensionality with PCA while reducing the number of training instances at the same time.9 Our joint data and dimensionality reduction results are presented in Table 3. They show that there is indeed a slightly larger benefit when employing background knowledge in the more impoverished settings with largest improvements over using only the novel reading architecture when using around 10k examples and reduced dimensionality to 10. However, we observe that the biggest overall impact over the baseline ESIM model stems from our contextual refinement strategy (reading) which is especially pronounced for the 1k and 3k experiments. This highlights once more the usefulness of our refinement strategy even without the use of additional knowledge. 9 Although reducing either embedding dimensionality or data individually exhibit similar (but less pronounced) results we only report the joint reduction results here. 7 p: h: His off-the-cuff style seems amateurish [...] He didn’t look like an amateur the net cost of operations. The gross cost. but uh these guys [...] file their uh their final exams [...] These men filed their midterm exams [...] a: → look like synonym seem contradiction gross antonym net contradiction midterm antonym final contradiction ā: → look like antonym seem entailment gross synonym net entailment midterm synonym final entailment Table 4: Three examples for the antonym ↔ synonym swapping experiment on MultiNLI. p-premise, h-hypothesis, a-assertion, ā-swapped assertion. (a) BiLSTM on MultiNLI. (b) ESIM on MultiNLI. (c) BiLSTM on SQuAD. Figure 2: Performance differences when ignoring certain types of knowledge, i.e., relation predicates during evaluation. Normalized performance differences are measured on the subset of examples for which an assertion of the respective relation predicate occurs. 6 A NALYSIS OF K NOWLEDGE U TILIZATION Is additional knowledge used? To verify whether and how our models make use of additional knowledge, we conducted several experiments. First, we evaluated models trained with knowledge on our tasks while not providing any knowledge at test time. This ablation drops performance by 3.7–3.9% accuracy on MultiNLI, and by 4% F1 on SQuAD. This indicates the model is refining the representations using the provided assertions in a useful way. Are models sensitive to semantics of the provided knowledge? The previous result does not show that the models utilize the provided assertions in any consistent way (it may just reflect a mismatch of training and testing conditions). Therefore, to test our models sensitivity towards the semantics of the assertions, we run an experiment in which we swap the synonym with the antonym predicate in the provided assertions during test time. Because of our heuristic retrieval mechanism, not all such “counterfactuals” will affect the truth of the inference, but we still expect to see a more significant impact. The performance drop on MultiNLI examples for which either a synonym or an antonym-assertion is retrieved is about 10% for both the BiLSTM and the ESIM model. This very large drop clearly shows that our models are sensitive to the semantics of the provided knowledge. Examples of prediction changes are presented in Table 4. They demonstrate that the system has learned to trust the presented assertions to the point that it will make appropriate counterfactual inferences—that is, the change in knowledge has caused the change in prediction. What knowledge is used? After establishing that our models are somehow sensitive to semantics we wanted to find out which type of knowledge is important for which task. For this analysis we exclude assertions including the most prominent predicates in our knowledge base individually when evaluating our models. The results are presented in Figure 2. They demonstrate that the biggest performance drop in total (blue bars) stems from related to assertions. This very prominent predicate appears much more frequently than other assertions and helps connecting related parts of the 2 input sequences with each other. We believe that related to assertions offer benefits mainly from a modeling perspective by strongly connecting the input sequences with each other and thus 8 bridging long-range dependencies similar to attention. Looking at the relative drops obtained by normalizing the performance differences on the actually affected examples (green) we find that our models depend highly on the presence of antonym and synonym assertions for all tasks as well as partially on is a and derived from assertions. This is an interesting finding which shows that the sensitivity of our models is selective wrt. the type of knowledge and task. The fact that the largest relative impact stems from antonyms is very interesting because it is known that such information is hard to capture with distributional semantics contained in pre-trained word embeddings. 7 R ELATED W ORK The role of background knowledge in natural language understanding has long been remarked on, especially in the context of classical models of AI (Schank & Abelson, 1977; Minsky, 2000); however, it has only recently begun to play a role in neural network models of NLU (Ahn et al., 2016; Xu et al., 2016; Long et al., 2017; Dhingra et al., 2017). However, previous efforts have focused on specific tasks or certain kinds of knowledge, whereas we take a step towards a more general-purpose solution for the integration of heterogeneous knowledge for NLU systems by providing a simple, general-purpose reading architecture that can read background knowledge encoded in simple natural language statements, e.g., “abdication is a type of resignation”. Bahdanau et al. (2017) use textual word definitions as a source of information about the embeddings of OOV words. In the area of visual question answering Wu et al. (2016) utilize external knowledge in form of DBpedia comments (short abstracts/definitions) to improve the answering ability of a model. Marino et al. (2017) explicitly incorporate knowledge graphs into an image classification model. Xu et al. (2016) created a recall mechanism into a standard LSTM cell that retrieves pieces of external knowledge encoded by a single representation for a conversation model. Concurrently, Dhingra et al. (2017) exploit linguistic knowledge using MAGE-GRUs, an adapation of GRUs to handle graphs, however, external knowledge has to be present in form of triples. The main difference to our approach is that we incorporate external knowledge in free text form on the word level prior to processing the task at hand which constitutes a more flexible setup. Ahn et al. (2016) exploit knowledge base facts about mentioned entities for neural language models. Bahdanau et al. (2017) and Long et al. (2017) create word embeddings on-the-fly by reading word definitions prior to processing the task at hand. Pilehvar et al. (2017) seamlessly incorporate information about word senses into their representations before solving the downstream NLU task, which is similar. We go one step further by seamlessly integrating all kinds of fine-grained assertions about concepts that might be relevant for the task at hand. Another important aspect of our approach is the notion of dynamically updating wordrepresentations. Tracking and updating concepts, entities or sentences with dynamic memories is a very active research direction (Kumar et al., 2016; Henaff et al., 2017; Ji et al., 2017; Kobayashi et al., 2017). However, those works typically focus on particular tasks whereas our approach is taskagnostic and most importantly allows for the integration of external background knowledge. Other related work includes storing temporary information in weight matrices instead of explicit neural activations (such as word representations) as a biologically more plausible alternative. 8 C ONCLUSION We have presented a novel task-agnostic reading architecture that allows for the dynamic integration of background knowledge into neural NLU models. Our solution, which is based on the incremental refinement of word representations by reading supplementary inputs, is flexible and be used with virtually any existing NLU architecture that rely on word embeddings as input. Our results show that embedding refinement using both the system’s text inputs, as well as supplementary texts encoding background knowledge can yield large improvements. In particular, we have shown that relatively simple task architectures (e.g., based on simple BiLSTM readers) can become competitive with state-of-the-art, task-specific architectures when augmented with our reading architecture. 9 ACKNOWLEDGMENTS This research was conducted during an internship of the first author at DeepMind. It was further partially supported by the German Federal Ministry of Education and Research (BMBF) through the projects ALL SIDES (01IW14002), BBDC (01IS14013E), and Software Campus (01IS12050, sub-project GeNIE). R EFERENCES Sungjin Ahn, Heeyoul Choi, Tanel Pärnamaa, and Yoshua Bengio. A neural knowledge language model. arXiv, 2016. Dzmitry Bahdanau, Tom Bosc, Stanisław Jastrzebski, Edward Grefenstette, Pascal Vincent, and Yoshua Bengio. Learning to compute word embeddings on the fly. arXiv, 2017. Samuel R Bowman, Gabor Angeli, Potts Christopher, and Christopher D Manning. A large annotated corpus for learning natural language inference. In EMNLP. Association for Computational Linguistics, 2015. Qian Chen, Xiaodan Zhu, Zhen-Hua Ling, Si Wei, Hui Jiang, and Diana Inkpen. Recurrent neural network-based sentence encoder with gated attention for natural language inference. arXiv, 2017a. Qian Chen, Xiaodan Zhu, Zhenhua Ling, Si Wei, and Hui Jiang. Enhancing and Combining Sequential and Tree LSTM for Natural Language Inference. ACL, 2017b. Bhuwan Dhingra, Zhilin Yang, William W Cohen, and Ruslan Salakhutdinov. Linguistic Knowledge as Memory for Recurrent Neural Networks. arXiv, 2017. Yichen Gong, Heng Luo, and Jian Zhang. Natural language inference over interaction space. arXiv, 2017. Mikael Henaff, Jason Weston, Arthur Szlam, Antoine Bordes, and Yann LeCun. Tracking the world state with recurrent entity networks. In ICLR, 2017. Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 1997. Minghao Hu, Yuxing Peng, and Xipeng Qiu. Reinforced mnemonic reader for machine comprehension. arXiv, 2017. Yangfeng Ji, Chenhao Tan, Sebastian Martschat, Yejin Choi, and Noah A Smith. Dynamic entity representations in neural language models. In EMNLP, 2017. Mandar Joshi, Eunsol Choi, Daniel S. Weld, and Luke Zettlemoyer. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. In ACL, July 2017. Diederik Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. ICLR, 2015. Sosuke Kobayashi, Naoaki Okazaki, and Kentaro Inui. A neural language model for dynamically representing the meanings of unknown words and entities in a discourse. arXiv preprint arXiv:1709.01679, 2017. Ankit Kumar, Ozan Irsoy, Peter Ondruska, Mohit Iyyer, James Bradbury, Ishaan Gulrajani, Victor Zhong, Romain Paulus, and Richard Socher. Ask me anything: Dynamic memory networks for natural language processing. In ICML, pp. 1378–1387, 2016. Teng Long, Emmanuel Bengio, Ryan Lowe, Jackie Chi Kit Cheung, and Doina Precup. World knowledge for reading comprehension: Rare entity prediction with hierarchical lstms using external descriptions. In EMNLP, 2017. Christopher D Manning, Hinrich Schütze, et al. Foundations of statistical natural language processing, volume 999. MIT Press, 1999. 10 Kenneth Marino, Ruslan Salakhutdinov, and Abhinav Gupta. The more you know: Using knowledge graphs for image classification. CVPR, 2017. Marvin Minsky. Commonsense-based interfaces. Communications of the ACM, 2000. Bhaskar Mitra and Nick Craswell. arXiv:1705.01509, 2017. Neural models for information retrieval. arXiv preprint Karthik Narasimhan, Adam Yala, and Regina Barzilay. Improving information extraction by acquiring external evidence with reinforcement learning. In EMNLP, 2016. Rodrigo Nogueira and Kyunghyun Cho. Task-oriented query reformulation with reinforcement learning. In EMNLP, 2017. Boyuan Pan, Hao Li, Zhou Zhao, Bin Cao, Deng Cai, and Xiaofei He. Memen: Multi-layer embedding with memory networks for machine comprehension. arXiv, 2017. Jeffrey Pennington, Richard Socher, and Christopher D. Manning. Glove: Global vectors for word representation. In EMNLP, 2014. Mohammad Taher Pilehvar, Jose Camacho-Collados, Roberto Navigli, and Nigel Collier. Towards a seamless integration of word senses into downstream nlp applications. In ACL, 2017. Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. In SQuAD: 100,000+ Questions for Machine Comprehension of Text, 2016. Tim Rocktäschel, Edward Grefenstette, Karl Moritz Hermann, Tomás Kociský, and Phil Blunsom. Reasoning about entailment with neural attention. ICLR, 2015. Roger Schank and Robert Abelson. Scripts, Plans, Goals, and Understanding. Psychology Press, 1977. Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hananneh Hajishirzi. Bi-Directional Attention Flow for Machine Comprehension. In ICLR, 2017. Robert Speer and Catherine Havasi. Representing General Relational Knowledge in ConceptNet 5. In LREC, 2012. Wenhui Wang, Nan Yang, Furu Wei, Baobao Chang, and Ming Zhou. Gated self-matching networks for reading comprehension and question answering. In ACL, 2017. Dirk Weissenborn, Georg Wiese, and Laura Seiffe. Making Neural QA as Simple as Possible but not Simpler. In CoNLL, 2017. Adina Williams, Nikita Nangia, and Samuel R Bowman. A broad-coverage challenge corpus for sentence understanding through inference. arXiv, 2017. Qi Wu, Peng Wang, Chunhua Shen, Anton van den Hengel, and Anthony Dick. Ask Me Anything: Free-form Visual Question Answering Based on Knowledge from External Sources. CVPR, 2016. Zhen Xu, Bingquan Liu, Baoxun Wang, Chengjie Sun, and Xiaolong Wang. Incorporating LooseStructured Knowledge into LSTM with Recall Gate for Conversation Modeling. arXiv, 2016. 11 A I MPLEMENTATION D ETAILS In the following we explain the detailed implementation of our two task-specific, baseline models. We assume to have computed the contextually (un-)refined word representations depending on the setup and embedded our input sequences q = (q1 , ..., qLQ ) and p = (p1 , ..., pLP ) to Q ∈ Rn×LQ and P ∈ Rn×LP , respectively. The word representation update gate in Eq. 4 is initialized with a bias of 1 to refine representations only slightly in the beginning of training. In the following as before, we denote the hidden dimensionality of our model by n and a fully-connected layer by FC(z) = Wz + b, W ∈ Rn×m , b ∈ Rn , u ∈ Rm . A.1 Q UESTION A NSWERING Encoding In the DQA task q refers to the question and p to the supporting text. At first we process both sequences by identical BiLSTMs in parallel (Eq. 6) followed by separate linear projections (Eq. 7) . Q̂ = BiLSTM(Q) P̂ = BiLSTM(P) Q̃ = UQ Q̂ Q̂ ∈ R2n×LQ , P̂ ∈ R2n×LP Q̃ ∈ R P̃ = UP P̂ n×LQ , P̃ ∈ R n×LP , (6) (7) UQ , UP ∈ Rn×2n are initialized by [I; I] where I ∈ Rn×n is the identity matrix. Prediction Our prediction– or answer layer is the same as in Weissenborn et al. (2017). We first compute a weighted, n-dimensional representation q̃ of the processed question Q̃ (Eq. 8). α = softmax(vq Q̃) , vq ∈ Rn X q̃ = αi q̃i (8) i The probability distribution ps /pe for the start/end location of the answer is computed by a 2-layer MLP with a ReLU activated, hidden layer sj as follows: " sj = ReLU FCs p̃j q̃ p̃j ps (j) ∝ exp(vs sj ) #!! " ej = ReLU FCe q̃ vs ∈ R p̃j q̃ p̃j n pe (j) ∝ exp(ve sj ) #!! q̃ v e ∈ Rn (9) The model is trained to minimize the cross-entropy loss of the predicted start and end positions, respectively. During evaluation we extract the span (i, k) with the best span-score ps (i) · pe (k) of maximum token length k − i = 16. A.2 R ECOGNIZING T EXTUAL E NTAILMENT Encoding Analogous to DQA we encode our input sequences by BiLSTMs, however, for RTE we use conditional encoding (Rocktäschel et al., 2015) instead. Therefore, we initially process the embedded hypothesis Q by a BiLSTM and use the respective end states of the forward and backward LSTM as initial states for the forward and backward LSTM that processes the embedded premise P. Prediction We hconcatenate i the outputs of the forward and backward LSTMs processing the fw bw premise p, i.e., p̃t ; p̃t ∈ R2n and run each of the resulting LP outputs through a fullyconnected layer with ReLU activation (ht ) followed by a max-pooling operation over time resulting in a hidden state h ∈ Rn . Finally, h is used to predict the RTE label as follows: 12   f w  p̃t ht = ReLU FC p̃bw t h = maxpool ht t p(c) ∝ exp(vc h) , vc ∈ Rn (10) The probability of choosing category c ∈ {entailment, contradiction, neutral} is defined in Eq. 10. Finally, the model is trained to minimize the cross-entropy loss of the predicted category probability distribution p. A.3 T RAINING As pre-processing steps we lowercase all inputs and tokenize it. Additionally, we make use of lemmatization as described §3.2 in which is necessary for matching. As pre-trained word representations we use 300-dimensional word-embeddings from Glove (Pennington et al., 2014). We employed ADAM (Kingma & Ba, 2015) for optimization with an initial learning-rate of 10−3 which was halved whenever the F1 measure (DQA) or the accuracy (RTE) dropped on the development set between 1000/2000 minibatches for DQA and RTE respectively. We used mini-batches of size 16 for DQA and 64 for RTE. Additionally, for regularization we make use of dropout with a rate of 0.2 on the computed non-contextual word representations ew defined in §3.1 with the same dropout mask for all words in a batch. All our models were trained with 3 different random seeds and the top performance is reported. 13
2cs.AI
Polychronous Interpretation of Synoptic, a Domain Specific Modeling Language for Embedded Flight-Software L. Besnard, T. Gautier, J. Ouy, J.-P. Talpin, J.-P. Bodeveix, A. Cortier, M. Pantel, M. Strecker, G. Garcia, A. Rugina, J. Buisson, F. Dagnat L. Besnard, T. Gautier, J. Ouy, J.-P. Talpin INRIA Rennes - Bretagne Atlantique / IRISA, Campus de Beaulieu, F-35042 Rennes Cedex, France {Loic.Besnard, Thierry.Gautier, Julien.Ouy, Jean-Pierre.Talpin}@irisa.fr J.-P. Bodeveix, A. Cortier, M. Pantel, M. Strecker IRIT-ACADIE, Université Paul Sabatier, 118 Route de Narbonne, F-31062 Toulouse Cedex 9, France {bodeveix, cortier, pantel, strecker}@irit.fr G. Garcia Thales Alenia Space, 100 Boulevard Midi, F-06150 Cannes, France gerald.garcia@thalesaleniaspace.com A. Rugina EADS Astrium, 31 rue des Cosmonautes, Z.I. du Palays, F-31402 Toulouse Cedex 4, France Ana-Elena.RUGINA@astrium.eads.net J. Buisson, F. Dagnat Institut Télécom / Télécom Bretagne, Technopôle Brest Iroise, CS83818, F-29238 Brest Cedex 3, France {jeremy.buisson, Fabien.Dagnat}@telecom-bretagne.eu The SPaCIFY project, which aims at bringing advances in MDE to the satellite flight software industry, advocates a top-down approach built on a domain-specific modeling language named Synoptic. In line with previous approaches to real-time modeling such as Statecharts and Simulink, Synoptic features hierarchical decomposition of application and control modules in synchronous block diagrams and state machines. Its semantics is described in the polychronous model of computation, which is that of the synchronous language S IGNAL. 1 Introduction In collaboration with major European manufacturers, the SPaCIFY project aims at bringing advances in MDE to the satellite flight software industry. It focuses on software development and maintenance phases of satellite lifecycle. The project advocates a top-down approach built on a Domain-Specific Modeling Language (DSML) named Synoptic. The aim of Synoptic is to support all aspects of embedded flightsoftware design. As such, Synoptic consists of heterogeneous modeling and programming principles defined in collaboration with the industrial partners and end users of the SPaCIFY project. Used as the central modeling language of the SPaCIFY model driven engineering process, Synoptic allows to describe different layers of abstraction: at the highest level, the software architecture models the M. Bujorianu and M. Fisher (Eds.): Workshop on Formal Methods for Aerospace (FMA) EPTCS 20, 2010, pp. 80–87, doi:10.4204/EPTCS.20.9 c SPaCIFY Project This work is licensed under the Creative Commons Attribution License. SPaCIFY Project 81 functional decomposition of the flight software. This is mapped to a dynamic architecture which defines the thread structure of the software. It consists of a set of threads, where each thread is characterized by properties such as its frequency, its priority and its activation pattern (periodic, sporadic). A mapping establishes a correspondence between the software and the dynamic architecture, by specifying which blocks are executed by which threads. At the lowest level, the hardware architecture permits to define devices (processors, sensors, actuators, busses) and their properties. Finally, mappings describe the correspondence between the dynamic and hardware architecture on the one hand, by specifying which threads are executed by which processor, and describe a correspondence between the software and hardware architecture on the other hand, by specifying which data is carried by which bus for instance. Figure 1 depicts these layers and mappings. Figure 1: Global view: layers and architecture mappings The aim is to synthesize as much of this mapping as possible, for example by appealing to internal or external schedulers. However, to allow for human intervention, it is possible to give a fine-grained mapping, thus overriding or bypassing machine-generated schedules. Anyway, consistency of the resulting dynamic architecture is verified by the SPaCIFY tool suite, based on the properties of the software and dynamic model. At each step of the development process, it is also useful to model different abstraction levels of the system under design inside a same layer (functional, dynamic or hardware architecture). Synoptic offers this capability by providing an incremental design framework and refinement features. To summarize, Synoptic deals with data-flow diagrams, mode automata, blocks, components, dynamic and hardware architecture, mapping and timing. The functional part of the Synoptic language allows to model software architecture. The corresponding sub-language is well adapted to model synchronous islands and to specify interaction points between these islands and the middleware platform using the concept of external variables. Synchronous islands and middleware form a Globally Asynchronous and Locally Synchronous (GALS) system. Software architecture The development of the Synoptic software architecture language has been tightly coordinated with the definition of the GeneAuto language [1]. Synoptic uses essentially two types of modules, called blocks in Synoptic, which can be mutually nested: data-flow diagrams and 82 Polychronous interpretation of Synoptic mode automata. Nesting favors a hierarchical design and enables viewing the description at different levels of detail. By embedding blocks in the states of state machines, one can elegantly model operational modes: each state represents a mode, and transitions correspond to mode changes. In each mode, the system may be composed of other sub-blocks or have different connection patterns among components. Apart from structural and behavioral aspects, the Synoptic software architecture language allows to define temporal properties of blocks. For instance, a block can be parameterized with a frequency and a worst case execution time which are taken into account in the mapping onto the dynamic architecture. Synoptic is equipped with an assertion language that allows to state desired properties of the model under development. We are mainly interested in properties that permit to express, for example, coherence of the modes (“if component X is in mode m1, then component Y is in mode m2” or “. . . can eventually move into mode m2”). Specific transformations extract these properties and pass them to the verification tools. The main purpose of this paper is to describe a formal semantics of Synoptic, expressed in terms of the synchronous language S IGNAL [2, 3]. S IGNAL is based on “synchronized data-flow” (flows with synchronization): a process is a set of equations on elementary flows describing both data and control. The S IGNAL formal model provides the capability to describe systems with several clocks (polychronous systems) as relational specifications. A brief overview of the abstract syntax of Synoptic is provided in Section 2. Then Section 3 describes the interpretation of each one of these constructions in the model of the S IGNAL language. 2 An overview of Synoptic Blocks are the main structuring elements of Synoptic. A block block x A defines a functional unit of compilation and of execution that can be called from many contexts and with different modes in the system under design. A block x encapsulates a functionality A that may consist of sub-blocks, automata and data-flows. A block x is implicity associated with two signals x.trigger and x.reset. The signal x.trigger starts the execution of A. The specification A may then operate at its own pace until the next x.trigger is signaled. The signal x.reset is delivered to x at some x.trigger and forces A to reset its state and variables to initial values. (blocks) A, B ::= block x A | dataflow x A | automaton x A | A | B Data-flows inter-connect blocks with data and events (e.g. trigger and reset signals). A flow can simpliy define a connection from an event x to an event y, written event x → y, combine data y and z by a simple operation f to form the flow x, written data y f z → x or feed a signal y back to x, written data y $init v → x. In a feedback loop, the signal x is initially defined by x0 = v. Then, at each occurrence n > 0 of the signal y, it takes its previous value xn = yn−1 . The execution of a data-flow is controlled by its parent clock. A data-flow simultaneously executes each connection it is composed of every time it is triggered by its parent block. (data f low) A, B ::= data y $init v → x | data y f z → x | event x → y | A | B Actions are sequences of operations on variables that are performed during the execution of automata. An assignment x = y f z defines the new value of the variable x from the current values of y and z by the function f . The skip stores the new values of variables that have been defined before it, so that they SPaCIFY Project 83 become current past it. The conditional if x then A else B executes A if the current value of x is true and executes B otherwise. A sequence A; B executes A and then B. (action) A, B ::= skip | x = y f z | if x then A else B | A; B Automata schedule the execution of operations and blocks by performing timely guarded transitions. An automaton receives control from its trigger and reset signals x.trigger and x.reset as specified by its parent block. When an automaton is first triggered, or when it is reset, its starts execution from its initial state, specified as initial state S. On any state S : do A, it performs the action A. From this state, it may perform an immediate transition to new state T , written S → on x T , if the value of the current variable x is true. It may also perform a delayed transition to T , written S  on x T , that waits the next trigger before to resume execution (in state T ). If no transition condition applies, it then waits the next trigger and resumes execution in state S. States and transitions are composed as A | B. The timed execution of an automaton combines the behavior of an action or a data-flow. The execution of a delayed transition or of a stutter is controlled by an occurrence of the parent trigger signal (as for a data-flow). The execution of an immediate transition is performed without waiting for a trigger or a reset (as for an action). (automaton) A, B ::= 3 state S : do A | S → on x T | S  on x T | A | B Polychronous interpretation of Synoptic The model of computation on which Synoptic relies is that of the polychronous data-flow language S IGNAL. This section describes how Synoptic programs are interpreted into this core language. 3.1 A brief introduction to S IGNAL In S IGNAL, a process P consists of the composition of simultaneous equations x = f (y, z) over signals x, y, z. A delay equation x = y $init v defines x every time y is present. Initially, x is defined by the value v, and then, it is defined by the previous value of y. A sampling equation x = y when z defines x by y when z is true. Finally, a merge equation x = y default z defines x by y when y is present and by z otherwise. An equation x = y f z can use a boolean or arithmetic operator f to define all of the nth values of the signal x by the result of the application of f to the nth values of the signals y and z. The synchronous composition of processes P | Q consists of the simultaneous solution of the equations in P and in Q. It is commutative and associative. The process P/x restricts the signal x to the lexical scope of P. P, Q ::= x = y f z | P/x | P | Q (process) In S IGNAL, the presence of a value along a signal x is an expression noted ˆx. It is true when x is present. Otherwise, it is absent. Specific processes and operators are defined in S IGNAL to manipulate clocks explicitly. We only use the simplest one, xˆ = y, that synchronizes all occurrences of the signals x and y. 3.2 Interpretation of blocks The execution of a block is driven by the trigger t of its parent block. The block resynchronizes with that trigger every time, itself or one of its sub-blocks, makes an explicit reference to time (e.g. a skip for an action or a delayed transition S  T for an automaton). Otherwise, the elapse of time is sensed from outside the block, whose operations (e.g., on ci ), are perceived as belonging to the same period as within 84 Polychronous interpretation of Synoptic [ti ,ti+1 [. The interpretation implements this feature by encoding actions and automata using static single assignment. As a result, and from within a block, every non-time-consuming sequence of actions A; B or transitions A → B defines the value of all its variables once and defines intermediate ones in the flow of its execution. 3.3 Interpretation of data-flow Data-flows are structurally similar to S IGNAL programs and equally combined using synchronous composition. The interpretation [[A]]rt = hhPii of a data-flow (Fig. 2) is parameterized by the reset and trigger signals of the parent block and returns a process P (the input term A and the output term P are marked by [[A]] and hhPii for convenience). A delayed flow data y $init v → x initially defines x by the value v. It is reset to that value every time the reset signal r occurs. Otherwise, it takes the previous value of y in time.  [[ dataflow f A]]rt = hh[[A]]rt | ∏x∈in(A) xˆ =t ii [[ data y $init v → x]]rt = hhx = (v when r) default (y $init v) | (xˆ = y)ii [[ data y f z → x]]rt = hhx = y f zii [[ event y → x]]rt = hhx = when yii [[A | B]]rt = hh[[A]]rt | [[B]]rt ii Figure 2: Interpretation of data-flow connections In Fig. 2, we write ∏i≤n Pi for a finite product of processes P1 | . . . Pn . Similarly, i≤n ei is a finite merge e1 default . . . en . A functional flow data y f z → x defines x by the product of (y, z) by f . An event flow event y → x connects y to define x. Particular cases are the operator ?(y) to convert an event y to a boolean data and the operator ˆ(y) to convert the boolean data y to an event. We write in(A) and out(A) for the input and output signals of a data-flow A. By default, the convention of Synoptic is to synchronize the input signals of a data-flow to the parent trigger. It is however, possible to define alternative policies. One is to down-sample the input signals at the pace of the trigger. Another is to adapt or resample them at that trigger. W 3.4 Interpretation of actions The execution of an action A starts at an occurrence of its parent trigger and shall end before the next occurrence of that event. During the execution of an action, one may also wait and synchronize with this event by issuing a skip . A skip has no behavior but to signal the end of an instant: all the newly computed values of signals are flushed in memory and execution is resumed upon the next parent trigger. Action x! sends the signal x to its environment. Execution may continue within the same symbolic instant unless a second emission is performed: one shall issue a skip before that. An operation x = y f z takes the current value of y and z to define the new value of x by the product with f . A conditional if x then A else B executes A or B depending on the current value of x. As a result, only one new value of a variable x should at most be defined within an instant delimited by a start and an end or a skip. Therefore, the interpretation of an action consists of its decomposition in static single assignment form. To this end, we use an environment E to associate each variable with its definition, an expression, and a guard, that locates it (in time). SPaCIFY Project 85 An action holds an internal state s that stores an integer n denoting the current portion of the actions that is being executed. State 0 represents the start of the program and each n > 0 labels a skip that materializes a synchronized sequence of actions. The interpretation [[A]]s,m,g,E = hhPiin,h,F of an action A (Fig. 3) takes as parameters the state variable s, the state m of the current section, the guard g that leads to it, and the environment E. It returns a process P, the state n and guard h of its continuation, and an updated environment F. We write usegE (x) for the expression that returns the definition of the variable x at the guard g and defgE (x) for storing the final values of all variables x defined in E (i.e., x ∈ V (E)) at the guard g. usegE (x) = i f x ∈ V (E)then hhE(x)i  i else hh(x $init 0) when gii defg (E) = ∏x∈V (E) x = usegE (x) Execution is started with s = 0 upon receipt of a trigger t. It is also resumed from a skip at s = n with a trigger t. Hence the signal t is synchronized to the state s of the action. The signal r is used to inform the parent block (an automaton) that the execution of the action has finished (it is back to its initial state 0). An end resets s to 0, stores all variables x defined in E with an equation x = usegE (x) and finally stops (its returned guard is 0). A skip advances s to the next label n + 1 when it receives control upon the guard e and flushes the variables defined so far. It returns a new guard (s $init 0) = n + 1 to resume the actions past it. An action x! emits x when its guard e is true. A sequence A; B evaluates A to the process P and passes its state nA , guard gA , environment EA to B. It returns P | Q with the state, guard and environment of B. Similarly, a conditional evaluates A with the guard g when x to P and B with g when not x to Q. It returns P | Q but with the guard gA default gB . All variables x ∈ X, defined in both EA and EB , are merged in the environment F. [[ do A]]rt = hh(P | sˆ =t | r = (s = 0)) /sii where hhPiin,h,F = [[A; end ]]s,0,((s pre 0)=0),0/ [[ end ]]s,n,g,E = hhs = 0 when g | defg (E)ii0,0,0/ [[ skip ]]s,n,g,E = hhs = n + 1 when g | defg (E)iin+1,((s pre 0)=n+1),0/ [[x!]]s,n,g,E = hhx = 1 when giin,g,E [[x = y f z]]s,n,g,E = hhx = eiin,g,Ex ]{x7→e} where e = hh f (usegE (y), usegE (z)) when gii [[A; B]]s,n,g,E = hhP | QiinB ,gB ,EB where hhPiinA ,gA ,EA = [[A]]s,n,g,E and hhQiinB ,gB ,EB = [[B]]s,nA ,gA ,EA [[ if x then A else B]]s,n,g,E = hhP | QiinB ,(gA default gB ),(EA ]EB ) g g where hhPiinA ,gA ,EA = [[A]]s,n,(g when useE (x)),E and hhQiinB ,gB ,EB = [[B]]s,nA ,(g when not useE (x)),E Figure 3: Interpretation of timed sequential actions In Fig. 3, we write E ] F to merge the definitions in the environments E and F. For all variables x ∈ V (E) ∪ V (F) in the domains of E and F,  x ∈ V (E) \ V (F)  E(x), F(x), x ∈ V (F) \ V (E) (E ] F)(x) =  E(x) default F(x), x ∈ V (E) ∩ V (F) Note that an action cannot be reset from the parent clock because it is not synchronized to it. A sequence of emissions x!; x! yields only one event along the signal x because they occur at the same (logical) time, as opposed to x!; skip ; x! which sends the second one during the next trigger. 86 3.5 Polychronous interpretation of Synoptic Interpretation of automata An automaton describes a hierarchic structure consisting of actions that are executed upon entry in a state by immediate and delayed transitions. An immediate transition occurs during the period of time allocated to a trigger. Hence, it does not synchronize to it. Conversely, a delayed transition occurs upon synchronization with the next occurrence of the parent trigger event. As a result, an automaton is partitioned in regions. Each region corresponds to the amount of calculation that can be performed within the period of a trigger, starting from a given initial state. Notations We write →A and A for the immediate and delayed transition relations of an automaton A. We write pred→A (S) = {T | (T, x, S) ∈ R} and succ→A (S) = {T | (S, x, T ) ∈ R} (resp. predA (S) and succA (S)) for the predecessor and successor states of the immediate (resp. delayed) transitions →A (resp. A ) from a state S in an automaton A.Finally, we write ~S for the region of a state S. It is defined by an equivalence relation. ∀S, T ∈ S (A), ((S, x, T ) ∈ →A ) ⇔ ~S = ~T For any state S of A, written S ∈ S (A), it is required that the restriction of →A to the region ~S is acyclic. Notice that, still, a delayed transition may take place between two states of the same region. Interpretation An automaton A is interpreted by a process [[ automaton x A]]rt parameterized by its parent trigger and reset signals. The interpretation of A defines a local state s. It is synchronized to the parent trigger t. It is set to 0, the initial state, upon receipt of a reset signal r and, otherwise, takes the previous value of s0 , that denotes the next state. The interpretation of all states is performed concurrently. We give all states Si of an automaton A a unique integer label i = dSi e and designate with dAe its number of states. S0 is the initial state and, for each state of index i, we call Ai its action i and xi j the guard of an immediate or delayed transition from Si to S j . [[ automaton x A]]rt =  hh t ˆ = s | s = (0 when r) default (s0 $init 0) | ∏Si ∈S (A) [[Si ]]s /ss0 ii The interpretation [[Si ]]s of all states 0 ≤ i < dAe of an automaton (Fig. 4) is implemented by a series of mutually recursive equations that define the meaning of each state Si depending on the result obtained for its predecessors S j in the same region. Since a region is by definition acyclic, this system of equations has therefore a unique solution. The interpretation of state Si starts with that of its actions Ai . An action Ai defines a local state si synchronized to the parent state s = i of the automaton. The automaton stutters with s0 = s if the evaluation of the action is not finished: it is in a local state si 6= 0. Interpreting the actions Ai requires the definition of a guard gi and of an environment Ei . The guard gi defines when Ai starts. It requires the local state to be 0 or the state Si to receive control from a predecessor S j in the same region (with the guard x ji ). The environment Ei is constructed by merging these Fj returned by its immediate predecessors S j . Once these parameters are defined, the interpretation of Ai returns a process Pi together with an exit guard hi and an environment Fi holding the value of all variables it defines. Upon evaluation of Ai , delayed transition from Si are checked. This is done by the definition of a process Qi which, first, checks if the guard xi j of a delayed transition from Si evaluates to true with Fi . If so, variables defined in Fi are stored with defhi (Fi ). SPaCIFY Project 87 All delayed transitions from Si to S j are guarded by hi (one must have finished evaluating i before moving to j) and a condition gi j , defined by the value of the guard xi j . The default condition is to stay in the current state s while si 6= 0 (i.e. until mode i is terminated). Hence, the next state from i is defined by the equation s0 = s0i . The next state equation of each state W is composed with the other to form the product ∏i<dAe s0 = s0i that is merged as s0 = i<dAe s0i . ∀i < dAe, [[Si ]]s = (Pi | Qi | si ˆ = when (s = i) | s0 = s0i ) /si where i ,Ei hhPi iin,hi ,Fi = [[Ai ]]si ,0,g   Qi = ∏(Si ,xi j ,S j )∈A defhi when (useFi (xi j )) (Fi ) Ei = U S j ∈pred→A (Si ) Fj gi = 1 when (si $init 0 = 0) default  (use (x )) E ji (S j ,x ji ,Si )∈→A W gi j = hi when (useFi (xi j )), ∀(Si , xi j , S j ) ∈ A  W s0i = (s when si 6= 0) default (Si ,xi j ,S j )∈A ( j when gi j ) Figure 4: Recursive interpretation of a mode automaton 4 Conclusion Synoptic has a formal semantics, defined in terms of the synchronous language S IGNAL. On the one hand, this allows for neat integration of verification environments for ascertaining properties of the system under development. On the other hand, a formal semantics makes it possible to encode the metamodel in a proof assistant. In this sense, Synoptic will profit from the formal correctness proof and subsequent certification of a code generator that is under way in the GeneAuto project. Moreover, the formal model of S IGNAL is the basis for the Eclipse-based polychronous modeling environment SME [3, 4]. SME is used to transform Synoptic diagrams and generate executable C code. References [1] A. Toom, T. Naks, M. Pantel, M. Gandriau and I. Wati: GeneAuto: An Automatic Code Generator for a safe subset of SimuLink/StateFlow. European Congress on Embedded Real Time Software (ERTS’08), Société des Ingénieurs de l’Automobile, (2008). [2] P. Le Guernic, J.-P. Talpin and J.-C. Le Lann: Polychrony for system design. Journal for Circuits, Systems and Computers, Special Issue on Application Specific Hardware Design, World Scientific, (2003). [3] Polychrony and SME. Available at http://www.irisa.fr/espresso/Polychrony. [4] C. Brunette, J.-P. Talpin, A. Gamatié and T. Gautier: A metamodel for the design of polychronous systems. The Journal of Logic and Algebraic Programming, 78, Elsevier, (2009).
6cs.PL
DISTORTION FOR ABELIAN SUBGROUPS OF Out(Fn ) arXiv:1612.01134v2 [math.GR] 10 Jan 2017 DERRICK WIGGLESWORTH Abstract. We prove that abelian subgroups of the outer automorphism group of a free group are quasiisometrically embedded. Our proof uses recent developments in the theory of train track maps by FeighnHandel. As an application, we prove the rank conjecture for Out(Fn ). 1. Introduction Given a finitely generated group G, a finitely generated subgroup H is undistorted if the inclusion H ,→ G is a quasi-isometric embedding with respect to the word metrics on G and H for some (any) finite generating sets. A standard technique for showing that a subgroup is undistorted involves finding a space on which G acts nicely and constructing a height function on this space satisfying certain properties: elements which are large in the word metric on H should change the height function by a lot, elements of a fixed generating set for G should change the function by a uniformly bounded amount. In this paper, we use a couple of variations of this method. Let Rn be the wedge of n circles and let Fn be its fundamental group, the free group of rank n ≥ 2. The outer automorphism group of the free group, Out(Fn ), is defined as the quotient of Aut(Fn ) by the inner automorphisms, those which arise from conjugation by a fixed element. Much of the study of Out(Fn ) draws parallels with the study of mapping class groups. Furthermore, many theorems concerning Out(Fn ) and their proofs are inspired by analogous theorems and proofs in the context of mapping class groups. Both groups satisfy the Tits alternative [McC85, BFH00], both have finite virtual cohomological dimension [Har86, CV86], and both have Serre’s property FA to name a few. Importantly, this approach to the study of Out(Fn ) has yielded a classification of its elements in analogy with the Nielsen-Thurston classification of elements of the mapping class group [BH92], along with constructive ways for finding good representatives of these elements [FH14]. In [FLM01], the authors proved that infinite cyclic subgroups of the mapping class group are undistorted. Their proof also implies that higher rank abelian subgroups are undistorted. In [Ali02], Alibegović proved that infinite cyclic subgroups of Out(Fn ) are undistorted. In contrast with the mapping class group setting, her proof does not directly apply to higher rank subgroups: the question of whether all abelian subgroups of Out(Fn ) are undistorted has been left open. In this paper, we answer this in the affirmative. Theorem 7.1. Abelian subgroups of Out(Fn ) are undistorted. This theorem has implications for various open problems in the study of Out(Fn ). In [BM08], Behrstock and Minsky prove that the geometric rank of the mapping class group is equal to the maximal rank of an abelian subgroup of the mapping class group. As an application of Theorem 7.1, we prove the analogous result in the Out(Fn ) setting. Corollary 7.3. The geometric rank of Out(Fn ) is 2n − 3, which is the maximal rank of an abelian subgroup of Out(Fn ). We remark that in principle, this could have been done earlier by using the techniques in [Ali02] to show that a specific maximal rank abelian subgroup is undistorted. 2010 Mathematics Subject Classification. Primary 20F65. January 12, 2017. The author is partially supported by the NSF grant of Mladen Bestvina (DMS-1607236) and also acknowledges support from U.S. National Science Foundation grants DMS-1246989 and DMS-0932078. 1 2 DERRICK WIGGLESWORTH In the course of proving Theorem 7.1, we show that, up to finite index, only finitely many marked graphs are needed to get good representatives of every element of an abelian subgroup of Out(Fn ). In the setting of mapping class groups, the analogous statement is that for a surface S and an abelian subgroup H of MCG(S) there is a Thurston decomposition of S into disjoint subsurfaces which is respected by every element of H. This can also be viewed as a version of the Kolchin Theorem of [BFH05] for abelian subgroups. We prove: Proposition 5.2. For any abelian subgroup H of Out(Fn ), there exists a finite index subgroup H 0 such that every φ ∈ H 0 can be realized as a CT on one of finitely many marked graphs. The paper is outlined as follows: In section 3 we prove that the translation distance of an arbitrary element φ of Out(Fn ) acting on Outer Space is the maximum of the logarithm of the expansion factors associated to the exponentially growing strata in a relative train track map for φ. This result was obtained previously and independently by Richard Wade in his thesis [Wad12]. This is the analog for Out(Fn ) of Bers’ result [Ber78] that the translation distance of a mapping class f acting on Teichmüller space endowed with the Teichmüller metric is the maximum of the logarithms of the dilatation constants for the pseudo-Anosov components in the Thurston decomposition of f . In section 4 we then use our result on translation distance to prove the main theorem in the special case where the abelian subgroup H has “enough” exponential data. More precisely, we will prove the result under the assumption that the collection of expansion factor homomorphisms determines an injective map H → ZN . In section 5 we prove Proposition 5.2 and then use this in section 6 to prove the main result in the case that H has “enough” polynomial data. This is the most technical part of the paper because we need to obtain significantly more control over the types of sub-paths that can occur in nice circuits in a marked graph than was previously available. The bulk of the work goes towards proving Proposition 6.1. This result provides a connection between the comparison homomorphisms introduced in [FH09] (which are only defined on subgroups of Out(Fn )) and Alibegović’s twisting function. We then use this connection to complete the proof of our main result in the polynomial case. Finally, in section 7 we consolidate results from previous sections to prove Theorem 7.1. The methods used in sections 4 and 6 can be carried out with minimal modification in the general setting. I would like to thank my advisor Mladen Bestvina for many hours of his time and for his patience. I would also like to thank Mark Feighn for his encouragement and support. Finally, I would also like to express my gratitude to Radhika Gupta for patiently listening to me go on about completely split paths for weeks on end and to MSRI for its hospitality and partial support. 2. Preliminaries Identify Fn with π1 (Rn , ∗) once and for all. A marked graph G is a finite graph of rank n with no valence one vertices equipped with a homotopy equivalence ρ : Rn → G called a marking. The marking identifies Fn with π1 (G). As such, a homotopy equivalence f : G → G determines an (outer) automorphism φ of Fn . We say that f : G → G represents φ. All homotopy equivalences will be assumed to map vertices to vertices and the restriction to any edge will be assumed to be an immersion. Let Γ be the universal cover of the marked graph G. A path in G (resp. Γ) is either an isometric immersion of a (possibly infinite) closed interval σ : I → G (resp. Γ) or a constant map σ : I → G (resp. Γ). If σ is a constant map, the path will be called trivial. If I is finite, then any map σ : I → G (resp. Γ) is homotopic rel endpoints to a unique path [σ]. We say that [σ] is obtained by tightening σ. If f : G → G is a homotopy equivalence and σ is a path in G, we define f# (σ) as [f (σ)]. If f˜: Γ → Γ is a lift of f , we define f˜# similarly. If the domain of σ is finite, then the image has a natural decomposition into edges E1 E2 · · · Ek called the edge path associated to σ. A circuit is an immersion σ : S 1 → G. For any path or circuit, let σ be σ with its orientation reversed. A decomposition of a path or circuit into subpaths is a splitting for f : G → G and is denoted σ = . . . σ1 · σ2 . . . k k k if f# (σ) = . . . f# (σ1 )f# (σ2 ) . . . for all k ≥ 1. Let G be a graph. An unordered pair of oriented edges {E1 , E2 } is a turn if E1 and E2 have the same initial endpoint. As with paths, we denote by E, the edge E with the opposite orientation. If σ is a path DISTORTION FOR ABELIAN SUBGROUPS OF Out(Fn ) 3 which contains . . . E 1 E2 . . . or . . . E 1 E2 . . . in its edge path, then we say σ takes the turn {E1 , E2 }. A train track structure on G is an equivalence relation on the set of edges of G such that E1 ∼ E2 implies E1 and E2 have the same initial vertex. A turn {E1 , E2 } is legal with respect to a train track structure if E1  E2 . A path is legal if every turn crossed by the associated edge path is legal. The equivalence classes of this relation are called gates. A homotopy equivalence f : G → G induces a train track structure on G as follows. f determines a map Df on oriented edges in G by definining Df (E) to be the first edge in the edge path f (E). We then declare E1 ∼ E2 if D(f k )(E1 ) = D(f k )(E2 ) for some k ≥ 1. A filtration for a representative f : G → G of an outer automorphism φ is an increasing sequence of f -invariant subgraphs ∅ = G0 ⊂ G1 ⊂ · · · ⊂ Gm = G. We let Hi = Gi \ Gi−1 and call Hi the i-th stratum. A turn with one edge in Hi and the other in Gi−1 is called mixed while a turn with both edges in Hi is called a turn in Hi . If σ ⊂ Gi does not contain any illegal turns in Hi , then we say σ is i-legal. We denote by Mi the submatrix of the transition matrix for f obtained by deleting all rows and columns except those labeled by edges in Hi . For the representatives that will be of interest to us, the transition matrices Mi will come in three flavors: Mi may be a zero matrix, it may be the 1 × 1 identity matrix, or it may be an irreducible matrix with Perron-Frobenius eigenvalue λi > 1. We will call Hi a zero (Z), non-exponentially growing (NEG), or exponentially growing (EG) stratum according to these possibilities. Any stratum which is not a zero stratum is called an irreducible stratum. Definition 2.1 ([BH92]). We say that f : G → G is a relative train track map representing φ ∈ Out(Fn ) if for every exponentially growing stratum Hr , the following hold: (RTT-i): Df maps the set of oriented edges in Hr to itself; in particular all mixed turns are legal. (RTT-ii): If σ ⊂ Gr−1 is a nontrivial path with endpoints in Hr ∩ Gr−1 , then so is f# (σ). (RTT-iii): If σ ⊂ Gr is r-legal, then f# (σ) is r-legal. Suppose that u < r, that Hu is irreducible, Hr is EG and each component of Gr is non-contractible, and that for each u < i < r, Hi is a zero stratum which is a component of Gr−1 and eachSvertex of Hi has r valence at least two in Gr . Then we say that Hi is enveloped by Hr and we define Hrz = k=u+1 Hk . k A path or circuit σ in a representative f : G → G is called a periodic Nielsen path if f# (σ) = σ for some k ≥ 1. If k = 1, then σ is a Nielsen path. A Nielsen path is indivisible if it cannot be written as a concatenation of non-trivial Nielsen paths. If w is a closed root-free Nielsen path and Ei is an edge such that f (Ei ) = Ei wdi , then we say E is a linear edge and we call w the axis of E. If Ei , Ej are distinct linear edges with the same axis such that di 6= dj and di , dj > 0, then we call a path of the form Ei w∗ E j an exceptional path. In the same scenario, if di and dj have different signs, we call such a path a quasi-exceptional path. We say that x and y are Nielsen equivalent if there is a Nielsen path σ in G whose endpoints are x and y. We say that a periodic point x ∈ G is principal if neither of the following conditions hold: • x is not an endpoint of a non-trivial periodic Nielsen path and there are exactly two periodic directions at x, both of which are contained in the same EG stratum. • x is contained in a component C of periodic points that is topologically a circle and each point in C has exactly two periodic directions. A relative train track map f is called rotationless if each principal periodic vertex is fixed and if each periodic direction based at a principal vertex is fixed. We remark that there is a closely related notion of an outer automorphism φ being rotationless. We will not need this definition, but will need the following relevant facts from [FH09]: Theorem 2.2 ([FH09, Corollary 3.5]). There exists k > 0 depending only on n, so that φk is rotationless for every φ ∈ Out(Fn ). Theorem 2.3 ([FH09, Corollary 3.14]). For each abelian subgroup A of Out(Fn ), the set of rotationless elements in A is a subgroup of finite index in A. For an EG stratum, Hr , we call a non-trivial path σ ⊂ Gr−1 with endpoints in Hr ∩ Gr−1 a connecting k path for Hr . Let E be an edge in an irreducible stratum, Hr and let σ be a maximal subpath of f# (E) in a zero stratum for some k ≥ 1. Then we say that σ is taken. A non-trivial path or circuit σ is called 4 DERRICK WIGGLESWORTH completely split if it has a splitting σ = τ1 · τ2 · · · τk where each of the τi ’s is a single edge in an irreducible stratum, an indivisible Nielsen path, an exceptional path, or a connecting path in a zero stratum which is both maximal and taken. We say that a relative train track map is completely split if f (E) is completely split for every edge E in an irreducible stratum and if for every taken connecting path σ in a zero stratum, f# (σ) is completely split. Definition 2.4 ([FH11]). A relative train track map f : G → G and filtration F given by ∅ = G0 ⊂ G1 ⊂ · · · ⊂ Gm = G is said to be a CT if it satisfies the following properties. (Rotationless): f : G → G is rotationless. (Completely Split): f : G → G is completely split. (Filtration): F is reduced. The core of each filtration element is a filtration element. (Vertices): The endpoints of all indivisible periodic (necessarily fixed) Nielsen paths are (necessarily principal) vertices. The terminal endpoint of each non-fixed NEG edge is principal (and hence fixed). (Periodic Edges): Each periodic edge is fixed and each endpoint of a fixed edge is principal. If the unique edge Er in a fixed stratum Hr is not a loop then Gr−1 is a core graph and both ends of Er are contained in Gr−1 . (Zero Strata): If Hi is a zero stratum, then Hi is enveloped by an EG stratum Hr , each edge in Hi is r-taken and each vertex in Hi is contained in Hr and has link contained in Hi ∪ Hr . (Linear Edges): For each linear Ei there is a closed root-free Nielsen path wi such that f (Ei ) = Ei widi for some di 6= 0. If Ei and Ej are distinct linear edges with the same axes then wi = wj and di 6= dj . (NEG Nielsen Paths): If the highest edges in an indivisible Nielsen path σ belong to an NEG stratum then there is a linear edge Ei with wi as in (Linear Edges) and there exists k 6= 0 such that σ = Ei wik Ēi . (EG Nielsen Paths): If Hr is EG and ρ is an indivisible Nielsen path of height r, then f |Gr = θ ◦ fr−1 ◦ fr where : (1) fr : Gr → G1 is a composition of proper extended folds defined by iteratively folding ρ. (2) fr−1 : G1 → G2 is a composition of folds involving edges in Gr−1 . (3) θ : G2 → Gr is a homeomorphism. We remark that several of the properties in Definition 2.4 use terms that have not been defined. We will not use these properties in the sequel. The main result for CTs is the following existence theorem: Theorem 2.5 ([FH11, Theorem 4.28]). Every rotationless φ ∈ Out(Fn ) is represented by a CT f : G → G. For completely split paths and circuits, all cancellation under iteration of f# is confined to the individual terms of the splitting. Moreover, f# (σ) has a complete splitting which refines that of σ. Finally, just as with improved relative train track maps introduced in [BFH00], every circuit or path with endpoints at vertices eventually is completely split. Culler and Vogtmann’s outer space, CVn , is defined as the space of homothety classes of free minimal actions of Fn on simplicial metric trees. Outer Space has a (non-symmetric) metric defined in analogy with the Teichmüller metric on Teichmüller space. The distance from T to T 0 is defined as the logarithm of the infimal Lipschitz constant among all Fn -equivariant maps f : T → T 0 . Let Γ be the universal cover of the marked graph G. Each non-trivial c ∈ Fn acts by a covering translation Tc : Γ → Γ which is a hyperbolic isometry, and therefore has an axis which we denote by Ac . The projection of Ac to G is the circuit corresponding to the conjugacy class c. If E is a linear edge in a CT so that f (E) = Ewd as in (Linear Edges), then we say w is the axis of E. The space of lines in Γ is denoted B̃(Γ) and is the set ((∂Γ × ∂Γ) \ ∆)/Z2 (where ∆ denotes the diagonal and Z2 acts by interchanging the factors) equipped with the compact-open topology. The space of abstract lines is denoted by ∂ 2 Fn and defined by ((∂Fn × ∂Fn ) \ ∆)/Z2 . The action of Fn on ∂Fn (resp. ∂Γ) induces an action on ∂ 2 Fn (resp. B̃(Γ)). The marking of G defines an Fn -equivariant homeomorphism between ∂ 2 Fn and B̃(Γ). The quotient of B̃(Γ) by the Fn action is the space of lines in G and is denoted B(G). The space of abstract lines in Rn is denoted by B. DISTORTION FOR ABELIAN SUBGROUPS OF Out(Fn ) 5 A lamination, Λ, is a closed set of lines in G, or equivalently, a closed Fn -invariant subset of B̃(Γ). The elements of a lamination are its leaves. Associated to each φ ∈ Out(Fn ) is a finite φ-invariant set of attracting laminations, denoted by L(φ). In the coordinates given by a relative train track map f : G → G representing φ, the attracting laminations for φ are in bijection with the EG strata of G. For each attracting lamination Λ+ ∈ L(φ), there is an associated expansion factor homomorphism, P FΛ+ : StabOut(Fn ) (Λ+ ) → Z which has been studied in [BFH00]. We briefly describe the essential features of P FΛ+ here, but we direct the reader to [BFH00] for more details on lines, laminations, and expansion factor homomorphisms. For each ψ ∈ Stab(Λ+ ), at most one of L(ψ) and L(ψ −1 ) can contain Λ+ . If neither L(ψ) nor L(ψ −1 ) contains Λ+ , then P FΛ+ (ψ) = 0. Let f : G → G be a relative train track map representing ψ. If Λ+ ∈ L(ψ) and Hr is the EG stratum of G associated to Λ+ with corresponding PF eigenvalue λr , then P FΛ+ (ψ) = log λr . Conversely, if Λ+ ∈ L(ψ −1 ), then P FΛ+ (ψ) = − log λr , where λr is the PF eigenvalue for the EG stratum of a RTT representative of ψ −1 which is associated to Λ+ . The image of P FΛ+ is a discrete subset of R which we will frequently identify with Z. For φ ∈ Out(Fn ), each element Λ+ ∈ L(φ) has a paired lamination in L(φ−1 ) which is denoted by Λ− . The paired lamination is characterized by the fact that it has the same free factor support as Λ+ . That is, the minimal free factor carrying Λ+ is the same as that which carries Λ− . We denote the pair {Λ+ , Λ− } by Λ± . 3. Translation Lengths in CVn In this section, we will compute the translation distance for an arbitrary element of Out(Fn ) acting on Outer Space. As is standard, for φ ∈ Out(Fn ) we define the translation distance of φ on Outer Space n ) . It is straightforward to check that this is independent of x ∈ CVn . For the as τ (φ) = limn→∞ d(x,x·φ n remainder of this section φ ∈ Out(Fn ) will be fixed, and f : G → G will be a relative train track map representing φ with filtration ∅ = G0 ⊂ G1 ⊂ · · · ⊂ Gm = G. Lemma 3.1. If Hr is an exponentially growing stratum of G, then there exists a metric ` on G such that `(f# (E)) ≥ λr `(E) for every edge E ∈ Hr , where λr is the Perron-Frobenius eigenvalue associated to Hr . Proof. Let Mr be the transition matrix for the exponentially growing stratum,P Hr and let v be a left eigenvector for the PF eigenvalue λr with components (v)i . Normalize v so that (v)i = 1. For Ei ∈ Hr define `(Ei ) = (v)i . If E ∈ / Hr define `(E) = 1. We now check the condition on the growth of edges in the EG stratum Hr . If E is an edge in Hr , (RTT-iii) implies that f (E) is r-legal. Now write f# (E) = f (E) as an edge path, f# (E) = E1 E2 . . . Ej , and we have `(f (E)) = `(f# (E)) = j X `(Ei ) ≥ i=1 j X `(Ei ∩ Hr ) = λr `(E) i=1 completing the proof of the lemma.  We define the r-length `r of a path or circuit in G by ignoring the edges in other strata. Explicitly, `r (σ) = `(σ ∩ Hr ), where σ ∩ Hr is considered as a disjoint union of sub-paths of σ. Note that the definition of ` and the proof of the previous lemma show that `r (f# (Ei )) = λr `(Ei ). Lemma 3.2. If σ is an r-legal reduced edge path in G and ` is the metric defined in Lemma 3.1, then `r (f# σ) = λr `r (σ). Proof. We write σ = a1 b1 a2 · · · bj as a decomposition into maximal subpaths where aj ⊂ Hr and bj ⊂ Gr−1 as in Lemma 5.8 of [BH92]. Applying the lemma, we conclude that f# (σ) = f (a1 ) · f# (b1 ) · f (a2 ) · . . . · f# (bj ). Thus, X X X X `r (f# σ) = `r (f (ai )) + `r (f# (bi )) = `r (f (ai )) = λr `r (ai ) = λr `r (σ)  i i i i Theorem 3.3 ([Wad12]). Let φ ∈ Out(Fn ) with f : G → G a RTT representative. For each EG stratum Hr of f , let λr be the associated PF eigenvalue. Then τ (φ) = max{0, log λr | Hr is an EG stratum}. 6 DERRICK WIGGLESWORTH Proof. We first show that τ (φ) ≥ log λr for every EG stratum Hr . Let x = (G, `, id) where ` is the length function provided by Lemma 3.1. Recall [FM11] that the logarithm of the factor by which a candidate loop is stretched gives a lower bound on the distance between two points in CVn . Let σ be an r-legal circuit n contained in Gr of height r and let C = `r (σ)/`(σ). (RTT-iii) implies that f# (σ) is r-legal for all n, so repeatedly applying Lemma 3.2, we have n−1 n n n σ) `(f# σ) `r (f# σ) `r (f# σ) `r (f# `r (f# σ) `r (σ) ≥ = ≥ λnr C ··· n−1 n−2 `(σ) `(σ) `r (σ) `(σ) `r (f# σ) `r (f# σ) Rearranging the inequality, taking logarithms and using the result of [FM11] yields log(λnr C) log C d(x, x · φn ) ≥ = log λr + n n n Taking the limit as n → ∞, we have a lower bound on the translation distance of φ. For the reverse inequality, fix  > 0. We must find a point in outer space which is moved by no more than  + max{0, log λr }. The idea is to choose a point in the simplex of CVn corresponding to a relative train track map for φ in which each stratum is much larger than the previous one. This way, the metric will see the growth in every EG stratum. Let f : G → G be a relative train track map as before, but assume that each NEG stratum consists of a single edge. This is justified, for example by choosing f to be a CT [FH11]. Let K be the maximum edge length of the image of any edge of G. Define a length function on G as follows:  r  if E is the unique edge in the NEG stratum Hr (K/) `(E) = (K/)r if E is an edge in the zero stratum Hr   r (K/) · vi if Ei ∈ Hr and Hr is an EG stratum with ~v as above The logarithm of the maximum amount that any edge is stretched in a difference of markings map gives an upper bound on the Lipschitz distance between any two points. So we just check the factor by which every edge is stretched. Clearly the stretch factor for edges in fixed strata is 1. If E is the single edge in an NEG stratum, Hi , then `(f (E)) `(E) + K max{`(E 0 ) | E 0 ∈ Gi−1 } (K/)i + K(K/)i−1 ≤ = =1+ `(E) `(E) (K/)i Similarly, if E is an edge in the zero stratum, Hi , then K(K/)i−1 `(f (E)) ≤ = `(E) (K/)i We will use the notation `↓r (σ) to denote the length of the intersection of σ with Gr−1 . So for any path σ contained in Gr , we have `(σ) = `r (σ) + `↓r (σ). Now, if Ei is an edge in the EG stratum, Hr , with normalized PF eigenvector v then `(f (Ei )) `r (f (Ei )) + `↓r (f (Ei )) `↓ (f (Ei )) K(K/)r−1  = = λr + r ≤ λr + = λr + `(Ei ) `(Ei ) `(Ei ) (K/)r (v)i (v)i (E)) Since the vector v is determined by f , after replacing  we have that `(f`(E) ≤ max{λr , 1} +  for every edge of G. Thus, the distance (G, `, ρ) is moved by φ is less than max{log(λr ), 0}+ and the proof is complete.  Now that we have computed the translation distance of an arbitrary φ acting on outer space, we’ll use this result to establish our main result in a special case. 4. The Exponential Case In this section, we’ll analyze the case that the abelian subgroup H = hφ1 , . . . , φk i has enough exponential data so that the entire group is seen by the so called lambda map. More precisely, given an attracting lamination Λ+ for an outer automorphism φ, let P FΛ+ : Stab(Λ+ ) → Z be the expansion factor homomorphism defined by Corollary 3.3.1 of [BFH00]. In [FH09, Corollary 3.14], the authors prove that every abelian subgroup of Out(Fn ) has a finite index subgroup which is rotationless (meaning that every element of the DISTORTION FOR ABELIAN SUBGROUPS OF Out(Fn ) 7 subgroup is rotationless). Distortion is unaffectedSby passing to a finite index subgroup, so there is no loss in assuming that H is rotationless. Now let L(H) = φ∈H L(φ) be the set of attracting laminations for elements of H. By [FH09, Lemma 4.4], L(H) is a finite set of H-invariant laminations. Define P FH : H → Z#L(H) by taking the collection of expansion factor homomorphisms for attracting laminations of the subgroup H. In what follows, we will need to interchange P FΛ+ for P FΛ− and for that we will need the following lemma. PF + Lemma 4.1. If Λ+ ∈ L(φ) and Λ− ∈ L(φ−1 ) are paired laminations then P FΛ− is a constant map. That Λ is, P FΛ+ and P FΛ− differ by a multiplicative constant, and so determine the same homomorphism. Proof. First, Corollary 1.3(2) of [HM14] gives that Stab(Λ+ ) = Stab(Λ− ) (which we will henceforth refer to as Stab(Λ± )), so the ratio in the statement is always well defined. Now P FΛ+ and P FΛ− each determine a homomorphism from Stab(Λ± ) to R and it suffices to show that these homomorphisms have the same kernel. Suppose ψ ∈ / ker P FΛ+ so that by [BFH00, Corollary 3.3.1] either Λ+ ∈ L(ψ) or Λ+ ∈ L(ψ −1 ). After −1 −1 replacing ψ by ψ if necessary, we may assume Λ+ ∈ L(ψ). Now ψ has a paired lamination Λ− ) ψ ∈ L(ψ − − − which a priori could be different from Λ . But Corollary 1.3(1) of [HM14] says that in fact Λψ = Λ and therefore that Λ− ∈ L(ψ −1 ). A final application of [BFH00, Corollary 3.3.1] gives that ψ ∈ / ker P FΛ− . This concludes the proof.  Theorem 4.2. If P FH is injective, then H is undistorted in Out(Fn ). Proof. Let k be the rank of H and start by choosing laminations Λ1 , . . . , Λk ∈ L(H) so the restriction of the function P FH to the coordinates determined by Λ1 , . . . , Λk is still injective. First note that {Λ1 , . . . , Λk } cannot contain an attracting-repelling lamination pair by Lemma 4.1. Next, pass to a finite index subgroup of H and choose generators φi so that after reordering the Λi ’s if necessary, each generator satisfies P FH (φi ) = (0, . . . , 0, P FΛi (φi ), 0, . . . , 0). Let ∗ ∈ CVn be arbitrary and let ψ = φp11 · · · φpkk ∈ H. We complete the proof one orthant at a time by replacing some of the φi ’s by their inverses so that all the pi ’s are non-negative. Next, after replacing some of the Λi ’s by their paired laminations (again using Lemma 4.1), we may assume that P FH (ψ) has all coordinates nonnegative. By Theorem 3.3, the translation distance of ψ is the maximum of the Perron-Frobenius eigenvalues associated to the EG strata of a relative train track representative f of ψ. Some, but not necessarily all, of Λ1 , . . . , Λk are attracting laminations for ψ. Those Λi ’s which are in L(ψ) are associated to EG strata of f . For such a stratum, the logarithm of the PF eigenvalue is P FΛi (ψ) and the fact that P FΛi is a homomorphism implies P FΛi (ψ) = P FΛi (φp11 · · · φpkk ) = p1 P FΛj (φ1 ) + . . . + pk P FΛj (φk ) = pi P FΛi (φi ) Thus, the translation distance of ψ acting on outer space is τ (ψ) = max{log λ | λ is PF eigenvalue associated to an EG stratum of ψ} ≥ max{P FΛi (ψ) | Λi is in L(ψ) and 1 ≤ i ≤ k} = max{pi P FΛi (φi ) | 1 ≤ i ≤ k} In the last equality, the maximum is taken over a larger set, but the only values added to the set were 0. Let S be a symmetric (i.e., S −1 = S) generating set for Out(Fn ) and let D1 = maxs∈S d(∗, ∗ · s). If we write ψ in terms of the generators ψ = s1 s2 · · · sl , then d(∗, ∗ · ψ) ≤ d(∗, ∗ · sl ) + d(∗ · sl , ∗ · sl−1 sl ) + . . . + d(∗ · (s2 . . . sl ), ∗ · (s1 . . . sl )) = d(∗, ∗ · sl ) + d(∗, ∗ · sl−1 + . . . + d(∗, ∗ · s1 ) ≤ D1 |ψ|Out(Fn ) Let K1 = min{P FΛ± (φ± j ) | 1 ≤ i, j ≤ k}. Rearranging this and combining these inequalities, we have i |ψ|Out(Fn ) ≥ 1 1 K1 1 d(∗, ∗ · ψ) ≥ τ (ψ) ≥ max{pi P FΛi (φi ) | 1 ≤ i ≤ k} ≥ max{pi } D1 D1 D1 D1 We have thus proved that the image of H under the injective homomorphism P FH is undistorted in Zk . To conclude the proof, recall that any injective homomorphism between abelian groups is a quasi-isometric embedding.  8 DERRICK WIGGLESWORTH Now that we have established our result in the exponential setting, we move on to the polynomial case. First we prove a general result about CTs representing elements of abelian subgroups. 5. Abelian Subgroups are Virtually Finitely Filtered In this section, we prove an analog of [BFH05, Theorem 1.1] for abelian subgroups. In that paper, the authors prove that any unipotent subgroup of Out(Fn ) is contained in the subgroup Q of homotopy equivalences respecting a fixed filtration on a fixed graph G. They call such a subgroup “filtered”. While generic abelian subgroups of Out(Fn ) are not unipotent, we prove that they are virtually filtered. Namely, that such a subgroup is virtually contained in the union of finitely many Q’s. First, we review the comparison homomorphisms introduced in [FH09]. 5.1. Comparison Homomorphisms. Feighn and Handel defined certain homomorphisms to Z which measure the growth of linear edges and quasi-exceptional families in a CT representative. Though they can be given a canonical description in terms of principal lifts, we will only need their properties in coordinates given by a CT. Presently, we will define these homomorphisms and recall some basic facts about them. Complete details on comparison homomorphisms can be found in [FH09]. Comparison homomorphisms are defined in terms of principal sets for the subgroup H. The exact definition of a principal set is not important for us. We only need to know that a principal set X for an abelian subgroup H is a subset of ∂Fn which defines a lift s : H → Aut(Fn ) of H to the automorphism group. Let X1 and X2 be two principal sets for H that define distinct lifts s1 and s2 to Aut(Fn ). Suppose further that X1 ∩ X2 contains the endpoints of an axis Ac . Since H is abelian, s1 · s−1 2 : H → Aut(Fn ) defined by −1 −1 s1 · s2 (φ) = s1 (φ) · s2 (φ) is a homomorphism. It follows from [FH11, Lemma 4.14] that for any φ ∈ H, s1 (φ) = s2 (φ)ikc for some k, where ic : Aut(Fn ) → Aut(Fn ) denotes conjugation by c. Therefore s1 · s−1 2 defines homomorphism into hic i, which we call the comparison homomorphism determined by X1 and X2 . Generally, we will use the letter ω for comparison homomorphisms. For a rotationless abelian subgroup H, there are only finitely many comparison homomorphisms [FH09, Lemma 4.3]. Let K be the number of distinct comparison homomorphisms and (as before) let N be the number of attracting laminations for H. The map Ω : H → ZN +K defined as the product of the comparison homomorphisms and expansion factor homomorphisms is injective [FH09, Lemma 4.6]. An element φ ∈ H is called generic if every coordinate of Ω(φ) ∈ ZN +K is non-zero. If φ is generic and f : G → G is a CT representing φ, then there is a correspondence between the comparison homomorphisms for H and the linear edges and quasi-exceptional families in G described in the introduction to §7 of [FH09] which we briefly describe now. There is a comparison homomorphism ωEi for each linear edge Ei in G. If f (Ei ) = Ei · udi , then ωEi (φ) = di . There is also a comparison homomorphism for each quasi-exceptional family, Ei u∗ E j which is denoted by ωEi u∗ E j . If Ei is as before and f (Ej ) = Ej udj , then ωEi u∗ E j and ω(φ) = di − dj . We illustrate this correspondence with an example. Example 5.1. Let G = R3 be the rose with three petals labeled a, b, and c. For i, j ∈ Z, define gi,j : G → G as follows: a 7→ a gi,j : b 7→ bai c 7→ caj Each gi,j determines an outer automorphism of F3 which we denote by φi,j . The automorphisms φi,j all lie in the rank two abelian subgroup H = hφ0,1 , φ1,0 i. The subgroup H has three comparison homomorphisms which are easily understood in the coordinates of a CT for a generic element of H. The element φ2,1 is generic in H, and g2,1 is a CT representing it. Two of the comparison homomorphisms manifest as ωb and ωc where ωb (φi,j ) = i and ωc (φi,j ) = j. The third homomorphism is denoted by ωba∗ c and it measures how a path of the form ba∗ c changes when gi,j is applied. Since gi,j (ba∗ c) = ba∗+i−j c, we have ωba∗ c (φi,j ) = i − j. In the sequel, we will rely heavily on this correspondence between the comparison homomorphisms of H and the linear edges and quasi-exceptional families in a CT for a generic element of H. We now prove the main result of this section. DISTORTION FOR ABELIAN SUBGROUPS OF Out(Fn ) 9 Proposition 5.2. For any abelian subgroup H of Out(Fn ), there exists a finite index subgroup H 0 such that every φ ∈ H 0 can be realized as a CT on one of finitely many marked graphs. Most of the proof consists of restating and combining results of Feighn and Handel from [FH09]. We refer the reader to §6 of their paper for the relevant notation and most of the relevant results. Proof. First replace H by a finite index rotationless subgroup [FH09, Corollary 3.14]. The proof is by induction on the rank of H. The base case follows directly from [FH09, Lemma 6.18]. Let H = hφi and let f ± : G± → G± be CT’s for φ and φ−1 which are both generic in H. The definitions then guarantee that i = (i, i, . . . , i) for i > 0 is both generic and admissible. Lemma 6.18 then says that fi± : G± → G± is a CT ±i representing φ± i = φ , so we are done. Assume now that the claim holds for all abelian subgroups of rank less than k, and let H = hφ1 , . . . , φk i. The set of generic elements of H is the complement of a finite [FH09, Lemma 4.3] collection of hyperplanes. Every non-generic element, φ, lies in a rank (k − 1) abelian subgroup of H: the kernel of the corresponding comparison homomorphism. By induction and the fact that there are only finitely many hyperplanes, every non-generic element has a CT representative on one of finitely many marked graphs. We now add a single marked graph for each sector defined by the complement of the hyperplanes. Let φ be generic and let f : G → G be a CT representative. Let D(φ) be the disintegration of φ as defined in [FH09] and recall that D(φ) ∩ H is finite index in H [FH09, Theorem 7.2]. Let Γ be the semigroup of generic elements of D(φ) ∩ H that lie in the same sector of H as φ (i.e., for every γ ∈ Γ and every coordinate ω of Ω, the signs of ω(γ) and ω(φ) agree). The claim is that every element of Γ can be realized as a CT on the marked graph G and we will show this by explicitly reconstructing the generic tuple a such that γ = [fa ]. Fix γ ∈ Γ and let φa1 , . . . , φak be a generating set for H with ai generic [FH09, Corollary 6.20]. Write γ as a word in the generators, γ = φja11 · · · φjakk and define a = j1 a1 + . . . + jk ak . Since the admissibility condition is a set of homogeneous linear equations which must be preserved under taking linear combinations, as long as every coordinate of a is non-negative, a must be admissible. To see that every coordinate of a is in fact positive, let ω be a coordinate of Ωφ . Using the fact that ω is a homomorphism to Z and repeatedly applying [FH09, Lemma 7.5] to the φai ’s, we have ω(γ) = j1 ω(φa1 ) + j2 ω(φa2 ) + . . . + jk ω(φak ) = j1 (a1 )s ω(φ) + j2 (a2 )s ω(φ) + . . . + jk (ak )s ω(φ) = (j1 a1 + j2 a2 + . . . + jk ak )s ω(φ) = (a)s ω(φ) where (a)s denotes the s-th coordinate of the vector a. Since γ and φ were assumed to be generic and to lie in the same sector, we conclude that every coordinate of a is positive. The injectivity Ωφ [FH09, Lemma 7.4] then implies that γ = [fa ]. That a is in fact generic follows from the fact, which is directly implied by the definitions, that if a is a generic tuple, then φa is a generic element of H. Finally, we apply [FH09, Lemma 6.18] to conclude that fa : G → G is a CT. Thus, every element of Γ has a CT representative on the marked, filtered graph G. Repeating this argument in each of the finitely many sectors and passing to the intersection of all the finite index subgroups obtained this way yields a finite index subgroup H 0 and finitely many marked graphs, so that every generic element of H 0 can be realized as a CT on one of the marked graphs. The non-generic elements were already dealt with using the inductive hypothesis, so the proof is complete.  6. The Polynomial Case In [Ali02], the author introduced a function that measures the twisting of conjugacy classes about an axis in Fn and used this function to prove that cyclic subgroups of UPG are undistorted. In order to use the comparison homomorphisms in conjunction with this twisting function, we need to establish a result about the possible terms occuring in completely split circuits. After establishing this connection, we use it to prove (Theorem 6.12) the main result under the assumption that H has “enough” polynomial data. 10 DERRICK WIGGLESWORTH In the last section, we saw the correspondence between comparison homomorphisms and certain types of paths in a CT. In order to use the twisting function from [Ali02], our goal is to find circuits in G with single linear edges or quasi-exceptional families as subpaths, and moreover to do so in such a way that we can control cancellation at the ends of these subpaths under iteration of f . This is the most technical section of the paper, and the one that most heavily relies on the use of CTs. The main result is Proposition 6.1. 6.1. Completely Split Circuits. One of the main features of train track maps is that they allow one to k understand how cancellation occurs when tightening f k (σ) to f# (σ). In previous incarnations of train track maps, this cancellation was understood inductively based on the height of the path σ. One of the main advantages of completely split train track maps is that the way cancellation can occur is now understood directly, rather than inductively. Given a CT f : G → G representing φ, the set of allowed terms in completely split paths would be finite were it not for the following two situations: a linear edge E 7→ Eu gives rise to an infinite family of INPs of the form Eu∗ E, and two linear edges with the same axis E1 7→ E1 ud1 , E2 7→ E2 ud2 (with d1 and d2 having the same sign) give rise to an infinite family of exceptional paths of the form E1 u∗ E 2 . To see that these are the only two subtleties, one only needs to know that there is at most one INP of height r for each EG stratum Hr . This is precisely [FH09, Corollary 4.19]. To connect Feighn-Handel’s comparison homomorphisms to Alibegović’s twisting function, we would like to show that every linear edge and exceptional family occurs as a term in the complete splitting of some completely split circuit. We will in fact show something stronger: Proposition 6.1. There is a completely split circuit σ containing every allowable term in its complete splitting. That is the complete splitting of σ contains at least one instance of every • edge in an irreducible stratum (fixed, NEG, or EG) • maximal, taken connecting subpath in a zero stratum • infinite family of INPs Eu∗ E • infinite family of exceptional paths E1 u∗ E 2 The proof of this proposition will require a careful study of completely split paths. With that aim, we define a directed graph that encodes the complete splittings of such paths. Given a CT f : G → G representing φ define a di-graph CSP(f ) (or just CSP when f is clear) whose vertices are oriented allowed terms in completely split paths. More precisely, there are two vertices for each edge in an irreducible stratum: one labeled by E and one labeled by E (which we will refer to at τE and τE ). There are two vertices for each maximal taken connecting path in a zero stratum: one for σ and one for σ (which will be referred to as τσ and τσ ). Similarly, there are two vertices for each family of exceptional paths, two vertices for each INP of EG height, and one vertex for each infinite family of NEG Nielsen paths. There is only one vertex for each family of indivisible Nielsen path σ whose height is NEG because σ and σ determine the same initial direction. There is an edge connecting two vertices τσ and τσ0 in CSP(f ) if the path σσ 0 is completely split with splitting given by σ · σ 0 . This is equivalent to the turn (σ, σ 0 ) being legal by the uniqueness of complete splittings [FH11, Lemma 4.11]. Any completely split path (resp. circuit) σ with endpoints at vertices in G defines a directed edge path (resp. directed loop) in CSP(f ) given by reading off the terms in the complete splitting of σ. Conversely, a directed path or loop in CSP(f ) yields a not quite well defined path or circuit σ in G which is necessarily completely split. The only ambiguity lies in how to define σ when the path in CSP(f ) passes through a vertex labeled by a Nielsen path of NEG height or a quasi-exceptional family. Example 6.2. Consider the rose R2 consisting of two edges a and b with the identity marking. Let f : R2 → R2 be defined by a 7→ ab, b 7→ bab. This is a CT representing a fully irreducible outer automorphism. There is one indivisible Nielsen path σ = abab. The graph CSP(f ) is shown in Figure 1. The blue edges represent the fact that each of the paths b · b, b · a, b · σ, and b · a is completely split. Remark 6.3. A basic observation about the graph CSP is that every vertex τσ has at least one incoming and at least one outgoing edge. While this is really just a consequence of the fact that every vertex in a CT has at least two gates, a bit of care is needed to justify this formally. Indeed, let v be the initial endpoint DISTORTION FOR ABELIAN SUBGROUPS OF Out(Fn ) τa τa τb τb τσ 11 τσ Figure 1. The graph of CSP(f ) for Example 6.2 of σ. If there is some legal turn (E, σ) at v where E is an edge in an irreducible stratum, then E · σ is completely split so there is an edge in CSP from τE to τσ . The other possibility is that the only legal turns ( , σ) at v consist of an edge in a zero stratum Hi . In this case, (Zero Strata) guarantees that v is contained in the EG stratum Hr which envelops Hi and that the link of v is contained in Hi ∪ Hr . In particular, there are a limited number of possibilities for σ; σ may be a taken connecting subpath in Hi , an edge in Hr , or an k EG INP of height r. In the first two cases, σ is a term in the complete splitting of f# (E) for some edge E. By increasing k if necessary, we can guarantee that σ is not the first or last term in this splitting. Therefore, there is a directed edge in CSP with terminal endpoint τσ . In the case that σ is an INP, σ has a first edge E0 which is necessarily of EG height. We have already established that there is a directed edge in CSP pointed to τE0 , so we just observe that any vertex in CSP with a directed edge ending at E0 will also have a directed edge terminating at τσ . The same argument shows that there is an edge in CSP emanating from τσ . The statement of Proposition 6.1 can now be rephrased as a statement about the graph CSP. Namely, that there is a directed loop in CSP which passes through every vertex. We will need some basic terminology from the study of directed graphs. We say a di-graph Γ is strongly connected if every vertex can be connected to every other vertex in Γ by a directed edge path. In any di-graph, we may define an equivalence relation on the vertices by declaring v ∼ w if there is a directed edge path from v to w and vice versa (we are required to allow the trivial edge path so that v ∼ v). of Γ. The equivalence classes of this relation partition the vertices of Γ into strongly connected components. We will prove that CSP(f ) is connected and has one strongly connected component. From this, Proposition 6.1 follows directly. The proof proceeds by induction on the core filtration of G, which is the filtration obtained from the given one by considering only the filtration elements which are their own cores. Because the base case is in fact more difficult than the inductive step, we state it as a lemma. Lemma 6.4. If f : G → G is a CT representing a fully irreducible automorphism, then CSP(f ) is connected and strongly connected. Proof. Under these assumptions, there are two types of vertices in CSP(f ): those labeled by edges, and those labeled by INPs. We denote by CSP e the subgraph consisting of only the vertices which are labeled by edges. Recall that τE denotes the vertex in CSP corresponding to the edge E. If the leaves of the 12 DERRICK WIGGLESWORTH attracting lamination are non-orientable, then we can produce a path in CSP e starting at τE , then passing through every other vertex in CSP e , and finally returning to τE by looking at a long segment of a leaf of the attracting lamination. More precisely, (Completely Split) says that f k (E) is a completely split path for all k ≥ 0 and the fact that f is a train track map says that this complete splitting contains no INPs. Moreover, irreducibility of the transition matrix and non-orientability of the lamination implies that for sufficiently large k this path not only contains every edge in G (with both orientations), but contains the edge E followed by every other edge in G with both of its orientations, and then the edge E again. Such a path in G exactly shows that CSP e is connected and strongly connected. We isolate the following remark for future reference. Remark 6.5. If there is an indivisible Nielsen path σ in G, write its edge path σ = E1 E2 . . . Ek (recall that all INPs in a CT have endpoints at vertices). If τσ0 is any vertex in CSP with a directed edge pointing to τE1 , then σ 0 · σ is completely split since the turn (σ 0 , σ) must be legal. Hence there is also a directed edge in CSP from τσ0 to τσ . The same argument shows that there is an edge in CSP from τσ to some vertex τ 0 6= τσ . Since CSP e is strongly connected, and the remark implies that each vertex τσ (for σ an INP in G) has directed edges coming from and going back into CSP e , we conclude that CSP is strongly connected in the case that leaves of the attracting lamination are non-orientable. Now choose an orientation on the attracting lamination Λ. If we imagine an ant following the path in G determined by a leaf of Λ, then at each vertex v we see the ant arrive along certain edges and leave along others. Let E be an edge with initial vertex v so that E determines a gate [E] at v. We say that [E] is a departure gate at v if E occurs in some (any) oriented leaf λ. Similarly, we say the gate [E] is an arrival gate at v if the edge E occurs in λ. Some gates may be both arrival and departure gates. Suppose now that there is some vertex v in G that has at least two arrival gates and some vertex w that has at least two departure gates. As before, we will produce a path in CSP e that shows this subgraph has one strongly connected component. Start at any edge in G and follow a leaf λ of the lamination until you have crossed every edge with its forward orientation. Continue following the leaf until you arrive at v, say through the gate [E]. Since v has two arrival gates, there is some edge E 0 which occurs in λ with the given orientation and whose terminal vertex is v ([E 0 ] is a second arrival gate). Now turn onto E 0 . Since [E] and [E 0 ] are distinct gates, this turn is legal. Follow λ going backwards until you have crossed every edge of G (now in the opposite direction). Finally, continue following λ until you arrive at w, where there are now two arrival gates because you are going backwards. Use the second arrival gate to turn around a second time, and follow λ (now in the forwards direction again) until you cross the edge you started with. By construction, this path in G is completely split and every term in its complete splitting is a single edge. The associated path in CSP e passes through every vertex and then returns to the starting vertex, so CSP e is strongly connected. In the presence of an INP, Remark 6.5 completes the proof of the lemma under the current assumptions. We have now reduced to the case where the lamination is orientable and either every vertex has only one departure gate or every vertex has only one arrival gate. The critical case is the latter of the two, and we would like to conclude in this situation that there is an INP. Example 6.2 illustrates this scenario. Some edges are colored red to illustrate the fact that in order to turn around and get from the vertices labeled by a and b to those labeled by a and b, one must use an INP. The existence of an INP in this situation is provided by the following lemma. Lemma 6.6. Assume f : G → G is a CT representing a fully irreducible rotationless automorphism. Suppose that the attracting lamination is orientable and that every vertex has exactly one arrival gate. Then G has an INP, σ, and the initial edges of σ and σ are oriented consistently with the orientation of the lamination. We postpone the proof of this lemma and explain how to conclude our argument. If every vertex has one arrival gate, then we apply the lemma to conclude that there must be an INP. Since INPs have exactly one illegal turn, using the previous argument, we can turn around once. Now if we are again in a situation where there is only one arrival gate, then we can apply the lemma a second time (this time with the orientation of Λ reversed) to obtain the existence of a second INP, allowing us to turn around a second time.  DISTORTION FOR ABELIAN SUBGROUPS OF Out(Fn ) 13 We remark that since there is at most one INP in each EG stratum of a CT, Lemma 6.6 implies that if the lamination is orientable, then some vertex of G must have at least 3 gates. Proof of Lemma 6.6. There is a vertex of G that is fixed by f since [FH11, Lemma 3.19] guarantees that every EG stratum contains at least one principal vertex and principal vertices are fixed by (Rotationless). Choose such a vertex v and let ṽ ∈ Γ be a lift of v to the universal cover Γ of G. Let g be the unique arrival gate at ṽ. Lift f to a map f˜: Γ → Γ fixing ṽ. Let T be the infinite subtree of Γ consisting of all embedded rays γ : [0, ∞) → Γ starting at ṽ and leaving every vertex through its unique arrival gate. That is γ(0) = ṽ and whenever γ(t) is a vertex, Dγ(t) should be the unique arrival gate at γ(t). Refer to Figure 2 for the tree T for Example 6.2. a a a b b a a b a a a b ṽ b b a b a b b a a a b b a a b Figure 2. The tree T for Example 6.2. The red path connects two vertices of the same height. First, we claim that f˜(T ) ⊂ T . To see this, notice that since f is a topological representative, it suffices to show that f˜(p) ∈ T for every vertex p of T . Notice that vertices p of T are characterized by two things: first [ṽ, p] is legal, and second, for every edge E in the edge path of [ṽ, p], the gate [E] is the unique arrival gate at the initial endpoint of E. Now [ṽ, f˜(p)] = f˜([ṽ, p]) is legal because f is a train track map. Moreover, every edge E in the edge path of [ṽ, p] occurs (with orientation) in a leaf λ of the lamination. Since f˜ takes leaves to leaves preserving orientation, the same is true for f˜([ṽ, p]). The gate determined by every edge in the edge path of λ is the unique arrival gate at that vertex. Thus, for every edge E in the edge path of f˜([ṽ, p]), [E] is the unique arrival gate at that vertex, which means that f˜(p) ∈ T . Endow G with a metric using the left PF eigenvector of the transition matrix so that for every edge of G, we have `(f (E)) = ν `(E) where ν is the PF eigenvalue of the transition matrix. Lift the metric on G to a metric on Γ and define a height function on the tree T by measuring the distance to ṽ: h(p) = d(p, ṽ). Since legal paths are stretched by exactly ν, we have that for any p ∈ T , h(f˜(p)) = νh(p). Now let w and w0 be two distinct lifts of v with the same height, h(w) = h(w0 ). To see that this is possible, just take α and β to be two distinct (hα, βi ' F2 ) circuits in G based at v which are obtained by following a leaf of the lamination. The initial vertices of the lifts of αβ and βα which end at ṽ are distinct lifts of v which are contained in T , and have the same height. k Let τ be the unique embedded segment connecting w to w0 in T . By [FH11, Lemma 4.25], f˜# (τ ) is k ˜ completely split for all sufficiently large k. Moreover, the endpoints of f# (τ ) are distinct since the restriction of f˜ to the lifts of v is injective. This is simply because f˜: (Γ, ṽ) → (Γ, ṽ) represents an automorphism of k Fn and lifts of v correspond to elements of Fn . Now observe that the endpoints f˜# (τ ) have the same height and for any pair of distinct vertices with the same height, the unique embedded segment connecting them must contain an illegal turn. This follows from the definition of T and the assumption that every vertex has k a unique arrival gate. Therefore, the completely split path f˜# (τ ) contains an illegal turn. In particular, it 14 DERRICK WIGGLESWORTH must have an INP in its complete splitting. That the initial edges of σ and σ are oriented consistently with the orientation on λ is evident from the construction.  The key to the inductive step is provided by the “moving up through the filtration” lemma from [FH09] which explicitly describes how the graph G can change when moving from one element of the core filtration to the next. Recall the core filtration of G is the filtration G0 ⊆ Gl1 ⊆ . . . ⊆ Glk = Gm = G obtained by restricting to those filtration elements which are their own cores. For each Gli , the i-th stratum of the core Sli Hj . Finally, we let ∆χ− filtration is defined to be Hlci = j=l i = χ(Gli−1 ) − χ(Gli ) denote the negative i−1 +1 of the change in Euler characteristic. Lemma 6.7 ([FH09, Lemma 8.3]). (1) If Hlci does not contain any EG strata then one of the following holds. (a) li = li−1 + 1 and the unique edge in Hlci is a fixed loop that is disjoint from Gli−1 . (b) li = li−1 + 1 and both endpoints of the unique edge in Hlci are contained in Gli−1 . (c) li = li−1 + 2 and the two edges in Hlci are nonfixed and have a common initial endpoint that is not in Hli−1 and terminal endpoints in Gli−1 . In case 1a, ∆i χ− = 0; in cases 1b and 1c, ∆i χ− = 1. (2) If Hlci contains an EG stratum, then Hli is the unique EG stratum in Hlci and there exists li−1 ≤ ui < li such that both of the following hold. (a) For li1 < j ≤ ui , Hj is a single nonfixed edge Ej whose terminal vertex is in Gli−1 and whose initial vertex has valence one in Gui . In particular, Gui deformation retracts to Gli−1 and χ(Gui ) = χ(Gli−1 ). (b) For ui < j < li , Hj is a zero stratum. In other words, the closure of Gli \ Gui is the extended EG stratum Hlzi . If some component of Hlci is disjoint from Gui then Hlci = Hli is a component of Gli and ∆i χ− ≥ 1; otherwise ∆i χ− ≥ 2. As we move up through the core filtration, we imagine adding new vertices to CSP and adding new edges connecting these vertices to each other and to the vertices already present. Thus, we define CSP li to be the subgraph of CSP consisting of vertices labeled by allowable terms in Gli . Here we use the fact that the restriction of f to each connected component of an element of the core filtration is a CT. The problem with proving that CSP is strongly connected by induction on the core filtration is that CSP li may have multiple connected components. This only happens, however, if Gli has more than one connected component in which case CSP li will have multiple connected components. If any component of Gli is a topological circle (necessarily consisting of a single fixed edge E), then CSP li will have two connected components for this circle. Lemma 6.8. For every 1 ≤ i ≤ k, the number of strongly connected components of CSP li (f ) is equal to 2 · # {connected components of Gli that are circles} + # {connected components of Gli that are not circles} The following proof is in no way difficult. It only requires a careful analysis of the many possible cases. The only case where there is any real work is in case 2 of Lemma 6.7. Proof. Lemma 6.4 establishes the base case when H1c is exponentially growing. If H1c is a circle, then CSP 1 has exactly two vertices, each with a self loop, so the lemma clearly holds. We now proceed to the inductive step, which is case-by-case analysis based on Lemma 6.7. We set some notation to be used throughout: E will be an edge with initial vertex v and terminal vertex w (it’s possible that v = w). We denote by Gvli the component of Gli containing v and similarly for w. Let CSP vli be the component(s) of CSP li containing paths which pass through v. In the case that Gvli is a topological circle, there will be two such components. In case 1a of Lemma 6.7, CSP li is obtained from CSP li−1 by adding two new vertices: τE and τE . Each new vertex has a self loop, and no other new edges are added. So the number of connected components of CSP increases by two. Each component is strongly connected. In case 1b, there are several subcases according to the various possibilities for the edge E, and the topological types of Gvli−1 and Gw li−1 . First, suppose that E is a fixed edge. Then CSP li is obtained from DISTORTION FOR ABELIAN SUBGROUPS OF Out(Fn ) 15 CSP li−1 by adding two new vertices. There are no new INPs since the restriction of f to each component of Gli is a CT and any INP is of the form provided by (NEG Nielsen Paths) or (EG Nielsen Paths). As in Remark 6.3, the vertex τE has an incoming edge with initial endpoint τ and an outgoing edge with terminal w endpoint τ 0 . Moreover, τ ∈ CSP vli−1 and τ 0 ∈ CSP w li−1 . We then have a directed edge from σ ∈ CSP li−1 to τE and a directed edge from τE to σ 0 ∈ CSP vli−1 . Hence, there are directed paths in CSP li connecting the two strongly connected subgraphs CSP vli−1 and CSP w li−1 to each other, and passing through all new vertices. Therefore, there is one strongly connected component of CSP li corresponding to the component of Gli containing v (and w). This component cannot be a circle, since it contains at least two edges. In the case that Gvli−1 (resp. Gw li−1 ) is a topological circle, we remark that there are incoming (resp. outgoing) edges w v ) in CSP vli (resp. CSP w li to τE from each of the components of CSP li−1 (resp. CSP li−1 ). See Figure 3. E τE τE σ τ Gvli−1 Gw li−1 σ0 τ0 CSP vli−1 (f ) CSP w li−1 (f ) Figure 3. A possibility for Gli and the graph CSP li when Hlci is a single NEG edge Suppose now that E is a non-fixed NEG edge. There are two new vertices in CSP li labeled τE and τE . The argument given in the previous paragraph goes through once we notice that if v 6= w, then Gw li−1 cannot be a circle since this would imply that w is not a principal vertex in Gli (see first bullet point in the definition) contradicting the fact that f |Gli is a CT ((Vertices) is not satisfied). If E is a non-linear edge, then we are done. If E is linear, then there will be other new vertices in CSP li . There will be a new vertex for the family of NEG Nielsen paths Eu∗ E. The fact that we have concluded the inductive step for the vertex τE along with remark 6.5 shows that this new vertex is in the same strongly connected component as τE . There will also be two vertices for each family of exceptional paths Eu∗ E 0 . For the exact same reasons, these vertices are also in this strongly connected component. This concludes the proof in case 1b of Lemma 6.7. The arguments given thus far apply directly to case 1c of Lemma 6.7. We remark that in this case, neither of the components of Gli−1 containing the terminal endpoints of the new edges can be circles for the same reason as before. The most complicated way that G (and hence CSP) can change is when Hlci contains an EG stratum. In case 2 of Lemma 6.7, if some component of Hlci is disjoint from Gui , then Hlci is a component of Gli and the restriction of f to this component is a fully irreducible. In particular, CSP li has one more strongly connected component than CSP li−1 by Lemma 6.4. Though case 2 of Lemma 6.7 describes Gli as being built from Gli−1 in three stages from bottom to top, somehow it is easier to prove CSP li has the correct number of connected components by going from top to bottom. By looking at a long segment of a leaf of the attracting lamination for Hli , we can see as in Lemma 6.4 that the vertices in CSP li labeled by edges in the EG stratum Hli are in at most two different strongly connected components. In fact, we can show that these vertices are all in the same strongly connected component. Since we are working under the assumption that no component of Hlci is disjoint from Gui , we can use one of the components of Gui to turn around on a leaf of the lamination. Indeed, choose some component G1 of Gui which intersects Hli . Let E be an EG edge in Hli with terminal vertex w ∈ G1 . Note that if G1 deformation 16 DERRICK WIGGLESWORTH retracts onto a circle with vertex v, then some EG edge in Hli must be incident to v, since otherwise f |Gli would not be a CT. Thus, by replacing E if necessary, we may assume in this situation that w is on the circle. Using the inductive hypothesis and the fact that mixed turns are legal, we can connect the vertex τE to the vertex τE in CSP li . Then we can follow a leaf of the lamination going backwards until we return to w, say along E 0 . If E = E 0 , then the leaves of the lamination were non-orientable in the first place, and all the vertices labeled by edges in Hli are in the same strongly connected component of CSP li . Otherwise, apply the inductive hypothesis again and use the fact that mixed turns are legal to get a path from τE 0 to τE 0 . This shows all vertices labeled by edges in Hli are in the same strongly connected component of CSP li . We will henceforth denote the strongly connected component of CSP li which contains all these vertices by CSP EG li . If there is an INP σ of height Hli , its first and last edges are necessarily in Hli . Remark 6.5 then implies that τσ and τσ are in CSP EG li . Recall that the only allowable terms in complete splittings which intersect zero strata are connecting paths which are both maximal and taken. In particular, each vertex in CSP li corresponding to such a connecting path is in the aforementioned strongly connected component, CSP EG li . Now let E be an NEG edge in Hlci with terminal vertex w. There is necessarily an outgoing edge from EG w τE into CSP w li−1 and an incoming edge to τE from CSP li . If the graph Gli−1 is not a topological circle, w then the corresponding component CSP li−1 is already strongly connected and there is a directed edge from this graph back to τE and from there back into CSP EG li . Thus, this subgraph is contained in the strongly EG connected component CSP li . On the other hand, if Gw li−1 is a topological circle, then there is a directed edge from τE back into CSP EG because mixed turns are legal, and as before, some edge in Hli must be li incident to w. Thus all the vertices in CSP li labeled by NEG edges are in the strongly connected component w CSP EG li , as are all vertices in CSP li−1 for w as above. The same argument and the inductive hypothesis shows that for any component of Gli−1 which intersects Hli , the corresponding strongly connected component(s) of CSP li−1 are also in CSP EG li . The only thing remaining is to deal with NEG Nielsen paths and families of exceptional paths. Both of these are handled contains all vertices of the form by Remark 6.5 and the fact that we have already established that CSP EG li τE or τE for NEG edges in Hlci . We have shown that every vertex of a strongly connected component of CSP li−1 coming from a component of Gli−1 which intersects Hlci is in the strongly connected component CSP EG li . In particular, there is only one strongly connected component of CSP li for the component of Gli which contains edges in Hlci . This completes the proof of the proposition.  In the proof of Theorem 6.12, we will need to consider a weakening of the complete splitting of paths and circuits. The quasi-exceptional splitting of a completely split path or circuit σ is the coarsening of the complete splitting obtained by considering each quasi-exceptional subpath to be a single element. Given a CT f : G → G, we define the graph CSP QE (f ) by adding two vertices to CSP(f ) for each QE-family (one for Ei u∗ E j and one for Ej u∗ E i ). For every vertex τσ with a directed edge terminating at τEi add an edge from τσ to τEi u∗ E j and similarly for every edge emanating from τE j , add an edge to the same vertex beginning at τEi u∗ E j . Do the same for the vertex τEj u∗ E i . As before, every completely split path σ gives rise to a directed edge path in CSP QE corresponding to its QE-splitting. It follows immediately from the definition and Proposition 6.1 that Corollary 6.9. There is a completely split circuit σ containing every allowable term in its QE-splitting. We are now ready to prove our main result in the polynomial case. 6.2. Polynomial Subgroups are Undistorted. In this subsection, we will complete the proof of our main result in the polynomial case. We first recall the height function defined by Alibegović in [Ali02]. Given two conjugacy classes [u], [w] of elements of Fn , define the twisting of [w] about [u] as twu (w) = max{k | w = auk b where u, w are a cyclically reduced conjugates of [u], [w]} DISTORTION FOR ABELIAN SUBGROUPS OF Out(Fn ) 17 Then define the twisting of [w] by tw(w) = max{twu (w) | u ∈ Fn }. Alibegović proved the following lemma using bounded cancellation, which we restate for convenience. A critical point is that D2 is independent of w. Lemma 6.10 ([Ali02, Lemma 2.4]). There is a constant D2 such that tw(s(w)) ≤ tw(w) + D2 for all conjugacy classes w and all s ∈ S, our symmetric finite generating set of Out(Fn ). Since we typically work with train tracks, we have a similar notion of twisting adapted to that setting. Let τ be a path or circuit in a graph G and let σ be a circuit in G. Define the twisting of τ about σ as twσ (τ ) = max{k | τ = ασ k β where the path ασ k β is immersed} Then define tw(τ ) = max{twσ (τ ) | σ is a circuit}. The bounded cancellation lemma of [Coo87] directly implies Lemma 6.11. If ρ : Rn → G and [w] is a conjugacy class in Fn = π1 (Rn ), then tw(ρ(w)) ≥ tw(w) − 2Cρ . We are now ready to prove non-distortion for polynomial abelian subgroups. Recall the map Ω : H → ZN +K was defined by taking the product of comparison and expansion factor homomorphisms. In the following theorem, we will denote the restriction of this map to the last K coordinates (those corresponding to comparison homomorphisms) by Ωcomp . Theorem 6.12. Let H be a rotationless abelian subgroup of Out(Fn ) and assume that the map from H into the collection of comparison factor homomorphisms Ωcomp : H → ZK is injective. Then H is undistorted. Proof. The first step is to note that it suffices to prove the generic elements of H are uniformly undistorted. This is just because the set of non-generic elements of H is a finite collection of hyperplanes, so there is a uniform bound on the distance from a point in one of these hyperplanes to a generic point. We set up some constants now for later use. This is just to emphasize that they depend only on the subgroup we are given and the data we have been handed thus far. Let G be the finite set of marked graphs provided by Proposition 5.2 and define K2 as the maximum of BCC(ρG ) and BCC(ρ−1 G ) as G varies over the finitely many marked graphs in G. Lemma 6.11 then implies that tw(ρ(w)) ≥ tw(w) − K2 for any conjugacy class w and any of the finitely many marked graphs in G. Let D2 be the constant from Lemma 6.10. Fix a minimal generating set φ1 , . . . , φk for H and let ψ = φp11 · · · φpkk be generic in H. Let f : G → G be a CT representing ψ with G chosen from G and let ω be the comparison homomorphism for which ω(ψ) is the largest. The key point is that given ψ, Corollary 6.9 will provide a split circuit σ for which the twisting will grow by |ω(ψ)| under application of the map f . Indeed, let σ be the circuit provided by Corollary 6.9. As we discussed in section 5.1, there is a correspondence between the comparison homomorphisms for H and the set of linear edges and quasi-exceptional families in G. Assume first that ω corresponds to the linear edge E with axis u, so that by definition f (E) = E · uω(ψ) . Since the splitting of f# (σ) refines that of σ and E is a term in the complete splitting of σ, f# (σ) not only contains the path E · uω(ψ) , but in fact splits at the ends of this subpath. Under iteration, t t we see that f# (σ) contains the path E · utω(ψ) , and therefore tw(f# (σ)) ≥ t|ω(ψ)|. This isn’t quite good enough for our purposes, so we will argue further to conclude that for some t0 , (1) t0 t0 −1 tw(f# (σ)) − tw(f# (σ)) ≥ |ω(ψ)| t−1 t Suppose for a contradiction that no such t exists. Then for every t, we have tw(f# (σ)) − tw(f# (σ)) ≤ t |ω(ψ)|−1. Using a telescoping sum and repeatedly applying this assumption, we obtain tw(f# (σ))−tw(σ) ≤ t|ω(ψ)| − t. Combining and rearranging inequalities, this implies t tw(σ) ≥ tw(f# (σ)) + t − t|ω(ψ)| ≥ t|ω(ψ)| + t − t|ω(ψ)| = t for all t, a contradiction. This establishes the existence of t0 satisfying equation (1). The above argument works without modification in the case that ω corresponds to a family of quasiexceptional paths. We now address the minor adjustment needed in the case that ω corresponds to a family of exceptional paths, Ei u∗ E j . Let f (Ei ) = Ei udi and f (Ej ) = Ej udj . Since σ contains both Ei u∗ E j and Ej u∗ E i in its complete splitting, we may assume without loss that di > dj . The only problem is that the 18 DERRICK WIGGLESWORTH t exponent of u in the term Ei u∗ E j occuring in the complete splitting of σ may be negative, so that tw(f# (σ)) may be less than t|ω(ψ)|. In this case, just replace σ by a sufficiently high iterate so that the exponent is positive. Now write ψ in terms of the generators ψ = s1 s2 · · · sp so that for any conjugacy class w, by repeatedly applying Lemma 6.10 we obtain tw(s1 (s2 · · · sp (w))) ≤ tw(s2 (s3 · · · sp (w))) + D2 ≤ tw(s3 · · · sp (w)) + 2D2 ≤ . . . ≤ tw(w) + pD2 t0 −1 so that, D2 |ψ|Out(Fn ) ≥ tw(ψ(w)) − tw(w). Applying this inequality to the circuit f# (σ) just constructed, t −1 and letting w be the conjugacy class ρ−1 (f#0 (σ)), we have i 2K 1 1 h 1 2K2 2 t0 t0 −1 |ψ|Out(Fn ) ≥ [tw(ψ(w)) − tw(w)] ≥ tw(f# (σ)) − tw(f# (σ)) − ≥ |ω(ψ)| − D2 D2 D2 D2 D2 The second inequality is justified by Lemma 6.11 and the third uses the property of σ established in (1) above. Since ω was chosen to be largest coordinate of Ωcomp (ψ) and Ωcomp is injective, the proof is complete.  7. The Mixed Case There are no additional difficulties with the mixed case since both the distance function on CVn and Alibegović’s twisting function are well suited for dealing with outer automorphisms whose growth is neither purely exponential nor purely polynomial. Consequently, for an element ψ of an abelian subgroup H, if the image of ψ is large under P FH then we can use CVn to show that |ψ|Out(Fn ) is large, and if the image is large under Ωcomp then we can use the methods from §6 to show |ψ|Out(Fn ) is large. The injectivity of Ω [FH09, Lemma 4.6] exactly says that if |ψ|H is large, then at least one of the aforementioned quantities must be large as well. Theorem 7.1. Abelian subgroups of Out(Fn ) are undistorted. Proof. Assume, by passing to a finite index subgroup, that H is rotationless. By [FH09, Lemma 4.6], the map Ω : H → ZN +K is injective. Choose a minimal generating set for H and write H = hφ1 , . . . , φk i. The restriction of Ω to the first N coordinates is precisely the map P FH from section 4. Choose k coordinates of Ω so that the restriction Ωπ to those coordinates is injective. Let P FΛ1 , . . . , P FΛl be the subset of the chosen coordinates corresponding to expansion factor homomorphisms. Pass to a finite index subgroup of H and choose generators so that Ωπ (φi ) = (0, . . . , P FΛi (φi ), . . . , 0) for 1 ≤ i ≤ l. Now we proceed as in the proofs of Theorems 4.2 and 6.12. Fix a basepoint ∗ ∈ CVn and let ψ = φp11 · · · φpkk in H. We may assume without loss that ψ is generic in H (again, it suffices to prove that generic elements are uniformly undistorted). Replace the φi ’s by their inverses if necessary to ensure that all pi ’s are non-negative. Then, for each of the first l coordinates of Ωπ , replace Λi by its paired lamination if necessary (Lemma 4.1) to ensure that P FΛi (ψ) > 0. Look at the coordinates of Ωπ (ψ) and pick out the one with the largest absolute value. We first consider the case where the largest coordinate corresponds to an expansion factor homomorphism P FΛj . We have already arranged that P FΛj (ψ) > 0. By Theorem 3.3, the translation distance of ψ is the maximum of the Perron-Frobenius eigenvalues associated to the EG strata of a relative train track representative f of ψ. Since ψ is generic and the first l coordinates of Ωπ are non-negative, {Λ1 , . . . , Λl } ⊂ L(ψ). Each Λi is associated to an EG stratum of f . For such a stratum, the logarithm of the PF eigenvalue is P FΛi (ψ). Just as in the proof of Theorem 4.2, for each 1 ≤ i ≤ l, we have that P FΛi (ψ) = pi P FΛi (φi ). So the translation distance of ψ acting on Outer Space is τ (ψ) ≥ max{pi P FΛi (φi ) | 1 ≤ i ≤ l} The inequality is because there may be other laminations in L(ψ). Just as in Theorem 4.2, we have d(∗, ∗ · ψ) ≤ D1 |ψ|Out(Fn ) where D1 = maxs∈S d(∗, ∗ · s). Let K1 = min{P FΛ± (φ± j ) | 1 ≤ i ≤ l, 1 ≤ j ≤ k}. Then we have i |ψ|Out(Fn ) 1 1 K1 1 d(∗, ∗ · ψ) ≥ τ (ψ) ≥ max{pi P FΛi (φi ) | 1 ≤ i ≤ k} ≥ max{pi } ≥ D1 D1 D1 D1 DISTORTION FOR ABELIAN SUBGROUPS OF Out(Fn ) 19 We now handle the case where the largest coordinate of Ωπ (ψ) corresponds to a comparison homomorphism ω. Let G be the finite set of marked graphs provided by Proposition 5.2 and let f : G → G be a CT for ψ where G ∈ G. Define K2 exactly as in the proof of Theorem 6.12 so that tw(ρ(w)) ≥ tw(w) − K2 for all conjugacy classes w and any marking or inverse marking of the finitely many marked graphs in G. The construction of the completely split circuit σ satisfying equation (1) given in the polynomial case works without modification in our current setting, where the comparison homomorphism ω in equation (1) is the coordinate of Ωπ which is largest in absolute value. t0 −1 Using this circuit and defining w = ρ−1 (f# σ), the inequalities and their justifications in the proof of Theorem 6.12 now apply verbatim to the present setting to conclude |ψ|Out(Fn ) ≥ 2K2 1 max{|ω(ψ)| | ω ∈ Ωπ }| − D2 D2 We have thus shown that the image of H under Ωπ undistorted. Since Ωπ is injective, it is a quasi-isometric embedding of H into Zk , so the theorem is proved.  We conclude by proving the rank conjecture for Out(Fn ). The maximal rank of an abelian subgroup of Out(Fn ) is 2n − 3, so Theorem 7.1 gives a lower bound for the geometric rank of Out(Fn ): rank Out(Fn ) ≤ 2n − 3. The other inequality follows directly from the following result, whose proof we sketch below. Theorem 7.2. If G has virtual cohomological dimension k ≥ 3, then rank(G) ≤ k. The virtual cohomological dimension of Out(Fn ) is 2n − 3 [CV86]. Thus, for n ≥ 3, we have: Corollary 7.3. The geometric rank of Out(Fn ) is 2n − 3, which is the maximal rank of an abelian subgroup of Out(Fn ). Proof of 7.2. Let G0 ≤ G be a finite index subgroup whose cohomological dimension is k. Since G is quasi-isometric to its finite index subgroups, we have rank(G0 ) = rank(G). A well known theorem of Eilenberg-Ganea [EG57] provides the existence of a k−dimensional CW complex X which is a K(G0 , 1). By Švarc-Milnor, it suffices to show that there can be no quasi-isometric embedding of Rk+1 into the universal cover X̃. Suppose for a contradiction that f : Rk+1 → X̃ is such a map. The first step is to replace f by a continuous quasi-isometry f 0 which is a bounded distance from f . This is done using the “connect-the-dots argument” whose proof is sketched in [SW02]. The key point is that X̃ is uniformly contractible. That is, for every r, there is an s = s(r), such that any continuous map of a finite simplicial complex into X whose image is contained in an r-ball is contractible in an s(r)-ball. It is a standard fact [Hat02, Theorem 2C.5] that X may be replaced with a simplicial complex of the same dimension so that X̃ may be assumed to be simplicial. We now construct a cover U of the simplicial complex X̃ whose nerve is equal to the barycentric subdivision of X̃. The cover U has one element for each cell of X̃. For each vertex v, the set Uv ∈ U is S a small neighborhood of v. For each i-cell, σ, Define Uσ by taking a sufficiently small neighborhood of σ \ σ0 ∈X̃ (i−1) Uσ0 to ensure that Uσ ∩ X̃ (i−1) = ∅. The key property of U is that all (k + 2)−fold intersections are necessarily empty because the dimension of the barycentric subdivision of X̃ is equal to dim(X̃). Since we have arranged f to be continuous, we can pull back the cover just constructed to obtain a cover V = {f −1 (U )}U ∈U of Rk+1 . Since the elements of U are bounded, and f is a quasi-isometric embedding, the elements of V are bounded as well. The intersection pattern of the elements of V is exactly the same as the intersection pattern of elements of U. But the cover U was constructed so that any intersection of (k + 2) elements is necessarily empty. Thus, we have constructed a cover of Rk+1 by bounded sets with no (k + 2)−fold intersections. We will contradict the fact that the Lebesgue covering dimension of any compact subset of Rk+1 is k + 1. Let K be compact in Rk+1 and let V 0 be an arbitrary cover of K. Let δ be the constant provided by the Lebesgue covering Lemma applied to V 0 . Since the elements of V are uniformly bounded, we can scale them by a single constant to obtain a cover of K whose sets have diameter < δ/3. Such a cover is necessarily a refinement of V 0 , but has multiplicity k + 1. This contradicts the fact that K has covering dimension k + 1 so the theorem is proved.  20 DERRICK WIGGLESWORTH References [Ali02] [Ber78] [BFH00] [BFH05] [BH92] [BM08] [Coo87] [CV86] [EG57] [FH09] [FH11] [FH14] [FLM01] [FM11] [Har86] [Hat02] [HM14] [McC85] [SW02] [Wad12] Emina Alibegović. Translation lengths in Out(Fn ). Geom. Dedicata, 92:87–93, 2002. Dedicated to John Stallings on the occasion of his 65th birthday. Lipman Bers. An extremal problem for quasiconformal mappings and a theorem by Thurston. Acta Math., 141(12):73–98, 1978. Mladen Bestvina, Mark Feighn, and Michael Handel. The Tits alternative for Out(Fn ). I. Dynamics of exponentiallygrowing automorphisms. Ann. of Math. (2), 151(2):517–623, 2000. Mladen Bestvina, Mark Feighn, and Michael Handel. The Tits alternative for Out(Fn ). II. A Kolchin type theorem. Ann. of Math. (2), 161(1):1–59, 2005. Mladen Bestvina and Michael Handel. Train tracks and automorphisms of free groups. Ann. of Math. (2), 135(1):1–51, 1992. Jason A. Behrstock and Yair N. Minsky. Dimension and rank for mapping class groups. Ann. of Math. (2), 167(3):1055– 1077, 2008. Daryl Cooper. Automorphisms of free groups have finitely generated fixed point sets. J. Algebra, 111(2):453–456, 1987. Marc Culler and Karen Vogtmann. Moduli of graphs and automorphisms of free groups. Invent. Math., 84(1):91–119, 1986. Samuel Eilenberg and Tudor Ganea. On the Lusternik-Schnirelmann category of abstract groups. Ann. of Math. (2), 65:517–518, 1957. Mark Feighn and Michael Handel. Abelian subgroups of Out(Fn ). Geom. Topol., 13(3):1657–1727, 2009. Mark Feighn and Michael Handel. The recognition theorem for Out(Fn ). Groups Geom. Dyn., 5(1):39–106, 2011. Mark Feighn and Michael Handel. Algorithmic constructions of relative train track maps and CTs. ArXiv e-prints, November 2014. Benson Farb, Alexander Lubotzky, and Yair Minsky. Rank-1 phenomena for mapping class groups. Duke Math. J., 106(3):581–597, 2001. Stefano Francaviglia and Armando Martino. Metric properties of outer space. Publ. Mat., 55(2):433–473, 2011. John L. Harer. The virtual cohomological dimension of the mapping class group of an orientable surface. Invent. Math., 84(1):157–176, 1986. Allen Hatcher. Algebraic topology. Cambridge University Press, Cambridge, 2002. Michael Handel and Lee Mosher. The free splitting complex of a free group II: Loxodromic outer automorphisms. ArXiv e-prints, February 2014. John McCarthy. A “Tits-alternative” for subgroups of surface mapping class groups. Trans. Amer. Math. Soc., 291(2):583–612, 1985. Estelle Souche and Bert Wiest. An elementary approach to quasi-isometries of tree × Rn . In Proceedings of the Conference on Geometric and Combinatorial Group Theory, Part II (Haifa, 2000), volume 95, pages 87–102, 2002. Richard D Wade. Symmetries of free and right-angled Artin groups. PhD thesis, University of Oxford, 2012. Department of Mathematics, University of Utah, 155 S. 1400 E. Salt Lake City, UT 84112 http://www.math.utah.edu/~dwiggles/ E-mail address: dwiggles@math.utah.edu
4math.GR
Catroid: A Mobile Visual Programming System for Children Wolfgang Slany Institute for Software Technology Graz University of Technology Inffeldgasse 16b, 8010 Graz, Austria wolfgang.slany@tugraz.at ABSTRACT Catroid is a free and open source visual programming language, programming environment, image manipulation program, and website. Catroid allows casual and first-time users starting from age eight to develop their own animations and games solely using their Android phones or tablets. Catroid also allows to wirelessly control external hardware such as Lego Mindstorms robots via Bluetooth, Bluetooth Arduino boards, as well as Parrot’s popular and inexpensive AR.Drone quadcopters via WiFi. Categories and Subject Descriptors D.3.m [Programming Languages]: Miscellaneous. General Terms Design, Human Factors, Languages. Keywords Visual Programming Language, Mobile, Smart Phone, Tablet, Programming, Animations, Educational, Games, Music, Kids, Children, Teenagers, Pedagogical. 1. INTRODUCTION Why programming for children? There is a worldwide shortage of qualified software developers. This is due to rapidly increasing demand together with stagnating or even declining number of computer science students. This decline has been even more pronounced for females over the last 25 years, and it seems that even though younger girls can be interested in programming to the same degree as boys of their age, girls consistently seem to lose interest in their late teens [1,2]. At the same time our society increasingly relies on software which is thus less and less understood by the general population. Moreover, software development skills are not only of interest for obvious professional but also for philosophical reasons: Developing software is a skill that helps understanding the fundamental mechanisms and limitations underlying rational thinking. be more attractive to kids than simple text, and the success of MIT’s Scratch programming environment undeniably has proven in practice more than two million times that it is very appealing to kids1. Note that visual programming is not easy but that if children are motivated, they are ready to spend the necessary time: Visual programming is not about dumbing down programming but instead about motivation by avoiding frustration due to, e.g., spurious syntactic mumbo jumbo, unnecessarily complicated work flows, or hard to spot syntax errors as frequently encountered in mainstream programming languages. A drawback of visual programming? Visual programming has been criticized to not scale well to larger and more complex programs. However, practical evidence from visual programming environments shows that large and complex programs such as a 3D chess engine with an AI based machine opponent, multi level jump and run games, complex physics simulations, Sudoku solvers, and much more are possible with a hierarchical organization of program elements. Why mobile devices? Worldwide there are ten times more mobile phones than PCs, and this ratio even is much more pronounced for children (think China and developing countries). Moreover, one’s smartphone nowadays is always in one’s pocket and can easily be used everywhere without preparation, e.g., when commuting to one’s school using public transportation or at the backseat of the family car. Being able to program mobile devices also has become an important job qualification. Cheap smartphones from China are increasingly becoming available on a worldwide scale. Sony Ericsson’s Xperia Play Android smartphone, a PlayStation based portable game console, is particularly attractive to kids. What is visual programming, and why do we use it? Visual programming predominantly consists in moving graphical elements instead of typing text. We use visual programming because, based on informal experiences, it seems aesthetically to Figure 1. Catroid’s “Hello world!” program. 1 http://scratch.mit.edu/ and http://stats.scratch.mit.edu/ (2012-04) Figure 3. Lego Mindstorm robot and user interface visually programmed with Catroid as illustrated in Figure 2. Figure 2. Catroid program for Lego Mindstorm robots. 2. SALIENT FEATURES OF CATROID Catroid runs on smartphones and tablets, is intended for the use by children, and has been strongly inspired by the already mentioned Scratch programming language, environment, and thriving online community1 which were developed by the Lifelong Kindergarten Group at the MIT Media Lab [4,5]. As known from Scratch or Google/MIT’s App Inventor2, Catroid programs are written in a visual Lego-style, where individual commands are stuck together by arranging them visually with one’s fingers. Figure 1 on the left shows Catroid’s “Hello world!” program with the Lego-style bricks sticking together. The result on the screen is shown on the right. The “Speak” brick at the bottom left of Figure 1 additionally pronounces the phrase via Android’s text to speech engine in the default language of one’s Android device. the Android device occurs when first executing the program. The possibilities for creative applications are infinite, especially when attaching the phone to the Lego robot and using the many sensors built into the phone such as acceleration or gyro sensors, or GPS for location based programs. Voice synthesis, voice recognition, as well as image recognition all can equally easily be used to build, e.g., autonomous intelligent soccer-playing robots. Using the similarly controlled Arduino hardware, arbitrary external devices can be controlled using Catroid. Figure 4 on the left shows the main screen of Catroid. On the right a part of the list of bricks that appears when one adds a brick to a script of an object is shown. The top three bricks are used for broadcasting and receiving messages, and the lower ones are used for loops and sprite movements on the screen. New command bricks selected by the user from the list of bricks partly shown in Figure 4 on the right can be visually dragged and dropped using one’s fingers, or deleted by dragging them with one’s fingers to a Catroid also differs in important aspects from Scratch and App Inventor. Compared to both, with Catroid there is no need for a PC – the apps can be written by solely using smartphones or tablets devices. Scratch is intended for PC use with a keyboard, mouse, and comparatively large screen size whereas Catroid focuses on small devices with multi-touch sensitive screens and thereby very different user interaction and usability challenges. As pictures often say more than a thousand words, Figures 2 to 7 show Catroid in action, thereby illustrating some of the features mentioned so far. Even better, as a session with an interactive system often says more than a thousand pictures, I cordially invite the reader to try out the latest version of Catroid3. Figure 2 shows parts of a Catroid program that allows controlling a Lego Mindstorm robot. On the left a list of sprite objects is shown, each possessing its own scripts and images. On the right scripts are shown that are associated with object “turn left” which is the one at the bottom on the screenshot on the left. Figure 3 shows the resulting user interface and the robot. The necessary Bluetooth connection handshake between the robot and 2 http://appinventor.mit.edu/ 3 http://code.google.com/p/catroid/ Figure 4. Main screen of Catroid and typical command bricks. Figure 5. Parrot’s AR.Drone quadcopter controlled via WiFi by a user’s program written using Catroid. waste basket. Figure 5 shows how Parrot’s popular and inexpensive AR.Drone quadcopter can be controlled from Catroid via WiFi. The quadcopter has two video cameras that transmit their data to Catroid for image processing. Catroid uses Intel’s OpenCV computer vision open source library running as a service on the Android device to follow simple patterns such as the helipad in the photo on the left side of Figure 5. A video showing how it follows the moving helipad is available at http://goo.gl/1CcBK. Being able to quickly use such powerful but very simple to use features is a tremendous motivator to acquire the necessary programming skills for users of all age. Figure 6 shows Catroid running on Sony Ericsson’s Xperia Play Android smartphone, a PlayStation based portable game console. We plan to support the gamepad keys of such phones in the near future. Parents will most likely be much more willing to buy such gaming smartphones for their kids when they know that their children will not only be able to play games but moreover also be empowered to creatively build their own games, animations, simulations, or other programs. Figure 7 shows the screen one sees when executing a Hannah Montana interactive music video animation programmed with Catroid which was created by children (it is a remix from an original Scratch project that can be found at http://scratch.mit.edu/projects/tyster/443306). Creating interactive music video animations is tremendously motivating both for boys but equally for girls even though a lot of programming is required and kids can spend days on their creations. Being able to upload such animations as videos to YouTube is an additional strong motivator as kids in general love to show off their creations to their friends regardless of what mobile phone or PC their friends are using. A YouTube recorder for Catroid programs is currently being developed, and kids will soon be able to upload their videos to YouTube in high quality. In order to allow the recording also on low-end Android devices and to decrease the amount of data that needs to be uploaded from one’s Android device, only the play data is transmitted from the phone to our server. It then will be interpreted on our server in exactly the same way with the same user interaction and additional input such as random seeds. Our server records it in high quality and optionally uploads it directly to YouTube. Similar to Scratch, Catroid is an interpreted programming language with a procedural control flow. Objects communicate via simple broadcast messages (see Figure 4 on the right) and Figure 6. Sony Ericsson’s Xperia Play Android smartphone, a PlayStation based portable game console. have a set of scripts that are all excecuted concurrently, with each script running in its own thread, thus allowing real parallelism to take advantage of the multiple cores of recent smartphones. Because children easily can think in terms of objects, actors, and messages, this style of multi-threading and process synchronization feels totally natural to them. The main design objective of the language is to make it as simple to understand and use as possible. The current version of Catroid as of March 2012 is not yet a full programming language as, e.g., no variables and formulas are supported at this time, though we are working hard to extend it in that direction. The project started in April 2010 with a small team. Our aim was to quickly produce a working partial solution with the most important features implemented first, and contuinue from there on. We started to implement some minimal functionality that is sufficient to emulate the highly popular creativity tool Flipnote4 that is preinstalled on many Nintendo DSi game consoles: Only a background image that can change according to a prespecified timeline while an audio file is playing. We then went on to implement the bricks most used in Scratch programs around the Figure 7. Interactive music video animation. 4 http://flipnote.hatena.com/ 4. RELATED WORK There is a plethora of research papers about visual programming: The ACM digital library lists more than 14,000 papers about the topic, and Google scholar reports more than 20,000 documents related to visual programming. I limit myself here to previous work regarding visual programming languages intended for the use by children, and in this set of languages to those featuring community sites supporting and encouraging the sharing of interactive animations and/or games created by kids. Beside Scratch and Catroid, other visual programming systems (with varying expressive power of the language) include those associated with Nintendo’s Wario Ware D.I.Y.6, Microsoft’s Kodu7 [3], Flipnote Hatena8, and Game Maker9 [6]. YouTube can also be seen as a platform to share user contributed multimedia content though it is not primarily oriented towards children and the contributed content cannot be made interactive. 5. ACKNOWLEDGMENTS My thanks to the team members and supporters of Catroid10. Figure 8. Catroid’s online community website. world, based on statistics published on the Scratch website5. All of those are now implemented, and a lot more are currently being implemented to eventually make Catroid a general programming language. 3. CATROID’S COMMUNITY WEBSITE The Catroid system includes a community website allowing children to upload and share their projects with others. It is an important and integral part of our Catroid system. All projects uploaded to the community website are open source and published under a free software license. Everyone can download and edit every project from the website, add new functionality or change the current behavior of the project, and upload the new version again. This is called “remixing” and was a core idea behind the Scratch online community [5][5]. See Figure 8 for some images of the community website on a smartphone. On the left a list of projects on Catroid’s community website is shown. On the right the details page of a project is shown. From there the project can be downloaded directly into Catroid or reported as inappropriate, as not all inappropriate content can automatically be detected. Regarding the latter, names of projects, descriptions, comments, and user names are compared to an extensive multilingual set of cuss words as well as their creative spelling variations and, when recognized, automatically rejected. In order to serve the needs of children on a worldwide scale, both the smartphone parts as well as the website of Catroid are available in many languages. A crowd sourcing localization / internationalization support site based on Pootle allows adding further languages. We currently support several languages, with speakers of English, Mandarin, Cantonese, Hindi, Arabian, German, Turkish, French, Japanese, Urdu, Russian, Rumanian, and Malaysian in the team. 5 http://stats.scratch.mit.edu/community/blocks.html 6. REFERENCES [1] Craig, M., and Horton, D. Gr8 designs for Gr8 girls: a middle-school program and its evaluation. In Proceedings of the 40th ACM technical symposium on Computer science education (SIGCSE’09) (Chattanooga, Tennessee, March 37, 2009). ACM Press, New York, NY, 2009, 221-225. [2] Kelleher, C. Motivating Programming: Using storytelling to make computer programming attractive to middle school girls. Ph.D. Thesis, Carnegie Mellon University, School of Computer Science Technical Report CMU-CS-06-171, 2006. [3] MacLaurin, M. B. The design of Kodu: a tiny visual programming language for children on the Xbox 360. In Proceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming language (POPL '11). ACM Press, New York, NY, 2011, 241-246. [4] Maloney, J., Resnick, M., Rusk, N., Silverman, B., and Eastmond, E. The Scratch Programming Language and Environment. ACM Trans. Comp. Edu., 10, 4 (Nov. 2010), 16:1-16:15. [5] Monroy-Hernández, A. Designing a website for creative learning. In: Proceedings of the Web Science 09: Society OnLine (WebSci'09) (Athens, Greece, March 18-20, 2009). [6] Overmars, M. Teaching computer science through game design. Computer , 37 (4). IEEE, 2004, 81-83. 6 http://www.wariowarediy.com/ 7 http://www.ditii.com/2011/03/03/kodu-with-community-gamesharing-released/ 8 http://flipnote.hatena.com/ 9 http://www.yoyogames.com/ 10 http://code.google.com/p/catroid/wiki/Credits
6cs.PL
Scheduling Distributed Clusters of Parallel Machines : Primal-Dual and LP-based Approximation Algorithms [Full Version] ∗ Riley Murray1 , Samir Khuller2 , and Megan Chao3 1 arXiv:1610.09058v1 [cs.DS] 28 Oct 2016 2 3 Department of Industrial Engineering & Operations Research, University of California, Berkeley Berkeley, CA 94709, USA rjmurray@berkeley.edu Department of Computer Science, University of Maryland, College Park College Park, MD 20742, USA samir@cs.umd.edu Department of Electrical Engineering & Computer Science, Massachusetts Institute of Technology 50 Vassar St, Cambridge, MA 02142, USA megchao@mit.edu Abstract The Map-Reduce computing framework rose to prominence with datasets of such size that dozens of machines on a single cluster were needed for individual jobs. As datasets approach the exabyte scale, a single job may need distributed processing not only on multiple machines, but on multiple clusters. We consider a scheduling problem to minimize weighted average completion time of n jobs on m distributed clusters of parallel machines. In keeping with the scale of the problems motivating this work, we assume that (1) each job is divided into m “subjobs” and (2) distinct subjobs of a given job may be processed concurrently. When each cluster is a single machine, this is the NP-Hard concurrent open shop problem. A clear limitation of such a model is that a serial processing assumption sidesteps the issue of how different tasks of a given subjob might be processed in parallel. Our algorithms explicitly model clusters as pools of resources and effectively overcome this issue. Under a variety of parameter settings, we develop two constant factor approximation algorithms for this problem. The first algorithm uses an LP relaxation tailored to this problem from prior work. This LP-based algorithm provides strong performance guarantees. Our second algorithm exploits a surprisingly simple mapping to the special case of one machine per cluster. This mapping-based algorithm is combinatorial and extremely fast. These are the first constant factor approximations for this problem. Remark - A shorter version of this paper (one that omitted several proofs) appeared in the proceedings of the 2016 European Symposium on Algorithms. 1998 ACM Subject Classification F.2.2 Nonnumerical Algorithms and Problems Keywords and phrases approximation algorithms, distributed computing, machine scheduling, LP relaxations, primal-dual algorithms Digital Object Identifier 10.4230/LIPIcs.ESA.2016.234 ∗ All authors conducted this work at the University of Maryland, College Park. This work was made possible by the National Science Foundation, REU Grant CCF 1262805, and the Winkler Foundation. This work was also partially supported by NSF Grant CCF 1217890. © Riley Murray, Samir Khuller, Megan Chao; licensed under Creative Commons License CC-BY 24rd Annual European Symposium on Algorithms (ESA 2016). Editors: Piotr Sankowski and Christos Zaroliagis; Article No. 234; pp. 234:1–234:18 Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany 234:2 Scheduling Distributed Clusters of Parallel Machines [Full Version] 1 Introduction It is becoming increasingly impractical to store full copies of large datasets on more than one data center [6]. As a result, the data for a single job may be located not on multiple machines, but on multiple clusters of machines. To maintain fast response-times and avoid excessive network traffic, it is advantageous to perform computation for such jobs in a completely distributed fashion [7]. In addition, commercial platforms such as AWS Lambda and Microsoft’s Azure Service Fabric are demonstrating a trend of centralized cloud computing frameworks in which the user manages neither data flow nor server allocation [1, 10]. In view of these converging issues, the following scheduling problem arises: If computation is done locally to avoid excessive network traffic, how can individual clusters on the broader grid coordinate schedules for maximum throughput? This was precisely the motivation for Hung, Golubchik, and Yu in their 2015 ACM Symposium on Cloud Computing paper [7]. Hung et al. modeled each cluster as having an arbitrary number of identical parallel machines, and choose an objective of average job completion time. As such a problem generalizes the NP-Hard concurrent open shop problem, they proposed a heuristic approach. Their heuristic (called “SWAG”) runs in O(n2 m) time and performed well on a variety of data sets. Unfortunately, SWAG offers poor worst-case performance, as we show in Section 5. Our contributions to this problem are to extend the model considered by Hung et al. and to introduce the first constant-factor approximation algorithms for this general problem. Our extensions of Hung et al.’s model are (1) to allow different machines within the same cluster to operate at different speeds, (2) to incorporate pre-specified “release times” (times before which a subjob cannot be processed), and (3) to support weighted average job completion time. We present two algorithms for the resulting problem. Our combinatorial algorithm exploits a surprisingly simple mapping to the special case of one machine per cluster, where the problem can be approximated in O(n2 + nm) time. We also present an LP-rounding approach with strong performance guarantees. E.g., a 2-approximation when machines are of unit speed and subjobs are divided into equally sized (but not necessary unit) tasks. 1.1 Formal Problem Statement I Definition 1 (Concurrent Cluster Scheduling). . There is a set M of m clusters, and a set N of n jobs. For each job j ∈ N , there is a set of m “subjobs” (one for each cluster). Cluster i ∈ M has mi parallel machines, and machine ` in cluster i has speed v`i . Without loss of generality, assume v`i is decreasing in `. 1 The ith subjob for job j is specified by a set of tasks to be performed by machines in cluster i, denote this set of tasks Tji . For each task t ∈ Tji , we have an associated processing time pjit (again w.l.o.g., assume pjit is decreasing in t). We will frequently refer to “the subjob of job j at cluster i” as “subjob (j, i).” Different subjobs of the same job may be processed concurrently on different clusters. Different tasks of the same subjob may be processed concurrently on different machines within the same cluster. 1 Where we write “decreasing”, we mean “non-increasing.” Where we write “increasing”, we mean “non-decreasing”. R. Murray, S. Khuller, and M. Chao 234:3 A subjob is complete when all of its tasks are complete, and a job is complete when all of its subjobs are complete. We denote a job’s completion time by “Cj ”. The objective is to minimize weighted average job completion time (job j has weight wj ). P For the purposes of computing approximation ratios, it is equivalent to minimize wj Cj . We work with this equivalent objective throughout this paper. A machine is said to operate at unit speed it if can complete a task with processing requirement “p” in p units of time. More generally, a machine with speed “v” (v ≥ 1) processes the same task in p/v units of time. Machines are said to be identical if they are all of unit speed, and uniform if they differ only in speed. In accordance with Graham et al.’s α|β|γ taxonomy for scheduling problems [5] we take α = CC to refer to the concurrent cluster environment, and denote our problem by P CC|| wj Cj .2 Optionally, we may associate a release time rji to every subjob. If any P subjobs are released after time zero, we write CC|r| wj Cj . 1.1.1 Example Problem Instances We now illustrate our model with several examples (see Figures 1 and 2). The tables at left have rows labeled to identify jobs, and columns labeled to identify clusters; each entry in these tables specifies the processing requirements for the corresponding subjob. The diagrams to the right of these tables show how the given jobs might be scheduled on clusters with the indicated number of machines. Figure 1 Two examples of our scheduling model. Left: Our baseline example. There are 4 jobs and 2 clusters. Cluster 1 has 2 identical machines, and cluster 2 has 3 identical machines. Note that job 4 has no subjob for cluster 1 (this is permitted within our framework). In this case every subjob has at most one task. Right: Our baseline example with a more general subjob framework : subjob (2,2) and subjob (3,1) both have two tasks. The tasks shown are unit length, but our framework does not require that subjobs be divided into equally sized tasks. 1.2 Related Work Concurrent cluster scheduling subsumes many fundamental machine scheduling problems. For example, if we restrict ourselves to a single cluster (i.e. m = 1) we can schedule a set of jobs on a bank of identical parallel machines to minimize makespan (Cmax ) or total P weighted completion time ( wj Cj ). With a more clever reduction, we can even minimize P total weighted lateness ( wj Lj ) on a bank of identical parallel machines (see Section 6). Alternatively, with m > 1 but ∀i ∈ M, mi = 1, our problem reduces to the well-studied “concurrent open shop” problem. 2 A problem α|β|γ implies a particular environment α, objective function γ, and optional constraints β. ESA 2016 234:4 Scheduling Distributed Clusters of Parallel Machines [Full Version] Figure 2 Two additional examples of our model. Left: Our baseline example, with variable machine speeds. Note that the benefit of high machine speeds is only realized for tasks assigned to those machines in the final schedule. Right: A problem with the peculiar structure that (1) all clusters but one have a single machine, and (2) most clusters have non-zero processing requirements for only a single job. We will use such a device for the total weighted lateness reduction in Section 6. Using Graham et al.’s taxonomy, the concurrent open shop problem is written as P P D|| wj Cj . Three groups [2, 3, 8] independently discovered an LP-based 2-approximation P for P D|| wj Cj using the work of Queyranne [11]. The linear program in question has an exponential number of constraints, but can still be solved in polynomial time with a variant of the Ellipsoid method. Our “strong” algorithm for concurrent cluster scheduling refines the techniques contained therein, as well as those of Schulz [13, 14] (see Section 4). P Mastrolilli et al. [9] developed a primal-dual algorithm for P D|| wj Cj that does not use LP solvers. “MUSSQ”3 is significant for both its speed and the strength of its performance guarantee : it achieves an approximation ratio of 2 in only O(n2 + nm) time. Although MUSSQ does not require an LP solver, its proof of correctness is based on the fact that it finds a feasible solution to the dual a particular linear program. Our “fast” algorithm for concurrent cluster scheduling uses MUSSQ as a subroutine (see Section 5). Hung, Golubchik, and Yu [7] presented a framework designed to improve scheduling across geographically distributed data centers. The scheduling framework had a centralized scheduler (which determined a job ordering) and local dispatchers which carried out a schedule consistent with the controllers job ordering. Hung et al. proposed a particular algorithm for the controller called “SWAG.” SWAG performed well in a wide variety of simulations where each data center was assumed to have the same number of identical parallel machines. We adopt a similar framework to Hung et al., but we show in Section 5.1 that SWAG has no constant-factor performance guarantee. 1.3 Paper Outline & Algorithmic Results Although only one of our algorithms requires solving a linear program, both algorithms use the same linear program in their proofs of correctness; we introduce this linear program in Section 2 before discussing either algorithm. Section 3 establishes how an ordering of jobs can be processed to completely specify a schedule. This is important because the complex work in both of our algorithms is to generate an ordering of jobs for each cluster. Section 4 introduces our “strong” algorithm: CC-LP. CC-LP can be applied to any instance of concurrent cluster scheduling, including those with non-zero release times rji . A key in CC-LP’s strong performance guarantees lay in the fact that it allows different permutations of subjobs for different clusters. By providing additional structure to the problem (but while maintaining a generalization of concurrent open shop) CC-LP becomes a 3 A permutation of the author’s names: Mastrolilli, Queyranne, Schulz, Svensson, and Uhan. R. Murray, S. Khuller, and M. Chao 234:5 2-approximation. This is significant because it is NP-Hard to approximate concurrent open shop (and by extension, our problem) with ratio 2 −  for any  > 0 [12]. Our combinatorial algorithm (“CC-TSPT”) is presented in Section 5. The algorithm is fast, provably accurate, and has the interesting property that it can schedule all clusters using the same permutation of jobs.4 After considering CC-TSPT in the general case, we show how fine-grained approximation ratios can be obtained in the “fully parallelizable” setting of Zhang et al. [16]. We conclude with an extension of CC-TSPT that maintains performance guarantees while offering improved empirical performance. The following table summarizes our results for approximation ratios. For compactness, condition Id refers to identical machines (i.e. v`i constant over `), condition A refers to rji ≡ 0, and condition B refers to pjit constant over t ∈ Tji . CC-LP CC-TSPT (Id, A, B) 2 3 (Id, ¬A, B) 3 - (Id, A, ¬B) 3 3 (Id, ¬A, ¬B) 4 - (¬Id, A) 2+R 2+R (¬Id, ¬A) 3+R - The term R is the maximum over i of Ri , where Ri is the ratio of fastest machine to average machine speed at cluster i. The most surprising of all of these results is that our scheduling algorithms are remarkably simple. The first algorithm solves an LP, and then the scheduling can be done easily on each cluster. The second algorithm is again a rather surprising simple reduction to the case of one machine per cluster (the well understood concurrent open shop problem) and yields a simple combinatorial algorithm. The proof of the approximation guarantee is somewhat involved however. In addition to algorithmic results, we demonstrate how our problem subsumes that of minimizing total weighted lateness on a bank of identical parallel machines (see Section 6). Section 7 provides additional discussion and highlights our more novel technical contributions. 2 The Core Linear Program Our linear program has an unusual form. Rather than introduce it immediately, we conduct a brief review of prior work on similar LP’s. All the LP’s we discuss in this paper have P wj Cj , where Cj is a decision variable corresponding to the completion objective function time of job j, and wj is a weight associated with job j. For the following discussion only, we adopt the notation in which job j has processing time pj . In addition, if multiple machine problems are discussed, we will say that there are m such machines (possibly with speeds si , i ∈ {1, . . . , m}). The earliest appearance of a similar linear program comes from Queyranne [11]. In his paper, Queyranne presents an LP relaxation for sequencing n jobs on a single   machine 2 P P P 1 2 where all constraints are of the form j∈S pj Cj ≥ 2 + j∈S pj where S is j∈S pj an arbitrary subset of jobs. Once a set of optimal {Cj? } is found, the jobs are scheduled in increasing order of {Cj? }. These results were primarily theoretical, as it was known at his P time of writing that sequencing n jobs on a single machine to minimize wj Cj can be done optimally in O(n log n) time. 4 We call such schedules “single-σ schedules.” As we will see later on, CC-TSPTPserves as a constructive proof of existence of near-optimal single-σ schedules for all instances of CC|| wj Cj , including those instances for which single-σ schedules are strictly sub-optimal. This is addressed in Section 7. ESA 2016 234:6 Scheduling Distributed Clusters of Parallel Machines [Full Version] Queyranne’s constraint set became particularly useful for problems with coupling across distinct machines (as occurs in concurrent open shop). Four separate groups [2, 3, 8, 9] saw this and used the following LP in a 2-approximation for concurrent open shop scheduling.   2 P X P P 1 2 (LP0) min wj Cj s.t. p C ≥ ∀ S⊆N p + p ji j ji j∈S j∈S j∈S ji i∈M 2 j∈N In view of its tremendous popularity, we sometimes refer to the linear program above as the canonical relaxation for concurrent open shop. Andreas Schulz’s Ph.D. thesis developed Queyranne’s constraint set in greater depth [13]. As part of his thesis, Schulz considered scheduling n jobs on m identical parallel machines with P 2 P P 1 constraints of the form j∈S pj Cj ≥ 2m + 12 j∈S p2j . In addition, Schulz showed p j∈S j   2 P  Pm −1 P P 2 that the constraints j∈S pj Cj ≥ 2 i=1 si + j∈S pj are satisfied by j∈S pj any schedule of n jobs on m uniform machines. In 2012, Schulz refined the analysis for several of these problems [14]. For constructing a schedule from the optimal {Cj? }, Schulz considered scheduling jobs by increasing order of {Cj? }, {Cj? − pj /2}, and {Cj? − pj /(2m)}. 2.1 Statement of LP1 The model we consider allows for more fine-grained control of the job structure than is indicated by the LP relaxations above. Inevitably, this comes at some expense of simplicity in LP formulations. In an effort to simplify notation, we define the following constants, and give verbal interpretations for each. . Pmi µi = `=1 v`i . qji = min {|Tji |, mi } . Pqji µji = `=1 v`i . P pji = t∈Tji pjit (1) From these definitions, µi is the processing power of cluster i. For subjob (j, i), qji is the maximum number of machines that could process the subjob, and µji is the maximum processing power than can be brought to bear on the same. Lastly, pji is the total processing requirement of subjob (j, i). In these terms, the core linear program, LP1, is as follows. (LP1) min s.t. (1A) P j∈N P wj Cj j∈S pji Cj ≥ 1 2  P j∈S pji 2 /µi + P 2 j∈S pji /µji (1B) Cj ≥ pjit /v1i + rji ∀i ∈ M, j ∈ N, t ∈ Tji (1C) Cj ≥ pji /µji + rji ∀j ∈ N, i ∈ M  ∀S ⊆ N, i ∈ M Constraints (1A) are more carefully formulated versions of the polyhedral constraints introduced by Queyranne [11] and developed by Schulz [13]. The use of µji term is new and allows us to provide stronger performance guarantees for our framework where subjobs are composed of sets of tasks. As we will see, this term is one of the primary factors that allows us to parametrize results under varying machine speeds in terms of maximum to average machine speed, rather than maximum to minimum machine speed. Constraints (1B) and (1C) are simple lower bounds on job completion time. The majority of this section is dedicated to proving that LP1 is a valid relaxation of P CC|r| wj Cj . Once this is established, we prove the that LP1 can be solved in polynomial time by providing a separation oracle with use in the Ellipsoid method. Both of these proofs use techniques established in Schulz’s Ph.D. thesis [13]. R. Murray, S. Khuller, and M. Chao 2.2 234:7 Proof of LP1’s Validity The lemmas below establish the basis for both of our algorithms. Lemma 2 generalizes an inequality used by Schulz [13]. Lemma 3 relies on Lemma 2 and cites an inequality mentioned in the preceding section (and proven by Queyranne [11]). I Lemma 2. Let {a1 , . . . az } be a set of non-negative real numbers. We assume that k ≤ z of them are positive. Let bi be a set of decreasing positive real numbers. Then P  Pz Pz 2 k 2 a /b ≥ ( a ) / b . i i i i=1 i i=1 i=1 Proof. 5 We only show the case where k = z. Define a = ∈ Rk+ , b = [b1 , . . . , bk ] ∈ √ [a1 , . . . , ak ] √ k R++ , and 1 as the vector of k ones. Now, set u = a/ b and w = b (element-wise), and Pk note that ha, 1i = hu, wi. In these terms, it is clear that ( i=1 ai )2 = hu, wi2 . Given this, one need only cite Cauchy-Schwarz (namely, hu, wi2 ≤ hu, ui · hw, wi) and plug in the definitions of u and w to see the desired result. J P I Lemma 3 (Validity Lemma). Every feasible schedule for an instance I of CC|r| wj Cj has completion times that define a feasible solution to LP1(I). Proof. As constraints (1B) and (1C) are clear lower bounds on job completion time, it suffices to show the validity of constraint (1A). Thus, let S be a non-empty subset of N , and fix an arbitrary but feasible schedule “F ” for I. F Define Cji as the completion time of subjob (j, i) under schedule F . Similarly, define F Cji` as the first time at which tasks of subjob (j, i) scheduled on machine ` of cluster i are finished. Lastly, define p`ji as the total processing requirement of job j scheduled on F F machine ` of cluster i. Note that by construction, we have Cji = max`∈{1,...,mi } Cji` and P m i F CjF = maxi∈M Cji . Since pji = `=1 p`ji , we can rather innocuously write Pmi `  F P P F (2) j∈S pji Cji = j∈S `=1 pji Cji . F F But using Cji ≥ Cji` , we can lower-bound F pji Cji . Namely,  `  F Pmi P P P Pmi ` F F (3) j∈S pji Cji ≥ j∈S `=1 pji Cji` = `=1 v`i j∈S pji /v`i Cji`  `  F P The next inequality uses a bound on j∈S  pji /v`i Cji` proven by Queyranne [11] for any subset S of N jobs with processing times p`ji /v`i to be scheduled on a single machine.6  `  F j∈S pji /v`i Cji` ≥ P 1 2  P P j∈S   ` 2 P  ` 2 + j∈S pji /v`i j∈S pji /v`i Combining inequalities (3) and (4), we have the following.    ` 2 P  ` 2 P P 1 Pmi F v`i + j∈S pji /v`i j∈S pji /v`i j∈S pji Cji ≥ 2 `=1   2  P Pmi 1 Pmi P ` ` 2 ≥ /v`i + j∈S `=1 pji /v`i `=1 j∈S pji 2 5 6 (4) (5) (6) The proceedings version of this paper stated that the proof cites the AM-GM inequality and proceeds by induction from z = k = 2. We have opted here to demonstrate a different (simpler) proof that we discovered only after the proceedings version was finalized. Here, our machine is machine ` on cluster i. ESA 2016 234:8 Scheduling Distributed Clusters of Parallel Machines [Full Version] Next, we apply Lemma 2 to the right hand side of inequality (6) a total of |S| + 1 times. 2 P P 2 2 P Pmi P mi mi P ` ` v = p p / /µi (7) p /v ≥ `i ji `i `=1 j∈S `=1 j∈S ji `=1 j∈S ji   P P Pmi qji mi ` 2 ` 2 / `=1 v`i = p2ji /µji ∀ j ∈ S (8) /v`i ≥ `=1 pji `=1 pji F , we arrive at the desired result. Citing CjF ≥ Cji   2 P P P 1 F 2 p C ≥ p /µ + p /µ i ji j∈S ji j j∈S ji j∈S ji 2 “constraint (1A)” (9) J 2.3 Theoretical Complexity of LP1 As the first of our two algorithms requires solving LP1 directly, we need to address the fact that LP1 has m · (2n − 1) + n constraints. Luckily, it is still possible to such solve linear programs in polynomial time with the Ellipsoid method; we introduce the following separation oracle for this purpose. I Definition 4 (Oracle LP1). Define the violation   2 P P 1 P 2 V (S, i) = p /µ + p /µ i ji − j∈S ji j∈S ji j∈S pji Cj 2 (10) Let {Cj } ∈ Rn be a potentially feasible solution to LP1. Let σi denote the ordering when jobs are sorted in increasing order of Cj − pji /(2µji ). Find the most violated constraint in (1A) for i ∈ M by searching over V (Si , i) for Si of the form {σi (1), . . . , σi (j −1), σi (j)}, j ∈ {1, . . . , n}. If any of maximal V (Si∗ , i) > 0, then return (Si∗ , i) as a violated constraint for (1A). Otherwise, check the remaining n constraints ((1B) and (1C)) directly in linear time. For fixed i, Oracle-LP1 finds the subset of jobs that maximizes “violation” for cluster i. That is, Oracle-LP1 finds Si∗ such that V (Si∗ , i) = maxS⊂N V (S, i). We prove the correctness of Oracle-LP1 by establishing a necessary and sufficient condition for a job j to be in Si∗ . . P I Lemma 5. For Pi (A) = j∈A pji , we have x ∈ Si∗ ⇔ Cx − pxi /(2µxi ) ≤ Pi (Si∗ )/µi . Proof. For given S (not necessarily equal to Si∗ ), it is useful to express V (S, i) in terms of V (S ∪ x, i) or V (S \ x, i) (depending on whether x ∈ S or x ∈ N \ S). Without loss of generality, we restrict our search to S : x ∈ S ⇒ px,i > 0. Suppose x ∈ S. By writing Pi (S) = Pi (S \ x) + Pi (x), and similarly decomposing the P sum j∈S p2ji /(2µji ), one can show the following.     1 2Pi (S) − pxi pxi V (S, i) =V (S \ x, i) + pxi + − Cx (11) 2 µi µxi Now suppose x ∈ N \ S. In the same strategy as above (this time writing Pi (S) = Pi (S ∪ x) − Pi (x)), one can show that    1 2Pi (S) + pxi pxi V (S, i) =V (S ∪ x, i) + pxi Cx − + . (12) 2 µi µxi Note that Equations (11) and (12) hold for all S, including S = Si∗ . Turning our attention to Si∗ , we see that x ∈ Si∗ implies that the second term in Equation (11) is non-negative, i.e. Cx − pxi /(2µxi ) ≤ (2Pi (Si∗ ) − pxi ) /(2µi ) < Pi (Si∗ )/µi . (13) R. Murray, S. Khuller, and M. Chao 234:9 Similarly, x ∈ N \ Si∗ implies the second term in Equation (12) is non-negative. Cx − pxi /(2µxi ) ≥ (2Pi (Si∗ ) + pxi ) /(2µi ) ≥ Pi (Si∗ )/µi It follows that x ∈ Si∗ iff Cx − pxi /(2µxi ) < Pi (Si∗ )/µi . (14) J Given Lemma 5, It is easy to verify that sorting jobs in increasing order of Cx − pxi /(2µxi ) to define a permutation σi guarantees that Si∗ is of the form {σi (1), . . . , σi (j − 1), σi (j)} for some j ∈ N . This implies that for fixed i, Oracle-LP1 finds Si∗ in O(n log(n)) time. This procedure is executed once for each cluster, leaving the remaining n constraints in (1B) and (1C) to be verified in linear time. Thus Oracle-LP1 runs in O(mn log(n)) time. By the equivalence of separation and optimization, we have proven the following theorem: I Theorem 6. LP1(I) is a valid relaxation of I ∈ ΩCC , and is solvable in polynomial time. As was explained in the beginning of this section, linear programs such as those in [2, 3, 8, 11, 13, 14] are processed with an appropriate sorting of the optimal decision variables {Cj? }. It is important then to have bounds on job completion times for a particular ordering of jobs. We address this next in Section 3, and reserve our first algorithm for Section 4. 3 List Scheduling from Permutations The complex work in both of our proposed algorithms is to generate a permutation of jobs. The procedure below takes such a permutation and uses it to determine start times, end times, and machine assignments for every task of every subjob. List-LPT : Given a single cluster with mi machines and a permutation of jobs σ, introduce . List(a, i) = (pai1 , pai2 , . . . , pai|Tai | ) as an ordered set of tasks belonging to subjob (a, i), . ordered by longest processing time first. Now define List(σ) = List(σ(1), i) ⊕ List(σ(2), i) ⊕ · · · ⊕ List(σ(n), i), where ⊕ is the concatenation operator. Place the tasks of List(σ) in order- from the largest task of subjob (σ(1), i), to the smallest task of subjob (σ(n), i). When placing a particular task, assign it whichever machine and start time results in the task being completed as early as possible (without moving any tasks which have already been placed). Insert idle time (on all mi machines) as necessary if this procedure would otherwise start a job before its release time. The following Lemma is essential to bound the completion time of a set of jobs processed by List-LPT. The proof is adapted from Gonzalez et al. [4]. I Lemma 7. Suppose n jobs are scheduled on cluster i according to List-LPT(σ). Then for . v¯i = µi /mi , the completion time of subjob (σ(j), i) (denoted Cσ(j)i ) satisfies Cσ(j)i ≤ max rσ(k)i + pσ(j)i1 /v¯i + 1≤k≤j P j k=1  pσ(k)i − pσ(j)i1 /µi (15) Proof. For now, assume all jobs are released at time zero. Let the task of subjob (σ(j), i) to finish last be denoted t∗ . If t∗ is not the task in Tσ(j)i with least processing time, then 0 construct a new set Tσ(j)i = {t : pσ(j)it∗ ≤ pσ(j)it } ⊂ Tσ(j)i . Because the tasks of subjob (σ(j), i) were scheduled by List-LPT (i.e. longest-processing-time-first), the sets of potential start times and machines for task t∗ (and hence the set of potential completion times for ESA 2016 234:10 Scheduling Distributed Clusters of Parallel Machines [Full Version] task t∗ ) are the same regardless of whether subjob (σ(j), i) consisted of tasks Tσ(j)i or the 0 0 subset Tσ(j)i . Accordingly, reassign Tσ(j)i ← Tσ(j)i without loss of generality. Let D`j denote the total demand for machine ` (on cluster i) once all tasks of subjobs (σ(1), i) through (σ(j − 1), i) and all tasks in the set Tσ(j)i \ {t∗ } are scheduled. Using the fact that Cσ(j)i v`i ≤ (D`j + pσ(j)it∗ )∀` ∈ {1, . . . , mi }, sum the left and right and sides over Pmi j Pmi D` . Dividing by the sum of machine `. This implies Cσ(j)i ( `=1 v`i ) ≤ mi pσ(j)it∗ + `=1 speeds and using the definition of µi yields P  Pmi j j Cσ(j)i ≤ mi pσ(j)it∗ /µi + `=1 D` /µi ≤ pσ(j)i1 /v¯i + p − p σ(j)i1 /µi (16) k=1 σ(k)i where we estimated pσ(j)it∗ upward by pσ(j)i1 . Inequality (16) completes our proof in the case when rji ≡ 0. Now suppose that some rji > 0. We take our policy to the extreme and suppose that all machines are left idle until every one of jobs σ(1) through σ(j) are released; note that this occurs precisely at time max1≤k≤j rσ(k)i . It is clear that beyond this point in time, we are effectively in the case where all jobs are released at time zero, hence we can bound the remaining time to completion by the right hand side of Inequality 16. As Inequality 15 simply adds these two terms, the result follows. J Lemma 7 is cited directly in the proof of Theorem 8 and Lemma 13. Lemma 7 is used implicitly in the proofs of Theorems 9, 10, and 15. 4 An LP-based Algorithm In this section we show how LP1 can be used to construct near optimal schedules for concurrent cluster scheduling both when rji ≡ 0 and when some rji > 0. Although solving LP1 is somewhat involved, the algorithm itself is quite simple: P Algorithm CC-LP : Let I = (T, r, w, v) denote an instance of CC|r| wj Cj . Use the optimal solution {Cj? } of LP1(I) to define m permutations {σi : i ∈ M } which sort jobs in increasing order of Cj? − pji /(2µji ). For each cluster i, execute List-LPT(σi ). Each theorem in this section can be characterized by how various assumptions help us cancel an additive term7 in an upper bound for the completion time of an arbitrary subjob (x, i). Theorem 8 is the most general, while Theorem 10 is perhaps the most surprising. 4.1 CC-LP for Uniform Machines I Theorem 8. Let Ĉj be the completion time of job j using algorithm CC-LP, and let R be P P as in Section 1.3. If rji ≡ 0, then j∈N wj Ĉj ≤ (2 + R) OP T . Otherwise, j∈N wj Ĉj ≤ (3 + R) OP T . Proof. For y ∈ R, define y + = max{y, 0}. Now let x ∈ N be arbitrary, and let i ∈ M be such that pxi > 0 (but otherwise arbitrary). Define t∗ as the last task of job x to complete on cluster i, and let ji be such that σi (ji ) = x. Lastly, denote the optimal LP solution {Cj }.8 Because {Cj } is a feasible solution to LP1, constraint (1A) implies the following (set 7 8 “+pxit∗ ”; see associated proofs. We omit the customary ? to avoid clutter in notation. R. Murray, S. Khuller, and M. Chao 234:11 Si = {σi (1), . . . , σi (ji − 1), x}) P ji k=1 pσi (k)i 2µi 2 ≤ ji X k=1     ji pσi (k)i pxi X pσi (k)i Cσi (k) − ≤ Cx − pσi (k)i 2µσi (k)i 2µxi (17) k=1 Pji pσi (k)i /µi ≤ 2Cx − pxi /µxi . which in turn implies k=1 If all subjobs are released at time zero, then we can combine this with Lemma 7 and P the fact that pxit∗ ≤ pxi = t∈Txi pxit to see the following (the transition from the first inequality the second inequality uses Cx ≥ pxit∗ /v1i and Ri = v1i /v̄i ). Ĉxi ≤ 2Cx − pxi pxit∗ pxit∗ + + − ≤ Cx (2 + [Ri (1 − 2/mi )] ) µxi v̄i µi (18) When one or more subjobs are released after time zero, Lemma 7 implies that it is  sufficient to bound max rσi (k)i by some constant multiple of Cx . Since σi is defined by 1≤k≤ji . increasing Lji = Cj − pji /(2µji ), Lσi (a)i ≤ Lσi (b)i implies rσi (a)i + pσi (b)i pσi (a)i pσi (b)i pσi (a)i + ≤ Cσi (a) − + ≤ Cσi (b) ∀ a ≤ b 2µσi (a)i 2µσi (b)i 2µσi (a)i 2µσi (b)i (19)  and so max1≤k≤ji rσi (k)i + pxi /(2µxi ) ≤ Cx . As before, combine this with Lemma 7 and P the fact that pxit∗ ≤ pxi = t∈Txi pxit to yield the following inequalities Ĉxi ≤ 3Cx − 3pxi pxit∗ pxit∗ + + − ≤ Cx (3 + [Ri (1 − 5/(2mi ))] ) 2µxi v̄i µi (20) J -which complete our proof. 4.2 CC-LP for Identical Machines I Theorem 9. If machines are of unit speed, then CC-LP yields an objective that is... single-task subjobs multi-task subjobs rji ≡ 0 ≤ 2 OP T ≤ 3 OP T some rji > 0 ≤ 3 OP T ≤ 4 OP T Proof. Define [·]+ , x, Cx , Ĉx , i, σi , and t∗ as in Theorem 8. When rji ≡ 0, one need only give a more careful treatment of the first inequality in (18) (using µji = qji ). + Ĉx,i ≤ 2Cx + pxit∗ − pxit∗ /mi − pxi /qxi ≤ Cx (2 + [1 − 1/mi − 1/qxi ] ) (21) Similarly, when some rji > 0, the first inequality in (20) implies the following. + Ĉx,i ≤ 3Cx + pxit∗ − pxit∗ /mi − 3pxi /(2qxi ) ≤ Cx (3 + [1 − 1/mi − 3/(2qxi )] ) (22) J The key in the refined analysis of Theorem 9 lay in how −pxi /qxi is used to annihilate +pxit∗ . While qxi = 1 (i.e. single-task subjobs) is sufficient to accomplish this, it is not strictly necessary. The theorem below shows that we can annihilate the +pxit∗ term whenever all tasks of a given subjob are of the same length. Note that the tasks need not be unit, as the lengths of tasks across different subjobs can differ. ESA 2016 234:12 Scheduling Distributed Clusters of Parallel Machines [Full Version] I Theorem 10. Suppose v`i ≡ 1. If pjit is constant over t ∈ Tji for all j ∈ N and i ∈ M , then algorithm CC-LP is a 2-approximation when rji ≡ 0, and a 3-approximation otherwise. P Proof. The definition of pxi gives pxi /qxi = t∈Txi pxit /qxi . Using the assumption that pjit is constant over t ∈ Tji , we see that pxi /qxi = (qxi + |Txi | − qxi )pxit∗ /qxi , where |Txi | ≥ qxi . Apply this to Inequality (21) from the proof of Theorem 9; some algebra yields Ĉxi ≤2Cx − pxit∗ /mi − pxit∗ (|Txi | − qxi ) /qxi ≤ 2Cx . The case with some rji > 0 uses the same identity for pxi /qxi . (23) J P Sachdeva and Saket [12] showed that it is NP-Hard to approximate CC|mi ≡ 1| wj Cj with a constant factor less than 2. Theorem 10 is significant because it shows that CC-LP can attain the same guarantee for arbitrary mi , provided v`i ≡ 1 and pjit is constant over t. 5 Combinatorial Algorithms In this section, we introduce an extremely fast combinatorial algorithm with performance guarantees similar to CC-LP for “unstructured” inputs (i.e. those for which some v`i > 1, or some Tji have pjit non-constant over t). We call this algorithm CC-TSPT. CC-TSPT uses the MUSSQ algorithm for concurrent open shop (from [9]) as a subroutine. As SWAG (from [7]) motivated development of CC-TSPT, we first address SWAG’s worst-case performance. 5.1 A Degenerate Case for SWAG As a prerequisite for addressing worst-case performance of an existing algorithm, we 1: procedure SWAG(N, M, pji ) provide psuedocode and an accompanying 2: J ←∅ verbal description for SWAG. 3: qi ← 0, ∀i ∈ M SWAG computes queue positions for 4: while |J| = 6 |N | do   every subjob of every job, supposing that qi +pji 5: mkspn ← max j i∈M m i each job was scheduled next. A job’s poten∀j ∈ N \ J tial makespan (“mkspn”) is the largest of 6: nextJob ← argminj∈N \J mkspnj the potential finish times of all of its subjobs 7: J.append(nextJob) (considering current queue lengths qi and 8: q i ← qi + pji each subjob’s processing time pji ). Once 9: end while potential makespans have been determined, return J the job with smallest potential makespan is 10: selected for scheduling. At this point, all 11: end procedure queues are updated. Because queues are updated, potential makespans will need to be re-calculated at the next iteration. Iterations continue until the very last job is scheduled. Note that SWAG runs in O(n2 m) time. P I Theorem 11. For an instance I of P D|| Cj , let SW AG(I) denote the objective function value of SWAG applied to I, and let OP T (I) denote the objective function value of an optimal solution to I. Then for all L ≥ 1, there exists an I ∈ ΩP D|| P Cj such that SW AG(I)/OP T (I) > L. Proof. Let L ∈ N+ be a fixed but arbitrary constant. Construct a problem instance ILm as follows: R. Murray, S. Khuller, and M. Chao 234:13 N = N1 ∪ N2 where N1 is a set of m jobs, and N2 is a set of L jobs. Job j ∈ N1 has processing time p on cluster j and zero all other clusters. Job j ∈ N2 has processing time p(1 − ) on all m clusters.  is chosen so that  < 1/L (see Figure 3). Figure 3 At left, an input for SWAG example with m = 3 and L = 2. At right, SWAG’s resulting schedule, and an alternative schedule. It is easy to verify that SWAG will generate a schedule where all jobs in N2 precede all jobs in N1 (due to the savings of p for jobs in N2 ). We propose an alternative solution in which all jobs in N1 preceed all jobs in N2 . Denote the objective value for this alternative solution ALT (ILm ), noting ALT (ILm ) ≥ OP T (ILm ). By symmetry, and the fact that all clusters have a single machine, we can see that SW AG(ILm ) and ALT (ILm ) are given by the following SW AG(ILm ) = p(1 − )L(L + 1)/2 + p(1 − )Lm + pm ALT (ILm ) = p(1 − )L(L + 1)/2 + pL + pm (24) (25) Since L is fixed, we can take the limit with respect to m. p(1 − )Lm + pm SW AG(ILm ) = lim = L(1 − ) + 1 > L m m→∞ ALT (I ) m→∞ pm L lim (26) The above implies the existence of a sufficiently large number of clusters m, such that m ≥ m implies SW AG(ILm )/OP T (ILm ) > L. This completes our proof. J Theorem 11 demonstrates that that although SWAG performed well in simulations, it may not be reliable. The rest of this section introduces an algorithm not only with superior runtime to SWAG (generating a permutation of jobs in O(n2 + nm) time, rather than O(n2 m) time), but also a constant-factor performance guarantee. 5.2 CC-TSPT : A Fast 2 + R Approximation Our combinatorial algorithm for concurrent cluster scheduling exploits an elegant transformation to concurrent open shop. Once we consider this simpler problem, it can be handled with MUSSQ [9] and List-LPT. Our contributions are twofold: (1) we prove that this intuitive technique yields an approximation algorithm for a decidedly more general problem, and (2) we show that a non-intuitive modification can be made that maintains theoretical bounds while improving empirical performance. We begin by defining our transformation. ESA 2016 234:14 Scheduling Distributed Clusters of Parallel Machines [Full Version] I Definition 12 (The Total Scaled Processing Time (TSPT) Transformation). Let ΩCC be the P P set of all instances of CC|| wj Cj , and let ΩP D be the set of all instances of P D|| wj Cj . Note that ΩP D ⊂ ΩCC . Then the Total Scaled Processing Time Transformation is a mapping P T SP T : ΩCC → ΩP D with (T, v, w) 7→ (X, w) : xji = t∈Tji pjit /µi i.e., xji is the total processing time required by subjob (j, i), scaled by the sum of machine speeds at cluster i. Throughout this section, we will use I = (T, v, w) to denote an arbitrary P instance of CC|| wj Cj , and I 0 = (X, w) as the image of I under TSPT. Figure 4 shows the result of TSPT applied to our baseline example. Figure 4 An instance I of CC|| wj Cj , and its image I 0 = T SP T (I). The schedules were constructed with List-LPT using the same permutation for I and I 0 . P We take the time to emphasize the simplicity of our reduction. Indeed, the TSPT transformation is perhaps the first thing one would think of given knowledge of the concurrent open shop problem. What is surprising is how one can attain constant-factor performance guarantees even after such a simple transformation. Algorithm CC-TSPT : Execute MUSSQ on I 0 = T SP T (I) to generate a permutation of jobs σ. List schedule instance I by σ on each cluster according to List-LPT. Towards proving the approximation ratio for CC-TSPT, we will establish a critical inequality in Lemma 13. The intuition behind Lemma 13 requires thinking of every job j in I as having a corresponding representation in j 0 in I 0 . Job j in I will be scheduled in the CC environment, while job j 0 in I 0 will be scheduled in the P D environment. We consider what results when the same permutation σ is used for scheduling in both environments. CC Now the definitions for the lemma: let Cσ(j) be the completion time of job σ(j) resulting CC? from List-LPT on an arbitrary permutation σ. Define Cσ(j) as the completion time of job 0 P D,I σ(j) in the CC environment in the optimal solution. Lastly, define Cσ(j as the completion 0) time of job σ(j 0 ) in I 0 when scheduling by List-LPT(σ) in the P D environment. I Lemma 13. For I 0 = T SP T (I), let j 0 be the job in I 0 corresponding to job j in I. For an P D,I 0 CC? CC arbitrary permutation of jobs σ, we have Cσ(j) ≤ Cσ(j + R · Cσ(j) . 0) Proof. After list scheduling has been carried out in the CC environment, we may determine CC CC Cσ(j)i - the completion time of subjob (σ(j), i). We can bound Cσ(j)i using Lemma 7 (which implies (27)), and the serial-processing nature of the P D environment (which implies (28)). Pj CC Cσ(j)i ≤ pσ(j)i1 (1/v̄ − 1/µi ) + `=1 pσ(`)i /µi (27) 0 Pj P D,I ∀i∈M (28) `=1 pσ(`)i /µi ≤ Cσ(j 0 ) If we relax the bound given in Inequality (27) and combine it with Inequality (28), we see P D,I 0 CC that Cσ(j)i ≤ Cσ(j + pσ(j)i1 /v̄. The last step is to replace the final term with something 0) R. Murray, S. Khuller, and M. Chao 234:15 CC? more meaningful. Using pσ(j)1 /v̄ ≤ R · Cσ(j) (which is immediate from the definition of R) the desired result follows. J While Lemma 13 is true for arbitrary σ, now we consider σ = M U SSQ(X, w). The proof of MUSSQ’s correctness established the first inequality in the chain of inequalities below. The second inequality can be seen by substituting pji /µi for xji in LP0(I 0 ) (this shows that the constraints in LP0(I 0 ) are weaker than those in LP1(I)). The third inequality follows from the Validity Lemma. P P P LP0(I 0 ) LP1(I) P D,I 0 ≤ 2 j∈N wj Cj ≤ 2 j∈N wj Cj ≤ 2OP T (I) (29) j∈N wσ(j) Cσ(j) Combining Inequality (29) with Lemma 13 allows us to bound the objective in a way that does not make reference to I 0 . h i P P P D,I 0 CC CC? w C ≤ w C + R · C σ(j) σ(j) j∈N j∈N σ(j) σ(j) ≤ 2 · OP T (I) + R · OP T (I) (30) σ(j) Inequality (30) completes our proof of the following theorem. I Theorem 14. Algorithm CC-TSPT is a 2 + R approximation for CC|| 5.3 P wj Cj . CC-TSPT with Unit Tasks and Identical Machines Consider concurrent cluster scheduling with v`i = pjit = 1 (i.e., all processing times are unit, although the size of the collections Tji are unrestricted). In keeping with the work of Zhang, Wu, and Li [16] (who studied this problem in the single-cluster case), we call instances with these parameters “fully parallelizable,” and write β = f ps for Graham’s α|β|γ taxonomy. Zhang et al. showed that scheduling jobs greedily by “Largest Ratio First” (decreasing wj /pj ) results in a 2-approximation, where 2 is a tight bound. This comes as something P of a surprise since the Largest Ratio First policy is optimal for 1|| wj Cj - which their P problem very closely resembles. We now formalize the extent to which P |f ps| wj Cj P P resembles 1|| wj Cj : define the time resolution of an instance I of CC|f ps| wj Cj as  ρI = minj∈N,i∈M pji /mi . Indeed, one can show that as the time resolution increases, the P P performance guarantee for LRF on P |f ps| wj Cj approaches that of LRF on 1|| wj Cj . We prove the analogous result for our problem. P I Theorem 15. CC-TSPT for CC|f ps| wj Cj is a (2 + 1/ρI )−approximation. Proof. Applying techniques from the proof of Lemma 13 under the hypothesis of this theorem, P D,I 0 CC,OP T CC we have Cσ(j),i ≤ Cσ(j) + 1. Next, use the fact that for all j ∈ N , Cσ(j) ≥ ρI by the 0 P D,I CC definition of ρI . These facts together imply Cσ(j),i ≤ Cσ(j) + C CC,OP T /ρI . Thus CC j∈N wj Cσ(j) ≤ P h i P D,I 0 CC,OP T w C + C /ρ ≤ 2 · OP T + OP T /ρI . j I j∈N σ(j) P (31) J 5.4 CC-ATSPT : Augmenting the LP Relaxation CC? The proof of Theorem 14 appeals to a trivial lower bound on Cσ(j) , namely pσ(j)1 /v̄ ≤ CC? R · Cσ(j) . We attain constant-factor performance guarantees in spite of this, but it is natural to wonder how the need for such a bound might come hand-in-hand with empirical weaknesses. Indeed, TSPT can make subjobs consisting of many small tasks look the same as subjobs consisting of a single very long task. Additionally, a cluster hosting a subjob with a single ESA 2016 234:16 Scheduling Distributed Clusters of Parallel Machines [Full Version] extremely long task might be identified as a bottleneck by MUSSQ, even if that cluster has more machines than it does tasks to process. We would like to mitigate these issues by introducing the simple lower bounds on Cj as seen in constraints (1B) and (1C). This is complicated by the fact that MUSSQ’s proof of correctness only allows constraints of the form in (1A). For I ∈ ΩP D this is without loss of generality, since |S| = 1 in LP0 implies Cj ≥ pji , but since we apply LP0 to I 0 = T SP T (I), Cj ≥ xji is equivalent to Cj ≥ pji /µi (a much weaker bound than we desire). Nevertheless, we can bypass this issue by introducing additional clusters and appropriately defined subjobs. We formalize this with the “Augmented Total Scaled Processing Time” (ATSPT) transformation. Conceptually, ATSPT creates n “imaginary clusters”, where each imaginary cluster has nonzero processing time for exactly one job. I Definition 16 (The Augmented TSPT Transformation). Let ΩCC and ΩP D be as in the definition for TSPT. Then the Augmented TSPT Transformation is likewise a mapping   AT SP T : ΩCC → ΩP D with (T, v, w) 7→ (X, w) : X = XT SP T (I) D . Where D ∈ Rn×n is a diagonal matrix with djj as any valid lower bound on the completion time of job j (such as the right hand sides of constraints (1B) and (1C) of LP1). Given that djj is a valid lower bound on the completion time of job j, it is easy to verify that for I 0 = AT SP T (I), LP1(I 0 ) is a valid relaxation of I. Because MUSSQ returns a permutation of jobs for use in list scheduling by List-LPT, these “imaginary clusters” needn’t be accounted for beyond the computations in MUSSQ. 6 A Reduction for Minimizing Total Weighted Lateness on Identical Parallel Machines The problem of minimizing total weighted lateness on a bank of identical parallel machines P . is typically denoted P || wj Lj , where the lateness of a job with deadline dj is Lj = P max {Cj − dj , 0}. The reduction we offer below shows that P || wj Lj can be stated in P P terms of CC|| wj Cj at optimality. Thus while a ∆ approximation to CC|| wj Cj does P not imply a ∆ approximation to P || wj Lj , the reduction below nevertheless provides new P insights on the structure of P || wj Lj . I Definition 17 (Total Weighted Lateness Reduction). Let I = (p, d, w, m) denote an instance P of P || wj Lj . p is the set of processing times, d is the set of deadlines, w is the set of weights, and m is the number of identical parallel machines. Given these inputs, we transform I ∈ ΩP || P wj Lj to I 0 ∈ ΩCC in the following way. Create a total of n + 1 clusters. Cluster 0 has m machines. Job j has processing time pj on this cluster, and |Tj0 | = 1. Clusters 1 through n each consist of a single machine. Job j has processing time dj on cluster j, and zero on all clusters other than cluster 0 and cluster j. Denote this problem I 0 . We refer the reader to Figure 2 for an example output of this reduction. P P I Theorem 18. Let I be an instance of P || wj Lj . Let I 0 be an instance of CC|| wj Cj resulting from the transformation described above. Any list schedule σ that is optimal for I 0 is also optimal for I. Proof. If we restrict the solution space of I 0 to single permutations (which we may do without loss of generality), then any schedule σ for I or I 0 produces the same value of R. Murray, S. Khuller, and M. Chao 234:17 wj (Cj − dj )+ for I and I 0 . The additional clusters we added for I 0 ensure that Cj ≥ dj . P Given this, the objective for I can be written as j∈N wj dj + wj (Cj − dj )+ . Because wj dj is P a constant, any permutation to solve I 0 optimally also solves j∈N wj (Cj − dj )+ optimally. P P Since j∈N wj (Cj − dj )+ = j∈N wj Lj , we have the desired result. J P j∈N 7 Closing Remarks We now take a moment to address a subtle issue in the concurrent cluster problem: what price do we pay for using the same permutation on all clusters (i.e. single-σ schedules)? For concurrent open shop, it has been shown ([15, 9]) that single-σ schedules may be assumed without loss of optimality. As is shown in Figure 5, this does not hold for concurrent cluster scheduling in the general case. In fact, that is precisely why the strong performance guarantees for algorithm CC-LP rely on clusters having possibly unique permutations. P Figure 5 An instance of CC|| Cj (i.e. wj ≡ 1) for which there does not exist a single-σ schedule which attains the optimal objective value. In the single-σ case, one of the jobs necessarily becomes delayed by one time unit compared to the multi-σ case. As a result, we see a 20% optimality gap even when v`i ≡ 1. Our more novel contributions came in our analysis for CC-TSPT and CC-ATSPT. First, we could not rely on the processing time of the last task for a job to be bounded above by the job’s completion time variable Cj in LP0(I 0 ), and so we appealed to a lower bound on Cj that was not stated in the LP itself. The need to incorporate this second bound is critical in realizing the strength of algorithm CC-TSPT, and uncommon in LP rounding schemes. Second, CC-ATSPT is novel in that it introduces constraints that would be redundant for LP0(I) when I ∈ ΩP D , but become relevant when viewing LP 0(I 0 ) as a relaxation for I ∈ ΩCC . This approach has potential for more broad applications since it represented effective use of a limited constraint set supported by a known primal-dual algorithm. We now take a moment to state some open problems in this area. One topic of ongoing research is developing a factor 2 purely combinatorial algorithm for the special case of concurrent cluster scheduling considered in Theorem 10. In addition, it would be of broad interest to determine the worst-case loss to optimality incurred by assuming single-permutation P schedules for CC|v ≡ 1| wj Cj . The simple example above shows that an optimal single-σ schedule can have objective 1.2 times the globally optimal objective. Meanwhile, Theorem 14 shows that there always exists a single-σ schedule with objective no more than 3 times the globally optimal objective. Thus, we know that the worst-case performance ratio is in the interval [1.2, 3], but we do not know its precise value. As a matter outside of scheduling theory, it would be valuable to survey primal-dual algorithms with roots in LP relaxations to determine which have constraint sets that are amenable to implicit modification, as in the fashion of CC-ATSPT. ESA 2016 234:18 Scheduling Distributed Clusters of Parallel Machines [Full Version] Acknowledgments. Special thanks to Andreas Schulz for sharing some of his recent work P with us [14]. His thorough analysis of a linear program for P || wj Cj drives the LP-based results in this paper. Thanks also to Chien-Chung Hung and Leana Golubchik for sharing [7] while it was under review, and to Ioana Bercea and Manish Purohit for their insights on SWAG’s performance. Lastly, our sincere thanks to William Gasarch for organizing the REU which led to this work, and to the 2015 CAAR-REU cohort for making the experience an unforgettable one; in the words of Rick Sanchez wubalubadubdub! References 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Inc Amazon Web Services. AWS Lambda - Serverless Compute, 2016 (accessed April 3, 2016). URL: https://aws.amazon.com/lambda/. Zhi-Long Chen and Nicholas G. Hall. Supply chain scheduling: Assembly systems. Working paper., 2000. doi:10.1007/978-3-8349-8667-2. Naveen Garg, Amit Kumar, and Vinayaka Pandit. Order Scheduling Models: Hardness and Algorithms. FSTTCS 2007: Foundations of Software Technology and Theoretical Computer Science, 4855:96–107, 2007. doi:10.1007/978-3-540-77050-3\_8. Teofilo Gonzalez, Oscar Ibarra, and Sartaj Sahni. Bounds for LPT Schedules on Uniform Processors. SIAM Journal on Computing, 6(1):155–166, 1977. Ronald L Graham, Eugene L Lawler, Jan Karel Lenstra, and AHG Rinnooy Kan. Optimization and approximation in deterministic sequencing and scheduling: a survey. Annals of discrete mathematics, 5:287–326, 1979. Mohammad Hajjat, Shankaranarayanan P N, David Maltz, Sanjay Rao, and Kunwadee Sripanidkulchai. Dealer : Application-aware Request Splitting for Interactive Cloud Applications. CoNEXT 2012, pages 157–168, 2012. Chien-Chun Hung, Leana Golubchik, and Minlan Yu. Scheduling jobs across geodistributed datacenters. In Proceedings of the Sixth ACM Symposium on Cloud Computing, pages 111–124. ACM, 2015. J. Y T Leung, Haibing Li, and Michael Pinedo. Scheduling orders for multiple product types to minimize total weighted completion time. Discrete Applied Mathematics, 155(8):945–970, 2007. doi:10.1016/j.dam.2006.09.012. Monaldo Mastrolilli, Maurice Queyranne, Andreas S. Schulz, Ola Svensson, and Nelson A. Uhan. Minimizing the sum of weighted completion times in a concurrent open shop. Operations Research Letters, 38(5):390–395, 2010. doi:10.1016/j.orl.2010.04.011. Microsoft. Azure Service Fabric, 2016 (accessed April 3, 2016). URL: https://azure. microsoft.com/en-us/services/service-fabric/. Maurice Queyranne. Structure of a simple scheduling polyhedron. Mathematical Programming, 58(1-3):263–285, 1993. doi:10.1007/BF01581271. Sushant Sachdeva and Rishi Saket. Optimal inapproximability for scheduling problems via structural hardness for hypergraph vertex cover. In 2013 IEEE Conference on Computational Complexity, pages 219–229. IEEE, 2013. Andreas S. Schulz. Polytopes and scheduling. PhD Thesis, 1996. Andreas S Schulz. From linear programming relaxations to approximation algorithms for scheduling problems : A tour d ’ horizon. Working paper; available upon request., 2012. C. Sriskandarajah and E. Wagneur. Openshops with jobs overlap. European Journal of Operations Research, 71:366–378, 1993. Qiang Zhang, Weiwei Wu, and Minming Li. Resource Scheduling with Supply Constraint and Linear Cost. COCOA 2012 Conference, 2012. arXiv:9780201398298, doi:10.1007/ 3-540-68339-9\_34.
8cs.DS
arXiv:1710.10948v1 [cs.SD] 27 Oct 2017 SOUND SOURCE LOCALIZATION IN A MULTIPATH ENVIRONMENT USING CONVOLUTIONAL NEURAL NETWORKS Eric L. Ferguson∗, Stefan B. Williams Craig T. Jin Australian Centre for Field Robotics The University of Sydney, Australia Computing and Audio Research Laboratory The University of Sydney, Australia ABSTRACT The propagation of sound in a shallow water environment is characterized by boundary reflections from the sea surface and sea floor. These reflections result in multiple (indirect) sound propagation paths, which can degrade the performance of passive sound source localization methods. This paper proposes the use of convolutional neural networks (CNNs) for the localization of sources of broadband acoustic radiated noise (such as motor vessels) in shallow water multipath environments. It is shown that CNNs operating on cepstrogram and generalized cross-correlogram inputs are able to more reliably estimate the instantaneous range and bearing of transiting motor vessels when the source localization performance of conventional passive ranging methods is degraded. The ensuing improvement in source localization performance is demonstrated using real data collected during an at-sea experiment. Index Terms— source localization, DOA estimation, convolutional neural networks, passive sonar, reverberation 1. INTRODUCTION Sound source localization plays an important role in array signal processing with wide applications in communication, sonar and robotics systems [1]. It is a focal topic in the scientific literature on acoustic array signal processing with a continuing challenge being acoustic source localization in the presence of interfering multipath arrivals [2, 3, 4]. In practice, conventional passive narrowband sonar array methods involve frequency-domain beamforming of the outputs of hydrophone elements in a receiving array to detect weak signals, resolve closely-spaced sources, and estimate the direction of a sound source. Typically, 10-100 sensors form a linear array with a uniform interelement spacing of half a wavelength at the array’s design frequency. However, this narrowband approach has application over a limited band of frequencies. The upper limit is set by the design frequency, above which grating lobes form due to spatial aliasing, leading to ambiguous source directions. The lower limit is set one octave below the design frequency because at lower frequencies the directivity of the array is much reduced as the beamwidths broaden. An alternative approach to sound source localization is to measure the time difference of arrival (TDOA) of the signal at an array of spatially distributed receivers [5, 6, 7, 8], allowing the instantaneous position of the source to be estimated. The accuracy of the source position estimates is found to be sensitive to any uncertainty in the sensor positions [9]. Furthermore, reverberation has an adverse effect on time delay estimation, which negatively impacts ∗ Work supported by Defence Science and Technology Group Australia. sound source localization [10]. In a model-based approach to broadband source localization in reverberant environments, a model of the so-called early reflections (multipaths) is used to subtract the reverberation component from the signals. This decreases the bias in the source localization estimates [11]. The approach adopted here uses a minimum number of sensors (no more than three) to localize the source, not only in bearing, but also in range. Using a single sensor, the instantaneous range of a broadband signal source is estimated using the cepstrum method [12]. This method exploits the interaction of the direct path and multipath arrivals, which is observed in the spectrogram of the sensor output as a Lloyds mirror interference pattern [12]. Generalized cross-correlation (GCC) is used to measure the TDOA of a broadband signal at a pair of sensors which enables estimations of the source bearing. Furthermore, adding another sensor so that all three sensor positions are collinear enables the source range to be estimated using the two TDOA measurements from the two adjacent sensor pairs. The range estimate corresponds to the radius of curvature of the spherical wavefront as it traverses the receiver array. This latter method is commonly referred to as passive ranging by wavefront curvature [13]. However, its source localization performance can become problematic in multipath environments when there is a large number of extraneous peaks in the GCC function attributed to the presence of multipaths, and when the direct path and multipath arrivals are unresolvable (resulting in TDOA estimation bias). Also, its performance degrades as the signal source direction moves away from the array’s broadside direction and completely fails at endfire. Note that this is not the case with the cepstrum method with its omnidirectional ranging performance being independent of source direction. Recently, Deep Neural Networks (DNN) based on supervised learning methods have been applied to acoustic tasks such as speech recognition [14, 15], terrain classification [16], and source localization tasks [17]. A challenge for supervised learning methods for source localization is their ability to adapt to acoustic conditions that are different from the training conditions. The acoustic characteristics of a shallow water environment are non-stationary with high levels of clutter, background noise, and multiple propagation paths making it a difficult environment for DNN methods. A CNN is proposed that uses generalized cross-correlation (GCC) and cepstral feature maps as inputs to estimate both the range and bearing of an acoustic source passively in a shallow water environment. The CNN method has an inherent advantage since it considers all GCC and cepstral values that are physically significant when estimating the source position. Other approaches involving time delay estimation typically consider only a single value (a peak) in the GCC or cepstogram. The CNNs are trained using real, multi-channel acoustic recordings of a surface vessel underway in a Quefrency (ms) Time Delay (ms) Cepstrogram 300 Range output Bearing output 200 100 0 1.0 0.5 0.0 -0.5 -1.0 dense: 256 Cross-correlogram 0 20 40 60 80 Time (seconds) Combined CNN 100 120 Fig. 1. a) Cepstrogram for a surface vessel as it transits over a single recording hydrophone located 1 m above the sea floor, and b) the corresponding cross-correlogram for a pair of hydrophones. shallow water environment. CNNs operating on cepstrum or GCC feature map inputs only are also considered and their performances compared. The proposed model is shown to localize sources with greater performance than a conventional passive sonar localization method which uses TDOA measurements. Generalization performance of the networks is tested by ranging another vessel with different radiated noise characteristics. The original contributions of this work are: • Development of a multi-task CNN for the passive localization of acoustic broadband noise sources in a shallow water environment where the range and bearing of the source are estimated jointly; • Range and bearing estimates are continuous, allowing for improved resolution in position estimates when compared to other passive localization networks which use a discretized classification approach [17, 18]; • A novel loss function based on localization performance, where bearing estimates are constrained for additional network regularization when training; and • A unified, end-to-end network for passive localization in reverberate environments with improved performance over traditional methods. 2. ACOUSTIC LOCALIZATION CNN A neural network is a machine learning technique that maps the input data to a label or continuous value through a multi-layer nonlinear architecture, and has been successfully applied to applications such as image and object classification [19, 20], hyperspectral pixelwise classification [21] and terrain classification using acoustic sensors [16]. CNNs learn and apply sets of filters that span small regions of the input data, enabling them to learn local correlations. 2.1. Architecture Since the presence of a broadband acoustic source is readily observed in a cross-correlogram and cepstrogram, Fig. 1, it is possible to create a unified network for estimating the position of a vessel relative to a receiving hydrophone array. The network is divided into sections, Fig 2. The GCC CNN and cepstral CNN operate in parallel and serve as feature extraction networks for the GCC and cepstral feature map inputs respectively. Next, the outputs of the GCC CNN GCC CNN dense: 256 Cepstral CNN dense: 256 dense: 256 dense: 256 dense: 256 GCC input cepstral input multichannel acoustic recording Fig. 2. Network architecture for the acoustic localization CNN and cepstral CNN are concatenated and used as inputs for the dense layers, which outputs a range and bearing estimate. For both the GCC CNN and cepstral CNN, the first convolutional layer filters the input feature maps with 10 × 1 × 1 kernels. The second convolutional layer takes the output of the first convolutional layer as input and filters it with 10 × 1 × 48 kernels. The third layer also uses 10 × 1 × 48 kernels, and is followed by two fullyconnected layers. The combined CNN further contains two fullyconnected layers that take the concatenated output vectors from both of the GCC and cepstral CNNs as input. All the fully-connected layers have 256 neurons each. A single neuron is used for regression output for the range and bearing outputs respectively. All layers use rectified linear units as activation functions. Since resolution is important for the accurate ranging of an acoustic source, max pooling is not used in the network’s architecture. 2.1.1. Input In order to localize a source using a hydrophone array, information about the time delay between signal propagation paths is required. Although such information is contained in the raw signals, it is beneficial to represent it in a way that can be readily learned by the network. A cepstrum can be derived from various spectra such as the complex or differential spectrum. For the current approach, the power cepstrum is used and is derived from the power spectrum of a recorded signal. It is closely related to the Mel-frequency cepstrum used frequently in automatic speech recognition tasks [14, 15], but has linearly spaced frequency bands rather than bands approximating the human auditory system’s response. The cepstral representation of the signal is neither in the time nor frequency domain, but rather, it is in the quefrency domain [22]. Cepstral analysis is based on the principle that the logarithm of the power spectrum for a signal containing echoes has an additive periodic component due to the echoes from multi-path reflections [23]. Where the original time waveform contained an echo the cepstrum will contain a peak and thus the TDOA between propagation paths of an acoustic signal can be measured by examining peaks in the cepstrum [24]. It is useful in the presence of strong multipath reflections found in shallow water environments, where time delay estimation methods such as GCC suffer from degraded performance [25]. The cepstrum x̂(n) is obtained by the inverse Fourier transform of the logarithm of the power spectrum:  (1) x̂(n) = F −1 log|S(f )|2 , where S(f ) is the Fourier transform of a discrete time signal x(n). For a given source-sensor geometry, there is a bounded range of quefrencies useful in source localization. As the source-sensor separation distance decreases, the TDOA values (position of peaks in the cepstrum) will tend to a maximum value, which occurs when the source is at the closest point of approach to the sensor. TDOA values greater than this maximum are not physically realizable and are excluded. Cepstral values near zero are dominated by source dependent quefrencies and are also excluded. GCC is used to measure the TDOA of a signal at a pair of hydrophones and is useful in situations of spatially uncorrelated noise [26]. For a given array geometry, there is a bounded range on useful GCC information. For a pair of recording sensors, a zero relative time delay corresponds to a broadside source, whilst a maximum relative time delay corresponds to an endfire source. TDOA values greater than the maximum bound are not useful to the passive localization problem and are excluded [27, 12]. The windowing of CNN inputs has the added benefit of reducing the number of parameters in the network. A cepstrogram and cross-correlogram (an ensemble of cepstrum and GCC respectively, as they vary in time) is shown in Fig. 1. 2.1.2. Output For each example, the network predicts the range and bearing of the acoustic source as a continuous value (each with a single neuron regression output). This differs from other recent passive localization networks which use a classification based approach such that range and bearing predictions are discretized, putting a hard limit on the resolution of estimations that the networks are able to provide [17, 18]. 2.2. Multi-task Joint Training The objective of the network is to predict the range and bearing of an acoustic source relative to a receiving array from reverberant and noisy multi-channel input signals. Since the localization of an acoustic source involves both a range and bearing estimate, the Euclidean distance between the network prediction and ground truth is minimized when training. Both the range and bearing output loss components are jointly minimized using a loss function based on localization performance. This additional regularization is expected to improve localization performance when compared to minimizing range loss and bearing loss separately. The total objective function E minimized during network training is given by the weighted sum of the polar-distance loss Ep and the bearing loss Eb , such that: E = αEp + (1 − α)Eb , (2) where Ep is the L2 norm of the polar distance given by: Ep = y 2 + t2 − 2yt cos(θ − φ) (3) and Eb is the L2 norm of the bearing loss only, given by: Eb = (θ − φ)2 (4) with the predicted range and bearing output denoted as t and φ respectively, and the true range and bearing denoted as y and θ respectively. The inclusion of the Eb term encourages bearing predictions to be constrained to the first turn, providing additional regularization and reducing parameter weight magnitudes. The two terms are weighted by hyper-parameter α so each loss term has roughly equal weight. Training uses batch normalization [28] and is stopped when the validation error does not decrease appreciably per epoch. In order to further prevent over-fitting, regularization through a dropout rate of 50% is used in all fully connected layers when training [29]. 3. EXPERIMENTAL RESULTS Passive localization on a transiting vessel was conducted using a multi-sensor algorithmic method described in [30], and CNNs with cepstral and/or GCC inputs. Their performances were then compared. The generalization ability of the networks to other broadband sources is also demonstrated by localizing an additional vessel with a different radiated noise spectrum and source level. 3.1. Dataset Acoustic data of a motor boat transiting in a shallow water environment over a hydrophone array were recorded at a sampling rate of 250 kHz. The uniform linear array (ULA) consists of three recording hydrophones with an interelement spacing of 14 m. Recording commenced when the vessel was inbound 500 m from the sensor array. The vessel then transited over the array and recording was terminated when the vessel was 500 m outbound. The boat was equipped with a DGPS tracker, which logged its position relative to the receiving hydrophone array at 0.1 s intervals. Bearing labels were wrapped between 0 and π radians, consistent with bearing estimates available from ULAs which suffer from left-right bearing ambiguity. Twenty-three transits were recorded over a two day period. One hundred thousand training examples were randomly chosen each with a range and bearing label, such that examples uniformly distributed in range only. A further 5000 labeled examples were reserved for CNN training validation. The recordings were preprocessed as outlined in Section 2.1.1. The networks were implemented in TensorFlow and were trained with a Momentum Optimizer using a NVIDIA GeForce GTX 770 GPU. The gradient descent was calculated for batches of 32 training examples. The networks were trained with a learning rate of 3 × 10−9 , weight decay of 1 × 10−5 and momentum of 0.9. Additional recordings of the vessel were used to measure the performance of the methods. These recordings are referred to as the test dataset and contain 9980 labeled examples. Additional acoustic data were recorded on a different day using a different boat with different radiated noise characteristics. Acoustic recordings for each transit started when the inbound vessel was 300 m from the array, continued during its transit over the array, and ended when the outbound vessel was 300 m away. This dataset is referred to as the generalization set and contains 11714 labeled examples. 60 Average Bearing Error (deg) 90° Combined CNN Algorithmic Method 45° DGPS 135° 40 30 20 10 0 0° Fig. 3. Estimates of the range and bearing of a transiting vessel. The true position of the vessel is shown relative to the recording array, measured by the DGPS. Combined CNN Cepstral CNN GCC CNN Algorithmic Method Average Range Error (m) 225° 102 0 80 Average Bearing Error (deg) 180° 600 500 400 300 200 100 Combined CNN Cepstral CNN GCC CNN Algorithmic Method 50 25 50 75 100 Bearing (deg) 125 150 175 50 75 100 Bearing (deg) 125 150 175 Combined CNN Cepstral CNN GCC CNN Algorithmic Method 70 60 50 40 30 20 10 315° 0 270° 25 Fig. 5. Comparison of bearing estimation performance as a function of the vessels true bearing for the a) test dataset and b) generalization dataset. 101 Average Range Error (m) 0 100 200 Range (m) 300 400 102 101 Combined CNN Cepstral CNN GCC CNN Algorithmic Method 0 50 100 150 Range (m) 200 250 300 Fig. 4. Comparison of range estimation performance as a function of the vessels true range for the a) test dataset and b) generalization dataset. 3.2. Input of Network Cepstral and GCC feature maps were used as inputs to the CNN and they were computed as follows. For any input example, only a select range of cepstral and GCC values contain relevant TDOA information and are retained - see Section 2.1.1. Cepstral values more than 1.4 ms are discarded because they represent the maximum multipath delay and occur when the source is directly over a sensor. Cepstral values less than 84 µs are discarded since they are highly source dependent. Thus, each cepstrogram input is liftered and samples 31 through 351 are used as input to the network only. A cepstral feature vector is calculated for each recording channel, resulting in a 320 x 3 cepstal feature map. Due to array geometry, the maximum time delay between pairs of sensors is ±9.2 ms. A GCC feature vector is calculated for two pairs of sensors, resulting in a 4800 x 2 GCC feature map. The GCC map is further sub-sampled to size 480 x 2, which reduces the number of network parameters. 3.3. Comparison of Localization Methods Algorithmic passive localization was conducted using the methods outlined in [30]. The TDOA values required for algorithmic localization were taken from the largest peaks in the GCC. Nonsensical results at ranges greater than 1000 m are discarded. Other CNN ar- chitectures are also compared. The GCC CNN uses the GCC CNN section of the combined CNN only, and the Cepstral CNN uses the Cepstral CNN section of the combined CNN only, both with similar range and bearing outputs, Fig 2. Fig. 3 shows localization results for a vessel during one complete transit. Fig. 4 and Fig. 5 show the performance of localization methods as a function of the true range and bearing of the vessel for the test dataset, and the generalization set respectively. The CNNs are able to localize a different vessel in the generalization set with some impact to performance. The performance of the algorithmic method is degraded in the shallow water environment since there are a large number of extraneous peaks in the GCC attributed to the presence of multipaths, and when the direct path and multipath arrivals become unresolvable (resulting in TDOA estimation bias). Bearing estimation performance is improved in networks using GCC features, showing that time delay information between pairs of spatially distributed sensors is beneficial. The networks show improved robustness to interfering multipaths. Range estimation performance is improved in networks using cepstral features, showing that multipath information can be useful in determining the sources range. The combined CNN is shown to provide superior performance for range and bearing estimation. 4. CONCLUSIONS In this paper we introduce the use of a CNN for the localization of surface vessels in a shallow water environment. We show that the CNN is able to jointly estimate the range and bearing of an acoustic broadband source in the presence of interfering multipaths. Several CNN architectures are compared and evaluated. The networks are trained and tested using cepstral and GCC feature maps as input derived from real acoustic recordings. Networks are trained using a novel loss function based on localization performance with additional constraining of bearing estimates. The inclusion of both cepstral and GCC inputs facilitates robust passive acoustic localization in reverberant environments, where other methods can suffer from degraded performance. 5. REFERENCES [1] J. Benesty, J. Chen, and Y. Huang, Microphone array signal processing, vol. 1, Springer Science & Business Media, 2008. [17] S. Chakrabarty and E.A.P. Habets, “Broadband DOA estimation using convolutional neural networks trained with noise signals,” arXiv preprint arXiv:1705.00919, 2017. [2] M. Viberg, B. Ottersten, and T. Kailath, “Detection and estimation in sensor arrays using weighted subspace fitting,” IEEE Trans. Signal Process., vol. 39, no. 11, pp. 2436–2449, 1991. [18] R. Takeda and K. Komatani, “Unsupervised adaptation of deep neural networks for sound source localization using entropy minimization,” in Proc. IEEE Int. Conf. Acoust., Speech, Signal Process. IEEE, 2017, pp. 2217–2221. [3] X. Zeng, M. Yang, B. Chen, and Y. Jin, “Low angle direction of arrival estimation by time reversal,” in Proc. IEEE Int. Conf. Acoust., Speech, Signal Process. IEEE, 2017, pp. 3161–3165. [19] A. Krizhevsky, I. Sutskever, and G.E. Hinton, “Imagenet classification with deep convolutional neural networks,” in Adv. in neural information process. systems, 2012, pp. 1097–1105. [4] J. Capon, “High-resolution frequency-wavenumber spectrum analysis,” Proc. IEEE, vol. 57, no. 8, pp. 1408–1418, 1969. [20] R. Girshick, J. Donahue, T. Darrell, and J. Malik, “Rich feature hierarchies for accurate object detection and semantic segmentation,” in Proc. IEEE Conf. Computer Vision and Pattern Recog., 2014, pp. 580–587. [5] G.C. Carter, “Time delay estimation for passive sonar signal processing,” IEEE Trans. Acoust., Speech, Signal Process., vol. 29, pp. 463–470, 1981. [6] G.C. Carter, Ed., Coherence and time delay estimation, IEEE Press, New York, 1993. [7] Y.T. Chan and K.C. Ho, “A simple and efficient estimator for hyperbolic location,” IEEE Trans. on Signal Process., vol. 42, pp. 1905–1915, 1994. [21] L. Windrim, R. Ramakrishnan, A. Melkumyan, and R. Murphy, “Hyperspectral CNN classification with limited training samples,” in British Machine Vision Conf., 2017. [22] B.P. Bogert, “The quefrency alanysis of time series for echoes: Cepstrum pseudo-autocovariance, cross-cepstrum, and saphe cracking,” Time Series Analysis, pp. 209–243, 1963. [8] J. Benesty, J. Chen, and Y. Huang, “Time-delay estimation via linear interpolation and cross correlation,” IEEE Trans. Speech and Audio Process., vol. 12, no. 5, pp. 509–519, 2004. [23] K.W. Lo, B.G. Ferguson, Y. Gao, and A. Maguer, “Aircraft flight parameter estimation using acoustic multipath delays,” IEEE Trans. on Aerospace and Electronic Systems, vol. 39, no. 1, pp. 259–268, 2003. [9] E.L. Ferguson, “Application of passive ranging by wavefront curvature methods to the localization of biosonar click signals emitted by dolphins,” in Proc. of International Conf. on Underwater Acoust. Measurements, 2011. [24] A.V. Oppenheim and R.W. Schafer, “From frequency to quefrency: a history of the cepstrum,” IEEE Signal Process. Magazine, vol. 21, no. 5, pp. 95–106, 2004. [10] J. Chen, J. Benesty, and Y.A. Huang, “Performance of GCCand AMDF-based time-delay estimation in practical reverberant environments,” EURASIP J. on Adv. in Signal Process., vol. 2005, no. 1, pp. 498964, 2005. [11] J.R. Jensen, J.K. Nielsen, R. Heusdens, and M.G. Christensen, “DOA estimation of audio sources in reverberant environments,” in Proc. IEEE Int. Conf. Acoust., Speech, Signal Process. IEEE, 2016, pp. 176–180. [12] E.L. Ferguson, R. Ramakrishnan, S.B. Williams, and C.T. Jin, “Convolutional neural networks for passive monitoring of a shallow water environment using a single sensor,” in Proc. IEEE Int. Conf. Acoust., Speech, Signal Process. IEEE, 2017, pp. 2657–2661. [25] Y. Gao, M. Clark, and P. Cooper, “Time delay estimate using cepstrum analysis in a shallow littoral environment,” Conf. Undersea Defence Technology, vol. 7, pp. 8, 2008. [26] C. Knapp and G. Carter, “The generalized correlation method for estimation of time delay,” IEEE Trans. Acoust., Speech, and Signal Process., vol. 24, no. 4, pp. 320–327, 1976. [27] E.L. Ferguson, R. Ramakrishnan, S.B. Williams, and C.T. Jin, “Deep learning approach to passive monitoring of the underwater acoustic environment,” J. Acoust. Soc. Am., vol. 140, no. 4, pp. 3351–3351, 2016. [28] S. Ioffe and C. Szegedy, “Batch normalization: Accelerating deep network training by reducing internal covariate shift,” in International Conf. on Machine Learning, 2015, pp. 448–456. [13] E.L. Ferguson, “A modified wavefront curvature method for the passive ranging of echolocating dolphins in the wild,” J. Acoust. Soc. Am., vol. 134, no. 5, pp. 3972–3972, 2013. [29] N. Srivastava, G.E. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov, “Dropout: a simple way to prevent neural networks from overfitting.,” J. Machine Learning Research, vol. 15, no. 1, pp. 1929–1958, 2014. [14] X. Xiao, S. Watanabe, H. Erdogan, L. Lu, J. Hershey, M.L. Seltzer, G. Chen, Y. Zhang, M. Mandel, and D. Yu, “Deep beamforming networks for multi-channel speech recognition,” in Proc. IEEE Int. Conf. Acoust., Speech, Signal Process. IEEE, 2016, pp. 5745–5749. [30] H.C. Schau and A.Z. Robinson, “Passive source localization employing intersecting spherical surfaces from time-of-arrival differences,” IEEE Trans. on Acoust., Speech, Signal Process., vol. 35, no. 8, pp. 1223–1225, 1987. [15] J. Heymann, L. Drude, Christoph Boeddeker, Patrick Hanebrink, and R. Haeb-Umbach, “Beamnet: end-to-end training of a beamformer-supported multi-channel asr system,” in Proc. IEEE Int. Conf. Acoust., Speech, Signal Process. IEEE, 2017, pp. 5325–5329. [16] A. Valada, L. Spinello, and W. Burgard, “Deep feature learning for acoustics-based terrain classification,” in Robotics Research, pp. 21–37. Springer, 2018.
7cs.IT
RANSAC Algorithms for Subspace Recovery and Subspace Clustering arXiv:1711.11220v1 [math.ST] 30 Nov 2017 Ery Arias-Castro Jue Wang University of California, San Diego Abstract We consider the RANSAC algorithm in the context of subspace recovery and subspace clustering. We derive some theory and perform some numerical experiments. We also draw some correspondences with the methods of Hardt and Moitra (2013) and Chen and Lerman (2009b). 1 Introduction The Random Sample Consensus (with acronym RANSAC) algorithm of Fischler and Bolles (1981), and its many variants and adaptations, are well-known in computer vision for their robustness in the presence of gross errors (outliers). In this paper we focus on the closely related problems of subspace recovery and subspace clustering in the presence of outliers, where RANSAC-type methods are believed to be optimal, yet too costly in terms of computations when the fraction of inliers is small. Although this is a well-understood limitation of the RANSAC, we nevertheless establish this rigorously in the present context. In particular, we derive the performance and computational complexity of RANSAC for these two problems, and perform some numerical experiments corroborating our theory and comparing the RANSAC with other methods proposed in the literature. 1.1 The problem of subspace recovery Consider a setting where the data consist of n points in dimension p, denoted x1 , . . . , xn ∈ Rp . It is assumed that m of these points lie on a d-dimensional linear subspace L and that the points are otherwise in general position, which means that the following assumption is in place: Assumption 1. A q-tuple of data points (with q ≤ p) is linearly independent unless it includes at least d + 1 points from L. (We say that points are linearly dependent if they are so when seen as vectors.) The points on L are called inliers and all the other points are called outliers. This is the setting of subspace recovery without noise. When there is noise, the points are not exactly on the underlying subspace but rather in its vicinity. In any case, the goal is to recover L, or said differently, distinguish the inliers from the outliers. See Figure 1a for an illustration in a setting where the subspace is of dimension d = 2 in ambient dimension p = 3. The goal is to recover the subspace L and/or identify the inlier points. The present project was initiated in the context of an Independent Study for Undergraduates (Math 199). We acknowledge support from the US National Science Foundation (DMS 1513465). 1 2 This problem is intimately related to the problem of robust covariance estimation, which dates back decades (Huber and Ronchetti, 2009; Maronna, 1976; Tyler, 1987), but has attracted some recent attention. We refer the reader to the introduction of (Zhang and Lerman, 2014) for a comprehensive review of the literature, old and new. Subspace recovery in the presence of outliers, as we consider the problem here, is sometimes referred to a robust principal components analysis, although there are other meanings in the literature more closely related to matrix factorization with a low-rank component (Candès et al., 2011; Wright et al., 2009). (a) Subspace recovery problem. (b) Subspace clustering problem. Figure 1: An illustration of the two settings considered in the paper. 1.2 The problem of subspace clustering Consider a setting where the data consist of n points in dimension p, denoted x1 , . . . , xn ∈ Rp . It is assumed that mk of these points lie on a dk -dimensional linear subspace Lk , where k = 1, . . . , K (so that there are K subspaces in total). The remaining points are in general position: Assumption 2. A q-tuple of data points is linearly independent unless it includes at least dk + 1 points from Lk for some k ∈ {1, . . . , K}. In this setting all the points on one of the subspaces are inliers, and all the other points are outliers. This is the setting of subspace clustering without noise. When there is noise, the inliers are not exactly on the subspaces but in their vicinity. See Figure 1b for an illustration in a setting where there is one subspace of dimension d1 = 1 and two subspaces of dimension d2 = d3 = 2, in ambient dimension p = 3. The goal is to cluster mk points to their corresponding Lk for all k ∈ {1, . . . , K}. The problem of subspace clustering has applications in computer vision, in particular, movement segmentation (Vidal, 2011; Vidal et al., 2005). 1.3 Contents In Section 2, we consider the problem of subspace recovery. In Section 3, we consider the problem of subspace clustering. In both cases, we study a ‘canonical’ RANSAC algorithm, deriving some theory and comparing it with other methods in numerical experiments. We briefly discuss our results in Section 4. Remark 1 (linear vs affine). Throughout, we consider the case where the subspaces are linear, although some applications may call for affine subspaces. (This is for convenience.) Because of this, we are able to identify a point x ∈ Rp with the corresponding vector (sometimes written x − 0). 3 2 Subspace recovery We consider the setting of Section 1.1 and use the notation defined there. In particular, we work under Assumption 1. We consider the noiseless setting for simplicity. 2.1 RANSAC for subspace recovery We propose a simple RANSAC algorithm for robust subspace recovery. In the present setting, in particular under Assumption 1, the underlying linear subspace L (which we assumed is of dimension d) is determined by any (d + 1)-tuple that comes from that subspace. The algorithm starts by randomly selecting a (d + 1)-tuple and checking if this tuple forms a linear subspace of dimension d. If so, the subspace is recovered and the algorithm stops. Otherwise, the algorithm continues, repeatedly sampling a (d + 1)-tuple at random until the subspace is discovered. (Optionally, the algorithm can be made to stop when a maximum number of tuples has been sampled.) In this formulation, detailed in Algorithm 1, d is known. Input : data points x1 , . . . , xn ∈ Rp ; dimension d Output: a linear subspace of dimension d containing at least d + 1 points repeat randomly select a (d + 1)-tuple of data points until the tuple is linearly dependent; return the subspace spanned by the tuple 1 2 3 4 Algorithm 1: RANSAC (Subspace Recovery) By design, the procedure is exact. (Again, we are in the noiseless setting. In a noisy setting, the method can be shown to be essentially optimal.) However, researchers have shied away from a RANSAC approach because of its time complexity. We formalize what is in the folklore in the following. Proposition 1. Algorithm 1 is exact and the number of iterations has the geometric distribum n )/(d+1 ). Thus the expected number of iterations is 1/θ1 = tion1 with success probability θ1 ∶= (d+1 n m d+1 (d+1)/(d+1), which is of order O(n/m) when d is held fixed. Note that each iteration requires on the order of O(pd2 ) operations as it requires computing the rank of a p-by-(d + 1) matrix. Proof. The algorithm sample a (d+1)-tuple independently and uniformly at random until the tuple is linearly dependent. Because of Assumption 1, a (d + 1)-tuple is linearly dependent if and only if n m ) (d + 1)-tuples in total, only (d+1 ) fit the all the points in the tuple are from L. While there are (d+1 m n )/(d+1 ). Because the draws are bill, so that the probability of drawing a suitable tuple is θ1 = (d+1 independent, the total number of draws until the algorithm stops has the geometric distribution with success probability θ1 . n m )/(d+1 ), and when d is assumed fixed, We know that the mean of this distribution is 1/θ1 = (d+1 while n and m are large, we have 1/θ1 ∼ 1 nd+1 /(d + 1)! = (n/m)d+1 . md+1 /(d + 1)! Here we consider the variant of the geometric distribution that is supported on the positive integers. 4 (The reader is invited to verify that this still holds true as long as d = o(m2 ).) In applications where the number of outliers is a non-negligible fraction of the sample (meaning that n/m is not close to 1), the RANSAC’s number of iterations depends exponentially on the dimension of subspace. This confirms the folklore, at least in such a setting. Remark 2. For simplicity, we analyzed the variant of the algorithm where the tuples are drawn with replacement, so that the worst-case number of iterations is infinite. However, in practice one should draw the tuples without replacement (which is equally easy to do in the present setting), as recommended in (Schattschneider and Green, 2012). For this variant, the worst-case time comn n ) + 1. Moreover, Proposition 1 still applies if understood as an upper bound. ) − (d+1 plexity is (d+1 (The number of iterations has a so-called negative hypergeometric distribution in this case.) Remark 3. If the dimension d is unknown, a possible strategy is to start with d = 1, run the algorithm for a maximum number of iterations, and if no pair of points is found to be aligned with the origin, move to d = 2, and continue in that fashion, increasing the dimension. If no satisfactory tuple is found, the algorithm would start again at d = 1. The algorithm will succeed eventually. 2.2 The algorithm of Hardt and Moitra for subspace recovery As we said above, researchers have avoid RANSAC procedures because of the running time, which as we saw can be prohibitive. Recently, however, Hardt and Moitra (2013) have proposed a RANSACtype algorithm that strikes an interesting compromise between running time and precision. Their algorithm is designed for the case where the sample size is larger than the ambient dimension, namely n > p. It can be described as follows. It repeatedly draws a p-tuple at random until the tuple is found to be linearly dependent. When such a tuple is found, the algorithm returns a set of linearly dependent points in the tuple. See the description in Algorithm 2. A virtue of this procedure is that it does not require knowledge of the dimension d of the underlying subspace. 1 2 3 4 Input : data points x1 , . . . , xn ∈ Rp Output: a linear subspace repeat randomly select a p-tuple of data points until the tuple is linearly dependent; return the subspace spanned by any subset of linearly dependent points in the tuple Algorithm 2: Hardt-Moitra (Subspace Recovery) Proposition 2. When n > p, Algorithm 2 is exact and its number of iterations has the geomet)(n−m )/(np). Thus the expected number of ric distribution with success probability θ2 ∶= ∑k≥d+1 (m k p−k iterations is 1/θ2 . Note that each iteration requires on the order of O(p3 ) operations as it requires computing the rank of a p-by-p matrix. Proof. With Assumption 1 in place, a p-tuple is linearly dependent if and only if it contains at least d + 1 points from the subspace L. Thus the Repeat statement above stops exactly when it found a p-tuple that contains at least d + 1 points. Moreover, also because of Assumption 1, the points within that tuple that are linear dependent must belong to L. Therefore, the algorithm returns L, and is therefore exact. 5 We now turn to the number of iterations. The number of iterations is obviously geometric and the success probability is the probability that a p-tuple drawn uniformly at random contains at least d + 1 points from L. θ2 is that probability. Indeed, it is the probability that, when drawing p balls without replacement from an urn with m red balls out of n total, the sample contains at least d + 1 red balls. In the present context, the balls are of course the points and the red balls are the points on the linear subspace. Hardt and Moitra (2013) analyze their algorithm in a slightly different setting and with the goal of finding the maximum fraction of outliers that can be tolerated before the algorithm breaks down in the sense that it does not run in polynomial time. In particular, they show that, if m/n ≥ d/p, then their algorithm has a number of iterations with the geometric distribution with success probability at least 1/(2p2 n), so that the expected number of iterations is bounded by 2p2 n, which is obviously polynomial in (p, n). In fact, it can be better than that. The following is a consequence of Proposition 2. Corollary 1. If, in addition to n > p, it holds that m/n ≥ d/p, with d/p ≤ τ and p/n ≤ τ , for some fixed τ < 1, then θ2 is bounded from below by a positive quantity that depends only on τ . Consequently, Algorithm 2 has expected number of iterations of order O(1). Proof. Let U denote a random variable with the hypergeometric distribution with parameters (p, m, n) described above. Then θ2 = P(U ≥ d + 1), and it depends on (d, p, m, n). We show that θ2 is bounded from below irrespective of these parameters as long as the conditions are met. Noting that θ2 is increasing in d and n, and decreasing in p and m, it suffices to consider how θ2 varies along a sequence where n → ∞ and (d, p, m) all varying with n in such a way that m/n → τ and d/p → τ , as this makes the expected number of iterations largest. Define µ ∶= E(U ) = p(m/n); σ 2 = Var(U ) = p(m/n)(1 − m/n)(n − p)/(n − 1). The condition m/n ≥ d/p implies that µ ≥ d, and along the sequence of parameters under consideration, σ → ∞. Moreover, along such a sequence, Z ∶= (U − µ)/σ is standard normal in the limit, so that θ2 = P(U ≥ d + 1) = P(Z ≥ (d + 1 − µ)/σ) ≥ P(Z ≥ 1/σ) → P(N (0, 1) ≥ 0) = 1/2, using Slutsky’s theorem in the last line. 2.3 Numerical experiments We performed some small-scale numerical experiments comparing RANSAC (in the form of Algorithm 1), the Hardt-Moitra (HM) procedure (Algorithm 2), and the Geometric Median Subspace (GMS) of (Zhang and Lerman, 2014), which appears to be one of the best methods on the market. (We used the code available on Teng Zhang’s website.) Each inlier is uniformly distributed on the intersection of the unit sphere with the underlying subspace. Each outlier is simply uniformly distributed on the unit sphere. The result of each algorithm is averaged over 1000 repeats. Performance is measured by the (first principal) angle between the returned subspace and the true subspace. (This is to be fair to GMS, as the other two algorithms are exact.) The results are reported in Table 1. 6 parameters average system time (d, p, m, m0 ) difference in angle RANSAC HM GMS RANSAC HM GMS .0051 .0011 .0064 .0001 .0076 .6123 .0009 .0006 .0002 .0006 .0093 .0013 .0947 .1912 .5008 .1918 .0117 .0160 0 0 0 0 0 0 0 0 0 0 0 0 .0341 0 .0184 0 .0411 .2285 (8, 10, 100, 50) (4, 10, 100, 50) (8, 20, 100, 50) (6, 10, 100, 20) (9, 10, 100, 50) (18, 20, 100, 50) Table 1: Numerical experiments comparing RANSAC, HM, and GMS for the problem of subspace recovery. As in the text, d is the dimension of the subspace, p is the ambient dimension, m is the number of inliers, m0 is the number of outliers (so that n = m + m0 is the sample size). We performed another set of experiments to corroborate the theory established in Proposition 1 for the complexity of RANSAC. The results are shown in Figure 2, where each setting has been repeated 1000 times. As expected, as the dimensionality of the problem increases, RANSAC’s complexity becomes quickly impractical. 3000 n/m=1.3(simulated) n/m=1.4(simulated) n/m=1.5(simulated) n/m=1.3(theory) n/m=1.4(theory) n/m=1.5(theory) 2500 number of iterations 2000 1500 1000 500 0 0 2 4 6 8 10 12 14 16 18 20 intrinsic dimension Figure 2: Average number of iterations for RANSAC (in the form of Algorithm 1) as a function of the subspace dimension d and the ratio of sample size n to number of inliers m. The dashed lines are the averages from our simulation while the lines are derived from theory (Proposition 1). 3 Subspace clustering We consider the setting of Section 1.2 and use the notation defined there. In particular, we work under Assumption 2. We consider the noiseless setting for simplicity. We also assume that all subspaces are of same dimension, denoted d (so that dk = d for all k). 7 3.1 RANSAC for subspace clustering We propose a simple RANSAC algorithm for subspace clustering. As before, any of the linear subspaces is determined by any (d + 1)-tuple that comes from that subspace. The algorithm starts by randomly selecting a (d+1)-tuple and checking if this tuple forms a linear subspace of dimension d. If so, one of the subspaces is recovered and all the points on the subspace are extracted from the data. Otherwise, the algorithm continues, repeatedly sampling a (d + 1)-tuple at random until that condition is met. The algorithm continues in this fashion until all the K subspaces have been recovered. In this formulation, detailed in Algorithm 3, both d and K are assumed known. 1 2 3 4 5 6 7 Input : data points x1 , . . . , xn ∈ Rp ; dimension d; number of subspace K Output: K linear subspaces of dimension d, each containing at least d + 1 points for k = 1, . . . , K do repeat randomly select a (d + 1)-tuple of data points until the tuple is linearly dependent; return the subspace spanned by the tuple remove the points on that subspace from the data end Algorithm 3: RANSAC (Subspace Clustering) Again, the procedure is exact by design, since we are in the noiseless setting. Here too, researchers have not embraced RANSAC approaches because of their running time. We confirm this folklore in the following, where we assume for simplicity that all subspaces have the same number of points m (so that mk = m for all k). Proposition 3. Algorithm 3 is exact and the number of iterations is has the distribution of I1 + ⋅ ⋅ ⋅ + IK , where the I’s are independent and Ij has the geometric distribution with success probability m )/(n−(j−1)m ). This is stochastically bounded by the negative binomial with parameters (K − j + 1)(d+1 d+1 (K, θ1 ). Thus the expected number of iterations is bounded by K/θ1 , which is of order O(n/m)d+1 when d and K are held fixed. The proof is very similar to that of Proposition 1 and is omitted. Remark 4. When the dimensions of the subspaces are unknown, a strategy analogous to that described in Remark 3 is of course possible. When the number of subspaces is unknown, a stopping rule can help decide whether there remains a subspace to be discovered. Details are omitted as such an approach, although natural, could prove complicated. 3.2 Adapting the algorithm of Hardt and Moitra for subspace clustering Algorithm 3 consists in applying Algorithm 1 until a subspace is recovered, removing the points on that subspace, and then continuing, until all K subspaces are recovered. An algorithm for subspace clustering can be based on the algorithm of Hardt and Moitra (2013) (Algorithm 2) instead. The resulting algorithm is suited for the case where n − (m1 + ⋅ ⋅ ⋅ + mK ) > p. Based on the fact that Algorithm 2 has expected number of iterations bounded by 2p2 n, the resulting algorithm for subspace clustering has expected number of iterations bounded by 2Kp2 n. See Algorithm 4, where we assume that the number of subspaces is known, but do not assume that the dimensions of the subspaces are known (and they do not need to be the same). 8 Input : data points x1 , . . . , xn ∈ Rp ; number of subspace K Output: K linear subspaces each with a number of points exceeding its dimension for k = 1, . . . , K do repeat randomly select a p-tuple of data points until the tuple is linearly dependent; repeat find the smallest number of linearly dependent points in the tuple return the subspace spanned by these points remove the points on that subspace from the data until there are no more linearly dependent points in the tuple; end 1 2 3 4 5 6 7 8 9 10 Algorithm 4: Subspace Clustering based on the Hardt-Moitra Algorithm The reason why we extract the smallest number of linearly dependent points at each step is to avoid a situation where a p-tuple contains dj + 1 points from Lj and dk + 1 points from Lk (with j ≠ k), in which case, assuming dj + dk < p, these points are linearly dependent but do not span one of the subspaces. This particular step is, however, computationally challenging as it amounts to finding the sparsest solution to a p-by-p linear system, a problem known to be challenging (Tropp and Wright, 2010, Eq 1). One possibility is to replace this will finding the solution with minimum `1 norm (Tropp and Wright, 2010, Eq 8). The use of the `1 constraint is central to the method proposed by Elhamifar and Vidal (2009). 3.3 The algorithm of Chen and Lerman The Spectral Curvature Clustering (SCC) algorithm of Chen and Lerman (2009b) is in fact of RANSAC type. The method was designed for the noisy setting and is therefore more sophisticated.2 It is based on a function A ∶ (Rp )d+1 → [0, 1] that quantifies how close a (d+1)-tuple is from spanning a subspace of dimension d or less. It is equal to 1 when this is the case and is strictly less than 1 when this is not the case. The algorithm draws a number, c, of d-tuples at random, where the s-th tuple is denoted (x1,s , . . . , xd,s ), and computes the matrix W = (Wij ), where c Wij = ∑ A(xi , x1,s , . . . , xd,s )A(xj , x1,s , . . . , xd,s ). s=1 It then applies a form of spectral graph partitioning algorithm to W closely related to method of Ng et al. (2002). (The method assumes all subspaces are of same dimension d, and both d and K are assumed known.) In the noiseless setting, one could take A to return 1 if the tuple is linearly dependent and 0 otherwise. In that case, Wij is simply the number of d-tuples among the c that were drawn with whom both xi and xj are linearly dependent. Chen and Lerman (2009a) analyzes their method in a setting that reduces to this situation and show that the method is exact in this case. 2 Chen and Lerman (2009b) consider the case where the subspaces are affine, but we adapt their method to the case where they area linear. 9 parameters average system time rand index (d, p, K, m, m0 ) RANSAC SSC SCC TSC RANSAC SSC SCC TSC (4, 8, 3, 50, 50) (6, 8, 3, 50, 50) (4, 8, 3, 50, 100) (4, 8, 5, 50, 50) (8, 10, 3, 50, 50) .0622 .8810 .2108 .3425 17.1827 .3188 .2813 .3974 .6163 .3185 .3731 .8257 .4563 .9395 1.4141 .1767 .1815 .1757 .3282 .2019 1 1 1 1 1 .8407 .6490 .7619 .9206 .6148 .9997 .8322 .9689 .9548 .6904 .7237 .5829 .2849 .7578 .5688 Table 2: Numerical experiments comparing RANSAC, SSC, SCC, and TSC for the problem of subspace clustering. As in the text, d is the dimension of the subspaces (assumed to be the same), p is the ambient dimension, K is the number of subspaces, m is the number of inliers per subspace (assumed to be the same), m0 is the number of outliers (so that n = Km + m0 is the sample size). 3.4 Numerical experiments We performed some numerical experiments to compare various methods for subspace clustering, specifically, RANSAC, Sparse Subspace Clustering (SSC) (Elhamifar and Vidal, 2009), Spectral Curvature Clustering (SCC) (Chen and Lerman, 2009b), and Thresholding-based Subspace Clustering (TSC) (Reinhard Heckel, 2015). Each inlier is uniformly distributed on the intersection of the unit sphere with its corresponding subspace. Each outlier is simply uniformly distributed on the unit sphere. The result of each algorithm is averaged over 500 repeats. Performance is measured by the Rand index. The results are reported in Table 2. 4 Discussion and conclusion In our small scale experiments, RANSAC is seen to be competitive with other methods, at least when the intrinsic dimensionality is not too large and when there are not too many outliers (or too many underlying subspaces) present in the data. This was observed both in the context of subspace recovery and in the context of subspace clustering. References Candès, E. J., X. Li, Y. Ma, and J. Wright (2011). Robust principal component analysis? Journal of the ACM (JACM) 58 (3), 11. Chen, G. and G. Lerman (2009a). Foundations of a multi-way spectral clustering framework for hybrid linear modeling. Foundations of Computational Mathematics 9 (5), 517–558. Chen, G. and G. Lerman (2009b). Spectral curvature clustering (scc). International Journal of Computer Vision 81 (3), 317–330. Elhamifar, E. and R. Vidal (2009). Sparse subspace clustering. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pp. 2790–2797. IEEE. Fischler, M. A. and R. C. Bolles (1981). Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography. Communications of the ACM 24 (6), 381–395. Hardt, M. and A. Moitra (2013). Algorithms and hardness for robust subspace recovery. In Conference on Learning Theory (COLT), Volume 30, pp. 354–375. 10 Huber, P. J. and E. M. Ronchetti (2009). Robust Statistics (2nd edition). Wiley. Maronna, R. A. (1976). Robust M-estimators of multivariate location and scatter. The Annals of Statistics 4 (1), 51–67. Ng, A. Y., M. I. Jordan, and Y. Weiss (2002). On spectral clustering: Analysis and an algorithm. In Advances in neural information processing systems, pp. 849–856. Reinhard Heckel, Helmut Bolcskei, D. o. I. . E. E. Z. S. (2015). Robust subspace clustering via thresholding. IEEE Transactions on Information Theory 61. Schattschneider, R. and R. Green (2012). Enhanced ransac sampling based on non-repeating combinations. In Proceedings of the 27th Conference on Image and Vision Computing New Zealand, pp. 198–203. ACM. Tropp, J. A. and S. J. Wright (2010). Computational methods for sparse solution of linear inverse problems. Proceedings of the IEEE 98 (6), 948–958. Tyler, D. E. (1987). A distribution-free m-estimator of multivariate scatter. The Annals of Statistics, 234–251. Vidal, R. (2011). Subspace clustering. IEEE Signal Processing Magazine 28 (2), 52–68. Vidal, R., Y. Ma, and S. Sastry (2005). Generalized principal component analysis (gpca). IEEE Transactions on Pattern Analysis and Machine Intelligence 27 (12), 1945–1959. Wright, J., A. Ganesh, S. Rao, Y. Peng, and Y. Ma (2009). Robust principal component analysis: Exact recovery of corrupted low-rank matrices via convex optimization. In Advances in neural information processing systems, pp. 2080–2088. Zhang, T. and G. Lerman (2014). A novel M-estimator for robust PCA. The Journal of Machine Learning Research 15 (1), 749–808.
10math.ST
N ::= S, F P ::= idle Programs idle Sensors | P |P | P ; P parallel composition sequential composition | N |N termination composition | t.v[~v ] | install v method invocation module update | [P, M ]p,r b | [P, M ]p,r b {S} sensor broadcast sensor | sense (~x) in P | if v then P else P field sensing conditional execution S ::= arXiv:cs/0612093v1 [cs.DC] 19 Dec 2006 Network sensors and field off M ::= {li = (~xi ) Pi }i∈I t ::= net | this Modules v ::= method collection x Values variable Targets | m | p field measure position broadcast local | b | M battery capacity module Figure 1: The syntax of CSN. E ::= N | [P, M ]p,r b { | }E | E This section addresses the syntax and the semantics of the Calculus for Sensor Networks. The syntax of the calculus is given by the grammar in Figure 1. The calculus encompasses a two-level structure: networks and programs. Networks N are flat, unstructured collections of sensors and values. A sensor [P, M ]p,r represents an abstraction of a physical sensing device b located at position p and running program P . Module M is the collection of methods that the sensor makes available for internal and for external usage. Typically this collection of methods may be interpreted as the library of functions of the tiny operating system installed in the sensor. Sensors may only broadcast values to its neighborhood sensors. Radius rt defines the transmitting power of a sensor and specifies the border of communication: a circle centered at position p (the position of the sensor) with radius rt . Likewise, radius rs defines the sensing capability of the sensor, meaning that a sensor may only read values inside the circle centered at position p with radius rs . Values h~v ip define the field of measures that may be sensed. A value consists of a tuple ~v denoting the strength of the measure at a given position p of the plane. Values are managed by the environment; in CSN there are no primitives for manipulating values, besides reading (sensing) values. We assume that the environment inserts these values in the network and update its contents. Networks are combined using the parallel composition operator | . 1 Processes are built from the inactive process idle and from ... idle denotes a terminated thread. and sensing values from the environment sensed th Programs P and Q may be combined in sequence, P ; Q, or in parallel, P | Q. The sequential composition P ; Q designates a program that first executes P and then proceeds with the execution of Q. In contrast, P | Q represents the simultaneous execution of P and Q. However we consider that sensors support only a very limited form of parallelism: P and Q do not interact during their execution; Mutually recursive method definitions makes possible to represent infinite behaviours. Values are the data exchanged between sensors, and are basic values b, method labels l, positions p, and modules M . Notice that the calculus in not high-order in the sense that communication of modules ... As an example, consider a... 1 Programming Examples In this section we present some examples, programmed in CSN, of typical operations performed on networks of sensors. Our goal is to show the expressiveness of the CSN calculus just presented and also to identify some other aspects of these networks that may be interesting to model. In the following examples, we denote as MSensor and MSink the modules installed in any of the anonymous sensors in the network and the modules installed in the sink, respectively. Note also that all sensors are assumed to have a builtin method, deploy, that is responsible for installing new modules. The intuition is that this method is part of the tiny operating system that allows sensors to react when first placed in the field. Finally, we assume in these small examples that the network layer supports scoped flooding. We shall see in the next section that this can be supported via software with the inclusion of state in sensors. 1.1 Ping We start with a very simple ping program. Each sensor has a ping method that when invoked calls a method forward in the network with its position and battery charge as arguments. When the method forward is invoked by a sensor in the network, it just triggers another call to forward in the network. The sink has a distinct implementation of this method. Any incomming invocation logs the position and battery values given as arguments. So, the overall result of the call net.ping [] in the sink is that all reachable sensors in the network will, in principle, receive this call and will flood the network with their positions and battery charge values. These values eventually reach the sink and get logged. MSensor ( p , b ) = { ping = () net . f o r w a r d [ p , b ] ; net . p i n g [ ] forward = ( x , y ) net . f o r w a r d [ x , y ] 2 M (li ) = (~xi )Pi b ≥ cin p,r [ this .li [~v ] ; P1 | P2 , M ]b →F [Pi [~v /~xi ] ; P1 | P2 , M ]p,r b−cin li 6∈ dom(M ) [ this .li [~v ] ; P1 | P2 , M ]p,r v ] ; P1 | P2 , M ]p,r b →F [ this .li [~ b d(p, p′ ) < r [net .li [~v ] ; (R-method) (R-no-method) b ≥ cout ′ ′ ′ ′ p ,r P1 | P2 , M ]p,r b {S} | [P , M ]b′ →F ′ ′ ′ [net .li [~v ] ; P1 | P2 , M ]p,r v ], M ′ ]pb′ ,r } b {S | [P | this .li [~ (R-broadcast) p,r [net .li [~v ] ; P1 | P2 , M ]p,r b {S} →F [P1 | P2 , M ]b−cout | S [ install M′ (R-release) b ≥ cin ′ p,r ; P1 | P2 , M ]p,r b →F [P1 | P2 , M + M ]b−cin (R-install) b ≥ cin [sense (~x) in P ; P1 | P2 , M ]p,r x] ; P1 | P2 , M ]p,r b →F [P [F (p)/~ b−cin S1 →F S2 S | S1 →F S | S2 S1 ≡ S2 (R-sense) S2 →F S3 S3 ≡ S4 S1 →F S4 (R-parallel, R-structural) S →F S ′ S, F → S ′ , F (R-network) Figure 2: Reduction semantics for processes and networks. } MSink ( p , b ) = { forward = (x , y) log position and power [ x , y ] } [ net . p i n g [ ] , MSink ( p , b ) ] p,r | b [ i d l e , MSensor (p1 ,b1 ) ] bp11 ,r1 | . . . | [ i d l e , MSensor (pn ,bn ) ] 1.2 pn ,rn bn Querying This example shows how we can program a network with a sink that periodically queries the network for the readings of the sensors. Each sensor has a sample method that samples the field using the sense construct and calls the method forward in the neighbourhood with its position and the value sampled as arguments. The call then queries the neighbourhood recursively with a replica 3 of the original call. The original call is, of course, made from the sink, which has a method start sample that calls the method sample in the network within a cycle. Note that, if the sink had a method named sample instead of start sample , it might get a call to sample from elsewhere in the network that could interfere with the sampling control cycle. MSensor ( p ) = { sample = () s e n s e ( x ) i n net . f o r w a r d [ p , x ] ; net . s a m p l e [ ] forward = ( x , y ) net . f o r w a r d [ x , y ] } MSink ( p ) = { start sample = () net . s a m p l e [ ] ; t h i s . s t a r t s a m p l e [ ] forward = (x , y) log position and value [x , y ] } [ t h i s . s t a r t s a m p l e [ ] , MSink ( p ) ] p,r | b [ i d l e , MSensor (p1 ) ] pb11 ,r1 | . . . | [ i d l e , MSensor (pn) ] pbnn ,rn 1.3 Polling In this example the cycle of the sampling is done in each sensor, instead of in the sink, as in the previous example. The sink just invokes the method start sample once. This method propagates the call through the network and invokes sample, for each sensor. This method samples the field, within a cycle, and forwards the result to the network. This implementation requires less broadcasts than the previous one as the sink only has to call start sample on the network once. On the other hand, it increases the amount of processing per sensor. MSensor ( p ) = { start sample = () net . s t a r t s a m p l e [ ] ; t h i s . s a m p l e [ ] sample = () s e n s e ( x ) i n net . f o r w a r d [ p , x ] ; t h i s . s a m p l e [ ] forward = ( x , y ) net . f o r w a r d [ x , y ] } MSink ( p ) = { forward = (x , y) log position and value [x , y ] } | [ net . s t a r t e x a m p l e [ ] , MSink ( p ) ] p,r b [ i d l e , MSensor (p1 ) ] pb11 ,r1 | . . . | [ i d l e , MSensor (pn) ] pbnn ,rn 1.4 Code deployment The above examples assume we have some means of deploying the code to the sensors. In this example we address this problem and show how it can be programmed in CSN. The code we wish to deploy and execute is the same as the one in the previous example. To achieve this goal, the sink first calls the deploy method on the network to install the new module with the methods start sample , sample and forward as above. This call recursively deploys the code to the sensors 4 in the network. The sink then calls start sample to start the sampling, again as above, and waits for the forwarded results on the method forward . MSensor ( p ) = { deploy = (x) i n s t a l l x ; net . d e p l o y [ x ] } MSink ( p ) = { forward = (x , y) log position and value [x , y ] } [ net . d e p l o y [ { start sample = () net . s t a r t s a m p l e [ ] ; t h i s . s a m p l e [ ] sample = () s e n s e ( x ) i n net . f o r w a r d [ p , x ] ; t h i s . s a m p l e [ ] forward = ( x , y ) net . f o r w a r d [ x , y ] }]; net . s t a r t s a m p l e [ ] , MSink ( p ) ] p,r | b [ i d l e , MSensor (p1 ) ] pb11 ,r1 | . . . | [ i d l e , MSensor (pn) ] pbnn ,rn A refined version of this code, one that avoids the start sample method completely, can be programmed. Here, we deploy the code for all sensors by sending methods sample and forward to all the sensors in the network by invoking deploy. Once deployed, the code is activated with a call to sample in the sink, instead of using the start sample method as above. MSensor ( p ) = { deploy = (x) i n s t a l l x ; net . d e p l o y [ x ] } MSink ( p ) = { forward = (x , y) log position and value [x , y ] } [ net . d e p l o y [ { sample = () net . s a m p l e [ ] ; i n s t a l l { s a m p l e = ( ) s e n s e ( x ) i n net . f o r w a r d [ p , x ] ; t h i s . sample [ ] } ; t h i s . sample [ ] forward = ( x , y ) net . f o r w a r d [ x , y ] }]; net . s a m p l e [ ] , MSink ( p ) ] p,r | b [ i d l e , MSensor (p1 ) ] pb11 ,r1 | . . . | [ i d l e , MSensor (pn) ] pbnn ,rn Notice that the implementation of the method sample has changed. Here, when the method is executed for the first time at each sensor, it starts by propagating the call to its neighborhood and then, it changes itself through an install call. The newly installed code of sample is the same as the one in the first implementation of the example. The method then continues to execute and calls the new version of sample, which starts sampling the field and forwarding values. 1.5 Sealing sensors This example shows how we can install a sensor network with a module that contains a method, seal , that prevents any further dynamic re-programming of 5 the sensors, preventing anyone from tampering with the installed code. The module also contains a method, unseal that restores the original deploy method, thus allowing dynamic re-programming again. The sink just installs the module containning these methods in the network by broadcasting a method call to deploy. Each sensor that receives the call, installs the module and floods the neighborhood with a replica of the call. Another message by the sink then replaces the deploy method itself and re-implements it to idle . This prevents any further instalation of software in the sensors and thus effectively seals the network from external interaction other than the one allowed by the remainder of the methods in the modules of the sensors. MSensor = { deploy = (x) } MSink = { } [ net . d e p l o y [ { seal = () unseal = () }]; net . s e a l [ ] , MSink ] [ i d l e , MSensor ] pb11 ,r1 i n s t a l l x ; net . d e p l o y [ x ] i n s t a l l { deploy = () idle} i n s t a l l { d e p l o y = ( x ) i n s t a l l x ; net . d e p l o y [ x ] } p,r b | | ... | [ i d l e , MSensor ] pbnn ,rn September 4, 2017 6 1 A Calculus for Sensor Networks Miguel S. Silva∗ , Francisco Martins†, Luı́s Lopes∗ , and João Barros∗ ∗ Departamento de Ciência de Computadores & LIACC Faculdade de Ciências da Universidade do Porto, Portugal. arXiv:cs/0612093v1 [cs.DC] 19 Dec 2006 † Departamento de Informática Faculdade de Ciências da Universidade de Lisboa, Portugal. Abstract We consider the problem of providing a rigorous model for programming wireless sensor networks. Assuming that collisions, packet losses, and errors are dealt with at the lower layers of the protocol stack, we propose a Calculus for Sensor Networks (CSN) that captures the main abstractions for programming applications for this class of devices. Besides providing the syntax and semantics for the calculus, we show its expressiveness by providing implementations for several examples of typical operations on sensor networks. Also included is a detailed discussion of possible extensions to CSN that enable the modeling of other important features of these networks such as sensor state, sampling strategies, and network security. keywords: Sensor Networks, Ad-Hoc Networks, Ubiquitous Computing, Process-Calculi, Programming Languages. I. I NTRODUCTION A. The Sensor Network Challenge Sensor networks, made of tiny, low-cost devices capable of sensing the physical world and communicating over radio links [3], are significantly different from other wireless networks: (a) the design of a sensor network is strongly driven by its particular application, (b) sensor nodes are highly constrained in terms of power consumption and computational resources (CPU, memory), and (c) large-scale sensor applications require self-configuration and distributed software updates without human intervention. Previous work on fundamental aspects of wireless sensor networks has mostly focused on communication-oriented models, in which the sensor nodes are assumed to store and process the data, coordinate their transmissions, organize the routing of messages within the network, and relay the data to a remote receiver (see e.g. [4, DRAFT Fig. 1. A wireless sensor network is a collection of small devices that, once deployed on a target area, organize themselves in an ad-hoc network, collect measurements of a physical process and transmit the data over the wireless medium to a data fusion center for further processing. 14, 24] and references therein). Although some of these models provide useful insights (e.g. into the connectivity characteristics or the overall power efficiency of sensor networks) there is a strong need for formal methods that capture the inherent processing and memory constraints, and illuminate the massively parallel nature of the sensor nodes’ in-network processing. If well adapted to the specific characteristics of sensor networks, a formalism of this kind, specifically a process calculus, is likely to have a strong impact on the design of operating systems, communication protocols, and programming languages for this class of distributed systems. In terms of hardware development, the state-of-the-art is well represented by a class of multi-purpose sensor nodes called motes1 [8], which were originally developed at UC Berkeley and are being deployed and tested by several research groups and start-up companies. In most of the currently available imple1 Trademark of Crossbow Technology, Inc. 2 mentations, the sensor nodes are controlled by module-based operating systems such as TinyOS [1] and programming languages like nesC [11] or TinyScript/Maté [17]. In our view, the programming models underlying most of these tools have one or more of the following drawbacks: 1) they do not provide a rigorous model (or a calculus) of the sensor network at the programming level, which would allow for a formal verification of the correctness of programs, among other useful analysis; 2) they do not provide a global vision of a sensor network application, as a specific distributed application, making it less intuitive and error prone for programmers; 3) they require the programs to be installed on each sensor individually, something unrealistic for large sensor networks; 4) they do not allow for dynamic re-programming of the network. Recent middleware developments such as Deluge [15] and Agilla [9] address a few of these drawbacks by providing higher level programming abstractions on top of TinyOS, including massive code deployment. Nevertheless, we are still far from a comprehensive programming solution with strong formal support and analytical capabilities. The previous observation motivates us to design a sensor network programming model from scratch. Beyond meeting the challenges of network-wide programming and code deployment, the model should be capable of producing quantitative information on the amount of resources required by sensor network programs and protocols, and also of providing the necessary tools to prove their correctness. B. Related Work Given the distributed and concurrent nature of sensor network operations, we build our sensor network calculus on thirty years of experience gathered by concurrency theorists and programming language designers in pursuit of an adequate formalism and theory for concurrent systems. The first steps towards this goal were given by Milner [20] with the development of CCS (Calculus of Communicating Systems). CCS describes computations in which concurrent processes may interact through simple synchronization, without otherwise exchanging information. Allowing processes to exchange resources (e.g., links, memory references, sockets, code), besides synchronizing, considerably increases the expressive power of the formal systems. Such systems, known as process-calculi, are able to model the mobility patterns of the resources and thus constitute valuable tools to reason about concurrent, distributed systems. 3 The first such system, built on Milner’s work, was the π -calculus [21]. Later developments of this initial proposal allowed for further simplification an provided an asynchronous form of the calculus [5, 13]. Since then, several calculi have been proposed to model concurrent distributed systems and for many there are prototype implementations of programming languages and run-time systems (e.g. Join [10], TyCO [27], X-Klaim [16], and Nomadic Pict [28]). Previous work by Prasad [23] established the first process calculus approach to modeling broadcast based systems. Later work by Ostrovský, Prasad, and Taha [22] established the basis for a higher-order calculus for broadcasting systems. The focus of this line of work lies in the protocol layer of the networks, trying to establish an operational semantics and associated theory that allows assertions to be made about the networks. More recently, Mezzetti and Sangiorgi [19] discuss the use of process calculi to model wireless systems, again focusing on the details of the lower layers of the protocol stack (e.g. collision avoidance) and establishing an operational semantics for the networks. C. Our Contributions Our main contribution is a sensor network programming model based on a process calculus, which we name Calculus of Sensor Networks (CSN). Our calculus offers the following features that are specifically tailored for sensor networks: • Top-Level Approach: CSN focuses on programming and managing sensor networks and so it assumes that collisions, losses, and errors have been dealt with at the lower layers of the protocol stack and system architecture (this distinguishes CSN from the generic wireless network calculus presented in [19]); • Scalability: CSN offers the means to provide the sensor nodes with self-update and self-configuration abilities, thus meeting the challenges of programming and managing a large-scale sensor network; • Broadcast Communication: instead of the peer-to-peer (unicast) communication of typical process calculi, CSN captures the properties of broadcast communication as favored by sensor networks (with strong impact on their energy consumption); • Ad-hoc Topology: network topology is not required to be programmed in the processes, which would be unrealistic in the case of sensor networks; • Communication Constraints: due to the power limitations of their wireless interface, the sensor nodes can only communicate with their direct neighbors in the network and thus the notion of neighborhood 4 of a sensor node, i.e. the set of sensor nodes within its communication range, is introduced directly in the calculus; • Memory and Processing Constraints: the typical limitations of sensor networks in terms of memory and processing capabilities are captured by explicitly modeling the internal processing (or the intelligence) of individual sensors; • Local Sensing: naturally, the sensors are only able to pick up local measurements of their environment and thus have geographically limited sensitivity. To provide these features, we devise CSN as a two-layer calculus, offering abstractions for data acquisition, communication, and processing. The top layer is formed by a network of sensor nodes immersed in a scalar or vector field (representing the physical process captured by the sensor nodes). The sensor nodes are assumed to be running in parallel. Each sensor node is composed of a collection of labeled methods, which we call a module, and that represents the code that can be executed in the device. A process is executed in the sensor node as a result of a remote procedure call on a module by some other sensor or, seen from the point of view of the callee, as a result of the reception of a message. Sensor nodes are multithreaded and may share state, for example, in a tuple-space. Finally, by adding the notions of position and range, we are able to capture the nature of broadcast communication and the geographical limits of the sensor network applications. The remainder of this paper is structured as follows. The next section describes the syntax and semantics of the CSN calculus. Section III presents several examples of functionalities that can be implemented using CSN and that are commonly required in sensor networks. In Section IV we discuss some design options we made and how we can extend CSN to model other aspects of sensor networks. Finally, Section V presents some conclusions and directions for future work. II. T HE C ALCULUS This section addresses the syntax and the semantics of the Calculus for Sensor Networks. For simplicity, in the remainder of the paper we will refer to a sensor node or a sensor device in a network as a sensor. The syntax is provided by the grammar in Figure 2, and the operational semantics is given by the reduction relation depicted in Figures 3 and 4. 5 N ::= S, F P ::= sensors and field idle Programs idle | P |P parallel composition Sensors | P ; P sequential composition off termination | t.v[~v ] method invocation | N |N composition | install v module update | [P, M ]p,r b sensor | sense (~x) in P field sensing | [P, M ]p,r b {S} broadcast sensor | if v then P else P conditional execution S ::= M ::= {li = (~xi ) Pi }i∈I t ::= net | this Fig. 2. Network Modules v ::= Values x method collection variable | m field measure Targets | p position broadcast | b battery capacity local | M module The syntax of CSN. A. Syntax Let α ~ denote a possible empty sequence α1 . . . αn of elements of the syntactic category α. Assume a countable set of labels, ranged over by letter l, used to name methods within modules, and a countable set of variables, disjoint from the set of labels and ranged over by letter x. Variables stand for communicated values (e.g. battery capacity, position, field measures, modules) in a given program context. The syntax for CNS is found in Figure 2. We explain the syntactic constructs along with their informal, intuitive semantics. Refer to the next section for a precise semantics of the calculus. Networks N denote the composition of sensor networks S with a (scalar or vector) field F . A field is 6 a set of pairs (position, measure) describing the distribution of some physical quantity (e.g. temperature, pressure, humidity) in space. The position is given in some coordinate system. Sensors can measure the intensity of the field in their respective positions. Sensor networks S are flat, unstructured collections of sensors combined using the parallel composition operator. A sensor [P, M ]p,r b represents an abstraction of a physical sensing device and is parametric in its position p, describing the location of the sensor in some coordinate system; its transmission range specified by the radius r of a circle centered at position p; and its battery capacity b. The position of the sensors may vary with time if the sensor is mobile in some way. The transmission range, on the other hand, usually remains constant over time. A sensor with the battery exhausted is designated by off . Inside a sensor there exists a running program P and a module M . A module is a collection of methods defined as l = (~x)P that the sensor makes available for internal and for external usage. A method is identified by label l and defined by an abstraction (~x)P : a program P with parameters ~x. Method names are pairwise distinct within a module. Mutually recursive method definitions make it possible to represent infinite behavior. Intuitively, the collection of methods of a sensor may be interpreted as the function calls of some tiny operating system installed in the sensor. Communication in the sensor network only happens via broadcasting values from one sensor to its neighborhood: the sensors inside a circle centered at position p (the position of the sensor) with radius r . A broadcast sensor [P, M ]p,r b {S} stands for a sensor during the broadcast phase, having already communicated with sensors S . While broadcasting, it is fundamental to keep track of the sensors engaged in communication so far, thus preventing the delivery of the same message to the same sensor during one broadcasting operation. Target sensors are collected in the bag of the sensor emitting the message. Upon finishing the broadcast the bag is emptied out, and the (target) sensors are released into the network. This construct is a run-time construct and is available to the programmer. Programs are ranged over by P . The idle program denotes a terminated thread. Method invocation, t.v[~v ], selects a method v (with arguments ~v ) either in the local module or broadcasts the request to the neighborhood sensors, depending whether t is the keyword this or the keyword net , respectively. Program sense (~x) in P reads a measure from the surrounding field and binds it to ~x within P . Installing or replacing methods in the sensor’s module is performed using the construct install v . The calculus also offers a standard form of branching through the if v then P else P construct. Programs P and Q may be combined in sequence, P ; Q, or in parallel, P | Q. The sequential 7 composition P ; Q designates a program that first executes P and then proceeds with the execution of Q. In contrast, P | Q represents the simultaneous execution of P and Q. Values are the data exchanged between sensors and comprise field measures m, positions p, battery capacities b, and modules M . Notice that this is not a higher-order calculus: communicating a module means the ability to transfer its code to, to retransmit it from, or to install it in a remote sensor. B. Examples Our first example illustrates a network of sensors that sample the field and broadcast the measured values to a special node known as the sink. The sink node may be no different from the other sensors in the network, except that it usually possesses a distinct software module that allows it to collect and process the values broadcasted in the network. The behavior we want to program is the following. The sink issues a request to the network to sample the field; upon reception of the request each sensor samples the field at its position and broadcasts the measured value back to the sink; the sink receives and processes the values. An extended version of this example may be found in Section III-B. The code for the modules of the sensors, MSensor(p, r), and for the sink, MSink(p, r), is given below. Both modules are parametric in the position and in the broadcasting range of each sensor. As for the module equipping the sensors, it has a method sample that, when invoked, propagates the call to its neighborhood (net.sample[];), samples the field (sense x in ... ) and forwards the value to the network ( ... net.forward[p,x] ). Notice that each sensor propagates the original request from the sink. This is required since in general most of the sensors in the network will be out of broadcasting range from the sink. Therefore each sensor echos the request, hopefully covering all the network. Message forwarding will be a recurrent pattern found in our examples. Another method of the sensors’ module is forward that simply forwards the values from other sensors through the network. The module for the sink contains a different implementation of the forward method, since the sink will gather the values sent by the sensors and will log them. Here we leave unspecified the processing done by the log position and value program. The network starts-up with all sensors idle , except for the sink that requests a sampling (net.sample[]). MSensor ( p , r ) = { sample = ( ) net . sample [ ] ; sense x i n net . f o r w a r d [ p , x ] f o r w a r d = ( x , y ) net . f o r w a r d [ x , y ] } MSink ( p , r ) = { forward = ( x , y ) l o g p o s i t i o n a n d v a l u e [ x , y ] } 8 [ net . sample [ ] , MSink ( p , r ) ] [ i d l e , MSensor (p1 ,r1 ) ] p1 ,r1 b1 p,r b | | . . . | [ i d l e , MSensor (pn ,rn ) ] pn ,rn bn The next example illustrates the broadcast, the deployment, and the installation of code. The example runs as follows. The sink node deploys some module in the network (net.deploy[M]) and then seals the sensors (net.seal [] ), henceforth preventing any dynamic re-programming of the network. An extended version of the current example may be found in Section III-E. The code for the modules of the sensors and of the sink is given below. The module M is the one we wish to deploy to the network. It carries the method seal that forwards the call to the network and installs a new version of deploy that does nothing when executed. MSensor ( p , r ) = { deploy = ( x ) net . deploy [ x ] ; i n s t a l l x } MSink ( p , r ) = {} M = { seal = () [ net . deploy [M] ; net . s e a l [ ] , MSink ( p , r ) ] [ i d l e , MSensor (p1 ,r1 ) ] p1 ,r1 b1 i n s t a l l { deploy = ( ) i d l e } } net . s e a l [ ] ; p,r b | | . . . | [ i d l e , MSensor (pn ,rn ) ] pn ,rn bn C. Semantics The calculus has two name bindings: field sensing and method definitions. The displayed occurrence of name xi is a binding with scope P both in sense (x1 , . . . , xi , . . . , xn ) in P and in l = (x1 , . . . , xi , . . . , xn ) P . An occurrence of a name is free if it is not in the scope of a binding. Otherwise, the occurrence of the name is bound. The set of free names of a sensor S is referred as fn(S). Following Milner [20] we present the reduction relation with the help of a structural congruence relation. The structural congruence relation ≡, depicted in Figure 3, allows for the manipulation of term structure, adjusting sub-terms to reduce. The relation is defined as the smallest congruence relation on sensors (and programs) closed under the rules given in Figure 3. The parallel composition operators for programs and for sensors are taken to be commutative and associative with idle and off as their neutral elements, respectively (vide Rules S- MONOID -P ROGRAM and S- MONOID -S ENSOR). Rule S- IDLE - SEQ asserts that idle is also neutral with respect to sequential composition of programs. Rule S- PROGRAM - STRU incorporates structural congruence for programs into sensors. When a sensor is broadcasting a message it uses a bag to collect the sensors as they become 9 P1 | P2 ≡ P2 | P1 , S1 | S2 ≡ S2 | S1 , P | idle ≡ P, P1 | (P2 | P3 ) ≡ (P1 | P2 ) | P3 (S- MONOID -P ROGRAM ) S | off ≡ S, S1 | (S2 | S3 ) ≡ (S1 | S2 ) | S3 (S- MONOID -S ENSOR) idle ; P ≡ P p,r [P, M ]p,r b ≡ [P, M ]b { off } Fig. 3. P1 ≡ P2 p,r [P1 , M ]p,r b ≡ [P2 , M ]b b < max(cin , cout ) [P, M ]p,r b ≡ off (S- IDLE - SEQ, S- PROGRAM - STRU) (S- BROADCAST, S- BAT- EXHAUSTED) Structural congruence for processes and sensors. engaged in communication. Rule S- BROADCAST allows for a sensor to start the broadcasting operation. A terminated sensor is a sensor with insufficient battery capacity for performing an internal or an external reduction step (vide Rule S- BAT- EXHAUSTED). The reduction relation on networks, notation S, F → S ′ , F , describes how sensors S can evolve (reduce) to sensors S ′ , sensing the field F . The reduction is defined on top of a reduction relation for sensors, notation S →F S ′ , inductively defined by the rules in Figure 4. The reduction for sensors is parametric on field F and on two constants cin and cout that represent the amount of energy consumed when performing internal computation steps (cin ) and when broadcasting messages (cout ). Computation inside sensors proceeds by invoking a method (either local—Rules R- METHOD and RNO - METHOD —or remote—Rules R- BROADCAST and R- RELEASE), by sensing values (Rule R- SENSE), and by updating the method collection of the sensor (Rule R- INSTALL). The invocation of a local method li with arguments ~v evolves differently depending on whether or not the definition for li is part of the method collection of the sensor. Rule R- METHOD describes the invocation of a method from module M , defined as M (li ) = (~xi )Pi . The result is the program Pi where the values ~v are bound to the variables in ~x. When the definition for li is not present in M , we have decided to actively wait for the definition (see Rule R- NO - METHOD). Usually invoking an undefined method causes a program to get stuck. Typed programming languages use a type system to ensure that there are no invocations to undefined methods, ruling out all other programs at compile time. At runtime, another possible choice would be to simply discard invocations to undefined methods. Our choice provides more resilient applications when coupled with the procedure for deploying code in a sensor 10 M (li ) = (~xi )Pi b ≥ cin [this .li [~v ] ; P1 | P2 , M ]p,r → [P [~ v xi ] ; P1 | P2 , M ]p,r F i /~ b b−cin (R- METHOD) li 6∈ dom(M ) [this .li [~v ] ; P1 | P2 , M ]p,r v ] ; P1 | P2 , M ]p,r b →F [this .li [~ b d(p, p′ ) < r (R- NO - METHOD) b ≥ cout ′ (R- BROADCAST) ′ ′ ′ p ,r → [net .li [~v ] ; P1 | P2 , M ]p,r F b {S} | [P , M ]b′ ′ ′ ′ [net .li [~v ] ; P1 | P2 , M ]p,r v ], M ′ ]pb′ ,r } b {S | [P | this .li [~ p,r [net .li [~v ] ; P1 | P2 , M ]p,r b {S} →F [P1 | P2 , M ]b−cout | S (R- RELEASE) b ≥ cin ′ p,r ; P1 | P2 , M ]p,r b →F [P1 | P2 , M + M ]b−cin (R- INSTALL) [ install M′ [sense (~x) in P ; S 1 →F S 2 S | S 1 →F S | S 2 b ≥ cin →F [P [F (p)/~x] ; P1 | P2 , M ]p,r b−cin S1 ≡ S2 S 2 →F S 3 S 1 →F S 4 S3 ≡ S4 S →F S ′ S, F → S ′ , F Fig. 4. (R- SENSE) P1 | P2 , M ]p,r b (R- PARALLEL, R- STRUCTURAL) (R- NETWORK) Reduction semantics for processes and networks. network. We envision that if we invoke a method in the network after some code has been deployed (see Example III-D), there may be some sensors where the method invocation arrives before the deployed code. With the semantics we propose, the call actively waits for the code to be installed. Sensors communicate with the network by broadcasting messages. A message consists of a remote method invocation on unspecified sensors in the neighborhood of the emitting sensor. In other words, the messages are not targeted to a particular sensor (there is no peer-to-peer communication). The neighborhood of a sensor is defined by its communication radius, but there is no guarantee that a message broadcasted by a given sensor arrives at all surrounding sensors. There might be, for instance, landscape obstacles that prevent two sensors, otherwise within range, from communicating with each other. Also, 11 during a broadcast operation the message must only reach each neighborhood sensor once. Notice that we are not saying that the same message can not reach the same sensor multiple times. In fact it might, but as the result of the echoing of the message in subsequent broadcast operations. We model the broadcasting of messages in two stages. Rule R- BROADCAST invokes method li in the remote sensor, provided that the distance between the emitting and the receiving sensors is less that the transmission radius (d(p, p′ ) < r ). The sensor receiving the message is put in the bag of the emitting sensor, thus preventing multiple deliveries of the same message while broadcasting. Observe that the rule does not enforce the interaction with all sensors in the neighborhood. Rule R- RELEASE finishes the broadcast by consuming the operation (net .li [~v ]), and by emptying out the contents of the emitting sensor’s bag. A broadcast operation starts with the application of Rule S- BROADCAST, proceeds with multiple (eventually none) applications of Rule R- BROADCAST (one for each target sensor), and terminates with the application of Rule R- RELEASE. Installing module M ′ in a sensor with a module M , Rule R- INSTALL, amounts to add to M the methods in M ′ (absent in M ), and to replace (in M ) the methods common to both M and M ′ . Rigorously, the operation of installing module M ′ on top of M , denoted M + M ′ , may be defined as M + M ′ = (M \ M ′ ) ∪ M ′ . The + operator is reminiscent of Abadi and Cardelli’s operator for updating methods in their imperative object calculus [2]. A sensor senses the field in which it is immersed, Rule R- SENSE, by sampling the value of the field F in its position p and, continues the computation replacing this value for the bound variables ~x in program P . Rule R- PARALLEL allows reduction to happen in networks of sensors and Rule R- STRUCTURAL brings structural congruence into the reduction relation. D. The Operational Semantics Illustrated To illustrate the operational semantics of CNS, we present the reduction steps for the examples discussed at the end of Section II-B. During reduction we suppress the side annotations when writing the sensors. Due to space constraints we consider a rather simple network with just the sink and another sensor. [ net . sample [ ] , MSink ( p , r ) ] | [ i d l e , MSensor (p1 ,r1 ) ] We assume that the sensor is within range from the sink and vice-versa. This network may reduce as follows: 12 [net.sample[],MSink(p,r)] | [ idle ,MSensor(p1 ,r1 )] ≡ (S- BROADCAST) [net.sample[],MSink(p,r)]{off} | [ idle ,MSensor(p1 ,r1 )] →≡ (d(p, p1 ) < r , R- BROADCAST, S- MONOID -S ENSOR) [net.sample[],MSink(p,r)] {[this.sample[] || idle ,MSensor(p1 ,r1 )]} →≡ (R- RELEASE, S- MONOID -P ROGRAM ) [ idle ,MSink(p,r)] | [this.sample[],MSensor(p1 ,r1 )] → (R- METHOD) [ idle ,MSink(p,r)] | [net.sample[]; sense x in net.forward[p1 ,x],MSensor(p1 ,r1 )] ≡ (S- BROADCAST) [ idle ,MSink(p,r)] | [net.sample[]; sense x in net.forward[p1 ,x],MSensor(p1 ,r1 )]{off} → (R- RELEASE) [ idle ,MSink(p,r)] | [sense x in net.forward[p1 ,x],MSensor(p1 ,r1 )] → [ idle ,MSink(p,r)] | [net.forward[p1 ,F (p1 )], MSensor(p1 ,r1 )] ≡ (R- SENSE) (S- MONOID -S ENSOR) [net.forward[p1 ,F (p1 )], MSensor(p1 ,r1 )] | [idle,MSink(p,r)] ≡ (S- BROADCAST) [net.forward[p1 ,F (p1 )], MSensor(p1 ,r1 )]{off} | [idle,MSink(p,r)] →≡ (d(p1 , p) < r1 , R- BROADCAST, S- MONOID -S ENSOR) [net.forward[p1 ,F (p1 )], MSensor(p1 ,r1 )]{[this.forward[p1 ,F (p1 )] || idle, MSink(p,r)]} →≡ (R- RELEASE, S- MONOID -P ROGRAM ) [ idle , MSensor(p1 ,r1 )] | [this.forward[p1 ,F (p1 )], MSink(p,r)] → [ idle , MSensor(p1 ,r1 )] | [log position and value[p1 ,F (p1 )], MSink(p,r)] ≡ (R- METHOD) (S- MONOID -S ENSOR) [log position and value[p1 ,F (p1 )] | [idle, MSensor(p1 ,r1 )], MSink(p,r)] So, after these reduction steps the sink gets the field values from the sensor at position p1 and logs them. The sensor at p1 is idle waiting for further interaction. Following we present the reduction step for our second (and last) example of Section II-B where we illustrate the broadcast, the deployment, and the installation of code. Again, due to space restrictions, we use a very simple network with just the sink and another sensor, both within reach of each other. [ net . deploy [M] ; net . s e a l [ ] , MSink ( p , r ) ] | [ i d l e , MSensor (p1 ,r1 ) ] 13 This network may reduce as follows: [net.deploy[M]; net.seal [], MSink(p,r)] | [ idle ,MSensor(p1 ,r1 )] ≡ (S- BROADCAST) [net.deploy[M]; net.seal [], MSink(p,r)]{off} | [ idle ,MSensor(p1 ,r1 )] →≡ (d(p, p1 ) < r , R- BROADCAST, S- MONOID -S ENSOR) [net.deploy[M]; net.seal [], MSink(p,r)] | {[this.deploy[M] || idle , MSensor(p1 ,r1 )]} →≡ (R- RELEASE, S- MONOID -P ROGRAM ) [net.seal [], MSink(p,r)] | [this.deploy[M], MSensor(p1 ,r1 )] → [net.seal [], MSink(p,r)] | [net.deploy[M]; install M, MSensor(p1 ,r1 )] ≡ (R- METHOD) (S- BROADCAST) [net.seal [], MSink(p,r)] | [net.deploy[M]; install M, MSensor(p1 ,r1 )]{off} →≡ (R- RELEASE, S- MONOID -S ENSOR) [net.seal [], MSink(p,r)] | [ install M, MSensor(p1 ,r1 )] → (R- INSTALL) [net.seal [], MSink(p,r)] | [ idle , MSensor(p1 ,r1 )+M] ≡ (S- BROADCAST) [net.seal [], MSink(p,r)]{off} | [ idle , MSensor(p1 ,r1 )+M] →≡ (d(p, p1 ) < r , R- BROADCAST, S- MONOID -S ENSOR) [net.seal [], MSink(p,r)] {[this.seal [] || idle , MSensor(p1 ,r1 )+M]} →≡ (R- RELEASE, S- MONOID -P ROGRAM ) [ idle ,MSink(p,r)] | [this.seal [], MSensor(p1 ,r1 )+M] → (R- METHOD) [ idle ,MSink(p,r)] | [net.seal []; install {deploy = () idle }, MSensor(p1 ,r1 )+M] ≡ (S- BROADCAST) [ idle ,MSink(p,r)] | [net.seal []; install {deploy = () idle }, MSensor(p1 ,r1 )+M]{off} →≡ (R- RELEASE, S- MONOID -S ENSOR) [ idle ,MSink(p,r)] | [ install {deploy = () idle}, MSensor(p1 ,r1 )+M] → (R- INSTALL) [ idle ,MSink(p,r)] | [ idle , MSensor(p1 ,r1 )+M+{deploy = () idle}] After these reductions, the sink is idle after deploying the code to the sensor at p. The sensor at p is also idle, waiting for interaction, but with the code for the module M installed and with the deploy method disabled. 14 III. P ROGRAMMING E XAMPLES In this section we present some examples, programmed in CSN, of typical operations performed on networks of sensors. Our goal is to show the expressiveness of the CSN calculus just presented and also to identify some other aspects of these networks that may be interesting to model. In the following examples, we denote as MSensor and MSink the modules installed in any of the anonymous sensors in the network and the modules installed in the sink, respectively. Note also that all sensors are assumed to have a builtin method, deploy, that is responsible for installing new modules. The intuition is that this method is part of the tiny operating system that allows sensors to react when first placed in the field. Finally, we assume in these small examples that the network layer supports scoped flooding. We shall see in the next section that this can be supported via software with the inclusion of state in sensors. A. Ping We start with a very simple ping program. Each sensor has a ping method that when invoked calls a method forward in the network with its position and battery charge as arguments. When the method forward is invoked by a sensor in the network, it just triggers another call to forward in the network. The sink has a distinct implementation of this method. Any incomming invocation logs the position and battery values given as arguments. So, the overall result of the call net.ping [] in the sink is that all reachable sensors in the network will, in principle, receive this call and will flood the network with their positions and battery charge values. These values eventually reach the sink and get logged. MSensor ( p , b ) = { ping = () net . f o r w a r d [ p , b ] ; net . ping [ ] forward = ( x , y ) net . f o r w a r d [ x , y ] } MSink ( p , b ) forward = { = ( x , y ) log position and power [ x , y ] } [ net . ping [ ] , MSink ( p , b ) ] [ i d l e , MSensor (p1 ,b1 ) ] p1 ,r1 b1 p,r b | | . . . | [ i d l e , MSensor (pn ,bn ) ] 15 pn ,rn bn B. Querying This example shows how we can program a network with a sink that periodically queries the network for the readings of the sensors. Each sensor has a sample method that samples the field using the sense construct and calls the method forward in the neighbourhood with its position and the value sampled as arguments. The call then queries the neighbourhood recursively with a replica of the original call. The original call is, of course, made from the sink, which has a method start sample that calls the method sample in the network within a cycle. Note that, if the sink had a method named sample instead of start sample, it might get a call to sample from elsewhere in the network that could interfere with the sampling control cycle. MSensor ( p ) = { sample = () sense ( x ) i n net . f o r w a r d [ p , x ] ; net . sample [ ] forward = ( x , y ) net . f o r w a r d [ x , y ] } MSink ( p ) = { start sample = () net . sample [ ] ; t h i s . s t a r t s a m p l e [ ] forward = (x , y ) log position and value [ x , y ] } [ t h i s . s t a r t s a m p l e [ ] , MSink ( p ) ] [ i d l e , MSensor (p1 ) ] p1 ,r1 b1 | ... p,r b | | [ i d l e , MSensor (pn) ] pn ,rn bn C. Polling In this example the cycle of the sampling is done in each sensor, instead of in the sink, as in the previous example. The sink just invokes the method start sample once. This method propagates the call through the network and invokes sample, for each sensor. This method samples the field, within a cycle, and forwards the result to the network. This implementation requires less broadcasts than the previous one as the sink only has to call start sample on the network once. On the other hand, it increases the amount of processing per sensor. MSensor ( p ) = { start sample = () net . s t a r t s a m p l e [ ] ; t h i s . sample [ ] sample = () sense ( x ) i n net . f o r w a r d [ p , x ] ; t h i s . sample [ ] forward = ( x , y ) net . f o r w a r d [ x , y ] 16 } MSink ( p ) = { = (x , y ) log position and value [ x , y ] forward } [ net . s t a r t e x a m p l e [ ] , MSink ( p ) ] [ i d l e , MSensor (p1 ) ] p1 ,r1 b1 | ... p,r b | | [ i d l e , MSensor (pn) ] pn ,rn bn D. Code deployment The above examples assume we have some means of deploying the code to the sensors. In this example we address this problem and show how it can be programmed in CSN. The code we wish to deploy and execute is the same as the one in the previous example. To achieve this goal, the sink first calls the deploy method on the network to install the new module with the methods start sample, sample and forward as above. This call recursively deploys the code to the sensors in the network. The sink then calls start sample to start the sampling, again as above, and waits for the forwarded results on the method forward. MSensor ( p ) = { deploy = (x) i n s t a l l x ; net . deploy [ x ] = (x,y) log position and value [ x , y ] start sample = () net . s t a r t s a m p l e [ ] ; t h i s . sample [ ] sample = () sense ( x ) i n net . f o r w a r d [ p , x ] ; t h i s . sample [ ] forward = ( x , y ) net . f o r w a r d [ x , y ] } MSink ( p ) = { forward } [ net . deploy [ { }]; net . s t a r t s a m p l e [ ] , MSink ( p ) ] [ i d l e , MSensor (p1 ) ] p1 ,r1 b1 | ... p,r b | | [ i d l e , MSensor (pn) ] pn ,rn bn A refined version of this code, one that avoids the start sample method completely, can be programmed. Here, we deploy the code for all sensors by sending methods sample and forward to all the sensors in the network by invoking deploy. Once deployed, the code is activated with a call to sample in the sink, instead of using the start sample method as above. 17 MSensor ( p ) = { deploy = (x) i n s t a l l x ; net . deploy [ x ] } MSink ( p ) forward = { = (x , y) log position and value [ x , y ] } [ net . deploy [ { sample = () net . sample [ ] ; i n s t a l l { sample = ( ) sense ( x ) i n net . f o r w a r d [ p , x ] ; t h i s . sample [ ] } ; t h i s . sample [ ] forward = ( x , y ) net . f o r w a r d [ x , y ] }]; net . sample [ ] , MSink ( p ) ] [ i d l e , MSensor (p1 ) ] p1 ,r1 b1 p,r b | | ... | [ i d l e , MSensor (pn) ] pn ,rn bn Notice that the implementation of the method sample has changed. Here, when the method is executed for the first time at each sensor, it starts by propagating the call to its neighborhood and then, it changes itself through an install call. The newly installed code of sample is the same as the one in the first implementation of the example. The method then continues to execute and calls the new version of sample, which starts sampling the field and forwarding values. E. Sealing sensors This example shows how we can install a sensor network with a module that contains a method, seal, that prevents any further dynamic re-programming of the sensors, preventing anyone from tampering with the installed code. The module also contains a method, unseal that restores the original deploy method, thus allowing dynamic re-programming again. The sink just installs the module containning these methods in the network by broadcasting a method call to deploy. Each sensor that receives the call, installs the module and floods the neighborhood with a replica of the call. Another message by the sink then replaces the deploy method itself and re-implements it to idle . This prevents any further instalation of software in the sensors and thus effectively seals the network from external interaction other than the one allowed by the remainder of the methods in the modules of the sensors. 18 MSensor deploy = { = ( x ) i n s t a l l x ; net . deploy [ x ] } MSink = { } [ net . deploy [ { seal = () i n s t a l l { deploy = ( ) idle } uns eal = () i n s t a l l { deploy = ( x ) i n s t a l l x ; net . deploy [ x ] } }]; net . s e a l [ ] , MSink ] [ i d l e , MSensor ] p1 ,r1 b1 p,r b | | . . . | [ i d l e , MSensor ] pn ,rn bn IV. D ISCUSSION In the previous sections, we focused our attention on the programming issues of a sensor network and presented a core calculus that is expressive enough to model fundamental operations such as local broadcast of messages, local sensing of the environment, and software module updates. CSN allows the global modeling of sensor networks in the sense that it allows us to design and implement sensor network applications as large-scale distributed applications, rather than giving the programmer a sensor-by-sensor view of the programming task. It also provides the tools to manage running sensor networks, namely through the use of the software deployment capabilities. There are other important features of sensor networks that we consciously left out of CSN. In the sequel we discuss some of these features and sketch some ideas of how we would include support for them. a) State: From a programming point of view, adding state to sensors is essential. Sensors have some limited computational capabilities and may perform some data processing before sending it to the sink. This processing assumes that the sensor is capable of buffering data and thus maintain some state. In a way, CSN sensors have state. Indeed, the atributes p, b, and r may be viewed as sensor state. Since these are characteristic of each sensor and are usually controlled at the hardware level, we chose to represent this state as parameters of the sensors. The programmer may read these values at any time through builtin method calls but any change to this data is performed transparently for the programmer by the hardware or operating system. As we mentioned before, it is clear that the value of b changes with time. The 19 position p may also change with time if we envision our sensors endowed with some form of mobility (e.g., sensors dropped in the atmosphere or flowing in the ocean). To allow for a more systematic extension of our sensors with state variables we can assume that each sensor has a heap H where the values of these variables are stored: [H, P, M ]p,r b . The model chosen for this heap is orthogonal to our sensor calculus and for this discussion we assume that we enrich the values v of the language with a set of keys, ranged over by k. Our heap may thus be defined as a map H from keys into values. Intuitively, we can think of it as an associative memory with the usual built-in operations put, get, lookup, and hash. Programs running in the sensors may share state by exchanging keys. We assume also that these operations are atomic and thus no race conditions can arise. With this basic model for a heap we can re-implement the Ping example from Section III-A with scoped flooding thus eliminating echos by software. We do this by associating a unique key to each remote procedure call broadcast to the network. This key is created through the built-in hash function that takes as arguments the position p and the battery b of the sensor. Each sensor, after receiving a call to ping, propagates the call to its neighborhood and generates a new key to send, with its position and battery charge, in a forward call. Then, it stores the key in its heap to avoid forwarding its own forward call. On the other hand, each time a sensor receives a call to forward, it checks whether it has the key associated to the call in its heap. If so, it does nothing. If not, it forwards the call and stores the key in the heap, to avoid future re-transmission. MSensor ( p , b ) = { ping = () net . ping [ ] ; l e t k = hash [ p , b ] i n net . f o r w a r d [ p , b , k ] ; put [ k , ] forward = ( x , y , k ) i f ( ! lookup [ k ] ) then net . f o r w a r d [ x , y , k ] ; put [ k , ] } MSink ( p , b ) = {...} p,r | b MSensor (p1 ,b1 ) ] pb11 ,r1 [ net . ping [ ] , MSink ] [ idle , | . . . | [ i d l e , MSensor (pn ,bn ) ] pn ,rn bn b) Events: Another characteristic of sensors is their modus operandi. Some sensors sample the field as a result of instructions implemented in the software that controls them. Such is the case with CSN 20 sensors. The programmer is responsible for controlling the sensing activity of the sensor network. It is of course possible for sensor nodes to be activated in different ways. For example, some may have their sensing routines implemented at hardware or operating system level and thus not directly controllable by the programmer. Such classes of sensor nodes tipically sample the field periodically and are activated when a given condition arises (e.g., a temperature above or below a given threshold, the detection of CO2 above a given threshold, the detection of a strong source of infrared light). The way in which certain environmental conditions or events can activate the sensor is by triggering the execution of a handler procedure that processes the event. Support for this kind of event-driven sensors in CSN could be achieved by assuming that each sensor has a builtin handler procedure, say handle, for such events. The handler procedure, when activated, receives the value of the field that triggered the event. Note that, from the point of view of the sensor, the occurrence of such an event is equivalent to the deployment of a method invocation this.handle[v] in its processing core, where v is the field value associated with the event. The sensor has no control over this deployment, but may be programmed to react in different ways to these calls, by providing adequate implementations of the handle routine. The events could be included in the semantics given in Section II-C with the following rule: p,r [P, M ]p,r b →F [this .handle [F (p)] | P , M ]b (R- EVENT) As in the case of the builtin method for code deployment, the handler could be programmed to change the behavior of the network in the presence of events. One could envision the default handler as handle = (x) idle , which ignores all events. Then, we could change this default behavior so that an event triggers an alarm that gets sent to the sink. A possible implementation of such a dynamic re-programming of the network default handlers can be seen in the code below. MSensor ( p ) = { handle = ( x ) idle } MSink ( p ) = { handle = ( x ) idle } [ net . deploy [ { handle = ( x ) alarm net . alarm [ p , x ] = ( x , y ) net . alarm [ x , y ] }]; i n s t a l l { alarm MSink ( p ) ] p,r b = (x , y) sing bell [ x , y ]} , | [ i d l e , MSensor (p1 ) ] p1 ,r1 b1 | ... | [ i d l e , MSensor (pn) ] 21 pn ,rn bn where the default implementation of the handle procedure is superseded by one that eventualy triggers an alarm in the sink. More complex behavior could be modeled for sensors that take multiple readings, with a handler associated with each event. c) Security: Finally, another issue that is of outmost importance in the management of sensor networks is security. It is important to note that many potential applications of sensor networks are in high risk situations. Examples may be the monitorization of ecological disaster areas, volcanic or sismic activity, and radiation levels in contaminated areas. Secure access to data is fundamental to establish its credibility and for correctly assessing risks in the management of such episodes. In CSN we have not taken security issues into consideration. This was not our goal at this time. However, one feature of the calculus may provide interesting solutions for the future. In fact, in CSN, all computation within a sensor results from an invocation of methods in the modules of a sensor, either originating in the network or from within the sensor. In a sense the modules M of the sensor work as a firewall that can be used to control incomming messages and implement security protocols. Thus, all remote method invocations and software updates might first be validated locally with methods of the sensor’s modules and only then the actions would be performed. The idea of equipping sensors, or in general domains, with some kind of membrane that filters all the interactions with the surrounding network has been explored, for instance, in [6], in the M-calculus [25], in the Kell calculus [26], in the Brane calculi [7], in Miko [18], and in [12]. One possible development is to incorporate some features of the membrane model into CSN. The current formulation of the calculus also assumes that all methods in the module M of a sensor [P, M ]p,r b are visible from the network. It is possible to implement an access policy to methods in such a way that some methods are private to the sensor, i.e., can only be invoked from within the sensor. This allows, for example, the complete encapsulation of the state of the sensor. V. C ONCLUSIONS AND F UTURE W ORK Aiming at providing large-scale sensor networks with a rigorous and adequate programming model (upon which operating systems and high-level programming languages can be built), we presented CSN — a Calculus for Sensor Networks, developed specifically for this class of distributed systems. After identifying the necessary sensing, processing, and wireless broadcasting features of the calculus, we opted to base our work on a top-layer abstraction of physical and link layer communication issues (in contrast with previous work on wireless network calculi [19, 23]), thus focusing on the system 22 requirements for programming network-wide applications. This approach resulted in the CSN syntax and semantics, whose expressiveness we illustrated through a series of implementations of typical operations in sensor networks. Also included was a detailed discussion of possible extensions to CSN to account for other important properties of sensors such as state, sampling strategies, and security. As part of our ongoing efforts, we are currently using CSN to establish a mathematical framework for reasoning about sensor networks. One major objective of this work consists in providing formal proofs of correctness for data gathering protocols that are commonly used in current sensor networks and whose performance and reliability has so far only been evaluated through computer simulations and ad-hoc experiments. From a more practical point of view, the focus will be set on the development of a prototype implementation of CSN. This prototype will be used to emulate the behavior of sensor networks by software and, ultimately, to port the programming model to a natural development architecture for sensor network applications. ACKNOWLEDGEMENTS The authors gratefully acknowledge insightful discussions with Gerhard Maierbacher (Departamento de Ciência de Computadores, Faculdade de Ciências, Universidade do Porto). R EFERENCES [1] The TinyOS Documentation Project. Available at http://www.tinyos.org. [2] M. Abadi and L. Cardelli. An Imperative Object Calculus. In TAPSOFT ’95: Theory and Practice of Software Development, number 915 in LNCS, pages 471–485. Springer-Verlag, 1995. [3] I. Akyildiz, W. Su, Y. Sankarasubramaniam, and E. Cayirci. A survey on sensor networks. IEEE Communications Magazine, 40(8):102–114, 2002. [4] J. Barros and S. D. Servetto. Network information flow with correlated sources. IEEE Transactions on Information Theory, Vol. 52, No. 1, pp. 155-170, January 2006. [5] G. Boudol. Asynchrony and the pi-calculus. Technical Report 1702, INRIA, Institut National de Recherche en Informatique et en Automatique, 1992. [6] G. Boudol. A generic membrane model. In Global Computing Workshop, volume 3267 of LNCS, pages 208–222. SpringerVerlag, 2005. [7] L. Cardelli. Brane calculi: Interactions of biological membranes. In Proceedings of CMSB’04, volume 3082 of LNCS, pages 257–280. Springer-Verlag, 2004. [8] D. E. Culler and H. Mulder. Smart sensors to network the world. Scientific American, 2004. 23 [9] C.-L. Fok, G.-C. Roman, and C. Lu. Rapid Development and Flexible Deployment of Adaptive Wireless Sensor Network Applications. In Proceedings of the 24th International Conference on Distributed Computing Systems (ICDCS’05), pages 653–662. IEEE, June 2005. [10] C. Fournet and G. Gonthier. The Reflexive Chemical Abstract Machine and the Join-Calculus. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’96), pages 372–385. ACM, 1996. [11] D. Gay, P. Levis, R. von Behren, M. Welsh, E. Brewer, and D. Culler. The nesC Language: A Holistic Approach to Network Embedded Systems. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI)., 2003. [12] D. Gorla, M. Hennessy, and V. Sassone. Security policies as membranes in systems for global computing. In Proceedings of FGUC’04, ENTCS. Elsevier Science, 2004. [13] K. Honda and M. Tokoro. An object calculus for asynchronous communication. In Proceedings of the ECOOP ’91 European Conference on Object-oriented Programming, LNCS 512, pages 133–147. Springer-Verlag, 1991. [14] Z. Hu and B. Li. On the fundamental capacity and lifetime limits of energy-constrained wireless sensor networks. In Proceedings of the 10th IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS 2004), pages 38–47, Toronto, Canada, 2004. [15] J. W. Hui and D. Culler. The Dynamic Behavior of a Data Dissemination Protocol for Network Programming at Scale. In Proceedings of the 2nd international conference on Embedded networked sensor systems, pages 81–94. ACM Press, 2004. [16] R. Pugliese L. Bettini, R. De Nicola. X-Klaim and Klava: Programming Mobile Code. TOSCA 2001, Electronic Notes on Theoretical Computer Science, Elsevier, 62, 2001. [17] P. Levis and D. Culler. Maté: A tiny virtual machine for sensor networks. In International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS X), 2002. [18] F. Martins, L. Salvador, V. Vasconcelos, and L. Lopes. Miko: Mikado koncurrent objects. Technical Report 05081, Dagstuhl Seminar, 2005. [19] N. Mezzetti and D. Sangiorgi. Towards a Calculus for Wireless Systems. In Proc. MFPS ’06, volume 158 of ENTCS, pages 331–354. Elsevier, 2006. [20] R. Milner. A Calculus of Communicating Systems, volume 92. Springer-Verlag, 1980. [21] R. Milner, J. Parrow, and D. Walker. A calculus of mobile processes, (Parts I and II). Information and Computation, 100:1–77, 1992. [22] K. Ostrovský, K. V. S. Prasad, and W. Taha. Towards a Primitive Higher Order Calculus of Broadcasting Systems. In PPDP’02, International Conference on Principles and Practice of Declarative Programming, 2002. [23] K. V. S. Prasad. A Calculus of Broadcasting Systems. In TAPSOFT, Volume 1, pages 338–358, 1991. [24] A. Scaglione and S. D. Servetto. On the Interdependence of Routing and Data Compression in Multi-Hop Sensor Networks. In Proc. ACM MobiCom, Atlanta, GA, 2002. [25] A. Schmitt and J.-B. Stefani. The M-calculus: a higher-order distributed process calculus. In Proceedings of POPL’03, pages 50–61. ACM Press, 2003. [26] J.-B. Stefani. A calculus of Kells. In Proceedings of FGC’03, volume 85(1). Elsevier Science, 2003. [27] V. Vasconcelos, L. Lopes, and F. Silva. Distribution and Mobility with Lexical Scoping in Process Calculi. In Workshop on High Level Programming Languages (HLCL’98), volume 16(3) of ENTCS, pages 19–34. Elsevier Science, 1998. [28] P. T. Wojciechowski and P. Sewell. Nomadic Pict: Language and Infrastructure Design for Mobile Agents. Concurrency, 8(2):42–52, /2000. 24 IEEE 1 A Calculus for Sensor Networks Miguel S. Silva∗ , Francisco Martins†, Luı́s Lopes∗ , and João Barros∗ ∗ Departamento de Ciência de Computadores & LIACC Faculdade de Ciências da Universidade do Porto, Portugal. arXiv:cs/0612093v1 [cs.DC] 19 Dec 2006 † Departamento de Informática Faculdade de Ciências da Universidade de Lisboa, Portugal. Abstract We consider the problem of providing a rigorous model for programming wireless sensor networks. Assuming that collisions, packet losses, and errors are dealt with at the lower layers of the protocol stack, we propose a Calculus for Sensor Networks (CSN) that captures the main abstractions for programming applications for this class of devices. Besides providing the syntax and semantics for the calculus, we show its expressiveness by providing implementations for several examples of typical operations on sensor networks. Also included is a detailed discussion of possible extensions to CSN that enable the modeling of other important features of these networks such as sensor state, sampling strategies, and network security. keywords: Sensor Networks, Ad-Hoc Networks, Ubiquitous Computing, Process-Calculi, Programming Languages. I. I NTRODUCTION A. The Sensor Network Challenge Sensor networks, made of tiny, low-cost devices capable of sensing the physical world and communicating over radio links [?], are significantly different from other wireless networks: (a) the design of a sensor network is strongly driven by its particular application, (b) sensor nodes are highly constrained in terms of power consumption and computational resources (CPU, memory), and (c) large-scale sensor applications require self-configuration and distributed software updates without human intervention. Previous work on fundamental aspects of wireless sensor networks has mostly focused on communication-oriented models, in which the sensor nodes are assumed to store and process the data, coordinate their transmissions, organize the routing of messages within the network, and relay the data to a remote receiver (see e.g. [?, ?, ?] and references therein). Although some of these models provide useful insights (e.g. into the DRAFT 2 Fig. 1. A wireless sensor network is a collection of small devices that, once deployed on a target area, organize themselves in an ad-hoc network, collect measurements of a physical process and transmit the data over the wireless medium to a data fusion center for further processing. connectivity characteristics or the overall power efficiency of sensor networks) there is a strong need for formal methods that capture the inherent processing and memory constraints, and illuminate the massively parallel nature of the sensor nodes’ in-network processing. If well adapted to the specific characteristics of sensor networks, a formalism of this kind, specifically a process calculus, is likely to have a strong impact on the design of operating systems, communication protocols, and programming languages for this class of distributed systems. In terms of hardware development, the state-of-the-art is well represented by a class of multi-purpose sensor nodes called motes1 [?], which were originally developed at UC Berkeley and are being deployed and tested by several research groups and start-up companies. In most of the currently available implementations, the sensor nodes are controlled by module-based operating systems such as TinyOS [?] and programming languages like nesC [?] or TinyScript/Maté [?]. In our view, the programming models 1 Trademark of Crossbow Technology, Inc. DRAFT 3 underlying most of these tools have one or more of the following drawbacks: 1) they do not provide a rigorous model (or a calculus) of the sensor network at the programming level, which would allow for a formal verification of the correctness of programs, among other useful analysis; 2) they do not provide a global vision of a sensor network application, as a specific distributed application, making it less intuitive and error prone for programmers; 3) they require the programs to be installed on each sensor individually, something unrealistic for large sensor networks; 4) they do not allow for dynamic re-programming of the network. Recent middleware developments such as Deluge [?] and Agilla [?] address a few of these drawbacks by providing higher level programming abstractions on top of TinyOS, including massive code deployment. Nevertheless, we are still far from a comprehensive programming solution with strong formal support and analytical capabilities. The previous observation motivates us to design a sensor network programming model from scratch. Beyond meeting the challenges of network-wide programming and code deployment, the model should be capable of producing quantitative information on the amount of resources required by sensor network programs and protocols, and also of providing the necessary tools to prove their correctness. B. Related Work Given the distributed and concurrent nature of sensor network operations, we build our sensor network calculus on thirty years of experience gathered by concurrency theorists and programming language designers in pursuit of an adequate formalism and theory for concurrent systems. The first steps towards this goal were given by Milner [?] with the development of CCS (Calculus of Communicating Systems). CCS describes computations in which concurrent processes may interact through simple synchronization, without otherwise exchanging information. Allowing processes to exchange resources (e.g., links, memory references, sockets, code), besides synchronizing, considerably increases the expressive power of the formal systems. Such systems, known as process-calculi, are able to model the mobility patterns of the resources and thus constitute valuable tools to reason about concurrent, distributed systems. The first such system, built on Milner’s work, was the π -calculus [?]. Later developments of this initial proposal allowed for further simplification an provided an asynchronous form of the calculus [?, ?]. Since then, several calculi have been proposed to model concurrent distributed systems and for many there are DRAFT 4 prototype implementations of programming languages and run-time systems (e.g. Join [?], TyCO [?], X-Klaim [?], and Nomadic Pict [?]). Previous work by Prasad [?] established the first process calculus approach to modeling broadcast based systems. Later work by Ostrovský, Prasad, and Taha [?] established the basis for a higher-order calculus for broadcasting systems. The focus of this line of work lies in the protocol layer of the networks, trying to establish an operational semantics and associated theory that allows assertions to be made about the networks. More recently, Mezzetti and Sangiorgi [?] discuss the use of process calculi to model wireless systems, again focusing on the details of the lower layers of the protocol stack (e.g. collision avoidance) and establishing an operational semantics for the networks. C. Our Contributions Our main contribution is a sensor network programming model based on a process calculus, which we name Calculus of Sensor Networks (CSN). Our calculus offers the following features that are specifically tailored for sensor networks: • Top-Level Approach: CSN focuses on programming and managing sensor networks and so it assumes that collisions, losses, and errors have been dealt with at the lower layers of the protocol stack and system architecture (this distinguishes CSN from the generic wireless network calculus presented in [?]); • Scalability: CSN offers the means to provide the sensor nodes with self-update and self-configuration abilities, thus meeting the challenges of programming and managing a large-scale sensor network; • Broadcast Communication: instead of the peer-to-peer (unicast) communication of typical process calculi, CSN captures the properties of broadcast communication as favored by sensor networks (with strong impact on their energy consumption); • Ad-hoc Topology: network topology is not required to be programmed in the processes, which would be unrealistic in the case of sensor networks; • Communication Constraints: due to the power limitations of their wireless interface, the sensor nodes can only communicate with their direct neighbors in the network and thus the notion of neighborhood of a sensor node, i.e. the set of sensor nodes within its communication range, is introduced directly in the calculus; • Memory and Processing Constraints: the typical limitations of sensor networks in terms of memory and processing capabilities are captured by explicitly modeling the internal processing (or the intelligence) of individual sensors; DRAFT 5 • Local Sensing: naturally, the sensors are only able to pick up local measurements of their environment and thus have geographically limited sensitivity. To provide these features, we devise CSN as a two-layer calculus, offering abstractions for data acquisition, communication, and processing. The top layer is formed by a network of sensor nodes immersed in a scalar or vector field (representing the physical process captured by the sensor nodes). The sensor nodes are assumed to be running in parallel. Each sensor node is composed of a collection of labeled methods, which we call a module, and that represents the code that can be executed in the device. A process is executed in the sensor node as a result of a remote procedure call on a module by some other sensor or, seen from the point of view of the callee, as a result of the reception of a message. Sensor nodes are multithreaded and may share state, for example, in a tuple-space. Finally, by adding the notions of position and range, we are able to capture the nature of broadcast communication and the geographical limits of the sensor network applications. The remainder of this paper is structured as follows. The next section describes the syntax and semantics of the CSN calculus. Section III presents several examples of functionalities that can be implemented using CSN and that are commonly required in sensor networks. In Section IV we discuss some design options we made and how we can extend CSN to model other aspects of sensor networks. Finally, Section V presents some conclusions and directions for future work. II. T HE C ALCULUS This section addresses the syntax and the semantics of the Calculus for Sensor Networks. For simplicity, in the remainder of the paper we will refer to a sensor node or a sensor device in a network as a sensor. The syntax is provided by the grammar in Figure 2, and the operational semantics is given by the reduction relation depicted in Figures 3 and 4. A. Syntax Let α ~ denote a possible empty sequence α1 . . . αn of elements of the syntactic category α. Assume a countable set of labels, ranged over by letter l, used to name methods within modules, and a countable set of variables, disjoint from the set of labels and ranged over by letter x. Variables stand for communicated values (e.g. battery capacity, position, field measures, modules) in a given program context. The syntax for CNS is found in Figure 2. We explain the syntactic constructs along with their informal, intuitive semantics. Refer to the next section for a precise semantics of the calculus. DRAFT 6 N ::= S, F P ::= sensors and field idle Programs idle | P |P parallel composition Sensors | P ; P sequential composition off termination | t.v[~v ] method invocation | N |N composition | install v module update | [P, M ]p,r b sensor | sense (~x) in P field sensing | [P, M ]p,r b {S} broadcast sensor | if v then P else P conditional execution S ::= M ::= {li = (~xi ) Pi }i∈I t ::= net | this Fig. 2. Network Modules v ::= method collection Values x variable | m field measure Targets | p position broadcast | b battery capacity local | M module The syntax of CSN. Networks N denote the composition of sensor networks S with a (scalar or vector) field F . A field is a set of pairs (position, measure) describing the distribution of some physical quantity (e.g. temperature, pressure, humidity) in space. The position is given in some coordinate system. Sensors can measure the intensity of the field in their respective positions. Sensor networks S are flat, unstructured collections of sensors combined using the parallel composition operator. A sensor [P, M ]p,r b represents an abstraction of a physical sensing device and is parametric in its position p, describing the location of the sensor in some coordinate system; its transmission range specified by the radius r of a circle centered at position p; and its battery capacity b. The position of the sensors may DRAFT 7 vary with time if the sensor is mobile in some way. The transmission range, on the other hand, usually remains constant over time. A sensor with the battery exhausted is designated by off . Inside a sensor there exists a running program P and a module M . A module is a collection of methods defined as l = (~x)P that the sensor makes available for internal and for external usage. A method is identified by label l and defined by an abstraction (~x)P : a program P with parameters ~x. Method names are pairwise distinct within a module. Mutually recursive method definitions make it possible to represent infinite behavior. Intuitively, the collection of methods of a sensor may be interpreted as the function calls of some tiny operating system installed in the sensor. Communication in the sensor network only happens via broadcasting values from one sensor to its neighborhood: the sensors inside a circle centered at position p (the position of the sensor) with radius r . A broadcast sensor [P, M ]p,r b {S} stands for a sensor during the broadcast phase, having already communicated with sensors S . While broadcasting, it is fundamental to keep track of the sensors engaged in communication so far, thus preventing the delivery of the same message to the same sensor during one broadcasting operation. Target sensors are collected in the bag of the sensor emitting the message. Upon finishing the broadcast the bag is emptied out, and the (target) sensors are released into the network. This construct is a run-time construct and is available to the programmer. Programs are ranged over by P . The idle program denotes a terminated thread. Method invocation, t.v[~v ], selects a method v (with arguments ~v ) either in the local module or broadcasts the request to the neighborhood sensors, depending whether t is the keyword this or the keyword net , respectively. Program sense (~x) in P reads a measure from the surrounding field and binds it to ~x within P . Installing or replacing methods in the sensor’s module is performed using the construct install v . The calculus also offers a standard form of branching through the if v then P else P construct. Programs P and Q may be combined in sequence, P ; Q, or in parallel, P | Q. The sequential composition P ; Q designates a program that first executes P and then proceeds with the execution of Q. In contrast, P | Q represents the simultaneous execution of P and Q. Values are the data exchanged between sensors and comprise field measures m, positions p, battery capacities b, and modules M . Notice that this is not a higher-order calculus: communicating a module means the ability to transfer its code to, to retransmit it from, or to install it in a remote sensor. B. Examples Our first example illustrates a network of sensors that sample the field and broadcast the measured values to a special node known as the sink. The sink node may be no different from the other sensors DRAFT 8 in the network, except that it usually possesses a distinct software module that allows it to collect and process the values broadcasted in the network. The behavior we want to program is the following. The sink issues a request to the network to sample the field; upon reception of the request each sensor samples the field at its position and broadcasts the measured value back to the sink; the sink receives and processes the values. An extended version of this example may be found in Section III-B. The code for the modules of the sensors, MSensor(p, r), and for the sink, MSink(p, r), is given below. Both modules are parametric in the position and in the broadcasting range of each sensor. As for the module equipping the sensors, it has a method sample that, when invoked, propagates the call to its neighborhood (net.sample[];), samples the field (sense x in ... ) and forwards the value to the network ( ... net.forward[p,x] ). Notice that each sensor propagates the original request from the sink. This is required since in general most of the sensors in the network will be out of broadcasting range from the sink. Therefore each sensor echos the request, hopefully covering all the network. Message forwarding will be a recurrent pattern found in our examples. Another method of the sensors’ module is forward that simply forwards the values from other sensors through the network. The module for the sink contains a different implementation of the forward method, since the sink will gather the values sent by the sensors and will log them. Here we leave unspecified the processing done by the log position and value program. The network starts-up with all sensors idle , except for the sink that requests a sampling (net.sample[]). MSensor ( p , r ) = { sample = ( ) net . sample [ ] ; sense x i n net . f o r w a r d [ p , x ] f o r w a r d = ( x , y ) net . f o r w a r d [ x , y ] } MSink ( p , r ) = { forward = ( x , y ) l o g p o s i t i o n a n d v a l u e [ x , y ] } [ net . sample [ ] , MSink ( p , r ) ] [ i d l e , MSensor (p1 ,r1 ) ] p1 ,r1 b1 p,r b | | . . . | [ i d l e , MSensor (pn ,rn ) ] pn ,rn bn The next example illustrates the broadcast, the deployment, and the installation of code. The example runs as follows. The sink node deploys some module in the network (net.deploy[M]) and then seals the sensors (net.seal [] ), henceforth preventing any dynamic re-programming of the network. An extended version of the current example may be found in Section III-E. The code for the modules of the sensors and of the sink is given below. The module M is the one we wish to deploy to the network. It carries the method seal that forwards the call to the network and installs a new version of deploy that does nothing when executed. DRAFT 9 P1 | P2 ≡ P2 | P1 , P | idle ≡ P, P1 | (P2 | P3 ) ≡ (P1 | P2 ) | P3 (S- MONOID -P ROGRAM ) S | off ≡ S, S1 | (S2 | S3 ) ≡ (S1 | S2 ) | S3 (S- MONOID -S ENSOR) S1 | S2 ≡ S2 | S1 , P1 ≡ P2 p,r [P1 , M ]p,r b ≡ [P2 , M ]b idle ; P ≡ P p,r [P, M ]p,r b ≡ [P, M ]b { off } Fig. 3. b < max(cin , cout ) [P, M ]p,r b ≡ off (S- IDLE - SEQ, S- PROGRAM - STRU) (S- BROADCAST, S- BAT- EXHAUSTED) Structural congruence for processes and sensors. MSensor ( p , r ) = { deploy = ( x ) net . deploy [ x ] ; i n s t a l l x } MSink ( p , r ) = {} M = { seal = () [ net . deploy [M] ; net . s e a l [ ] , MSink ( p , r ) ] [ i d l e , MSensor (p1 ,r1 ) ] p1 ,r1 b1 i n s t a l l { deploy = ( ) i d l e } } net . s e a l [ ] ; p,r b | | . . . | [ i d l e , MSensor (pn ,rn ) ] pn ,rn bn C. Semantics The calculus has two name bindings: field sensing and method definitions. The displayed occurrence of name xi is a binding with scope P both in sense (x1 , . . . , xi , . . . , xn ) in P and in l = (x1 , . . . , xi , . . . , xn ) P . An occurrence of a name is free if it is not in the scope of a binding. Otherwise, the occurrence of the name is bound. The set of free names of a sensor S is referred as fn(S). Following Milner [?] we present the reduction relation with the help of a structural congruence relation. The structural congruence relation ≡, depicted in Figure 3, allows for the manipulation of term structure, adjusting sub-terms to reduce. The relation is defined as the smallest congruence relation on sensors (and programs) closed under the rules given in Figure 3. The parallel composition operators for programs and for sensors are taken to be commutative and associative with idle and off as their neutral elements, respectively (vide Rules S- MONOID -P ROGRAM and S- MONOID -S ENSOR). Rule S- IDLE - SEQ asserts that idle is also neutral with respect to sequential composition of programs. Rule S- PROGRAM - STRU incorporates structural congruence for programs into sensors. When a sensor is broadcasting a message it uses a bag to collect the sensors as they become engaged in communication. Rule S- BROADCAST allows for a sensor to start the broadcasting operation. DRAFT 10 M (li ) = (~xi )Pi b ≥ cin [this .li [~v ] ; P1 | P2 , M ]p,r → [P [~ v xi ] ; P1 | P2 , M ]p,r F i /~ b b−cin (R- METHOD) li 6∈ dom(M ) [this .li [~v ] ; P1 | P2 , M ]p,r v ] ; P1 | P2 , M ]p,r b →F [this .li [~ b d(p, p′ ) < r (R- NO - METHOD) b ≥ cout ′ (R- BROADCAST) ′ ′ ′ p ,r → [net .li [~v ] ; P1 | P2 , M ]p,r F b {S} | [P , M ]b′ ′ ′ ′ [net .li [~v ] ; P1 | P2 , M ]p,r v ], M ′ ]pb′ ,r } b {S | [P | this .li [~ p,r [net .li [~v ] ; P1 | P2 , M ]p,r b {S} →F [P1 | P2 , M ]b−cout | S (R- RELEASE) b ≥ cin ′ p,r ; P1 | P2 , M ]p,r b →F [P1 | P2 , M + M ]b−cin (R- INSTALL) [ install M′ [sense (~x) in P ; S 1 →F S 2 S | S 1 →F S | S 2 b ≥ cin →F [P [F (p)/~x] ; P1 | P2 , M ]p,r b−cin S1 ≡ S2 S 2 →F S 3 S 1 →F S 4 S3 ≡ S4 (R- PARALLEL, R- STRUCTURAL) S →F S ′ S, F → S ′ , F Fig. 4. (R- SENSE) P1 | P2 , M ]p,r b (R- NETWORK) Reduction semantics for processes and networks. A terminated sensor is a sensor with insufficient battery capacity for performing an internal or an external reduction step (vide Rule S- BAT- EXHAUSTED). The reduction relation on networks, notation S, F → S ′ , F , describes how sensors S can evolve (reduce) to sensors S ′ , sensing the field F . The reduction is defined on top of a reduction relation for sensors, notation S →F S ′ , inductively defined by the rules in Figure 4. The reduction for sensors is parametric on field F and on two constants cin and cout that represent the amount of energy consumed when performing internal computation steps (cin ) and when broadcasting messages (cout ). Computation inside sensors proceeds by invoking a method (either local—Rules R- METHOD and RNO - METHOD —or remote—Rules R- BROADCAST and R- RELEASE), by sensing values (Rule R- SENSE), and by updating the method collection of the sensor (Rule R- INSTALL). DRAFT 11 The invocation of a local method li with arguments ~v evolves differently depending on whether or not the definition for li is part of the method collection of the sensor. Rule R- METHOD describes the invocation of a method from module M , defined as M (li ) = (~xi )Pi . The result is the program Pi where the values ~v are bound to the variables in ~x. When the definition for li is not present in M , we have decided to actively wait for the definition (see Rule R- NO - METHOD). Usually invoking an undefined method causes a program to get stuck. Typed programming languages use a type system to ensure that there are no invocations to undefined methods, ruling out all other programs at compile time. At runtime, another possible choice would be to simply discard invocations to undefined methods. Our choice provides more resilient applications when coupled with the procedure for deploying code in a sensor network. We envision that if we invoke a method in the network after some code has been deployed (see Example III-D), there may be some sensors where the method invocation arrives before the deployed code. With the semantics we propose, the call actively waits for the code to be installed. Sensors communicate with the network by broadcasting messages. A message consists of a remote method invocation on unspecified sensors in the neighborhood of the emitting sensor. In other words, the messages are not targeted to a particular sensor (there is no peer-to-peer communication). The neighborhood of a sensor is defined by its communication radius, but there is no guarantee that a message broadcasted by a given sensor arrives at all surrounding sensors. There might be, for instance, landscape obstacles that prevent two sensors, otherwise within range, from communicating with each other. Also, during a broadcast operation the message must only reach each neighborhood sensor once. Notice that we are not saying that the same message can not reach the same sensor multiple times. In fact it might, but as the result of the echoing of the message in subsequent broadcast operations. We model the broadcasting of messages in two stages. Rule R- BROADCAST invokes method li in the remote sensor, provided that the distance between the emitting and the receiving sensors is less that the transmission radius (d(p, p′ ) < r ). The sensor receiving the message is put in the bag of the emitting sensor, thus preventing multiple deliveries of the same message while broadcasting. Observe that the rule does not enforce the interaction with all sensors in the neighborhood. Rule R- RELEASE finishes the broadcast by consuming the operation (net .li [~v ]), and by emptying out the contents of the emitting sensor’s bag. A broadcast operation starts with the application of Rule S- BROADCAST, proceeds with multiple (eventually none) applications of Rule R- BROADCAST (one for each target sensor), and terminates with the application of Rule R- RELEASE. Installing module M ′ in a sensor with a module M , Rule R- INSTALL, amounts to add to M the methods in M ′ (absent in M ), and to replace (in M ) the methods common to both M and M ′ . Rigorously, the operation of installing module M ′ on top of M , denoted M + M ′ , may be defined as M + M ′ = DRAFT 12 (M \ M ′ ) ∪ M ′ . The + operator is reminiscent of Abadi and Cardelli’s operator for updating methods in their imperative object calculus [?]. A sensor senses the field in which it is immersed, Rule R- SENSE, by sampling the value of the field F in its position p and, continues the computation replacing this value for the bound variables ~x in program P . Rule R- PARALLEL allows reduction to happen in networks of sensors and Rule R- STRUCTURAL brings structural congruence into the reduction relation. D. The Operational Semantics Illustrated To illustrate the operational semantics of CNS, we present the reduction steps for the examples discussed at the end of Section II-B. During reduction we suppress the side annotations when writing the sensors. Due to space constraints we consider a rather simple network with just the sink and another sensor. [ net . sample [ ] , MSink ( p , r ) ] | [ i d l e , MSensor (p1 ,r1 ) ] We assume that the sensor is within range from the sink and vice-versa. This network may reduce as follows: DRAFT 13 [net.sample[],MSink(p,r)] | [ idle ,MSensor(p1 ,r1 )] ≡ (S- BROADCAST) [net.sample[],MSink(p,r)]{off} | [ idle ,MSensor(p1 ,r1 )] →≡ (d(p, p1 ) < r , R- BROADCAST, S- MONOID -S ENSOR) [net.sample[],MSink(p,r)] {[this.sample[] || idle ,MSensor(p1 ,r1 )]} →≡ (R- RELEASE, S- MONOID -P ROGRAM ) [ idle ,MSink(p,r)] | [this.sample[],MSensor(p1 ,r1 )] → (R- METHOD) [ idle ,MSink(p,r)] | [net.sample[]; sense x in net.forward[p1 ,x],MSensor(p1 ,r1 )] ≡ (S- BROADCAST) [ idle ,MSink(p,r)] | [net.sample[]; sense x in net.forward[p1 ,x],MSensor(p1 ,r1 )]{off} → (R- RELEASE) [ idle ,MSink(p,r)] | [sense x in net.forward[p1 ,x],MSensor(p1 ,r1 )] → [ idle ,MSink(p,r)] | [net.forward[p1 ,F (p1 )], MSensor(p1 ,r1 )] ≡ (R- SENSE) (S- MONOID -S ENSOR) [net.forward[p1 ,F (p1 )], MSensor(p1 ,r1 )] | [idle,MSink(p,r)] ≡ (S- BROADCAST) [net.forward[p1 ,F (p1 )], MSensor(p1 ,r1 )]{off} | [idle,MSink(p,r)] →≡ (d(p1 , p) < r1 , R- BROADCAST, S- MONOID -S ENSOR) [net.forward[p1 ,F (p1 )], MSensor(p1 ,r1 )]{[this.forward[p1 ,F (p1 )] || idle, MSink(p,r)]} →≡ (R- RELEASE, S- MONOID -P ROGRAM ) [ idle , MSensor(p1 ,r1 )] | [this.forward[p1 ,F (p1 )], MSink(p,r)] → [ idle , MSensor(p1 ,r1 )] | [log position and value[p1 ,F (p1 )], MSink(p,r)] ≡ (R- METHOD) (S- MONOID -S ENSOR) [log position and value[p1 ,F (p1 )] | [idle, MSensor(p1 ,r1 )], MSink(p,r)] So, after these reduction steps the sink gets the field values from the sensor at position p1 and logs them. The sensor at p1 is idle waiting for further interaction. Following we present the reduction step for our second (and last) example of Section II-B where we illustrate the broadcast, the deployment, and the installation of code. Again, due to space restrictions, we use a very simple network with just the sink and another sensor, both within reach of each other. [ net . deploy [M] ; net . s e a l [ ] , MSink ( p , r ) ] | [ i d l e , MSensor (p1 ,r1 ) ] DRAFT 14 This network may reduce as follows: [net.deploy[M]; net.seal [], MSink(p,r)] | [ idle ,MSensor(p1 ,r1 )] ≡ (S- BROADCAST) [net.deploy[M]; net.seal [], MSink(p,r)]{off} | [ idle ,MSensor(p1 ,r1 )] →≡ (d(p, p1 ) < r , R- BROADCAST, S- MONOID -S ENSOR) [net.deploy[M]; net.seal [], MSink(p,r)] | {[this.deploy[M] || idle , MSensor(p1 ,r1 )]} →≡ (R- RELEASE, S- MONOID -P ROGRAM ) [net.seal [], MSink(p,r)] | [this.deploy[M], MSensor(p1 ,r1 )] → [net.seal [], MSink(p,r)] | [net.deploy[M]; install M, MSensor(p1 ,r1 )] ≡ (R- METHOD) (S- BROADCAST) [net.seal [], MSink(p,r)] | [net.deploy[M]; install M, MSensor(p1 ,r1 )]{off} →≡ (R- RELEASE, S- MONOID -S ENSOR) [net.seal [], MSink(p,r)] | [ install M, MSensor(p1 ,r1 )] → (R- INSTALL) [net.seal [], MSink(p,r)] | [ idle , MSensor(p1 ,r1 )+M] ≡ (S- BROADCAST) [net.seal [], MSink(p,r)]{off} | [ idle , MSensor(p1 ,r1 )+M] →≡ (d(p, p1 ) < r , R- BROADCAST, S- MONOID -S ENSOR) [net.seal [], MSink(p,r)] {[this.seal [] || idle , MSensor(p1 ,r1 )+M]} →≡ (R- RELEASE, S- MONOID -P ROGRAM ) [ idle ,MSink(p,r)] | [this.seal [], MSensor(p1 ,r1 )+M] → (R- METHOD) [ idle ,MSink(p,r)] | [net.seal []; install {deploy = () idle }, MSensor(p1 ,r1 )+M] ≡ (S- BROADCAST) [ idle ,MSink(p,r)] | [net.seal []; install {deploy = () idle }, MSensor(p1 ,r1 )+M]{off} →≡ (R- RELEASE, S- MONOID -S ENSOR) [ idle ,MSink(p,r)] | [ install {deploy = () idle}, MSensor(p1 ,r1 )+M] → (R- INSTALL) [ idle ,MSink(p,r)] | [ idle , MSensor(p1 ,r1 )+M+{deploy = () idle}] After these reductions, the sink is idle after deploying the code to the sensor at p. The sensor at p is also idle, waiting for interaction, but with the code for the module M installed and with the deploy method disabled. DRAFT 15 III. P ROGRAMMING E XAMPLES In this section we present some examples, programmed in CSN, of typical operations performed on networks of sensors. Our goal is to show the expressiveness of the CSN calculus just presented and also to identify some other aspects of these networks that may be interesting to model. In the following examples, we denote as MSensor and MSink the modules installed in any of the anonymous sensors in the network and the modules installed in the sink, respectively. Note also that all sensors are assumed to have a builtin method, deploy, that is responsible for installing new modules. The intuition is that this method is part of the tiny operating system that allows sensors to react when first placed in the field. Finally, we assume in these small examples that the network layer supports scoped flooding. We shall see in the next section that this can be supported via software with the inclusion of state in sensors. A. Ping We start with a very simple ping program. Each sensor has a ping method that when invoked calls a method forward in the network with its position and battery charge as arguments. When the method forward is invoked by a sensor in the network, it just triggers another call to forward in the network. The sink has a distinct implementation of this method. Any incomming invocation logs the position and battery values given as arguments. So, the overall result of the call net.ping [] in the sink is that all reachable sensors in the network will, in principle, receive this call and will flood the network with their positions and battery charge values. These values eventually reach the sink and get logged. MSensor ( p , b ) = { ping = () net . f o r w a r d [ p , b ] ; net . ping [ ] forward = ( x , y ) net . f o r w a r d [ x , y ] } MSink ( p , b ) forward = { = ( x , y ) log position and power [ x , y ] } [ net . ping [ ] , MSink ( p , b ) ] [ i d l e , MSensor (p1 ,b1 ) ] p1 ,r1 b1 p,r b | | . . . | [ i d l e , MSensor (pn ,bn ) ] pn ,rn bn B. Querying This example shows how we can program a network with a sink that periodically queries the network for the readings of the sensors. Each sensor has a sample method that samples the field using the sense DRAFT 16 construct and calls the method forward in the neighbourhood with its position and the value sampled as arguments. The call then queries the neighbourhood recursively with a replica of the original call. The original call is, of course, made from the sink, which has a method start sample that calls the method sample in the network within a cycle. Note that, if the sink had a method named sample instead of start sample, it might get a call to sample from elsewhere in the network that could interfere with the sampling control cycle. MSensor ( p ) = { sample = () sense ( x ) i n net . f o r w a r d [ p , x ] ; net . sample [ ] forward = ( x , y ) net . f o r w a r d [ x , y ] } MSink ( p ) = { start sample = () forward = (x , y ) log position and value [ x , y ] net . sample [ ] ; t h i s . s t a r t s a m p l e [ ] } [ t h i s . s t a r t s a m p l e [ ] , MSink ( p ) ] [ i d l e , MSensor (p1 ) ] p1 ,r1 b1 | ... p,r b | | [ i d l e , MSensor (pn) ] pn ,rn bn C. Polling In this example the cycle of the sampling is done in each sensor, instead of in the sink, as in the previous example. The sink just invokes the method start sample once. This method propagates the call through the network and invokes sample, for each sensor. This method samples the field, within a cycle, and forwards the result to the network. This implementation requires less broadcasts than the previous one as the sink only has to call start sample on the network once. On the other hand, it increases the amount of processing per sensor. MSensor ( p ) = { start sample = () net . s t a r t s a m p l e [ ] ; t h i s . sample [ ] sample = () sense ( x ) i n net . f o r w a r d [ p , x ] ; t h i s . sample [ ] forward = ( x , y ) net . f o r w a r d [ x , y ] } MSink ( p ) forward = { = (x , y ) log position and value [ x , y ] } [ net . s t a r t e x a m p l e [ ] , MSink ( p ) ] p,r b | DRAFT 17 [ i d l e , MSensor (p1 ) ] p1 ,r1 b1 | ... | [ i d l e , MSensor (pn) ] pn ,rn bn D. Code deployment The above examples assume we have some means of deploying the code to the sensors. In this example we address this problem and show how it can be programmed in CSN. The code we wish to deploy and execute is the same as the one in the previous example. To achieve this goal, the sink first calls the deploy method on the network to install the new module with the methods start sample, sample and forward as above. This call recursively deploys the code to the sensors in the network. The sink then calls start sample to start the sampling, again as above, and waits for the forwarded results on the method forward. MSensor ( p ) = { deploy = (x) i n s t a l l x ; net . deploy [ x ] = (x,y) log position and value [ x , y ] start sample = () net . s t a r t s a m p l e [ ] ; t h i s . sample [ ] sample = () sense ( x ) i n net . f o r w a r d [ p , x ] ; t h i s . sample [ ] forward = ( x , y ) net . f o r w a r d [ x , y ] } MSink ( p ) = { forward } [ net . deploy [ { }]; net . s t a r t s a m p l e [ ] , MSink ( p ) ] [ i d l e , MSensor (p1 ) ] p1 ,r1 b1 | ... p,r b | | [ i d l e , MSensor (pn) ] pn ,rn bn A refined version of this code, one that avoids the start sample method completely, can be programmed. Here, we deploy the code for all sensors by sending methods sample and forward to all the sensors in the network by invoking deploy. Once deployed, the code is activated with a call to sample in the sink, instead of using the start sample method as above. MSensor ( p ) = { deploy = (x) i n s t a l l x ; net . deploy [ x ] } MSink ( p ) forward = { = (x , y) log position and value [ x , y ] DRAFT 18 } [ net . deploy [ { sample = () net . sample [ ] ; i n s t a l l { sample = ( ) sense ( x ) i n net . f o r w a r d [ p , x ] ; t h i s . sample [ ] } ; t h i s . sample [ ] forward = ( x , y ) net . f o r w a r d [ x , y ] }]; net . sample [ ] , MSink ( p ) ] [ i d l e , MSensor (p1 ) ] p1 ,r1 b1 p,r b | | ... | [ i d l e , MSensor (pn) ] pn ,rn bn Notice that the implementation of the method sample has changed. Here, when the method is executed for the first time at each sensor, it starts by propagating the call to its neighborhood and then, it changes itself through an install call. The newly installed code of sample is the same as the one in the first implementation of the example. The method then continues to execute and calls the new version of sample, which starts sampling the field and forwarding values. E. Sealing sensors This example shows how we can install a sensor network with a module that contains a method, seal, that prevents any further dynamic re-programming of the sensors, preventing anyone from tampering with the installed code. The module also contains a method, unseal that restores the original deploy method, thus allowing dynamic re-programming again. The sink just installs the module containning these methods in the network by broadcasting a method call to deploy. Each sensor that receives the call, installs the module and floods the neighborhood with a replica of the call. Another message by the sink then replaces the deploy method itself and re-implements it to idle . This prevents any further instalation of software in the sensors and thus effectively seals the network from external interaction other than the one allowed by the remainder of the methods in the modules of the sensors. MSensor deploy = { = ( x ) i n s t a l l x ; net . deploy [ x ] } MSink = { } [ net . deploy [ { seal = () i n s t a l l { deploy = ( ) idle } uns eal = () i n s t a l l { deploy = ( x ) i n s t a l l x ; net . deploy [ x ] } DRAFT 19 }]; net . s e a l [ ] , MSink ] [ i d l e , MSensor ] p1 ,r1 b1 p,r b | | . . . | [ i d l e , MSensor ] pn ,rn bn IV. D ISCUSSION In the previous sections, we focused our attention on the programming issues of a sensor network and presented a core calculus that is expressive enough to model fundamental operations such as local broadcast of messages, local sensing of the environment, and software module updates. CSN allows the global modeling of sensor networks in the sense that it allows us to design and implement sensor network applications as large-scale distributed applications, rather than giving the programmer a sensor-by-sensor view of the programming task. It also provides the tools to manage running sensor networks, namely through the use of the software deployment capabilities. There are other important features of sensor networks that we consciously left out of CSN. In the sequel we discuss some of these features and sketch some ideas of how we would include support for them. a) State: From a programming point of view, adding state to sensors is essential. Sensors have some limited computational capabilities and may perform some data processing before sending it to the sink. This processing assumes that the sensor is capable of buffering data and thus maintain some state. In a way, CSN sensors have state. Indeed, the atributes p, b, and r may be viewed as sensor state. Since these are characteristic of each sensor and are usually controlled at the hardware level, we chose to represent this state as parameters of the sensors. The programmer may read these values at any time through builtin method calls but any change to this data is performed transparently for the programmer by the hardware or operating system. As we mentioned before, it is clear that the value of b changes with time. The position p may also change with time if we envision our sensors endowed with some form of mobility (e.g., sensors dropped in the atmosphere or flowing in the ocean). To allow for a more systematic extension of our sensors with state variables we can assume that each sensor has a heap H where the values of these variables are stored: [H, P, M ]p,r b . The model chosen for this heap is orthogonal to our sensor calculus and for this discussion we assume that we enrich the values v of the language with a set of keys, ranged over by k. Our heap may thus be defined as a map H from keys into values. Intuitively, we can think of it as an associative memory with the usual built-in operations put, get, lookup, and hash. Programs running in the sensors may share state by exchanging keys. We assume also that these operations are atomic and thus no race conditions can arise. DRAFT 20 With this basic model for a heap we can re-implement the Ping example from Section III-A with scoped flooding thus eliminating echos by software. We do this by associating a unique key to each remote procedure call broadcast to the network. This key is created through the built-in hash function that takes as arguments the position p and the battery b of the sensor. Each sensor, after receiving a call to ping, propagates the call to its neighborhood and generates a new key to send, with its position and battery charge, in a forward call. Then, it stores the key in its heap to avoid forwarding its own forward call. On the other hand, each time a sensor receives a call to forward, it checks whether it has the key associated to the call in its heap. If so, it does nothing. If not, it forwards the call and stores the key in the heap, to avoid future re-transmission. MSensor ( p , b ) = { ping = () net . ping [ ] ; l e t k = hash [ p , b ] i n net . f o r w a r d [ p , b , k ] ; put [ k , ] forward = ( x , y , k ) i f ( ! lookup [ k ] ) then net . f o r w a r d [ x , y , k ] ; put [ k , ] } MSink ( p , b ) = {...} p,r | b MSensor (p1 ,b1 ) ] pb11 ,r1 [ net . ping [ ] , MSink ] [ idle , | . . . | [ i d l e , MSensor (pn ,bn ) ] pn ,rn bn b) Events: Another characteristic of sensors is their modus operandi. Some sensors sample the field as a result of instructions implemented in the software that controls them. Such is the case with CSN sensors. The programmer is responsible for controlling the sensing activity of the sensor network. It is of course possible for sensor nodes to be activated in different ways. For example, some may have their sensing routines implemented at hardware or operating system level and thus not directly controllable by the programmer. Such classes of sensor nodes tipically sample the field periodically and are activated when a given condition arises (e.g., a temperature above or below a given threshold, the detection of CO2 above a given threshold, the detection of a strong source of infrared light). The way in which certain environmental conditions or events can activate the sensor is by triggering the execution of a handler procedure that processes the event. Support for this kind of event-driven sensors in CSN could be achieved by assuming that each sensor has a builtin handler procedure, say handle, for such events. The handler procedure, when activated, receives the value of the field that triggered the event. Note that, DRAFT 21 from the point of view of the sensor, the occurrence of such an event is equivalent to the deployment of a method invocation this.handle[v] in its processing core, where v is the field value associated with the event. The sensor has no control over this deployment, but may be programmed to react in different ways to these calls, by providing adequate implementations of the handle routine. The events could be included in the semantics given in Section II-C with the following rule: p,r [P, M ]p,r b →F [this .handle [F (p)] | P , M ]b (R- EVENT) As in the case of the builtin method for code deployment, the handler could be programmed to change the behavior of the network in the presence of events. One could envision the default handler as handle = (x) idle , which ignores all events. Then, we could change this default behavior so that an event triggers an alarm that gets sent to the sink. A possible implementation of such a dynamic re-programming of the network default handlers can be seen in the code below. MSensor ( p ) = { handle = ( x ) idle } MSink ( p ) = { handle = ( x ) idle } [ net . deploy [ { handle = ( x ) alarm net . alarm [ p , x ] = ( x , y ) net . alarm [ x , y ] }]; i n s t a l l { alarm MSink ( p ) ] p,r b = (x , y) sing bell [ x , y ]} , | [ i d l e , MSensor (p1 ) ] p1 ,r1 b1 | ... | [ i d l e , MSensor (pn) ] pn ,rn bn where the default implementation of the handle procedure is superseded by one that eventualy triggers an alarm in the sink. More complex behavior could be modeled for sensors that take multiple readings, with a handler associated with each event. c) Security: Finally, another issue that is of outmost importance in the management of sensor networks is security. It is important to note that many potential applications of sensor networks are in high risk situations. Examples may be the monitorization of ecological disaster areas, volcanic or sismic activity, and radiation levels in contaminated areas. Secure access to data is fundamental to establish its credibility and for correctly assessing risks in the management of such episodes. In CSN we have not taken security issues into consideration. This was not our goal at this time. However, one feature of the calculus may provide interesting solutions for the future. In fact, in CSN, all computation within a sensor DRAFT 22 results from an invocation of methods in the modules of a sensor, either originating in the network or from within the sensor. In a sense the modules M of the sensor work as a firewall that can be used to control incomming messages and implement security protocols. Thus, all remote method invocations and software updates might first be validated locally with methods of the sensor’s modules and only then the actions would be performed. The idea of equipping sensors, or in general domains, with some kind of membrane that filters all the interactions with the surrounding network has been explored, for instance, in [?], in the M-calculus [?], in the Kell calculus [?], in the Brane calculi [?], in Miko [?], and in [?]. One possible development is to incorporate some features of the membrane model into CSN. The current formulation of the calculus also assumes that all methods in the module M of a sensor [P, M ]p,r are b visible from the network. It is possible to implement an access policy to methods in such a way that some methods are private to the sensor, i.e., can only be invoked from within the sensor. This allows, for example, the complete encapsulation of the state of the sensor. V. C ONCLUSIONS AND F UTURE W ORK Aiming at providing large-scale sensor networks with a rigorous and adequate programming model (upon which operating systems and high-level programming languages can be built), we presented CSN — a Calculus for Sensor Networks, developed specifically for this class of distributed systems. After identifying the necessary sensing, processing, and wireless broadcasting features of the calculus, we opted to base our work on a top-layer abstraction of physical and link layer communication issues (in contrast with previous work on wireless network calculi [?, ?]), thus focusing on the system requirements for programming network-wide applications. This approach resulted in the CSN syntax and semantics, whose expressiveness we illustrated through a series of implementations of typical operations in sensor networks. Also included was a detailed discussion of possible extensions to CSN to account for other important properties of sensors such as state, sampling strategies, and security. As part of our ongoing efforts, we are currently using CSN to establish a mathematical framework for reasoning about sensor networks. One major objective of this work consists in providing formal proofs of correctness for data gathering protocols that are commonly used in current sensor networks and whose performance and reliability has so far only been evaluated through computer simulations and ad-hoc experiments. From a more practical point of view, the focus will be set on the development of a prototype implementation of CSN. This prototype will be used to emulate the behavior of sensor networks by software and, ultimately, to port the programming model to a natural development architecture for sensor DRAFT 23 network applications. ACKNOWLEDGEMENTS The authors gratefully acknowledge insightful discussions with Gerhard Maierbacher (Departamento de Ciência de Computadores, Faculdade de Ciências, Universidade do Porto). DRAFT This figure "reachback.jpg" is available in "jpg" format from: http://arxiv.org/ps/cs/0612093v1 This figure "sensornet.jpg" is available in "jpg" format from: http://arxiv.org/ps/cs/0612093v1
2cs.AI
1 Skew-t Filter and Smoother with Improved Covariance Matrix Approximation arXiv:1608.07435v1 [cs.SY] 26 Aug 2016 Henri Nurminen, Tohid Ardeshiri, Robert Piché, and Fredrik Gustafsson 800 600 count Abstract—Filtering and smoothing algorithms for linear discrete-time state-space models with skew-t-distributed measurement noise are presented. The presented algorithms use a variational Bayes based posterior approximation with coupled location and skewness variables to reduce the error caused by the variational approximation. Although the variational update is done suboptimally, our simulations show that the proposed method gives a more accurate approximation of the posterior covariance matrix than an earlier proposed variational algorithm. Consequently, the novel filter and smoother outperform the earlier proposed robust filter and smoother and other existing low-complexity alternatives in accuracy and speed. We present both simulations and tests based on real-world navigation data, in particular GPS data in an urban area, to demonstrate the performance of the novel methods. Moreover, the extension of the proposed algorithms to cover the case where the distribution of the measurement noise is multivariate skew-t is outlined. Finally, the paper presents a study of theoretical performance bounds for the proposed algorithms. 400 200 0 -8 -6 -4 -2 0 2 4 6 8 error (m) Fig. 1. The error histogram in an ultra-wideband (UWB) ranging experiment described in [8] shows positive skewness. The edge bars show the errors outside the figure limits. anchor range true position likelihood Index Terms— skew t, skewness, t-distribution, robust filtering, Kalman filter, variational Bayes, RTS smoother, truncated normal distribution, Cramér–Rao lower bound I. I NTRODUCTION Asymmetric and heavy-tailed noise processes are present in many inference problems. In radio signal based distance estimation [1]–[3], for example, obstacles cause large positive errors that dominate over symmetrically distributed errors from other sources [4]. An example of this is the error histogram of time-of-flight in distance measurements collected in an indoor environment given in Fig. 1. The asymmetric outlier distributions cannot be predicted by the normal distribution that is equivalent in second order moments, because normal distributions are symmetric thin-tailed distributions. The skew t-distribution [5]–[7] is a generalization of the t-distribution that has the modeling flexibility to capture both skewness and heavy-tailedness of such noise processes. To illustrate this, Fig. 2 shows the contours of the likelihood function for three range measurements where some of the measurements are positive outliers. In this example, skew-t, t, and normal measurement noise models are compared. Due to the additional modeling flexibility, the skew-t based likelihood provides a more apposite spread of the probability mass than the normal and t based likelihoods. H. Nurminen and R. Piché are with the Department of Automation Science and Engineering, Tampere University of Technology (TUT), PO Box 692, 33101 Tampere, Finland (e-mails: henri.nurminen@tut.fi, robert.piche@tut.fi). H. Nurminen receives funding from TUT Graduate School, the Foundation of Nokia Corporation, and Tekniikan edistämissäätiö. T. Ardeshiri was with the Division of Automatic Control, Department of Electrical Engineering, Linköping University, 58183, Linköping, Sweden and received funding from Swedish research council (VR), project scalable Kalman filters for this work. T. Ardeshiri is currently with the Department of Engineering, University of Cambridge, Trumpington Street, Cambridge, CB2 1PZ, UK, (e-mail: ta417@cam.ac.uk). F. Gustafsson is with the Division of Automatic Control, Department of Electrical Engineering, Linköping University, 58183 Linköping, Sweden, (email: fredrik@isy.liu.se). Fig. 2. The contours of the likelihood function for three range measurements for the normal (left), t (middle) and skew-t (right) measurement noise models. The t and skew-t based likelihoods handle one outlier (upper row), while only the skew-t model handles the two positive outlier measurements (bottom row) due to its asymmetry. The measurement model parameters are selected such that the degrees-of-freedom values and the first two moments coincide. The applications of the skew distributions are not limited to radio signal based localization. In biostatistics skewed distributions are used as a modeling tool for handling heterogeneous data involving asymmetric behaviors across subpopulations [9]. In psychiatric research skew normal distribution is used to model asymmetric data [10]. Further, in economics skew normal and skew t-distributions are used as models for describing claims in property-liability insurance [11]. More examples describing approaches for analysis and modeling using multivariate skew normal and skew t-distributions in econometrics and environmetrics are presented in [12]. There are various algorithms dedicated to statistical inference of time series when the data exhibit asymmetric distribution. Particle filters [13] can easily be adapted to skew noise distributions, but the computational complexity of these filters increases rapidly as the state dimension increases. A skew Kalman filter is proposed in [14], and in [15] this filter is extended to a robust scale-mixture filter using Monte Carlo integration. These solutions are based on state-space models where the measurement noise is a dependent process with skewed marginals. The article [16] proposes filtering of independent skew measurement and process noises with the 2 cost of increasing the filter state’s dimension over time. In all the skew filters of [14]–[16], sequential processing requires numerical evaluation of multidimensional integrals. The inference problem with skew likelihood distributions can also be cast into an optimization problem; [3] proposes an approach to model the measurement noise in an ultra-wideband (UWB) based positioning problem using a tailored half-normal-halfCauchy distribution. Skewness can also be modeled by a mixture of normal distributions (Gaussian mixtures, GM) [1]. There are many filtering algorithms for GM distributions such as Gaussian sum filter [17] and interactive multiple model (IMM) filter [18]. However, GMs have exponentially decaying tails and can thus be too sensitive to outlier measurements. Furthermore, in order to keep the computational cost of a Gaussian sum filter practicable, a mixture reduction algorithm (MRA) [19] is required, and these MRAs can be computationally expensive and involve approximations to the posterior density. Filtering and smoothing algorithms for linear discretetime state-space models with skew-t measurement noise using a variational Bayes (VB) method are presented in [20]. In tests with real UWB indoor localization data [8], this filter was shown to be accurate and computationally inexpensive. This paper proposes improvements to the robust filter and smoother proposed in [20]. Analogous to [20], the measurement noise is modeled by the skew t-distribution, and the proposed filter and smoother use a VB approximation of the filtering and smoothing posteriors. However, the main contributions of this paper are (1) a new factorization of the approximate posterior distribution, (2) derivation of Cramér– Rao lower bound (CRLB) for the proposed filter and smoother, (3) the application of an existing method for approximating the statistics of a truncated multivariate normal distribution (TMND), and (4) a proof of optimality for a truncation ordering in approximation of the moments of the TMND. A TMND is a multivariate normal distribution whose support is restricted (truncated) by linear constraints and that is renormalized to integrate to unity. The aforementioned contributions improve the estimation performance of the skew-t filter and smoother by reducing the covariance underestimation common to most VB inference algorithms [21, Chapter 10]. To our knowledge, VB approximations have been applied to the skew t-distribution only in our earlier works [8], [20] and by Wand et al. [22]. The rest of this paper is structured as follows. In Section II, the filtering and smoothing problem involving the univariate skew t-distribution is posed. In Section III a solution based on VB for the formulated problem is proposed. The proposed solution is evaluated using simulated data as well as realworld data in Sections IV and V, respectively. The essential expressions to extend the proposed filtering and smoothing algorithms to problems involving multivariate skew-t (MVST) distribution are given in Section VI. A performance bound for time series data with MVST–distributed measurement noise is derived and evaluated in simulation in Section VII. The concluding remarks are given in Section VIII. II. I NFERENCE P ROBLEM FORMULATION Consider the linear and Gaussian state evolution model p(x1 ) = N (x1 ; x1|0 , P1|0 ), xk+1 = Axk + wk , (1a) iid wk ∼ N (0, Q), (1b) where N (·; µ, Σ) denotes the probability density function (PDF) of the (multivariate) normal distribution with mean µ and covariance matrix Σ; A ∈ Rnx ×nx is the state transition matrix; xk ∈ Rnx indexed by 1 ≤ k ≤ K is the state to be estimated with initial prior distribution (1a), where the subscript “a|b” is read “at time a using measurements up to time b”; and wk ∈ Rnx is the process noise. Further, the measurements yk ∈ Rny are assumed to be governed by the measurement equation yk = Cxk + ek , (2) ny ×nx where C ∈ R is the measurement matrix, and the measurement noise ek is independent of the process noise and has the product of independent univariate skew t-distributions as the PDF iid [ek ]i ∼ ST(0, Rii , ∆ii , νi ). (3) The model can also be nonstationary, but for the sake of lighter notation the k subscripts on A, Q, C, Rii , ∆ii , and νi are omitted. The univariate skew t-distribution ST(µ, σ 2 , δ, ν) is parametrized by its location parameter µ ∈ R, spread parameter σ > 0, shape parameter δ ∈ R and degrees of freedom ν > 0, and has the PDF ST(z; µ, σ 2 , δ, ν) = 2 t(z; µ, σ 2 + δ 2 , ν) T(e z ; 0, 1, ν + 1), (4) where 2 t(z; µ, σ , ν) = Γ √ ν+1 2 σ νπΓ   ν 2  (z − µ)2 1+ νσ 2 − ν+1 2 (5) is the PDF of Student’s t-distribution, Γ(·) is the gamma func  12 ν+1 tion, and ze = (z−µ)δ . Also, T(·; 0, 1, ν) σ ν(σ 2 +δ 2 )+(z−µ)2 denotes the cumulative distribution function (CDF) of Student’s t-distribution with degrees of freedom ν. Expressions for the first two moments of the univariate skew t-distribution can be found in [23]. The model (3) with independent univariate skew-tdistributed measurement noise components is justified in applications where one-dimensional data from different sensors can be assumed to have statistically independent noise [20]. Extension and comparison to multivariate skew-t-distributed noise will be discussed in Section VI. The independent univariate skew-t noise model (3) induces the hierarchical representation of the measurement likelihood yk |xk , uk , Λk ∼ N (Cxk + ∆uk , Λ−1 k R), uk |Λk ∼ [Λk ]ii ∼ N+ (0, Λ−1 k ), G( ν2i , ν2i ), (6a) (6b) (6c) where R ∈ Rny ×ny is √ a diagonal matrix whose diagonal elements’ square roots Rii are the spread parameters of the skew t-distribution in (3); ∆ ∈ Rny ×ny is a diagonal matrix whose diagonal elements ∆ii are the shape parameters; ν ∈ (R+ )ny is a vector whose elements νi are the degrees of freedom; the operator [·]ij gives the (i, j) entry of its argument; Λk is a diagonal matrix with a priori independent random diagonal elements [Λk ]ii . Also, N+ (µ, Σ) is the TMND with closed positive orthant as support, location parameter µ, and squared-scale matrix Σ. Furthermore, G(α, β) is the gamma distribution with shape parameter α and rate parameter β. Bayesian smoothing means finding the smoothing posterior p(x1:K , u1:K , Λ1:K |y1:K ). In [20], the smoothing posterior is approximated by a factorized distribution of the form 3 q [20] , qx (x1:K )qu (u1:K )qΛ (Λ1:K ). Subsequently, the approximate posterior distributions are computed using the VB approach. The VB approach minimizes the Kullback–Leibler R q(x) dx [24] of divergence (KLD) DKL (q||p) , q(x) log p(x) the true posterior from the factorized approximation. That is, DKL (q [20] ||p(x1:K , u1:K , Λ1:K |y1:K )) is minimized in [20]. The numerical simulations in [20] manifest covariance matrix underestimation, which is a known weakness of the VB approach [21, Chapter 10]. One of the contributions of this paper is to reduce the covariance underestimation of the filter and smoother proposed in [20] by removing independence approximations of the posterior approximation. The proposed filter and smoother are presented in Section III. III. P ROPOSED F ILTER AND S MOOTHER Using Bayes’ theorem, the state evolution model (1), and the likelihood (6), the joint smoothing posterior PDF can be derived as in [20]. This posterior is not analytically tractable. We propose to seek an approximation in the form p(x1:K ,u1:K , Λ1:K |y1:K ) ≈ qxu (x1:K , u1:K ) qΛ (Λ1:K ), (7) where the factors in (7) are specified by q̂xu , q̂Λ = argmin DKL (qN ||p(x1:K , u1:K , Λ1:K |y1:K )) (8) qxu ,qΛ and where qN , qxu (x1:K , u1:K )qΛ (Λ1:K ). Hence, x1:K and u1:K are not approximated as independent as in [20] because they can be highly correlated a posteriori [20]. The analytical solutions for q̂xu and q̂Λ are obtained by cyclic iteration of log qxu (·) ← E [log p(y1:K , x1:K , u1:K , Λ1:K )] + cxu (9a) log qΛ (·) ← E [log p(y1:K , x1:K , u1:K , Λ1:K )] + cΛ (9b) qΛ qxu where the expected values on the right hand sides are taken with respect to the current qxu and qΛ [21, Chapter 10] [25], [26]. Also, cxu and cΛ are constants with respect to the variables (x1:K , u1:K ) and Λ1:K , respectively. Furthermore, the joint PDF p(x1:K , u1:K , Λ1:K , y1:K ) can be written as p(x1:K , u1:K , Λ1:K , y1:K ) = p(x1 ) K−1 Y p(xl+1 |xl ) l=1 × K Y p(yk |xk , uk , Λk )p(uk |Λk )p(Λk ) (10) k=1 =N (x1 ; x1|0 , P1|0 ) K−1 Y N (xl+1 ; Axl , Q) l=1 × × K Y −1 N (yk ; Cxk + ∆uk , Λ−1 k R)N+ (uk ; 0, Λk ) k=1 ny K Y Y k=1  νi νi  G [Λk ]ii ; , . 2 2 i=1 (11) Computation of the expectation in (9b), which is relegated to Appendix A, requires the first two moments of a TMND because the support of u1:K is the non-negative orthant. These moments can be computed using the formulas presented in [27]. They require evaluating the CDF of general multivariate normal distributions. The M ATLAB function mvncdf implements the numerical quadrature of [28] in 2 and 3 dimensional cases and the quasi-Monte Carlo method of [29] for the dimensionalities 4–25. However, these methods can be prohibitively slow. Therefore, we approximate the TMND’s moments using the fast sequential algorithm suggested in [30], [31]. The method is initialized with the original normal density whose parameters are then updated by applying one linear constraint at a time. For each constraint, the mean and covariance matrix of the once-truncated normal distribution are computed analytically, and the once-truncated distribution is approximated by a non-truncated normal with the updated moments. This method is illustrated in Fig. 3, where a bivariate normal distribution truncated into the positive quadrant is approximated with a non-truncated normal distribution. The result of the sequential truncation depends on the order in which the constraints are applied. Finding the optimal order of applying the truncations is a problem that has combinatorial complexity. Hence, we adopt a greedy approach, whereby the constraint to be applied is chosen from among the remaining constraints so that the resulting once-truncated normal is closest to the true TMND. By Lemma 1, the optimal constraint to select is the one that truncates the most probability. The optimality is with respect to a KLD as the measure. For example, in Fig. 3 the vertical constraint truncates more probability, so it is applied first. Lemma 1. Let p(z) be a TMND with the support {z ≥ 0} and q(z) = N (z; µ, Σ). Then,   argmin DKL p(z) c1i q(z)[[zi ≥ 0]] = argmin √µΣi , (12) i i ii where µi is the ith element of µ, Σii is the ith R diagonal element of Σ, [[·]] is the Iverson bracket, and ci = q(z)[[zi ≥ 0]] dz.   Proof: DKL p(z) c1i q(z)[[zi ≥ 0]] Z + (13) = − p(z) log( c1i q(z)[[zi ≥ 0]]) dz Z + = log ci − p(z) log q(z) dz − 1 = log ci , (14) + where = means equality up to an additive constant. Since ci is an increasing function of √µΣi the proof follows. ii  The obtained algorithm with the optimal processing sequence for computing the mean and covariance matrix of a given multivariate normal distribution truncated to the positive orthant is given in Table I. In many programming languages a numerically robust method to implement the line 6 of the algorithm in Table I is using the scaled complementary error function erfcx through p 2/π φ(ξ) √ . = (15) Φ(ξ) erfcx(−ξ/ 2) The recursion (9) is convergent to a local optimum [21, Chapter 10]. However, there is no proof of convergence available when the moments of the TMND are approximated. In spite of lack of a convergence proof the iterations did not diverge in the numerical simulations presented in section IV. In the smoother, the update (9a) includes a forward filtering step of the Rauch–Tung–Striebel smoother (RTSS) [32] to compute an approximate filtering posterior for (x1:K , u1:K ). This posterior is a TMND where only the variables u1:K are restricted to the positive orthant. The TMND is approximated as a multivariate normal distribution whose parameters 4 95-% contour of normal under truncation 95-% contour of normal approximation linear constraint truncated area (a) (b) (c) (d) Fig. 3. The sequential truncation method for approximating a truncated normal distribution with a normal distribution: (a) the original normal distribution’s contour ellipse that contains 95 % of the probability, and the truncated area in gray, (b) the first applied truncation in gray, and the 95-% contour of the resulting normal approximation, (c) the second applied truncation in gray, and the 95-% contour of the normal approximation, (d) the final normal approximation. Table II S MOOTHING FOR SKEW-t MEASUREMENT NOISE Table I O PTIMAL SEQUENTIAL TRUNCATION TO THE POSITIVE ORTHANT 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: Inputs: µ, Σ, and the set of the truncated components’ indices T while T = 6 ∅ do √ k ← argmin √ i {µi / Σii | i ∈ T } ξ ← µk / Σkk if Φ(ξ) does not underflow to 0 then  ← φ(ξ)/Φ(ξ) . φ is the PDF of N (0, 1), Φ its CDF √ µ ← µ + (/ Σkk ) · Σ:,k 2 Σ ← Σ − ((ξ +  )/Σkk ) · Σ:,k Σk,: else √ . limξ→−∞ ( + ξ) = 0 [30] µ ← µ + (−ξ/ Σkk ) · Σ:,k Σ ← Σ − (1/Σkk ) · Σ:,k Σk,: . limξ→−∞ (ξ + 2 ) = 1 [30] end if T ← T \{k} end while Outputs: µ and Σ; ([µ, Σ] ← rec_trunc(µ, Σ, T )) are obtained using the sequential truncation. This approximation enables recursive forward filtering and the use of RTSS’s backward smoothing step that gives normal approximations to the marginal smoothing posteriors qxu (xk , uk ) ≈ N ([ uxkk ] ; zk|K , Zk|K ). After the iterations converge, the variables u1:K are integrated out to get the approximate smoothing posteriors N (xk ; xk|K , Pk|K ), where the parameters xk|K and Pk|K are the output of the skew-t smoother (STS) algorithm in Table II. STS can be restricted to an online recursive algorithm to synthesize a filter which is summarized in Table III. In the filter, the output of a filtering step is also a TMND which in analogy to STS is approximated by a multivariate normal distribution to have a recursive algorithm. Using sequential truncation, the TMND qxu (xk , uk ) is approximated by a normal distribution, and the parameters of the marginals N (xk ; xk|k , Pk|k ) are the outputs of the skew-t filter (STF) algorithm in Table III. IV. S IMULATIONS Our numerical simulations use satellite navigation pseudorange measurements of the model iid [yk ]i = ksi − [xk ]1:3 k+[xk ]4 +[ek ]i , [ek ]i ∼ ST(0, 1 m, δ m, 4) (16) where si ∈ R3 is the ith satellite’s position, [xk ]4 ∈ R is bias with prior N (0, (0.75 m)2 ), and δ ∈ R is a parameter. The model is linearized using the first order Taylor polynomial approximation, and the linearization error is negligible because the satellites are far. The satellite constellation of the Global Positioning System from the first second of the year 2015 provided by the International GNSS Service [33] is used with 8 visible satellites. The root-mean-square error (RMSE) is computed for [xk ]1:3 . The computations are made with M ATLAB. 1: Inputs: A, C,  Q, R, ∆, ν, x1|0 , P1|0 , and y1:K 0 2: Az ← A 0 0 , Cz ← [ C ∆ ] initialization 3: Λk|K ← Iny for k = 1 · · · K 4: repeat update qxu (x1:K , u1:K ) given qΛ (Λ1:K ) 5: for k = 1 to K do ) 6: Zk|k−1 ← blockdiag(Pk|k−1 , Λ−1 k|K 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: Kz ← Zk|k−1 CzT (CPk|k−1 C T +∆Λ−1 ∆T +Λ−1 R)−1 k|K k|K h i xk|k−1 zek|k ← + Kz (yk − Cxk|k−1 ) 0 ek|k ← (I − Kz Cz )Pk|k−1 Z ek|k , {nx + 1 · · · nx + ny }) [zk|k , Zk|k ] ← rec_trunc(e zk|k , Z xk|k ← [zk|k ]1:nx , Pk|k ← [Zk|k ]1:nx ,1:nx xk+1|k ← Axk|k Pk+1|k ← APk|k AT + Q end for for k = K − 1 down to 1 do −1 Gk ← Zk|k Az Zk+1|k zk|K ← zk|k + Gk (zk+1|K − Az zk|k ) Zk|K ← Zk|k + Gk (Zk+1|K − Zk+1|k )GT k xk|K ← [zk|K ]1:nx , Pk|K ← [Zk|K ]1:nx ,1:nx uk|K ←[zk|K ]nx +(1:ny ) , Uk|K ←[Zk|K ]nx +(1:ny ),nx +(1:ny ) end for update qΛ (Λ1:K ) given qxu (x1:K , u1:K ) for k = 1 to K do Ψk ← (yk −Cz zk|K )(yk −Cz zk|K )T R−1 +Cz Zk|K CzT R−1 +uk|K uT + Uk|K k|K νi +2 end for 24: for i = 1 to ny do [Λk|K ]ii ← ν +[Ψ i k ]ii 25: end for 26: until converged 27: Outputs: xk|K and Pk|K for k = 1 · · · K A. Computation of TMND statistics In this subsection we study the computation of the moments of the untruncated components of a TMND. One state and one measurement vector per Monte Carlo replication are generated from the model (16) with ν = ∞ degrees of freedom (corresponding to skew-normal likelihood), prior x ∼ N (0, diag((20 m)2 , (20 m)2 , (0.22 m)2 , (0.1 m)2 )), and 10 000 replications. The compared methods are sequential truncations with the optimal truncation order (TOPT) and with random order (TRAND), the variational Bayes (VB), and the analytical formulas of [27] using M ATLAB function mvncdf (MVNCDF). In TRAND any of the non-optimal constraints is chosen randomly at each truncation. VB is an update of the skew t variational Bayes filter (STVBF) [20] where Λk = I and the VB iteration is terminated when the position estimate changes less than 0.005 m or at the 1000th iteration. The reference solution for the expectation value is a bootstrap particle filter (PF) update with 50 000 samples. Table III F ILTERING FOR SKEW-t MEASUREMENT NOISE MVNCDF VB TRAND TOPT 1: Inputs: A, C, Q, R, ∆, ν, x1|0 , P1|0 , and y1:K 2: Cz ← [ C ∆ ] 3: for k = 1 to K do initialization 4: Λk|k ← Iny 5: repeat update qxu (xk , uk ) given qΛ (Λk ) 6: Zk|k−1 ← blockdiag(Pk|k−1 , Λ−1 ) k|k 9: 10: 11: 12: 13: 103 102 101 100 −1 Kz ← Zk|k−1 CzT (CPk|k−1 C T +∆Λ−1 ∆T +Λk|k R)−1 k|k h i xk|k−1 zek|k ← + Kz (yk − Cxk|k−1 ) 0 e Zk|k ← (I − Kz Cz )Pk|k−1 ek|k , {nx + 1 · · · nx + ny }) [zk|k , Zk|k ] ← rec_trunc(e zk|k , Z xk|k ← [zk|k ]1:nx , Pk|k ← [Zk|k ]1:nx ,1:nx uk|k←[zk|k ]nx +(1:ny ) , Uk|k←[Zk|k ]nx +(1:ny ),nx +(1:ny ) update qΛ (Λk ) given qxu (xk , uk ) Ψk ← (yk − Cz zk|k )(yk − Cz zk|k )T R−1 + Cz Zk|k CzT R−1 +uk|k uT + Uk|k k|k νi +2 end for 14: for i = 1 to ny do [Λk|k ]ii ← ν +[Ψ i k ]ii 15: until converged 16: xk+1|k ← Axk|k 17: Pk+1|k ← APk|k AT + Q 18: end for 19: Outputs: xk|k and Pk|k for k = 1 · · · K 0 0.5 2 3 δ 4 5 10 20 350 300 250 200 150 100 50 0 -50 0 1 2 3 4 5 c Fig. 5. TOPT outperforms TRAND when one negative outlier is added to the measurement noise vector because there is one truncation that truncates much more probability than the rest. Fig. 4 shows the distributions of the estimates’ differences from the PF estimate. The errors are given per cent of the PF’s estimation error. The box levels are 5 %, 25 %, 50 %, 75 %, and 95 % quantiles and the asterisks show minimum and maximum values. TOPT outperforms TRAND in the cases with high skewness, which reflects the result of Lemma 1. MVNCDF is more accurate than TOPT in the cases with high skewness, but MVNCDF’s computational load is roughly 40 000 times that of the TOPT. This justifies the use of the sequential truncation approximation. The order of the truncations in the sequential truncation algorithm affects the performance only when there are clear differences in the amounts of probability mass that each truncation truncates. Fig. 5 presents an example, where δ = 20, and each measurement noise realization e has been generated from the skew normal distribution and then modified by p ej = min{min{e1:ny }, 0} − c 1 + 202 , (17) where j is a random index, and c is a parameter. A large c generates one negative outlier to each measurement vector, which results in one truncation with significantly larger truncated probability mass than the rest of the truncations. Fig. 5 shows the difference of TRAND error from TOPT error; i.e. a positive difference means that TOPT is more accurate. The errors here refer to distance from the PF estimate. The figure shows that with large c TOPT is more accurate than TRAND. Thus, the effect of the truncation ordering on the accuracy of the sequential truncation approximation is more pronounced when there is one truncation that truncates much more than the rest. This justifies our greedy approach and the result of Lemma 1 for ordering the truncations. The approximation of the posterior covariance matrix is tested by studying the normalized estimation error squared (NEES) values [34, Ch. 5.4.2] NEES values are shown by Fig. 6. If the covariance matrix is correct, the expected value of NEES is the dimensionality 3 [34, Ch. 5.4.2]. VB gets large NEES values when δ is large, which indicates that VB underestimates the covariance matrix. Apart from MVNCDF, TOPT and TRAND give NEES values closest to 3, so the sequential truncation provides a more accurate covariance matrix approximation than VB. B. Skew-t inference In this section, the proposed skew-t filter (STF) is compared with state-of-the-art filters using numerical simulations of a 100-step trajectory. The state model is a random walk with process noise covariance Q = diag((q m)2 , (q m)2 , (0.2 m)2 , 0), where q is a parameter. The compared methods are a bootstraptype PF, STVBF [20], t variational Bayes filter (TVBF) [35], and Kalman filter (KF) with measurement validation gating [34, Ch. 5.7.2] that discards the measurement components whose normalized innovation squared is larger than the χ21 distribution’s 99 % quantile. The used KF parameters are the mean and variance of the used skew t-distribution, and the TVBF parameters are obtained by matching the degrees of freedom with that of the skew t-distribution and computing the maximum likelihood location and scale parameters for a set of pseudo-random numbers generated from the skew t-distribution. The results are based on 10 000 Monte Carlo replications. MVNCDF VB TRAND TOPT 4 3.5 3 2.5 2 0 −1 NEES = (xk|k − xk )T Pk|k (xk|k − xk ), 1 Fig. 4. With large δ values TOPT outperforms TRAND. MVNCDF is accurate but computationally heavy. average NEES 8: 104 10-1 TRAND error - TOPT error (m) 7: error from PF (% of PF error) 5 (18) where xk|k and Pk|k are the filter’s output mean and covariance matrix, and xk is the true state. The distributions of the filters’ 5 10 δ 15 20 Fig. 6. TOPT’s NEES is closer to the optimal value 3 than that of VB, so sequential truncation gives a more accurate posterior covariance matrix. δ = 0 corresponds to the symmetric t-distribution hence, the comparison methods become identical. 6 120 4.5 PF KF TVBF STVBF STF 2 1.5 RMSE difference (%) 2.5 KF TVBF STVBF 100 median RMSE (m) median RMSE (m) 3 4 3.5 3 80 60 40 20 0 -20 2.5 10 20 103*Np / NVB 30 40 0 10 20 30 40 3 4 δ 5 10 20 1 2 3 4 δ 5 10 20 100 Fig. 7. STF converges in five iterations. The required number of PF particles can be more than 10 000. (left) q = 0.5, δ = 5, (right) q = 5, δ = 5. 80 60 40 20 0 -20 Fig. 8. STF outperforms the comparison methods with skew-t-distributed noise. RMSE differences from STF’s RMSE per cent of the STF’s RMSE. The differences increase as δ is increased. (upper) q = 0.5, (lower) q = 5. The used state evolution model is the almost-constant velocity model for both the user position lk ∈ R3 and the receiver clock error bk ∈ R used in [36, Section IV]. Thus, the filter T state is xk = [ lkT l̇kT bk ḃk ] ∈ R8 , and the state evolution model is   I3 Dk I3 O3×2 I3 xk+1 =  O2 (19) 3×2 xk + wk , O 1 Dk O2×3 O2×3 0 1 where 3 q 2 Dk I3 3  q2 Dk2   2 I3     wk ∼ N  0,   O 2×3 2 q 2 Dk 2 I3 q 2 Dk I3  O3×2 O3×2 " O2×3 sb Dk + 3 sf Dk 2 sf Dk 2 2 sf Dk 3 2   # .   sf Dk and Dk is the time difference of the measurements. The used 2 2 parameter values are q = 0.5 m, sb = 70 ms , and sf = 0.6 ms3 . The initial prior is a normal distribution with mean given by the Gauss–Newton method with the first measurement and a large covariance matrix. The measurement model is the same pseudorange model that is used in the simulations of Section IV, i.e. [yk ]i = ksi,k − [xk ]1:3 k + [xk ]7 + [ek ]i , 2.5 median RMSE (m) V. T ESTS WITH REAL DATA A. GNSS-based pseudorange positioning Two GNSS (global navigation satellite system) positioning data sets were collected in central London (UK) to test the filters’ performance in a challenging real-world satellite positioning scenario with numerous non-line-of-sight measurements. The data include time-of-arrival (TOA) based pseudorange measurements from GPS (Global Positioning System) satellites. Each set contains a trajectory that was collected by car using a u-blox M8 GNSS receiver. The lengths of the tracks are about 8 km and 10 km, the durations are about an hour for each, and measurements are received at about onesecond intervals. The first track is used for fitting the filter parameters, while the second track is used for studying the filters’ positioning errors. A ground truth was measured using an Applanix POS-LV220 system that improves the GNSS solution with tactical grade inertial measurement units. The GPS satellites’ locations were obtained from the broadcast ephemerides provided by the International GNSS Service [33]. The algorithms are computed with M ATLAB. 2 120 103*Np / NVB Fig. 7 illustrates the filter iterations’ convergence when the measurement noise components [ek ]i in (16) are generated independently from the univariate skew t-distribution. The figure shows that the proposed STF converges within five VB iterations and outperforms the other filters already with two VB iterations, except for PF that is the minimum-RMSE solution. Furthermore, Fig. 7 shows that STF’s converged state is close to the PF’s converged state in RMSE, and PF can require as many as 10 000 particles to outperform STF. STF also converges faster than STVBF when the process noise variance parameter q is large. Fig. 8 shows the distributions of the RMSE differences from the STF’s RMSE as percentages of the STF’s RMSE. STF and TVBF use five VB iterations, and STVBF uses 30 VB iterations. STF clearly has the smallest RMSE when δ ≥ 3. Unlike STVBF, the new STF improves accuracy even with small q, which can be explained by the improved covariance matrix approximation. The proposed smoother is also tested with measurements generated from (16). The compared smoothers are the proposed skew-t smoother (STS), skew-t variational Bayes smoother (STVBS) [20], t variational Bayes smoother (TVBS) [35], and the RTSS with 99 % measurement validation gating [32]. Fig. 9 shows that STS has lower RMSE than the smoothers based on symmetric distributions. Furthermore, STS’s VB iteration converges in five iterations or less, so it is faster than STVBS. 1 (20) 4 RTSS TVBS STVBS STS 2 median RMSE (m) 0 RMSE difference (%) 1 1.5 1 3.5 3 2.5 0 10 N20 VB 30 40 0 10 N20 VB 30 40 Fig. 9. Five STS iterations give the converged state’s RMSE. (left) q = 0.5, δ = 5, (right) q = 5, δ = 5. 7 0.05 100 normal t skew-t 0.03 80 RMSE (m) RMSE (m) p(ek) 0.04 100 EKF TVBF STF 80 60 40 60 40 0.02 20 0.01 20 0 0 0 5 10 15 20 25 30 0 5 10 15 NVB -60 -40 -20 0 20 40 60 ek (m) Fig. 10. Measurement error distributions fitted to the real GNSS data for normal, t, and skew-t error models. The modes are fixed to zero. Normal µn (m) σn (m) 0 28.4 empirical CDF F ILTER PARAMETERS FOR REAL GNSS DATA t, νt = 4 µt (m) σt (m) 0 11.1 1 1 0.8 0.8 0.6 0.4 EKF TVBF STF 0.2 0 30 0.6 0.4 0.2 0 0 50 100 150 200 250 300 350 400 0 50 100 150 error (m) where si,k is the 3-dimensional position of the ith satellite at the time of transmission. The measurement model is linearized with respect to xk at each prior mean using the first order Taylor series approximation. The compared filters are based on three different models for the measurement noise ek where [ek ]i ∼ ST(µ, σ 2 , δ, ν); [ek ]i ∼ T (µt , σt2 , νt ); [ek ]i ∼ N (µn , σn2 ). 25 Fig. 11. RMSE of horizontal (left) and vertical (right) position for real GNSS data as a function of the number of VB iterations Table IV Skew-t, ν = 4 µ (m) σ (m) δ (m) -2.5 0.8 16.8 20 NVB 80 empirical CDF 0 -80 (21) (22) (23) The skew-t model (21) is the basis for STF and STVBF, the t model (22) is the basis for TVBF, and the normal model (23) is the basis for the extended KF (EKF) with 99 % measurement validation gating. The pseudoranges are unbiased in the line-of-sight case, so the location parameters are fixed to µn = µt = 0. Furthermore, the degrees of freedom are fixed to ν = νt = 4 to compromise between outlier robustness and performance based on inlier measurements. The deviation parameter σn of the normal model was then fitted to the data using the expectation–maximization algorithm [37, Ch. 12.3.3] and the parameter σt of the t model as well as the parameters σ and δ of the skew-t model were fitted with the particle– Metropolis algorithm [37, Ch. 12.3.4]. The location parameter µ was obtained by numerically finding the point that sets the mode of the skew-t noise distribution to zero. These three error distributions’ parameters are given in Table IV, and the PDFs are plotted in Fig. 10. Fig. 11 shows the filter RMSEs as a function of the number of VB iterations. Both STF and TVBF converge within five VB iterations. The empirical CDF graphs of the user position errors with five VB iterations are shown in Fig. 12, and the RMSEs as well as the relative running times are given in Table V. The results show that modelling the skewness improves the positioning accuracy and is important especially for the accuracy in vertical direction. This can be explained by the sensitivity of the vertical direction to large measurement errors; due to bad measurement geometry the accuracy in the vertical direction is low even with line-of-sight measurements, so correct downweighting of erroneous altitude information requires careful modelling of the noise distribution’s tails. The computational burden of our STF implementation with five VB iterations is about three times that of TVBF, but Fig. 11 shows that two STF iterations would already be enough to match TVBF’s average RMSE. 200 250 300 350 400 error (m) Fig. 12. Empirical error CDFs for the real GNSS data for the horizontal error (left) and the vertical error (right) B. Ultra-wide band indoor positioning Another application for STF is indoor localization using the TOA measurements of ultra-wide band (UWB) radios. We collected five test tracks in a laboratory environment with a high-precision optical reference positioning system1 and three test tracks in a real university campus indoor environment. The measurement equipment is a Spoonphone smartphone [38] with Android 4.2 operating system and UWB channel 2 pulse radio (3993.6 MHz, 500 MHz bandwidth), and six BeSpoon UWB tags. The system uses two-way TOA ranging, thus no clock synchronization is required. The UWB measurement update and localization error computation is done with 2 Hz frequency. The algorithms are computed with M ATLAB. The novelty of this article compared to our previous article [8] is the STF algorithm. Here only TOA measurements are used, and the state evolution model is the random walk xk+1 = xk + wk , wk ∼ N (0, blockdiag(q 2 · I2 , qa2 )), (24) where the state xk ∈ R3 is the√user position in east–north–up 1 1 coordinates and q = 0.5 ms− 2 · 0.5 s and qa = 1.4·10−3 ms− 2 · √ 0.5 s are the process noise parameters. The initial position is assumed to be known. Scaled by the speed of light, the two-way TOA gives a direct measurement of the distance between the UWB beacon and the user. Thus, the measurement model is [yk ]i = kbi − xk k + [ek ]i , (25) ny where yk ∈ R is the TOA-based distance vector, bi ∈ R3 is the 3-dimensional position of the ith UWB beacon, and ek is measurement noise. The measurement function is linearized at each prior mean. We test the three alternative models (21)–(23) for the measurement noise. The estimation algorithm for the skewt model (21) is the STF in Table III. The filter for the t-based model (22) is the TVBF [35] and for the normally distributed 1 High accuracy reference measurements are provided through the use of the Vicon real-time tracking system courtesy of the UAS Technologies Lab, Artificial Intelligence and Integrated Computer Systems Division (AIICS) at the Department of Computer and Information Science (IDA). http://www.ida.liu.se/divisions/aiics/aiicssite/index.en.shtml 8 RMSEhorizontal (m) RMSEvertical (m) Running time EKF 56 95 1 TVBF 49 84 1.3 RMSE (m) Table V T HE RMSE S AND RELATIVE RUNNING TIMES FOR REAL GNSS DATA STF 40 61 4.1 1.2 EKF TVBF STF 0 histogram distr. normal t skew-t 1 0.8 p(ek) 2 1.75 1.5 1.25 1 0.75 0.5 0.25 0 5 10 15 NVB 20 25 30 Fig. 14. Filter RMSEs for UWB indoor positioning as a function of the number of VB iterations Table VII T HE AVERAGE RMSE S IN METERS FOR UWB INDOOR POSITIONING 0.6 0.4 Route Laboratory Campus 1 Campus 2 Campus 3 0.2 0 -8 -6 -4 -2 0 2 4 6 8 ek (m) EKF 2.12 1.79 1.24 1.75 TVBF 0.92 1.18 0.80 1.00 STF 0.79 1.06 0.72 0.98 Fig. 13. The real UWB ranging’s measurement error histogram distribution and the distributions fitted to the data for normal, t, and skew-t error models. noise (23) the EKF with 99 % measurement validation gating. The degrees of freedom parameters ν and νt are fixed to 4, and the parameters {µ, σ, δ, µt , σt , µn , σn } are optimized to maximize the likelihood of the laboratory measurements. The maximum likelihood parameter values are given in Table VI, and the PDFs of the fitted distributions are compared with the error histogram in Fig. 13. The laboratory data are used for both parameter calibration and positioning tests to obtain a fair comparison of the optimal set-ups of each filtering algorithm. This eliminates the effect of possible differences in calibration and positioning data. To evaluate the performances at an independent data set, we also measured three test tracks in the campus of Tampere University of Technology with a rough reference position based on interpolation between timestamped locations. Table VI distribution families, which include the multivariate canonical fundamental skew t-distribution (CFUST) [40] and the multivariate unified skew t-distribution [41]. A comprehensive review on the different variants of the MVST is given in [23]. The MVST variant used in this article is based on the CFUST discussed in [23], and it is the most general variant of the MVST. In this variant the parameter matrix R ∈ Rnz ×nz is a square positive-definite matrix, and ∆ ∈ Rnz ×nz is an arbitrary matrix. The PDF is MVST(z; µ, R, ∆, ν) = 2nz t(z; µ, Ω, ν) T(z; 0, L, ν + nz ), (26) where L = Inz − ∆T Ω−1 ∆, Ω = R + ∆∆T , t(z; µ, Σ, ν) =   ν+nz Γ 2 nz (νπ) 2 1 det(Σ) 2 ν Γ( 2 ) z − ν+n 2 1 + ν1 (z − µ)T Σ−1 (z − µ) T HE MAXIMUM LIKELIHOOD PARAMETER VALUES OF UWB POSITIONING BASED ON THE LABORATORY DATA SET Skew-t, ν = 4 µ (m) σ (m) δ (m) -0.4 0.4 1.2 t, νt = 4 µt (m) σt (m) 0.3 0.9 Normal µn (m) σn (m) 1.2 2.9 The VB-based filters also have the number of VB iterations NVB as a parameter. Fig. 14 shows the filters’ RMSEs averaged over all the data sets with different values of NVB . Five iterations is sufficient for STF in UWB indoor positioning, but STF matches TVBF’s accuracy already with two VB iterations. The RMSEs of the filters are given in Table VII. TVBF and STF use five VB iterations, and show significantly lower RMSE that EKF with measurement validation gating. Furthermore, the proposed STF has a lower RMSE than the TVBF. The campus track 3 was measured avoiding non-lineof-sight condition, so the difference between STF and TVBF is small at this track. VI. E XTENSION TO MVST The skew t-distribution has several multivariate versions. In [5]–[7] the PDF of the multivariate skew t-distribution (MVST) involves the CDF of a univariate t-distribution, while the definition of skew t-distribution given in [39] involves the CDF of a multivariate t-distribution. These versions of MVST are special cases of more general multivariate skew-t-type (27) is the PDF of the nz -variate t-distribution and T(z; µ, Σ, ν) its CDF, and q z z = ∆T Ω−1 (z − µ) ν+(z−µ)ν+n (28) T Ω−1 (z−µ) . The inference algorithms proposed in this paper can be extended to cover the case where the elements of the measurement noise vector are not statistically independent but jointly multivariate skew-t-distributed. When the measurement noise follows a MVST, i.e. ek ∼ MVST(0, R, ∆, ν), (29) the filtering and smoothing algorithms presented in Tables III and II apply with slight modifications. At the core of this convenient extension is the fact that the MVST can be represented by a similar hierarchical model as in (6). However, the shape matrices ∆ and R are not required to be diagonal, and the matrix Λk has the form λk · Iny , where λk is a scalar with the prior λk ∼ G( ν2 , ν2 ). (30) Notice that when λk admits a small value, all the measurement components can potentially be outliers simultaneously unlike with the independent univariate skew-t components model. This difference is illustrated by the PDF contour plots in Fig. 15. 9 50 50 40 40 30 30 20 20 10 10 0 0 -10 -10 0 10 20 30 40 50 This coincides with the covariance matrix update of Rauch– Tung–Striebel smoother’s backward recursion [32]. The Fisher information matrix for the multivariate skew-tdistributed measurement noise of (29) is 0 10 20 30 40 50 The specific modification required by MVST measurement noise to the STS algorithm in Table II is replacing the line 24 by ν + 2ny · Iny ν + tr{Ψk } (31) ν + 2ny · I ny . ν + tr{Ψk } (32) VII. P ERFORMANCE B OUND A. Cramér–Rao lower bound The Bayesian Cramér–Rao lower bound (CRLB) B is a lower bound for the mean-square-error (MSE) matrix of the state estimator x̂ of the random variable x using the observations y M= T E [(x − x̂)(x − x̂) ] (33) p(x,y) in the sense that the matrix difference M − B is positive semidefinite for any state estimator [42, Ch. 2.4]. The regularity conditions necessary for the positive-semidefiniteness to hold [42, Ch. 2.4] are the integrability of the first two partial derivatives of the joint distribution p(x1:K , y1:K ) for an asymptotically unbiased estimator. These conditions are satisfied by the skew-t likelihood and the normal prior distribution, even though they do not hold for p(x1:K , u1:K , Λ1:K , y1:K ) of the hierarchical model used in the proposed variational estimator due to restriction of u1:K to the positive orthant. The filtering CRLB Bk|k for the state-space model (1)–(2) follows the recursion [43] B1|0 = P1|0 Bk+1|k+1 = (ABk|k AT + Q)−1 + E p(xk |y1:k−1 ) E= E h p(r) ν+ny ν+r T r  I ny − T 2 ν+r T r rr (34a) −1 [I(xk )] , (34b) er R erT +R i (39) 1 with r ∼ MVST(0, Iny − ΘΘT , Θ, ν), Θ = (R + ∆∆T )− 2 ∆, 1 1 1 1 A 2 is a square-root matrix such that A 2 (A 2 )T = A, A− 2 , 1 T 1 (A 2 )−1 , A− 2 , ((A 2 )−1 )T , and q  er = T ΘT r ν+nTy ; 0, In − ΘT Θ, ν + ny −1 R y ν+r r × (Iny − T 1 ν+r T r rr )Θ × ∇u T(u; 0, Iny − ΘT Θ, ν + ny ) Similarly, the specific modification required by MVST measurement noise to the STF algorithm in Table III is replacing the line 14 by Λk|k ← (38) where -10 -10 (a) (b) Fig. 15. PDF of bivariate measurement noise from (a) independent univariate skew-t components model (3) with ∆ = 5I2 , R = I2 , ν = [ 44 ] and (b) MVST model (29) with ∆ = 5I2 , R = I2 , ν = 4. Λk|K ← 1 T I(x) = C T (R + ∆∆T )− 2 E(R + ∆∆T )− 2 C, r u=ΘT r ν+ny ν+r T r , (40) where ∇u is the gradient with respect to u. The derivation is given in Appendix B. The evaluation of the expectation in (39) is challenging with high-dimensional measurements due to the requirement to evaluate the CDF of the multivariate tdistribution and its partial derivatives. By the Woodbury matrix identity, the recursion (34) is equivalent to the covariance matrix update of the Kalman filter with the measurement noise 1 1 covariance (R + ∆∆T ) 2 E −1 ((R + ∆∆T ) 2 )T . In the model (3) the measurement noise components are independently univariate skew-t-distributed. In this case the Fisher information is obtained by applying (38) to each conditionally independent measurement component and summing. The resulting formula matches with (38), the matrix E now being a diagonal matrix with the diagonal entries  ν −r 2 Eii = E (νii+r2i)2 p(ri ) i θi2 νi2 + 1−θ 2 2 3 i (νi +ri )  τνi +1 √ θi 1−θi2 ri q νi +1 νi +ri2  2  , (41) where ri ∼ ST(0, 1 − θi2 , θi , νi ) is a univariate skew-tp distributed random variable, θi = ∆ii / Rii + ∆2ii and τν (x) = t(x; 0, 1, ν)/T(x; 0, 1, ν). Substituted into (38), this formula matches the Fisher information formula obtained for the univariate skew t-distribution in [44]. In this case only integrals with respect to one scalar variable are to be evaluated numerically. B. Simulation where I(ek ) is the Fisher information matrix of the measurement noise distribution. Furthermore, the smoothing CRLB for the state-space model (1)–(2) follows the recursion [43] We study the CRLB in (34) of a linear state-space model with skew-t-distributed measurement noise by generating realizations of the model Bk|K = Bk|k + Gk (Bk+1|K − Bk+1|k )GT k, xk+1 = [ 10 11 ] xk + wk , wk ∼ N (0, Q) (42a) 2 yk = [ 1 0 ] xk + ek , ek ∼ ST(µ, σ , δ, ν), (42b) h i 1/2 where x ∈ R2 is the state, Q = 1/3 is the process 1/2 1 noise covariance matrix, yk ∈ R is the measurement, and ν (35) where −1 Gk = Bk|k AT Bk+1|k , T Bk+1|k = ABk|k A + Q. (36) (37) 10 and δc are parameters that determine other parameters by the formulas µ = −γδc σ, σ2 = (43a) ω2 ν 2 2 2 ν−2 (1+δc )−γ δc , (43b) δ = δc σ, q γ = πν Γ((ν−1)/2) Γ(ν/2) . (43c) (43d) Thus, the measurement noise distribution is zero-mean and has the variance ω 2 = 52 . We generate 10 000 realizations of a 50-step process, and compute the CRLB and mean-squareerrors (MSE) of the bootstrap PF with 2000 particles and the STF. The CRLB and the MSEs were computed for the first component of the state at the last time instant [x50 ]1 . Fig. 16 shows the CRLB of the model (42). The figure shows that increase in the skewness as well as heavy-tailedness can decrease the CRLB significantly, which suggests that a nonlinear filter can be significantly better than the KF, which gives MSE 11.8 for all δc and ν. Fig. 17 shows the MSEs of PF and STF. As expected, when ν → ∞ and δc → 0, the PF’s MSE approaches the CRLB. STF is only slightly worse than PF. The figures also show that although the CRLB becomes looser when the distribution becomes more skewed and/or heavy-tailed, it correctly indicates that modeling the skewness still improves the filtering performance. 6 12 10 4 8 6 δc 2 CRLB 4 2 0 0 2.5 3 3.5 4 4.5 5 5.5 6 ν Fig. 16. The CRLB of the 50th time instant for the model (42) with a fixed measurement noise variance. Skewness and heavy-tailedness decreases the CRLB significantly. 66 6 δc δc 2 5 22 0 00 2.5 3 3.5 4 ν Fig. 17. 4.5 5 5.5 6 MSE 10 44 4 0 2.5 2.5 33 3.5 3.5 44 4.5 4.5 55 5.5 5.5 66 ν The MSEs of PF (left) and STF’s (right) are close to each other. VIII. C ONCLUSIONS We have proposed a novel approximate filter and smoother for linear state-space models with heavy-tailed and skewed measurement noise distribution, and derived the Cramér– Rao lower bounds for the filtering and smoothing estimators. The algorithms are based on the variational Bayes approximation, where some posterior independence approximations are removed from the earlier versions of the algorithms to avoid significant underestimation of the posterior covariance matrix. Removal of independence approximations is enabled by the sequential truncation algorithm for approximating the mean and covariance matrix of truncated multivariate normal distribution. An optimal processing sequence is given for the sequential truncation. Simulations and real-data tests with GNSS outdoor positioning and UWB indoor positioning data show that the proposed algorithms outperform the state-of-theart low-complexity methods. R EFERENCES [1] F. Gustafsson and F. Gunnarsson, “Mobile positioning using wireless networks: possibilities and fundamental limitations based on available wireless network measurements,” IEEE Signal Processing Magazine, vol. 22, no. 4, pp. 41–53, July 2005. [2] B.-S. Chen, C.-Y. Yang, F.-K. Liao, and J.-F. Liao, “Mobile location estimator in a rough wireless environment using Extended Kalman-based IMM and data fusion,” IEEE Transactions on Vehicular Technology, vol. 58, no. 3, pp. 1157–1169, March 2009. [3] M. Kok, J. D. Hol, and T. B. Schön, “Indoor positioning using ultrawideband and inertial measurements,” IEEE Transactions on Vehicular Technology, vol. 64, no. 4, 2015. [4] K. Kaemarungsi and P. Krishnamurthy, “Analysis of WLAN’s received signal strength indication for indoor location fingerprinting,” Pervasive and Mobile Computing, vol. 8, no. 2, pp. 292–316, 2012, special Issue: Wide-Scale Vehicular Sensor Networks and Mobile Sensing. [5] M. D. Branco and D. K. Dey, “A general class of multivariate skewelliptical distributions,” Journal of Multivariate Analysis, vol. 79, no. 1, pp. 99–113, October 2001. [6] A. Azzalini and A. Capitanio, “Distributions generated by perturbation of symmetry with emphasis on a multivariate skew t-distribution,” Journal of the Royal Statistical Society. Series B (Statistical Methodology), vol. 65, no. 2, pp. 367–389, 2003. [7] A. K. Gupta, “Multivariate skew t-distribution,” Statistics, vol. 37, no. 4, pp. 359–363, 2003. [8] H. Nurminen, T. Ardeshiri, R. Piché, and F. Gustafsson, “A NLOS-robust TOA positioning filter based on a skew-t measurement noise model,” in International Conference on Indoor Positioning and Indoor Navigation (IPIN), October 2015, pp. 1–7. [9] S. Frühwirth-Schnatter and S. Pyne, “Bayesian inference for finite mixtures of univariate and multivariate skew-normal and skew-t distributions,” Biostatistics, vol. 11, no. 2, pp. 317–336, 2010. [10] N. Counsell, M. Cortina-Borja, A. Lehtonen, and A. Stein, “Modelling psychiatric measures using skew-normal distributions,” European Psychiatry, vol. 26, no. 2, pp. 112–114, 2010. [11] M. Eling, “Fitting insurance claims to skewed distributions: Are the skew-normal and skew-student good models?” Insurance: Mathematics and Economics, vol. 51, no. 2, pp. 239–248, 2012. [12] Y. V. Marchenko, “Multivariate skew-t distributions in econometrics and environmetrics,” Ph.D. dissertation, Texas A&M University, December 2010. [13] A. Doucet, S. Godsill, and C. Andrieu, “On sequential Monte Carlo sampling methods for Bayesian filtering,” Statistics and Computing, vol. 10, no. 3, pp. 197–208, July 2000. [14] P. Naveau, M. G. Genton, and X. Shen, “A skewed Kalman filter,” Journal of Multivariate Analysis, vol. 94, pp. 382–400, 2005. [15] H.-M. Kim, D. Ryu, B. K. Mallick, and M. G. Genton, “Mixtures of skewed Kalman filters,” Journal of Multivariate Analysis, vol. 123, pp. 228–251, 2014. [16] J. Rezaie and J. Eidsvik, “Kalman filter variants in the closed skew normal setting,” Computational Statistics and Data Analysis, vol. 75, pp. 1–14, 2014. [17] D. L. Alspach and H. W. Sorenson, “Nonlinear Bayesian estimation using Gaussian sum approximations,” IEEE Transactions on Automatic Control, vol. 17, no. 4, pp. 439–448, Aug. 1972. [18] Y. Bar-Shalom and T. Fortmann, Tracking and Data Association, ser. Mathematics in Science and Engineering Series. Academic Press, 1988. [19] J. L. Williams and P. S. Maybeck, “Cost-function-based hypothesis control techniques for multiple hypothesis tracking,” Mathematical and Computer Modelling, vol. 43, no. 9–10, pp. 976–989, May 2006. [20] H. Nurminen, T. Ardeshiri, R. Piche, and F. Gustafsson, “Robust inference for state-space models with skewed measurement noise,” IEEE Signal Processing Letters, vol. 22, no. 11, pp. 1898–1902, November 2015. [21] C. M. Bishop, Pattern Recognition and Machine Learning. Springer, 2007. [22] M. P. Wand, J. T. Ormerod, S. A. Padoan, and R. Frühwirth, “Mean field variational Bayes for elaborate distributions,” Bayesian Analysis, vol. 6, no. 4, pp. 847–900, 2011. [23] S. X. Lee and G. J. McLachlan, “Finite mixtures of canonical fundamental skew t-distributions – the unification of the restricted and unrestricted skew t-mixture models,” Statistics and Computing, no. 26, pp. 573–589, 2016. [24] T. M. Cover and J. Thomas, Elements of Information Theory. John Wiley and Sons, 2006. [25] D. G. Tzikas, A. C. Likas, and N. P. Galatsanos, “The variational approximation for Bayesian inference,” IEEE Signal Processing Magazine, vol. 25, no. 6, pp. 131–146, Nov. 2008. [26] M. J. Beal, “Variational algorithms for approximate Bayesian inference,” Ph.D. dissertation, Gatsby Computational Neuroscience Unit, University College London, 2003. [27] G. Tallis, “The moment generating function of the truncated multinormal distribution,” Journal of the Royal Statistical Society. Series B (Methodological), vol. 23, no. 1, pp. 223–119, 1961. 11 [28] A. Genz, “Numerical computation of rectangular bivariate and trivariate normal and t probabilities,” Statistics and Computing, vol. 14, pp. 251– 260, 2004. [29] A. Genz and F. Bretz, “Comparison of methods for the computation of multivariate t probabilities,” Journal of Computational and Graphical Statistics, vol. 11, no. 4, pp. 950–971, 2002. [30] T. Perälä and S. Ali-Löytty, “Kalman-type positioning filters with floor plan information,” in 6th International Conference on Advances in Mobile Computing and Multimedia (MoMM). New York, NY, USA: ACM, 2008, pp. 350–355. [31] D. J. Simon and D. L. Simon, “Constrained Kalman filtering via density function truncation for turbofan engine health estimation,” International Journal of Systems Science, vol. 41, no. 2, pp. 159–171, 2010. [32] H. E. Rauch, C. T. Striebel, and F. Tung, “Maximum Likelihood Estimates of Linear Dynamic Systems,” Journal of the American Institute of Aeronautics and Astronautics, vol. 3, no. 8, pp. 1445–1450, August 1965. [33] J. M. Dow, R. Neilan, and C. Rizos, “The international GNSS service in a changing landscape of global navigation satellite systems,” Journal of Geodesy, vol. 83, no. 7, p. 689, February 2009. [34] Y. Bar-Shalom, R. X. Li, and T. Kirubarajan, Estimation with Applications to Tracking and Navigation, Theory Algorithms and Software. John Wiley & Sons, 2001. [35] R. Piché, S. Särkkä, and J. Hartikainen, “Recursive outlier-robust filtering and smoothing for nonlinear systems using the multivariate Student-t distribution,” in IEEE International Workshop on Machine Learning for Signal Processing (MLSP), September 2012. [36] P. Axelrad and R. Brown, “GPS navigation algorithms,” in Global Positioning System: Theory and Applications I, B. W. Parkinson and J. J. Spilker Jr., Eds. Washington D.C.: AIAA, 1996, ch. 9. [37] S. Särkkä and J. Hartikainen, “On Gaussian optimal smoothing of nonlinear state space models,” IEEE Transactions on Automatic Control, vol. 55, no. 8, pp. 1938–1941, August 2010. [38] The SpoonPhone. [Online]. Available: http://spoonphone.com/en/ [39] S. K. Sahu, D. K. Dey, and M. D. Branco, “A new class of multivariate skew distributions with applications to Bayesian regression models,” Canadian Journal of Statistics, vol. 31, no. 2, pp. 129–150, 2003. [40] R. B. Arellano-Valle and M. G. Genton, “On fundamental skew distributions,” Journal of Multivariate Analysis, no. 96, pp. 93–116, 2005. [41] ——, “Multivariate extended skew-t distributions and related families,” METRON - International Journal of Statistics, vol. 68, no. 3, pp. 201– 234, 2010. [42] H. L. Van Trees, Detection, Estimation, and Modulation Theory, Part I: Detection, Estimation, and Linear Modulation Theory. New York: John Wiley & Sons, Inc., 1968. [43] M. Šimandl, J. Královec, and P. Tichavský, “Filtering, predictive, and smoothing Cramér–Rao bounds for discrete-time nonlinear dynamic systems,” Automatica, vol. 37, pp. 1703–1716, 2001. [44] T. J. Di Ciccio and A. C. Monti, “Inferential aspects of the skew tdistribution,” Quaderni di Statistica, vol. 13, pp. 1–21, 2011. [45] S. Särkkä, Bayesian Filtering and Smoothing. Cambridge, UK: Cambridge University Press, 2013. [46] R. Piché, “Cramér-Rao lower bound for linear filtering with t-distributed measurements,” in 19th International Conference on Information Fusion (FUSION), July 2016, pp. 536–540. A PPENDIX A D ERIVATIONS FOR THE SKEW-t SMOOTHER A. Derivations for qxu Eq. (9a) gives log qxu (x1:K , u1:K ) = log N (x1 ; x1|0 , P1|0 ) + + K−1 X l=1 K X k=1 log N (xl+1 ; Axl , Q) −1 E [log N (yk ; Cxk +∆uk , Λk R) qΛ + log N+ (uk ; 0, Λ−1 k )] + c = log N (x1 ; x1|0 , P1|0 ) + K−1 X (44) log N (xl+1 ; Axl , Q) l=1 K − 1X T −1 E [(yk −Cxk −∆uk ) R Λk (yk −Cxk −∆uk ) 2 qΛ k=1 + uT k Λk uk ] + c (45) = log N (x1 ; x1|0 , P1|0 ) + K−1 X log N (xl+1 ; Axl , Q) l=1 K − 1X {(yk −Cxk −∆uk )T R−1 Λk|K (yk −Cxk −∆uk ) 2 k=1 + uT k Λk|K uk } + c = log N (x1 ; x1|0 , P1|0 ) + (46) K−1 X log N (xl+1 ; Axl , Q) l=1 + K X {log N (yk ; Axk + ∆uk , Λ−1 k|K R) k=1 + log N (uk ; 0, Λ−1 (47) k|K )} + c       P1|0 O x x1 = log N ; 1|0 , O Λ−1 u1 0 1|K        K−1 X Q O xl+1 A O xl + log N ; , O Λ−1 ul+1 O O ul l+1|K l=1     x + log N yk ; [C ∆] k , Λ−1 k|K R + c, u1:K ≥ 0, (48) uk where Λk|K , EqΛ [Λk ] is derived in Section A-B, and u1:K ≥ 0 means that all the components of all uk are required to be nonnegative for each k = 1 · · · K. Up to the truncation of the u components, qxu (x1:K , u1:K ) has thus the same form as the joint smoothing posterior of a linear state-space model with the e , [ A O ], process noise covariance state transitionh matrix A OO i Q O e , fk , , measurement model matrix C matrix Q O Λ−1 k+1|K e , Λ−1 R. [ C ∆ ], and measurement noise covariance matrix R k|K We denote the PDFs related to this state-space model with pe. It would be possible to compute the truncated multivariate normal posterior of the joint smoothing distribution pe ([ ux1:K ] |y1:K ), and account for the truncation of u1:K to 1:K the positive orthant using the sequential truncation. However, this would be impractical with large K due to the large dimensionality K × (nx + ny ). A feasible solution is to approximate each filtering distribution in the Rauch–Tung– Striebel smoother’s (RTSS [32]) forward filtering step with a multivariate normal distribution by    1 xk 0 0 ; zk|k , Zk|k · [[uk ≥ 0]] (49) pe(xk , uk |y1:k ) = N uk C    xk ≈N ; zk|k , Zk|k (50) uk for each k = 1 · · · K, where [[uk ≥ 0]] is the Iverson bracket notation, C is the normalization factor, and zk|k , x x Epe [[ ukk ] |y1:k ] and Zk|k , Varpe [[ ukk ] |y1:k ] are approximated using the sequential truncation. Given the multivariate normal approximations of the filtering posteriors pe(xk , uk |y1:k ), by Lemma 2 the backward recursion of the RTSS gives multivariate normal approximations of the smoothing posteriors pe(xk , uk |y1:K ). The quantities required in the derivations of Section A-B are the expectations of the smoother posteriors xk|K , Eqxu [xk ], uk|K , Eqxu [uk ], and the covariance matrices Zk|K , Varqxu [ uxkk ] and Uk|K , Varqxu [uk ]. Lemma 2. Let {zk }K k=1 be a linear–Gaussian process, and {yk }K a measurement process such that k=1 z1 ∼ N (z1|0 , Z1|0 ) (51a) 12 zk |zk−1 ∼ N (Azk−1 , Q) yk |zk ∼ (a known distribution). (51b) (51c) with the standard Markovianity assumptions. Then, if the filtering posterior p(zk |y1:k ) is a multivariate normal distribution for each k, then for each k < K zk |y1:K ∼ N (zk|K , Zk|K ), =N (zk ; zk|K , Zk|K ). Because zK |y1:K ∼ N (zK|K , ZK|K ), and because (56) implies (68), the statement holds by the induction argument. (52) B. Derivations for qΛ Eq. (9b) gives (53) logqΛ (Λ1:K ) = where zk|K = zk|k + Gk (zk+1|K − Azk|k ), Zk|K = Zk|k + Gk (Zk+1|K − AZk|k AT − Q)GT k, T −1 T Gk = Zk|k A (AZk|k A + Q) , (54) (55) and zk|k and Zk|k are the mean and covariance matrix of the filtering posterior p(zk |y1:k ). Proof: The proof is mostly similar to the proof of [45, Theorem 8.2]. First, assume that zk+1 |y1:K ∼ N (zk+1|K , Zk+1|K ). (56) for some k < K. The joint conditional distribution of zk and zk+1 is then p(zk , zk+1 |y1:k ) = p(zk+1 |zk ) p(zk |y1:k ) || Markovianity (57) = N (zk+1 ; Azk , Q) N (zk ; zk|k , Zk|k ) (58)       Zk|k Zk|k AT zk|k zk =N , , ; zk+1 Azk|k AZk|k AZk|k AT + Q (59) log qΛ (Λk )  1 = − E tr{(yk −Cxk −∆uk )(yk −Cxk −∆uk )T R−1 Λk } 2 qxu ny    X νi νi T +tr{uk uk Λk } + log[Λk ]ii − [Λk ]ii + c (70) 2 2 i=1  1 = − tr (yk −Cxk|K −∆uk|K )(yk −Cxk|K −∆uk|K )T 2   h T i −1 T C + [ C ∆ ] Zk|K ∆T R + (uk|K uk|K +Uk|K ) Λk + T (61) Zk|k − Gk (AZk|k A + Q)GT k ). We use this formula in p(zk , zk+1 |y1:K ) =p(zk |zk+1 , y1:K ) p(zk+1 |y1:K ) =p(zk |zk+1 , y1:k ) p(zk+1 |y1:K ) || Markovianity =N (zk ; zk|k + Gk (zk+1 − Azk|k ), Zk|k 2 i=1 log[Λk ]ii −  νi [Λk ]ii + c 2 ny  X νi νi + [Ψk ]ii log[Λk ]ii − [Λk ]ii 2 2 (71)  + c, (72) where Ψk =(yk −Cxk|K −∆uk|K )(yk −Cxk|K −∆uk|K )T R−1 h Ti C + [ C ∆ ] Zk|K ∆ R−1 + uk|K uT T k|K + Uk|K . (73) Therefore, ny   Y k ]ii qΛ (Λk ) = G [Λk ]ii ; ν2i + 1, νi +[Ψ . 2 (62) (63) − Gk (AZk|k AT + Q)GT k ) N (zk+1 |zk+1|K , Zk+1|K ) (64)     zk|k + Gk (zk+1|K − Azk|k ) zk =N ; , zk+1 •   T T Gk Zk+1|K GT • k + Zk|k − Gk (AZk|k A + Q)Gk • • (65)     z + Gk (zk+1|K − Azk|k ) zk =N ; k|k , zk+1 •   Zk|k + Gk (Zk+1|K − AZk|k AT − Q)GT • k , (66) • • so p(zk |y1:K ) =N (zk ; zk|k + Gk (zk+1|K − Azk|k ), Zk|k + Gk (Zk+1|K − AZk|k AT − Q)GT k) ny  X νi i=1 (60) E [log p(yk |xk , uk , Λk ) + log p(uk |Λk )] qxu + log p(Λk ) + c. (69) QK Thus, qΛ (Λ1:K ) = k=1 qΛ (Λk ). In the model with independent univariate skew-t-distributed measurement noise components (3), the diagonal entries of Λk are separate random variables, as given in (6c). Therefore, = Zk|k − Zk|k AT (AZk|k AT + Q)−1 AZk|k ) =N (zk ; zk|k + Gk (zk+1 − Azk|k ), K X  k=1 so by the conditioning rule of the multivariate normal distribution p(zk |zk+1 , y1:k ) =N (zk ; zk|k + Gk (zk+1 − Azk|k ), (68) (67) (74) i=1 In the derivations of Section A-A, Λk|K , EqΛ [Λk ] is required. Λk|K is a diagonal matrix with the diagonal elements [Λk|K ]ii = νi +2 νi +[Ψk ]ii . (75) In the model (29) with multivariate skew-t-distributed measurement noise Λk is of the form λk ·Iny . There, λk is a scalar random variable, and there is just one degrees-of-freedom parameter ν, as given in (30). Therefore, log qΛ (λk ) 1 = − E [tr{(yk −Cxk −∆uk )(yk −Cxk −∆uk )T R−1 λk }] 2 qxu ν 1 ν+2ny −1 − E [tr{uk uT log λk − λk + c (76) k λk }] + 2 2 qxu 2 = ν+2ny −1 2 log λk − ν+tr{Ψk } λk , 2 (77) 13 where Ψk is given in (73). Thus,   ν+2n k} . qΛ (λk ) = G λk ; 2 y , ν+tr{Ψ 2 (78) so the required expectation is Λk|K = ν+2ny ν+tr{Ψk } · Iny . (79) A PPENDIX B D ERIVATION FOR THE F ISHER INFORMATION OF MVST Consider the multivariate skew-t measurement model y|x ∼ MVST(Cx, R, ∆, ν), where C ∈ Rny ×nx , R ∈ Rny ×ny , ∆ ∈ Rny ×ny , and ν ∈ R+ . The logarithm of the PDF of y|x is 1 log p(y|x) = log(2ny / det(Ω) 2 ) + log t(r; 0, Iny , ν) q T ν+n + log T(∆T Ω− 2 r ν+rTyr ; 0, L, ν + ny ), (80) 1 where r = Ω− 2 (y − Cx) is a function of x and y, Ω = R + ∆∆T , L = Iny −∆T Ω−1 ∆, and t(·; µ, Σ, ν) and T(·; µ, Σ, ν) denote the PDF and CDF of the scaled non-central multivariate 1 t-distribution with ν degrees of freedom. A 2 is a square1 1 1 1 root matrix such that A 2 (A 2 )T = A, A− 2 , (A 2 )−1 , and 1 T A− 2 , ((A 2 )−1 )T . The Hessian matrix of the term log t(r; 0, Iny , ν) is derived in [46], and it is d2 dx2 log t(r; 0, Iny , ν)  ν+ny T − T 2 = ν C Ω − 11 1+ ν T ν+n = ν+rTyr C T Ω− 2 rT r I ny +  2/ν rrT 1 (1+ ν r T r)2   1 Ω− 2 C (81) − 21 −Iny + ν+r2 T r rrT Ω C (82) q T ν+n The term log T(∆T Ω− 2 r ν+rTyr ; 0, L, ν + ny ) can be differentiated twice using the chain rule  T 2 d2 log(f ) df df 1 d f 1 = − (83) 2 2 2 dx f dx f dx dx , which gives q T ν+n log T(∆T Ω− 2 r ν+rTyr ; 0, L, ν + ny ) q −1 T ν+n = T(∆T Ω− 2 r ν+rTyr ; 0, L, ν + ny ) g(r) q  T −2 T T ν+n Dr Pr Pr Dr , − T(∆T Ω− 2 r ν+rTyr ; 0, L, ν + ny ) (84) d2 dx2 where the function g is antisymmetric because it is the second derivative of a function that is antisymmetric up to an additive constant, Pr = d du T(u; 0, L, ν + ny ) T u=∆T Ω− 2 r r ν+ny , ν+r T r Rregularity conditions given in [42, Ch. 2.4]. The integral g(r) t(r; 0, 1, ν) dy exists because the terms of g are products of positive powers of rational expressions where the denominator is of a higher degree than the nominator and q derivaT ν+n tives of T(u; 0, 1, ν + ny ) evaluated at ∆T Ω− 2 r ν+rTyr , which is a bounded continuous function of y. The integral Z q −1 T T T ν+n Dr Pr Pr Dr T(∆T Ω− 2 r ν+rTyr ; 0, L, ν + ny ) × 2 1 det(Ω) 2 q −1 T ν+n also exists because T(∆T Ω− 2 r ν+rTyr ; 0, L, ν + ny ) and Pr are bounded and continuous and Dr is a positive power of a rational expression where the denominator is of a higher degree than the nominator. Similar arguments show the integrability of the first and second derivative of the likelihood p(y|x), which guarantees that the regularity conditions of the CRLB are satisfied. Thus, the expectation of (84) is   q ν+ny T −T d2 2 r ν+rT r ; 0, L, ν + ny ) E dx2 log T(∆ Ω p(y|x) Z Z 2 2 t(r; 0, I , ν) dy − = g(r) 1 1 t(r; 0, Iny , ν) ny det(Ω) 2 det(Ω) 2 q −1 T ν+n × T(∆T Ω− 2 r ν+rTyr ; 0, L, ν + ny ) DrT PrT Pr Dr dy (88) Z Z = 2g(r)t(r; 0, Iny , ν) dr − 2 t(r; 0, Iny , ν) q −1 T T T ν+n × T(∆T Ω− 2 r ν+rTyr ; 0, L, ν + ny ) Dr Pr Pr Dr dr (89)   q  −2 T T ν+n =− E T(ΘT r ν+rTyr ; 0, L, ν + ny ) Dr Pr Pr Dr , p(r|x) (90) − 12 q T ν+n d Dr = dx ∆T Ω− 2 r ν+rTyr (86) q T 1 ν+n = ν+rTyr ∆T Ω− 2 ( ν+r1 T r rrT − Iny )Ω− 2 C. (87) R Because the function g is antisymmetric, g(r)p(r) dy = 0 for any symmetric function p for which the integral exists. We now outline the proof of integrability of certain functions to show that the CRLB exists and fulfils the T where Θ = Ω ∆, and r|x ∼ MVST(0, Iny −ΘΘ , Θ, ν) because z ∼ MVST(µ, R, ∆, ν) implies Az ∼ MVST(Aµ, ARAT , A∆, ν). This gives   q ν+ny T −T d2 2 r ν+rT r ; 0, L, ν + ny ) E dx2 log T(∆ Ω p(y|x) h i T ν+n e e T −1 = − C T Ω− 2 E ν+rTyr R (91) r Rr Ω 2 C, p(r|x) where er = T(ΘT r R × q ν+ny ν+r T r ; 0, L, ν d du T(u; 0, L, ν (85) and t(r; 0, Iny , ν) dy −1 + ny ) (Iny − + ny ) r u=ΘT r T 1 ν+r T r rr )Θ !T , ν+ny ν+r T r (92) where L = Iny − ΘT Θ. Thus, the Fisher information for the measurement model y|x ∼ MVST(Cx, R, ∆, ν) is h i d2 I(x) = E − dx (93) 2 log p(y|x) p(y|x) h i T ν+n er R erT ) Ω− 12 C, =C T Ω− 2 E ν+rTyr (Iny − (ν+r2T r)2 rrT + R p(r|x) (94) T − 12 where r|x ∼ MVST(0, Iny −ΘΘ , Θ, ν), Θ = Ω er is defined in (92). R + ∆∆T , and R ∆, Ω =
3cs.SY
1 Delta-operator based consensus analysis of multi-agent networks with link failures arXiv:1705.01711v1 [cs.SY] 4 May 2017 Xue Lin, Yuanshi Zheng, and Long Wang Abstract In this paper, a discrete-time multi-agent system is presented which is formulated in terms of the delta operator. The proposed multi-agent system can unify discrete-time and continuous-time multi-agent systems. In a multi-agent network, in practice, the communication among agents is acted upon by various factors. The communication network among faulty agents may cause link failures, which is modeled by randomly switching graphs. First, we show that the delta representation of discrete-time multi-agent system reaches consensus in mean (in probability and almost surely) if the expected graph is strongly connected. The results induce that the continuous-time multi-agent system with random networks can also reach consensus in the same sense. Second, the influence of faulty agents on consensus value is quantified under original network. By using matrix perturbation theory, the error bound is also presented in this paper. Finally, a simulation example is provided to demonstrate the effectiveness of our theoretical results. Index Terms Consensus, multi-agent systems, delta operator, link failures, error bound. I. I NTRODUCTION Distributed cooperative control problem of multi-agent systems has captured great attention. This interest is motivated by its diverse applications in various fields, from biology and sociology This work was supported by NSFC (Grant Nos. 61375120 and 61533001), the Fundamental Research Funds for the Central Universities (Grant No. JB160419) and the Young Talent Fund of University Association for Science and Technology in Shaanxi of China (Grant No. 20160208). (Corresponding author: Long Wang.) X. Lin and Y. Zheng are with the Center for Complex Systems, School of Mechano-electronic Engineering, Xidian University, Xi’an 710071, China (e-mail:xuelinxd@yeah.net; zhengyuanshi2005@163.com) L. Wang is with Center for Systems and Control, College of Engineering, Peking University, Beijing 100871, China (email:longwang@pku.edu.cn) May 5, 2017 DRAFT 2 to control engineering and computer science. In order to finish different cooperative tasks, a variety of protocols have been established for multi-agent systems [1], [2], [3], [4]. Lots of criteria concerning multi-agent coordination have been provided [5], [6], [7], etc. As a fundamental problem of multi-agent coordination, consensus characterizes a phenomenon that multiple agents achieve a common decision or agreement. For consensus problem, it has been studied for a long time in management science [8]. The rise of consensus problem in control filed is influenced by Vicsek model [9], which is a discrete-time model of multiple agents and each agent updates its state by using average of its own state as well as its neighbors’. The theoretical analysis of consensus for Vicsek model was finished in [10]. And then in [1], the authors proposed classical consensus protocols for multi-agent systems and provided several sufficient conditions to solve the consensus problem. Inspired by these results, many researchers devoted themselves to studying consensus problems [11], [12]. For a multi-agent system, it can be analyzed from two perspectives: one is dynamic model and the other is interaction network. From the viewpoint of dynamic model, the related researches include first-order dynamics [1], [11], second-order dynamics [13], hybrid dynamics [14], switched dynamics [15], heterogeneous dynamics [16], etc. From the viewpoint of interaction network, the related researches have fixed networks [16], switching networks [12], antagonistic networks [17], random networks [18], [19], and so on. With the development of digital controller, in many cases, a continuous-time multi-agent system only obtains input signal at the discrete sampling instants. According to actual factor, researchers investigated the sampled control and the event-triggered control for multi-agent systems [3], [20], [21]. It is well known that some discrete-time multi-agent systems are obtained directly from continuous-time multi-agent systems based on sampled control, which are described by the shift operator. However, some applications may possess higher sampling rate, which will lead to ill-conditioning problems when the shift operator is applied to represent the discrete-time system [22]. And the shift operator can’t show the intuitive connection between the discrete-time system and the continuous-time system. To overcome these limitations, Goodwin et al. used the delta operator to represent the dynamics of sampled data system [22], [23]. Compared with shift operator approach, delta operator has several advantages [22], [23], [24], such as superior finite world length coefficient representation and convergence to its continuous-time counterpart as the sampling period tends to zero. It is worth pointing out that the delta operator makes May 5, 2017 DRAFT 3 the smooth transition from the discrete-time representation to the underlying continuous-time system as sampled period tends to zero. Therefore, it can be used to unify discrete-time and continuous-time systems. Due to these advantages of the delta operator, there have existed many related research results [25], [26]. Inspired by these researches, we apply the delta operator to describe the multi-agent system with sampled data. A discrete-time representation is proposed for multi-agent systems. It is well known that the communication may be destroyed in realistic multi-agent network due to link failures, node failures, etc. Thus, the consensus of multi-agent systems with random networks was also studied in [18], [19], [27], [28]. Based on the delta operator, we consider the consensus of multi-agent systems with random networks in this paper. We assume that there exist faulty agents that only receive information or send information, which lead to link failures of the network. The original network without faulty agents is an undirected connected graph. This phenomenon often occurs in practice. For instance, the receiver (emitter) of the agent is failure, which leads to the link failure of the communication network. Different from [19], we consider the consensus of discrete-time multi-agent system with directed random networks. Due to the variation of networks, however, the consensus value is changed. Therefore, we analyze the influence of faulty agents on the original network. The main contribution of this paper is twofold. First, we show that the delta representation of discrete-time multi-agent system reaches consensus in different sense (in mean, in probability and almost surely) if the expected graph is strongly connected. Based on the delta operator, we get that the consensus conditions are also appropriate for the continuous-time multi-agent system with random networks. Second, we analyze the influence of faulty agents on the consensus value under original network. By using matrix perturbation theory, the error bound between consensus values under network with link failures and original network is presented. The structure of this paper is given as follows. In Section 2, based on the delta operator, a discrete-time multi-agent system is established. In Section 3, consensus in different sense is studied. In Section 4, we provide the error bound caused by faulty agents. In Section 5, a simulation example is presented. Finally, we give a short conclusion in Section 6. Notation: Let 1, 0, R and Rn×n denote the column vector of all ones, the column vector of all zeros, the set of real numbers and the n × n real matrices, respectively. The ith eigenvalue of matrix A can be denoted as λi (A). k · k2 denotes the standard Euclidean norm, i.e., kx(t)k2 = May 5, 2017 DRAFT 4 p xT (t)x(t). We write kx(t)k = xT (t)x(t). For the vector 2-norm k·k2, the induced matrix norm p 2 (kAk2 = λmax (AT A)). We write kAk = λmax (AT A). B = [bij ] ∈ Rn×n , is kAk2 = max kAxk kxk2 kxk6=0 B ≥ 0 if all bij ≥ 0. We say that B is a nonnegative matrix if B ≥ 0. Moreover, if all its row sums are 1, B is said to be a row stochastic matrix. For a given vector or matrix A, AT denotes its transpose. Let d¯ = max{dii }, H(tk ) = max{xi (tk )}, h(tk ) = min{xi (tk )}, λ̄(A) = max{λ2 (A)} i∈In ♯ i∈In i∈In i and ζ = max{ζtk }. A denotes the group inverse of matrix A [29]. II. P RELIMINARIES A. Graph theory The communication relationship between agents is modeled as a graph G = (V, E, A) with vertex set V = {ν1 , ν2 , . . . , νn }, edge set E = {eij } ⊆ V × V and nonnegative matrix A = [aij ]n×n . If (νj , νi ) ∈ Ei , agents i and j are adjacent and aij = 1. The set of neighbors of agent i is denoted by Ni = {νj |(νj , νi )} ∈ E. The degree matrix D = [dij ]n×n is a diagonal matrix P with dii = aij . The Laplacian matrix of the graph is defined as L = [lij ]n×n = D − A with j∈N i P aij and lij = −aij . The eigenvalues of L can be denoted as 0 = λ1 (L) ≤ λ2 (L) ≤ lii = − j∈Ni · · · ≤ λn (L). Graph G is said to be strongly connected if there exists a path between any two distinct vertices. A path that connects vi and vj in the directed graph G is a sequence of distinct vertices vi0 , vi1 , vi2 , . . ., vim , where vi0 = vi , vim = vj and (vir , vir+1 ) ∈ E, 0 ≤ r ≤ m − 1. When G is an undirected connected graph, then L is positive semi-definite and has a simple zero eigenvalue. Moreover, there exists min ξ6=0,1T ξ=0 ξ T Lξ ξT ξ = λ2 (L) for any ξ ∈ Rn . Throughout this paper, we always assume that G is a undirected connected graph if there does not exist the faulty agent (agent not be able to receive or send information). B. Problem statement In this paper, we consider a multi-agent system which consists of n agents. The continuoustime dynamics of the ith agent is described by ẋi (t) = ui (t), i = 1, . . . , n, (1) where xi (t) ∈ R and ui (t) ∈ R are the state and control input of ith agent, respectively. May 5, 2017 DRAFT 5 For continuous-time multi-agent system (1), a discrete-time representation can be obtained by using a traditional shift operator. It is given by xi (tk + h) = xi (tk ) + hui (tk ), i = 1, . . . , n, (2) where h is the sampling period. It is worth noting that, as sampling period h → 0, we lose all information about the underlying continuous-time multi-agent system (1) [30]. Moreover, it is difficult to describe the next value of xi (tk ). This difficulty can be avoided using the delta operator introduced in [22]. The delta operator is defined as follows:   ẋ(t), h = 0, δx(t) =   x(t + h) − x(t) , h 6= 0. h Then, by using the delta operator, the discrete-time representation of system (1) is described by δxi (tk ) = ui (tk ). (3) It can be seen that δxi (tk ) → ẋi (tk ) as h → 0. We know that δxi (tk ) = ẋi (tk ) when h = 0. Hence, there is a smooth transition from δxi (tk ) to ẋi (tk ) as h → 0, which ensures that discretetime multi-agent system (3) converges to continuous-time multi-agent system (1) as h → 0. P For system (1), we apply the classic consensus protocol ui (t) = aij (xj (t) − xi (t)). By j∈Ni using zero-order hold, the protocol is given as: X aij (xj (tk ) − xi (tk )), t ∈ [tk , tk + h). ui (tk ) = (4) j∈Ni Denote x(t) = [x1 (t), x2 (t), . . . , xn (t)]T . System (3) with protocol (4) can be represented by δx(tk ) = −Lx(tk ). (5) Based on above discussion and analysis, we know that discrete-time multi-agent system (5) converges to the continuous-time multi-agent system ẋ(t) = −Lx(t) (6) as h → 0. In this paper, the original multi-agent network is undirected connected. We know that each agent is influenced by the information of its neighbours. However, there may exist the agent that May 5, 2017 DRAFT 6 is unable to receive or send information in the network. We call this type of agent as faulty agent in this paper. Without loss of generality, we assume that agents 1 and 2 are faulty agent, while other agents are normal. That is, they can always receive and send information in the network. Two scenarios are considered. Scenario I : Four cases are considered: (1) only agent 1 can’t receive information; (2) only agent 2 can’t receive information; (3) agents 1 and 2 cannot receive information simultaneously; (4) all agents are normal. Networks G1 , G2 , G3 and G4 correspond to the four cases (1), (2), (3) and (4), respectively. We assume that Gi randomly switches among distinct networks Gi ∈ {G1 , G2 , G3 , G4 }. Networks G1 , G2 , G3 and G4 correspond to the occurrence probabilities 1 > α > 0, 1 > β > 0, 1 > γ > 0 and 1 > θ > 0, respectively. Moreover, α + β + γ + θ = 1. Scenario II : Four cases are considered: (1) only agent 1 can’t send information; (2) only agent 2 can’t send information; (3) agents 1 and 2 cannot send information simultaneously; (4) all agents are normal. Networks G′1 , G′2 , G′3 and G′4 correspond to the four cases (1), (2), (3) and (4), respectively. We assume that G′i randomly switches among distinct networks G′i ∈ {G′1 , G′2 , G′3 , G′4 }. Networks G′1 , G′2 , G′3 and G′4 correspond to the occurrence probabilities 1 > α > 0, 1 > β > 0, 1 > γ > 0 and 1 > θ > 0, respectively. Moreover, α + β + γ + θ = 1. System (5) under Scenario I or II can be written as: δx(tk ) = −Ltk x(tk ), (7) where Ltk is the Laplacian matrix at time point tk . Note that the graph Gtk is invariant during the time interval ∆. Corresponding adjacent matrix at time point tk is Atk . Throughout this paper, the sampling period satisfies ∆ = k̄h when h 9 0. Two main objectives are considered in this paper. First, the consensus of system (7) is considered. Second, the error bound between consensus values of system (5) and system (7) is presented. Remark 1: For simplicity, we focus on two faulty agents. However, the analytical methods concerning error bound in this paper can be extended to the Scenario of more than two faulty agents, which is left to the interested readers as an exercise. Definition 1: System (7) reaches consensus (a) in mean if for any x0 ∈ Rn it holds that lim E [x(t)] = v(x0 ); tk →∞ May 5, 2017 (8) DRAFT 7 (b) in probability if ∀ε > 0 and any x0 ∈ Rn it holds that lim P {H(tk ) − h(tk ) ≥ ε} = 0; (9) tk →∞ (c) almost surely if for any x0 ∈ Rn it holds that   P lim (H(tk ) − h(tk )) = 0 = 1. (10) tk →∞ Definition 2 ([31]): Let W denote the transition matrix of Markov chain. Then the Markov chain is called the regular chain if there exist k > 0 such that W k has only positive elements. ∞ P Lemma 1 ([29]): If T is the transition matrix of a regular chain, then A♯ = (T k − T ∞ ) k=0 where A = I − T . Lemma 2 ([32]): If C and C̃ are ergodic chains with transition matrices T and T̃ = T − E and limiting probability vectors s and s̃, respectively, then s − s̃ = sEA♯ (I + EA♯ )−1 where E1 = 0 and A = I − T . Lemma 3 ([23]): The property of delta operator for any time function x(tk ) and y(tk ) can be represented as δ(x(tk )y(tk )) = δ(x(tk ))y(tk ) + x(tk )δ(y(tk )) + hδ(x(tk ))δ(y(tk )). Lemma 4: Assume that the sampling period 0 < h < 1 . dmax Then, system (5) can reach average consensus if the graph is undirected connected. Proof. Let ν(tk ) = x(tk ) − 11T n x(0). Due to L1 = 0, one has δ(ν(tk )) = −Lν(tk ). Consider V (tk ) = kν(tk )k as a Lyapunov function. By Lemma 3, it holds that δV (tk ) = δ T (ν(tk ))ν(tk ) + ν T (tk )δ(ν(tk )) + hδ T (ν(tk ))δ(ν(tk )) = ν T (tk )(−2L + hLT L)ν(tk ) = ν T (tk )Ξν(tk ). Since the graph is undirected connected, which implies that the Laplacian matrix L is positive semi-definite. Hence, the eigenvalues of Ξ are repsented by −2λi (L) + hλ2i (L). From Gersgorin Disk Theorem, we get λi (L) ≤ 2dmax . Then −2 + hλi (L) < −2 + min ξ6=0,1T ξ=0 ξ T Lξ ξT ξ 1 2dmax dmax ≤ 0. Owing to = λ2 (L), then δV (tk ) ≤ −(2λ(L) − hλ2 (L))kν(tk )k May 5, 2017 DRAFT 8 where 2λ(L) − hλ2 (L) = min{2λ2 (L) − hλ22 (L), 2λn (L) − hλ2n (L)}. Due to λ2 (L) > 0 and λn (L) > 0, this proves that δV (tk ) < 0. Therefore, ν(tk ) is converge to 0. That is, system (5) can achieve average consensus asymptotically.  Remark 2: From Lemma 4, there exists δV (tk ) = V (tk + h) − V (tk ) < 0, h which implies that V (tk + h) − V (tk ) = V̇ (t) < 0. h→0 h lim δV (tk ) = lim h→0 It can be seen that δV (tk ) < 0 can be reduced to the V̇ (t) < 0 as h → 0. Note that system (5) converges to system (6) as h → 0. Consequently, system (6) reaches average consensus under undirected connected graph. III. C ONSENSUS ANALYSIS In this section, it is shown that system (5) reaches consensus despite the existence of faulty agents. Supposed that Scenario I and Scenario II have the same expression pattern for the network. Hence, the following results can be viewed as the unified conclusions of system (5) under Scenarios I and II. Theorem 1: Assume that the sampling period 0 < h < 1 . dmax Then, system (7) reaches consensus in mean if the expected graph is strongly connected. Furthermore, lim E[x(tk )] = 1π̄ T x(0), (11) tk →∞ where 1π̄ T =   1π̄1T = lim W1k : W1 = E[(I − hLtk )k̄ ], k→∞  1π̄ T = lim W k : W2 = E[e−Ltk ∆ ], h → 0, 2 2 k→∞ vectors π̄1 > 0 and π̄2 > 0 are left eigenvectors of the matrices W1 and W2 , respectively, such that π̄1T 1 = 1 and π̄2T 1 = 1. t Proof. As pointed out in [22], the solution to system (5) is x(t) = (I − hL) h x(0). Due to the invariance of graph Gtk during the time interval ∆, it can be get that x(tk + ∆) = (I − May 5, 2017 DRAFT 9 ∆ hLtk ) h x(tk ). Then lim E(x(tk )) k→∞ = lim [E((I − hLtk )k̄ )]k x(0) k→∞ = lim [(I − hL1 )k̄ α + (I − hL2 )k̄ β + (I − hL3 )k̄ γ + (I − hL4 )k̄ θ]k x(0) (12) k→∞ = lim W1k x(0). k→∞ According to 0 < h < 1 , dmax we have I − hLi = I − hDi + hAi ≥ 0 with positive diagonal elements. Since α > 0, β > 0, γ > 0 and θ > 0, it is immediate that E((I − hLtk )k̄ ) is also nonnegative matrix with positive diagonal elements. It follows that E((I − hLtk )k̄ ) ≥ Π(A1 α + A2 β + A3 γ + A4 θ), where Π is a positive diagonal matrix. Since the expected graph is strongly connected, matrix E((I − hLtk )k̄ ) is a nonnegative irreducible with positive diagonal elements. Moreover, it is easy to verify that E((I − hLtk )k̄ )1 = 1. Then, by Gers̆gorin Disc theorem, one has |λi (E((I − hLtk )k̄ ))| ≤ 1. Hence, by Perron-Frobenius Theorem [33], it can be deduced that ρ(E((I − hLtk )k̄ )) = 1 is an algebraically simple eigenvalue. Consequently, matrix W1 is a primitive. By virtue of Theorem 8.5.1 in [33], we obtain that lim E[x(tk )] = 1π¯1 T x(0). Hence, system (7) tk →∞ reaches consensus in mean. Next, we give the consensus value of system (7) as h → 0. By Proposition 11.1.3 in [34], it ∆ follows that x(tk + ∆) = (I − hLtk ) h x(tk ) = e−Ltk ∆ as h → 0. Hence lim E(x(tk )) tk →∞ = lim [E((I − hLtk )k̄ )]k x(0) k→∞ = lim (e−L1 ∆ α + e−L2 ∆ β + e−L3 ∆ γ + e−L4 ∆ θ)k x(0) (13) k→∞ = lim W2k x(0). k→∞ Let Ltk = dmax I − Ātk , then e−Ltk ∆ = e−∆dmax I eĀtk ≥ ζtk Ātk for ζtk > 0 where Ātk ≥ Atk . Hence, E(e−Ltk ∆ ) ≥ ζ(Ā1 α + Ā2 β + Ā3 γ + Ā4 θ). That is, matrix E(e−Ltk ∆ ) is a nonnegative irreducible with positive diagonal elements. Similar to the previous discussion, we have lim E[x(tk )] = 1π¯2 T x(0) as h → 0.  tk →∞ Theorem 2: Assume that the sampling period 0 < h < 1 . dmax Then, system (7) reaches consensus in probability if the expected graph is strongly connected. May 5, 2017 DRAFT 10 Proof. Since the expected graph is strongly connected, by Theorem 1, it follows that lim E(H(tk )− tk →∞ n P k̄ wij xj (tk ). Since matrix h(tk )) = 0. Let (I − hLtk ) = [wij ]n×n , we have xi (tk + ∆) = j=1 (I − hLtk )k̄ is a row stochastic matrix, we get H(tk + ∆) ≤ H(tk ) and h(tk + ∆) ≥ h(tk ). It can be verified that the H(tk ) − h(tk ) is nonincreasing. Let tk+1 = tk + ∆, hence 0 ≤ H(tk+1 ) − h(tk+1 ) ≤ H(tk ) − h(tk ), which yields E[(H(tk+1 ) − h(tk+1 ))2 ] ≤ E[H(tk ) − h(tk )](H(0) − h(0)). (14) lim E[(H(tk+1 ) − h(tk+1 ))2 ] = 0. (15) Hence tk →∞ As a result of Chebyshevs inequality, for any ε > 0, it follows that P {H(tk ) − h(tk ) ≥ ε} ≤ E[(H(tk ) − h(tk ))2 ] . ε2 (16) Therefore lim P {H(tk ) − h(tk ) ≥ ε} = 0. (17) tk →∞ ∆ It is shown from Theorem 1 that lim (I −hLtk ) h = e−Ltk ∆ . Matrix e−Ltk ∆ is also a row stochastic h→0 matrix. Similar to the above proof, it can be proved that (17) also holds as h → 0.  Theorem 3: Assume that the sampling period 0 < h < 1 . dmax Then, system (7) reaches consensus almost surely if the expected graph is strongly connected. Proof. It follows from Theorem 2 that H(tk ) − h(tk ) → 0 in probability. By Theorem 2.5.3 in [35], there exists a subsequence of {H(tk ) − h(tk )} that converges almost surely to 0. Hence, for any ε > 0, there exists tl such that for tl̄ ≥ tl , H(tl̄ ) − h(tl̄ ) < ε almost surely. Since {H(tk ) − h(tk )} is nonincreasing, it holds that 0 ≤ H(tl̄+1 ) − h(tl̄+1 ) ≤ H(tl̄ ) − h(tl̄ ) < ε almost surely. Therefore, for any tk ≥ tl̄+1 , there holds 0 ≤ {H(tk ) − h(tk )} < ε almost surely. This implies that system (7) reaches consensus almost surely.  Remark 3: As pointed out in Theorem 1, one has x(tk + ∆) = e−Ltk ∆ x(tk ) as h → 0. Since the network is invariant during time interval ∆, partial state of system (6) can be represented by x(tk + ∆) = e−Ltk ∆ x(tk ). It is shown from Theorem 1 that the sequence x(tk ) achieves consensus in mean. Then, using −L1 = 0, we can conclude that x(t) achieves consensus in mean. Therefore, system (6) with random networks reaches consensus in mean if the expected graph is strongly connected. May 5, 2017 DRAFT 11 This indicates that the consensus result of system (7) with random networks reduces to the consensus result of system (6) under random networks as h → 0. Moreover, Theorems 2 and 3 are also appropriate for the continuous-time multi-agent system as h → 0. IV. E RROR ANALYSIS In this section, we consider the error bound on the consensus value lim E(x(tk )) and the tk →∞ consensus value under original network 11T n x(0), i.e., lim E(x(tk )) − 11T n x(0) = 1π̄ T x(0) − tk →∞ 1T n = 1(π̄ T − 11T n x(0) (18) )x(0). To solve this problem, the matrix perturbation theory and the property of finite Markov chains are applied. On the analysis of the consensus problem, we apply E(x(tk + ∆)) = W1 E(x(tk )). Suppose that the expected graph is strongly connected and 0 < h < 1 . dmax Then, Theorem 1 shows that W1 is a row stochastic matrix such that W1k > 0. By property of row stochastic matrix, each element wij of matrix W1 satisfies 0 ≤ wij < 1. Hence, by Definition 2, W1 can be regarded as the transition matrix of a regular chain. Moreover, W1 is a transition matrix of ergodic chain. It is noteworthy that the following analysis results are appropriate for Scenario I and Scenario II. Theorem 4: Assume that the sampling period 0 < h < 1 dmax and the expected graph is strongly connected. Then kπ̄1T − 1T n k ≤ kD1 k 1 T , 1−λ̄(W̄1 − 11n ) (19) and kπ̄2T − where W̄1 = (I − hL4 )k̄ , D1 = 3 P 1T n k ≤ kD2 k 1 T , 1−λ̄(W̄2 − 11n ) h → 0, (20) ((I − hLi )k̄ − (I − hL4 )k̄ )pi , W̄2 = e−L4 ∆ , D2 = i=1 3 P (e−Li ∆ − i=1 e−L4 ∆ )pi . p1 , p2 , p3 correspond to α, β, γ, respectively. Proof. It is pointed out that W1 = (I − hL1 )k̄ α + (I − hL2 )k̄ β + (I − hL3 )k̄ γ + (I − hL4 )k̄ θ can be written as W1 = W̄1 + D1 . From Theorem 1, we can derive that lim W̄1k = k→∞ 11T n and W1 is a row stochastic matrix. Hence, it proves that the row sums of D1 are all equal to 0. Moreover, it follows from Theorem 1 that lim W1k = 1π̄1T . Let e = π̄1T − k→∞ 1T n , we analyze the error bound of kek. May 5, 2017 DRAFT 12 Using Lemmas 1 and 2, it holds that e= where F = ∞ P (W̄1k − k=0 holds 11T n 1T n D1 F (I − D1 F )−1 , (21) ). By some algebraic manipulations for (21), the following equation 1T n D1 F = e − π̄1T D1 F + 1T n (22) D1 F, i.e., e = π̄1T D1 F . This implies that kek = kπ̄1T D1 F k ≤ kπ̄1T kkD1 F k. Due to π̄1 > 0 and π̄1T 1 = 1, we get kek ≤ kD1 F k. ∞ P (W̄1k − It follows from F = kD1 ∞ P k=0 k=0 W̄1k k. 11T n ) that kek ≤ kD1 F k = kD1 ∞ P k=0 W̄1k k. Hence, we analyze To solve this problem, we introduce a vector y(0) such that ky(0)k = 6 0 and y(k + 1) = W̄1k y(0). It is obvious that 1T y(k) = 1T y(0). Therefore, kD1 W̄1k y(0)k ≤ kD1 kkW̄1k y(0)k = kD1 kkW̄1 y(k)k T Owing to W̄1 11n = 11T n = kD1 kk(W̄1 − 11T n = kD1 kk(W̄1 − 11T k ) kkI n 11T n )(y(k) − − 11T n (23) y(0))k kky(0)k. T W̄1 , by Theorem 4.5.15 in [33], we have λi (W̄1 − 11n ) = (1−hλi (L4 ))k̄ − T T λi ( 11n ). There exists the eigenvector 1 corresponding to λ1 (W̄1 ) = 1 and λ1 ( 11n ) = 1, which 11T n implies λ1 (W̄1 − ) = 0 and λi (W̄1 − 11T n ) = (1 − hλi (L4 ))k̄ , i = 2, · · · , n. Moreover, by a T T similar analysis, we have λ1 (I − 11n ) = 0 and λi (I − 11n ) = 1, i = 2, . . . , n. Due to 0 < h < it can be deduced that −1 < 1 − hλi (L4 ) < 1. We know that matrix W̄1 − Consequently, 0 ≤ λ̄(W̄1 − T 11 n ) = max{λi ((W̄1 − T 11 n kD1 W̄1k y(0)k ≤ λ̄k (W̄1 − )T (W̄1 − 11T n T 11 n 11T n 1 , dmax is symmetric. ))} < 1. It follows that (24) )kD1 kky(0)k. Then kD1 ∞ P k=0 W̄1k y(0)k ≤ k=0 kD1 W̄1k y(0)k ≤ kD1 k(1 + λ̄(W̄1 − On account of kD1 W̄1 k2 = kD1 k ∞ P kD W̄1k y(0)k2 ky(0)k2 ky(0)k2 6=0 max (25) 11T n 2 ) + λ̄ (W̄1 − and λ̄(W̄1 − 11T n 11T n ) + · · · )ky(0)k. ) < 1, we obtain kek ≤ 1 T . 1−λ̄(W̄1 − 11n ) May 5, 2017 DRAFT 13 When h → 0, from Theorem 1 we know that lim E[x(tk )] = 1π̄2T x(0). Then we analyze tk →∞ kek = kπ̄2T − 1T n k. It is clear that E(x(tk + ∆)) = W2 E(x(tk )) for h → 0, where W2 = lim W1 = e−L1 ∆ α + e−L2 ∆ β + e−L3 ∆ γ + e−L4 ∆ θ. (26) h→0 Similar to W1 , W2 can be regarded as the transition matrix of a regular chain. Moreover W2 = W̄2 + D2 and D2 1 = 0. When h → 0, by using lim W̄1k = 11T n k→∞ 11T n , we have lim W̄2 = (e−L4 ∆ )k = k→∞ . Hence kek ≤ ∞ P k=0 kD2 W̄2k k ≤ kD2 k(1 + λ̄(W̄2 − 11T n Similar to the above analysis, we get that 0 ≤ λ̄(W̄2 − kD2 k 1 T . 1−λ̄(W̄2 − 11n ) ) + λ̄2 (W̄2 − 11T n 11T n ) + · · · ). (27) ) < 1. Therefore, we have kek ≤  Remark 4: Agent that can’t receive information is considered in Scenario I, while agent that can’t send information is considered in Scenario II. We assume that there exist agents which can not receive or send information in Scenario III. For this scenario, similar to Theorem 4, error bound on consensus value can be calculated. 1 dmax Theorem 5: Assume that the sampling period ∆ = h < and the expected graph is strongly connected in Scenario I. Then kπ̄1T − 1T n k≤ where W̄1 = I − hL4 and c = h2 max{ 2c max{(α + β)2 , (β + γ)2 } 1 − λ̄(W̄1 − n P j=1 2 l1j , n P j=1 11T n ) , (28) 2 l2j }. Proof. Due to h = ∆, then we have W1 = (I − hL1 )α + (I − hL2 )β + (I − hL3 )γ + (I − hL4 )θ. Matrix W1 is expressed as W̄1 + D1 , where   l11 (α + γ) l12 (α + γ) · · · l1n (α + γ)   l (β + γ) l (β + γ) · · · l (β + γ) 22 2n  21    . D1 = h  0 0 ··· 0     . . . . .. .. .. ..     0 0 0 0 Similar to the analysis of Theorem 4, we have kek = kπ̄1T D1 F k ≤ kD1 F k = kD1 calculate kD1 ∞ P k=0 May 5, 2017 (29) ∞ P k=0 W̄1k k. To W̄1k k, we introduce a vector y(0) such that ky(0)k = 6 0 and y(k +1) = W̄1k y(0). DRAFT 14 By utilizing (29), the following equation is obtained kD1 y(k)k = h2 (α + γ)2 (l11 y1 (k) + l12 y2 (k) + · · · + l1n yn (k))2 +h2 (β + γ)2 (l21 y1 (k) + l22 y2 (k) + · · · + l2n yn (k))2 . Due to l11 = − n P n P l1j and l22 = − j=2 l2j , j=1,j6=2 kD1 y(k)k = h2 (α + γ)2 (−l12 (y1 (k) − y2 (k)) − · · · − l1n (y1 (k) − yn (k)))2 +h2 (β + γ)2 (−l21 (y2 (k) − y1 (k)) − · · · − l2n (y2 (k) − yn (k)))2 . Let ȳ(k) = 1T n (30) (31) y(0), substituting ȳ(k) into equation (31) leads to that kD1 y(k)k = h2 (α + γ)2 (l11 (y1 (k) − ȳ(k)) − l12 (ȳ(k) − y2 (k)) − · · · )2 +h2 (β + γ)2 (l22 (y2 (k) − ȳ(k)) − l21 (ȳ(k) − y2 (k)) − · · · )2 n n n n P P P P 2 2 ≤ h2 (α + γ)2 l1j (yi (k) − ȳ(k))2 + h2 (β + γ)2 l2j (yi (k) − ȳ(k))2 = h2 (α + γ)2 j=1 n P j=1 i=1 2 l1j ky(k) − 1ȳ(k)k + h2 (β + γ) 2 2 ≤ 2c max{(α + γ) , (β + γ) }ky(k) − 1ȳ(k)k. n P 2 j=1 j=1 i=1 2 l2j ky(k) − 1ȳ(k)k (32) By using ky(k + 1) − 1ȳ(k)k = k(W1 − T 11 n )y(k)k, we get ky(k + 1) − 1ȳ(k)k ≤ λ̄k (W̄1 − where 0 ≤ λ̄(W̄1 − 11T n 11T n ) < 1. Hence 11T n kD1 y(k + 1)k ≤ 2c max{(α + γ)2 , (β + γ)2 }λ̄k (W̄1 − Due to kD1 ∞ P k=0 W̄1k y(0)k ≤ ∞ P ∞ P )ky(0)k. (34) kD1 W k y(0)k, it holds that k=0 kD1 W k y(0)k = ∞ P kD1 y(k)k k=0 k=0 ≤ Therefore, kek ≤ kD1 (33) )ky(0)k, ∞ P W̄1k k ≤ 2c max{(α + β)2 , (β + γ)2 } 1 − λ̄(W̄1 − 11T n 2c max{(α + β)2 , (β + γ)2 } T 1 − λ̄(W̄1 − 11n ) Corollary 1: Assume that the sampling period ∆ = h < k=0 ) ky(0)k. . 1 dmax and the expected graph is strongly connected in Scenario II. Then kπ̄1T − May 5, 2017 1T n k≤ 4c̃ max{(α + β)2 , (β + γ)2 } 1 − λ̄(W̄1 − 11T n ) , (35) DRAFT 15 where W̄1 = I − hL4 and c̃ = h2 max{ n P j=1 2 lj1 , n P j=1 2 lj2 }. Proof. Due to h = ∆, then we have W1 = (I − hL1 )α + (I − hL2 )β + (I − hL3 )γ + (I − hL4 )θ. Matrix W1 can be expressed as W̄1 + D̃1 , where  −l12 (β + γ) l12 (β + γ) 0   l (α + γ) −l (α + γ) 0 21  21  D̃1 = h  l32 (β + γ) −l31 (α + γ) − l32 (β + γ)  l31 (α + γ)  .. .. . ..  . .  ln1 (α + γ) ln2 (β + γ) 0 ··· 0 ··· 0 ··· .. . 0 .. .  · · · −ln1 (α + γ) − ln2 (β + γ) (36) By utilizing (36), we have 2 2 kD̃1 y(k)k = h2 l21 (α + γ)2 (y1 − y2 )2 + h2 l12 (β + γ)2 (y1 − y2 )2 +(hl31 (α + γ)(y1 − y3 ) + hl32 (β + γ)(y2 − y3 ))2 + · · · + (hln1 (α + γ)(y1 − yn ) + hln2 (β + γ)(y2 − yn ))2 2 2 = (h2 l21 (α + γ)2 + h2 l12 (β + γ)2 )(y1 − ȳ + ȳ − y2 )2 + · · · + (hln1 (α + γ)(y1 − ȳ + ȳ − yn ) + hln2 (β + γ)(y2 − ȳ + ȳ − yn ))2 n n n n P P P P 2 2 (yi (k) − ȳ(k))2 lj2 (yi (k) − ȳ(k))2 + 4h2 (β + γ)2 lj1 ≤ 4h2 (α + γ)2 j=1 i=1 j=1 2 i=1 2 ≤ 4c̃ max{(α + γ) , (β + γ) }ky(k) − 1ȳ(k)k. (37) Similar to the analysis of Theorem 5, we have ∞ X 4c̃ max{(α + β)2 , (β + γ)2 } W̄1k k ≤ kek ≤ kD̃1 . 11T ) 1 − λ̄( W̄ − 1 k=0 n  V. S IMULATION In this section, a simulation is presented to illustrate the effectiveness of our theoretical results. Example 1: We consider that the communication network is chosen as in Figure 1. The interaction topology among agents randomly switches among G1 , G2 , G3 and G4 . Networks G1 , G2 , G3 and G4 correspond to the occurrence probabilities α = 0.3, β = 0.3, γ = 0.2, θ = 0.2, respectively. By calculation, we can get the sampling period 0 < h < 0.5. We choose h = 0.01, ∆ = 0.1 and initial value x(0) = [0.2, 0.8, 0.4, −1, −2]T . Figure 2 depicts the state trajectories of system (5) with random networks. It can be seen that all the agents reach consensus. The May 5, 2017 DRAFT     .     16 1 1 2 5 3 4 2 5 3 4 1 1 4 Fig. 1. 2 5 2 5 3 4 3 Network topologies G1 , G2 , G3 and G4 . 1 0.5 State x(t) 0 −0.5 −1 −1.5 −2 0 1 2 3 4 5 6 7 Time Fig. 2. State trajectories of system (5) with random networks. original network is denoted by graph G4 . The state trajectories of system (5) under network G4 are shown in Figure 3. It is shown that all the agents reach consensus. By calculation, we obtain kD1 k obtain kπ̄ T − 1T n 1 T 1−λ̄(W̄1 − 11n ) = 0.0716. Therefore, based on Theorem 4, we can k ≤ 0.0716. It follows from (18) that, when tk → ∞, kE(x(tk )) − 11T n x(0)k ≤ T 2.0918. From Figures 2 and 3, it is easy to verify that error bound kE(x(tk )) − 11n x(0)k is less than 2.0918. May 5, 2017 DRAFT 17 1 0.5 State x(t) 0 −0.5 −1 −1.5 −2 0 1 2 3 4 5 6 7 Time Fig. 3. State trajectories of system (5) with network G4 . VI. C ONCLUSION In this paper, based on the delta operator, a discrete-time multi-agent system is proposed. It is pointed out that the proposed discrete-time multi-agent system can converge to the continuoustime multi-agent system as the sampling period tends to zero. We assume that there exist faulty agents that only send or receive information in the network. The communication network is described by randomly switching networks. Under the random networks, it is proved that the consensus in mean (in probability and almost surely) can be achieved when the expected graph is strong connected. Furthermore, the influence of faulty agents on the consensus value is analyzed. The error bound between consensus values under network with link failures and original network is presented. In the future, based on the delta operator, we will consider the formation control and containment control of multi-agent systems, etc. R EFERENCES [1] R. Olfati-Saber and R. M. Murray, “Consensus problems in networks of agents with switching topology and time-delays,” IEEE Transactions on Automatic Control, vol. 49, no. 9, pp. 1520–1533, 2004. [2] Y. Zheng and L. Wang, “A novel group consensus protocol for heterogeneous multi-agent systems,” International Journal of Control, vol. 88, no. 11, pp. 2347–2353, 2015. [3] Y. P. Gao and L. Wang, “Sampled-data based consensus of continuous-time multi-agent systems with time-varying topology,” IEEE Transactions on Automatic Control, vol. 56, no. 5, pp. 1226–1231, 2011. [4] X. Lin and Y. Zheng, “Finite-time consensus of switched multiagent systems,” IEEE Transactions on Systems, Man, and Cybernetics: Systems, to be published, doi: 10.1109/TSMC.2016.2631659. May 5, 2017 DRAFT 18 [5] L. Wang and F. Xiao, “Finite-time consensus problems for networks of dynamic agents,” IEEE Transactions on Automatic Control, vol. 55, no. 4, pp. 950–955, 2010. [6] Y. Zheng and L. Wang, “Containment control of heterogeneous multi-agent systems,” International Journal of Control, vol. 87, no. 1, pp. 1–8, 2014. [7] F. Xiao, L. Wang, J. Chen, and Y. Gao, “Finite-time formation control for multi-agent systems,” Automatica, vol. 45, no. 11, pp. 2605–2611, 2009. [8] M. H. Degroot, “Reaching a consensus,” Journal of the American Statistical Association, vol. 69, no. 345, pp. 118–121, 1974. [9] T. Vicsek, A. Czirok, E. B. Jacob, I. Cohen, and O. Schochet, “Novel type of phase transition in a system of self-driven particles,” Physical Review Letters, vol. 75, no. 6, pp. 1226–1229, 1995. [10] A. Jadbabaie, J. Lin, and A. S. Morse, “Coordination of groups of mobile autonomous agents using nearest neighbor rules,” IEEE Transactions on Automatic Control, vol. 48, no. 6, pp. 988–1001, 2003. [11] W. Ren and R. W. Beard, “Consensus seeking in multiagent systems under dynamically changing interaction topologies,” IEEE Transactions on Automatic Control, vol. 50, no. 5, pp. 655–661, 2005. [12] F. Xiao and L. Wang, “Asynchronous consensus in continuous-time multi-agent systems with switching topology and time-varying delays,” IEEE Transactions on Automatic Control, vol. 53, no. 8, pp. 1804–1816, 2008. [13] G. Xie and L. Wang, “Consensus control for a class of networks of dynamic agents,” International Journal of Robust and Nonlinear Control, vol. 17, no. 10-11, pp. 941–959, 2007. [14] Y. Zheng, J. Ma, and L. Wang, “Consensus of hybrid multi-agent systems,” IEEE Transactions on Neural Networks and Learning Systems, to be published, doi:10.1109/TNNLS.2017.2651402. [15] Y. Zheng and L. Wang, “Consensus of switched multi-agent systems,” IEEE Transactions on Circuits and Systems II: Express Briefs, vol. 63, no. 3, pp. 314–318, 2016. [16] Y. Zheng, Y. Zhu, and L. Wang, “Consensus of heterogeneous multi-agent systems,” IET Control Theory and Applications, vol. 5, no. 16, pp. 1881–1888, 2011. [17] C. Altafini, “Consensus problems on networks with antagonistic interactions,” IEEE Transactions on Automatic Control, vol. 58, no. 4, pp. 935–946, 2013. [18] Y. Hatano and M. Mesbahi, “Agreement over random networks,” IEEE Transactions on Automatic Control, vol. 50, no. 11, pp. 1867–1872, 2005. [19] X. Lin, Y. Zheng, and L. Wang, “Consensus of switched multi-agent systems with random networks,” International Journal of Control, vol. 9, no. 5, pp. 1113–1122, 2017. [20] G. Xie, H. Liu, L. Wang, and Y. Jia, “Consensus in networked multi-agent systems via sampled control: fixed topology case,” in Proceedings of 2009 American Control Conference, 2009, pp. 3902–3907. [21] M. Cao, F. Xiao, and L. Wang, “Event-based second-order consensus control for multi-agent systems via synchronous periodic event detection,” IEEE Transactions on Automatic Control, vol. 60, no. 9, pp. 2452–2457, 2015. [22] G. C. Goodwin, R. H. Middleton, and H. V. Poor, “High-speed digital signal processing and control,” Proceedings of the IEEE, vol. 80, no. 2, pp. 240–259, 1992. [23] A. Feuer and G. C. Goodwin, Sampling in Digital Signal Processing and Control. Birkhäuser Boston, 1996. [24] R. H. Middleton and G. C. Goodwin, “Improved finite word length characteristics in digital control using delta operators,” IEEE Transactions on Automatic Control, vol. 31, no. 11, pp. 1015–1021, 1986. May 5, 2017 DRAFT 19 [25] F. Bayat and T. A. Johansen, “Multi-resolution explicit model predictive control: Delta-model formulation and approximation,” IEEE Transactions on Automatic Control, vol. 58, no. 11, pp. 2979–2984, 2013. [26] D. Ginoya, P. D. Shendge, and S. B. Phadke, “Delta-operator-based extended disturbance observer and its applications,” IEEE Transactions on Industrial Electronics, vol. 62, no. 9, pp. 5817–5828, 2015. [27] S. Kar and J. M. F. Moura, “Sensor networks with random links: Topology design for distributed consensus,” IEEE Transactions on Signal Processing, vol. 56, no. 7, pp. 3315–3326, 2008. [28] F. Fagnani and S. Zampieri, “Randomized consensus algorithms over large scale networks,” IEEE Journal on Selected Areas in Communications, vol. 26, no. 4, pp. 634–649, 2008. [29] C. D. Meyer, “The role of the group generalized inverse in the theory of finite markov chains,” SIAM Review, vol. 17, no. 3, pp. 443–464, 1975. [30] G. C. Goodwin, J. I. Yuz, J. C. AgüEro, and M. Cea, “Sampling and sampled-data models,” in American Control Conference, 2010, pp. 1–20. [31] J. J. Buckley and E. Eslami, “Fuzzy markov chains: uncertain probabilities,” Mathware and Soft Computing, vol. 9, no. 1, pp. 33–41, 2002. [32] C. D. Meyer, “The condition of a finite markov chain and perturbation bounds for the limiting probabilities,” SIAM Journal of Algebraic Discrete Methods, vol. 1, no. 3, pp. 273–283, 1980. [33] R. A. Horn and C. R. Johnson, Matrix analysis. Cambridge University press, 2012. [34] D. S. Bernstein, Matrix mathematics: theory, facts, and formulas. Princeton University Press, 2009. [35] R. B. Ash and C. Doleans-Dade, Probability and measure theory. Academic Press, 2000. May 5, 2017 DRAFT
3cs.SY
Identifiability of two-component skew normal mixtures with one known component Shantanu Jaina , Michael Levineb , Predrag Radivojaca , Michael W. Trossetc arXiv:1801.00038v1 [math.ST] 29 Dec 2017 a Department of Computer Science Indiana University, Bloomington, Indiana, U.S.A. b Department of Statistics Purdue University, West Lafayette, Indiana, U.S.A. c Department of Statistics Indiana University, Bloomington, Indiana, U.S.A. Abstract We give sufficient identifiability conditions for estimating mixing proportions in two-component mixtures of skew normal distributions with one known component. We consider the univariate case as well as two multivariate extensions: a multivariate skew normal distribution (MSN) by Azzalini and Dalla Valle (1996) and the canonical fundamental skew normal distribution (CFUSN) by Arellano-Valle and Genton (2005). The characteristic function of the CFUSN distribution is additionally derived. 1. Introduction We study identifiability of the mixing proportion for a mixture of two skew normal distributions when one of the components is known. This problem has direct implications for the estimation of mixing proportions given a sample from the mixture and a sample from one of the components. A sample from the mixture is typically collected for a set of objects under study, whereas the component sample is collected for a set of objects verified to satisfy some property of interest. This setting is common in domains where an absence of the property cannot be easily verified due to practical or systemic constraints, e.g., in social networks, molecular biology, etc. In social networks, for example, users may only be allowed Email addresses: shajain@indiana.edu (Shantanu Jain), mlevins@purdue.edu (Michael Levine), predrag@indiana.edu (Predrag Radivojac), mtrosset@indiana.edu (Michael W. Trosset) Preprint submitted to Elsevier January 3, 2018 to click ‘like’ for a particular product and, thus, the data can be collected only for one of the component samples (a sample from the users who clicked ‘like’) and the mixture (a sample from all users). Accurate estimation of mixing proportions in this setting has fundamental implications for false discovery rate estimation (Storey, 2002, 2003; Storey and Tibshirani, 2003) and, in the context of classification, for estimating posterior distributions (Ward et al., 2009; Jain et al., 2016b,a) and recovering true classifier performance (Menon et al., 2015; Jain et al., 2017). Identifiability and estimation of mixing proportions have been extensively studied (Yakowitz and Sprag 1968; Dempster et al., 1977; Tallis and Chesson, 1982; McLachlan and Peel, 2000). More recently, the case with one known component has been considered in the nonparametric setting (Bordes et al., 2006; Ward et al., 2009; Blanchard et al., 2010; Jain et al., 2016b; Patra and Sen, 2016). Though the nonparametric formulation is highly flexible, it can also be problematic due to the curse-of-dimensionality issues or when the ‘irreducibility’ assumption is violated (Blanchard et al., 2010; Jain et al., 2016b; Patra and Sen, 2016). In addition, it is often reasonable in practice to require unimodality of density components, which is difficult to ensure in a nonparametric formulation. To guarantee unimodality of components and allow for skewness, we model the components with a skew normal (SN) family, a generalization of the Gaussian family with good theoretical properties and tractability of inference (Genton, 2004). Although the SN family has been introduced only recently, e.g., see Azzalini (1985, 1986), and Azzalini and Dalla Valle (1996), it has gained practical importance in econometrics and financial domains (Genton, 2004). Until recently, the literature on identifiability of parametric mixture models emphasized identifiability with respect to a subset of parameters, e.g., cases in which only a single location parameter, or location and scale parameters, can change. Furthermore, most previous results only address the case of univariate mixture distributions. Few studies have considered identifiability of mixtures of general multivariate densities with respect to all of their parameters (Holzmann et al., 2006; Browne and McNicholas, 2015). Our work concerns identifiability with respect to mixing proportions in mixtures of two skew normal distributions with one known component. We show in Section 3 that, in this 2 setting, identifiability with respect to mixing proportions is equivalent to identifiability with respect to all parameters. We consider both univariate and multivariate families of skewnormal distributions, establishing identifiability with respect to all of their parameters. We begin with a univariate skew normal family (SN) introduced by Azzalini (1985), then extend our results to two forms of multivariate skew normal families (MSN and CFUSN) introduced by Azzalini and Dalla Valle (1996) and Arellano-Valle and Genton (2005), respectively. These families are further discussed in Section 4. Our main contribution is Theorems 1–3, which state sufficient conditions for identifiability of the mixing proportion of the mixture with SN, MSN, and CFUSN components, respectively. We also derive a concise formula for the characteristic function of CFUSN in Appendix A. 2. Problem Statement Let P0 and P1 be families of probability density functions (pdfs) on RK . Let F (P0 , P1 ) be a family of pdfs having the form f = αf1 + (1 − α)f0 , (1) where f0 ∈ P0 , f1 ∈ P1 , and α ∈ (0, 1). Densities f1 and f0 will be referred to as component pdfs, f will be referred to as the mixture pdf, and α will be referred to as the mixing proportion. F (P0 , P1 ), therefore, is a family of two-component mixtures. In this setting, we study identifiability of the density mixture (1) with respect to the parameter α when P0 and P1 are, first, univariate skew-normal and then two different multivariate skew-normal families. All of these distribution families are defined in (Genton, 2004). To do so, we start first with studying some general identifiability conditions in Section 3. 3. Identifiabilty of two-component mixtures with a known component In this section we discuss identifiability of the mixtures in the context of our problem. We will show that the general notion of identifiability is equivalent to identifiability of the mixing proportion (Lemma 1). However, our main contribution in this section is Lemma 3 that 3 gives a useful technique to prove identifiability, tailored to this setting, and will be applied to skew normal mixtures later in the paper. Lemma 1 and Lemma 2 are restatements of results in Jain et al. (2016b), in terms of densities instead of measures. Consider a mixture distribution f from Equation 1 and let f1 be the known component distribution. This is equivalent to restricting P1 to a singleton set, i.e., P1 = {f1 }. With a minor abuse of notation, we denote the family of mixtures F (P0 , P1 ) as F (P0 , f1 ). Note that f in Equation 1 can be treated as a pdf parametrized by α and f0 . To reflect this parameterization, we rewrite f as a function of α and f0 , i.e., f : (0, 1) × P0 → F (P0 , f1 ) given by f (α, f0 ) = αf1 + (1 − α)f0 . A family of distributions G = {gθ : θ ∈ Θ} is said to be identifiable if the mapping from θ to gθ is one-to-one.1 Therefore, F (P0 , f1 ) is identifiable if ∀a, b ∈ (0, 1) and ∀h0 , g0 ∈ P0 , f (a, h0 ) = f (b, g0 ) ⇒ (a, h0 ) = (b, g0 ). (2) The lack of identifiability means that even if (a, h0 ) and (b, g0 ) are different, the target density f contains no information to tell them apart. If we are only interested in estimating α, we need F (P0 , f1 ) to be identifiable in α. That is, ∀a, b ∈ (0, 1) and ∀h0 , g0 ∈ P0 , f (a, h0 ) = f (b, g0 ) ⇒ a = b (3) Identifiability of F (P0 , f1 ) in α might seem to be a weaker requirement as compared to identifiability of F (P0 , f1 ) in (α, f0 ). However, Lemma 1 shows that the two notions of identifiability are equivalent. Lemma 1. F (P0 , f1 ) is identifiable if and only if F (P0 , f1 ) is identifiable in α Proof. By definition, identifiability of F (P0 , f1 ) in α is a necessary condition for F (P0 , f1 ) to be identifiable. Now, we prove that it is a sufficient condition as well. Let us assume that F (P0 , f1 ) is identifiable in α. Also, suppose that ∃a, b ∈ (0, 1) and ∃h0 , g0 ∈ P0 such that f (a, h0 ) = f (b, g0 ). Then, from the definition of identifiability in α, it follows that a = b. Therefore, we have af1 + (1 − a)h0 = bf1 + (1 − b)g0 , which implies that h0 = g0 . Thus, F (P0 , f1 ) is identifiable. 1 Technically, we require bijection but ignore the obvious “onto” requirement for simplicity. 4 Consider now the largest possible P0 , i.e., P0 that contains all pdfs in RK , except f1 (or any pdf equal to f1 almost everywhere). Then, F (P0 , f1 ) contains all non trivial two component mixtures on RK with f1 as one of the components. Lemma 4 (Section 5) shows that this family is not identifiable. Next, we establish the necessary and sufficient condition for identifiability of F (P0 , f1 ). Lemma 2. F (P0 , f1 ) is identifiable if and only if F (P0 , f1 ) ∩ P0 = ∅. Proof. First, we will prove that F (P0 , f1 ) ∩ P0 = ∅ ⇒ F (P0 , f1 ) is identif iable. (4) We give a proof by contradiction. Suppose F (P0 , f1 ) ∩ P0 = ∅ but that F (P0 , f1 ) is not identifiable. By Lemma 1 F (P0 , f1 ) is not identifiable in α. Thus, ∃a, b ∈ (0, 1) and ∃g0 , h0 ∈ P0 such that f (a, g0) = f (b, h0 ), but a 6= b. Now, without loss of generality we can assume a > b. Therefore, from the equality of f (a, g0) and f (b, h0 ) we obtain, using simple algebra, that h0 = (a−b)/(1−b)f1 + (1 − (a−b)/(1−b))g0 . This means, in turn, that h0 = f ((a−b)/(1−b), g0 ). Because (a−b)/(1−b) ∈ (0, 1) and g0 ∈ P0 , it follows that h0 ∈ F (P0 , f1 ). Since h0 has been selected from P0 we conclude that F (P0 , f1 ) ∩ P0 contains h0 and is not empty. This completes the proof of statement 4. Now, we will prove that F (P0 , f1 ) is identif iable ⇒ F (P0 , f1 ) ∩ P0 = ∅ (5) We give a proof by contradiction. Suppose that F (P0 , f1 ) is identifiable but F (P0 , f1 )∩P0 6= ∅. Let g0 be a common member of P0 and F (P0 , f1 ). As g0 ∈ F (P0 , f1 ), it follows that ∃h0 ∈ P0 and ∃c ∈ (0, 1) such that g0 = f (c, h0 ). Let a ∈ (c, 1) and b = (a−c)/(1−c). As a, b ∈ (0, 1) and h0 , g0 ∈ P0 , it follows that both f (a, h0 ) and f (b, g0 ) belong in F (P0 , f1 ). We will show that f (a, h0 ) = f (b, g0 ). Indeed, f (b, g0 ) = bf1 + (1 − b)g0 = bf1 + (1 − b)f (c, h0 ) = bf1 + (1 − b)(cf1 + (1 − c)h0 ). This immediately implies that f (b, g0 ) = f (a, h0 ), where a = b(1 − c) + c ∈ (b, 1) and is, therefore, greater than b. Thus, (a, h0 ) 6= (b, g0 ). It follows that F (P0 , f1 ) is not identifiable. The lemma follows from statements 4 and 5. The next lemma gives a sufficient condition for identifiability that is mathematically convenient. It relies on the notion of span of a set of functions P, denoted by Span(P), that contains all finite linear combinations of functions in P. That is, ( k ) X Span(P) = ai fi : k ∈ N, ai ∈ R, fi ∈ P . i=1 Lemma 3. Consider the family of pdfs F (P0 , f1 ). Assume that for any pair of pdfs f0 , g0 ∈ P0 there exists a linear transformation Ψ, possibly depending on the choice of (f0 , g0 ), that 5 maps any function f ∈ Span({f0 , g0 , f1 }) to a real- or complex-valued function on some domain S. We denote Ψf the value of transformation Ψ of the function f ∈ Span({f0 , g0 , f1 }); thus, Ψf is a function. We denote Ψf (t) the value of this function for any t ∈ S. Then, if there exists a sequence {tn } in Sf1 = {s ∈ S : Ψf1 (s) 6= 0} such that Ψg0 (tn ) Ψf0 (tn ) = 0 and lim ∈ / (−∞, 0), n→∞ Ψf1 (tn ) n→∞ Ψf1 (tn ) lim (6) F (P0 , f1 ) is identifiable. Proof. We give a proof by contradiction. Suppose conditions of the theorem are satisfied but F (P0 , f1 ) is not identifiable. From Lemma 2, it follows that F (P0 , f1 ) ∩ P0 6= ∅, i.e., there exists a common element in F (P0 , f1 ) and P0 , say f0 . Because f0 is in F (P0 , f1 ), there exists g0 ∈ P0 such that f0 = f (a, g0 ) for some a ∈ (0, 1). Since f0 and g0 are in P0 , there exists a linear transform Ψ and a sequence {tn } satisfying condition (6). It follows that f0 = f (a, g0) = af1 + (1 − a)g0 and so Ψf0 (t) = aΨf1 (t) + (1 − a)Ψg0 (t). Now, for all Ψ (t) Ψ (t) Ψ (t ) a t ∈ Sf1 we have Ψff0 (t) = a+(1−a) Ψfg0 (t) and consequently, limn→∞ Ψgf0 (tnn ) = − 1−a ∈ (−∞, 0) 1 1 (contradiction) because {tn } satisfies limn→∞ Ψf0 (tn ) Ψf1 (tn ) 1 = 0 from condition (6). We will invoke this lemma later in this paper with two linear transforms; namely, the moment generating function (MGF) transform and the characteristic function (CF) transform. We observe that S = RK for both transforms. The main ideas in this lemma (linear transforms and limits) come from Theorem 2 in Teicher (1963) on identifiability of finite mixtures. 4. Two-component skew normal mixtures When P0 contains all pdfs on RK , with or without f1 , the family F (P0 , f1 ) is not identifiable (Lemma 4, Section 5). It is therefore desirable to choose a smaller family that makes the mixture model identifiable and that is rich enough to model real life data. In this paper, we take a parametric approach. The normal family presents a limited option since normal mixtures typically require a large number of components to capture asymmetry in real life data. The skew normal family—an asymmetric family—provides a convenient alternative in both univatiate and multivariate settings. Thus, we restrict our attention to the two-component mixture families where both unknown and known components are skew normal. Our contribution in this Section are Theorem 1, Theorem 2, and Theorem 3, that give a rather large 6 identifiable family of two-component skew normal mixtures. A similar approach has been reported by Ghosal and Roy (2011) for mixtures of normal and skew normal distributions. Our result, however, results in a much more extensive family F (P0 , f1 ). Before giving these results, we first introduce the univariate skew normal family as well as its two most common multivariate generalizations. Univariate skew normal family: Azzalini (1985) introduced the skew normal (SN) family of distributions as a generalization of the normal family that allows for skewness. It has a location (µ), a scale (ω), and a shape (λ) parameter, where λ controls for skewness. The distribution is right skewed when λ > 0, left skewed when λ < 0, and reduces to a normal distribution when λ = 0. For X ∼ SN(µ, ω, λ), its pdf is given by     2 λ(x − µ) x−µ fX (x) = φ Φ , x ∈ R, ω ω ω where µ, λ ∈ R, ω ∈ R+ , φ and Φ are the probability density function (pdf) and the cumulative distribution function (cdf) of the standard normal distribution N (0, 1), respectively. Pewsey (2003); Genton (2004); Kim and Genton (2011) derived the CF and MGF of the SN family (Table 2). Multivariate skew normal families: Azzalini and Dalla Valle (1996) proposed an extension of the skew normal family to the multivariate case. This particular generalization has a very useful property in that its marginals are skew normal as well. More recently, several other families of multivariate skew normal distributions have been proposed, as discussed by Lee and McLachlan (2013). In this paper we consider an alternate parametrization of Azzalini’s multivariate skew normal family, denoted by MSN. For X ∼ MSN(µ, Ω, Λ), pdf of X is fX (x|µ, Ω, Λ) = 2φK (x − µ|Ω)Φ Λ′ Ω −1/2  (x − µ) , x ∈ RK , where Ω is a K × K covariance matrix, µ ∈ RK is the location parameter, Λ ∈ RK is the shape/skewness parameter, φK (·|Ω) is the pdf of a K-dimensional normal distribution with mean zero and covariance Ω, and Φ is the cdf of a standard univariate normal. Azzalini and Dalla Valle (1996); Kim and Genton (2011) derived the MGF and CF of this distribution (Table 2). 7 Table 1: Alternate parametrization: The identifiability results and the algorithms are better formulated in terms of the alternate parameters. The table gives the relationship between the alternate and the canonical parameters as well as some other related quantities. Here IK is a K × K identity matrix. Family SN(µ, ω, λ) MSN(µ, Ω, Λ) CFUSN(µ, Ω, Λ) Alternate Parametrization canonical → alternate alternate → canonical √ ω = Γ +p ∆2 ∆ = ωδ Γ = ω 2 (1 − δ 2 ) λ = sign(∆) ∆2/Γ 1 Ω = Γ + ∆∆′ ∆ = Ω2δ 1 −2 Γ = Ω − ∆∆′ Λ= Γ = Ω − ΛΛ′ Ω = Γ + ΛΛ′ ∆ √Ω 1−∆′ Ω∆ Related Quantities δ= δ= √ λ 1+λ2 √ Λ 1+Λ′ Λ ∆ = (IK + Λ′ Γ−1 Λ)−1 = IK − Λ′ Ω−1 Λ Lin (2009) studied maximum likelihood estimation of finite multivariate skew normal mixtures with another family, the so-called canonical fundamental skew normal distribution (CFUSN), introduced by Arellano-Valle and Genton (2005). For X ∼ CFUSN(µ, Ω, Λ), the pdf of X is  fX (x|µ, Ω, Λ) = 2K φK (x − µ|Ω)ΦK Λ′ Ω−1 (x − µ)|∆ , x ∈ RK where Ω is a is a K × K covariance matrix, ∆ is defined in Table 1, µ ∈ RK is the location parameter, Λ is a K × K shape/skewness matrix2 and ΦK (·|∆) is the cdf of a K-dimensional multivariate normal distribution with zero mean and covariance ∆. The CF and MGF are given in Table 2. The MGF was obtained from Lin (2009). To the best of our knowledge, the expression for the CF was not available in the literature; we derived it in Theorem 4 (Appendix) for the purposes of this study. 4.1. Identifiability When P0 is some proper/improper subset of the family of univariate skew normal pdfs and f1 is also a univariate skew normal pdf —concisely written as P0 ⊆ {SN(µ, ω, λ) : µ, λ ∈ R, ω ∈ R+ } and f1 = SN(µ1 , ω1 , λ1 ) —F (P0, f1 ) contains only two-component univariate skew normal mixtures. Theorem 1 gives a sufficient condition for such a family to be identifiable. 2 Arellano-Valle and Genton (2005) define a more general form of the CFUSN family that allows nonsquare Λ matrices. 8 Table 2: Skew normal families: Expression for the characteristic function and moment generating function. The non-canonical parameters are defined in Table 1. Here ι denotes the imaginary number and Rxp 2 ℑ(x) = 0 2/π exp u /2 du. Φ and ΦK denote the cdfs of the standard univariate and multivariate normal distributions, respectively. The Λi in the expression for CFUSN CF is the ith column of Λ. Family SN(µ, ω, λ) MSN(µ, Ω, Λ) CFUSN(µ, Ω, Λ) MGF(t) 2 exp(tµ + t2 ω2/2)Φ(∆t) ′ 2 exp(t µ + t′ Ωt/2)Φ(∆′ t)  2K exp t′ µ + 12 t′ Ωt ΦK (Λ′ t) CF(t) /2)(1 + ιℑ(∆t)) exp(ιtµ − ′ t′ Ωt/2)(1 + ιℑ(∆′ t)) exp(ιt µ −  QK ′ exp ιt′ µ − 21 t′ Ωt i=1 (1 + ιℑ(Λi t)) t2 ω 2 Notation 4.1 (Notation for Theorem 3, Lemma 6, Lemma 9). Let P(U) denote a partition defined on a multiset of column vectors U such that column vectors that are in the same direction are in the same set. This relationship is formally defined by the following equivalence relationship t ≡ l ⇔ ct = l for some c 6= 0 in R Let PC denote the canonical vector direction of the vectors in P ∈ P(U), defined as PC = t/||t|| when a t ∈ P is not 0 and PC = 0 when a t ∈ P is 0. Let t⊥ be the space orthogonal to a vector t. Let Null(M) be the null space of matrix M. Let ∁A be the complement of a set A. Theorem 1. The family of pdfs F (P0 , f1 ) with f1 = SN(µ1 , ω1 , λ1 ) and P0 = {SN(µ, ω, λ) : Γ 6= Γ1 }, (7) (Γ is defined in Table 1) is identifiable. Proof. Consider a partition of P0 by sets P01 , P02 , defined as follows P01 = {SN(µ, ω, λ) : Γ > Γ1 } P02 = {SN(µ, ω, λ) : Γ < Γ1 } We now show that for a given pair of pdfs f0 , f¨0 from P0 , the conditions of Lemma 3 ¨ 0 ) be the parameters corresponding to f0 (f¨0 ), as defined in are satisfied. Let Γ0 , ∆0 (Γ̈0 , ∆ Table 1. • If f0 is from P01 (Γ0 > Γ1 ), we use Lemma 7 (Statements 1a and 1b) to prove our statement. First, select some t 6= 0 in R. Applying Lemma 7 (Statements 1a , we (ct;f0 ) CF (ct;f¨0 ) obtain limc→∞ CF = 0 and limc→∞ CF ∈ / (−∞, 0). Therefore, the sequence CF (ct;f1 ) (ct;f1 ) T = {tn }, tn = nt satisfies the conditions of Lemma 3. • If f0 is from P02 (Γ1 > Γ0 ), we use choose Lemma 7 (Statement 2) as the basis of our proof. First, we select some t 6= 0 in R with ∆0 t ≤ 0. Applying Lemma 7 (Statement M GF (ct;f0 ) = 0. Moreover, owing to the fact that an mgf is always 2), we obtain limc→∞ M GF (ct;f1 ) ¨ M GF (ct;f0 ) ∈ / (−∞, 0). The sequence T = {tn }, tn = nt positive, we know that limc→∞ M GF (ct;f1 ) satisfies the conditions of Lemma 3. 9 Thus all the conditions of Lemma 3 are satisfied and consequently F (P0 , f1 ) is identifiable Theorem 2. The family of pdfs F (P0 , f1 ) with f1 = MSN(µ1 , Ω1 , Λ1 ) and P0 = {MSN(µ, Ω, Λ) : Γ 6= Γ1 } (Γ is defined in Table 1) is identifiable. Proof. Consider a partition of P0 by sets P01 , P02 , defined as follows P01 = {MSN(µ, Ω, Λ) : Γ  Γ1 }, P02 = P0 \ P01 , where ≻ is the standard partial order relationship on the space of matrices. More specifically, A ≻ B implies that A − B is positive definite. Note that P02 also contains pdfs whose Γ matrix is unrelated to Γ1 by the partial ordering. We now show that for a given pair of pdfs f0 , f¨0 from P0 , the conditions of Lemma 3 are ¨ 0 ) be the parameters corresponding to f0 (f¨0 ), as defined in Table satisfied. Let Γ0 , ∆0 (Γ̈0 , ∆ 1. • If f0 is from P01 , we choose the characteristic function transform as the linear transform. We pick some t ∈ RK with t′ (Γ̈0 − Γ1 )t 6= 0 and t′ (Γ0 − Γ1 )t > 0; existence of such a t is guaranteed by Lemma 5. Applying Lemma 8 (Statements 1a and 1b), we CF (ct;f¨0 ) CF (ct;f0 ) = 0 and limc→∞ CF ∈ / (−∞, 0). Notice that the sequence obtain limc→∞ CF (ct;f1 ) (ct;f1 ) T = {tn }, tn = nt satisfies the conditions of Lemma 3. • If f0 is from P02 , we choose the moment generating function transform as the linear transform Ψ. We pick some l 6= 0 in Rk such that l′ (Γ1 − Γ0 )l > 0; existence of such an l is guaranteed by Γ0  Γ1 . If the scalar value ∆′0 l ≤ 0, we choose t = l; otherwise, we choose t = −l. It is easy to see that t′ (Γ1 − Γ0 )t > 0 and ∆′0 t ≤ 0. Applying GF (ct;f0 ) Lemma 8 (Statement 2), we obtain limc→∞ M = 0. Moreover, owing to the M GF (ct;f1 ) ¨ GF (ct;f0 ) ∈ / (−∞, 0). The fact that an mgf is always positive, we know that limc→∞ M M GF (ct;f1 ) sequence T = {tn }, tn = nt satisfies the conditions of Lemma 3. Thus all the conditions of Lemma 3 are satisfied and consequently F (P0 , f1 ) is identifiable Theorem 3. Let θ give a concise representation of the CFUSN parameters. The family of pdfs F (P0 , f1 ) with f1 = CFUSN(θ1 ) is identifiable when  P0 = CFUSN(θ) : Γ 6= Γ1 , Γ1 − Γ 6= kvv ′ , for any v ∈ Λ and any k ∈ R+ , where Γ is defined in Table 1. Here Λ, in addition to representing the skewness matrix, also represents the multiset containing its column vectors. 10 exp(ιc(µ0 −µ1 )′ t) exp(−1/2c2 t′ (Γ0 −Γ1 )t) , where 0✁ (t) = {i : t[i] 6= 0}, ) the set indexes containing non-zero entries of t. Note that V (c; θ0 , θ1 , t) = V (c; θ0 , θ, t)V (c; θ, θ1 , t), for an arbitrary θ—a property used multiple times in the proof. We also compute the limit of V (c; θ0 , θ1 , t) as c → ∞; note that the limit is primarily determined by the sign of the quadratic form t′ (Γ0 − Γ1 )t and is either 0 or ∞. However, if t′ (Γ0 − Γ1 )t = 0, then the limit is determined by the sign of |0✁(Λ′0 t)| −|0✁ (Λ′1 t)| and is still 0 or ∞; if |0✁(Λ′0 t)| −|0✁ (Λ′1 t)| = 0 as well, then V (c; θ0 , θ1 , t) oscillates between −1 and 1 (undefined limit), unless (µ0 − µ1 )′ t = 0, in which case the limit is 1. We use Notation (4.1) throughout the proof. We give a proof by contradiction supposing that the family is not identifiable. Then Lemma 2 implies that, there exists f0 and f¨0 in P0 , such that, with the characteristic function as the linear transform, Proof. First, we define V (c; θ0 , θ1 , t) = c( ✄ ✄ |0(Λ′0 t)|−|0(Λ′1 t)| ¨ 0 (ct) = aCF1 (ct) + (1 − a)CF0 (ct), CF ∀t ∈ RK , ∀c ∈ R and 0 < a < 1. (8) We will show that Equation 8 leads to a contradiction for all possible values of f0 and f¨0 from P0 . Consider a partition of P0 by sets P01 , P02 , defined as follows P01 = {CFUSN(µ, Ω, λ) : Γ1 6 Γ}, P02 = P0 \ P01 , where  is the standard partial order relationship on the space of matrices. Precisely, A  B implies that A − B is positive semi-definite. Now consider the following cases which cover all the contingencies • If f0 is from P01 (Γ1  Γ0 ) we proceed as follows. Equation 8 implies that for CF0 (ct) 6= 0 ¨ 0 (ct) CF CF1 (ct) =a + (1 − a) CF0 (ct) CF0 (ct) ⇒ ¨ 0 (ct) CF CF0 (ct) V (c; θ1 , θ0 , t) =a CF1 (ct) CF0 (ct) V (c; θ1 , θ0 , t) ¨ 0 (ct) CF CF0 (ct) + 1−a V (c; θ1 , θ0 , t) CF1 (ct) 1−a 1 CF0 (ct) + ⇒ =a V (c; θ1 , θ0 , t) V (c; θ1 , θ0 , t) V (c; θ1 , θ̈0 , t) V (c; θ̈0 , θ0 , t) {z } | {z } | {z } | B A C If limc→∞ V (c; θ1 , θ0 , t) = ∞, term (C) goes to 0 as c → ∞. Since, applying Lemma 9 (Statement 1a), the limit of term (B) as c → ∞ exists in C \ {0}, so does the limit of the entire RHS and consequently the LHS. It follows that, since limit of term (A) as c → ∞ exists in C \ {0}, limc→∞ V (c;θ1 ,θ̈ ,t) should also exist in C \ {0} (so that the 1 0 limit of entire LHS can exist in C \ {0}). Summarizing, lim V (c; θ1 , θ0 , t) = ∞ ⇒ lim c→∞ c→∞ 11 1 ∈ C \ {0} V (c; θ1 , θ̈0 , t) (9) Now we pick some t ∈ RK with t′ (Γ0 − Γ1 )t > 0 and t′ (Γ̈0 − Γ1 )t 6= 0; existence of such a t is guaranteed by Γ̈0 6= Γ1 and Γ1  Γ0 as shown in Lemma 5. Because t′ (Γ0 − Γ1 )t > 0, limc→∞ V (c; θ1 , θ0 , t) = ∞ but limc→∞ V (c;θ1 ,θ̈ ,t) is either 0 or ∞ as 1 0 t′ (Γ̈0 − Γ1 )t 6= 0, which contradicts Equation 9. • If f0 is from P02 , we proceed as follows. – If (Γ0 = Γ̈0 ), we use Equation 8 to get ¨ 0 (ct) CF CF1 (ct) =a + (1 − a) CF0 (ct) CF0 (ct) ⇒ ¨ 0 (ct) CF CF0 (ct) V (c; θ̈0 , θ0 , t) =a CF1 (ct) CF0 (ct) V (c; θ̈0 , θ0 , t) + 1−a V (c; θ̈0 , θ0 , t) ¨ 0 (ct) CF CF0 (ct) CF1 (ct) 1−a 1 CF0 (ct) = a ⇒ + V (c; θ1 , θ0 , t) V (c; θ̈0 , θ0 , t) V (c; θ̈0 , θ0 , t) V (c; θ̈0 , θ1 , t) | {z } | {z } B A | {z } (10) C If limc→∞ V (c; θ̈0 , θ1 , t) = ∞, term (C) goes to 0 as c → ∞, since the limit of term (B) exists in C \ {0} by Lemma 9 (Statement 1a). Since, applying Lemma 9 (Statement 1a), the limit of RHS as c → ∞ exists in C \ {0}, so does the limit of the entire LHS and consequently term (A); i.e., limc→∞ V (c;θ̈1,θ ,t) ∈ C \ {0}. 0 0 Summarizing, 1 ∈ C \ {0} c→∞ V (c; θ̈ , θ , t) 0 0 lim V (c; θ̈0 , θ1 , t) = ∞ ⇒ lim c→∞ (11) and 1−a c→∞ V (c; θ̈ , θ , t) c→∞ V (c; θ̈ , θ , t) 0 0 0 0 1−a ⇒ Ξ(Λ̈0 , Λ0, t) = lim (12) c→∞ V (c; θ̈ , θ , t) 0 0 (from Lemma 9 (Statement 1a)) lim V (c; θ̈0 , θ1 , t) = ∞ ⇒ lim c→∞ ¨ 0 (ct) CF CF0 (ct) = lim Now, t ∈ ∁Null(Γ1 − Γ0 ) ⇒ t′ (Γ1 − Γ0 )t > 0 ⇒ lim V (c; θ̈0 , θ1 , t) = ∞ c→∞ 1 ∈ C \ {0} c→∞ V (c; θ̈ , θ , t) 0 0 ⇒ lim (from Equation 11) ⇒ |0✁ (Λ′0 t)| − |0✁(Λ̈′0 t)| = 0 and (µ̈0 − µ0 )′ t = 0, 12 where the last step follows because V (c; θ̈0 , θ0 , t) = Consequently, exp(ιc(µ̈0 −µ0 )′ t) c( ✄ ✄ |0(Λ̈′0 t)|−|0(Λ′0 t)| ) when Γ0 = Γ̈0 . t ∈ ∁Null(Γ1 − Γ0 ) ⇒ V (c; θ̈0 , θ0 , t) = 1 ⇒ Ξ(Λ̈0 , Λ0 , t) = 1 − α (from Equation 12) (13) Summarizing, ∀t ∈ ∁Null(Γ1 − Γ0 ), ∗ |0✁(Λ′0 t)| − |0✁(Λ̈′0 t)| = 0 ∗ Ξ(Λ̈0 , Λ0, t) = 1 − a. Since 1 − α 6= 1, from Lemma 6 (Statement 3a), it follows that ∗ Γ1 − Γ0 = kvv ′ , for some v ∈ Λ0 and some k ∈ R+ Thus f0 ∈ / P0 and hence the contradiction. – If Γ0 6= Γ̈0 , Equation 8 implies that, for CF1 (ct) 6= 0 ¨ 0 (ct) CF CF0 (ct) = a + (1 − a) CF1 (ct) CF1 (ct) ¨ 0 (ct) CF CF1 (ct) CF0 (ct) a CF1 (ct) ⇒ = + (1 − a) V (c; θ0 , θ1 , t) V (c; θ0 , θ1 , t) V (c; θ0 , θ1 , t) ¨ 0 (ct) CF CF0 (ct) A B 1 a CF1 (ct) CF1 (ct) ⇒ = (1 − a) + V (c; θ0 , θ1 , t) V (c; θ0 , θ1 , t) V (c; θ0 , θ̈0 , t) V (c; θ̈0 , θ1 , t) | {z } | {z } {z } | C Notice that if limc→∞ V (c; θ0 , θ1 , t) = ∞, then term (C) goes to 0. Since, applying Lemma 9 (Statement 1a), the limit of term (B) as c → ∞ exists in C \ {0}, so is the limit of the entire RHS and consequently the LHS. It follows that, since limit of term (A) as c → ∞ exists in C \ {0} , limc→∞ V (c;θ1 ,θ̈ ,t) should also exist in 0 0 C \ {0} (so that the limit of entire LHS exists in C \ {0}). Summarizing, 1 ∈ C \ {0} c→∞ V (c; θ , θ̈ , t) 0 0 lim V (c; θ0 , θ1 , t) = ∞ ⇒ lim c→∞ (14) Now, then we pick some t ∈ RK with t′ (Γ1 − Γ0 )t > 0 and t′ (Γ0 − Γ̈0 )t 6= 0; existence of such an t is guaranteed by Lemma 5. t′ (Γ1 − Γ0 )t > 0 ensures that limc→∞ V (c; θ0 , θ1 , t) = ∞, but limc→∞ V (c; θ0 , θ̈0 , t) is either 0 or ∞ as t′ (Γ0 − Γ̈0 )t 6= 0, which contradicts Equation 14. 13 Comment 4.1 (Extension of Theorem 3). We speculate that Theorem 3 can be further strengthened by removing the condition Γ1 − Γ 6= kvv ′ (for any v ∈ Λ and any k ∈ R+ ) from the definition of P0 . Removal of this condition breaks the current proof only in the case when Γ1  Γ0 and Γ0 = Γ̈0 . Notice that this case implies that for any t ∈ RK  such that t ∈ ∁Null(Γ1 − Γ0 ) satisfies V (c; θ̈0 , θ1 , t) = Ω ck exp(1/2c2 t′ (Γ1 − Γ0 )t) , for some integer k (from the definition of V ); V (c; θ̈0 , θ0 , t) = 1 and Ξ(Λ̈0 , Λ0 , t) = 1 − α (as shown in Equation 13). These implications reduce Equation 10 to   ¨ a CF1 (ct) CF0 (ct) V (c; θ1 , θ0 , t) CF 0 (ct) CF0 (ct) − Ξ(Λ̈0 , Λ0 , t) V (c; θ̈0 , θ0 , t)  = Ω ck exp 1/2c2 t′ (Γ1 − Γ0 )t Ξ(Λ̈0 , Λ0 , t)       Q c ′ 1 + R c, ( Λ̈ ) t − ιO ′ N 0 i exp(1/2c2 ((Λ̈0 )′i t)2 )  i∈✁0(Λ̈0 t)    − 1 · Q , c ′ i∈✁ 0(Λ′0 t) 1 + RN (c, (Λ0 )i t) − ιO exp(1/2c2 ((Λ0 )′ t)2 ) i {z } | = V (c; θ̈0 , θ1 , t) A (using Lemma 9 (Statement 1b))  P (2n−1)!! −2(N +1) where, for a positive integer N, RN (c, x) = N + O(exp(−c2 x2/4)) n=1 c2n x2n + O c as c → ∞. Looking at the definition of RN , it seems that the term (A) should be Ω ck1 for some negative integer k1 , except  in a few special cases. This would imply that the RHS is k+k1 2 ′ 1 Ω c exp( /2c t (Γ1 − Γ0 )t) which still goes to ∞ as c → ∞, yet the LHS is in C \ {0}, which leads to a contradiction. 5. Auxiliary Results Lemma 4. If P0 contains all pdfs on RK except f1 , then F = F (P0 , f1 ) is not identifiable. Proof. Because P0 contains all pdfs on RK except f1 , we have F ⊆ P0 (note that f1 ∈ / F (a−b) either, since α cannot be 1). Let a ∈ (0, 1) and b ∈ (0, a), h0 ∈ P0 and g0 = f ( /(1−b), h0 ). As g0 is a mixture in F and F ⊆ P0 , it follows that g0 is also in P0 . Consequently, the mixture f (b, g0 ) is in F . Therefore, f (b, g0 ) = bf1 + (1 − b)g0 = bf1 + (1 − b)f ((a−b)/(1−b), h0 ); the last expression is equivalent to f (a, h0 ). Thus, we have f (a, h0 ) = f (b, g0 ). However, b 6= a and hence F is not identifiable. Lemma 5. For K × K symmetric matrices A 6= 0 and B 6= 0, if either A  0 or A  0, then there exists a vector t ∈ RK such that t′ Bt 6= 0 and t′ At > 0. Proof. Suppose there does not exist any vector l ∈ RK such that l′ Al > 0. Thus for all l ∈ RK , l′ Al ≤ 0. This immediately contradicts A  0. Hence A  0 implies that their exists l ∈ RK such that l′ Al > 0. On the other hand, A  0 implies l′ Al ≥ 0 for all l ∈ RK . This, in combination with l′ Al ≤ 0 for all l ∈ RK implies that that l′ Al = 0 for all l ∈ RK . 14 This, however, is impossible since A 6= 0. Summarizing, there exists l ∈ RK such that l′ Al > 0 when A 6= 0 and either of A  0 or A  0 is true. Now we give a recipe to find t ∈ RK with t′ Bt 6= 0 and t′ At > 0. Let l be some vector in RK with l′ Al > 0 (existence of l already proved) • If l′ Bl 6= 0, then choose t = l • else (l′ Bl = 0) let l1 ∈ RK be such that l1′ Bl1 6= 0. Existence of such l1 is guaranteed because B 6= 0. We choose t = l + ǫl1 , where ǫ > 0 is picked so that t′ Bt 6= 0 and t′ At > 0. To see that such an ǫ exists, notice first that t′ Bt = (l + ǫl1 )′ B(l + −2l1′ Bl ǫl1 ) = lBl′ + 2ǫl1′ Bl + ǫ2 l1′ Bl1 = 2ǫl1′ Bl + ǫ2 l1′ Bl1 6= 0 for any ǫ 6= l′ Bl . Second, 1 1 t′ At = (l + ǫl1 )′ A(l + ǫl1 ) = lAl′ + 2ǫl1′ Al + ǫ2 l1′ Al1 > 0 for a small enough ǫ > 0. Thus −2l′ Bl picking a small enough ǫ 6= l′ Bl1 1 ensures t′ Bt 6= 0 and t′ At > 0. 1 Lemma 6. Let U, V be K × K matrices and S 6= 0 be a K × K symmetric positive semidefinite matrix. Let U, V and S also denote the multiset containing the column vectors of U, V and S, respectively and using Notation (4.1), let P = P(U ∩ V ). Let Ξ(U, V, t) =  q (|✁0(U ′ t)|−|✁0(V ′ t)|) Q V ′t ✄ ′ t) i′ , where 0 Qi∈0(V ι π2 ✁ (t) = {i : t[i] 6= 0}, ι is the imaginary number and U t ✄ i∈0(U ′ t) i t ∈ RK . Assume |0✁ (U ′ t)| = |0✁(V ′ t)|, ∀t ∈ ∁Null(S). Then the following statements are true 1. |U ∩ P | − |V ∩ P | = 0, ∀P ∈ P; i.e., P has even number of elements with equal contribution from U and V . Y Q ||u|| Qu∈U ∩P , ∀l ∈ RK . 2. Ξ(U, V, l) = ||v|| ′ l6=0 P ∈P,PC v∈V ∩P 3. If Ξ(U, V, t) = r, ∀t ∈ ∁Null(S) and some constant r ∈ R then (a) r 6= 1 ⇒ S = kvv ′ for some v ∈ V and some constant k > 0. (b) Ξ(U, V, l) = 1, ∀l ∈ Null(S). Proof. First, we partition the elements of P into three sets P0 = {P ∈ P : PC ≡ 0}, P1 = {P ∈ P : PC 6≡ s for some s 6= 0 in S}, P2 = P \ (P0 ∪ P1 ). Notice that P0 is either singleton or empty because all the 0 vectors in U ∪ V are collected in a single component set in P. If P2 6= ∅, then a vector w in P̃ ∈ P2 is equivalent to all non-zero column vectors in S, which implicitly means that all non-zero column vectors in S are in the same direction (equivalent) and consequently S is rank-1 matrix having column vectors (and row vectors as S is symmetric) equivalent to w. In other words, S 15 can be expressed as S = k1 ww ′ for some constant k1 > 0 (k1 > 0 ensures S is positive semi-definite). Summarizing, P2 6= ∅ ⇒ S = k1 ww ′, for a w ∈ P̃ from P2 and k1 > 0 (15) Moreover, any other vector that can appear inside P2 is equivalent to w and consequently P2 is also singleton set (if not empty). These properties are implicitly used in the rest of the proof. Next, we show the following result, which will be used multiple times in the proof. (A): For a given vector e and a finite multiset of non-zero vectors M in RK , e 6≡ m, ∀m ∈ M ⇒ ∃t ∈ RK such that e′ t = 0 and m′ t 6= 0, ∀m ∈ M. To prove (A), notice that choosing t from e⊥ guarantees e′ t = 0. Choosing t from ∁m⊥ ensures m′ t 6= 0. It follows that if the set, D, obtained by removing m⊥ , for all m ∈ M, from e⊥ is non-empty, then any t ∈ D satisfies both m′ t 6= 0 and e′ t = 0. To see that D is indeed non-empty notice that removing m⊥ ’s (finite number of K − 1 dimensional linear spaces) from e⊥ (either K dimensional when e = 0 or K − 1 dimensional when e 6= 0) reduces it only by Lebesgue measure 0 set, provided e⊥ does not coincide with any of the m⊥ ’s, guaranteed by e 6≡ m for all m ∈ M. Using result (A), we show the existence of two vectors: • t0 : Let t0 be a vector whose existence is shown by using result (A) with e = 0 and S M = {PC : P ∈ P \ P0 } {s} for some s 6= 0 in S. It follows that PC′ t0 6= 0, ∀P ∈ P\P0 and t0 ∈ ∁Null(S). • tP̄ : For a given P̄ ∈ P1 , let s 6= 0 in S be such that s 6≡ P̄C (such an s exists by existence (A) definition of P1 ). Let tP̄ be a vector whose   S is shown by using result ′ with e = P̄C and M = PC : P ∈ P \ P̄ ∪ P0 {s}. It follows that P̄C tP̄ = 0, PC′ tP̄ 6= 0, ∀P ∈ P \ P̄ ∪ P0 and tP̄ ∈ ∁Null(S). To prove the Statement (1), we break the argument into three exhaustive cases (picking P from P0 or P1 or P2 ) as follows 1. P̌ ∈ P0 : Since t0 ∈ ∁Null(S), |0✁ (U ′ t0 )| = |0✁(V ′ t0 )|. The only source of 0’s in U ′ t0 and V ′ t0 are column vectors in P̌ and consequently, U ∩ P̌ − V ∩ P̌ = 0 follows. 2. P̄ ∈ P1 : Since tP̄ ∈ ∁Null(S), |0✁(U ′ tP̄ )| = |0✁(V ′ tP̄ )|. There are two possibilities for the source of 0’s in U ′ tP̄ and V ′ tP̄ : (a) column vectors in P̄ only (when P0 = ∅). Thus to satisfy |0✁(U ′ tP̄ )| = |0✁ (V ′ tP̄ )|, U ∩ P̄ − V ∩ P̄ = 0 must be true. (b) column vectors in P̄ and the only element in P0 , P̌ (when P0 is singleton). We already know from case (1) that U ∩ P̌ − V ∩ P̌ = 0 is true and consequently, to satisfy |0✁(U ′ tP̄ )| = |0✁(V ′ tP̄ )|, U ∩ P̄ − V ∩ P̄ = 0 must be true as well. 16 3. P̃ ∈ P2 : Since P̃ is the only element in P2 , all either P0 or P1 and are covered by cases (1) and a consequence, P̃ , being the only remaining set, because both U and V have the equal number of n o other sets P ∈ P \ P̃ belong to (2); i.e., |U ∩ P | − |V ∩ P | = 0. As U ∩ P̃ − V ∩ P̃ = 0 must be true column vectors. This proves Statement (1). To prove Statement (2), we rewrite the formula for Ξ(U, V, l), ∀l ∈ RK as follows pπ ′ Q 1 Y vl v∈V ∩P ι p π2 ′ Ξ(U, V, l) = Q 1 ul ′ l6=0 u∈U ∩P ι 2 P ∈P\P0 ,PC p Q 1 π Y ||v|| PC′ l v∈V ∩P ι 2 p Q = 1 π ||u|| PC′ l ′ l6=0 u∈U ∩P ι 2 P ∈P\P0 ,PC !|U ∩P |−|V ∩P | Q r Y ||v|| 2 ′ Q v∈V ∩P ι = PC l π u∈U ∩P ||u|| ′ l6=0 P ∈P\P0 ,PC Q Y ||v|| Q v∈V ∩P = , (because of Statement 1) u∈U ∩P ||u|| ′ P ∈P\P0 ,PC l6=0 which proves Statement (2). Let t0 and tP̄ (for a given P̄ ∈ P1 ) be as defined earlier. Since tP̄ and t0 are in ∁Null(S), r Ξ(U, V, t0 ) = ⇒ Ξ(U, V, tP̄ ) r Q ||v|| Q v∈V ∩P P ∈P\P0 u∈U ∩P ||u|| Q Q ||v|| Q v∈V ∩P P ∈P\({P̄ }∪P0 ) u∈U ∩P ||u|| Q = 1. Q ||v|| ⇒ Qv∈V ∩P̄ = 1. u∈U ∩P̄ ||u|| Now, P2 = ∅ ⇒ Ξ(U, V, l) = Y ′ l6=0 P̄ ∈P1 ,P̄C (16) Q ||v|| Qv∈V ∩P̄ , ∀l ∈ RK ||u|| u∈U ∩P̄ ⇒ Ξ(U, V, l) = 1, ∀l ∈ RK ⇒ Ξ(U, V, t) = 1, ∀t ∈ ∁Null(S). (from Equation 16) Thus, r 6= 1 ⇒ P2 6= ∅ ⇒ S = k1 ww ′, for a w ∈ P̃ from P2 and some k1 > 0 ⇒ S = kvv ′ , for some v ∈ V ∩ P̃ and some k > 0; 17 (from Equation 15) existence of v is justified by Statement (1) and the fact that P̃ is non-empty (contains w). This proves Statement (3a). To prove Statement (3b), notice that if P2 6= ∅, then ∀l ∈ Null(S) and for the only set P̃ ∈ P2 , P̃C′ l = 0 (from the definition of P2 ). It follows that ∀l ∈ Null(S) Q Y ||v|| Qv∈V ∩P̄ , ∀l ∈ RK Ξ(U, V, l) = u∈U ∩P̄ ||u|| ′ P̄ ∈P1 ,P̄C l6=0 (because either P2 = ∅ or P̃C′ l = 0 for the only P̃ ∈ P2 ) = 1. Notation 5.1 (Landau’s notation). We use Landau’s asymptotic notation in the next few lemmas, defined as follows. For real-valued functions g and h defined on some subset of g(c) < ∞ and g(c) = Ω(h(c)) as c → ∞ if R, g(c) = O(h(c)) as c → ∞ if lim supc→∞ h(c) lim supc→∞ g(c) h(c) > 0. Lemma 7. Consider two univariate skew normal distributions, SN(µ, ω, λ) and SN(µ, ω, λ). Let Γ, ∆ be related to ω and λ as given in Table 1. Let c ∈ R and t ∈ R \ {0}. 1. Let CF and CF be the characteristic functions corresponding to the two distributions (refer Table 2). (a) CF (ct) =0 c→∞ CF (ct) Γ − Γ > 0 ⇒ lim (b) CF (ct) ∈ {−∞, 0, ∞}, c→∞ CF (ct) Γ − Γ 6= 0 ⇒ lim provided the limit exists in R (the extended real number line). 2. Let MGF and MGF be the moment generating functions corresponding to the two distributions (refer Table 2). For ∆t ≤ 0, MGF (ct) = 0. c→∞ MGF (ct) Γ − Γ > 0 ⇒ lim Proof. Here, we use Landau’s O(·) and Ω(·) notation, defined in Notation (5.1). CF (ct) Statement 1a: Instead of working directly with CF , which can be complex, we circum(ct) vent the complication by working with the ratio’s absolute value squared, which is always 18 real. Multiplying the ratio with its conjugate, we obtain an expression of its absolute value squared as follows: CF (ct) CF (ct) 2   CF (ct) CF (ct) = CF (ct) CF (ct) = = CF (ct)(CF (ct)) (property of complex conjugate of a fraction) CF (ct)(CF (ct)) exp(−c2 ω02 t2 ) 1 + (ℑ(c∆t))2  exp(−c2 t2 ω12 t) 1 + (ℑ(c∆t))2 2  from the previous expression. Using the asymptotic upperConsider the ratio 1+(ℑ(c∆t)) 1+(ℑ(c∆t))2 bound (for the numerator) and lower bound (for the denominator), obtained in Lemma 10 (Statement 2c and 2d), we get Thus, 1 + (ℑ(c∆t))2 2 2  2 2 2 2 = O c exp c (∆t) − c (∆t) 1 + (ℑ(c∆t))  = O c2 exp c2 t2 ∆2 − ∆2 CF (ct) CF (ct) Consequently, 2   = exp −c2 t2 (ω 2 − ω 2 ) O c2 exp c2 t2 ∆2 − ∆2   = O c2 exp −c2 t2 ω 2 − ∆2 − ω 2 − ∆2  = O c2 exp −c2 t2 (Γ − Γ) lim c→∞ CF (ct) CF (ct) (17) 2 = 0, when Γ − Γ > 0 and CF (ct) = 0, when Γ − Γ > 0 c→∞ CF (ct) lim follows. Statement 1b Similar to the derivation of the asymptotic upper-bound for the ratio in Equation 17, we derive the asymptotic lower-bound by using Lemma 10 (Statement 2c and2d); CF (ct) CF (ct) 2 = Ω 1/c2 exp c2 t2 (Γ − Γ) 19  Consequently, CF (ct) lim c→∞ CF (ct) 2 = ∞, when Γ − Γ > 0 and CF (ct) ∈ {−∞, ∞}, when Γ − Γ > 0 c→∞ CF (ct) lim follows, provided the limit exists in R. Combining the result with Statement 1a proves Statement 1b. Statement 2 From the definition of SN MGF (Table 2) we get   Φ(c∆t) c2 2 2 MGF (ct) 2 = exp c(µ − µ)t − t (ω − ω ) MGF (ct) 2 Φ(c∆t) from the previous expression. We apply the asymptotic upperConsider the ratio Φ(c∆t) Φ(c∆t) bound (for the numerator) and lower bound (for the denominator), obtained in Lemma 10 (Statement 1b and 1a). Because ∆t ≤ 0, the asymptotic upper-bound is applicable.   2   c Φ(c∆t) 2 2 = O c exp − (∆t) − (∆t) Φ(c∆t) 2    2  c 2 2 2 = O c exp − t ∆ − ∆ 2 Thus,      2  c 2 2 MGF (ct) c2 2 2 2 2 = exp c(µ − µ)t − t (ω − ω ) O c exp − t ∆ − ∆ MGF (ct) 2 2    2   c 2 2 2 2 2 = O c exp c(µ − µ)t − t ω − ∆ − ω − ∆ 2    c2 2 = O c exp c(µ − µ)t − t (Γ − Γ) 2 Because c2 term dominates the c term in the exponential above, the asymptotic upper-bound goes to 0 when Γ − Γ > 0, irrespective of the relation between µ and µ. Consequently, lim c→∞ MGF (ct) = 0, when Γ − Γ > 0. MGF (ct) Lemma 8. Consider two K−dimensional Skew Normal distributions, MSN(µ, Ω, Λ0 ) and MSN(µ, Ω, Λ1 ). Let Γ, ∆ be related to Ω and Λ as given in Table 1. Let c ∈ R and t ∈ RK . 20 1. Let CF and CF be the characteristic functions corresponding to the two distributions (refer Table 2). (a) CF (ct) =0 c→∞ CF (ct) t′ (Γ − Γ)t > 0 ⇒ lim (b) CF (ct) ∈ {−∞, 0, ∞}, c→∞ CF (ct) t′ (Γ − Γ)t 6= 0 ⇒ lim provided the limit exists in R (the extended real number line). 2. Let MGF and MGF be the moment generating functions corresponding to the two distributions (refer Table 2). For ∆′ t ≤ 0, MGF (ct) = 0. c→∞ MGF (ct) t′ (Γ − Γ)t > 0 ⇒ lim Proof. Here, we use Landau’s O(·) and Ω(·) notation, defined in Notation (5.1). Statement 1a: We use the approach in Lemma 7. The expression for the squared absolute value of the characteristic function ratio, obtained by multiplying the ratio with its conjugate, is given by  2 exp(−c2 t′ Ωt) 1 + (ℑ(c∆′ t))2 CF (ct)   = 2 CF (ct) exp(−c2 t′ Ωt) 1 + (ℑ(c∆′ t)) ′ 2 1+(ℑ(c∆ t)) from the previous expression. Using the asymptotic upperConsider the ratio 1+(ℑ(c∆ ′ t))2 bound (for the numerator) and lower bound (for the denominator), obtained in Lemma 10 (Statement 2c and 2d), we get 1 + (ℑ(c∆′ t))2 Thus,    2 2 ′ 2 2 ′ 2 2 = O c exp c (∆ t) − c (∆ t) 1 + (ℑ(c∆′ t))  = O c2 exp c2 t′ (∆∆′ − ∆∆′ )t , CF (ct) CF (ct) Consequently, 2   = exp −c2 t′ (Ω − Ω)t O c2 exp c2 t′ (∆∆′ − ∆∆′ )t  = O c2 exp −c2 t′ ((Ω − ∆∆′ ) − (Ω − ∆∆′ ))t  = O c2 exp −c2 (t′ (Γ − Γ)t) lim c→∞ CF (ct) CF (ct) 2 = 0, when t′ (Γ − Γ)t > 0 21 (18) and CF (ct) = 0, when t′ (Γ − Γ)t > 0 c→∞ CF (ct) lim follows. Statement 1b Similar to the derivation of the asymptotic upper-bound for the ratio in Equation 18, we derive the asymptotic lower-bound by using Lemma 10 (Statement 2c and 2d);   2  1 CF (ct) 2 ′ = Ω 2 exp c (t (Γ − Γ)t) CF (ct) c Consequently, CF (ct) lim c→∞ CF (ct) 2 = ∞, when t′ (Γ − Γ)t > 0 and CF (ct) ∈ {−∞, ∞}, when t′ (Γ − Γ)t > 0 c→∞ CF (ct) lim follows, provided the limit exists in R. Combining the result with Statement 1a proves Statement 1b. Statement 2 From the definition of MSN MGF (Table 2) we get   c2 ′ Φ(c∆′ t) MGF (ct) ′ ′ = exp c(µ − µ )t − t (Ω − Ω)t MGF (ct) 2 Φ(c∆′ t) ′ t) Consider the ratio Φ(c∆ from the previous expression. We apply the asymptotic upperΦ(c∆′ t) bound (for the numerator) and lower bound (for the denominator), obtained in Lemma 10 (Statement 1). Because ∆′ t ≤ 0, the asymptotic upper-bound is applicable.   2   c Φ(c∆′ t) ′ 2 ′ 2 = O c exp − (∆ t) − (∆ t) Φ(c∆′ t) 2    2 c ′ ′ ′ = O c exp − t (∆∆ − ∆∆ )t 2 Thus,      2 c2 ′ c ′ MGF (ct) ′ ′ ′ ′ = exp c(µ − µ )t − t (Ω − Ω)t O c exp − t (∆∆ − ∆∆ )t MGF (ct) 2 2    2 c ′ ′ ′ ′ ′ = O c exp c(µ − µ )t − t ((Ω − ∆∆ ) − (Ω − ∆∆ ))t 2    c2 ′ ′ ′ = O c exp c(µ − µ )t − (t (Γ − Γ)t) 2 22 Because c2 term dominates the c term in the exponential above, the asymptotic upper-bound goes to 0, irrespective of the relation between µ and µ. Consequently, lim c→∞ MGF (ct) = 0, when t′ (Γ − Γ)t > 0. MGF (ct) Lemma 9. Consider two K−dimensional Skew Normal distributions, CFUSN(µ, Ω, Λ) and CFUSN(µ, Ω, Λ). Let Γ, ∆ be related to Ω and Λ as given in Table 1. Let c ∈ R and t ∈ RK . 1. Let CF and CF be the characteristic functions corresponding to the two distribuexp(ι(µ−µ)′ t) exp(−1/2c2 t′ (Γ−Γ)t) tions (refer Table 2). Let V (c; θ, θ, t) = , where 0✁ (t) = |0(Λ′ t)|−|0(Λ′ t)|) ✄ c( ✄  q (|✁0(U ′ t)|−|✁0(V ′ t)|) Q V ′t ✄ ′ t) i′ , where ι is the imagiQi∈0(V {i : t[i] 6= 0}. Let Ξ(U, V, t) = ι π2 U t ✄ i∈0(U ′ t) i nary number and Ui (Vi ) is the ith column of U (V ). Then (a) lim c→∞ CF (ct) CF (ct) V (c; θ, θ, t) = Ξ(Λ, Λ, t). (b) Using Landau’s O(·) notation, defined in Notation (5.1),  Q RN (c, Λ′i t)  c exp(1/2c2 (Λ′i t)2 )   − ιO  i∈✁0(Λ′ t) 1 +     − 1 −Ξ(Λ, Λ, t) = Ξ(Λ, Λ, t) Q , ′ c V (c; θ, θ, t) t) − ιO 1 + R (c, Λ ′ ′ N i i∈✁ 0(Λi t) exp(1/2c2 (Λ t)2 ) CF (ct) CF (ct) i where, for a positive integer N, RN (c, x) = as c → ∞. 23 PN (2n−1)!! n=1 c2n x2n +O  c−2(N +1) +O(exp(−c2 x2/4)) Proof. CF (ct) CF (ct) K 2 ′ Y 1 + ιℑ(cΛ′ t) 1 |✁ 0(Λ′ t)|−|✁ 0(Λ′ t)|) exp(− /2c t (Ω − Ω)t) i ( =c ′ 2 ′ 1 V (c; θ, θ, t) exp(− /2c t (Γ − Γ)t) i=1 1 + ιℑ(cΛi t) K c|✁0(Λ t)| exp(1/2c2 t′ ΛΛ′ t) Y 1 + ιℑ(cΛ′i t) = ′ ′ c|✁0(Λ t)| exp(1/2c2 t′ ΛΛ′ t) i=1 1 + ιℑ(cΛi t) ′ = 1+ιℑ(cΛ′i t) K |✁ 0(Λ′ t)| Y exp(1/2c2 (Λ′i t)2 ) c c|✁0(Λ t)| ′ 1+ιℑ(cΛ′i t) i=1 exp(1/2c2 (Λ′i t)2 ) c(1+ιℑ(cΛ′i t)) i∈✁ 0(Λ′ t) exp(1/2c2 (Λ′ t)2 ) i Q = Q c(1+ιℑ(cΛ′i t)) i∈✁ 0(Λ′ t) exp(1/2c2 (Λ′i t)2 ) Q c i∈✁ 0(Λ′ t) exp(1/2c2 (Λ′ t)2 ) i = Q c i∈✁ 0(Λ′i t) exp(1/2c2 (Λ′i t)2 ) c ℑ(cΛ′i t) (1/2c2 (Λ′i t)2 ) + ι exp(1/2cc2 (Λ′ t)2 ) ℑ(cΛ′i t) + ι exp (19) i Using Lemma 10 (Statement 2a), we get  q 2 1 ι i∈✁ 0(Λ′ t) π Λ′ t lim =Q q i c→∞ V (c; θ, θ, t) 2 1 i∈✁ 0(Λ′ t) ι π Λ′ t CF (ct) CF (ct) Q i = Ξ(Λ, Λ, t). This proves Statement (1a). Using Equation 19, Q c i∈✁ 0(Λ′ t) exp(1/2c2 (Λ′ t)2 ) i c ℑ(cΛ′i t) (1/2c2 (Λ′i t)2 ) − Ξ(Λ, Λ, t) − Ξ(Λ, Λ, t) = Q ′ c c V (c; θ, θ, t) i∈✁ 0(Λ′i t) exp(1/2c2 (Λ′i t)2 ) + ι exp(1/2c2 (Λ′i t)2 ) ℑ(cΛi t) p Q c 2/π 1 (1 + R (c, Λ′ t)) N i i∈✁ 0(Λ′ t) exp(1/2c2 (Λ′ t)2 ) + ι Λ′ t i p = Q − Ξ(Λ, Λ, t) c 2/π 1′ (1 + R (c, Λ′ t)) N i i∈✁ 0(Λ′i t) exp(1/2c2 (Λ′i t)2 ) + ι Λt (Using Lemma 10 Statement(2b))   Q c ′ i∈✁ 0(Λ′ t) 1 + RN (c, Λi t) − ιO exp(1/2c2 (Λ′ t)2 ) i   − Ξ(Λ, Λ, t) = Ξ(Λ, Λ, t) Q ′ c t) − ιO 1 + R (c, Λ ′ N i i∈✁ 0(Λi t) exp(1/2c2 (Λ′i t)2 )     Q c ′   i∈✁0(Λ′ t) 1 + RN (c, Λi t) − ιO exp(1/2c2 (Λ′i t)2 )    = Ξ(Λ, Λ, t) − 1 Q   ′ c i∈✁ 0(Λ′i t) 1 + RN (c, Λi t) − ιO exp(1/2c2 (Λ′ t)2 ) CF (ct) CF (ct) + ι exp i This proves Statement (1b). 24 Rxp Lemma 10. Let Φ be the standard normal cdf and ℑ(x) = 0 2/π exp(u2/2)du. Let x be finite. Then, using Landau’s O(·) and Ω(·) notation, defined in Notation (5.1), as c → ∞, 1. (a) For all x ∈ R   exp(−c2 x2/2) Φ(cx) = Ω c (b) When x ≤ 0, Φ(cx) = O(exp(−c2 x2/2)) 2. (a) For all x 6= 0, p 1 cℑ(cx) 2/π  = 2 2 c→∞ exp c x x 2 lim (b) For all x 6= 0, cℑ(cx) 2 2 = exp c 2x r " # N X  21 (2n − 1)!! 1+ + O c−2(N +1) + O(exp(−c2 x2/4)) , 2n x2n πx c n=1 where !! is defined recursively for an integer a ≥ −1 as follows ( a(a − 2)!! when a = 6 0 and a 6= −1 a!! = 1 when a = 0 or a = −1 (c) For all x ∈ R, (d) For all x ∈ R, 1 + (ℑ(cx))2 = O exp(c2 x2 )    exp(c2 x2 ) 1 + (ℑ(cx)) = Ω c 2 Proof. Statement 1: Consider the function, g(c) = c Φ(cx) 2 2 , exp − c 2x To prove the statements, we first derive the limits of g(c) as c → ∞. To evaluate the limit, when x < 0, we apply the L’Hôpital’s rule because both the numerator and denominator 25 go to 0. To this end we take the limit of ratio of the derivative of the numerator and the denominator w.r.t c and applying Leibniz integral rule, we get lim g(c) = lim c→∞ c→∞ = lim d dc d Φ(cx) dc   2 2 exp − c 2x c √x 2π  2 2 exp − c 2x  2 2 c→∞ ((−cx2 )c−1) exp − c 2x = c2 √x 2π lim c→∞ (−x2 − 1/c2 ) −1 (20) =√ 2πx   exp(−c2 x2/2) and consequently, Φ(cx) = O(exp(−c2 x2/2)), which Thus, for x < 0, Φ(cx) = O c also holds true when x = 0. Thus Φ(cx) = O(exp(−c2 x2/2)) when x ≤ 0, whichproves State exp(−c2 x2/2) ment (1b). Moreover, it follows from Equation 20 that, for x < 0, Φ(cx) = Ω c 1 and since it is true  for x 2 ≥2 0as well (because Φ(0) = /2 and Φ(cx) approaches 1 when c x exp(− /2) x > 0), Φ(cx) = Ω for all x ∈ R. This proves Statement (1a). c Statement 2: Performing integration by parts on ℑ(cx), for x 6= 0 gives 26 Z x r 2 exp(u2/2)du π 0 Z x r Z x/√2 r 2 2 exp(u2/2)du + √ exp(u2/2)du = π π x / 2 0 # r "Z x/√2 Z x 2 d 1 = exp(u2/2)du + √ (exp(u2/2))du π 0 x/ 2 u du # r "Z x/√2 Z x x2/2) u2/2) x2/4) 2 exp( exp( exp( + + √ du exp(u2/2)du − −1/2 = π 0 2 x x u2 x/ 2 # r "Z x/√2 Z x x2/2) x2/4) 2 exp( d 1 exp( = + + √ 3 exp(u2/2)du exp(u2/2)du − −1/2 π 0 2 x x u du x/ 2 # r "Z x/√2 Z x x2/4) x2/2) x2/2) u2/2) x2/4) 2 exp( exp( exp( exp( exp( − −3/2 3 + + + √ 3 du = exp(u2/2)du − −1/2 π 0 2 x 2 x x x3 u4 x/ 2 r " Z x N 2 exp(x2/2) X (2n − 1)!! exp(x2/2) exp(u2/2) = + + (2N + 1)!! √ 2(N +1) du π x x2n+1 x/ 2 u n=1 # √ Z x/ 2 N X (2n − 1)!! exp(x2/4) √ − exp(u2/2)du + −(2n+1) 2n+1 2 x 0 n=0  R x exp(u2/2) r N 2 √ X x 2 exp( /2)  (2n − 1)!! x/ 2 u2(N+1) du = 1+ + (2N + 1)!!x π x x2n exp(x2/2) n=1 # R x/√2 N u2/2)du X exp( (2n − 1)!! exp(−x2/4) √ +x 0 − −(2n+1) 2n exp(x2/2) 2 x n=0 ℑ(x) = Thus,  A z }| {  R u2/2) r exp ( cx N √ X (2n − 1)!! 2 exp(c2 x2/2)  cx/ 2 u2(N+1) du  ℑ(cx) = + (2N + 1)!!cx 1 +  π cx c2n x2n exp(c2 x2/2) n=1   B C z }| { z }| { R cx/√2  N X exp(u2/2)du  (2n − 1)!! exp(−c2 x2/4) 0 √ − + + cx  c2 x2/2) −(2n+1) c2n x2n exp( 2  n=0 27  Notice that term (A) is of order O c−2(N +1) since lim c→∞ A c−2(N +1) = lim (2N + 1)!!x c→∞ = lim (2N + 1)!!x c→∞ R cx √ cx/ 2 exp(u2/2) u2(N+1) exp(c2 x2/2) c2N+3 R exp(u2/2) cx d √ du cx / 2 u2(N+1) dc (applying L’Hôpital’s rule) c2 x2/2) d exp( 2N+3 dc c exp(c2 x2/2) exp(c2 x2/4)2N+1 √ · x/ 2 c2(N+1) x2(N+1) c2(N+1) x2(N+1) exp(c2 x2/2)((cx2 )c2N+3 −(2N +3)c2(N+1) ) c4N+6 = lim (2N + 1)!! c→∞ = lim (2N + 1)!! du ·x− (applying Leibniz integral rule)   √ c−2(N +1) x−(2N +1) 1 − exp(−c2 x2/4) 22N +1 c−2(N +1) (x2 − (2N + 3)c−2 ) √ 1 1 − exp(−c2 x2/4) 22N +1 = lim (2N + 1)!! 2N +1 c→∞ x x2 − (2N + 3)c−2 1 = (2N + 1)!! 2N +3 , x c→∞ term (B) is O(exp(−c2 x2/4)) and so is term (C) since C = lim x lim 2 2 c→∞ c→∞ exp(−c x /4) = lim x c→∞ = lim x R cx/√2 0 d dc exp(u2/2)du exp(c2 x2/4) R cx/√2 0 d dc c exp(u2/2)du exp(c2 x2/4) c 2 x2 c exp( /4) · exp(c2 x2/4)((cx2/2)c−1) c2 2 x √ lim x2 2 1 2 c→∞ ( /2 − /c ) c→∞ = = √x 2 √ (applying L’Hôpital’s rule) (applying Leibniz integral rule) 2. Consequently, cℑ(cx) = exp(c2 x2/2) r " # N X  21 (2n − 1)!! 2 2 1+ + O c−2(N +1) + O(exp(−c x /4)) , 2n x2n πx c n=1 which proves Statement (2b) and consequently Statement (2a). 28  exp(c2 x2/2) c  Statement (2a) implies that ℑ(cx) is O when x 6= 0. Thus 1 + (ℑ(cx))2   exp(c2 x2 ) is O(1) + O and consequently O(exp(c2 x2 )) when x 6= 0. Notice that the 1 + c2 (ℑ(cx))2 is trivially O(exp(c2 x2 )) when x = 0 as well, which completes the proof of Statement (2c).   exp(c2 x2/2) , when x 6= 0. Thus 1 + (ℑ(cx))2 is Statement (2a) also implies that ℑ(cx) is Ω c     exp(c2 x2 ) exp(c2 x2 ) Ω(1)+Ω and consequently Ω , when x 6= 0. Notice that 1+(ℑ(cx))2 is c2 c2   exp(c2 x2 ) when x = 0 as well, which completes the proof of Statement (2d). trivially Ω c2 6. Conclusions We give meaningful sufficient conditions that ensure identifiability of two-component mixtures with SN, MSN, and CFUSN components. We proved identifiability in terms of the Γ parameter that contains both the scale and the skewness information and has a consistent interpretation across the three skew normal families. Our results are strong in the sense that the set of parameter values not covered by the sufficient condition is a Lebesgue measure 0 set in the parameter space. Ghosal and Roy (2011) study the identifiability of a two-component mixture with the standard normal as one of the components and the second component itself given by a uncountable mixture of skew normals. Treating G from their work as a point distribution, we can make a valid comparison between our identifiability result and theirs, concluding the superiority of our results, owing to a larger coverage of the parameter space by our conditions. References References R. B. Arellano-Valle and M. G. Genton. On fundamental skew distributions. J Multivar Anal, 96(1):93–116, 2005. A. Azzalini. A class of distributions which includes the normal ones. Scand J Stat, 12(2):171–178, 1985. A. Azzalini. Further results on a class of distributions which includes the normal ones. Statistica, 46(2): 199–208, 1986. A. Azzalini and A. Dalla Valle. The multivariate skew-normal distribution. Biometrika, 83(4):715–726, 1996. G. Blanchard, G. Lee, and C. Scott. Semi-supervised novelty detection. J Mach Learn Res, 11:2973–3009, 2010. 29 L. Bordes, C. Delmas, and P. Vandekerkhove. Semiparametric estimation of a two-component mixture model where one component is known. Scand J Stat, 33(4):733–752, 2006. R. P. Browne and P. D. McNicholas. A mixture of generalized hyperbolic distributions. Can J Stat, 43(2): 176–198, 2015. A. P. Dempster, N. M. Laird, and D. B. Rubin. Maximum likelihood from incomplete data via the EM algorithm. J R Stat Soc B, pages 1–38, 1977. M. G. Genton. Skew-elliptical distributions and their applications: a journey beyond normality. CRC Press, 2004. S. Ghosal and A. Roy. Identifiability of the proportion of null hypotheses in skew-mixture models for the p-value distribution. Electron J Statist, 5:329–341, 2011. H. Holzmann, A. Munk, and T. Gneiting. Identifiability of finite mixtures of elliptical distributions. Scand J Stat, 33(4):753–763, 2006. S. Jain, M. White, and P. Radivojac. Estimating the class prior and posterior from noisy positives and unlabeled data. In Advances in Neural Information Processing Systems, NIPS 2016, pages 2693–2701, 2016a. S. Jain, M. White, M. W. Trosset, and P. Radivojac. Nonparametric semi-supervised learning of class proportions. arXiv preprint arXiv:1601.01944, 2016b. URL http://arxiv.org/abs/1601.01944. S. Jain, M. White, and P. Radivojac. Recovering true classifier performance in positive-unlabeled learning. In Proceedings of the 31st AAAI Conference on Artificial Intelligence, AAAI 2017, pages 2066–2072, 2017. H. M. Kim and M. G. Genton. Characteristic functions of scale mixtures of multivariate skew-normal distributions. J Multivar Anal, 102(7):1105–1117, 2011. S. X. Lee and G. J. McLachlan. On mixtures of skew normal and skew t-distributions. Adv Data Anal Classif, 7(3):241–266, 2013. T. I. Lin. Maximum likelihood estimation for multivariate skew normal mixture models. J Multivar Anal, 100(2):257–265, 2009. G. J. McLachlan and D. Peel. Finite mixture models. John Wiley & Sons, Inc., 2000. A. K. Menon, B. van Rooyen, C. S. Ong, and R. C. Williamson. Learning from corrupted binary labels via class-probability estimation. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, pages 125–134, 2015. R. K. Patra and B. Sen. Estimation of a two-component mixture model with applications to multiple testing. J R Statist Soc B, 78(4):869–893, 2016. A. Pewsey. The characteristic functions of the skew-normal and wrapped skew-normal distributions. In 27 Congreso Nacional de Estadistica e Investigación Operativa, pages 4383–4386, 2003. J. D. Storey. A direct approach to false discovery rates. J R Stat Soc B, 64(3):479–498, 2002. J. D. Storey. The positive false discovery rate: a Bayesian interpretation and the q-value. Ann Stat, 31(6): 2013–2035, 2003. J. D. Storey and R. Tibshirani. Statistical significance for genomewide studies. Proc Natl Acad Sci U S A, 100(16):9440–9445, 2003. G. M. Tallis. The moment generating function of the truncated multi-normal distribution. J R Stat Soc B, pages 223–229, 1961. G. M. Tallis and P. Chesson. Identifiability of mixtures. J Austral Math Soc Ser A, 32:339–348, 1982. H. Teicher. Identifiability of finite mixtures. Ann Math Stat, 34(4):1265–1269, 1963. G. Ward, T. Hastie, S. Barry, J. Elith, and J. R. Leathwick. Presence-only data and the EM algorithm. Biometrics, 65(2):554–563, 2009. S. J. Yakowitz and J. D. Spragins. On the identifiability of finite mixtures. Ann Math Statist, 39:209–214, 1968. 30 Appendix A. CFUSN characteristic function Theorem 4. The characteristic function of CFUSN(µ, Ω, Λ) is given by Y K 1 ′ CF (t) = exp ιt µ − t Ωt (1 + ιℑ(Λ′i t)), 2 i=1  ′ K is the dimensionality of the CFUSN distribution, ι is the imaginary number, ℑ(x) = Rwhere x p2 2 th / π exp(u /2)du and Λi is the i column of Λ. 0 Proof. We use the stochastic representation of X ∼ CF  USN(µ, Ω, Λ) obtained from Lin K (2009), given by X = ΛH +G, where H ∼ TN 0, IK , R+ , the standard multivariate normal distribution truncated below 0 in all the dimensions and G ∼ NK (µ, Γ), for Γ = Ω − ΛΛ′ —a symmetric positive semi-definite matrix. It follows that the cf of X can be expressed in terms of cf’s of Normal distribution and truncated Normal distribution; precisely, CFX (t) = CFG (t) · CFΛH (t). Using the expression for the CF of Multivariate Normal,   1 ′ ′ CFX (t) = exp ιt µ − t Γt CFΛH (t) (A.1) 2 Basic properties of a cf and its connection with the corresponding MGF gives CFΛH (t) = CFH (Λ′ t) = MGFH (ιΛ′ t). Using the expression for MGFH (t), derived in Tallis (1961) (p. 225), and replacing t by ιΛ′ t and R (the covariance matrix in Tallis (1961)) by IK (K × K identity matrix), we get  (2π)−K/2 R exp− 1 (w − ιΛ′ t)′ (w − ιΛ′ t) dw 1 2 RK + R CFΛH (t) = exp − t′ ΛΛ′t 2 φ (u)du RK K  + (where φK is the pdf of N(0, IK )) ) ( Z  K X 1 1 K − / 2 (wi − ιΛ′i t)2 dw (2π) exp − = 2K exp − t′ ΛΛ′ t K 2 2 R+ i=1 (where w = [wi ]K i=1 )   Z  K Y 1 ′ ′ 1 −K/2 K ′ 2 = 2 exp − t ΛΛ t (2π) exp − (wi − ιΛi t) dw 2 2 RK + i=1   K Z   1 1 ′ ′ Y ∞ −1/2 ′ 2 K (2π) exp − (wi − ιΛi t) dwi . = 2 exp − t ΛΛ t 2 2 0 i=1 Applying the substitution ui = −wi + ιΛ′i t for the integral in the numerator, changes the domain of the integration from the real line to the complex plane. To define such an integral 31 correctly, one needs to specify the path in the complex plane across which the integration is performed. Using the path from −∞ + ιΛ′i t to ιΛ′i t, parallel to the real line, we get  K Z ′   1 ′ ′ Y ιΛi t 1 2 −1/2 CFΛH (t) = 2 exp − t ΛΛ t (2π) exp − ui dui ′t 2 2 −∞+ιΛ i i=1  K Z ′  1 ′ ′ Y ιΛi t K φ(ui )dui . = 2 exp − t ΛΛ t ′t 2 −∞+ιΛ i i=1 K  Using Lemma 1 from Kim and Genton (2011) to simplify the integral term, we get   Y  Z Λ√′i t K  2 1  1 + ι √1 CFΛH (t) = 2K exp − t′ ΛΛ′ t exp u2i dui  2 2 π 0 i=1  Y  2 ! Z Λ′i t r K 2 1 1 v 1 = 2K exp − t′ ΛΛ′ t +ι exp i dvi 2 2 2 0 π 2 i=1 √ (substituting vi = ui/ 2)  K  1 ′ ′ Y (1 + ιℑ(Λ′i t)), = exp − t ΛΛ t 2 i=1 Substituting the expression for CFΛH (t) in equation (A.1) completes the proof. 32
10math.ST
1 Complexity of Frictional Interfaces: A Complex Network Perspective 2 H. O. Ghaffari1 3 Department of Civil Engineering and Lassonde Institute, University of Toronto, Canada 4 M. Sharifzadeh 5 Faculty of Engineering, Kyushu University, Hakozaki, Japan 6 E. Evgin 7 Department of Civil Engineering, University of Ottawa, Ontario, Canada 8 Abstract: The shear strength and stick-slip behavior of a rough rock joint are analyzed using the 9 complex network approach. We develop a network approach on correlation patterns of void 10 spaces of an evolvable rough fracture (crack type II). Correlation among networks properties 11 with the hydro -mechanical attributes (obtained from experimental tests) of fracture before and 12 after slip is the direct result of the revealed non-contacts networks. Joint distribution of locally 13 and globally filtered correlation gives a close relation to the contact zones attachment- 14 detachment sequences through the evolution of shear strength of the rock joint. Especially spread 15 of node’s degree rate to spread of clustering coefficient rate yielded possible stick and slip 16 sequences during the displacements. Our method can be developed to investigate the complexity 1 h.o.ghaffari@gmail.com; hamed.owladeghaffari@utoronto.ca Dept. Civil Engineering, U of T, MB108‐170 College Street‐Toronto‐ON‐Canada 1 17 of stick-slip behavior of faults as well as energy /stress localization on crumpled shells/sheets in 18 which ridge networks are controlling the energy distribution. 19 Key words: Frictional interface; Rock joint, Shear strength, Stick-slip, Complex networks, 20 Correlation, Contact areas 21 1. Introduction 22 During the last decade, complex networks have been used increasingly in different fields 23 of science and technology [1-3]. Initial applications of complex networks in geosciences were 24 mostly related to earthquakes [4-6]. 25 complexity of such recursive events has been the main objective of the related research [7-13]. 26 Understanding of spatio-temporal topological complexity of events based on field 27 measurements can disclose some other facets of these intra/extra woven events. Characterization of spatial and temporal structural 28 Studies pertaining to the topological complexity and its application in some geoscience 29 fields reveals that acquisition and gathering of direct information (especially in temporal scale) is 30 difficult and in many cases are (were) impossible (at least with current technologies). In addition 31 to complex earthquake networks, recently the analysis of climate networks, volcanic networks, 32 river networks and highway networks, as the large scale measurements, have been taken into 33 account [9-13]. 34 geoscience fields such as the gradation of soil particles, fracture networks, aperture of fractures, 35 and granular materials [14-20]. The initial step refers to organizational step which tries to find 36 out possible dominant well-known structures within the system. Next step in the most of the 37 mentioned works is to provide a suitable and simple method to yield a similar structure. Such 38 algorithm may support the evolution of structure in spatial or/and temporal cases [21]. In small scales, topological complexity has been evaluated in relation to 2 39 May be the most important structural complexity in geological fields is related to fracture 40 networks. Fracture networks with dilatancy [22], joint networks in excavation damaged zones, 41 cracking in pavements (or other natural/man-made structures) and fault networks in large scale 42 have been recognized [23-25]. In the analysis of these networks, the characterization of fractures 43 in a proper space such as friction-displacement space is an essential step. Furthermore, with 44 taking the direct relationship between void spaces and contact areas in to account, one may 45 interest in considering the induced topological complexity of the opening elements (non- 46 frictional contacts) into the fracture behavior. Using linear elastic fracture mechanics, we know 47 aperture or aspect ratio is generally the index to available energy in growth of rupture. Crack 48 like behavior of rupture in frictional interfaces also support the role of contact areas and 49 equivalently apertures. In addition, the variations of fluid flow features (such as permeability 50 and tortuosity) directly are controlled with aperture spaces. In order to characterize the main 51 attributes of the fractured systems, e.g. mechanical and hydraulic properties, several methods 52 have been suggested in the literature [26-30]. Recently, the authors have proposed the 53 implementation of a complex network analysis for the evolution of micro-scale apertures in a 54 rough rock fracture [18-19]. Based on a Euclidean measure, the results confirmed the 55 dependency of hydro-mechanical properties to the attributes of characterized aperture networks. 56 The present study is also related to the complex aperture networks. However, the current study 57 presents the analysis of frictional forces during shearing based on the correlation of apertures in 58 a rock joint. The analysis is associated with set up a network on an attribute (such as aperture 59 distribution) in an area. The aforementioned method has also been employed in the analysis of 60 the coupled partial differential equations which was related to two-phase flow [31]. 3 61 With respect to avalanche-like behavior of collective motion of the ensemble discrete 62 contacts (in the vicinity of a phase transition step), we try to characterize the collective behavior 63 of aperture strings using networks. In this paper we will answer the following three questions: 1) 64 Is there any (hidden) complex structure in the experimentally observed apertures? 2) What is the 65 effect of specific structural complexity of apertures on mechanical response of a fracture? 3) 66 How do apertures regulate with each other to show well-known slip-friction curve? In other 67 words, can we relate the topological complexity of apertures to the evolution path of the 68 fracture? 69 The organization of the paper is as follows: Section 2 includes a brief description of 70 networks and their characterization. In addition, the construction procedure of aperture networks 71 is explained. Section 3 covers a summary of the experimental procedure. The last section 72 presents the evaluation of the pre- and post-peak (stick-slip) behavior of a rock joint which is 73 followed by the analysis of the constructed network. 74 75 2. Network of Evolving Apertures 76 77 In this section we describe a general method of setting up a network on a fracture surface 78 while the surface property is a superposition of very narrow profiles (ribbons) of one attribute of 79 the system. In other words, one attribute of the system is “granulated “over strings (profiles or 80 ribbons). The relationship between the discrete strings –inferred from long range correlation or 81 elastic forces- results an interwoven network, i.e., topological complexity of interactions. The 82 frictional behavior including the stick-slip response of a joint is related to the sum of real contact 83 areas, which fluctuates with the changes in apertures. It also occurs based on the collective 4 84 motion and spatially coupled of contact zones. It is shown that the structural complexity of the 85 dynamic aperture changes is controlling and regulating the joint behavior and its unstable 86 response. In order to explain the details of our work, we need to characterize the topological 87 complexity. 88 A network consists of nodes and edges connecting the [32]. To set up a nondirected 89 network, we considered each string of measured aperture as a node. Each aperture string has N 90 pixels where each pixel shows the void size of that cell. Depending on the direction of strings, 91 the length of the profiles varies. The maximum numbers of strings (in our cases) are in the 92 perpendicular direction to the shear, while the minimum one is in the parallel direction. To make 93 an edge between two nodes, a correlation measurement ( Cij ) over the aperture profiles was 94 used. The main point in the selection of each space is to explore the explicit or implicit hidden 95 relations among different distributed elements of a system. For each pair of signals (profiles) Vi 96 and Vj , containing N elements (pixels) the correlation coefficient can be written as [33]: N 97 Cij = ∑ [V (k )− ≺ V ]. ⎡⎣V (k )− ≺ V k =1 i i N j j N ∑ [V (k )− ≺ V ] . ∑ ⎡⎣V (k )− ≺ V k =1 2 i i ⎤⎦ k =1 j j (1) ⎤⎦ 2 N 98 99 100 where ≺ V i = ∑ V (k ) k =1 i . Obviously, It should be noted that N Cij is restricted to −1 ≤ Cij ≤ 1, where Cij=1, 0, and -1 are related to perfect correlations, no correlations and perfect anti-correlations, respectively. 101 Selection of a threshold ( ξ ) to make an edge, can be seen from different views. 102 Choosing a constant value may be associated with the current accuracy of accumulated data 5 103 where after a maximum threshold the system loses its dominant order. In fact, there is not any 104 unique way in the selection of a constant value, however, preservation of the general pattern of 105 evolution must be considered while the hidden patterns can be related to the several characters of 106 the network. These characters can express different facets of the relations, connectivity, 107 assortivity (hubness), centrality, grouping and other properties of nodes and/or edges [34-36]. 108 Generally, it seems obtaining stable patterns of evolution (not absolute) over a variation of ξ can 109 give a suitable and reasonably formed network [33]. Also, different approaches have been used 110 such as density of links, the dominant correlation among nodes, c-k space and distribution of 111 edges or clusters. In this study, we set Cij ≥ ξ = 0.2Cij . Considering with this definition, we are 112 filtering uncorrelated profiles over the metric space. In the previous study, the sensitivity of the 113 observed patterns (associated with the Euclidean distance of profiles) 114 [18]. max has been distinguished 115 The clustering coefficient describes the degree to which k neighbors of a particular node 116 are connected to each other. What we mean by neighbors is the connected nodes to a particular 117 node. The clustering coefficient shows the collaboration between the connected nodes. Assume 118 that the i th node to have k i neighboring nodes. There can exist at most k i (k i −1) / 2 edges 119 between the neighbors. We define 120 121 122 ci = actual number of ci as the ratio edges between the neighbors k i ( k i − 1) / 2 Then, the clustering coefficient is given by the average of network [21]: 6 of the i th node (2) ci over all the nodes in the C = 123 1 N N ∑c . (3) i i =1 124 For k i ≤ 1 we define C ≡ 0 . The closer C is to one the larger is the interconnectedness 125 of the network. The connectivity distribution (or degree distribution), P ( k ) , is the probability of 126 finding nodes with k edges in a network. In large networks, there will always be some 127 fluctuations in the degree distribution. The large fluctuations from the average value ( < k > ) 128 refers to the highly heterogeneous networks while homogeneous networks display low 129 fluctuations [21]. From another perspective, clustering in networks is closely related to degree 130 correlations. Vertex degree correlations are the measures of the statistical dependence of the 131 degrees of neighbouring nodes in a network [35]. Two-point correlation is the criterion in 132 complex networks as it can be related to network assortativity. 133 The concept of two-point correlation can be included within the conditional probability 134 distribution P(k ' | k ) that a node of degree k is connected to a node of degree k ' . In other words, 135 the degrees of neighbouring nodes are not independent. The meaning of degree correlation can 136 also be defined by the average degree of nearest neighbours ( ≺ knn 137 k high degree nodes (hubs) tend to make a link to high degree nodes, otherwise, if 138 ≺ knn 139 (disassortative ) [34-36]. From the point of view of fractal complex networks [37-38], the degree 140 correlation may be used as a tool to distinguish the self-similarity of network structures. In fact, 141 in fractal networks large degree nodes (hubs) tend to connect to small degree nodes and not to 142 each other (fractality and disassortativity). Also, the clustering nature of a network can be drawn 143 as the average over all nodes of degree k giving a clustering distribution (or spectrum). In many k k ). If ≺ knn k increases with decreases with k, high degree nodes (hubs) tend to make a link with low degree nodes 7 144 real-world networks such as the internet the clustering spectrum is a decreasing function of 145 degree which may be interpreted as the hierarchical structures in a network. In contrast, some 146 other networks such social networks and scientific collaborations (and also we will see complex 147 aperture networks) are showing assortative behaviour [35]. It will be shown that spreading of 148 crack like behaviour due to shearing a fracture, can be followed with the patterns of proper 149 spectrum. Similarly, by using the degree correlation, one may define the virtual weight of an 150 edge as an average number of edges connected to the nodes [39]. 151 The average (characteristic) path length L is the mean length of the shortest paths 152 connecting any two nodes on the graph. The shortest path between a pair (i, j) of nodes in a 153 network can be assumed as their geodesic distance, gij , with a mean geodesic distance L given as 154 below [2, 21]: 155 L= 2 ∑ gij , N ( N −1) i< j (4) 156 where gij is the geodesic distance (shortest distance) between node i and j, and N is the number 157 of nodes. We will use a well known algorithm in finding the shortest paths presented by Dijkstra 158 [40]. Based on the mentioned characteristics of networks two lower and upper bounds of 159 networks can be recognized: regular networks and random networks (or Erdős–Rényi networks 160 [41]). Regular networks have a high clustering coefficient (C ≈ 3/4) and a long average path 161 length. Random networks (construction based on random connection of nodes) have a low 162 clustering coefficient and the shortest possible average path length. However Watts and Strogatz 163 [42] introduced a new type of networks with high clustering coefficient and small (much smaller 164 than the regular ones) average path length. This is called small world property. 8 165 3. Summary of Laboratory Tests 166 To study the small world properties of rock joints, the results of several laboratory tests 167 were used. The joint geometery consisting of two joint surfaces and the aperture between these 168 two surfaces were measured. The shear and flow tests were performed later on. The rock was 169 granite with a unit weight of 25.9 kN/m3 and uniaxial compressive strength of 172 MPa. An 170 artificial rock joint was made at mid height of the specimen by splitting and using special joint 171 creating apparatus, which has two horizontal jacks and a vertical jack [43-44]. The sides of the 172 joint are cut down after creating the joint. The final size of the sample is 180 mm in length, 100 173 mm in width and 80 mm in height. Using special mechanical units, various mechanical 174 parameters of this sample were measured. A virtual mesh having a square element size of 0.2 175 mm was spread on each surface and the height at each position was measured by a laser scanner. 176 The details of the procedure can be found in [45-46]. Different cases of the normal stress (1, 177 3and 5 MPa) were used while the variation of surfaces were recorded. Figure1 shows the shear 178 strength evolution under different normal loads. In this study, we focus on the patterns, obtained 179 from the test with a 3 MPa normal stress. 180 4. Implementation and Analysis of Complex Aperture Networks 181 In this section we set up the designated complex network over the aperture profiles, 182 which are perpendicular to the shear direction. By using the correlation measure, the distribution 183 of correlation values along profiles and during the successive shear displacements were obtained 184 (Fig.2). Plotting the correlation distribution shows the transition from a near Poisson distribution 185 to a Gaussian distribution. The change in the type of distribution is followed by the phenomena 186 of the tailing, which is inducing the homogeneity of the correlation values towards high and anti- 9 187 correlation values. In other words, tailing procedure is tied with the quasi-stable (residual part) 188 states of the joint. Thus, this can be described by reducing the entropy of the system where the 189 clusters of information over correlation space are formed. From another point of view, with 190 considering the correlation patterns, it can be inferred that throughout the shear procedure, there 191 is a relatively high correlation between each profile and the profiles at a certain neighborhood 192 radius. This radius of correlation is increasing non-uniformly (anisotropic development) during 193 shear displacement (Fig.3). 194 By using the method described in the previous section, a complex aperture network is 195 developed from the correlation patterns (Fig.4). As it can be seen in this figure, the formation of 196 highly correlated nodes (clusters) is distinguishable near the peak point. It can be estimated that 197 the controlling factor in the evolution path of the system is related to the formation of cliques 198 (communities). We will show locality properties of the clusters (intera structures) are much 199 more discriminated at last displacements rather than initial time steps while global variations of 200 the structures are more sensitive to reduction in the shear stress. In fact, forming hubs in the 201 constructed networks may give the key element of synchronization of aperture profiles (or 202 collective motion of discrete contact zones) along the shear process. In other words, reaching to 203 one or multiple attractors and the rate of this reaching after peak point are organized by the 204 spreading and stabilizing the clusters. Unfortunately, due to a low rate of data sampling, the 205 exact evolution of patterns before peak-point is not possible. However, during the discussion on 206 the joint degree correlations, a general concept will be proposed. 207 The three well-known characteristics of the constructed networks, namely total degree of 208 nodes, clustering coefficient and mean shortest path length are depicted as a function of shear 209 displacement in Figure 5.As it can be followed there is a nearly monotonic growth/decay of the 10 210 parameters. A considerable sharp change in transition from shear displacement 1 to 2 mm is 211 observed for all three illustrated parameters. This transition is assumed as state transition from 212 the pre-peak to post peak state, while with taking into account the rate of the variation of the 213 parameters the transformation step is discriminated. Also, despite of clustering coefficient trend 214 which show a fully-growth shape the number of edges and mean short length after a shear 215 displacement of 12 mm roughly exhibiting a quasi-stable trend. These results provide the 216 necessary information for the classification of the aperture networks in our rock joint. The high 217 clustering coefficient and low average (characteristic) path length clearly show that our aperture 218 networks have small-world properties. 219 The development of shear stress over the networks is much faster after the peak point 220 than the pre-peak states. This feature can be explained by understanding the concept of the net- 221 contact areas [59]. At interlocking of asperities step-before maximum static friction- the two- 222 point correlation shows a relatively more uniform shape rather than former and later cases. Also, 223 the current configuration implies that the homogeneity of the revealed network where the nodes 224 with high degree are tending to absorb nodes with low edges. This indicates the property of self- 225 similarity within the network structures. The shear displacements immediately after or near peak 226 (Figure 6) point destroy the homogeneity of the network and spreading slow fronts and dropping 227 of the frictional coefficient is accompanied with a trial to make stable cliques, inducing the 228 heterogeneity to the network structures. Using a microscopic analysis, it can be proven that, for 229 homogenous topologies, many small clusters spread over the network and merge together to 230 form a giant synchronized cluster [54-56]. This event is predicted before reaching to the peak 231 threshold. In heterogeneous graphs, however, one or more central cores (hubs) are driving the 232 evolutionary path and are figuring out the synchronization patterns by absorbing the small 11 233 clusters. As can be seen in Figure 6 and Figure 7, two giant groups are recognizable after 14 mm 234 displacement. This shows the attractors states in a dynamic system. However, two discriminated 235 clusters are not showing the self-similarity structures within the proper networks, i.e., hubs with 236 high degree nodes are separated from the hubs with low degree nodes. In general, one may 237 overestimate the self-similarity of internal structures of the networks, which means that in the 238 entire steps at least a small branch of fractility can be followed. 239 The attributed weight distribution, associated with the two-point correlation concept 240 (Fig.7) shows as if the virtual heaviness of edges are increasing, simultaneously, the joint degree 241 distribution is also growing, which indicates the networks are assortative. The distribution of the 242 weights from unveiled hubs also clearly can be followed in Figure 7 while two general 243 discriminated patterns are recognizable. On the contrary, if the patterns of correlation of 244 clustering coefficients are drawn (Fig.8), the eruption of local synchronization is generally closed 245 out after (or at least near) peak point while again during and after dropping shear strength, the 246 variation of local clusters will continue. Especially, at the point near to critical step, the local 247 clusters present much more uniform percolation rather than the other states while at final steps 248 the stable state (or quasi-stable) regime of regional structures is not clear. It is worth stressing the 249 rate of variation of local joint clustering patterns at apparently quasi-steps are much higher than 250 the global patterns, i.e., joint degree distribution. Also, it must be noticed that before peak point 251 the structures of joint triangles density is approximately unchangeable. Then as a conclusion, 252 burst of much dense local hubs is scaled with disclosing of slow fronts spreading. 253 Following the spectrum of the networks in a collective view (Fig.9) shows a nearly 254 uniform growing trend where a third degree polynomial may be fitted. However, with respect to 255 individual analysis (local analysis) of ci − k i , a negative trend can be pursued. The spectrum of 12 256 the networks can be related to three-point correlation concept which expresses the probability of 257 selecting a node with a certain degree, so that it is connected to other two nodes with the definite 258 degrees. The evolution of spectrum of aperture networks in a Euclidean space and using a 259 clustering analysis on the accumulated objects has come out the details of the fracture evolution, 260 either in the mechanical or hydro-mechanical analysis [18-19]. But, in our case, detecting such 261 explicit scaling is difficult. Let us transfer all of the calculated network properties in a variation 262 (rate) space (Fig.10). Depicting the clustering coefficient and mean degree rates, shows a similar 263 trend with the evolution of shear strength, however, after 8 mm displacement the variation of 264 edges and clustering coefficient unravels the different fluctuations. 265 The negative scaling (for large anisotropy) in dci dki − space can be expressed by dt dt 266 dki dc ≅ −800 i + 20 . As it can be followed in Figure 10, the congestion of objects makes a dt dt 267 general elliptic which approximately covers all of points where the details of the correlation 268 among two components presents how the expansion and contraction of patterns fall into the final 269 attractors (Fig.10). Thus, such emerged patterns related to the two-point correlation of variation 270 rate of edges and rate of clustering coefficient are proposing a certain core in each time step so 271 that the absorbing of objects within a “black hole” at residual part is much more obvious rather σ( d≺k ) dt 272 than other states. With definition of anisotropy by S = 273 deviation), the rate changes of profiles in a new space and with reference to the pre and post peak 274 behaviours are obtained (Fig.11). Transferring from interlocking step to Coulomb threshold level 275 is accompanying with the maximum anisotropy (Fig.11b) and immediate dropping and then 13 dC ( σ is standard σ( ) dt 276 starting to fluctuate until reaching to a uniform decline. The fluctuation of anisotropy from 2mm 277 to 13 mm may be associated with the stick-slip behaviour of the rock joint as the main reason of 278 shallow earthquakes [57-58]. It should be noticed that the results of the later new space is 279 completely matching with the analysis of joint degree and joint clustering distribution. In Figure 280 11.a, we have illustrated a new variable with regard to durability and entropy of the system, 281 dC d ≺ k × dt dt 282 while initiating the post stick-slip behavior is scaled with the minus or zero variation of the 283 parameter. In [59-61], we analyzed the sub-graph structures and frequencies over parallel and 284 perpendicular aperture networks. Also, a directed network based on contact strings and 285 preferentiality of possible energy flow in rupture tips has been introduced. We also, inspected the 286 synchronization of strings using a Kuromoto model [59]. 287 . In fact with definition of such parameter the fluctuation in anisotropy is filtered 5. Conclusions 288 In this study, we presented a special type of complex aperture network based on 289 correlation measures. The main purpose of the study was to make a connection between the 290 apparent mechanical behavior of a rock joint and the characterized network. The incorporation of 291 the correlation of apertures and the evaluation of continuously changing contact areas (i.e. 292 growth of aperture) within the networks showed the effects of structural complexity on the 293 evolution path of a rock joint. Our results showed that the main characteristics of aperture 294 networks are related to the shear strength behavior of a rock joint. The residual shear strength 295 corresponded to the formation of giant groups of nodes in the networks. In addition, based on the 296 joint correlation upon edges and triangles, the pre-peak and post peak behaviour of a rock joint 297 under shear were analyzed. Our results may be used as an approach to insert the complex 14 298 aperture networks into the surface growth methods or general understanding of the conditions for 299 a sudden movement (shock) in a fault. 300 301 References 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 1. Newman M. E. J. The structure and function of complex networks, SIAM Review 2003; 45(2): 167- 256. 318 319 320 321 322 323 324 325 326 327 328 329 330 6. Baiesi M, Paczuski M. 2004.Scale free networks of earthquakes and aftershocks. Physical review E 2004; 69 (2): 066106.1-066106.8 331 332 333 334 335 336 10. Xie F, Levinson D. Topological evolution of surface transportation networks. Computers, Environment and Urban Systems 33 (2009) 211–223 2. Dorogovetev S.N., Goltsev A.V.2008.Critical phenomena in complex networks .Review Modern Physics.Vol.80.Oct-Dec.2008 3. Boccaletti S.,Latora V., Moreno Y.,Chavez M.,Hwang D-U.2006.Complex Networks : Structure and Dynamics. Physics Reports 424,175-308 4. Abe S, Suzuki N.2006. Geophys;13:145-150 Complex network description of seismicity. Nonlin process 5. Jim´enez A, Tiampo K.F., Posadas A.M., Luz´on F., and Donner R. Analysis of complex networks associated to seismic clusters near the Itoiz reservoir dam. Eur. Phys. J. Special Topics 2009; 174, 181–195. 7. Doering R.C.1991.Modeling Complex Systems: Stochastic processes, Stochastic Differential Equations, and Fokker-Planck Equations; 1990 Lectures in complex systems, SFI Studies in the science of complexity. 8. Ghaffari H.O., Sharifzadeh M Shahriar , K. & Pedrycz W. Application of soft granulation theory to permeability analysis , International Journal of Rock Mechanics and Mining Sciences, Volume 46, Issue 3, 2009, Pages 577-589 9. Tsonis, A. A., and P. J. Roebber. 2003. The architecture of the climate network. Physica, 333A, 497–504. 11. Tsonis, A.A. and Swanson, K. L.2008. Topology and Predictability of El Nin˜o and La Nin˜a Networks. Physical Review Letters 100, 228502 (2008) 15 337 338 339 340 12. Bartolo1 S.D, Dell’Accio F, and Veltri M.2009. Approximations on the Peano river network: Application of the Horton-Strahler hierarchy to the case of low connections, Phys. Rev. E 79, 026108 (2009). 341 342 343 13. Latora V., Marchiori M. 2002, Is the Boston subway a small-world network? Physica A, 314, 109-113. 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 14. Mooney S.J, Dean K. Using complex networks to model 2-D and 3-D soil porous architecture. Soil Sci Soc Am J 73:1094-1100 (2009) 363 364 365 20. Walker D.M, Tordesillas A. Topological evolution in dense granular materials: a complex networks perspective. International Journal of Solids and Structures 47, 2010, 624-639. 366 367 368 21. Albert R., Barabasi A.-L. Statistical mechanics of complex networks. Review of Modern Physics; 74,2002, 47–97. 369 370 371 372 373 374 375 376 377 22. Alkan H. Percolation model for dilatancy-induced permeability of the excavation damaged zone in rock salt, International Journal of Rock Mechanics and Mining Sciences, 46(4), 2009, Pages 716-724. 15. Perez-Reche F, Taraskin S.N, Neri F.M, Gilligan C.A.2009.Biological invasion in soil :complex network analysis . Proceedings of the 16th international conference on Digital Signal Processing, Santorin, Greece .2009. 16. Karabacak T, Guclu H, Yuksel M. Network behaviour in thin film growth dynamics. Phys. Rev. B 79, 195418 (2009) – Published May 15, 2009 17. Valentini L Perugini D, Poli G. The small-world topology of rock fracture networks. Physica A 2007; 377:323–328. 18. Ghaffari H.O., Sharifzadeh M. & Fall M. Analysis of Aperture Evolution in a Rock Joint Using a Complex Network Approach; International Journal of Rock Mechanics and Mining Sciences, Volume 47, Issue 1, January 2010, Pages 17-29. 19. Ghaffari H.O., Sharifzadeh M. http://aps.arxiv.org/abs/0901.4413 .,Evgin E; Complex Aperture Networks. 23. Adler MP and Thovert JF. Fractures and fracture networks. Kluwer Academic; 1999. 24. Alava M. J , Nukala P.K. V. V.; Zapperi S, Statistical models of fracture , Advances in Physics, Volume 55, Issue 3 , 2006 , pages 349 – 476. 16 378 379 380 25. Knopoff, L. The organization of seismicity on fault networks, PNAS April 30, 1996 vol. 93 no. 9 3830-3837. 381 382 383 26. R.W. Zimmerman, D.W. Chen and N.G.W. Cook, The effect of contact area on the permeability of fractures, J Hydrol 139 (1992), pp. 79–96. 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 27. Lanaro F.A. Random field model for surface roughness and aperture of rock fractures. Int J Rock Mech Min Sci, 2000, 37:1195-1210. 399 32. Wilson RJ. Introduction to Graph Theory. Fourth Edition: Prentice Hall, Harlow, 1996. 400 401 402 403 404 405 406 407 33. Gao Z. and Jin N. Flow-pattern identification and nonlinear dynamics of gas-liquid twophase flow in complex networks; 2009.Physical Review E 79, 066303. 408 409 410 36. Colizza, V., Flammini, A., Serrano, M.A., Vespignani, A. Detecting rich-club ordering in complex networks, Nature Physics 2, Issue 2, 2006, Pages 110-115 . 411 412 413 37. Song C, Havlin S, Makse HA., Origins of fractality in the growth of complex networks, Nature Physics 2, 275 - 281 (2006), pages 275-281. 414 415 416 38. Kim JS, Goh KI, Salvi G, Oh E, Kahng B, Kim D, Fractality in complex networks: Critical and supercritical skeletons, Phys. Rev. E 75, 016110 (2007). 28. Brown SR, Kranz RL , Bonner BP. Correlation between the surfaces of natural rock joints, Geophys Res Lett, 1986; 13(13):1430-1433. 29. Hakami E, Einstein H H,Genitier S , Iwano M. Characterization of fracture aperturesmethods and parameters. In: Proc of the 8th Int Congr on Rock Mech, Tokyo, 1995: 751-754. 30. Lanaro F, Stephansson O.A. Unified model for characterization and mechanical behavior of rock fractures. Pure Appl Geophys,2003;160:989-998 31. Ghaffari H. O, Complexity Analysis of Unsaturated Flow in Heterogeneous Media Using a Complex Network Approach, http://arxiv.org/ftp/arxiv/papers/0912/0912.4991.pdf 34. Newman M.E.J. Assortative mixing in networks. Phys. Rev. Lett. 89, 208701 (2002). 35. R. Xulvi-Brunet and I.M. Sokolov. Changing correlations in networks: assortativity and dissortativity. Acta Phys. Pol. B, 36, 1431 (2005). 17 417 418 419 420 39. Korniss G, Synchronization in weighted uncorrelated complex networks in a noisy environment: Optimization and connections with transport efficiency, Phys. Rev. E 75, 051121 (2007). 421 422 423 40. Dijkstra EW, A note on two problems in connexion with graphs, Numerische mathematik, 1959 ,pp. 269-271.Springer 424 425 426 41. Newman M., Barabasi A-L., Watts D.J.The Structure and Dynamics of Networks.2006. Princeton University Press 427 428 429 42. Watts DJ, Strogatz SH. Collective dynamics of small-world networks. Nature ,1998; 393:440-442 430 431 432 433 43. Mitani, Y., Esaki, T., Zhou, G., Nakashima, Y. Experiments and simulation of Shear – Flow Coupling properties of rock joint. In: Proc., 39th Rock mechanics conference: Glückauf, Essen, (2003), 1459–1464. 434 435 436 437 44. Mitani, Y., Esaki, T., Sharifzadeh, M., Vallier, F. Shear – Flow coupling properties of rock joint and its modeling Geographical Information System (GIS). In: Proc., 10th ISRM Conference, South African Institute of Mining and Metallurgy, (2003), 829–832. 438 439 440 441 442 443 444 45. Sharifzadeh M. Experimental and theoretical research on hydro-mechanical coupling properties of rock joint. Ph.D. thesis, Kyushu University, Japan; 2005. 445 446 447 448 449 47. L. Valentini, D. Perugini and G. Poli, The ‘small-world’ nature of fracture/conduit networks:next term Possible implications for disequilibrium transport of magmas beneath mid-ocean ridges, Journal of Volcanology and Geothermal Research 159 (2007), pp. 355– 365. 450 451 48. Gnecco, Enrico; Meyer, Ernst, Fundamentals of Friction and Wear, 2007, Springer, 714 p. 452 453 454 49. Rubinstein, S., Cohen, G. & Fineberg, J. Contact area measurements reveal loading-history dependence of static friction. Phys. Rev. Lett. 96, 256103 (2006) 46. Sharifzadeh M, Mitani Y, Esaki T .Rock joint surfaces measurement and analysis of aperture distribution under different normal and shear loading using GIS, Rock Mechanics and Rock Engineering, Volume 41, Number 2 / April, 2008, Pages 299-323. 18 455 456 457 50. Xia, K., Rosakis, A. J. & Kanamori, H. Laboratory earthquakes: the sub-Raleigh-tosupershear rupture transition. Science 303, 1859–1861 (2004) 458 459 460 51. Rubinstein, S. M., Cohen, G. & Fineberg, J. Detachment fronts and the onset of dynamic friction. Nature 430, 1005–1009 (2004) 461 462 463 464 52. S. M. Rubinstein, G. Cohen, and J. Fineberg, Visualizing Stick-Slip: Experimental observations of processes governing the nucleation of frictional sliding, J. Phys. D: Appl. Phys. 42 214016, (2009). 465 466 467 53. Sornette D, Critical Phenomena in Natural Sciences, Springer-Verlag Berlin Heidelberg, 2006. 468 469 470 54. Arenas A., Diaz-Guilera A., Kurths J., Moreno Y., Zhou C. Synchronization in complex networks .Physics Reports ,2008, 469,93-153. 471 472 473 474 475 55. Strogatz,S.H. Exploring complex networks, Nature. 2001; Vol .410:268-276. 476 477 478 57. Brace WF, Byerlee JD, Stick-slip as a mechanism for earthquakes, Science, Volume 153, Issue 3739, pp. 990-992. 479 480 58. Scholz CH, Earthquakes and friction laws, Nature, 391, 37-42 (1998). 481 482 59. H.O.Ghaffari and R.P.Young, ArXive-prints (2011) http://arxiv.org/abs/1105.4265. 483 484 60. H.O.Ghaffari, A.Nabovati, M. Sharifzadeh, and R.P.Young, http://arxiv.org/abs/1103.1124. 485 486 61. H.O.Ghaffari and R.P.Young, Motifs of Networks from Shear Fractures; submitted to Journal 56. Barahona M, and Pecora L. M. Synchronization in Small-World Systems, Phys. Rev. Lett. 89, 054101 (2002) 487 488 489 19 490 491 492 493 494 495 496 497 498 Figures 499 20 case1 case3 case5 case6 8 7 SS(MPa) 6 5 4 3 2 1 0 0 500 2 4 6 8 10 12 14 16 18 20 SD(mm) 501 FIGURE 1. Variation of shear strength for different cases (normal stresses for 502 case1:1mpa, case3: 3 MPa, case5: 5 MPa and case6: 3 MPa (without control of upper 503 shear box) [46]. 504 505 506 507 508 21 509 510 FIGURE 2. Evolution of correlation values of aperture profiles at shear displacement s: 511 0,2,10 and 20 mm. 512 22 900 800 SD=0 800 700 700 600 600 600 500 500 500 400 400 400 300 300 300 200 200 200 100 800 200 300 400 500 600 700 800 900 1 SD=4 0.8 0.6 100 100 0.4 0.2 100 100 200 300 400 500 600 700 800 100 200 300 400 500 600 700 800 0 800 SD=5 800 700 SD=10 700 -0.2 SD=20 700 600 600 -0.4 600 500 500 500 400 200 100 200 513 400 600 -0.6 400 400 300 514 800 SD=2 700 300 300 200 200 100 100 -0.8 -1 800 200 400 600 800 200 400 600 800 FIGURE 3. Correlation patterns throughout the shear displacements 900 800 800 SD=0 800 SD=2 700 700 700 600 600 600 500 500 500 400 400 400 300 300 300 200 200 200 100 100 100 200 400 600 0.9 100 800 1 SD=5 200 300 400 500 600 700 800 0.8 0.7 0.6 100 200 300 400 500 600 700 800 0.5 800 800 700 800 SD=10 700 600 515 516 SD=15 700 500 500 500 400 400 400 300 300 300 200 200 200 100 100 100 200 300 400 500 600 700 800 0.3 600 600 100 0.4 SD=20 0.2 0.1 0 100 200 300 400 500 600 700 800 100 200 FIGURE 4. Visualization of adjacency matrix for the achieved networks 23 300 400 500 600 700 800 0 K C 0.7 11 a) 0.65 <l > 4 x 10 2.25 b) 10 c) 2.2 2.15 9 0.6 mean geodesic distance 2.1 8 K C 0.55 7 0.5 6 2.05 2 1.95 1.9 0.45 5 1.85 0.4 0.35 517 4 0 2 4 6 8 10 SD(mm) 12 14 16 18 3 20 1.8 1.75 0 2 4 6 8 10 SD(mm) 12 14 16 18 20 0 2 4 6 8 10 SD(mm) 12 14 518 FIGURE 5. a) Clustering coefficient-Shear Displacement (SD), b) Number of edges-SD 519 and c) Average path length-SD ρ ( ki , k j ) SD=0mm SD=1mm 250 20 18 250 16 200 12 150 150 12 10 16 150 12 10 10 100 8 100 8 6 6 200 16 150 12 50 4 50 4 150 12 10 10 100 8 100 8 200 6 50 4 50 4 50 6 50 4 2 2 Number of Bins(kj) 14 12 100 8 2 2 4 6 8 10 12 14 16 18 20 2 2 0 2 4 6 8 10 12 14 16 18 0 20 2 4 6 8 SD=8mm SD=7mm 250 20 10 12 14 16 18 0 20 2 2 4 6 8 10 12 14 16 18 0 20 5 SD=9 250 20 250 20 200 16 200 16 150 12 150 12 150 10 10 100 8 100 8 6 100 8 14 12 10 SD=14mm 15 20 0 SD=15mm 10 5 250 15 20 0 5 10 SD=16mm 250 20 15 20 100 8 50 4 4 6 8 10 12 14 16 18 20 250 20 200 16 200 16 18 150 12 150 12 14 250 20 100 8 6 50 4 50 4 5 10 15 20 0 2 4 6 8 10 12 14 16 18 20 0 250 200 150 150 10 SD=18mm 15 6 18 10 SD=19mm 15 0 20 10 15 0 20 SD=20mm 250 20 200 16 18 200 16 14 150 5 250 20 18 200 150 12 50 14 150 12 10 100 2 5 250 50 4 0 20 100 8 50 2 150 10 100 8 100 8 10 100 8 100 8 6 6 6 6 6 10 15 20 50 2 5 0 5 10 15 20 0 50 4 2 2 5 4 50 4 2 50 4 50 4 2 2 SD=13mm 10 100 4 12 100 8 6 12 6 5 10 0 20 14 150 8 14 12 10 15 18 200 16 50 4 16 150 12 100 8 10 250 20 200 16 14 10 10 8 20 18 200 16 14 14 20 12 0 SD=17 18 18 18 10 2 2 0 16 100 2 2 5 14 14 150 150 12 2 20 12 16 6 50 4 10 20 6 50 4 8 18 200 10 6 6 50 4 6 SD=12mm 250 16 10 10 4 5 18 14 12 2 0 20 200 16 14 14 14 15 2 0 250 18 200 16 10 SD=11mm 20 SD=10mm 20 18 18 18 2 520 200 16 150 6 4 250 18 16 50 4 250 20 200 14 10 100 8 6 6 250 20 18 14 100 8 SD=6mm SD=5mm 250 20 18 200 14 14 12 10 200 16 14 150 250 20 18 18 16 14 250 20 18 SD=4mm SD=3mm SD=2mm 20 200 10 15 20 0 2 5 10 15 20 0 2 4 6 8 10 12 14 16 18 20 0 Number of Bins(ki) 521 FIGURE 6. Joint degree distribution from SD=0 to SD=20 mm (Top left-first row is 522 SD=0 and Top right -first row is 6mm shear slip ) 24 0 16 18 20 ρ (ki + k j / 2) SD=1mm SD=0mm SD=2mm 350 500 SD=3mm 450 450 700 400 300 600 400 350 250 350 500 300 300 200 400 250 250 200 150 300 200 150 100 150 200 100 100 50 0 100 50 50 0 50 100 150 200 250 0 20 40 60 80 100 SD=4mm 140 160 180 200 220 0 0 50 100 SD=10mm 700 1400 600 1200 500 1000 400 150 200 250 0 0 50 100 SD=15mm 150 200 250 300 300 350 400 SD=20mm 1200 1200 1000 1000 800 800 600 600 400 400 800 300 600 200 400 100 200 0 50 120 100 150 200 250 300 0 100 200 150 200 250 300 350 0 100 200 150 200 250 300 350 400 0 100 150 200 250 (ki)+(ki)/2 523 524 FIGURE 7. Attributed weight distribution of links related to joint degree distribution 525 (for SD=0-4,10,15 and 20 mm) 25 ρ (ci , c j ) 500 SD=0mm SD=1mm SD=4mm SD=3mm SD=2mm SD=5mm 20 20 20 20 20 20 18 18 18 18 18 18 18 16 16 16 16 16 16 14 14 14 14 14 14 12 12 12 12 12 10 10 10 10 10 8 8 8 8 6 6 6 6 4 4 4 4 2 2 2 2 16 14 12 10 450 SD=6mm 20 8 6 4 2 2 4 6 8 10 12 14 16 18 20 2 600 4 6 8 10 12 14 16 18 20 2 4 6 8 10 12 14 16 18 20 2 4 6 8 10 12 14 16 18 12 10 8 8 6 6 4 4 2 2 20 4 6 8 10 12 14 16 18 2 20 2 600 700 600 700 4 6 8 10 12 14 16 18 20 2 800 4 6 8 10 12 14 16 18 20 900 400 600 500 500 500 500 400 400 400 300 300 200 200 700 600 500 400 400 300 300 800 600 700 500 600 400 500 300 200 200 400 300 200 350 100 100 0 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0 0.2 0.65 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 300 200 100 100 200 100 100 0.65 0 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 100 0 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0 0.4 SD=7mm SD=8mm 20 20 18 300 12 10 8 6 250 10 12 14 16 18 18 16 16 16 14 14 14 12 12 10 10 8 8 6 6 4 4 2 2 10 8 8 8 6 6 6 4 4 2 2 2 4 6 8 10 12 14 16 18 12 10 900 700 800 6 8 10 12 14 16 18 20 2 1000 4 6 8 10 12 14 16 18 1200 600 14 16 18 8 6 4 20 2 4 6 8 10 12 14 16 18 2 20 2 1200 300 0.45 0.5 0.55 800 800 600 600 400 400 0.6 0.65 0.7 0.75 0.5 0.55 0.6 200 200 0.65 0.7 0.75 0.8 SD=15mm 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 300 0.5 0.55 0.6 0.65 0.7 0 0.45 0.75 0.5 0.55 0.6 0.65 SD=18mm 0.7 0.75 0 0.45 0.8 SD=19mm 16 16 14 14 12 12 10 10 10 8 6 4 2 2 4 6 8 10 12 14 16 18 20 20 18 18 18 0.55 0.6 16 16 16 14 14 14 12 12 12 12 10 10 10 10 8 8 8 6 6 6 6 6 6 4 4 4 4 4 2 2 2 2 2 2 4 6 8 10 12 SD=15mm 14 16 18 20 2000 1800 1800 1600 6 8 10 12 14 16 18 20 2 4 6 8 10 12 14 16 18 20 2 1600 1200 1400 1600 600 0.65 0.7 0.75 0.8 0.85 0.9 12 14 16 18 20 4 2 2 1400 1400 1200 1200 4 6 8 10 12 14 16 18 20 2 4 6 8 10 12 14 16 18 20 0.85 0.9 0.95 1800 1600 1000 1000 800 800 1000 600 600 800 400 400 200 200 1200 600 600 600 400 0.6 10 800 800 800 0.55 8 1000 1000 1000 400 400 400 200 200 200 0 0.45 6 1400 1200 1200 200 4 1200 800 600 0.8 1400 1400 1000 0.75 14 8 4 0.7 16 8 2 0.65 18 8 20 1400 0 0.5 0.5 20 20 18 12 20 SD=20mm 20 14 18 200 0 0.45 0.8 SD=17mm 18 16 16 100 0 0.45 20 18 14 400 SD=16mm 20 12 500 400 100 SD=14mm 10 700 600 200 0 0.45 8 800 200 100 6 1000 600 400 200 4 1000 800 500 300 0 0.4 526 12 1000 200 0 10 1000 400 300 100 50 8 700 400 0.75 900 500 100 6 1200 600 150 4 900 500 0.7 10 20 1400 700 200 0.65 12 2 4 800 600 0.6 SD=13mm 14 20 2 800 0.55 16 12 20 0.5 18 14 2 8 18 10 4 6 18 12 2 4 20 14 4 2 20 20 16 16 14 0.45 SD=12mm 20 18 18 16 SD=11mm SD=10mm 20 400 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0 0.9 0.5 200 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0 0.90.5 0.55 0.6 0.65 0.7 0.75 0.8 527 FIGURE 8. Joint clustering coefficient distribution plus attributed weight histograms 528 based on averages of triangles connected to a link (sequence of figures are as well as 529 figure 6). 530 531 26 140 ≺ K data1 -0.1 10 data2 a) 3 data3 data4 120 2 y = - 5.2e+003*x + 7.6e+003*x - 3.3e+003*x + 4.9e+002 data fit data5 -0.2 b) data6 10 data7 data8 100 data9 data10 -0.3 10 data11 1/N*<K> ci data12 ci data13 data14 -0.4 10 data15 80 data16 data17 60 data18 -0.5 10 data19 data20 40 -0.6 10 ki -0.7 10 532 1 20 0.35 2 10 C 0.4 0.45 0.5 10 ki 0.55 0.6 0.65 <C> 3 10 533 FIGURE 9. a) Spectrum of complex aperture networks ( ci - ki )and b) Evolution of mean 534 degree of node against clustering coefficient and fitness of a polynomial function 535 536 120 100 80 dki dt data1 data2 data3 data4 data5 data6 data7 data8 data9 data10 data11 data12 data13 data14 data15 data16 data17 data18 data19 data20 60 i dk /dt 40 20 0 -20 -40 -60 -80 -0.15 -0.1 -0.05 0 0.05 dc i/dt 537 0.1 dci dt 0.15 0.2 dki dci − space with respect to shear displacements dt dt 538 FIGURE 10. Data accumulation in 539 (data1to data 20 are related to shear displacements from 0 to20 mm ). 27 0.7 540 dC d ≺ k × dt dt S= 0.9 σ( d≺k dt ) σ( 560 a) 0.8 dC ) dt b) 540 0.7 520 0.6 STD(dk/dt)/STD(dc/dt) 500 d < k > /d t*d c /d t 0.5 0.4 0.3 480 460 440 0.2 420 0.1 400 0 -0.1 541 380 0 1 2 3 4 5 6 7 8 9 10 SD(mm) 11 12 13 14 15 16 17 18 19 20 0 sd (m m ) 1 2 3 4 5 6 7 8 9 10 11 SD(mm) 12 13 14 15 16 17 sd (m m ) dC d < k > × with shear displacements and b) Anisotropy dt dt 542 FIGURE 11.a) Variation of 543 evolution at the rate of spectrum (networks) space 544 28 18 19 20
5cs.CE
arXiv:1610.08464v1 [math.GR] 26 Oct 2016 Mapping class groups are not linear in positive characteristic J. O. Button Abstract For Σ an orientable surface of finite topological type having genus at least 3 (possibly closed or possibly with any number of punctures or boundary components), we show that the mapping class group M od(Σ) has no faithful linear representation in any dimension over any field of positive characteristic. 1 Introduction A common question to ask of a given infinite finitely generated group is whether it is linear. For instance consider the braid groups Bn , the automorphism group Aut(Fn ) of the free group Fn and the mapping class group Mod(Σg ) of the closed orientable surface Σg with genus g. Linearity in the first case was open for a while but is now known to hold by [1], [8]. For n ≥ 3 [5] showed that Aut(Fn ) is not linear, whereas for g ≥ 3 the third case is open. However whereas the definition of linearity is that a group embeds in GL(d, F) for some d ∈ N and some field F, in practice one tends to concentrate on the case where F = C. In fact a finitely generated group embeds in C if and only if it embeds in some field of characteristic zero, so it is enough to restrict to this case if only characteristic zero representations are being considered. However we can still ask about faithful linear representations in positive characteristic. For instance in the three examples above, it is unknown for n ≥ 4 if the braid group Bn admits a faithful linear representation in any dimension over any field of positive characteristic. For Aut(Fn ) with n ≥ 3, the proof in [5] applies to any field, not just the characteristic zero case, so that there are also no faithful representations in positive characteristic. 1 2 PROOF 2 As for mapping class groups, we show here that there are no faithful linear representations of Mod(Σg ) in any dimension over any field of positive characteristic when Σg is an orientable surface of finite topological type having genus g at least 3 (which might be closed or might have any number of punctures or boundary components). The idea comes from considering the analogy between a finitely generated group being linear in positive characteristic and having a “nice” geometric action, as we did in [4] when showing that Gersten’s free by cyclic group has no faithful linear representation in any positive characteristic. On looking more closely to see which definition of “nice” aligns most closely with linearity in positive characteristic, we were struck by the similarities between that and the notion of a finitely generated group acting properly and semisimply (more so than properly and cocompactly) on a complete CAT(0) space. In [3] Bridson shows that for all the surfaces Σg mentioned above, the mapping class group Mod(Σg ) does not admit such an action. This result is first credited to [6] but the proof in [3] consists of finding an obstruction to the existence of such an action by any one of these groups. This obstruction involves taking an element of infinite order and its centraliser in said group, then applying a condition on the abelianisation of this centraliser. Here we show that this condition holds verbatim for groups which are linear in positive characteristic, thus obtaining the same obstruction. We leave open the question of whether the mapping class group of the closed orientable surface of genus 2 is linear in positive characteristic, but we note that it was shown in [2] and [7] using the braid group results that this group is linear in characteristic zero anyway. 2 Proof The following is the crucial point which distinguishes our treatment of linear groups in positive characteristic from the classical case. Proposition 1 If F is an algebraically closed field of positive characteristic and d ∈ N then there exists K ∈ N such that for all elements g ∈ GL(d, F) the matrix g K is diagonalisable. Proof. If F has characteristic p then we take K to be any power of p which is at least d. 2 PROOF 3 We put g into Jordan normal form, or indeed any form where the matrix splits up into blocks corresponding to the generalised eigenspaces of g and such that we are upper triangular in each block. Then on taking the eigenvalue λ ∈ F of g, the block of g corresponding to λ will be of the form λI + N where N is upper triangular with all zeros on the diagonal so that     K K K−1 K K λN K−1 + N K . λ N + ...+ (λI + N) = λ I + K−1 1  But N K = 0 because K ≥ d and Ki ≡ 0 modulo p for 0 < i < K as K is a power of p. Thus in this block we have that g K is equal to λK I. But we can do this in each block, making g K a diagonal matrix. ✷ As for the mapping class group Mod(Σ) of the surface Σ, we have: Proposition 2 ([3] Proposition 4.2) If Σ is an orientable surface of finite type having genus at least 3 (with any number of boundary components and punctures) and if T is the Dehn twist about any simple closed curve in Σ then the abelianisation of the centraliser in Mod(Σ) of T is finite. This is in contrast to: Theorem 3 Suppose that G is a linear group over a field of positive characteristic and CG (g) is the centraliser in G of the infinite order element g. Then the image of g in the abelianisation of CG (g) also has infinite order. Proof. As the abelianisation is the universal abelian quotient of a group, it is enough to find some homomorphism of CG (g) to an abelian group where g maps to an element of infinite order, so we use the determinant. We first replace our field by its algebraic closure. Then Proposition 1 tells us that we have the diagonalisable element g K , whereupon showing that g K has infinite order in the abelianisation of CG (g) (which could of course be smaller than the centraliser in G of g K ) will establish the same for g. Take a basis so that g K is actually diagonal and group together repeated eigenvalues, so that we have   λ1 Id1 0   .. . gK =  .   λk Idk 0 REFERENCES 4 This means that any element in CG (g K ), and thus also in CG (g), is of the form   A1 0   ..   . 0 Ak with the same block structure. Consequently we have as homomorphisms from CG (g) to the multiplicative abelian group (F∗ , ×) not just the determinant itself but also the “subdeterminant” functions det1 , . . . , detk . Here for h ∈ CG (g) we define deti (h) as the determinant of the ith block of h when expressed with respect to our basis above which diagonalises g K , and this is indeed a homomorphism. Now it could be that deti (g K ) has finite order, which implies that λdi i and thus also λi has finite multiplicative order in F∗ . However if this is true for all i = 1, 2, . . . , k then λ1 , . . . , λk all have finite order. This means that g K and so g does too, which is a contradiction. Thus for some i we know g K and g map to elements of infinite order in the abelian group (F∗ , ×) under the homomorphism deti . ✷ Corollary 4 If Σ is an orientable surface of finite type having genus at least 3 (with any number of boundary components and punctures) then Mod(Σ) is not linear over any field of positive characteristic. Proof. We can combine Proposition 2 and Theorem 3 to get a contradiction because Dehn twists have infinite order. ✷ References [1] S. J. Bigelow, Braid groups are linear, J. Amer. Math. Soc. 14 (2001) 471–486. [2] S. J. Bigelow and R. D. Budney, The mapping class group of a genus two surface is linear, Algebr. Geom. Topol. 1 (2001) 699-708. REFERENCES 5 [3] M. R. Bridson, Semisimple actions of mapping class groups on CAT(0) spaces, Geometry of Riemann surfaces, 1–14, London Math. Soc. Lecture Note Ser., 368, Cambridge Univ. Press, Cambridge, 2010. [4] J. O. Button, Minimal dimension faithful linear representations of common finitely presented groups, http://arxiv.org/1610.03712 [5] E. Formanek and C. Procesi, The automorphism group of a free group is not linear, J. Algebra 149 (1992) 494–499. [6] M. Kapovich and B. Leeb, Actions of discrete groups on nonpositively curved spaces, Math. Ann. 306 (1996) 341–352. [7] M. Korkmaz, On the linearity of certain mapping class groups, Turkish J. Math. 24 (2000) 367-371. [8] D. Krammer, Braid groups are linear, Ann. of Math. 155 (2002) 131-156. Selwyn College, University of Cambridge, Cambridge CB3 9DQ, UK E-mail address: j.o.button@dpmms.cam.ac.uk
4math.GR
PACKING CIRCLES WITHIN CIRCULAR CONTAINERS: A NEW HEURISTIC ALGORITHM FOR THE BALANCE CONSTRAINTS CASE Washington Alves de Oliveira1∗ , Luiz Leduino de Salles Neto2 , Antonio Carlos Moretti1 and Ednei Felix Reis3 *Corresponding author de Ciências Aplicadas, Universidade Estadual de Campinas, 13484-350 Limeira, SP, Brazil 2 Instituto de Ciência e Tecnologia, Universidade Federal de São Paulo, 12247-014 São José dos Campos, SP, Brazil 3 Departamento de Matemática, Universidade Tecnológica Federal do Paraná, 84016-210 Ponta Grossa, PR, Brazil E-mails: washington.oliveira@fca.unicamp.br [Oliveira] / luiz.leduino@unifesp.br [Salles Neto] / moretti@ime.unicamp.br [Moretti] / edneif@utfpr.edu.br [Reis] 1 Faculdade ABSTRACT. In this work we propose a heuristic algorithm for the layout optimization for disks installed in a rotating circular container. This is a unequal circle packing problem with additional balance constraints. It proved to be an NP-hard problem, which justifies heuristics methods for its resolution in larger instances. The main feature of our heuristic is based on the selection of the next circle to be placed inside the container according to the position of the system’s center of mass. Our approach has been tested on a series of instances up to 55 circles and compared with the literature. Computational results show good performance in terms of solution quality and computational time for the proposed algorithm. Keywords: Packing problem, Layout optimization problem, Nonidentical circles, Heuristic algorithm 1 Introduction We study how to install unequal disks in a rotating circular container, which is an adaptation of the model for the two-dimensional (2D) unequal circle packing problem with balance behavioral constraints. This problem arises in some engineering applications: development of satellites and rockets, multiple spindle box, rotating structure and so on. The low cost and high performance of the equipment require the best internal configuration among different geometric devices. This problem is known as layout optimization problem (LOP), and consists in placing a set of circles in a circular container of minimum envelopment radius without overlap and with minimum imbalance. Each circle is characterized by its radius and mass. There, the original threedimensional (3D) case (the equipment must rotate around its own axis) is simplified: different two-dimensional circles (see, Figure 1(c)) represent three-dimensional cylindrical objects to be placed inside the circular container. Figure 1 illustrates the physical problem. Figure 1(a) shows a rotating cylindrical container. The symbol ω and the arrow illustrate the rotation around the axis of the equipment, ω is the angular velocity. In another viewpoint, Figure 1(b) shows the interior of the equipment where distinct 1 circular devices need to be placed. In this example, six cylinders are placed, in which the radii, masses and heights are not necessarily equal. Research on packing circles into a circular container has been documented and used to obtain good solutions. Heuristic, metaheuristic and hybrid methods are used in most of them. There are only a few publications discussing the disk problems with balance constraints. LOP is a combinatorial problem and has been proved to be NP-hard (Lenstra & Rinnooy Kan 1979). This problem was first proposed by Teng et al. (1994), where a mathematical model and a series of intuitive algorithms combining the method of constructing the initial objects topomodels with the model-changing iteration method are described, and the validity of the proposed algorithms is verified by numerical examples. Tang & Teng (1999) presented a modified genetic algorithm called decimal coded adaptive genetic algorithm to solve the LOP. Xu et al. (2007) developed a version of genetic algorithm called order-based positioning technique, which finds the best ordering for placing the circles in the container, and compare it with two existing natureinspired methods. Qian et al. (2001) extended the work (Tang & Teng 1999) by introducing a genetic algorithm based on human-computer intervention, in which a human expert examines the best solution obtained through the loops of many generations and designs new solutions. Methods based on particle swarm optimization (PSO) have been applied to the LOP. Li et al. (2004) developed a PSO method based-mutation operator. This approach can escape from the local minima, maintaining the characteristic of fast speed of convergence. Zhou et al. (2005) proposed a hybrid approach based on constraint handling strategy suit for PSO, where improvement is made by using direct search to increase the local search ability of the algorithm. Xiao et al. (2007) presented two nature-inspired approaches based on gradient search, the first hybrid with simulated annealing (SA) method and the second hybrid with PSO method. Lei (2009) presented an adaptive PSO with a better search performance, which employs multi-adaptive strategies to plan large-scale space global search and refined local search to obtain global optimum. Huang & Chen (2006) proposed an improved version of the quasi-physical quasi-human algorithm proposed by Wang et al. (2002) for solving the disk packing problem with equilibrium constraints. An efficient strategy of accelerating the search process is introduced in the steepest descends method to shorten the execution time. In Liu & Li (2010) the LOP is converted into an unconstrained optimization problem which is solved by the basin filling algorithm presented by them, together with the improved energy landscape paving method, the gradient method based on local search and the heuristic configuration update mechanism. Liu et al. (2010) presented a simulated annealing heuristic for solving the LOP by incorporating the neighborhood search mechanism and the adaptive gradient method. The neighborhood search mechanism avoids the disadvantage of blind search in the simulated annealing algorithm, and the adaptive gradient method is used to speed up the search for the best solution. Liu et al. (2011) developed a tabu search algorithm for solving the LOP. The algorithm begins with a random initial configuration and applies the gradient method with an adaptive step length to search for the minimum energy configuration. He et al. (2013) proposed a hybrid approach based on coarse-to-fine quasiphysical optimization method, where improvement is made by adapting the quasi-physical descent and the tabu search procedures. The algorithm approach takes into account the diversity of the search space to facilitate the global search, and it also does fine search to find the corresponding best solution in a promising local area. Liu et al. (2015) presented a heuristic based on energy landscape paving. The LOP is converted into the unconstrained optimization problem by 2 using quasi-physical strategy and penalty function method. Subsequently, the heuristic approach combines a new updating mechanism of the histogram function in an improved energy landscape paving, and a local search for solving the LOP. In this paper, we propose a new heuristic to solve the LOP. The basic idea of our approach, called center-of-mass-based placing technique (CMPT), is to place each circle according to the current position of the center of mass of the system. Results for a selected set of instances are found in Huang & Chen (2006), Xiao et al. (2007), Lei (2009), Liu & Li (2010), Liu et al. (2010, 2011, 2015) and He et al. (2013). To validate our approach, we compare the results of our heuristic with these instances. Computational results show good performance in terms of solution quality and computational time. The paper is organized as follows. Section 2 presents a formal definition of the unequal circle packing problem with balance constraints, and some definitions are established. Section 3 describes our heuristic. In Section 4, we present and analyze the experimental results, and Section 5 concludes the paper. 2 Problem formulation We consider the following layout optimization for the disks installed in a rotating circular container: given a set of circles (not necessarily equal), find the minimal radius of a circular container in which all circles can be packed without overlap, and the shift of the dynamic equilibrium of the system should be minimized. The decision problem is stated as follows. Consider a circular container of radius r, a set of n circles i of radii ri and mass mi , i ∈ N = {1, . . . , n}. Let (x, y)T be the coordinates of the container center, and (xi , yi )T the center coordinates of the circle i. Let f1 (z) = r be the first objective function, and � �2 � �2 �� n � n f2 (z) = � ∑ mi ω2 (xi − x) + ∑ mi ω2 (yi − y) i=1 i=1 the second objective function, which measures the shift in the dynamic equilibrium of the system caused by the rotation of the container. Without loss ω (a) 6 r3 3 5 1 � (c) 2 r 7 (b) 4 Figure 1: Circular devices inside a rotating circular container and a feasible solution 3 of generality, we can consider ω = 1. The problem is to determine if there exists a (2n + 3)dimensional vector z = (r, x, y, x1 , y1 , x2 , y2 , . . . , xn , yn )T that satisfies the following mathematical formulation. (LOP) Minimize subject to r � max 1�i�n � f (z) = λ f1 (z) + β f2 (z) ri + � � (xi − x)2 + (yi − y)2 , (xi − x j )2 + (yi − y j )2 � (ri + r j )2 , i �= j ∈ N, z∈R 2n+3 (1) (2) , where λ, β ∈ (0, 1) are a pair of preset weights, λ + β = 1. Constraint (1) states that circle i placed inside the container should not extend outside the container, while constraints (2) require that two any circles placed inside the container do not overlap each other. Figure 1(c) illustrates a typical feasible solution to the LOP. The circles are numbered from 1 to 7, r3 is the radius of the circle 3, there is no overlap between the circles and the seven circles are completely placed into the larger circle of radius r (radius of the container). 2.1 Definitions We develop a constructive heuristic guided by a simple strategy. A suboptimal solution is reached after gradually placing a circle at a time inside the container. Each circle is placed in an Euclidean coordinates system on the following evaluation criteria: select as the new position of the circle according to the current center of mass of the system without overlapping with the circles placed earlier; attempt to fill the wasted spaces after placing this circle; and in the end, select as the new coordinates of the container center that completely eliminate the dynamic imbalance of the system. To perform the above criteria we need some notations and definitions. �We denote by X(i) = (xi , yi )T the center coordinates of the circle i, by d(i, j) = d(X(i), X( j)) = (xi − x j )2 + (yi − y j )2 the Euclidean distance between the center coordinates of the circles i and j, and by Γ(i, j) = {(1 − λ)X(i) + λX( j) : 0 � λ � 1} the set of points on the line segment whose endpoints are X(i) and X( j). Figure 2(a) illustrates the set Γ(10, 12). Definition 1. (Contact Pair) If d(i, j) = ri + r j , we say that {i, j} is a Contact Pair of circles. Definition 2. (Layout) A partial Layout, denoted by L, is a partial pattern (layout) formed by a subset of the m � 2 of the circle centers, which have already been placed inside the container without overlap. Assume in addition that the container itself is in L. If m = n, then L is a complete layout (or solution). Figure 2(b) illustrates a partial Layout formed by 16 circles placed inside the container. Among others, {5, 9} and {8, 15} are Contact Pairs. Definition 3. (Placed Cyclic Order) Let C = i1 i2 · · · it−1 it , i p ∈ N, p = 1, . . . ,t, be a cyclic order of circles, which have already been placed inside the container without overlap. In addition, 4 the intersection of any two sets Γ(i p1 , iq1 ) and Γ(i p2 , iq2 ) have at most one endpoint in common, p1 , p2 , q1 , q2 ∈ {1, . . . ,t}. We say that C is a Placed Cyclic Order. Definition 4. (Contact Cyclic Order) Let C be a Placed Cyclic Order. If the circles are two by two Contact Pairs in C, we say that C is a Contact Cyclic Order. Given a C = i1 i2 · · · i p−1 i p i p+1 · · · it−1 it , we say that the circles i1 , i2 , · · · , i p−1 are in counterclockwise order in relation to circle i p and the circles i p+1 , · · · , it−1 it are in clockwise order in relation to circle i p . Definition 5. (Main Area) Let C be a Placed Cyclic Order. We say that the area bounded by the union of the line segments Γ(i p , iq ), where i p , iq are in C, is the Main Area of C, which is denoted by A(C). Figure 2(a) illustrates a Contact Cyclic Order C̄ formed by 12 circles placed inside the container. Note that all {i, j} in C̄ are two by two Contact Pairs. In Figure 2(b), in addition to C̄, it is illustrated a Contact Cyclic Order C formed by 4 circles. Note that all circles in C (dashed lines) are completely placed on A(C̄). This is a feature of our approach, since several Contact Cyclic Order are obtained by circling each other. This approach is an important requirement, since it can yield a more compact layout. L 12 • ) 10 10 Γ• ( 2 ,1 12 • 6• 11 • 6• 15 • 10 • 11 • 15 • 4• 5• • 2• 8 5• 1• 9• • • XCM • • 16 3 9• • 7 8 • 16 • 14 • 7 • • 14 13 • 13 C = 5|9|13|7|14|16|8|15|11|6|12|10 C = 1|3|2|4 C = 5|9|13|7|14|16|8|15|11|6|12|10 (a) (b) Figure 2: Two Contact Cyclic Orders and a partial Layout Let N̄ ⊂ N be a subset of circles placed inside the container and |N̄| be the cardinality of N̄. We 1 denote the centroid of N̄ by the coordinates XC = |N̄| ∑ X(i). i∈N̄ Definition 6. (Border) Let L be a partial Layout and C be a Contact Cyclic Order. If the center of each circle in L belongs to A(C), we say in addition that C is the Border of the partial Layout L. 5 Figure 2(b) illustrates the Border C̄ (12 circles) of the partial Layout L (16 circles). Note that all circle centers in L belong to A(C̄). On the other hand, C = 1|3|2|4 is not a Border of L, since X(5) ∈ / A(C). We consider two cases of inclusion for placing circles. In the first case, we require that the circle k to be included must touch at least two previously placed circles. After this, in the second case, we require that another circle � to be included occupies the wasted spaces after placing the circle k. This is a reasonable requirement, since it will generally yield a more compact layout than one defined by separate circles. These two cases of inclusion can be explained by a partial Layout of the LOP example with seven existing circles illustrated in Figure 3. In Figure 3(a), it is shown the first case of inclusion. There are two positions to place the circle 9 (dashed lines) touching the Contact Pair {1, 7}, and two positions to place the circle 6 (dashed lines) touching the Contact Pair {2, 3}. Each position can be obtained by the solutions of the following particular case of the problems of Apolonio (Coxeter 1968).  �  (x − xi )2 + (y − yi )2 = rk + ri p p p � (3)  (x − xi )2 + (y − yi )2 = rk + ri q q q We denote by St(k, i p , iq ) the coordinates of the solution of the System (3) which does not belong to A(C). Note that the System (3) has two real solutions whenever d(i p , iq ) � ri p + riq + 2rk . In Figure 3(a), by choosing St(9, 7, 1) as the coordinates of the circle 9, we obtain a feasible layout. However, it is not enough to choose St(6, 2, 3) as the coordinates of the circle 6, because the circle 6 overlaps the circles 1 and 5. In our approach, we always select the coordinates St(k, i p , iq ) ∈ / A(C) in order to place the new circle k touching the Contact Pair {i p , iq } in the Border C (in Figure 3(a), we have k = 6 and {i p , iq } = {2, 3}), but due to the potentially large differences in the radii, it is possible to occur overlap with the circles in the Border C. As it is illustrated in Figure 3(a), we get around this situation by repositioning the circle k to the coordinates of the solution of new System (3) for k, i p̄ and iq̄ , where now the circle k touches the circles i p̄ and iq̄ (in Figure 3(b), we have k = 6, i p̄ = 1 and iq̄ = 5). This first case of inclusion and the possible reposition define the following placement approach. Definition 7. (External Placement) Let L be a partial Layout and C be the Border of L. An External Placement is the placement of a circle k inside the container, so that there is no overlap, its center does not belong to A(C), and it becomes Contact Pair with at least two circles in C. We denoted an External Placement by pE (k). The External Placement is always selected outside A(C), however if there is overlap on C, the repositioning of the new circle k (as explained above) is done in the following routine. 6 Procedure 1: External Placement routine Input: a circle k, a Contact Pair {i p , iq }, a partial Layout L and the Border C Output: an External Placement pE (k), p and q Step 1. Calculate St(k, i p , iq ) by System (3) and pE (k) ← St(k, i p , iq ). If the circle k does not overlap any circles in C stop, otherwise go to Step 2. Step 2. While there is overlap between the circle k and the circles in C repeat. If the circle k overlaps the circle i p̄ furthest with respect to the counterclockwise order of the Border C, p ← p̄, and if the circle k overlaps the circle iq̄ furthest with respect to the clockwise order of the Border C, q ← q̄, and choose pE (k) as the solution of the System (3) that is furthest from the centroid of the circles in L with respect to the Euclidean distance. First, if the new circle k does not overlap any circles in Border C, the External Placement routine selects pE (k) = St(k, i p , iq ). In our approach, this case is the most convenient way to place the next circle. However, if there is overlap, in Step 2 the routine identifies such circles (i p̄ and iq̄ ) in order to reposition the circle k further from the centroid of the partial Layout, eventually avoiding any kind of overlap. To obtain a more compact layout, after including the circle k, it is checked the possibility of including another circle to occupy the wasted spaces after placing the circle k. We check among the remaining circles outside the container (preferably the largest one) if there is a circle � that can be placed into the container in a centralized position without overlap. Each centralized position is the centroid coordinates of a certain set of circles which includes the circle k and the two circles touching the circle k. Figure 3(b) illustrates the second case of inclusion, which we can investigate the possibility of positioning a circle in the wasted space after placing the circle 9 touching the Contact Pair {1, 7} (centroid X̂C of the circles {1, 7, 9}), and in the wasted space after placing the circle 6 touching the circles 1 and 5 (centroid X̄C of the circles {1, 2, 3, 4, 5, 6}). Definition 8. (Internal Placement) Let L be a partial Layout, C be the Border of L, and {i p , k}, {k, iq } be Contact Pairs in C, where k is the previous circle included. An Internal Placement is the placement of a circle � inside the container, so that its center belongs to A(C), � does not overlap with any other circle, and the center of � is placed at the centroid coordinates of the subset N̄, where {k, i p , iq } ⊆ N̄. We denote an Internal Placement by pI (N̄, �), meaning that � is to be placed at the centroid coordinates XC of N̄. Let L be a partial Layout and C be the Border of L. In our algorithm, each positioning in the first case of inclusion is always done by looking at the Contact Pairs in the Border C. Suppose that the remaining circle k is selected to be placed touching the Contact Pair {i p , iq } in C. The placement of the circle k causes the addition of one element in L and one index in C, and perhaps the removal of some indices from C. This will be represented by the following operation. O+ − (k, i p , i p+s )(C) = C + {k} − {i p+1 , . . . , i p+s−1 } = i1 i2 · · · i p k i p+s · · · it−1 it , 7 6• 6• 9• • • 5 • • (a) • 2 5• • 7• 9 10 6• 1 • 9• 4 • • 2 • A(C) C = · · · |7|1|2|3|4|5|10| · · · (b) 10 XC 7• • 3 6• � X C • 1• 4 • 3 A(C) C = · · · |7|9|1|6|5|10| · · · Figure 3: Two cases of inclusion: (a) External Placement and (b) Internal Placement where 1 � s � �(t − 2)/2�. With this choice for s there are fewer indices between p and p + s than p + s and p. The operation O+ − (k, i p , i p+s )(C) applied to C means that the circle k was placed inside the container touching the circles i p and i p+s without overlap. Then the index k is added to C, the subset of indices {i p+1 , . . . , i p+s−1 } between p and p + s is removed from C, and the coordinates X(k) are added to the partial Layout L. Note that if s = 1 there is no removal of indices from C, and the index k is inserted in C between the indices i p and i p+1 . The possible placement of the circle � after the placement of the circle k only causes the possible addition of the coordinates X(�) to the partial Layout L. In our approach, we require the imbalance of the system be zero. It seems intuitive that this requirement may result in a good � solution. We�denote the center of mass of the system by n n n XCM = (xCM , yCM ) = (1/ ∑ mi ) ∑ mi xi , ∑ mi yi , then one can shift the center of the rotating i=1 i=1 i=1 circular container to the center of mass of the system to have zero imbalance. This shift is made at each outer iteration and at the end of the algorithm, but it may increase the envelopment radius. Thus, if the Layout L represents � a complete solution � of the LOP, we denote the radius r of the container by r = R(L) ≡ max rik + d(XCM , X(ik )) . Moreover, the index where R(L) is 1�k�t reached is denoted by kmax ≡ arg(R(L)). 3 Center-of-mass-based placing technique (CMPT) We present a new placing technique which yields compact layouts and quality solutions in an efficient manner. Let α = (α(1), α(2), . . . , α(n)) be a permutation of (1, 2, . . . , n). We place the circles in the partial Layout L one by one according to the order defined by this permutation. Given a order of inclusion, the first circles α(1), α(2), α(3) and α(4) must be positioned as follows. 8 Procedure 2: Initial layout routine Input: the circles α(1), α(2), α(3) and α(4) Output: an initial Layout L and the initial Border C Place the circle α(1) at coordinates X(α(1)) = (0, 0). Choose the coordinates X(α(2)), such that α(2) touches α(1). For each circle α(3) and α(4), solve the System (3) and place them at coordinates X(α(3)) = (xα(3) , yα(3) ) = St(α(3), α(1), α(2)) and X(α(4)) = St(α(4), α(1), α(2)) without overlap. L = {X(α(1)), X(α(2)), X(α(3)), X(α(4))} and C ← α(1)|α(3)|α(2)|α(4). Figure 2(b) illustrates the initial L = {X(1), X(2), X(3), X(4)} and the initial Border C = 1|3|2|4. Among many optional positions we can choose X(α(2)), for example, at the x-axis with the coordinates (rα(1) + rα(2) , 0). Suppose we have already placed the circles α(1), α(2), . . . , α(k − 1), we describe our approach for placing the circle α(k), and after that, we verify the possibility of placing another circle α(�), k < � � n. When we place the circle α(k) (where k > 4, see Procedure 2), we require that the circle touches at least two previously placed circles (see Figure 3(a) and Procedure 4). This will generally yield a more compact layout. However, we can increase the compactness of the layout if the wasted spaces after placing the circle α(k) can be occupied by another circle α(�) (see Figure3(b) and Procedure 4). α(k) • 12 • α(k) 12 • • 6• 6• 10 • 10 • 11 • Q2 • XCM • 1• Q3 • 3 • • 7 16 • XCM 8 • 3 • • 7 • • • 9• 14 • 13 Q1 2• 5• 8 1• (0, 0) 9• 15 • 4• 2• 5• 11 • 15 • 4• α(k) • Q4 • 14 • 13 C = 5|9|13|7|14|16|8|15|11|6|12|10 16 α(k) C = 5|9|13|7|14|16|8|15|11|6|12|10 (a) (b) Figure 4: Example of the CMPT routine We observe that for each additional circle, the envelopment radius of a layout is generally enlarged. In order to minimize the rate of growth of this radius during inclusions, we must properly 9 choose a new position for circle α(k) which yields a smaller envelopment radius. Our strategy CMPT attempts to reduce the rate of growth of the envelopment radius by including every circle around the coordinates of the center of mass of the system, which is updated during each outer iteration. This strategy consists of shifting the origin of the Euclidean plane to the current center of mass of the system. Then we require that the circle α(k) touches the circles of a Contact Pair arbitrarily chosen among the elements of the Border C, taking into consideration the quadrants of the Euclidean plane. This approach is performed according to the following routine. Procedure 3: CMPT routine Input: a partial Layout L and the Border C Output: the sets Q1 , Q2 , Q3 and Q4 Step 1. Calculate the coordinates of the center of mass XCM of the circles in L, and translate the origin of the Euclidean plane to XCM . Step 2. Include each Contact Pair {i p , i p+1 } of C in the set Qh if the center of i p belongs to the quadrant h of the Euclidean plane, for h = 1, 2, 3, 4. Given the Border C, the Procedure 3 only separates the Contact Pairs in C according to the quadrants of the Euclidean plane with origin shifted to the current center of mass of the system. Figure 4 illustrates the Procedure 3. In Figure 4(a) we observe that the coordinates of the center of mass XCM of the system do not coincide with the coordinates of the origin X(α(1)) = (0, 0). We wish to place the next circle α(k) around the coordinates XCM in order to mitigate the growth of the envelopment radius. By dividing the plane into quadrants, we can obtain a Border C with a more circular shape. We see in Figure 4(b) that if we place each new circle α(k) at a different quadrant of the Euclidean plane (with the origin shifted to XCM ), then the layout is more evenly distributed. The choice of different quadrants (a Contact Pair in Qh (h = 1, 2, 3, 4)) to position the next circle α(k), and the operation O+ − on the Border C lead to a updated Border C more similar to a circular shape. This will generally yield a more compact layout, because the wasted space between the Main Area A(C) and envelopment radius is minimized (see the example in Figure 5). Next we describe the two cases of inclusion in the following routine. Procedure 4: Inclusion routine Input: a circle α(k), a permutation α, the sets Qh , h = 1, 2, 3, 4, a Contact Pair {i p , iq } in a set Qh , a partial Layout L and the Border C Output: a partial Layout L, the Border C and the sets Qh , h = 1, 2, 3, 4 Step 1. Obtain an External Placement pE (α(k)) and the new values for p and q by Procedure 1. If there are fewer indices in the Border C between q and p than those between p and q, then p̄ ← p, p ← q and q ← p̄. 10 Step 2. C ← O+ , iq )(C), X(α(k)) ← pE (α(k)), L ← L ∪ {X(α(k))} and Qh ← Qh \ − (α(k), i p� {{i p , i p+1 }, . . . , {iq−1 , iq } , h = 1, 2, 3, 4 (note that q = p + s, where 1 � s � �(t − 2)/2�). Step 3. If it is possible to obtain an Internal Placement pI (N̄, α(�)) for the set N̄ = {α(k), i p , i p+1 , . . . , iq−1 , iq } and a circle α(�) (preferably the largest) in the permutation α, k < � � n, then X(α(�)) ← pI (N̄, α(�)), L ← L ∪ {X(α(�))}, and exclude α(�) from α. The Inclusion routine attempts to place the new circles in a more compact layout. First, it computes an External Placement for the next circle α(k) by Procedure 1 and updates the values for p and q in order to obtain fewer indices between p and q than those between q and p. In Step 2, the Border C is updated by the operation O+ − , where the indices between p and q are removed from C (by Step 1, those indices correspond to the internal circles from the Border when compared to the indices between q and p), and α(k) is added to C. The circle α(k) is placed inside the container and all Contact Pairs between p and q (including {i p , i p+1 } and {iq−1 , iq }) are removed from the sets Qh , h = 1, 2, 3, 4. This choice guarantees that the operation O+ − will exclude the internal circles from the Border C. Finally, a search to place another circle α(�) (Internal Placement) is performed. Post-optimization A post-optimization is performed after the algorithm builds a complete solution (represented by Layout L), which contemplates improvements via circle repositioning at the Border C of L. This post-optimization process causes changes in C, where an index is removed and then it is repositioned in C by operation O+ − . The removal of the index from C will be represented by the following operation. D(i p )(C) = i1 i2 · · · i p−1 i p+1 · · · it−1 it . The operation D(i p )(C) applied to C means that the circle i p is deleted from its position. We delete the current X(i p ) from the Layout L, and we test if a new position pE (i p ) for i p improves the radius R(L) of the container. Main routine We choose to position each circle inside the container according to the following main procedure. Main routine Input: a permutation α = (α(1), α(2), . . . , α(n)) Output: a Layout L (complete solution) Step 1. (Initialization) Obtain the initial Layout L and the initial Border C by Procedure 2, k ← 5. Step 2. (CMPT) Obtain the sets Qh , h = 1, 2, 3, 4 by Procedure 3. 11 Step 3. (Layout construction) While there are Contact Pairs in any Qh and circles outside the container, repeat for each h = 1, 2, 3, 4. / choose an arbitrary {i p , iq } ∈ Qh and include the circle α(k) and the possible If Qh �= 0, circle α(�), k < � � n, by Procedure 4 and k ← k + 1. Step 4. If there are circles outside the container, return to Step 2. Otherwise, go to Step 5. Step 5. (Post-optimization) L̄ ← L, C̄ ← C, r̄ ← R(L̄), compute kmax in C̄ and k ← kmax . Step 5.1. (x̄, ȳ) ← X(ik ), delete the current X(ik ) and repeat Step 5.2. for each Contact Pair {i p , iq } of C̄, excluding {ik−1 , ik } and {ik , ik+1 }. Step 5.2. Obtain an External Placement pE (ik ) and the new values for p and q by Procedure 1, and X(ik ) ← pE (ik ). If the radius of the container is improved, then C̄ ← D(ik )(C̄), C̄ ← O+ − (ik , i p , iq )(C̄), L ← L̄, C ← C̄ and return to Step 5. Step 5.3. X(ik ) ← (x̄, ȳ) and finish the routine with the complete solution L ← L̄, whose container center is the center of mass of the system. Given a permutation α, the Main routine builds an initial Layout L in Step 1 by placing the first four circles as in Procedure 2. Next, in Step 2 the main aspect of our approach is performed by Procedure 3 (CMPT routine), where the Euclidean plane is divided into four parts and the subsets Qh (h = 1, 2, 3, 4) of Contact Pairs are obtained. Next, Step 3 is repeated by looking at each subset Qh and while there are circles remaining to be placed. In this step, an arbitrary Contact Pair in Qh is chosen and the two cases of inclusions are performed by Procedure 4. After we finish placing all circles inside the container, we obtain a complete solution L and its Border C. Then, in Step 5, a post-optimization is performed via circle repositioning at the Border C, which attempts improvements in the envelopment radius. In the end, the center of the container is shifted to center of mass of the system, which achieves zero imbalance. Order of placement of the circles As previously described, a permutation α = (α(1), α(2), . . . , α(n)) of (1, 2, . . . , n) is used as an input in our algorithm to generate a layout by specifying the order in which the circles are placed. Since there exist n! possible permutations for n circles, we need an appropriate technique in order to search in such a large space. Preliminary tests show that the wasted spaces after placing circles are minimized with greater efficiency when the order of addition of the circles favors those of larger radii. Let α = (α(1), α(2), . . . , α(n)) be a sequence obtained by considering their radii in descending order of the circles, i.e., rα(k) � rα( j) , 1 � k < j � n. Choose an integer b, 1 � b � n and subdivide the terms of the sequence α in � = �n/b� blocks. Thus, it is possible to obtain a subsequence ᾱ of α to be used as an input to the algorithm, by permuting the positions of the first α(1), . . . , α(�) elements of α, the α(� + 1), . . . , α(2�) elements of α, and so on, until we permute the positions of α(b�), . . . , α(n − 1), α(n) last elements of α. With this procedure, several subsequences to place the different circles may be generated. Actually, there are ((�!)b )(n − (b�))! possibilities, so that 1 � ((�!)b )(n − (b�))! � n!. Thus, when b = n, we only obtain the sequence ᾱ = α, and 12 XCM 1 • |C1 | = 4 |C2 | = 12 • ikmax |C3 | = 27 Figure 5: A suboptimal solution: 45 circles inside the container when b = 1, we can generate at most n! distinct subsequences. In our numerical experiments, for each instance of dimension greater than or equal to 10 we chose b = 5 to generate such sequences. Complexity The analysis of the real computational time of the Main routine is difficult, because it does not depend only on the number of circles, but also on the diversity of the circle radii and the number of circles in a current Border C, as well as the implementation. Here, we analyze the upper bound of the complexity of the Main routine, when it finds a complete solution L with Border C, such that |C| = λn, where 0 < λ � 1, including the post-optimization process. Recall that, before post-optimization, the circles in Border C are two by two Contact Pair. Given a partial Layout L with m circles already placed inside the container and n − m circles outside. Let |C| be the number of circles in the Border C of the partial Layout L. The strategy CMPT in Procedure 3 checks the position of |C| circles in the Euclidean plane, which is done in O(|C|). When we position the circle ik (where k > 2, see Procedure 2) touching two circles in Border C, |C| existing circles can define 2 × |C| positions, since two existing circles define two possible positions for the third ik . To determine an External Placement for ik , we must check the overlap with A(C) or with any circles in C. This is the same that we check the overlap with each circle in L, that is, m circles (a good implementation can reduce the number of checks). Because we assess 2 × |C| positions when we place the circle ik , each time checking for overlaps m times, then the complexity to obtain an External Placement is about 2 × m × |C|. After placing the circle ik , we must check if there is a circle i� outside the container to be placed 13 in an Internal Placement, then we must check the overlaps among n − m circles and a subset N̄ in C, which is done in about |N̄| × (n − m) � |C| × (n − m). In the post-optimization process, we select one circle in C and assess at most (|C| − 2) Contact Pairs in C to try to improve of the envelopment radius by checking at most 2 × (|C| − 2) External Placements, thus the complexity of the post-optimization is bounded by 2 × (n − 1) × (|C| − 2). Therefore the complexity of placing n circles during the Main routine is bounded by O(n2 |C|). After placing the new circle ik , the operation O+ − modifies the Border C. This operation controls the size of C during the iterations. Since |C| � n, the theoretical upper bound is O(n3 ). 4 Experimental results In this section, we measure the quality and performance of our algorithm on a series of instances up to 55 circles from literature. We tested three sets of instances from the literature. We compare our approach with a series of hybrid nature-inspired approaches based on simulated annealing and particle swarm optimization (Xiao et al. 2007, Lei 2009), a hybrid approach based on simulated annealing, neighborhood search mechanism and the adaptive gradient method Liu et al. (2010), a hybrid tabu search algorithm and gradient method Liu et al. (2011), a series of heuristics based on energy landscape paving, gradient method and local search Liu & Li (2010), Liu et al. (2010, 2015), and a series of algorithms based on quasi-physical approaches, gradient method and local search Huang & Chen (2006), He et al. (2013), Liu et al. (2015). Size 5 9 5 Size 7 12 15 Size 10 15 20 25 30 Table 1: Data of each instance First set of instances (Liu & Li 2010) Radii Mass Size Radii Mass [20.71, 50] [20.71, 50] 7 [8.5, 12] [72.25, 144] [0.17, 0.41] [0.17, 0.41] 40 [81, 120] [6, 14] [6, 11] [36, 121] Second set of instances (Huang & Chen 2006) Radii Mass Size Radii Mass [20, 20] [400, 400] 17 [5, 25] [25, 625] [23.72, 100] [562.64, 104 ] 37 [20, 20] [400, 400] [1, 15] [1, 225] 50 [20, 20] [400, 400] Third of instances (Xiao et al. 2007) Radii Mass Size Radii Mass [5, 23] [20, 93] 35 [7, 24] [10, 99] [6, 24] [12, 98] 40 [6, 23] [12, 99] [5, 24] [11, 94] 45 [6, 24] [11, 99] [6, 24] [11, 96] 50 [5, 24] [10, 99] [6, 24] [12, 97] 55 [6, 24] [13, 99] These methods search for the optimal layout by directly evolving the positions of every circle, as well as considering imbalance. We use the benchmark suite of 21 instances of the problem 14 Table 2: Numerical results for the first set of instances Instance n 1.1 1.2 1.3 1.4 1.5 5 9 5 7 40 Instance n 1.1 1.2 1.3 1.4 1.5 5 9 5 7 40 Instance n 1.1 1.2 1.3 1.4 1.5 5 9 5 7 40 Huang & Chen (2006) Lei (2009) Liu & Li (2010) f1 f2 time(s) f1 f2 time(s) f1 f2 time(s) 120.710 – 22.327 31.981 742.750 7.63×10−4 – 3.90×10−4 −3 4.11×10 5.40×10−4 3.82 – 2.91 76.33 12.27 – – – 31.924 769.819 – – – 1.40×10−5 3.25×10−4 – – – 427 1724 120.710678 1.000000 22.249000 31.854600 725.043500 3.89×10−9 9.7×10−9 3.12×10−9 1.5×10−9 2.47×10−9 0.594 2.891 1.313 54.828 7.187 Liu et al. (2010) Liu et al. (2011) f1 f2 time(s) f1 f2 120.7106782 – 22.2463 31.8412 716.6782 4.30×10−9 – 3.52×10−9 −10 2.03×10 2.86×10−9 0.969 – 0.469 58.797 154.594 120.710678 1.000000 22.246203 31.841134 716.610932 3.25×10−9 2.38×10−9 2.63×10−9 5.89×10−9 1.77×10−9 He et al. (2013) Liu et al. (2015) times(s) 0.350 0.225 0.506 27.766 63.263 Our algorithm f1 f2 time(s) f1 f2 time(s) f1 f2 time(s) 120.710678 1.000000 22.246203 31.841134 709.812500 2.11×10−10 2.00×10−12 3.44×10−10 2.90×10−10 1.85×10−10 0.046 0.172 0.015 98.031 434.734 120.710678 1.000000 22.246203 31.841133 715.978266 3.49×10−10 9.92×10−10 9.22×10−10 1.13×10−9 3.15×10−7 – – – – – 120.710618 1.000000 23.624138 31.905109 745.118349 0 0 0 0 0 1.925 2.365 1.812 110.912 829.156 described in Table 1 to test our algorithm. For each instance we present the range for ri and mi . A more detailed description of the instances can be found in Huang & Chen (2006), Liu & Li (2010) and Xiao et al. (2007). The routines were implemented in MATLAB language, and executed on a PC with an Intel Core i7, 7.7 GB of RAM and Linux operating system. Except for the instances 1.1 and 1.3, both of them with 5 circles, we decide to generate 7! = 5040 distinct permutations α as input for the algorithm in each instance, i.e., we fixed in 5040 the number of executions of the Main routine for each instance and the best solution found was selected. This amount of tests proved adequate for our comparisons. The results from the first, second and third sets of instances are presented in Tables 2, 3 and 4 respectively, where we compare our approach with those described in each indicated reference. The results are shown for the size of the instances, the best radius of the container obtained (first objective function f1 ), the imbalance obtained (second objective function f2 ), and the running time t (in seconds). Table 2 shows that our approach proved to be competitive. We obtained the best value for f1 on instance 1.1, tied in instance 1.2, while obtained results 6,1%, 0,2% and 4,0% worse than the best result on instances 1.3, 1.4 and 1.5 respectively. Similar results were obtained in the second set test, as can be seen in Table 3. Our algorithm tied in instance 2.1 and 2.2, while obtained results at most 7,7% worse than the best result on instances 2.3, 2.4, 2.5 and 2.6. In Table 4 we compare our approach with three other algorithms. The first set of data are from a version of simulated annealing (SA), the second set of data are from the same reference, but one of them is a version of particle swarm optimization (PSO), while the third set of data is a 15 Table 3: Numerical results for the second set of instances Instance n 2.1 2.2 2.3 2.4 2.5 2.6 7 12 15 17 37 50 Instance n 2.1 2.2 2.3 2.4 2.5 2.6 7 12 15 17 37 50 Huang & Chen (2006) Liu et al. (2010) Liu et al. (2011) f1 f2 time(s) f1 f2 time(s) f1 f2 time(s) 60.00 215.470 39.780 49.720 135.176 159.570 3.6×10−3 9.5×10−3 7.6×10−3 5.1×10−3 6.7×10−3 8.0×10−3 7.78 444.78 91.92 157.92 18.29 348.97 60.0000 215.470054 39.123400 49.507800 135.175410 158.967800 1.59×10−9 2.74×10−7 2.97×10−8 6.83×10−8 1.23×10−8 4.81×10−9 1.031 11.562 130.362 123.407 0.203 453.625 60.000000 215.470054 39.065105 49.368194 135.175410 158.967698 7.38×10−9 3.77×10−7 4.13×10−8 2.50×10−8 4.91×10−9 3.49×10−9 0.206 3.042 365.797 597.719 0.425 1078.386 He et al. (2013) Liu et al. (2015) Our algorithm f1 f2 time(s) f1 f2 time(s) f1 f2 time(s) 60.000000 215.470054 39.037635 49.338750 135.175410 158.963672 2.66×10−9 2.92×10−8 7.78×10−10 1.51×10−9 6.95×10−9 5.14×10−9 0.015 0.391 36.343 10.562 0.234 268.078 60.000000 215.470054 39.065105 49.368194 135.175410 158.967698 5.13×10−9 1.69×10−7 1.12×10−8 1.42×10−8 3.35×10−9 3.65×10−9 – – – – – – 60.000000 215.470054 40.090538 50.246873 145.624231 163.206698 0 0 0 0 0 0 0.118 52.125 167.248 325.080 0.402 0.390 heuristic based on energy landscape paving. Again, our approach proved to be competitive. In relation to the envelopment radius we obtained better results in 5 out of the 10 instances. We only obtained worse results in five cases, but they were on average approximately 0.63% worse than the results from literature for such instances. Overall, running time obtained by our algorithm can be considered good. Since the center of the rotating circular container is shifted to the center of mass of the system we always have f2 = 0, making our solutions more interesting than the others for this first set of instances. Figure 5 illustrates a typical solution obtained by our algorithm for an instance of 45 circles. Note that the large Border C3 have 27 circles, i.e., 60% of the size, and when we carefully read the CMPT routine, we can see that the initial Border C1 (|C1 | = 4) is iteratively transformed in the Border C2 (|C2 | = 12), and finally the latter is iteratively transformed in the Border C3 . In this example there were only two inclusions by Internal Placement. The computational results show that the proposed algorithm is an effective method for solving the circular packing problem with additional balance constraints. 5 Conclusions We have presented a new heuristic called center-of-mass-based placing technique for packing unequal circles into a 2D circular container with additional balance constraints. The main feature of our algorithm is the use of the Euclidean plane with origin in the center of mass of the system to select a new circle to be placed inside the container. We evaluate our approach on a series of instances from the literature and compare with existing algorithms. The computational results show that our approach is competitive and outperforms some published methods for solving this problem. We conclude that our approach is simple, but with high performance. Future work will focus on the problem of packing spheres. 16 Table 4: Numerical results for the third set of instances Instance n 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 10 15 20 25 30 35 40 45 50 55 Instance n 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 10 15 20 25 30 35 40 45 50 55 Xiao et al. (2007) (SA) Xiao et al. (2007) (PSO) f1 f2 time(s) f1 f2 time(s) 60.96 68.77 83.09 83.97 99.58 102.86 115.15 120.63 125.82 138.22 0 0 0 0 0 0 0 0 0 0 3237 8320 18431 34032 54565 76760 128112 167484 198071 198071 59.93 67.65 83.06 84.24 99.89 102.71 115.58 119.67 126.19 138.89 0 0 0 0 0 0 0 0 0 0 2898 8659 20035 36815 62360 86537 122390 153006 199050 244171 Liu et al. (2015) Our algorithm f1 f2 time(s) f1 f2 time(s) 59.92 67.39 82.99 82.98 98.97 102.32 115.00 119.07 124.98 136.13 5.40×10−9 – – – – – – – – – – 59.96 67.59 83.85 83.68 98.95 102.15 114.15 117.69 124.32 137.37 0 0 0 0 0 0 0 0 0 0 28 39 82 107 134 155 96 118 136 154 6.44×10−9 2.48×10−9 5.10×10−9 4.14×10−9 4.50×10−9 5.82×10−9 7.64×10−9 4.45×10−9 2.19×10−9 Acknowledgements The authors are indebted to the anonymous reviewers for their helpful comments. The first author wishes to thank CAPES and FAEPEX-UNICAMP (grant 285/15), the second author is grateful to FAPESP, the third author thank CNPq. References Coxeter, H. S. M. (1968), ‘The problem of Apollonius’, The American Mathematical Monthly 75(1), 5–15. He, K., Mo, D., Ye, T. & Huang, W. (2013), ‘A coarse-to-fine quasi-physical optimization method for solving the circle packing problem with equilibrium constraints’, Computers & Industrial Engineering 66(4), 1049–1060. Huang, W. & Chen, M. (2006), ‘Note on: An improved algorithm for the packing of unequal 17 circles within a larger containing circle’, Computers & Industrial Engineering 50(3), 338– 344. Lei, K. (2009), ‘Constrained layout optimization based on adaptive particle swarm optimizer’, Springer-Verlag Berlin Heidelberg 1, 434–442. Lenstra, J. K. & Rinnooy Kan, A. H. G. (1979), Complexity of packing, covering and partitioning problems, In: Schrijver, A. (Ed.), Packing and Covering in Combinatorics. Econometric Institute. Mathematisch Centrum, Amsterdam, pp. 275-291. Li, N., Liu, F. & Sun, D. (2004), ‘A study on the particle swarm optimization with mutation operator constrained layout optimization’, Chinese Journal of Computers (in Chinese) 27(7), 897– 903, apud in Xiao, R. B., Xu, Y. C. & Amos, M. (2007). Liu, J., Jiang, Y., Li, G., Xue, Y., Liu, Z. & Zhang, Z. (2015), ‘Heuristic-based energy landscape paving for the circular packing problem with performance constraints of equilibrium’, Physica A: Statistical Mechanics and its Applications 431, 166–174. Liu, J. & Li, G. (2010), ‘Basin filling algorithm for the circular packing problem with equilibrium behavioral constraints’, Science China Information Sciences 53(5), 885–895. Liu, J., Li, G., Chen, D., Liu, W. & Wang, Y. (2010), ‘Two-dimensional equilibrium constraint layout using simulated annealing’, Computers & Industrial Engineering 59(4), 530–536. Liu, J., Li, G. & Geng, H. (2011), ‘A new heuristic algorithm for the circular packing problem with equilibrium constraints’, Science China Information Sciences 54(8), 1572–1584. Qian, Z., Teng, H. & Sun, Z. (2001), ‘Human-computer interactive genetic algorithm and its application to constrained layout optimization’, Chinese Journal of Computers 24(5), 553– 560, apud in Xiao, R. B., Xu, Y. C. & Amos, M. (2007). Tang, F. & Teng, H. F. (1999), ‘A modified genetic algorithm and its application to layout optimization’, Journal of Software (in Chinese) 10, 1096–1102, apud in Xiao, R. B., Xu, Y. C. & Amos, M. (2007). Teng, H. F., Sun, S. L., Ge, W. H. & Zhong, W. X. (1994), ‘Layout optimization for the dishes installed on rotating table – the packing problem with equilibrium behavioural constraints’, Science in China Mathematics (Series A) 37(10), 1272–1280. Wang, H., Huang, W., Zhang, Q. & Xu, D. (2002), ‘An improved algorithm for the packing of unequal circles within a larger containing circle’, European Journal of Operational Research 141(2), 440–453. Xiao, R. B., Xu, Y. C. & Amos, M. (2007), ‘Two hybrid compaction algorithms for the layout optimization problem’, Biosystems 90(2), 560–567. Xu, Y. C., Xiao, R. B. & Amos, M. (2007), A novel genetic algorithm for the layout optimization problem, in ‘Evolutionary Computation, 2007. CEC 2007. IEEE Congress on’, IEEE, pp. 3938–3943. Zhou, C., Gao, L. & Gao, H. (2005), ‘Particle swarm optimization based algorithm for constrained layout optimization’, Control and Decision 20(1), 36–40. 18
5cs.CE
Counting racks of order n arXiv:1607.07036v2 [math.CO] 21 May 2017 Matthew Ashford and Oliver Riordan∗ May 20, 2017 Abstract A rack on [n] can be thought of as a set of maps (fx )x∈[n] , where each fx is a permutation of [n] such that f(x)fy = fy−1 fx fy for all x and y. In 2013, Blackburn showed that the number of isomorphism classes of racks 2 2 on [n] is at least 2(1/4−o(1))n and at most 2(c+o(1))n , where c ≈ 1.557; 2 in this paper we improve the upper bound to 2(1/4+o(1))n , matching the lower bound. The proof involves considering racks as loopless, edge-coloured directed multigraphs on [n], where we have an edge of colour y between x and z if and only if (x)fy = z, and applying various combinatorial tools. 1 Introduction A rack is a pair (X, ⊲), where X is a non-empty set and ⊲ : X × X → X is a binary operation such that: 1. For any y, z ∈ X, there exists x ∈ X such that z = x ⊲ y; 2. Whenever we have x, y, z ∈ X such that x ⊲ y = z ⊲ y, then x = z; 3. For any x, y, z ∈ X, (x ⊲ y) ⊲ z = (x ⊲ z) ⊲ (y ⊲ z). If X is finite, we call |X| the order of the rack. Note that conditions 1 and 2 above are equivalent to the statement that for each y, the map x 7→ x ⊲ y is a bijection on X. As mentioned by Blackburn in [2], racks originally developed from correspondence between J.H. Conway and G.C. Wraith in 1959, while more specific structures known as quandles (which are racks such that x ⊲ x = x for all x) were introduced independently by Joyce [10] and Matveev [11] in 1982 as invariants of knots. Fenn and Rourke [4] provide a history of these concepts, while Nelson [12] gives an overview of how these structures relate to other areas of mathematics. ∗ Mathematical Institute, University of Oxford, Andrew Wiles Building, Radcliffe Observatory Quarter, Woodstock Road, Oxford OX2 6GG, UK. E-mail: matthew.ashford1@btinternet.com, riordan@maths.ox.ac.uk. 1 As a first example, note that for any set X, if we define x ⊲ y = x for all x, y ∈ X, then we obtain a rack, known as the trivial rack TX . If G is a group and ⊲ : G × G → G is defined by x ⊲ y := y −1 xy, then the resulting quandle (G, ⊲) is known as a conjugation quandle. For a further example, let A be an Abelian group and τ ∈ Aut(A) be an automorphism. If we define a binary operation ⊲ : A × A → A by x ⊲ y = (x)τ + y − (y)τ = (x − y)τ + y then (G, ⊲) = (A, τ ) is an Alexander quandle or affine quandle.1 Let (X, ⊲) and (X ′ , ⊲′ ) be racks. A map φ : X → X ′ is a rack homomorphism if (x ⊲ y)φ = (x)φ ⊲′ (y)φ for all x, y ∈ X. A bijective homomorphism is an isomorphism. We will only be concerned with racks up to isomorphism. If (X, ⊲) is a rack of order n, then it is clearly isomorphic to a rack on [n], so we will take [n] to be our underlying ground set. We will denote the set of all racks on [n] by Rn , and the set of all isomorphism classes of racks of order n by R′n , so |R′n | 6 |Rn |. There have been several published results concerning the enumeration of quandles of small order; Ho and Nelson [6] and Henderson, Macedo and Nelson [5] enumerated the isomorphism classes of quandles of order at most 8, while work of Clauwens [3] and Vendramin [13] gives an enumeration of isomorphism classes of quandles of order at most 35 whose operator group is transitive (the operator group is defined in Section 2). Recently, Jedlička, Pilitowska, Stanovskỳ and Zamojska-Dzienio [9] gave an enumeration of medial quandles (a type of affine quandle) of order at most 13. As far as we are aware, the only previous asymptotic enumeration result for general racks was due to Blackburn [2], giving lower and 2 2 upper bounds for |R′n | of 2(1/4+o(1))n and 2(c+o(1))n respectively, where c ≈ 1.557. 2 Theorem 8.2 of [9] improves the upper bound to 2(1/2+o(1))n in the case of me2 dial quandles; the authors then conjecture an upper bound of 2(1/4+o(1))n under the same restriction. The main result of this paper proves this upper bound for general racks, and hence for (medial) quandles. Theorem 1.1. Let ǫ > 0. Then for all sufficiently large integers n, 2 2 2(1/4−ǫ)n 6 |R′n | 6 |Rn | 6 2(1/4+ǫ)n . The lower bound follows from the construction in Theorem 4 of [2]; our focus is on the upper bound. The bound given in Theorem 12 of [2] was obtained by applying group theoretic results to the operator group associated with a rack; in our arguments we apply combinatorial results to a graph associated with a rack. This graph is defined in the next section. 2 Graphical representations of racks For any rack (X, ⊲), we can define a set of bijections (fy )y∈X by setting (x)fy = x⊲y for all x and y. The following well-known result (see for example, [4], [2]) gives the correct conditions for a collection of maps (fy )y∈X to define a rack. 1 Throughout the paper, we write maps on the right. 2 Proposition 2.1. Let X be a set and let (fx )x∈X be a collection of functions each with domain and co-domain X. Define a binary operation ⊲ : X × X → X by x ⊲ y := (x)fy . Then (X, ⊲) is a rack if and only if fy is a bijection for each y ∈ X, and for all y, z ∈ X we have f(y)fz = fz−1 fy fz . (2.1) Proof. As noted earlier, conditions 1 and 2 in the definition of a rack hold if and only if each fy is a bijection, so it remains to show that condition 3 is equivalent to (2.1). This is essentially a reworking of the definition; we omit the simple details. In the light of Proposition 2.1, we can just as well define a rack on a set X by the set of maps (fy )y∈X , providing they are all bijections and satisfy (2.1). We will move freely between the two definitions, with x ⊲ y = (x)fy for all x, y ∈ X unless otherwise stated. The operator group of a rack is the subgroup of Sym(X) generated by (fy )y∈X . The following standard lemma (see for example Lemma 6 of [2]) shows that Proposition 2.1 can be extended to elements of the operator group. Lemma 2.2. Let (X, ⊲) be a rack and let G be its operator group. Then for any y ∈ X and g ∈ G, f(y)g = g −1 fy g. Any rack on X can be represented by a directed multigraph on X; we give each vertex a colour and then put a directed edge of colour i from vertex j to vertex k if and only if (j)fi = k. We then remove all loops from the graph; i.e. if (j)fi = j we don’t have an edge of colour i incident to j. It will be helpful to recast the representation of racks by directed multigraphs in a slightly different setting. Let V be a finite set and let σ ∈ Sym(V ); then → →∈− we can define a simple, loopless directed graph Gσ on V by setting − uv E (Gσ ) if and only if u 6= v and (u)σ = v. By considering the decomposition of σ into disjoint cycles, we see that Gσ consists of a collection of disjoint directed cycles, isolated double edges corresponding to cycles of length two, and some isolated vertices. We can now extend this definition to the case of multiple permutations in a natural way. Definition 2.3. Suppose Σ = {σ1 , . . . , σk } ⊆ Sym(V ) is a set of permutations − → on a set V . Define a directed, loopless multigraph GΣ = (V, E ) with a k-edgecolouring by putting a directed edge of colour i from u to v if and only if u 6= v and (u)σi = v. We also define the reduced graph G0Σ to be the directed graph on V obtained → 0 →∈− by letting e = − uv E (GΣ ) if and only if there is at least one directed edge from u to v in GΣ . Note that the reduced graph contains at most two edges between any u, v ∈ V , → and − → Also observe that if Σ′ ⊆ Σ, then G ′ is a subgraph of G . namely − uv vu. Σ Σ 3 Before continuing, let us clarify some terminology. A path in a directed multigraph G need not respect the orientation of the edges, so for x, y ∈ V (G), there is an xy-path in G if and only if there is an xy-path in the underlying undirected graph. A component of a directed graph G is defined to be a component of the underlying undirected graph. For x, y ∈ V (G), a directed xy-path is a sequence of → −−→ − vertices x = x0 , . . . , xr = y such that − x− i xi+1 ∈ E (G) for all i. Now let us return specifically to racks. Definition 2.4. Let R = (X, ⊲) be a rack, and let (fy )y∈X be the associated maps. For any S ⊆ X, define ΣS = {fy | y ∈ S}. Then by GS we mean the directed multigraph GΣS in the sense of Definition 2.3; GS thus has an associated |S|-edge-colouring, although if |S| = 1 we may not necessarily consider GS as being coloured. We will also write GR = GX , indicating the graph for the whole rack. When describing racks on [n] in a graphical context, we may refer to elements of [n] as vertices. The following two observations are straightforward but crucial. Lemma 2.5. Let Σ ⊆ Sym(V ) be a family of permutations, and let u, v ∈ V be distinct. Then there is a uv-path in GΣ if and only if there is a directed uv-path in GΣ . Proof. We need only prove the ‘only if’ statement. Let u = u0 , . . . , ut = v be a −−→ path in GΣ ; any edge − u− i ui−1 is part of a directed cycle and thus can be replaced with a directed ui−1 ui -path. Replacing each such edge gives a directed uv-walk; the shortest such walk is a path. Lemma 2.6. Let Σ ⊆ Sym(V ) be a family of permutations and U ⊆ V . Then U is an orbit of the natural action of hΣi on V if and only if U spans a component in GΣ . Proof. Let u, v ∈ V . Then u and v are in the same orbit of the natural action if and only if there exists a sequence (σi1 , . . . , σim ) of elements from Σ and a sequence m (ǫ1 , . . . , ǫm ) ∈ {−1, 1}m such that v = (u)σiǫ11 · · · σiǫm . But this is exactly equivalent to there being a uv-path in GΣ with edges successively coloured i1 , . . . , im , and the value of ǫi indicating the direction of the edge. Thus the partition of V into orbits of hΣi coincides with the partition of V into components of GΣ . Applying this last result to a rack R on [n] shows that the orbits of the operator group (in its natural action on [n]) coincide with the components of GR . We can illustrate these notions with a simple example. Let (X, ⊲) be a rack; then a subrack of (X, ⊲) is a rack (Y, ⊲|Y ×Y )2 where Y ⊆ X. Thus a subset Y ⊆ X forms a subrack if and only if for all y, z ∈ Y , (z)fy ∈ Y ; as each fy is a bijection we then also have that (z)fy−1 ∈ Y for all z and thus Y and X \ Y are separated in the graph GY . 2 The notation ⊲|Y ×Y in the above context will always be abbreviated to ⊲, with the restriction to the subset Y left implicit. 4 3 Outline of the proof In this short section we give a brief outline of how we will count the number of racks on [n]. We shall reveal information about an unknown rack on [n] in several steps, counting the number of possibilities for the revealed information at each step. At the end the rack will have been determined completely, so we obtain an upper bound on the number of racks. The principle behind the argument is as follows: we choose a set T ⊆ [n] and reveal the maps (fj )j∈T . We then consider the components of the graph GT ; a key lemma shows that if V is a set of vertices such that each component contains precisely one element from V , then revealing the maps (fv )v∈V determines the entire rack R. The difficulty is in finding a set T which is not too big, but such that GT has relatively few components. We will actually need to consider two different sets T and W . We choose a threshold ∆ and first consider the set of vertices S>∆ that have degree strictly greater than ∆ in the underlying graph G0R ; we will choose probabilistically a relatively small set W ⊆ [n] such that any vertex with high degree in G0R also has high degree in G0W . Because the degree of any vertex in S>∆ is so high, the number of components of G0W contained in S>∆ is small; this allows us to determine the maps (fs )s∈S>∆ . For the vertices in S6∆ (those with degree at most ∆ in G0R ), we will construct greedily a set T of a given size by adding vertices one at a time and revealing their corresponding maps, each time choosing the vertex whose map joins up the most components. It will follow that for every j ∈ S6∆ \ T , fj can only join up a limited number of components of GT ; we will reveal the restriction of fj to these components. Because of the complex nature of this argument, we will ‘store’ these revealed maps in a 7-tuple I = I(R), and then count the racks consistent with I. The main term in the argument comes from considering maps in S6∆ \ T acting within components of GT ; we can control the action of these maps by first revealing some extra information corresponding to the neighbours of T in G0R , which can themselves be controlled as T consists of low degree vertices. In Section 4 we formally define the information I(R), which requires some straightforward graph theory; in Section 5 we show that the number of possibilities 2 for I is at most 2o(n ) . In Section 6 we will complete the proof of Theorem 1.1. 4 4.1 Important information in a rack Degrees in graphical representations of racks Let R = ([n], ⊲) be a rack and T ⊆ [n]; for each v ∈ [n], define Γ+ T (v) = {(v)fj | j ∈ T, (v)fj 6= v}, 5 − →∈→ the set of vertices w such that − vw E (GT ). If V ⊆ [n], we define so Γ+ T (v) is S + (v). (V ) := Γ Γ+ v∈V T T Definition 4.1. With notation as above, the out-degree of v (with respect to T ) + + 0 is d+ T (v) = |ΓT (v)|, so dT (v) is the out-degree of v in the simple graph GT . We can of course define the in-degree d− T (v) similarly. We now show that when S is a subrack, then all components of G0S are out-regular. Lemma 4.2. Let ([n], ⊲) be a rack and (S, ⊲) be a subrack, and let C span a + component of GS , and hence also of G0S . Then for any u, v ∈ C, d+ S (u) = dS (v). Proof. First suppose that v is an out-neighbour of u, so that there is a directed edge → − →∈− uv E (GS ) of some colour i ∈ S, i.e. (u)fi = v. Take an arbitrary w ∈ Γ+ S (u), so w 6= u and there exists a j ∈ S such that w = (u)fj ; as S is a subrack, k := (j)fi ∈ S. Now observe that (v)fk = (v)f(j)fi = (v)fi−1 fj fi = (u)fj fi = (w)fi . Suppose for a contradiction that (v)fk = v; then (w)fi = v = (u)fi , and thus + w = u, contradicting the fact that w ∈ Γ+ S (u). Hence (w)fi = (v)fk ∈ ΓT (v), and + + + as w ∈ ΓS (u) was arbitrary we have that (ΓS (u))fi ⊆ ΓS (v). As fi is a bijection, + + + d+ S (u) = |ΓS (u)| 6 |ΓS (v)| = dS (v). Now let u, v ∈ C be arbitrary; from Lemma 2.5, there is a directed path + u = u0 , . . . , ur = v in GS [C]. From above, we have that d+ S (u) 6 dS (v). By + + instead considering a directed vu-path we have that dS (v) 6 dS (u), and the result follows. 4.2 Some multigraph theory The construction of the information I(R) requires some straightforward graph theory. Here, a multigraph G = (V, E) is defined by a vertex set V = V (G) and an edge multiset E = E(G) of unordered pairs from V . For multisets A and B, A ⊎ B is the multiset obtained by including each element e with multiplicity m, where m is the sum of the multiplicity of e in A and the multiplicity of e in B. If F is a multiset of unordered pairs from V (G), G + F is the multigraph with vertex set V (G) and edge multiset E(G) ⊎ F . In this subsection we will consider only undirected multigraphs for clarity. As paths and components of a directed multigraph are defined by the underlying undirected multigraph, all of these results remain true for directed multigraphs. We will write cp(G) for the number of components of a multigraph G. Let G be a multigraph3 . Then for distinct u, v ∈ V (G) we have that cp(G + {uv}) = cp(G) − 1 if and only if there is no uv-path in G. The following result is standard. 3 While the following results can be formulated using just simple graphs, we will use multigraphs to be consistent with the definition of the graph of a rack. 6 Proposition 4.3. Let G be a multigraph and E1 and E2 be multisets of unordered pairs of elements of V (G). Then cp(G)−cp(G+E2 ) > cp(G+E1 )−cp(G+E1 +E2 ). Proof. The case where |E2 | = 1 follows from the above observation, since there is a uv-path in G + E1 if there is a uv-path in G. The general case now follows by induction. Definition 4.4. Let G be a multigraph and E be a multiset of unordered pairs of elements of V (G). Let C ⊆ V (G) span a component4 of G; we say that C is merged by E if there exist u ∈ C, v ∈ V (G) \ C such that uv is an edge from E. We denote by M (G, E) the set of (vertex sets of) components of G merged by E. Note that for multisets of edges E and F , M (G, E ⊎ F ) = M (G, E) ∪ M (G, F ). As a single edge can merge at most two components, |M (G, {e})| 6 2 for any unordered pair e. Lemma 4.5. Let G be a multigraph and E and {e} be multisets of unordered pairs of elements of V (G). If cp(G + E + {e}) = cp(G + E), then M (G, E ⊎ {e}) = M (G, E). Proof. Write e = uv; if u and v are in the same component of G then e is not a merging edge and M (G, {e}) = ∅, so suppose that u and v are in different components of G. Write C for the vertex set of the component containing u and D for that containing v, so that M (G, {e}) = {C, D}. As cp(G + E + {e}) = cp(G + E) we have that C and D are both contained a single component of G + E; it follows easily that C, D ∈ M (G, E). It follows that in all cases we have M (G, {e}) ⊆ M (G, E) and thus that M (G, E ⊎ {e}) = M (G, E). Corollary 4.6. Let G be a multigraph and E be a multiset of unordered pairs of elements of V (G). Then |M (G, E)| 6 2(cp(G) − cp(G + E)). Proof. Order E as {e1 , . . . , el } and write a = cp(G)−cp(G+E); then there are precisely a edges ei1 , . . . , eia such that cp(G+{e1 , . . . , eij }) = cp(G+{e1 , . . . , eij −1 })− 1 for each j. Write Ek = {e1 , . . . , ek } for each k, so we always have M (G, Ek ) = M (G, Ek−1 ⊎ {ek }) = M (G, Ek−1 ) ∪ M (G, {ek }). Now consider adding the edges of E in the order given to G; if k 6= ij for any j then cp(G, Ek ) = cp(G, Ek−1 ) and so from Lemma 4.5 we have that M (G, Ek ) = M (G, Ek−1 ), while if k = ij for some j we have that |M (G, Ek )| 6 |M (G, Ek−1 )| + 2. As there are only a such edges it follows that |M (G, E)| 6 2a = 2(cp(G) − cp(G + E)). 4 In other words, C is the vertex set of a component of G; the component itself is a multigraph, not just a set of vertices. 7 4.3 The information I(R) We introduce the following terminology. For any rack R = ([n], ⊲) and any ∆ with 1 6 ∆ 6 n − 1, let S6∆ (R) := {v ∈ [n] | d+ R (v) 6 ∆} denote the set of all vertices with out-degree in G0R at most ∆. Write S>∆ (R) = [n] \ S6∆ (R) for the set of all vertices with out-degree strictly greater than ∆. We now show that this partition is actually a partition into subracks. Lemma 4.7. Let R = ([n], ⊲) be a rack and 1 6 ∆ 6 n − 1. Then (S>∆ (R), ⊲) and (S6∆ (R), ⊲) are both subracks of R. Proof. By Lemma 4.2 (with S = R), two vertices in the same component of GR have the same out-degree. Hence S>∆ (R) and S6∆ (R) are separated in GR and thus both (S>∆ (R), ⊲) and (S6∆ (R), ⊲) are subracks. Now fix ∆ := (log2 n)3 , so ∆ 6 n−1 for sufficiently large n. Given a rack R, we will construct a set T (R) ⊆ S6∆ (R), with |T (R)| 6 (log2 n)2 , by the following procedure (the subgraph GA , where A ⊆ [n], is described in Definitions 2.3 and 2.4). Construction 4.8. If S6∆ (R) = ∅ then T (R) = ∅. Otherwise, order the vertices of S6∆ (R) as follows: first choose u1 so that cp(G{u1 } ) 6 cp(G{v} ) for any v ∈ S6∆ (R). Given a partial ordering u1 , . . . , uk , choose the next vertex uk+1 such that cp(G{u1 ,...,uk ,uk+1 } ) 6 cp(G{u1 ...,uk ,v} ) for any v ∈ S6∆ (R) \ {u1 , . . . , uk }. Now take L := ⌊(log2 n)2 ⌋ and define T (R) := ( {u1 , . . . , uL } if |S6∆ (R)| > L S6∆ (R) otherwise. → − → − We now introduce some more notation. For any j ∈ [n], write E j = E (G{j} ) for the set of edges of GR of colour j and → − Mj := M (GT (R) , E j ) for the set of (vertex sets of) components of GT (R) merged by the edges of colour − → → − j. Note that if j ∈ T (R) then E j ⊆ E (GT (R) ) and so Mj = ∅. The key property of the set T (R) is given in the next lemma. Lemma 4.9. Let R = ([n], ⊲) be a rack. Then for any j ∈ S6∆ (R) \ T (R), |Mj | 6 2n . (log2 n)2 8 Proof. Note that if |S6∆ (R)| 6 L = ⌊(log2 n)2 ⌋, then T (R) = S6∆ (R) and the statement is trivial. We will thus assume that s = |S6∆ (R)| > L + 1 and so |T (R)| = L. For 1 6 i 6 s, write Hi = G{u1 ,...,ui } and xi = cp(Hi−1 ) − cp(Hi ), where H0 = → − G∅ is the empty graph on [n]. Note that cp(Hi ) = cp(Hi−1 + E ui ) 6 cp(Hi−1 ), and so xi > 0 for each i; we also have that s X i=1 xi = s X i=i  cp(Hi−1 ) − cp(Hi ) = cp(H0 ) − cp(Hs ) 6 cp(H0 ) = n. Now fix an i and suppose that xi < xi+1 ; then cp(Hi−1 ) − cp(Hi ) < cp(Hi ) − cp(Hi+1 ) → − → − → − = cp(Hi−1 + E ui ) − cp(Hi−1 + E ui + E ui+1 ) → − 6 cp(Hi−1 ) − cp(Hi−1 + E ui+1 ), from Proposition 4.3. But then cp(G{u1 ,...ui−1 ,ui } ) > cp(G{u1 ,...ui−1 ,ui+1 } ), contradicting our ordering of the vertices. Hence xi > xi+1 , and as i was arbitrary we conclude that (xi )si=1 is a decreasing sequence. From this and the fact that P s −2 i=1 xi 6 n it follows that xL+1 6 n/(L + 1) 6 n(log2 n) . Now take j ∈ S6∆ (R) \ T (R), so in our ordering of S6∆ (R) we have j = uk for some k > L. By our construction, cp(G{u1 ,...,uL ,j} ) > cp(G{u1 ,...,uL ,uL+1 } ); → − noting that GT (R) = G{u1 ,...,uL } = HL , we may rewrite this as cp(GT (R) + E j ) > cp(HL+1 ), and thus → − cp(GT (R) ) − cp(GT (R) + E j ) 6 cp(HL ) − cp(HL+1 ) = xL+1 6 n . (log2 n)2 We can combine this with Corollary 4.6 to see that − → →  − |Mj | = |M (GT (R) , E j )| 6 2 cp(GT (R) ) − cp(GT (R) + E j ) 6 2n , (log2 n)2 showing the result. Before formally defining the information I(R) associated with a rack R, we will need some more notation. Firstly, write T + (R) := T (R) ∪ Γ+ R (T (R)). For any j ∈ S6∆ (R) \ T (R), define [ Yj := C C∈Mj → − to be the set of vertices in components of GT (R) merged by E j , and write Zj := [n] \ Yj 9 Yj j Figure 1: A representation of the components of GT (R) , with the edges of colour j in blue. Here, precisely five components (shaded light blue) are merged by the edges of colour j, so |Mj | = 5; Yj is the set of vertices in these shaded components. If j ∈ S6∆ (R) \ T (R) then only the restriction fj |Yj is included in the information I(R). (see Figure 1). The following lemma gives the key property of the set Zj , in a slightly more general setting. If U, V ⊆ [n] are such that (V )fj = V for all j ∈ U , we say that V is U -invariant; we will write j-invariant instead of {j}-invariant. Lemma 4.10. Let R = ([n], ⊲) be a rack, W ⊆ [n] and j ∈ [n]. Let C ⊆ [n] span → − a component of GW , with C ∈ / M (GW , E j ). Then C is j-invariant. Proof. Take a set C as described and let x ∈ C be arbitrary. If (x)fj = y 6= x then → − → is an edge of colour j; as C is not merged by − xy E j , we must have (x)fj = y ∈ C and (as x was arbitrary and fj is a bijection) it follows that (C)fj = C. Now apply this lemma with W = T (R); for any C ⊆ [n] spanning a component of GT (R) with C ∈ / Mj , (C)fj = C. As Zj consists of all vertices in components of → − GT (R) not merged by E j , we have that (Zj )fj = Zj , and thus that (Yj )fj = Yj . We will now formally define the information associated with a rack R. Definition 4.11. Let R = ([n], ⊲) be a rack and let ∆ = (log2 n)3 . Then with notation as above let M be the (|S6∆ (R)| − |T (R)|)-tuple M := (Mj )j∈S6∆ (R)\T (R) , where we order the vertices in some arbitrary way, and let [ Y := (Yj × {j}) ⊆ [n]2 . j∈S6∆ (R)\T (R) We define  I(R) := S6∆ (R), ⊲|[n]×S>∆ , T (R), ⊲|T (R)×[n] , ⊲|[n]×T + (R) , M, ⊲|Y . 10 As i ⊲ j = (i)fj , the second entry of this 7-tuple is equivalent to the set of maps (fj )j∈S>∆ (R) or alternatively the graph GS>∆ (R) . The fourth entry is equivalent to the set of maps (fj |T (R) )j∈[n] ; from Lemma 4.7, the image of each of these maps is contained within S6∆ (R). Knowing the fourth entry determines Γ+ R (T (R)), which is necessary for the fifth entry. Note also that the fifth entry is equivalent to the set of maps (fj )j∈T + (R) and thus the graph GT + (R) , while the seventh entry is equivalent to (fj |Yj )j∈S6∆ (R)\T (R) . We will think of I as a map from Rn to a set of 7-tuples; the form of this set will be considered in more detail in Section 6. In the next section, we show that the image I(Rn ) is small. We will do this by first considering the map I ′ , where I ′ (R) = (I1 (R), I2 (R)) and then I ′′ , where I ′′ (R) = (I3 (R), . . . , I7 (R)). Determining the information I(R) 5 5.1 Random subsets The part of the argument relating to the vertices of high degree requires some probabilistic tools. In particular, we will require a result of Hoeffding [7] known as the Chernoff bounds; we will use the following, more workable version (see for example Theorems 2.1 and 2.8 and Corollary 2.3 of [8]). Theorem 5.1. Let X1 , . . . , Xn be Pindependent random variables, each taking values in the range [0, 1]. Let X = ni=1 Xi . Then for any ǫ ∈ [0, 1], P(X > (1 + ǫ)E[X]) 6 e−ǫ and P(X 6 (1 − ǫ)E[X]) 6 e−ǫ 2 E[X]/3 2 E[X]/2 . + Let R = ([n], ⊲) be a rack. To ease notation, we write d+ v = dR (v) for any v ∈ [n]. Lemma 5.2. Let R = ([n], ⊲) be a rack and let p, ǫ ∈ (0, 1). Construct a random subset X of [n] by retaining each element with probability p, independently for all elements. Then 1. P(|X| > (1 + ǫ)np) 6 e−ǫ 2 np/3 ;  + −ǫ2 δ/2 . 2. For any v ∈ [n] and 0 < δ 6 d+ v p, P dX (v) 6 (1 − ǫ)δ 6 e Proof. For each j, let Xj = 1{j∈X} , soP that each Xj ∼ Ber(p) and the variables (Xj )nj=1 are independent. Then |X| = nj=1 Xj ∼ Bi(n, p) and E[X] = np, so we can apply Theorem 5.1 to |X|, showing the first statement. 11 For the second statement, take a vertex v ∈ [n] and let v1 , . . . , vd+ be the v 0 + out-neighbours of v in GR ; for each 1 6 i 6 dv , choose an element jvi ∈ [n] such that (v)fjvi = vi and put Jv := {jvi | i = 1, . . . , d+ v }. The elements jv1 , . . . , jvd+ are clearly distinct and so |Jv | = d+ v . Now v + |Jv ∩ X| = dv X Xjvi ∼ Bi(d+ v , p), i=1 + so E[|Jv ∩X|] = d+ v p and we can apply Theorem 5.1 to see that for any 0 < δ 6 dv p,   2 −ǫ2 d+ v p/2 P |Jv ∩ X| 6 (1 − ǫ)δ 6 P |Jv ∩ X| 6 (1 − ǫ)d+ 6 e−ǫ δ/2 . vp 6e Since d+ X (v) > |Jv ∩ X|, the second result follows. 5.2 The high degree part We will need the following crucial lemma. Lemma 5.3. Let R = ([n], ⊲) be a rack and T ⊆ [n]. Let C span a component of GT , and let v ∈ C. Let A ⊆ [n] be [n]-invariant. Then knowledge of the maps (fi |A )i∈T and fv |A is sufficient to determine the maps (fu |A )u∈C , and further, the maps (fu |A )u∈C are conjugate in Sym(A). Proof. Let u ∈ C, so from Lemma 2.5 there is a directed vu-path in GT . Let the colours of the edges of this path be i1 , . . . , il , so (v)fi1 · · · fil = u and thus from · · · fi−1 fv fi1 · · · fil . As A is [n]-invariant, (A)fij = A for any Lemma 2.2 fu = fi−1 1 l j, and thus |A · · · fi−1 | f | f | · · · fil |A . fu |A = fi−1 1 A v A i1 A l But as each ij ∈ T , all of these maps are determined and thus fu |A is determined. Also note that fu |A is conjugate to fv |A by the map (fi1 · · · fil )|A , proving the result. We will now show the first main result of this section. Proposition 5.4. Let R = ([n], ⊲) be a rack. Then for n sufficiently large there exists a set W ⊆ [n], with |W | 6 w0 (n) := n 7 , 2 (log2 n)3/2 (5.1) such that I ′ (R) = (I1 (R), I2 (R)) is determined by the sets S6∆ (R) and W and the maps (fi )i∈W . 12 Proof. We will construct the set W by a mixture of probabilistic and deterministic arguments. Let p = (log2 n)−3/2 and consider a random subset X of [n] as described in Lemma 5.2. Let E be the event that |X| 6 3np/2; from item 1 of the lemma (with ǫ = 1/2) we have that P(E c ) 6 P(|X| > 3np/2) 6 e−np/12 . Since np → ∞ as n → ∞, it follows that P(E c ) < 1/2 if n is large enough. 3/2 /2, and Now for each v ∈ [n] and U ⊆ [n], call v U -bad if d+ U (v) 6 (log 2 n)  + let Bv be the event that v is X-bad, so that P(Bv ) = P dX (v) 6 (log2 n)3/2 /2 . Let NP = N (X) denote the number of X-bad vertices in S>∆ := S>∆ (R), so that 3/2 for each v ∈ S N = v∈S>∆ 1Bv . Now d+ >∆ ; hence from v p > ∆p = (log2 n) item 2 of Lemma 5.2 (with ǫ = 1/2 and δ = ∆p), X X  3/2 3/2 E[N ] = P(Bv ) = /2 6 e−(log2 n) /8 |S>∆ |. P d+ X (v) 6 (log 2 n) v∈S>∆ v∈S>∆ Let F be the event that N = 0, i.e. that every vertex in S>∆ is X-good. Then from Markov’s Inequality 3/2 /8 P(F c ) = P(N > 1) 6 E[N ] 6 |S>∆ |e−(log2 n) 3/2 /8 6 ne−(log2 n) →0 as n → ∞. Hence P(F c ) < 1/2 if n is large enough. If n is large enough, then P(E c ∪ F c ) < 1/2 + 1/2 = 1, and thus P(E ∩ F) > 0. Hence we can find a set U ⊆ [n] such that |U | 6 3np/2 and each vertex in S>∆ is 3/2 /2 whenever v ∈ S U -good; this means that d+ >∆ , or in graphical U (v) > (log 2 n) terms, that each vertex v ∈ S>∆ is adjacent to at least (log2 n)3/2 /2 vertices in G0U . Now from Lemma 4.7 there are no edges from S>∆ to S6∆ = [n] \ S>∆ , so S>∆ is a disjoint union of vertex sets of components of G0U . Each component of G0U contained within S>∆ has size at least (log2 n)3/2 /2 + 1 and hence there are at most 2|S>∆ |(log2 n)−3/2 such components. Write the vertex sets of these components as {C1 , . . . , Cr } and take a set of vertices V = {v1 , . . . , vr } such that vk ∈ Ck for each k; we have shown that |V | = r 6 2n . (log2 n)3/2 Now from Lemma 5.3 (with T = U and A = [n]), knowledge of the maps (fi )i∈U and fvk is sufficient to determine the maps (fu )u∈Ck ; applying this to each component in turn shows that knowledge of the maps (fi )i∈U and (fv )v∈V is sufficient to determine (fu )u∈S>∆ , i.e. the second entry of I ′ (R). So put W = U ∪ V ; as |U | 6 3n(log2 n)−3/2 /2 we have the result. Corollary 5.5. Let ǫ > 0. There exists some positive integer n1 such that for all 2 n > n1 , |I ′ (Rn )| 6 2ǫn . 13 Proof. Take n sufficiently large for the previous result to hold; then I ′ (R) is determined by S6∆ (R) (or equivalently S>∆ (R)), W and the maps (fi )i∈W for a suitable set W depending on R, with |W | 6 w0 (n). Now fix such an n; it follows that |I ′ (Rn )| is at most the number of distinct triples (S6∆ (R), W, (fi )i∈W ) arising from all racks in Rn . There are clearly at most 2n possibilities for each of S6∆ (R) and W ; as there are n! 6 nn choices for any map fi , and |W | 6 w0 (n), there are at most nnw0 (n) possibilities for the maps (fi )i∈W . Hence |I ′ (Rn )| 6 22n nnw0 (n) , and from (5.1) we have that   log2 22n nnw0(n) = 2n + n(log2 n)w0 (n) = 2n + n(log2 n) = 2n + 7 n 2 (log2 n)3/2 n2 7 2 (log2 n)1/2 = o(n2 ). Hence for any ǫ > 0, there exists a positive integer n1 such that for n > n1 , 2 |I ′ (Rn )| 6 22n nnw0 6 2ǫn . 5.3 Components of the graph GT (R) In order to prove that there are few choices for I ′′ (R) = (I3 (R), . . . , I7 (R)), we will need the following lemma. Recall that T (R) ⊆ S6∆ (R) is defined in Construction 4.8 and that T + (R) = T (R) ∪ Γ+ R (T (R)). Lemma 5.6. Let R = ([n], ⊲) be a rack. Let C span a component of GT (R) , and let v ∈ C. Then for any j ∈ [n], knowledge of the maps (fl |T (R) )l∈[n] and (fi )i∈T + (R) and the vertex (v)fj is sufficient to determine the map fj |C . As in Definition 4.11, the maps (fl |T (R) )l∈[n] determine the set Γ+ R (T (R)) and + thus the set T (R). Proof. Let u ∈ C; from Lemma 2.5 there is a directed vu-path in GT (R) (note that this graph is determined from the maps (fi )i∈T (R) , knowledge of which is → − assumed). Let d (v, u) denote the length of the shortest directed vu-path; we will → − show that (u)fj is determined by induction on the graph distance d = d (v, u). The base case d = 0 is true by assumption, so take d > 0 and suppose the result is true for smaller d. Take a shortest directed path (of length d) from v to u and let w be the → is an edge in G penultimate vertex on the path; then − wu T (R) , so there exists some i ∈ T (R) such that (w)fi = u. As we know fj |T (R) , k := (i)fj is determined; + as k ∈ T (R) ∪ Γ+ R (T (R)) = T (R), the map fk is also determined. Further, → − d (v, w) = d − 1, so by the inductive hypothesis the vertex (w)fj is determined. 14 Now fk = f(i)fj = fj−1 fi fj , and so fj = fi−1 fj fk ; hence (u)fj = (u)fi−1 fj fk = (w)fj fk , which is determined as we know the vertex (w)fj and the map fk . The result follows by induction. We can now show the second main result of this section. Proposition 5.7. Let ǫ > 0. Then there exists a positive integer n2 such that for 2 any n > n2 , |I ′′ (Rn )| 6 2ǫn . Proof. As in Corollary 5.5, |I ′′ (Rn )| is equal to the number of distinct values of the 5-tuple I ′′ (R) as R ranges over all racks of order n; we will produce bounds for each of these entries. There are clearly at most 2n choices for the set T (R); recall that by construction |T (R)| 6 L = ⌊(log2 n)2 ⌋ and that T (R) ⊆P S6∆ (R), so d+ R (v) = + + |Γ+ (v)| 6 ∆ for any v ∈ T (R). It follows that |Γ (T (R))| 6 d (v) 6 L∆ v∈T (R) R R R + and thus that |T (R)| 6 L + L∆. There are at most n possibilities for the vertex (u)fi for any i, u ∈ [n], so there are at most (nL )n possibilities for the maps (fj |T (R) )j∈[n] and at most (nn )L+L∆ possibilities for the maps (fi )i∈T + (R) ; hence there are at most 2n n(2+∆)Ln possible values for the first three entries of I ′′ (R) (as R ranges over all racks of order n). Now consider a rack R ∈ Rn and suppose that the first three entries of I ′′ (R) have been determined. Fix a j ∈ S6∆ (R)\T (R); we must consider the possibilities → − for the set Mj of components of GT (R) merged by E j , and the restricted map fj |C for each C ∈ Mj . If |Mj | = aj then there are (crudely) at most naj possibilities for Mj , as there are at most n components of GT (R) ; from Lemma 4.9, aj = |Mj | 6 2n(log2 n)−2 , so the number of possibilities for Mj is at most ⌊2n(log2 n)−2 ⌋ X aj =0 n aj 6  2n 1+ (log2 n)2  −2 n2n(log2 n) −2 6 3n · n2n(log2 n) , for sufficiently large n. Now take a C ∈ Mj and choose an arbitrary v ∈ C; as the maps (fl |T (R) )l∈[n] and (fi )i∈T + (R) have been determined already, we have from Lemma 5.6 that the restriction fj |C is determined entirely by (v)fj . There are at most n possibilities for this vertex, and so considering the |Mj | components −2 making up Yj , there are at most n|Mj | 6 n2n(log2 n) possibilities for the restriction fj |Yj . Now note that M and ⊲|Y are determined by Mj and fj |Yj for each j ∈ S6∆ (R) \ T (R); as there are at most n such elements regardless of the set S6∆ (R), 2 −2 2 −2 there are at most (3n)n n2n (log2 n) possibilities for M and at most n2n (log2 n) possibilities for ⊲|Y . Combining these bounds, there are at most 2n n(2+∆)Ln (3n)n n4n 2 (log 2 n)−2 = (6n)n n(2+∆)Ln+4n 15 2 (log 2 n)−2 =: Λn possibilities for I ′′ (R) as R ranges over all racks of order n, for n sufficiently large, and thus |I ′′ (Rn )| 6 Λn . We have that ∆ = (log2 n)3 , so 2 + ∆ 6 2(log 2 n)3 for sufficiently large n. Thus for n sufficiently large   4n2 log2 (Λn ) = n log2 (6n) + (log2 n) (2 + ∆)Ln + (log2 n)2 4n2 6 n log2 (6n) + 2n(log2 n)6 + log2 n 2 = o(n ). Hence for any ǫ > 0, there exists a positive integer n2 such that for n > n2 , 2 |I ′′ (Rn )| 6 Λn 6 2ǫn , proving the result. 6 6.1 Maps acting within components of GT (R) Some preparatory results We will need the following easy claim. Claim 6.1. For real numbers x, y > 0, xy/3 + x2 /9 6 (x + y)2 /8. Proof. Simply observe that (x + y)2 /8 − x2 /9 − xy/3 = (x − 3y)2 /72 > 0. The above claim is used to prove the following key technical lemma. The notation is chosen to match the quantities defined in the next subsection. Lemma 6.2. Let nPbe a positive integer and (ηq )nq=1 be a sequence of non-negative integers such that nq=1 ηq = n. Set  Then ζ 6 n2 /4. ζ= p=1   n X log2 q   ηq . p q q=1 n X ηp Proof. By expanding the product, we have that n−1 n n X log2 q 2 X X log2 p + log2 q ηp ηq η + ζ= q 2 q p=1 q=p+1 pq q=1 and n n−1 n n2 (η1 + · · · + ηn )2 X ηq2 X X ηp ηq = = + , 4 4 4 2 q=1 16 p=1 q=p+1 (6.1) so if we set ν = n2 /4 − ζ, then ν= n X dq ηq2 + n−1 X n X cp,q ηp ηq , p=1 q=p+1 q=1 where dq := 1/4 − (log2 q)/q 2 and cp,q := 1/2 − (log2 (pq))/pq. Since 2r > r 2 for all positive integers r 6= 3, cp,q > 0 for (p, q) 6= (1, 3). 2 Similarly, 2r > r 4 for all positive integers r and thus dq > 0 for all q; hence ν > d1 η12 + d3 η32 + c1,3 η1 η3 . We can bound this sum from below by using Claim 6.1 with x = η3 and y = η1 ; we have that     η12 1 log2 3 1 log2 3 2 2 2 d1 η1 + d3 η3 + c1,3 η1 η3 = + − − η3 + η1 η3 4 4 9 2 3   η1 η3 η32 η12 η32 η1 η3 + + − (log2 3) + = 4 4 2 3 9 > (η1 + η3 )2 (η1 + η3 )2 − (log2 3) 4 8 > 0. A more elaborate version of this argument gives a corresponding stability result, saying (informally speaking) that ζ is close to n2 /4 if and only if η2 is close to n and ηq is close to 0 for all q 6= 2; for full details see [1]. 6.2 Proof of Theorem 1.1 At the end of Section 4, we introduced the information I(R) in a rack R on [n], and explained how I can be thought of as a map from Rn to a set of 7-tuples; let us call this set In . In Section 5 we showed that the image I(Rn ) ⊆ In has 2 size at most 2o(n ) ; in this section, we will fix an I in this image and consider all racks R ∈ Rn such that I(R) = I. We will show that once the information corresponding to I is known, there are not too many possibilities for R. We will first consider the set In of 7-tuples in more detail. From Definition 4.11 and the subsequent discussion, each I = (I1 , . . . , I7 ) ∈ In has the form described below. 1. I1 is a set S I ⊆ [n]; 2. I2 is an (n−|S I |)-tuple (σiI ) of elements of Sym([n]), indexed by S̃ I := [n]\S I in some arbitrary order; 17 3. I3 is a subset T I of [n] such that T I ⊆ S I ; 4. I4 is an n-tuple (τiI )ni=1 of injective maps from T I to S I ; 5. I5 is a sequence (σiI ) of elements of Sym([n]), indexed by the set (T I )+ := T I ∪ (T I )τ1I ∪ · · · ∪ (T I )τnI in some arbitrary order. The last two entries of I(R) are graphical in nature; to relate them to an abstract I ∈ In we will formally define the graph associated with such a 7-tuple I. Definition 6.3. Let I ∈ In . Write ΣI = {σiI | i ∈ T I } and define GI := GΣI , in the sense of Definition 2.3, so GI is a |T I |-edge-coloured multigraph on [n]. We write cI for cp(GI ) and C I for the set of vertex sets of components of GI , so |C I | = cI . We can now describe the form of I6 and I7 , namely: 6. I6 is a sequence (MjI ) of subsets of C I , indexed by S I \ T I in some arbitrary order; S 7. I7 is a sequence (ψjI ) indexed by S I \ T I , where YjI = C∈M I C and ψjI ∈ j Sym(YjI ) for all j. To avoid later inconvenience, we will extend the definition of MjI and YjI to all j ∈ [n] as follows. For each j ∈ S̃ I ∪ T I , define a set of ordered pairs from [n] (which we can think of as edges of colour j) by setting −I → → | (x)σ I = y, x 6= y}. E j := {− xy j (6.2) S → − Then we define MjI = M (GI , E Ij ) and YjI = C∈M I C. j Now fix an I ∈ In and suppose R ∈ Rn is a rack such that I(R) = I. Recall that ∆ = (log2 n)3 and  I(R) = S6∆ (R), ⊲|[n]×S>∆ , T (R), ⊲|T (R)×[n] , ⊲|[n]×T + (R) , M, ⊲|Y , where each entry defined by ⊲ can also be determined in terms of the maps f1 , . . . , fn corresponding to R. Comparing I(R) with I we see that S6∆ (R) = S I , S>∆ (R) = S̃ I and T (R) = T I . We also have that fj = σjI for j ∈ S̃ I ∪ (T I )+ , and thus GT (R) = GI . Finally, MjI = Mj and YjI = Yj for all j ∈ [n], and fj |Yj = ψjI for j ∈ S I \ T I . This means that if the information I = I(R) is known, we need only determine the maps (fj |Zj )j∈S6∆ (R)\T (R) to determine the entire rack R, noting that for each j ∈ [n], the set Zj = [n] \ Yj = [n] \ YjI is determined by I. It follows that an upper bound on the number of possibilities for these maps is also an upper bound for the number of racks R such that I(R) = I. We can further reduce the number of maps left to determine by considering components of the graph GI . 18 Lemma 6.4. Let I ∈ In be fixed and let R ∈ Rn be a rack such that I(R) = I. Let C I = {C1 , . . . , CcI } and let V = {v1 , . . . , vcI } be a set of vertices such that vj ∈ Cj for each j. Then R is determined by I and the maps (fv |Zv )v∈V . Proof. As I(R) = I, we have that GT (R) = GI and so the set of (vertex sets of) components of T (R) is C I . Take any j = 1, . . . , cI ; the knowledge of I determines the maps (fi )i∈T (R) = (σiI )i∈T I and thus from Lemma 5.3 (with A = [n]) knowledge of the map fvj is sufficient to determine the maps (fu )u∈Cj . Applying this over all the components of GT (R) shows that we can determine the entire rack R by determining the set of maps (fv )v∈V . As the restrictions (fv |Yv )v∈V are determined by I (fv |Yv = fv |YvI is equal to ψvI if v ∈ S I \ T I and to σvI |YvI otherwise), we need only determine the restrictions (fv |Zv )v∈V . Before proving an upper bound we will need some more notation. For I ∈ In and 1 6 q 6 n, let ηqI denote the number of vertices in components of GI of size exactly q. Then there are ηqI /q components of size exactly q and thus n= n X ηqI I and c = n X ηqI q=1 q=1 q . Proposition 6.5. Let I ∈ In and define    n n I X X η log2 q I  p ηq . ζI =  p q q=1 p=1 I Then there are at most 2ζ racks R ∈ Rn such that I(R) = I. Proof. Write C I = {C1 , . . . , CcI } and let V = {v1 , . . . , vcI } be a set of vertices such that vj ∈ Cj for each j. Let R ∈ Rn be a rack such that I(R) = I; from Lemma 6.4, R is determined by I and the maps (fv |Zv )v∈V . It follows that an upper bound on the number of possibilities for the maps (fv |Zv )v∈V is also an upper bound for the number of racks R such that I(R) = I. Now fix a v ∈ V . Let C ⊆ [n] span a component of GT (R) = GI with C ∈ / Mv , and let x ∈ C; from Lemma 4.10 (with W = T (R)), (C)fv = C and so in particular there are at most |C| possibilities for (x)fv . Now (fj |T (R) )j∈[n] = (τjI )j∈[n] and (fi )i∈T + (R) = (σiI )i∈(T I )+ are determined by I = I(R), so from Lemma 5.6 fv |C is determined by (x)fv . Thus there are at most |C| possibilities for fv |C . As there are ηqI /q components of GT (R) = GI of size q, there are at most N := Qn ηqI /q possibilities for the map fv |Zv . Considering all of the cI components q=1 q I together, there are at most N c possibilities for the maps (fv |Zv )v∈V ; it follows 19 I that there are at most N c racks R such that I(R) = I. Now n  I X ηqI log2 N c = cI log2 q q q=1    n n X X ηpI ηqI  = log2 q  p q p=1 q=1 = ζI, proving the result. This proposition allows us to prove the main result. Proof of Theorem 1.1. Recall that R′n denotes the set of isomorphism classes of racks of order n; as |R′n | 6 |Rn | it suffices to find an upper bound on |Rn |. Let ǫ > 0; we have from Corollary 5.5 and Proposition 5.7 that for n sufficiently large 2 2 |I ′ (Rn )| 6 2ǫn /2 and |I ′′ (Rn )| 6 2ǫn /2 . Now take such a sufficiently large n; as 2 I(R) = (I ′ (R), I ′′ (R)) for any R ∈ Rn , |I(Rn )| 6 |I ′ (Rn )||I ′′ (Rn )| 6 2ǫn , and so 2 there are at most 2ǫn possibilities for the 7-tuple I ∈ I(Rn ). From Proposition 6.5 2 I and Lemma 6.2, there are at most 2ζ 6 2n /4 racks R such that I(R) = I, and 2 2 thus |Rn | 6 2ǫn 2n /4 . 7 An extremal result For each positive integer n, let Pn be a partition of [n], and let RPn denote the set of racks R on [n] such that the components of GR are exactly the parts of Pn . Let m2 (n) denote the number of parts of Pn of size exactly two; an extension of the methods used in this paper can be used to prove that unless m2 (n) ∼ n/2 2 there exists a constant 0 < κ < 1/4 such that |RPn | 6 2κn for infinitely many n. In other words, informally speaking, almost all (in an exponentially strong sense) racks R on [n] are such that almost all components of GR have size 2. The idea of the proof is to find a function similar to ζ from Proposition 6.5, but taking into account the size of the components of GR rather than GT (R) ; the components of size two are a special case as the symmetric group on two elements is small and abelian. For a full proof, see [1]. References [1] Matthew Ashford. Graphs of Algebraic Objects. PhD thesis, University of Oxford, 2016. [2] Simon R Blackburn. Enumerating finite racks, quandles and kei. The Electronic Journal of Combinatorics, 20(3):P43, 2013. 20 [3] F.J.B.J. Clauwens. arXiv:1011.2456, 2010. Small connected quandles. arXiv preprint [4] Roger Fenn and Colin Rourke. Racks and links in codimension two. Journal of Knot theory and its Ramifications, 1(04):343–406, 1992. [5] Richard Henderson, Todd Macedo, and Sam Nelson. Symbolic computation with finite quandles. Journal of Symbolic Computation, 41(7):811–817, 2006. [6] Benita Ho and Sam Nelson. Matrices and finite quandles. Homology, Homotopy and Applications, 7(1):197–208, 2005. [7] Wassily Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American Statistical Association, 58(301):13–30, 1963. [8] Svante Janson, Tomasz Luczak, and Andrzej Ruciński. Random Graphs. John Wiley & Sons, 2011. [9] Přemysl Jedlička, Agata Pilitowska, David Stanovskỳ, and Anna ZamojskaDzienio. The structure of medial quandles. Journal of Algebra, 443:300–334, 2015. [10] David Joyce. A classifying invariant of knots, the knot quandle. Journal of Pure and Applied Algebra, 23(1):37–65, 1982. [11] Sergei Vladimirovich Matveev. Distributive groupoids in knot theory. Sbornik: Mathematics, 47(1):73–83, 1984. [12] Sam Nelson. The combinatorial revolution in knot theory. Notices of the AMS, 58(11):1553–1561, 2011. [13] Leandro Vendramin. On the classification of quandles of low order. Journal of Knot Theory and Its Ramifications, 21(09):1250088 (10 pages), 2012. 21
4math.GR
Generalized Minimum Distance Estimators in Linear Regression with Dependent Errors arXiv:1701.01199v1 [math.ST] 5 Jan 2017 Jiwoong Kim University of Notre Dame Abstract This paper discusses minimum distance estimation method in the linear regression model with dependent errors which are strongly mixing. The regression parameters are estimated through the minimum distance estimation method, and asymptotic distributional properties of the estimators are discussed. A simulation study compares the performance of the minimum distance estimator with other well celebrated estimator. This simulation study shows the superiority of the minimum distance estimator over another estimator. KoulMde (R package) which was used for the simulation study is available online. See section 4 for the detail. Keywords: Dependent errors; Linear regression; Minimum distance estimation; Strongly mixing 1 Introduction Consider the linear regression model yi = x′i β + εi , (1.1) where Eεi ≡ 0, xi = (1, xi2 , ..., xip )′ ∈ Rp with xij , j = 2, · · · , p, i = 1, · · · , n being non random design variables, and where β = (β1 , ..., βp )′ ∈ Rp is the parameter vector of interest. The methodology where the estimators are obtained by minimizing some dispersions or pseudo distances between the data and the underlying model is referred to as the minimum distance (m.d.) estimation method. In this paper we estimate regression parameter vector β by the m.d. estimation method when the collection of εi in the model (1.1) is a dependent process. Let T1 , ..., Tn be independent identically distributed (i.i.d.) random variables (r.v.’s) with distribution function (d.f.) Gϑ where ϑ is unknown. The classical m.d. estimator of ϑ is obtained by minimizing following Cramèr-von Mises (CvM) type L2 -distance (1.2) Z  2 Gn (y) − Gϑ (y) dH(y) 1 where Gn is an empirical d.f. of Ti ’s and H is a integrating measure. There are multiple reasons as to why CvM type distance is preferred, including the asymptotic normality of the corresponding m.d. estimator; see, e.g., Parr and Schucany (1980), Parr (1981) and Millar (1981). Many researchers have tried various H’s to obtain the m.d. estimators. Anderson and Darling (1952) proposed Anderson-Darling estimator obtained by using dGϑ /{Gϑ (1 − Gϑ )} for dH. Another important example includes H(y) ≡ y, giving a rise to Hodges - Lehmann type estimators. If Gn and Gϑ of the integrand are replaced with kernel density estimator and assumed density function of Ti , the Hellinger distance estimators will be obtained; see Beran (1977). Departing from one sample setup, Koul and DeWet (1983) extended the domain of the application of the m.d. estimation to the regression setup. On the assumption that εi ’s are i.i.d. r.v.’s with a known d.f. F , they proposed a class of the m.d. estimators by minimizing L2 -distances between a weighted empirical d.f. and the error d.f. F . Koul (2002) extended this methodology to the case where error distribution is unknown but symmetric around zero. Furthermore, it was shown therein that when the regression model has independent nonGaussian errors the m.d. estimators of the regression parameters — obtained by minimizing L2 -distance with various integrating measures — have the least asymptotic variance among other estimators including Wilcoxon rank, the least absolute deviation (LAD), the ordinary least squares (OLS) and normal scores estimators of β: e.g. the m.d. estimators obtained with a degenerate integrating measure display the least asymptotic variance when errors are independent Laplace r.v’s. However, the efficiency of the m.d. estimators depends on the assumption that errors are independent; with the errors being dependent, the m.d. estimation method will be less efficient than other estimators. Examples of the more efficient methods include the generalized least squares (GLS); GLS is nothing but regression of transformed yi on transformed x′i . The most prominent advantage of using the GLS method is “decorrelation” of errors as a result of the transformation. Motivated by efficiency of m.d. estimators — which was demonstrated in the case of independent non-Gaussian errors — and the desirable property of the GLS (decorrelation of the dependent errors), the author proposes generalized m.d. estimation method which is a mixture of the m.d. and the GLS methods: the m.d. estimation will be applied to the transformed variables. “Generalized” means the domain of the application of the m.d. method covers the case of dependent errors; to some extent, the main result of this paper generalizes the work of Koul (2002). As the efficiency of the m.d. method is demonstrated in the case of independent errors, the main goal of this paper is to show that the generalized m.d. estimation method is still competitive when the linear regression model has dependent errors; indeed, the simulation study empirically shows that the main goal is achieved. 2 The rest of this article is organized as follows. In the next section, characteristics of dependent errors used through this paper is studied. Also, the CvM type distance and various processes — which we need in order to obtain the estimators of β — will be introduced. Section 3 describes the asymptotic distributions and some optimal properties of the estimators. Findings of a finite sample simulations are described in Section 4. All the proofs are deferred until Appendix. In the remainder of the paper, an Italic and boldfaced variable denotes a vector while a non-Italic and boldfaced variable denotes a matrix. An identity matrix will carry a suffix showing its dimension: e.g. In×n denotes a n × n identity matrix. R For a function f : R → R, let |f |2H denote f 2 (y) dH(y). For a real vector u ∈ Rp , kuk denotes Euclidean norm. For any r.v. Y , kY kp denotes (E|Y |p )1/p . For a real matrix W and y ∈ R, W(y) means that its entries are functions of y. 2 Strongly mixing process & CvM type distance l be the σ-field generated by εm , εm+1 , ..., εl , m ≤ l. The sequence {εj , j ∈ Z} is said Let Fm to satisfy the strongly mixing condition if  0 α(k) := sup |P (A ∩ B) − P (A)P (B)| : A ∈ F−∞ , B ∈ Fk∞ → 0, as k → ∞. α is referred to as mixing number. Chanda (1974), Gorodetskii (1977), Koul (1977), and Withers (1979) investigated the decay rate of the mixing number. Having roots in their works, Section 3 defines the decay rate assumed in this paper; see, e.g., the assumption (a.8). Hereinafter the errors εi ’s are assumed to be strongly mixing with mixing number α. In addition, εi is assumed to be stationary and symmetric around zero. Next, we introduce the basic processes and the distance which are required to obtain desired result. Recall the model (1.1). Let X denote the n × p design matrix whose ith row vector is x′i . Then the model (1.1) can be expressed as y = Xβ + ε, where y = (y1 , y2 , ..., yn )′ ∈ Rn and ε = (ε1 , ε2 , ..., εn )′ ∈ Rn Let Q be any n × n real matrix so that the inverse of Q2 is a positive definite symmetric matrix. Note that the diagonalization of positive definite symmetric matrix guarantees the existence of Q which is also a symmetric matrix. Let q ′i = (qi1 , ..., qin ) for 1 ≤ i ≤ n denote the ith row vector of Q. Define transformed variables yei = q ′i y, e ′2 = q ′i X, x εei = q ′i ε, 3 1 ≤ i ≤ n. As in the GLS method, Q obtained from covariance matrix of ε transforms dependent errors into uncorrelated ones, i.e., “decorrelates” the errors. However, the GLS obtains Q in a slightly different manner. Instead of using Q2 , the GLS equates Q′ Q to the inverse of the covariance matrix, i.e., the GLS uses Cholesky decomposition. The empirical result in Section 4 describes that Q from the diagonalization yields better estimators. Here we propose the class of the generalized m.d. estimators of the regression parameter upon varying Q. We impose Noether (1949) condition on QX. Now let A = (X′ Q2 X)−1/2 and aj denote jth column of A. Let D = ((dik )), 1 ≤ i ≤ n, 1 ≤ k ≤ p, be an n × p matrix of real numbers and dj denote jth column of D. As stated in Koul (2002, p.60), if D = QXA ( i.e., dik = q ′i Xak ), then under Noether condition, (2.1) n X d2ik = 1, max d2ik = o(1) 1≤i≤n i for all 1 ≤ k ≤ p. Next, define CvM type distance from which the generalized m.d. estimator are obtained. Let fi and Fi denote the density function and the d.f. of εei , respectively. Analogue of (1.2) — with Gn and Gϑ being replaced by empirical d.f. of εei and Fi — will be a reasonable candidate. However, the d.f. Fi is rarely known. Since the original regression error εi ’s are assumed to be symmetric, the transformed error εei ’s are also symmetric; therefore we introduce, as in Koul (2002; Definition 5.3.1), Uk (y, b; Q) := n X i=1 n o  dik I q ′i y − q ′i Xb ≤ y − I − q ′i y + q ′i Xb < y , U (y, b; Q) := (U1 (y, b; Q), ..., Up (y, b; Q))′ , y ∈ R, Z L(b; Q) := kU (y, b; Q)k2 dH(y), b ∈ Rp , " n # p Z o 2 X n X   dik I q ′i y − q ′i Xb ≤ y − I − q ′i y + q ′i Xb < y , = k=1 i=1 where I(·) is an indicator function, and H is a σ−finite measure on R and symmetric around b as 0, i.e., dH(−x) = −dH(x), x ∈ R. Subsequently, define β b Q) = inf L(b; Q). L(β; p b∈R Next, define    e i :=  Q   q ′i 0′ .. . 0′     e :=  Q     ,   4 e1 Q e2 Q .. . en Q    ,   e i and Q e are n × n where q ′i is the ith row vector of Q and 0 = (0, ..., 0)′ ∈ Rn ; observe that Q and n2 × n matrices, respectively. Define a n × n2 matrix If (y) so that its (i, j)th entry is fi (y)I(j = n(i − 1) + 1): e.g., (k, k(k − 1) + 1)th entry is fk (y) for all 1 ≤ k ≤ n and all other entries are zeros. Finally, define following matrices: Z e ′ ΣD QXA, e (2.2) ΣD := I′ (y)DD′ If (y) dH(y), Σ := AX′ Q f b Let f H := which are needed for the asymptotic properties of β. ij Pp d d . Note that k=1 ik jk # " n n XX d∗ij fijH q i q ′j XA. Σ = AX′ R fi fj dH and d∗ij := i=1 j=1 3 b Asymptotic distribution of β b under the current setup. Note In this section we investigate the asymptotic distribution of β that minimizing L(·; Q) does not have the closed form solutions; only numerical solutions b To can be tried, and hence it would be impracticable to derive asymptotic distribution of β. redress this issue, define for b ∈ Rp Z 2 ∗ L (b; Q) = U (y, β; Q) + 2ΣDA (y)A−1 (b − β) dH(y), e where ΣDA (y) := D′ If (y)QXA is a p × p matrix. Next, define e Q) = inf L∗ (b; Q). L∗ (β; p b∈R Unlike L(·; Q), minimizing L∗ (·; Q) has the closed form solution. Therefore, it is not unb by one of β e if L(·; Q) can be reasonable to approximate the asymptotic distribution of β approximated by L∗ (·; Q). This idea is plausible under certain conditions which are called uniformly locally asymptotically quadratic; see Koul (2002, p.159) for the detail. Under b and β e converges to zero in probthese conditions, it was shown that difference between β b is ability; see theorem 5.4.1. The basic method of deriving the asymptotic properties of β similar to that of sections 5.4, 5.5 of Koul (2002). This method amounts to showing that L(β + Au; Q) is uniformly locally asymptotically quadratic in u belonging to a bounded b − β)k = Op (1). To achieve these goals we need the following assumptions set and kA−1 (β which in turn have roots in section 5.5 of Koul (2002). 5 (a.1) The matrix X′ Q2 X is nonsingular and, with A = (X′ Q2 X)−1/2 , satisfies lim sup n max kdj k2 < ∞. n→∞ 1≤j≤p (a.2) The integrating measure H is σ−finite and symmetric around 0, and Z ∞ (1 − Fi )1/2 dH < ∞, 0 1 ≤ i ≤ n. (a.3) For any real sequences {an }, {bn }, bn − an → 0, lim sup n→∞ Z bn an Z fi (y + x)dH(y)dx = 0, 1 ≤ i ≤ n. (a.4) For a ∈ R, define a+ := max(a, 0), a− := a+ − a. Let θi := kq ′i XAk. For all u ∈ Rp , kuk ≤ b, for all δ > 0, and for all 1 ≤ k ≤ p, lim sup n→∞ Z hX n i=1 i2  ′ ′ F (y + q XAu + δθ ) − F (y + q XAu − δθ ) d± dH(y) ≤ cδ 2 , i i i i i i ik where c does not depend on u and δ. (a.5) For each u ∈ Rp and all 1 ≤ k ≤ p, Z hX n i=1 i2  dik Fi (y + q ′i XAu) − Fi (y) − q ′i XAufi (y) dH(y) = o(1). (a.6) Fi has a continuous density fi with respect to the Lebesgue measure on (R, B) for i = 1, 2, ..., n. R∞ (a.7) 0 < 0 fir dH < ∞, for r = 1/2, 1, 2 and i = 1, 2, ..., n. (a.8) The {εi } in the model (1.1) is strongly mixing with mixing number α(·) satisfying lim sup n→∞ n−1 X k=1 k 2 α(k) < ∞. R∞ Remark 3.1. Note that (a.1) implies Noether condition and (a.2) implies 0 (1−Fi )dH < ∞. From Corollary 5.6.3 of Koul (2002), we note that in the case of i.i.d. errors, the asymptotic R b was established under the weaker conditions: Noether condition and ∞ (1 − normality of β 0 6 Fi )dH < ∞. The dependence of the errors now forces us to assume two stronger conditions (a.1) and (a.2). Remark 3.2. Here we discuss examples of H and F that satisfy (A.2). Clearly it is satisfied by any finite measure H. Next consider the σ-finite measure H given by dH ≡ {Fi (1−Fi )}−1 dFi , F a continuous d.f. symmetric around zero. Then Fi (0) = 1/2 and Z 0 ∞ (1 − Fi ) 1/2 dH = Z ∞ 0 (1 − Fi )1/2 dFi ≤ 2 Fi (1 − Fi ) Z 1 1/2 (1 − u)−1/2 du < ∞. Another useful example of a σ-finite measure H is given by H(y) ≡ y. For this measure, (a.2) is satisfied by many symmetric error d.f.s including normal, logistic, and Laplace. For example, for normal d.f., we do not have a closed form of the integral, but by using the well celebrated tail bound for normal distribution — see e.g., Theorem 1.4 of Durrett (2005) — we obtain Z ∞ Z ∞ 1/2 −1/2 y −1/2 exp(−y 2 /4)dy = (2/π)1/2 Γ(1/4). {1 − Fi (y)} dy ≤ (2π) 0 0 b corresponding to H(y) ≡ y is the extensions of the one Recall from Koul (2002) that the β sample Hodges-Lehmann estimator of the location parameter to the above regression model. R 1/2 Remark 3.3. Consider condition (a.7). If fi ’s are bounded then fi dH < ∞ implies the R 1/2 other two conditions in (a.7) for any σ-finite measure H. For H(y) ≡ y, fi (y)dy < ∞ when fi ’s are normal, logistic or Laplace densities. In particular, when dH = {Fi (1 − Fi )}−1 dFi and Fi ’s are logistic d.f.’s, so that dH(y) ≡ dy, this condition is also satisfied. We are ready to state the needed results. The first theorem establishes the needed uniformly locally asymptotically quadraticity while the corollary shows the boundedness of b Theorem 3.1 and Corollary 3.1 are counterparts of conditions a suitably standardized β. (A1̃) and (A5) in theorem 5.4.1 of Koul (2002), respectively. Note that condition (A4) in theorem 5.4.1 is met by (A.7) in the Appendix; condition (A6) in theorem 5.4.1 is trivial. Theorem 3.1. Let {yi , 1 ≤ i ≤ n} be in the model (1.1). Assume that (a.1)-(a.8) hold. Then, for any 0 < c < ∞, (3.1) E sup kA−1 (b−β)k≤c kL(b; Q) − L∗ (b; Q)k = o(1). Proof. See Appendix. Corollary 3.1. Suppose that the assumptions of Theorem 3.1 hold. Then for any ǫ > 0, 7 0 < M < ∞ there exists an Nε , and 0 < cǫ < ∞ such that (3.2) P  inf kA−1 (b−β)k≥cǫ L(b; Q) ≥ M  ≥ 1 − ǫ, ∀ n ≥ Nǫ . Proof. See Appendix. Theorem 3.2. Under the assumptions of Theorem 3.1, Z 1 −1 −1 b ′e′ A (β − β) = − Σ AX Q I′f (y)DU (y, β) dH(y) + op (1), 2 where Σ is as in (2.2). e −β). Therefore, Proof. Note that the first term in the right-hand side is nothing but A−1 (β the proof follows from Theorem 3.1 and Corollary 3.1, as in i.i.d. case illustrated in the theorem 5.4.1 of Koul (2002). Next, define Z Z −x x ψi (x) := fi (y) dH(y) − fi (y) dH(y), −∞ −∞ Z Zn := I′f (y)DU (y, β) dH(y). Symmetry of the Fi around 0 yields Eψi (e εj ) = 0 for 1 ≤ i, j ≤ n. Let ΣZZ denote covariance ′e′ matrix of AX Q Zn . Define a n × n matrix Σψ and write Σψ = ((γij )), 1 ≤ i ≤ p, 1 ≤ j ≤ p where n X n X γij = d∗il d∗jh E [ψi (q ′l ε)ψj (q ′h ε)] . l=1 h=1 Observe that ′ e e Zn Z′ QXA) = AX′ Q′ Σψ QXA. ΣZZ = E(AX′ Q n b Now, we are ready to state the asymptotic distribution of β. Lemma 3.1. Assume ΣZZ is positive definite for all n ≥ p. In addition, assume that sup u′ ΣZZ −1 u = O(1). u∈Rp ,kuk=1 Then −1/2 ′ e Zn →d N(0, Ip×p ), ΣZZ AX′ Q where 0 = (0, ..., 0)′ ∈ Rp and Ip×p is the p × p identity matrix. 8 e ′ Zn is Proof. To prove the claim, it suffices to show that for any λ ∈ Rp , λ′ ΣZZ −1/2 AX′ Q asymptotically normally distributed. Note that " # n n X  X e Zn = λ′ ΣZZ −1/2 AX′ Q λ′ ΣZZ −1/2 AX′ q i d∗ij ψi (q ′j ε) , ′ i=1 j=1 which is the sum as in the theorem 3.1 from Mehra and Rao (1975) with cni = λ′ ΣZZ −1/2 AX′ q i P and ξni = nj=1 d∗ij ψi (q ′j ε). Note that τc2 := n X 2 c2ni = λ′ Σ−1 ZZ λ, σn := E i=1 ( n " X  λ′ ΣZZ −1/2 AX′ q i i=1 n X d∗ij ψi (q ′j ε) j=1 #)2 = kλk2 . Also, observe that ′ 2 2 kλ′ Σ−1 ZZ k kAX q i k = max kAX′ q i k2 → 0, 1≤i≤n 1≤i≤n λ′ Σ−1 λ ZZ max c2ni /τc2 ≤ max 1≤i≤n by assumption (A.1). Finally, we obtain lim inf σn2 /τc2 ≥ kλk2 /(lim sup λ′ Σ−1 ZZ λ) > 0, n→∞ by the assumption that the terms in the denominator is O(1). Hence, the desired result follows from the theorem 3.1 of Mehra and Rao (1975). Corollary 3.2. In addition to the assumptions of Theorem 3.1, let the assumption of Lemma 3.1 hold. Then −1/2 b − β) →d 2−1 N(0, Ip×p ). ΣZZ ΣA−1 (β Proof. Claim follows from Lemma 3.1 upon noting that Z Zn = I′f (y)DU (y, β) dH(y). b denote the asymptotic variance of β. b Then we have Remark 3.4. Let Asym(β) b = 4−1 AΣ−1 ΣZZ Σ−1 A Asym(β) −1 −1 e ′ ΣD QXA) e e ′ ΣD QXA) e = 4−1 A(AX′ Q (AX′ Q′ Σψ QXA)(AX′ Q A Observe that if all the transformed errors have the same distribution, i.e., f1 = f2 = · · · = fn , 9 we have ′ e ΣD QXA e AX′ Q = (|f1 |2H )−1 Ip×p . b will be simplified as Therefore, Asym(β) (2|f1 |2H )−2 A(AX′ Q′ Σψ QXA)A. Moreover, if all the transformed errors are uncorrelated as a result of the transformation, b can be simplified further as Asym(β) τ (2|f1 |2H )−2 (X′ Q2 X)−1 , where τ = V ar(ψ1 (q ′1 ε)). 4 Simulation studies In this section the performance of the generalized m.d. estimator is compared with one of b denote covariance matrix of the errors and its the GLS estimators. Let Ω := E(εε′ ) and Ω estimate, respectively. Consequently we obtain the GLS estimator of β ′ b −1 ′ b −1 b β GLS = (X Ω X)(X Ω y). In order to obtain the generalized m.d. estimator, we try two different Q’s: Qs and Qc where b −1 . Q′c Qc = Ω b −1 , Q2s = Ω We refer to the generalized m.d. estimators corresponding to Qs and Qc as GMD1 and GMD2 estimators, respectively. In order to generate strongly mixing process for the dependent errors, the several restrictive conditions are required so that the mixing number α decays fast enough — i.e., the assumption (a.8) is met. Withers (1981) proposed the upperbound and the decay rate of the mixing number α. For the shake of completeness, we reproduce Theorem and Corollary 1 here. Lemma 4.1. Let {ξi } be independent r.v.s on R with characteristic functions {φi } such that (2π) −1 max i Z |φi (t)|dt < ∞ and max E|ξi |δ < ∞ for some δ > 0. i 10 Let {gv : v = 0, 1, 2, ...} be a sequence of complex numbers such that n omax(1,δ) St (min(1, δ)) →0 where St (λ) = ∞ X v=t Assume that as t → ∞ |gv |λ . gv = O(v −κ) where κ > 1 + δ −1 + max(1, δ −1 ). P Then the sequence {εn : εn = ∞ v=0 gv ξn−v } is strongly mixing with mixing number αl (k) = O(k −η ) where η = (κδ − max(δ, 1))(1 + δ)−1 − 1 > 0. To generate strongly mixing process by Lemma 4.1, we consider four independent ξi ’s: normal, Laplace, logistic, and mixture of the two normals (MTN). Note that all the ξi ’s have the finite second moments, and hence, we set δ at 2. It can be easily seen that for any κ > 7 we have η > 3, and hence the assumption (a.8) is satisfied. Then for ǫ > 0 (4.1) εn = ∞ X v −(7+ǫ) ξn−v v=0 satisfies the strongly mixing condition with α(k) = O(k −(3+ǫ) ). We let ǫ = 0.5, or equivalently, κ = 7.5. The ξ has a Laplace distribution if its density function is fLa (x) := (2s1 )−1 exp(−|x − µ1 |/s1 ) while the density function of Logistic innovation is given by 2 fLo (x) := s−1 2 exp(−|x − µ2 |/s2 )/(1 + exp(−|x − µ2 |/s2 )) . When we generate {ξi }ni=1 , we set mean of normal, Laplace, and logistic innovations at 0 (i.e., µ1 = µ2 = 0) since we assumed the ε, the sum of ξi ’s, is symmetric. We set the standard deviation of normal ξ at 2 while both s1 and s2 are set at 5 for Laplace and logistic, respectively. For MTN, we consider (1 − ǫ)N(0, 22 ) + ǫN(0, 102 ) where ǫ = 0.1. In each ξ, we subsequently generate {εi }ni=1 using (4.1). Next, we set the true β = (−2, 3, 1.5, −4.3)′, i.e., p = 4. For each k = 2, 3, 4, we obtain {xik }ni=1 in (1.1) as a random sample from the uniform distribution on [0, 50]; {yi }ni=1 is subsequently generated using models (1.1). We estimate β by the generalized m.d. and 11 the GLS methods. We report empirical bias, standard error (SE), and mean squared error (MSE) of these estimators. We use the Lebesgue integrating measure, i.e., H(y) ≡ y. To obtain the generalized m.d. estimators, the author used R package KoulMde. The package is available from Comprehensive R Archive Network (CRAN) at https://cran.r-project. org/web/packages/KoulMde/index.html. Table 1 and 2 report biases, SE’s and MSE’s of estimators for the sample sizes 50 and 100, each repeated 1,000 times. The author used High Performance Computing Center (HPCC) to accelerate the simulations. All of the simulations were done in the R-3.2.2. β1 N β2 β3 β4 β1 La β2 β3 β4 β1 Lo β2 β3 β4 β1 M β2 β3 β4 bias 0.0011 0.0036 -0.0023 0.0014 -3e-04 -0.0011 -0.0011 7e-04 -0.0111 -0.0034 -0.0027 0.003 -0.0024 0.0059 -0.002 -0.001 GLS SE 0.0798 0.0753 0.0784 0.0772 0.1085 0.1145 0.1129 0.1193 0.1438 0.1516 0.1465 0.1485 0.1005 0.1076 0.1035 0.1105 MSE 0.0064 0.0057 0.0062 0.006 0.0118 0.0131 0.0127 0.0142 0.0208 0.023 0.0215 0.0221 0.0101 0.0116 0.0107 0.0122 bias 0.0014 0.0032 -0.0024 0.0016 -3e-04 -0.0011 -0.001 7e-04 -0.0113 -0.0033 -0.002 0.0027 -0.0023 0.0054 -0.0016 -0.0013 GMD1 SE 0.0797 0.0756 0.0784 0.0773 0.107 0.1137 0.1121 0.119 0.1429 0.1513 0.1461 0.1481 0.0993 0.1063 0.1024 0.1098 MSE 0.0064 0.0057 0.0062 0.006 0.0115 0.0129 0.0126 0.0142 0.0205 0.0229 0.0213 0.0219 0.0099 0.0113 0.0105 0.0121 bias 8e-04 0.0036 -0.0023 0.0013 -6e-04 -0.001 -0.0011 4e-04 -0.0108 -0.0033 -0.0024 0.0029 -0.0027 0.0057 -0.002 -0.001 GMD2 SE 0.0805 0.0761 0.0787 0.0775 0.1073 0.1147 0.1127 0.1194 0.144 0.1515 0.1465 0.1478 0.0996 0.1069 0.1027 0.1097 MSE 0.0065 0.0058 0.0062 0.006 0.0115 0.0132 0.0127 0.0143 0.0209 0.023 0.0215 0.0218 0.0099 0.0115 0.0105 0.012 † N, La, Lo, and M denote normal, Laplace, logistic and MTN, respectively. Table 1: Bias, SE, and MSE of estimators with n = 50. As we expected, both biases and SE’s of all estimators decrease as n increases. First, we consider the normal ξ’s. When ξ’s are normal, the GLS and GMD1 estimators display the best performance; GLS and GMD1 show similar biases, SE’s, and hence MSE’s. GMD2 estimators show slightly worse performance than aforementioned ones; they display similar or smaller bias — e.g. estimators corresponding to n = 50 and β1 , β3 , β4 — while they always have larger SE’s which in turn cause larger MSE’s. Therefore, we conclude that GLS and GMD1 show similar performance to each other but better one than GMD2 when ξ’s are normal. For non-Gaussian ξ’s, we come up with a different conclusion: the GMD1 estimators outperform all other estimators while The GLS and GMD2 estimators display the similar 12 β1 N β2 β3 β4 β1 La β2 β3 β4 β1 Lo β2 β3 β4 β1 M β2 β3 β4 bias -3e-04 0.0014 -0.0032 2e-04 0.0013 -0.0027 -0.0039 -0.0015 -5e-04 -0.001 0.0072 -4e-04 -0.0029 -8e-04 5e-04 0.001 GLS SE 0.0518 0.049 0.0498 0.0495 0.0731 0.0703 0.0715 0.0672 0.0913 0.0925 0.0932 0.0928 0.0684 0.069 0.0707 0.0676 MSE 0.0027 0.0024 0.0025 0.0024 0.0053 0.0049 0.0051 0.0045 0.0083 0.0086 0.0087 0.0086 0.0047 0.0048 0.005 0.0046 bias 0 0.0013 -0.0031 2e-04 0.0018 -0.0026 -0.004 -0.0016 -7e-04 -0.0011 0.0073 -2e-04 -0.0032 -0.0012 4e-04 0.0011 GMD1 SE 0.0522 0.0491 0.0499 0.0496 0.0725 0.0695 0.0712 0.0666 0.0907 0.0921 0.0933 0.0929 0.067 0.0682 0.07 0.0667 MSE 0.0027 0.0024 0.0025 0.0025 0.0053 0.0048 0.0051 0.0044 0.0082 0.0085 0.0088 0.0086 0.0045 0.0046 0.0049 0.0044 bias -5e-04 0.0013 -0.0032 2e-04 0.0015 -0.0025 -0.0037 -0.0018 -2e-04 -0.0011 0.0072 -3e-04 -0.0031 -9e-04 3e-04 0.0013 GMD2 SE 0.0522 0.0494 0.0502 0.0496 0.0725 0.0697 0.071 0.0668 0.0914 0.0926 0.0933 0.093 0.0674 0.0679 0.0698 0.0671 MSE 0.0027 0.0024 0.0025 0.0025 0.0053 0.0049 0.0051 0.0045 0.0083 0.0086 0.0088 0.0087 0.0046 0.0046 0.0049 0.0045 Table 2: Bias, SE, and MSE of estimators with n = 100. performance. Note that weighing the merits of the GLS, the GMD1, and the GMD2 estimators in terms of bias is hard. For example, for the Laplace ξ when n = 50, the GLS and GMD1 estimators of all βi ’s show the almost same biases; the GMD2 estimator of β1 (β4 ) show smaller (larger) bias than the GLS and the GMD1 estimators. When we consider the SE, the GMD1 estimators display the least SE’s regardless of n’s and ξ’s. The GLS and the GMD2 estimators show somewhat similar SE’s when ξ is Laplace or logistic; however, the GMD2 estimators have smaller SE’s than the GLS ones when ξ is MTN. As a result, the GMD1 estimators display the least MSE for all non-Gaussian ξ’s and n’s; the GMD2 and the GLS — corresponding to Laplace or logistic ξ’s — show similar MSE’s while the GMD2 estimators show smaller MSE than the GLS ones when ξ is MTN. Appendix Proof of Theorem 3.1. Section 5.5 of Koul (2002) illustrates (3.1) holds for independent errors. Proof of the theorem, therefore, will be similar to the one of Theorem 5.5.1 in that 13 section. Define for k = 1, 2, ..., p, u ∈ Rp , y ∈ R, (A.2) Jk (y, u) := n X dik Fi (y + q ′i XAu), Yk (y, u) := n X i=1 i=1 Wk (y, u) := Yk (y, u) − Jk (y, u).  dik I q ′i ε ≤ y + q ′i XAu , Rewrite (A.3) L(β + Au; Q) = p Z h X k=1 {Wk (y, u) − Wk (y, 0)} + {Wk (−y, u) − Wk (−y, 0)} +{(Jk (y, u) − Jk (y, 0)) − n X i=1 +{(Jk (−y, u) − Jk (−y, 0)) − +{Uk (y, β) + 2 n X dik q ′i XAufi (y)} n X dik q ′i XAufi (y)} i=1 dik q ′i XAufi (y)} i=1 i2 dH(y). where 0 = (0, 0, ..., 0)′ ∈ Rp . Note that the last term of the integrand is the kth coordinate of U (y, β; Q) + 2ΣDA (y)A−1 (b − β) vector in L∗ (b; Q). If we can show that suprema of L2H norms of the first four terms of the integrand are op (1), then applying Cauchy-Schwarz (C-S) inequality on the cross product terms in (A.3) will complete the proof. Therefore to prove theorem it suffices to show that for all k = 1, 2, ..., p Z 2 (A.4) E sup Wk (±y, u) − Wk (±y, 0) dH(y) = o(1), (A.5) sup Z (A.6) (Jk (±y, u) − Jk (±y, 0)) − E sup Z Uk (y, β) + 2 n X n X 2 dik q ′i XAufi (y) dH(y) = o(1), i=1 2 dik q ′i XAufi (y) dH(y) = O(1). i=1 where sup is taken over kuk ≤ b. Here we consider the proof of the case +y only. The similar facts will hold for the case −y. Observe that (A.2) implies (A.7) E Z 2 2 Uk (y, β) dH(y) ≤ 2n max kdi k max 1≤i≤n 14 1≤i≤n Z (1 − Fi ) dH < ∞. Therefore, (A.6) immediately follows from (A.2) and (A.7). The proof of (A.5) does not involve the dependence of errors, and hence, it is the same as the proof of (5.5.11) of Koul (2002). Thus, we shall prove (A.4), thereby completing the proof of theorem. ± ± ± To begin with let Jku (·), Yku (·), and Wku (·) denote Jk (·, u), Yk (·, u) and Wk (·, u) in (A.2) ± when dik is replaced with dik so that Jk = Jk+ − Jk− , Yk = Yk+ − Yk− , and Wk = Wk+ − Wk− . Define for x ∈ Rp , u ∈ Rp , y ∈ R, Rewrite ± Wku pi (y, u; X) := Fi (y + q ′i XAu) − F (y),   Bni := I q ′i ε ≤ y + q ′i XAu − I q ′i ε ≤ y − pi (y, u; X). − ± Wk0 = n X i=1    ′ ′ ′ d± ik I q i ε ≤ y + q i XAu − I q i ε ≤ y − pi (y, u; X) . Note that 2 E Bni ≤ Fi (y + θi kuk) − Fi (y) (A.8) Recall a lemma from Deo(1973). Lemma A.2. Suppose for each n ≥ 1, {ξnj , 1 ≤ j ≤ n} are strongly mixing random variables with mixing number αn . Suppose X and Y are two random variables respectively measurable with respect to σ{ξn1 , ..., ξnk } and σ{ξnk+m, ..., ξnn }, 1 ≤ m, m + k ≤ n. Assume p, q and r are such that p−1 + q −1 + r −1 , and kXkp ≤ ∞ and kY kq ≤ ∞. Then for each 1 ≤ m, k + m ≤ n (A.9) |E(XY ) − E(X)E(Y )| ≤ 10 · αn1/r (m)kXkp kY kq . Consequently if kXk∞ = B < ∞ then for q > 1 and each 1 ≤ m, k + m ≤ n (A.10) |E(XY ) − E(X)E(Y )| ≤ 10 · αn1−1/q (m)kY kq . In addition, consider following lemma. Lemma A.3. For 1 < r < 3, (A.11) −1 n n−1 X n−i X α1/r (k) = O(1). i=1 k=1 15 Proof. For given r, let p such that 1/r + 1/p = 1. Note that 1 1 p = > . r r−1 2 Therefore, by Hölder’s inequality with p and r, we have (A.12) n−1 n−1 X n−i X i=1 k=1 n−1 X (n − k)p α1/r (k) ≤ np k=1 · 1 k 2p/r !1/p n−1 X k 2 α(k) k=1 !1/r < ∞. The last inequality follows from the assumption (A.8.6), thereby completing the proof of lemma. 2 Now, we consider the cross product terms of E Wku − Wk0 H . (A.13) Z X n X n  E i=1 j=i+1    dik djk I q ′i ε ≤ y + q ′i XAu − I q ′i ε ≤ y − pi (y, u; X)     × I q ′j ε ≤ y + q ′j XAu − I q ′j ε ≤ y − pj (y, u; X) dH(y) Z n X n X ≤ dik djk |E Bni Bnj | dH i=1 j=i+1 n n X X ≤ 10 i=1 j=i+1 1/2 ≤ 10b dik djk · α {n max d2ik } i 1/2 (j − i) · · {max θi } 1/2 i Z kBnj k2 dH −1 ·n n−i n−1 X X α 1/2 (m) i=1 m=1 Z 1/2 f1 dH → 0. The second inequality follows from Lemma A.2, and the convergence to zero follows from the Lemma A.3 with r = 2, (A.1), and (A.7). Consequently, by Fubini’s Theorem together with (A.3), we obtain, for every fixed kuk ≤ b, (A.14) lim sup E |Wku − n→∞ Wk0 |2H ≤ lim sup n→∞ ≤ Z X n i=1 d2ik Fi (y + q ′i XAu) − F (y) dH(y) lim sup{n max d2ik } i n→∞ = 0, Z an −an Z fi (y + s)dH(y)ds where an = b maxi θi → 0. To complete the proof of (A.4), it suffices to show that for all ǫ > 0, there exists a δ > 0 16 such that for all v ∈ Rp , ku − vk ≤ δ, (A.15) lim sup E sup |Kku − Kkv | ≤ ǫ, n→∞ ku−vk≤δ where Kku := |Wku − Wk0 |2H , u ∈ Rp , 1 ≤ k ≤ p. (A.15) follows from (5.5.5) of Koul (2002), thereby completing the proof of theorem. Proof of Corollary 3.1. The proof of (3.2) for independent errors can again be found in the section 5.5 of Koul (2002). The difference between the proof in the section 5.5 and one here arises only in the part which involves the dependence of the error. Thus, we present only the proof of an analogue of (5.5.27) in Koul (2002). Let Lk Z h n i X  := Wk (y, 0) + Wk (−y, 0) + Jk (y, 0) + Jk (−y, 0) − dik f1 (y) dH(y) = Z hX n i=1 i=1    i dik I q ′i ε ≤ y − I − q ′i ε < y f1 (y) dH(y), L := (L1 , ..., Lp ). R Note that Lk = Uk (y, β; Q)f1 (y)dH(y). By the symmetry of H and Fubini’s theorem, we obtain Z Z ∞    2 ′ ′ E I q i ε ≤ y − I − qi ε < y dH(y) = 4 (1 − Fi ) dH, 1 ≤ i ≤ n. 0 In addition, Lemma A.2 yields, for j > i, Z       E I q ′j ε ≤ y − I − q ′j ε < y dH(y) I q ′i ε ≤ y − I − q ′i ε < y Z ∞ √ 1/2 (1 − Fi )1/2 dH. ≤ 20 2 α (j − i) max 1≤i≤n 0 Together with the fact that (1 − Fi ) ≤ (1 − Fi )1/2 , by (A.1), (A.2), (A.7), and Lemma A.3, 17 we obtain, for some 0 < C < ∞, EkLk 2 ≤ p X k=1 |f1 |2H Z n n X 2 4 dik ∞ 0 i=1 −1 ×n < C p |f1 |2H max 1≤i≤n Z 0 ∞ √ (1 − Fi ) dH + 40 2 n max d2ik 1≤i≤n n X n X α 1/2 i=1 j=i+1 (j − i) max 1≤i≤n Z 0 ∞ (1 − Fi )1/2 dH o (1 − Fi )1/2 dH. Using E Lk = 0 for k = 1, ..., p + 1 and Chebyshev inequality, for all ǫ > 0 there exists N1 and cǫ such that R∞  C p |f1 |2H max1≤i≤n 0 (1 − Fi )1/2 dH (A.16) P kLk ≤ cǫ ≥ 1 − ≥ 1 − ǫ/2, n ≥ N1 . cǫ The rest of the proof will be the same as the proof of Lemma 5.5.4 of Koul (2002). References [1] Beran, R. J. (1977). Minimum Hellinger distance estimates for parametric models. Ann. Statist., 5 445-463. [2] Deo, C. M. (1973). A note on empirical processes of strong mixing sequences. Ann. Probab., 1 870-875. [3] Koul, H. L. (1977). Behavior of robust estimators in the regression model with dependent errors. Ann. Statist., 5 681-699. [4] Koul, H. L. (1985). Minimum distance estimation in linear regression with unknown error distributions. Statist. Probab. Lett., 3 1-8. [5] Koul, H. L. (1986). Minimum distance estimation and goodness-of-fit tests in first-order autoregression. Ann. Statist., 14 1194-1213. [6] Koul, H. L. (2002). Weighted empirical process in nonlinear dynamic models. Springer, Berlin, Vol. 166. [7] Koul, H. L. and De Wet, T. (1983). Minimum distance estimation in a linear regression model. Ann. Statist., 11 921-932. [8] Mehra, K. L. and Rao, M. S. (1975). Weak convergence of generalized empirical processes relative to dq under strong mixing. Ann. Probab., 3 979-991. 18 [9] Millar, P. W. (1981). Robust estimation via minimum distance methods. Zeit fur Wahrscheinlichkeitstheorie., 55 73-89. [10] Noether, G. E. (1949). On a theorem by Wald and Wolfowitz. Ann. Math Statist., 20 445-458. [11] Parr, W. C. and Schucany, W. R. (1979). Minimum distance and robust estimation. J. Amer. Statist. Assoc., 75 616-624. [12] Prescitt, E. C. and Schucany, W. R. (1987). Theory ahead of Business Cycle Measurement. Carnegie-Rochester Conference on Public Policy. 19
10math.ST
Static Analysis of File-Processing Programs using File Format Specifications M. Raveendra Kumar1 , Raghavan Komondoor2 , and S. Narendran2 1 arXiv:1501.04730v2 [cs.PL] 3 Apr 2015 2 Indian Institute of Science, Bangalore and Tata Consultancy Services Ltd., raveendra.kumar@tcs.com Indian Institute of Science, Bangalore, {raghavan,narendran}@csa.iisc.ernet.in Abstract. Programs that process data that reside in files are widely used in varied domains, such as banking, healthcare, and web-traffic analysis. Precise static analysis of these programs in the context of software verification and transformation tasks is a challenging problem. Our key insight is that static analysis of file-processing programs can be made more useful if knowledge of the input file formats of these programs is made available to the analysis. We propose a generic framework that is able to perform any given underlying abstract interpretation on the program, while restricting the attention of the analysis to program paths that are potentially feasible when the program’s input conforms to the given file format specification. We describe an implementation of our approach, and present empirical results using real and realistic programs that show how our approach enables novel verification and transformation tasks, and also improves the precision of standard analysis problems. 1 Introduction Processing data that resides in files or documents is a central aspect of computing in many organizations and enterprises. Standard file formats or document formats have been developed or evolved in various domains to facilitate storage and interchange of data, e.g., in banking [12,15], health-care [21], enterpriseresource planning (ERP) [33], billing [18], and web-traffic analysis [5]. The wide adoption of such standard formats has led to extensive development of software that reads, processes, and writes data in these formats. However, there is a lack of tool support for developers working in these domains that specifically targets the idioms commonly present in file-processing programs. We address this issue by proposing a generic approach for static analysis of file-processing programs that takes a program as well as a specification of the input file format of the program as input, and analyzes the program in the context of behaviors of the program that are compatible with the file-format specification. 1.1 Motivating example Our work has been motivated in particular by batch programs in the context of enterprise legacy systems. Such programs are typically executed periodically, and in each run process an input file that contains “transaction” records that have accumulated since the last run. In order to motivate the challenges in analyzing file-processing programs, we introduce as a running example a small batch program, as well as a sample file that it is meant to process, in Figure 1. DATA DIVISION. INPUT FILE in-file BUFFER in-rec. OUTPUT FILE out-file BUFFER out-rec. char same-flag. digit eof-flag = 0. PROCEDURE DIVISION. /1/ OPEN in-file, out-file /2/ READ in-file INTO in-rec, AT END MOVE 1 TO eof-flag /3/ WHILE eof-flag = 0 /4/ IF in-rec.typ = ‘ITM’ //Item record processing /5/ MOVE in-rec.rcv, in-rec.amt TO out-rec.rcv, out-rec.amt /6/ IF same-flag = ‘S‘ /7/ Itm record processing for SAME batch header /8/ ELSE /9/ Itm record processing for DIFF batch header /10/ END-IF /11/ WRITE out-file FROM out-rec /12/ ELSE IF in-rec.typ ='HDR' //Header Record Processing /13/ MOVE in-rec.pyr TO out-rec.pyr /14/ IF in-rec.src = ‘SAME' /15/ MOVE ‘S' TO same-flag /16/ ELSE /17/ MOVE ‘D' TO same-flag /18/ END-IF /19/ Rest of header record processing /20/ ELSE IF in-rec.typ =‘TRL' //Trailer Record Processing /21/ Trl record processing /22/ ELSE /23/ Terminate program with error /24/ END-IF /25/ READ in-file INTO pmt-record, AT END MOVE 1 TO eof-flag /26/ END-WHILE. /27/ CLOSE in-file,out-file. /28/ GOBACK. HDR ITM ITM ITM TRL HDR ITM ITM TRL 10205 10201 10103 18888 9000 SAME 3000 4000 2000 20221 6000 DIFF 19999 2000 10234 4000 (b) typ pyr tot src HDR 10205 9000 SAME typ rcv amt ITM 10201 3000 typ: pyr: tot: src: rcv: amt: main type. payer account number. total batch amount. source bank. receiver account num. item amount. (c) (a) Fig. 1. (a) Example program. (b) Sample input file. (c) Input file record layouts. Input file format. Although our example is a toy one, the sample file shown (in Figure 1(b)) adheres to a simplified version of a real banking format [15]. Each record is shown as a row, with fields being demarcated by vertical lines. In this file format, the records are grouped logically into “batches”, with each batch representing a group of “payments” from one customer to other customers. Each batch consists of a “header” record (value ‘HDR’ in the first field), which contains information about the paying customer, followed by one or more “item” or “payment” records (‘ITM’ in the first field), which identify the recipients, followed by a “trailer” record (‘TRL’). Figure 1(c) gives the names of the fields of header as well as item records. Other than the first field typ, which we have discussed above, another field of particular relevance to our discussions is the src field in header records, which identifies whether the paying customer is a customer of the bank that’s running the program (‘SAME’), or of a different bank (‘DIFF’). The meanings of the other fields are explained in part (c) of the figure. The code. Figure 1(a) shows our example program, which is in a Cobol-like syntax. The “DATA DIVISION” contains the declarations of the variables used in the program, including the input file buffer in-rec and output file buffer out-rec. in-rec is basically an overlay (or union, following the terminology of the C language), of the two record layouts shown in Figure 1(c). After any record is read into this buffer the program interprets its contents using the appropriate layout based on the value of the typ field. The output buffer out-rec is assumed to have fields pyr, rcv, amt, as well other fields that are not relevant to our discussions. These field declarations have been elided in the figure for brevity. The statements of the program appear within the “PROCEDURE DIVISION”. The program has a main loop, in lines 3-26. A record is read from the input file first outside the main loop (line 2), and then once at the end of each iteration of the loop (line 25). In each iteration the most recent record that was read is processed according to whether it is a header record (lines 12-19), item record (lines 4-11), or trailer record (lines 20-21). The sole WRITE statement in the program is in the item-record processing block (line 11), and writes out a “processed” payment record using information in the current item record as well as in the previously seen header record. Lines 7 and 9 represent code (details elided) that populates certain fields of out-rec in distinct ways depending on whether the paying customer is from the same bank or a different bank. 1.2 Analysis issues and challenges File-processing programs typically employ certain idioms that distinguish them from programs in other domains. These programs read an unbounded number of input records, rather than have a fixed input size. Furthermore, typically, a program is designed not to process arbitrary inputs, but only input files that adhere to a known (domain related) file-format. State variables are used in the program to keep track of the types of the records read until the current point of execution. These state variables are used to decide how to process any new record that is read from the file. For instance, in the program in Figure 1(a), the variable same-flag is set in lines 14-17 to ‘S’ (for “same”) or to ‘D’ (for “different”), based on src field of the header record that has just been read. This variable is then used in line 6 to decide how to process item records in the same batch that are subsequently read. In certain cases, the state variables could also be used to identify unexpected or ill-formed sequences, and to “reject” them. Analyzing, understanding, and transforming file-processing programs in precise ways requires a unique form of path sensitive analysis, in which, at each program point, distinct information about the program’s state needs to be tracked corresponding to each distinct pattern of record types that could have been read so far before control reaches the point. We illustrate this using example ques- tions about the program in Figure 1, answers to which would enable various verification and transformation activities. Does the program silently “accept” ill-formed inputs? This is a natural and important verification problem in the context of file-processing programs. In our running example, if an (ill-formed) input file happens to contain an item record as the first record (without a preceding header record), the variable same-flag would be uninitialized after this item record is read and when control reaches line 6. This is because this variable is initialized only when a header record is seen, in lines 14-17. Therefore, the condition in line 6 could evaluate nondeterministically. Furthermore, the output buffer out-rec, which will be written out in line 11, could contain garbage in its pyr field, because this field also is initialized only when a header record is seen (in line 13). In other words, file-processing programs could silently write out garbage values into output files or databases when given ill-formed inputs, which is undesirable. Ideally, in the running example, the programmer ought to have employed an additional state variable (e.g., hdr-seen), to keep track of whether a header record is seen before every item record, and ought to have emitted a warning or aborted the program upon identifying any violation of this requirement. In other words, state tracking in file-processing programs is complex, and prone to being done erroneously. Therefore, there is a need for an automated analysis that can check whether a program “over accepts” bad files (i.e., files that don’t adhere to a user-provided specification of well-formed files). What program behaviors are possible with well-formed inputs? In other situations, we are interested only in information on program states that can arise after (prefixes of) well-formed files have been read. For instance, a developer might be interested in knowing about possible uses of unitialized variables during runs on well-formed files only, without the clutter caused by warning reports pertaining to runs on ill-formed files. Intuitively, only the first category of warnings mentioned above signifies genuine errors in the program. This is because in many cases developers do not try to ensure meaningful outputs for corrupted input files. In our example program, there are in fact no instances of uninitialized variables being used during runs on well-formed files. On a related note, one might want to know if a program can falsely issue an “ill-formed input” warning even when run on a well-formed file. This sort of “under acceptance” problem could happen either due to a programming error, or due to misunderstanding on the developer’s part as to what inputs are to be expected. This could be checked by asking whether statements in the program that issue these warnings, such as line 23 in the example program, are reachable during runs on well-formed inputs. In the example program it turns out that this cannot happen. What program behaviors are possible under restricted scenarios of interest? In some situations there is a need to identify paths in a program that are taken during runs on certain narrower sub-classes of well-formed files. For instance, in the running example, we might be interested only in the parts of the program that are required when input files contain batches whose header records always have ‘SAME’ in the src field; these parts constitute all the lines in the program except lines 6, 9, and 14-17 (variable same-flag will no longer need to be set or used because all input batches are guaranteed to be ‘SAME’ batches). This is essentially a classical program specialization problem, but with a file-formatbased specialization criterion (rather than a standard criterion on the parameters to the program). Program specialization has various applications [7], for example, in program comprehension, decomposition of monolithic programs to collections of smaller programs that have internally cohesive functionality, and reducing run-time overhead. 1.3 Our approach and contributions Approach: Static analysis based on file formats. The primary contribution of this paper is a generic approach to perform any given “underlying” abstract interpretation [9] of interest U , based on an abstract lattice L, in a path-sensitive manner, by maintaining at each point a distinct abstract fact (i.e., element of L) for distinct patterns of record types that could have been read so far. Typically, to “lift” the analysis U to a path-sensitive domain, a finite set of predicates of P would be required [17]. The path-sensitive analysis domain would then essentially be P → L. For our example program, a set of six predicates, each one formed by conjuncting one of the three predicates “in-rec.typ = ‘HDR’”, “in-rec.typ = ‘ITM’” or “in-rec.type = ‘TRL’”, with one of the two predicates “same-flag = ’S’” or “same-flag = ’D’”, would be natural candidates. However, coming up with this set of predicates manually would be tedious, because it requires detailed knowledge of the state variables in the program and their usage. Automated predicate refinement [17] might be able to generate these predicates, but is a complex iterative process, and might potentially generate many additional predicates, which would increase the running time of the analysis. qsh SHdr Itm qs SHdr Itm qi Itm DHdr qdh Trl qt eof qe Record Type SHdr DHdr Itm Trl Constraint typ typ typ typ = = = = ‘HDR’∧ src = ‘SAME’ ‘HDR’∧ src = ‘DIFF’ ‘ITM’ ‘TRL’ DHdr (a) (b) Fig. 2. (a) Well-formed input automaton. (b) Input record types. File-format specifications, which are usually readily available because they are organization-wide or even industry-wide standards, have been used by previous programming languages researchers in the context of tasks such as parser and validator generation [18], and white-box testing [19]. Our key insight is that if a file-format specification can be represented as a finite-state input automaton, whose transitions are labeled with record types, then the set of states Q of this automaton (which we call file states) can be directly used to lift the analysis U , by using the domain Q → L. The intuition is that if an abstract fact l ∈ L is mapped to a file state q ∈ Q at a program point, then l over-approximates all possible concrete states that can arise at that point during runs that consume a sequence of records such that the concatenation of the types of these records is “accepted” by the file state q of the automaton. Figure 2(a) shows the well-formed input automaton for the file-format used in our running example, with Figure 2(b) showing the associated input record type descriptions (as dependent types [34]). The sample input file in Figure 1(b) is a well-formed file as per this automaton. This is because the sequence that consists of the types of the records in this file, namely ‘SHdr Itm Itm Itm Trl DHdr Itm Itm Trl’, is accepted by the automaton. Intuitively, statements other than READ statements do not affect the file-state that a program is “in” during execution. Therefore, the “lifted” transfer functions for these are straightforward, and use the underlying the transfer functions from the L analysis. The transfer function for READ plays the key role of enforcing the ordering among record types in well-formed files. For instance, consider the file-state qsh in Figure 2(a), which represents the situation wherein a ‘SAME’-type header record has just been read. Therefore, in the output of the READ transfer function, qsh is mapped to the join of the abstract facts that the predecessors file-states of qsh , namely, qs and qt were mapped to in the input to the transfer function. Applications. In addition to our basic approach above, we propose two applications of it that address two natural problems in the analysis of file-processing programs, that to our knowledge have not been explored previously in the literature. The first application is a sound approach to check if a program potentially “over accepts” ill-formed files, or “under accepts” well-formed files. The second is a sound technique to specialize a program wrt a given specialization criterion that represents a restriction of the full file-format, and that is itself represented as an input automaton. Program File State Graph (PFSG). We propose a novel program representation, the PFSG, which is a graph derived from both the control-flow graph (CFG) of the program and the given input automaton for the program. The PFSG is basically an “exploded” version of the CFG of the original program; the controlflow paths in the PFSG are a subset of the control-flow paths in the CFG, with certain paths that are infeasible under the given input automaton being omitted. Being itself a CFG, any existing static analysis can be applied on the PFSG without any modifications, with the benefit that the infeasible paths end up being ignored by the analysis. We describe how to modify our basic approach to emit a PFSG, and also discuss formally how the results from any analysis differ when performed on the PFSG when compared to being performed on the original CFG. Implementation and empirical results. We have implemented our approach, and applied it on several realistic as well as real Cobol batch programs. Our approach found file-format related conformance issues in certain real programs, and was also able to verify the absence of such errors in other programs. In the program specialization context, we observed that our approach was surprisingly precise in being able to identify statements and conditionals that need not be retained in the specialized program. We found that our analysis, when used to identify references to possibly uninitialized variables and reaching definitions gave improved precision over the standard analysis in many cases. The rest of this paper is structured as follows. In Section 2 we introduce key assumptions and definitions. In Section 3 we present our approach, as well as the two applications mentioned above. Section 4 introduces the PFSG. Section 5 presents our implementation and result. Section 6 discusses related work, while Section 7 concludes the paper. 2 Assumptions and definitions Definitions (Records, Record Types, and Files) A record is a contiguous sequence of bytes in a file. A field is a labeled non-empty sub-string of a record. Any record has zero or more fields (if it has zero fields then the record is taken to be a leaflevel record). A record type Ri is intuitively a specification of the length of a record, the names of its fields and their lengths, and a constraint on the contents of the record. For example, consider the record types shown in Figure 2(b). Each row shows the name of a record type, and then the associated constraint. We say that a record r is of type Ri iff r satisfies the length as well as value constraints of type Ri . For instance, the first record in the file in Figure 1(b) is of type SHdr (see Figure 2(b)). Note that in general a record r could be of multiple types. Definitions (Files and read operations) A file is a sequence of records, of possibly different lengths. Successive records in a file are assumed to be demarcated explicitly, either by inter-record markers or by other meta-data that captures the length of each record. At run time there is a file pointer associated with each open file; a READ statement, upon execution, retrieves the record pointed to by this pointer, copies it into the file buffer in the program associated with this file, and advances the file pointer. Definition (Input automaton) An input automaton S is a tuple (Q, Σ, ∆, qs , Qe ), where Q is a finite set of states, which we refer to as file states, Σ = T ∪ {eof }, where T is a set of record types, ∆ is a set of transitions between the file states, with each transition labeled with an element of Σ, qs is the designated start state of S, and Qe is the (non-empty) set of designated final states of S. A transition is labeled with eof iff the transition is to a final state. There are no outgoing transitions from final states. Note that an input automaton may be non-deterministic, in two different senses. Multiple transitions out of a file state could have the same label. Also, it is possible for a record r to be of two distinct types t1 and t2 and for these two types to be the labels of two outgoing transitions from a file state. Let q be any non-final state of Q. We define LT (q) – the type language of q – as the set of sequences of types (i.e., elements of T ∗ ) that take the automaton from its start state to q. For a final state qe , LT (qe ) is defined to be the union of type languages of the states from which there are transitions to qe . We define LR (q) – the record language of any file-state q – as follows: LR (q) consists of sequences of records R such that there exists a sequence of types T in LT (q) such that (a) the sequences R and T are of equal length, and (b) for each 1 ≤ j ≤ |R|, record R[j] is of type T [j]. Recall that a file is nothing but a sequence of records. We say that a file f conforms to an input automaton S, or that S accepts f , if f is in LR (qe ) for some final state qe of S. Let R be some sequence of records (possibly empty). Say R is in LR (q) for some file state q of an input automaton. If there exists an execution trace t of the given program P that starts at the program’s entry, consumes the records in R via the READ statements that it passes through, and reaches a program point p, then we say that (a) trace t is due to the prefix R, and (b) trace t reaches point p while being in file-state q of the input automaton. We define ns(t) as the sequence of nodes of the control-flow graph (CFG) of given program that are visited by the trace t; the sequence always begins with the entry node of the CFG and contains at least two nodes (the trace ends at the point before the last node in the sequence). A well-formed input automaton (which we often abbreviate to “well-formed automaton”) is an input automaton that accepts all files that are expected to be given as input to a program. A “specialization” automaton is an input automaton that accepts a subset of files as a well-formed automaton, while a “full” automaton is an input automaton that accepts every possible file. If a program accesses multiple sequential input files this situation could be handled using two alternative approaches: (1) By concurrently using multiple input automatons in the analysis, one per input file, or (2) By modeling one of the input files as the primary input file (with an associated automaton) and by modeling reads from the remaining files as always returning an undefined record. We adopt the latter of these approaches in our experimental evaluation. 3 Our approach In this section we describe our primary contribution, which is a generic approach for “lifting” a given abstract interpretation wrt a file-format specification. We then discuss its soundness and precision. Following this we present the details of the two applications of our generic approach that were mentioned in Section 1.3. Finally, we present an extension to our approach, which enables the specification of data integrity constraints on the contents of input files in relation to the contents of persistent tables. 3.1 Abstract interpretation lifted using input automatons The inputs to our approach are a program P , an input automaton S = (Q, Σ, ∆, qs , Qe ), and an arbitrary “underlying” abstract interpretation U ≡ ((L, vL ), FL ), where L is a join semi-lattice and FL is a set of transfer functions with signature L → L associated with statements and conditionals. Our objective, as described in the introduction, is to use the provided input automaton to compute a least fix-point solution considering only paths in the program that are potentially feasible wrt the given input automaton. The lattice that we use in our lifted analysis is D ≡ Q → L. The partial ordering for this lattice is a “point wise” ordering based on the underlying lattice L: d1 vD d2 =def ∀q ∈ Q. d1 (q) vL d2 (q) The initial value that we supply at the entry of the program is (qs , iL ), where iL ∈ L is an input to our approach, and is the initial value to be used in the context of the underlying analysis. We now discuss our transfer functions on the lattice D. We consider the following three categories of CFG nodes: Statements other than READ statements, conditionals, and READ statements. Let n be any node that is neither a READ statement nor a conditional. Let fLn : L → L ∈ FL be the “underlying” transfer function for node n. Since the file state that any trace is in at the point before node n cannot change after the trace executes node n, our transfer function for node n is: n fD (d ∈ D) = λq ∈ Q. fLn (d(q)) Let c be a conditional node, with a true successor and a false successor. Let c c ft,L ∈ FL and ff,L ∈ FL be the underlying true-branch and false-branch transfer functions of c. Since a conditional node cannot modify the file-state that a trace is in, either, our transfer function for conditionals is: c c fb,D (d ∈ D) = λq ∈ Q. fb,L (d(q)) where ‘b’ stands for t or f . Finally, we consider the case where a node r is a READ node. This is the most interesting case, because executing a READ statement can change the file state that a trace is in. Firstly, a note on terminology: a dataflow value l ∈ L is said to in READ qsh qdh qi qt lsh ldh li lt Itm Itm qs SHdr out Itm DHdr eof Trl SHdr qdh qsh qi qt qe f (ls,SHdr) ⊔L f (lt,SHdr) f (lsh,Itm) ⊔L f (ldh,Itm) ⊔L f (li,Itm) f (li,Trl) f (lt,eof) Fig. 3. Illustration of transfer function for READ statements. represent a concrete state s if s is an element of the concretization [9] of l (which is written as γ(l)). Secondly, we make the following assumption on the underlying transfer function fLr ∈ FL for READ statements: Rather than simply have the signature L → L, the function fLr ought to have the signature (L × Σ) → L. If t is some record type (i.e., element of T ), then, intuitively, fLr (l1 , t) should return a dataflow fact l2 that represents the set of concrete states that can result after the execution of the READ, assuming: – the concrete state just before the execution of the READ is some state that is represented by l1 , and – the READ statement retrieves a record of type t from the input file and places it in the input buffer. Correspondingly, fLr (l1 , eof ) should return a dataflow fact l2 that represents the set of concrete states that can result after the execution of the READ, assuming: – the concrete state just before the execution of the READ is some state that is represented by l1 , and – the input buffer in the program gets populated with an undefined value, and – the statement within the ‘AT END’ clause, if any, executes after the read operation. As an illustration, say the underlying analysis U is the CP (Constant Propagation) analysis. fLr (l1 , t) would return a fact l2 that is obtained by performing the following transformations on l1 : (1) remove all existing CP facts associated with the input buffer, and (2) obtain suitable new CP facts for the input buffer using the constraints associated with the type t. On the other hand, fLr (l1 , eof ) would perform only Step (1) above.  r We are now ready to present our transfer fD for a read node r. The transfer function is: G r fD (d) = λqj ∈ Q. {fLr (d(qi ), label (S, qi , qj ))} (qi →qj )∈∆ where label (S, qi , qj ) returns the label (which is a type, or eof ) of the transition qi → qj in S. The intuition behind this transfer function is as follows. For /2/ qsh qdh qi qt qe <i.t=‘H’,i.s=‘S’,e=0> <i.t=‘H’,i.s=‘D’,e=0> <i.t =‘I’,e=0> <i.t =‘T’,e=0> <e=1> {s,o} {s,o} {o.r,o.a} /3/ WHILE eof-flag = 0 qsh T F qdh qi qt qe <i.t=‘H’,i.s=‘S’,e=0> <i.t=‘H’,i.s=‘D’,e=0> <i.t =‘I’,e=0> <i.t =‘T’,e=0> {s,o} {s,o} {o.r,o.a} /4/ IF in-rec.typ = ‘ITM’ /27/ CLOSE in-file … F T qi qsh <i.t =‘I’,e=0>{o.r,o.a} <e=1> qdh qt <i.t=‘H’,i.s=‘S’,e=0>{s,o} <i.t=‘H’,i.s=‘D’,e=0>{s,o} <i.t =‘T’,e=0> /12/ IF in-rec.typ = ‘HDR’ qsh qdh qi qt <i.t=‘H’,i.s=‘S’, s=‘S’,e=0> {o.r,o.a} <i.t=‘H’,i.s=‘D’, s=‘D’,e=0>{o.r,o.a} <i.t =‘I’,e=0> <i.t =‘T’,e=0> /25/ READ in-file … qsh qdh <i.t=‘H’,i.s=‘S’,e=0> <i.t=‘H’,i.s=‘D,e=0> qi qt qe <i.t =‘I’,e=0>{o.r,o.a} <i.t =‘T’,e=0> <e=1> Fig. 4. Fix point solution for program in Figure 1(a), using CP × Possibly-unitializedvariables analysis. Abbreviations used: e: eof-flag, s: same-flag, i: in-rec, o: out-rec, i.t: in-rec.typ, i.s: in-rec.src, o.r: out-rec.rcv, o.a: out-rec.amt, ’H’: ’HDR’, ’S’: ’SAME’, ’D’: ’DIFF’, ’I;: ’ITM’, ’T’: ’TRL’. any file state qj , a trace can be in qj after executing the READ if the trace is in any one of the predecessor states of qj in the automaton just before executing the READ. Therefore, the fact (from lattice L) that is to be associated with qj at the point after the READ statement can be obtained as follows: (1) For each file state qi such that there is a transition qi → qj labeled s in the automaton, transfer the fact fLr (l1 , s), where l1 ∈ L is the fact that qi is mapped to at the point before the READ statement. (2) Take a join of all these transferred facts. Figure 3 sketches this transfer function schematically. Each edge from a column before the READ statement to a column after the READ denotes a “transfer” that happens due to Step (1) above; the label on the edge denotes the label on the corresponding transition in the automaton. We have abbreviated each instance of fLr in this figure as f . We have also omitted some of the columns for compactness. Our presentation above was limited to the intra-procedural setting. However, our analysis can be extended to the inter-procedural setting using standard techniques, some details of which we discuss in Section 5. Illustration. Figure 4 shows the fix-point solution at certain program points for the example program in Figure 1 as computed by our analysis, using the wellformed automaton shown in Figure 2. We assume an underlying lattice L that is a product of the constant-propagation (CP) and possibly uninitialized variables (Uninit) lattices. Each table in the figure denotes the solution (i.e., a function from Q to L) at the program point that precedes the statement that is indicated below the table. Each column of a table shows the underlying dataflow value associated with a file state. Columns in which the underlying dataflow value is ⊥ (which represents unreachability, basically) are omitted from the tables for brevity. The first component of each dataflow value – within angle brackets – indicates the constant values of variables, while the second component – within curly braces – indicates the set of variables that are possibly uninitialized. Empty sets are omitted from the figure for brevity. We abbreviate the variable names as well as constant values for the sake of compactness, as described in the caption of the figure. In the interest of space, we focus our attention on just one of the program points – the point just before the IF condition in line 4. Any execution trace reaching this point can be in any one of the following four file states: qsh , qdh , qi , or qt . These file states have associated CP facts that indicate that in-rec.typ has value ‘HDR’, ‘HDR’, ‘ITM’, and ‘TRL’, respectively. Additionally, the state variable same-flag is possibly uninitialized under columns qsh and qdh , because lines 1417 (which initialize this variable) may not have been visited yet, whereas is initialized under the other two columns. Now, only the fact associated with qi flows down the true branch of the conditional in line 4. This is because this conditional tests that in-rec.typ contains ‘ITM’. Therefore, same-flag is inferred to be definitely initialized by the time it is referenced in line 6, which is the desired precise result. 3.2 Soundness, precision, and complexity of our approach Our soundness result, intuitively, is that if the underlying analysis U is sound, then so is our lifted analysis, modulo the assumption that any input file given to the program P conforms to the given input automaton S. U itself is said to be sound if at any program point p of any program P the fix-point solution l computed by U represents all concrete states that can result at p due to all possible execution traces of P that begin in any concrete state that is represented by the given initial value iL . The following theorem states the soundness characterization of our analysis more formally. Theorem 1. Assuming U is a sound abstract interpretation, if d is the fix-point solution produced by our approach at a program point p of the given program P starting with initial value (qs , iL ), then l ≡ tq∈Q {d(q)} represents all concrete states that can result at point p due to all possible executions that begin in any concrete state that is represented by iL and that are on an input file that conforms to the given automaton S. The proof of the theorem above is straightforward. The following observations follow from the theorem above. (1) If the given input automaton is a well-formed automaton, then the fix-point solution at a program point p represents all concrete states that can result at point p during executions on well-formed files. (2) If the given input automaton is a “full” automaton, then the fix-point solution at a program point p represents all concrete states that can result at point p during all possible executions (including on ill-formed files). Given any input automaton S, our approach will produce a fix-point solution that is at least as precise as the one that would be produced directly by the underlying analysis U . However, the choice of the input automaton does impact the precision of the our approach. Intuitively, if input automaton S1 is a subautomaton of input automaton S2 (i.e., is obtained by deleting certain states and transitions, or by constraining further some of the types that label some of the transitions), then S1 will result in a more precise solution than S2 . Also, if S1 and S2 accept the same language, but S1 structurally refines S2 , then S1 will result in a more precise solution. We formalize these notions in the appendix. The time complexity of our analysis when used with an automaton S that has a set of states Q is, in the worst case, |Q| times the worst-case time complexity of the underlying analysis U . 3.3 Two applications of our analysis In this section we describe how we use our analysis described in Section 3.1 to address the two new problems that we mentioned in the introduction – file format conformance checking, and program specialization. File format conformance checking. As mentioned in the introduction, a verification question that developers would like an answer to is whether a program can silently “accept” an ill-formed input file and possibly write out a corrupted output file (“over acceptance”). Or, conversely, could the program “reject” a well-formed file via an abort or a warning message (“under acceptance”)? Different programs use different kinds of idioms to “reject” an input file; e.g., generating a warning message (and then continuing processing as usual), ignoring an erroneous part of the input file and processing the remaining records, and aborting the program via an exception. In order to target all these modes in a generic manner, our approach relies on the developer to identify file-format related rejection points in a program. These are the statements in a program where format violations are flagged, using warnings, aborts, etc. Detecting under-acceptance. We detect under-acceptance warnings by (1) Applying our analysis using a well-formed automaton and using any given programstate abstraction domain (e.g., CP, or interval analysis) as U . (2) Issuing an under-acceptance warning if the fact associated with any file-state is non-⊥ at any rejection point. The intuition is simply that rejection points should be unreachable when the program is run on well-formed files. Since our analysis is conservative, in that it never produces under-approximated dataflow facts, this approach will not miss any under-acceptance issues as long as the developer does not fail to mark any actual rejection point as a rejection point. As an illustration, say line 23 in the program in Figure 1 is marked as a rejection point. Using the well-formed automaton in Figure 2(a) and using CP as the underlying analysis U , our analysis will find this line to be unreachable. Therefore, no under-acceptance warnings will be issued. Detecting over-acceptance. Intuitively, a program has over acceptance errors with respect to a given well-formed file format if the program can reach the end of the main procedure without going through any rejection point when run on an input file that does not conform to the well-formed automaton. We check this property as follows: We first extend the given well-formed automaton S to a full automaton (which accepts all input files) systematically by adding a new final state qx , a few other new non-final states, and new transitions that lead to these new states from the original states. The intent is for these new states to accept record sequences that are not accepted by any file state in the original automaton S. We provide the full details of this construction in the appendix. Secondly, we modify the transfer functions of our lifted analysis D at rejection points such that they map all file states to ⊥ in their output. Intuitively, the idea behind this is to “block” paths that go through rejection points. We then apply our analysis using this full automaton and using any programstate abstraction domain as U , and flag an over-acceptance warning if the dataflow value associated with any file state that is not a final state in the original well-formed automaton is non-⊥ at the final point of the “main” procedure. Clearly, since our analysis over-approximates dataflow facts at all program points, we will not miss any over-acceptance scenarios as long as the developer does not wrongly mark a non-rejection point as a rejection point. Program specialization based on file formats. As mentioned in the introduction, it would be natural for developers to want to specify specialization criteria for file-processing programs as patterns on sequences of record types in an input file. We propose the use of input automatons for this purpose. For example, if the well-formed automaton in Figure 2(a) were to be modified by removing the file state qdh , as well as all transitions incident on it, what would be obtained would be a specialization automaton that accepts files in which all batches begin with “same” headers only. Our approach to program specialization using a specialization automaton is as follows. (1) We apply our analysis of Section 3.1 using the given specialization automaton as the input automaton, and using any program-state abstraction domain as U . (2) We identify program points p at which every file state is mapped to ⊥ as per the fix-point solution computed in Step 1. Basically, these program points are unreachable during executions on input files that conform to the specialization criterion. The statements/conditionals that immediately follow these points can be projected out of the program to yield the specialized program (the details of this projection operation are not a focus of this paper). It is easy to see that our approach is sound, in that it marks a point as unreachable only if it is definitely unreachable during all runs on input files that adhere to the given criterion. Illustration. Using the specialization automaton mentioned above, and using CP as the underlying analysis, lines 9 and 17 in the code in Figure 1(a) are marked as unreachable. It is worthwhile noting that if one did not use the specialization automaton as criterion, and instead simply specified that all header records have value ‘SAME’ in their ‘src’ field, then line 9 would not be identified as unreachable. Intuuitively, this is because the path consisting of lines 1-6, along which same-flag is uninitialized, would not be found infeasible, as discussed in Section 1.2. Subsequently, as a post-processing step (which is not a part of our core approach), the following further simplifications could be done to the program: (i) Make lines 7 and 15 unconditional, and remove the respective controlling “if” conditions. This would be safe because the “else” branches of these two “if” conditions have become empty. (ii) Remove line 15 entirely. This would be safe because after the conditional in line 6 is removed the variable same-flag is not used anywhere in the program. 3.4 Imposing data integrity constraints on input files The core of our approach, which was discussed in Section 3.1, used input automatons that constrain the sequences of types of records that can appear in an input file. However, in many situations, a well-formed file also needs to satisfy certain data integrity constraints wrt the contents of certain persistent tables. If these constraints can also be specified in conjunction with the input automaton, then certain paths in the program that execute only upon the violation of these constraints can be identified and pruned out during analysis time. This has the potential to further improve the precision and usefulness of our approach. In our running example, say there is a requirement that the “receiver” of any payment in the input file (represented by the in-rec.rcv field in the item record) necessarily be an account holder in the bank. Such a requirement could be enforced in the code in Figure 1 by adding logic right after line 4 to check if the value in in-rec.rcv appears as a primary key in the “accounts” database table of the bank, and to not execute lines 5-11 if the check fails. However, if a user of our approach wishes to assert that input files will never contain items that refer to invalid account numbers, then the logic mentioned above could be identified as redundant. To enable users to give such specifications we allow predicates of the form isInTable(Tab,field ) and isNotInTable(Tab,field ) to be associated with record type definitions, where Tab is the name of a persistent table, and field is the name of a field in the record type. For example, the Itm type in Figure 2(b) could be augmented as “typ = ‘ITM’ ∧ isInTable(accounts,rcv)”, where accounts is the master accounts table. The semantics of this is that the value in the rcv field is guaranteed to be a primary key of some row in the table accounts. Similarly, isNotInTable(Tab,field ) asserts that the value in field is guaranteed not to be a primary key of any row in Tab. We assume our programming language has the following construct for keybased lookup into a table Tab: READ Tab INTO buffer KEY variable, INVALID KEY statements-N statements-F The semantics of this statement is as follows: If a table row with a key matching the value in variable is found in the table Tab, then it will be copied into buffer and control is given to statements-F. If no matching key is found, then the buffer content is undefined and control is given to statements-N. With this enhancement of record type specifications, we extend our analysis framework as follows. The new lattice we use will be D ≡ Q → (S × L) where L is the given original underlying lattice, S = 2C and C is the set of all possible predicates of the two kinds mentioned above. We now describe the changes required to the transfer functions. The transfer function of (normal) READ statements that read from input files that we described in Section 3.1 is to be augmented, as follows. Whenever a record of a certain type t ∈ T is read in, any predicates in the incoming fact that refer to fields of the input buffer are removed, and the predicates associated with t are included in the outgoing fact. The transfer function of the statement “MOVE X TO Y” copies to the outgoing fact all predicates in the incoming fact that refer to variables other than Y. Further, for each predicate in the incoming fact that refers to X, it creates a copy of this predicate, makes it refer to Y instead of X, and adds it to the outgoing fact. Transfer functions of conditionals do not need any change. Finally, we need to handle key-based lookups, which is the most interesting case. Consider once again the statement: READ T INTO buffer KEY v, INVALID KEY statements-N statements-F The transfer function first checks if a predicate of the form isInTable(T,v ) is present in the incoming dataflow fact. If it does, it essentially treats statementsN as unreachable. Else, if a predicate of the form isNotInTable(T,v ) is present in the incoming fact, it essentially treats statements-F as unreachable. Otherwise, it treats both statements-F and statements-N as reachable. A more formal presentation of these transfer functions is omitted from this paper in the interest of space. 4 The Program File State Graph (PFSG) In this section we introduce our program representation for file-processing programs, the Program File State Graph (PFSG). We then formalize the properties of the PFSG. Finally, we discuss how the PFSG serves as a basis for performing other program analyses without any modifications, while enabling them to ignore certain CFG paths that are infeasible as per the given input automaton. 4.1 Structure and construction of the PFSG The PFSG is a representation that is based on a CFG G of a file-processing program P as well as on a given input automaton S for P . The PFSG is basically an exploded CFG. If the set of states in S (i.e., file states) is qs , q1 , q2 , . . . , qe , then, for each node m in the CFG, we have nodes (m, qs ), (m, q1 ), (m, q2 ), . . . , (m, qe ) in the PFSG. In other words, the PFSG has N |Q| nodes, where N is the number of nodes in G and Q is the set of file-states of S. A structural property of the PFSG is that an edge is present between nodes (m, qi ) and (n, qj ) in the PFSG only if there is an edge from m to n in the CFG. In other words, any path (m, qi ) → (n, qj ) → . . . → (r, ql ) in the PFSG corresponds to a path m → n → . . . → r in the CFG. Let sG be the entry node of the CFG. The node (sG , qs ) is regarded as the entry node of the PFSG. The PFSG can be constructed in a straightforward manner using our basic approach that was described in Section 3.1. The precision of the PFSG is linked to the precision of the underlying analysis U that is selected. For example, the standard CP (constant-propagation) analysis could be used as U . If more precision is required a more powerful lattice, then, for instance, a relational domain (wherein each lattice value represents a set of possible valuations of variables), such as the Octagon domain [26], could be used. Once the fix-point solution is obtained from the approach, edges are added to the PFSG as per the following procedure. For each edge m → n in the CFG: Rule 1, applicable if m is a “read” node: For each transition qi → qj in the automaton S, add an edge (m, qi ) → (n, qj ) in the PFSG. Rule 2, applicable if m is not a “read” node: For each q ∈ Q add an edge (m, q) → (n, q) in the PFSG. In both the rules above we add an edge (m, qk ) → (n, ql ) only if dm (qk ) 6= ⊥L and dn (ql ) 6= ⊥L , where dm and dn are the fix-point solutions at m and n, respectively. We follow this restriction because dm (qk ) (resp. dn (ql )) is ⊥ only when there is no execution trace that can reach m (resp. n) due to a sequence of records that is in LR (qk ) (resp. LR (ql )). The intuition behind the first rule above is that when a “read” statement executes, it modifies the file-state that the program could “be in”; intuitively, this is a file-state that the input automaton could be in were we to start simulating the automaton from qs when the program starts executing, and transition to an appropriate target state upon the execution of each “read” statement based on the type of the record read. When executing a “read” statement a program could transition from a file-state qi to file-state qj only if such a transition is present in the input automaton. The second rule above does not “switch” the file-state of the program, because statements other than “read” statements affect the program’s internal state (i.e, valuation of variables) but not the file-state that the program is in. qs qsh qdh qi DHdr Itm qt qe /1/ /2/ SHdr eof eof /3/ Trl /3/ /3/ /3/ /3/ /4/ /12/ /13/ /4/ /4/ /5/ /4/ /12/ /20/ /12/ /13/ /14/ /14/ /15/ /17/ /19/ /19/ /6/ /7/ /27/ /28/ /9/ /21/ /11/ /25/ /25/ /25/ /25/ Fig. 5. PFSG for program in Fig. 1(a) and input automaton in Fig. 2 4.2 Illustration of PFSG For illustration, consider the PFSG shown in Figure 5, corresponding to the program in Figure 1(a) and input automaton in Figure 2. Recall that this automaton describes all well-formed files where headers, item records, and trailers appear in their correct positions. Visually, the figure is laid out in six columns, corresponding to the six file states in the input automaton. The nodes in the PFSG are labeled with the corresponding line numbers from the program. Therefore, e.g., the node labeled /1/ in the qs column is actually node (/1/, qs ), where /1/ represents the OPEN statement in line 1 of the program. On a related note, qs being the start state of the input automaton, and line 1 being the entry node of the program, the node mentioned above is in fact the entry node of the PFSG. Certain parts of the PFSG are elided for brevity, and are represented using the cloud patterns. This PFSG was generated using a fix-point solution from our approach of Section 3.1, using CP (constant propagation) as the underlying analysis U . A fragment of this fix-point solution was shown in Figure 4 (the sets of possibly uninitialized variables in that figure can be ignored in the current context.) We now discuss in more detail a portion of the PFSG in Figure 5, with emphasis on how it elides certain infeasible paths that are present in the original CFG. Line 2 in the program is a READ statement. As per the given input automaton the outgoing transitions from qs go to qsh and to qdh . Therefore, as per Rule 1 of our PFSG edge-addition approach (see Section 4.1 above), there are outgoing edges from (/2/, qs ) to copies of node 3 in the qsh and qdh columns (for clarity we have labeled these edges with the types on the corresponding input-automaton transitions). The qsh column (i.e., the second column) essentially consists of a copy of the loop body, specialized to the situation wherein the last record read was of type SHdr (SHdr being the type on all transitions coming into qsh ). In particular, note that the true edge out of /4/ to /5/ in the qsh column is elided. This is because in the fix-point solution (see Figure 4) the CP (constant propagation) fact associated with the qsh file state at the point before /4/ indicates that in-rec.typ has value ‘HDR’ (this fact is abbreviated as “i.t = ‘H’” in the figure). Therefore, in the fix-point solution, the underlying fact associated with the qsh file state out of this edge ends up being ⊥, which results in Rule 2 adding only the false edge from /4/ to /12/. Line 25 in the program being a READ statement, there is an edge from node (/25/, qsh ) at the bottom of the qsh column to the entry of column qi (qi being the sole successor of qsh in the input automaton). The qi column consists of a copy of the loop body, specialized to the situation wherein the previous record read is of type Itm (this being the type on transitions coming into qi ). From the end of the qi column control goes to the qt column, and from the end of that column back to the beginning of the qsh and qdh columns. It is notable that the structure of the PFSG is inherited both from the CFG and from the input automaton. As was mentioned in the discussion above, control transfers from one column to another mirror the transitions in the input automaton, while paths within a column are inherited from the CFG, but specialized wrt the type of record that was last read. 4.3 Program analysis using PFSG Any program analysis that can be performed using a CFG can naturally be performed unmodified using a PFSG, by simply letting the analysis treat each node (n, qi ) as being the same statement/conditional as the underlying node n. Such an analysis will be no less precise than with the original CFG of the program. This is because, by construction, every path in the PFSG corresponds to a path in the original CFG; in other words, there are no “extra” paths in the PFSG. To the contrary, certain CFG paths that are infeasible as per the given input automaton could be omitted from the PFSG. In other words, precision of the analysis is improved by ignoring executions due to certain infeasible inputs. For instance, in the example that was discussed above, due to the omitted edge from /4/ to /5/ in the qsh column, there is no path in the PFSG that visits copies of the nodes /1/, /2/, /3/, /4/, /5/, and /6/, in that order, even though such a path exists in the original CFG. In other words, the PFSG encodes the fact that under the given input file format an “item” record cannot occur as the first record in an input file. (However, in general, due to possible imprecision in the given underlying analysis U , not all paths that are infeasible as per the given input automaton would necessarily be excluded from the PFSG.) To illustrate the benefits of program analysis using the PFSG, we discuss two example analyses below: – Say we wish to perform possibly uninitialized variables analysis. Due to the path /1/-/2/-/3/-/4/-/5/-/6/ in the original CFG, the use of same-flag in line /6/ would be declared as possibly uninitialized. However, under the given input automaton, since every path that reaches line /6/ in the PFSG reaches it via lines /15/ or /17/ (which both defined same-flag), the use mentioned above would be declared as definitely initialized when the possibly-initialized analysis is performed on the PFSG. – A CP (constant-propagation) analysis, when done on the PFSG in Figure 5, would indicate that at the point before line /25/ same-flag would not have a constant value. However, when the same analysis is done on the PFSG, the same analysis would indicate that if (a) if in-rec.type is ‘HDR’ and in-rec.src is ‘SAME’ then same-flag has value ‘S’, (b) if in-rec.type is ‘HDR’ and in-rec.src is ‘DIFF’ then same-flag has value ‘D’, and (c) same-flag is not a constant otherwise. These correlations are identified because the PFSG is “exploded”, hence segregates CFG paths that end at the same program point but are due to record sequences that are accepted by different file-states of the input automaton. Correlations such as the one mentioned above cannot be identified, in general, using the CFG unless very expensive domains (such as relational domains) are used. The two instances of precision improvement mentioned above can also be obtained using our approach of Section 3.1, if we use CP × Uninit as the underlying domain U (where Uninit is the possibly-uninitialized analysis) for the first instance, and if we simply use CP as the underlying domain U for the second instance. However, in general, there are several scenarios where the PFSG serves better as a foundation for performing program analysis than the approach of Section 3.1: – The approach of Section 3.1 applies only to forward dataflow analysis. Whereas, the PFSG can be used for forward as well as backward dataflow analysis problems. – The PFSG as a basis for applying static analysis techniques other than dataflow analysis, such as symbolic execution, model-checking, assertional reasoning, etc. Implementations of these techniques that are designed for CFGs can be applied unmodified on the PFSG. All these analyses are likely to benefit from the pruning of paths from the PFSG that are infeasible as per the given input automaton. 4.4 Formal properties of the PFSG Soundness. We now characterize the paths in the original CFG that are necessarily present in the PFSG. This result forms the basis for the soundness of any static analysis that is applied on the PFSG. Theorem: Let U ≡ ((L, vL ), FL ) be a given underlying sound [9] abstract interpretation. Consider any execution trace t of the program P that begins with a concrete state that is represented by the given initial dataflow fact iL ∈ L. Let l be the sequence of records due to which t executes, and T be the number of nodes in ns(t). If (a) l is in LR (q) for some non-final file-state q of S, and t did not encounter end-of-file upon a read, or (b) l is in LR (q) for some final file-state q of S, and the last “read” in t encountered end-of-file Then there is a path t0 in the PFSG such that (a) the first node of t0 is (sG , qs ), (b) for all i ∈ [2, T ], if the ith node of ns(t) is some node m then the ith node of t0 is of the form (m, qj ) for some file-state qj , and (c) the last node of t0 is of the form (m, q), for some m.  Intuitively, the theorem above states that for all execution traces that are due to record sequences that are accepted by the given input automaton, control-flow paths taken by these traces are present in the PFSG. In the specific scenario where the PFSG is used to perform a dataflow analysis, then the theorem above can be instantiated as follows. Corollary: Let D be any sound dataflow analysis framework [9], based on a semi-join lattice. Let d0 be a given dataflow fact at program entry (d0 is an element of D’s lattice). For any node n of the original CFG G, let s(n) denote the final fix-point solution at n computed using D on the CFG using initial value d0 . Consider a PFSG for G obtained using a given input automaton S. For any node (n, qi ) of the PFSG, let s(n, qi ) denote the final fix-point solution at n computed byFD, but applied on the PFSG, using the same initial value d0 . Let s0 (n) ≡ qi is a file−state of S {s(n, qi )}. (a) s0 (n) v s(n). [Precision] (b) γ(s0 (n)) over-approximates the set of concrete states that can arise at node n when the program is run on input files that conform to S. [Soundness] Precision ordering among PFSGs. As was clear from the discussion in this section, the PFSG produced by our approach for a given CFG G and input automaton S is not fixed, but depends on the selected underlying abstract interpretation U . The theorem given above states that no matter what abstract interpretation is used as U , the PFSG is sound (i.e., does not elide any paths that can be executed due to record sequences that are accepted by S) as long as U is sound. However, the precision of the PFSG depends the precision of U . Given a CFG G and an input automaton S, we can define a precision ordering on the set of PFSGs for G and S that can be obtained using different (sound) underlying domains U1 , U2 , etc.. A PFSG P1 can be said to be at-least as precise as another PFSG P2 if every edge (m, qi ) → (n, qj ) in P1 is also present in P2 . (Note that this implies that every path in P1 is also present in P2 .) Theorem: If an underlying domain U2 is a consistent abstraction [9] of another underlying domain U1 , then the PFSG obtained for G and S using U1 is at least as precise as the PFSG obtained for G and S using U2 .  5 Implementation and evaluation Prog. name ACCTRAN SEQ2000 DTAP CLIEOPP PROG1 PROG2 PROG3 PROG4 LoC 155 219 632 1421 1177 1052 2780 49846 No. of CFG Nodes 73 115 275 900 762 724 1178 32258 Well-formed Automaton |Q| |∆| 4 8 5 15 5 6 21 48 8 16 6 11 17 28 13 34 Full Automaton |Q| |∆| 5 15 6 25 10 41 12 47 12 49 20 50 - Fig. 6. Benchmark program details We have targeted our implementation at Cobol batch programs. These are very prevalent in large enterprises [6], and are based on a variety of standard as well as proprietary file formats. Another motivating factor for this choice is that one of the authors of this paper has extensive professional experience with developing and maintaining Cobol batch applications. We have implemented our analysis using a proprietary program analysis framework Prism [23]. Our implementation is in Java. We use the call strings approach [30] for precise context-sensitive inter-procedural analysis. Cobol programs do not use recursion; therefore, we place no apriori bound on call-string lengths. Our analysis code primarily consists of an implementation of our generic analysis framework, as described in Section 3.1. We have currently not implemented our extension for data integrity constraints that was described in Section 3.4, nor have we implemented our PFSG construction approach (Section 4). We also have some lightweight scripts that process the fix-point solution emitted by the analysis to compute results for the specialization problem as well as the file conformance problem (see Section 3.3). We ran our tool on a laptop with an Intel i7 2.8 GHz CPU with 4 GB RAM. 5.1 Benchmark programs We have used a set of eight programs as benchmarks for evaluation. Figure 6 lists key statistics about these programs. The second and third columns give the sizes of these programs, in terms of lines of code (including variable declarations) and in terms of number of (executable) nodes in the CFG (as constructed by Prism). The program ACCTRAN is a toy program that was used as a running example in a previous paper [31]. SEQ2000 is an example inventory management program used in a textbook [27] to showcase a typical sequential file processing program. The program DTAP has been developed by the authors of this paper. It is a payments validation program. The file-format it uses and the validation rules it implements are both taken from a widely used standard specification [15]. The program CLIEOPP is a payment validation and transformation program. It was developed by a professional developer at a large IT consulting services company for training purposes. The format and the validation rules it uses are from another standard specification [12]. PROG1 and PROG2 are real-world programs used in a bank for validating and reporting “return” payments sent from branches of the bank to the head-office. PROG3 and PROG4 are real-world programs from major multinational financial services companies. The program PROG3 is a format translator, which translates various kinds of input records to corresponding output records. PROG4 reads data from a sequential master file, collects the data required for computing monthly interest and fee for each account, and writes this data out to various output files. The file formats used in these four real-world programs are proprietary. Columns 4 and 5 in Figure 6 give statistics about the well-formed automaton for each program. For the programs ACCTRAN and SEQ2000 the respective original sources of these programs also give the expected input file formats. For the real programs PROG1, PROG2, and PROG3, we derived the record types as well as well-formed automatons by going through the programs and guessing the intended formats of the input files to these programs. For program PROG4, the maintainers have provided us the file format specification. In the case of programs DTAP and CLIEOPP, we constructed the record types as well as well-formed automatons from their respective standard input-file specifications. In all cases we employed a precision-enhancing thumb-rule while creating the automatons, namely, that all incoming transitions into a file state be labeled with the same type. For most of the programs we also constructed a full automaton, to use in the context of “over acceptance” analysis. We created each full automaton using the corresponding well-formed automaton as a basis, following the basic procedure described in Section 3.3. Statistics about these full automatons are presented in the last two columns in Figure 6. We did not create a full automaton for CLIEOPP and PROG4, because the full automatons for these program turn out to be large and unwieldy to specify. Instead, we used the well-formed automatons in place of the full automatons in over-acceptance analysis, which can cause potential unsoundness. We evaluate our approach in three different contexts – its effectiveness in detecting file-format conformance violations in programs, its usefulness in specializing file-processing programs, and its ability to improve the precision of a standard dataflow analysis. 5.2 File format conformance checking As a first step in this experiment, we manually identified the rejection points for each program. This was actually a non-trivial task, because each program had its own idioms for rejecting files. Some programs wrote warnings messages into log files, others used system routines for terminating the program, while others used Cobol keywords such as GOBACK and STOP RUN. Furthermore, since not every instance of a warning output or termination is necessarily due to file format related issues, we had to exercise care in selecting the instances that were Prog. File format conformance warnings Name Under acceptance Over acceptance ACCTRAN 0 1 SEQ2000 3 1 DTAP 0 1 CLIEOPP 13 *0 PROG1 5 9 PROG2 6 10 PROG3 0 1 PROG4 0 * 10 Fig. 7. Conformance checking results due to these issues. We also manually added summary functions in our analysis for calls to certain system routines that terminate the program: our summary functions treat these calls as returning a ⊥ dataflow value for all file states, thus simulating termination. In this experiment we use CP (Constant Propagation) as the underlying analysis U for our lifted approach. Figure 7 summarizes the results of this analysis. For each program, the second column captures the number instances of a file state of the well-formed automaton having a non-⊥ value at a rejection point. These are basically the under-acceptance warnings. The third column depicts the number of file states of the full automaton (excluding the final states of the original well-formed automaton) that reach the final point of the “main” procedure with a non-⊥ value. These are basically the over-acceptance warnings. The running time of the analysis was a few seconds or less on all programs except PROG4. On this very large program the analysis took 3700 seconds. Discussion of under-acceptance results. A noteworthy aspect of these results is that four of the eight programs, namely, ACCTRAN, DTAP, PROG3, and PROG4 have been verified as having no under-acceptance errors. In the case of CLIEOP, some of the under-acceptance warnings turned out to be true positives during manual examination, in that the code contained programming errors that cause rejection of well-formed files. We also manually examined one other program for which there were warnings – SEQ2000. Although this program is a textbook program, it follows a a complex idiom. Certain fields in certain record types in the input file format for this program are supposed to contain values that appear as primary keys in a sorted persistent table that is accessed by the program. However, the well-formed automaton that we created does not capture this constraint, and is hence overapproximated 3 . This caused false under-acceptance warnings to be reported. Discussion of over-acceptance results. As is clear from the table, our implementation reports over-acceptance warnings on all the programs. (The numbers marked with a “*” are potentially lower than they should really be, because, as mentioned in Section 5.1, we did not actually use a full automaton for these 3 This program uses sequential lookup on the persistent table, which is an idiom that our persistent-stores extension (Section 3.4) does not support. two programs.) We manually examined four of these programs, and report our findings below. Warnings reported for two of the programs – DTAP and PROG4 – turned out genuine. The input file-format for DTAP is similar to the one shown in Figure 2(a) (the difference is that it uses single state qh in place of qsh and qdh ). This program happens to accept files that contain batches in which a header record and a trailer record occur back-to-back without any intervening item records, which is a violation of the specification. In the case of PROG4, when we discussed the warnings with the maintainers of the program, they agreed that some of them were genuine. However, at present, there is another program that runs before PROG4 in their standard workflow that ensures that ill-formed files are not supplied to PROG4. In the case of SEQ2000 and PROG3, the well-formed automatons were overapproximated. There is one other challenging idiom in SEQ2000, which also contributes to imprecision. Some of the routines that emit warnings emit fileconformance warnings when called from certain call-sites, and other kinds of warnings when called from other call-sites. Since we currently do not have a context-sensitive scheme to mark rejection points, we left these routines unmarked as a conservative gesture. 5.3 Program specialization S. No 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 12 13 Program name ACCTRAN ACCTRAN SEQ2000 SEQ2000 SEQ2000 DTAP DTAP DTAP DTAP CLIEOPP CLIEOPP PROG1 PROG1 PROG2 PROG2 PROG2 PROG3 PROG4 PROG4 Criterion name Deposit Withdraw Add Change Delete DDBank DDCust CTBank CTCust Payments DirectDebit Edit Update Form Telex Modified TranCopy DAccts MAccts Criterionspecific Common nodes nodes 1 30 41 14 14 84 6 5 7 216 5 7 216 22 98 622 17 215 511 3 5 644 5 37 671 2 1047 30825 Fig. 8. Specialization criteria and results The objective of this experiment is to evaluate the effectiveness of our approach in identifying program statements that are relevant to given criteria that are specified as specialization automatons. In this experiment we used CP as the underlying analysis U . We ran our tool multiple times on each program, each time with a different specialization criterion that we identified which represents a meaningful functionality from the end-user perspective. For instance, consider the program SEQ2000. The input file to this program consists of a sequence of request records, with each request being either to “Add” an item to the inventory (which is stored in a persistent table), to “Change” the details of an item in the inventory, or to “Delete” an item from the inventory. A meaningful criterion for this program would be one that is concerned only about “Add” requests. Similarly, “Change” and “Delete” are meaningful criteria. Figure 8 summarizes the results from this experiment. Each row in the figure corresponds to a programcriterion pair. The third column in the figure indicates the mnemonic name that we have given to each of our criteria. Note that for PROG3, the criterion TranCopy specializes the program to process one of twelve kinds of input record types. While we have done the specialization with all 12 criteria, for brevity we report only one of them in the figure (i.e., TranCopy). Results. For any criterion, the sum of the numbers in the fourth and fifth columns in the figure is the number of CFG nodes that were determined by our analysis as being relevant to the criterion (i.e., were reached with a non-⊥ value under some file state with the specialization automaton). For instance, for ACCTRANDeposit, the number of relevant CFG nodes is 42 (out of a total of 73 nodes in the program – see Figure 6). The fifth column indicates the number of (common) nodes that were relevant to all of the criteria supplied, while the fourth column indicates the number of nodes that were relevant to the corresponding individual criterion but are not common to all the criteria. Note that in the case of DTAP we show commonality not across all four criteria, but within two subgroups each of which contains two (related) criteria. Also, in the case of PROG3 the common nodes depicted are across all twelve criteria. It is notable that in most of the programs the commonality among the statements that are relevant to the different criteria is high, while statements that are specific to individual criteria are fewer in number. Our belief is that in a program comprehension setting the ability of a developer to separately view common code and criterion-specific code would let them appreciate in a better way the processing logic that underlies each of these criteria. Manual examination. We manually examined the output of the tool to determine its precision. We did this for all programs except PROG1, PROG2, and PROG4 which had difficult control-flow as well as logic which made manual evaluation difficult. To our surprise, the tool was 100% precise on every criterion for four of the remaining programs – ACCTRAN, CLIEOP, DTAP, and PROG3. That is, it did not fail to mark as unreachable any CFG node that was actually unreachable (as per our human judgment) during executions on input files that conformed to the given specialization automaton. This is basically evidence that specialization automatons (in conjunction with CP as the underlying analysis) are a sufficiently precise mechanism to specialize file-processing programs. The remaining one program is SEQ2000, for which, as discussed in Section 5.2, we have an over-approximated input automaton. Although the specialized program does contain extra statements that should ideally be removed, the result actually turns out to be 100% precise relative to the given automaton. 5.4 Precision improvement of existing analyses As discussed in Section 1.2, there are scenarios where one is interested in performing standard analyses on a program, but restricted to paths that can be taken during runs on well-formed files only. To evaluate this scenario we implemented two analyses. One is a possibly uninitialized variables analysis, whose abstract domain we call Uninit, wherein one wishes to locate references to variables that have either not been initialized, or have been initialized using computations that in turn refer to possibly uninitialized variables. The second is a reaching definitions analysis, whose abstract domain we call RD. We ran each of these two analyses in two modes: a “direct” mode, where the analysis is run as-is, and a “lifted” mode, where the analysis is done by lifting it with a well-formed automaton. In the lifted mode, for Uninit we used CP × Uninit as the underlying analysis U , while for RD we used CP × RD as the underlying analysis. (The CP component is required to enable path-sensitivity, as was illustrated in Figure 4.) In the interest of space we summarize the results. With Uninit, 82.5% of all variable references in SEQ2000 were labeled as uninitialized in the direct mode, whereas only 25.7% were labeled so in the lifted mode. For DTAP, the analogous numbers are 61.4% and 9.6%. In other programs the lifted mode performed only marginally better than the direct mode. In the case of RD, the total number of def-use edges computed by the lifted mode were 12% below those computed by the direct mode for DTAP, 23% below for CLIEOPP, and 15% below for PROG2. In the other programs the reduction was marginal. We do not have numbers for these experiments on the large program PROG4, as the cross-product domains (mentioned above) do not yet scale to programs of these sizes. On the other programs the direct analyses took anywhere from a few hundreds of a second to up to 18 seconds, while the lifted analyses took anywhere from a few tenths of a second to 180 seconds. We did a limited study of some programs where the lifted mode did not give significant benefit. Some of the causes of imprecision that we observed were array references, and calls to external programs, both of which we handle only conservatively. These confounding factors in these programs could not be offset by the precision improvement afforded by the input automatons. 5.5 Discussion In summary, we are very encouraged by our experimental results. Except the two smaller programs – ACCTRAN and SEQ2000 – our benchmark programs are either real, or work on real formats and implement real specifications. File-format conformance checking and program specialization are two novel problems in whose context we have evaluated our tool. The tool verified four programs as not rejecting any well-formed files, and found genuine file-format related errors in several other programs. The tool was very precise in the program specialization context. Finally, it enabled non-trivial improvement in precision in the context of uninitialized variables or reaching definitions analysis on four of the eight programs. 6 Related Work We discuss related work broadly in several categories. Analysis of record- and file-processing programs. There exists a body of literature, of which the work of Godefroid et al. [19] and Saxena et al. [29] are representatives, on testing of programs whose inputs are described by grammars or regular expressions, via concolic execution. Their approaches are more suited for bug detection (with high precision), while our approach is aimed at conservative verification, as well as program understanding and transformation tasks. Various approaches have been proposed in the literature to recover record types and file types from programs by program analysis [24,3,10,14,13]. These approaches complement ours, by being potentially able to infer input automatons from programs in situations where pre-specified file formats are not available. A report by Auguston [1] shows the decidability of verifying certain kinds of assertions in file-processing programs. Program specialization. Blazy et al. [2] describe an approach to specialize Fortran programs using constant propagation. There is a significant body of literature on the technique of partial evaluation [22], which is a sophisticated form of program specialization, involving loop unrolling to arbitrary depths, simplification of expressions, etc. These approaches typically support only criteria on fixed sized program inputs. Launchbury et al. [25] extend partial evaluation to allow criteria on data structures. Consel et al. [8] provide an interesting variant of partial evaluation, wherein they propose an abstract-interpretation based framework to specialize functional programs with abstract values such as signs, types and ranges. Our approach could potentially be framed as an instantiation of their approach, with an input-automaton-based “lifted” lattice, and corresponding lifted transfer functions. Program slicing. Program slicing [35] is widely applicable in software engineering tasks, usually to locate the portion of a program that is relevant to a criterion. The constrained variants of program slicing [16,4,20] provide good precision in general, at the cost of being potentially expensive. Existing approaches for constrained slicing do not specifically support constraints on the record sequences that may appear in input files of file-processing programs. Our “lifted” reaching-definitions analysis, which we described in Section 5.4, enables this sort of slicing. Typestates. There is a rich body of literature in specifying and using type states, with the seminal work being that of Strom et al. [32]. In the context of analyzing file-processing programs, type-state automatons have been used to capture the state of a file (e.g., “open”, “closed”, “error”) [11,17]. To our knowledge ours is the first work in this space to use automatons to encode properties of the prefix of records read from a file. Shape analysis. Shape analysis [28] is a precise but heavy-weight technique for verifying shapes and other properties of in-memory data structures. While at a high level a data file is similar to an in-memory list, the operations used to traverse files and in-memory data structures are very different. To our knowledge shape analysis has not been used in the literature to model the contents and states of files as they are being read in programs. It would be an interesting topic of future work to explore in-depth the feasibility of such an approach. 7 Conclusions and Future Work We presented in this paper a novel approach to apply any given abstract interpretation on a file-processing program that has an associated input file-format. The file-format basically enables our approach to elide certain paths in the program that are infeasible as per the file format, and hence enhance the precision and usefulness of the underlying analysis. We have demonstrated the value of our approach using experiments, especially in the context of two novel applications: file format conformance checking, and program specialization. A key item of future work is to allow richer constraints on the data in the input file and persistent tables; for instance, general logical constraints, constraints expressing sortedness, etc., would be useful in many settings to obtain enhanced precision and usefulness. Also, we would like to investigate our techniques on domains other than batch programs; e.g., to image-processing programs, XMLprocessing programs, and web-based applications. References 1. M. Auguston. Decidability of program verification can be achieved by replacing the equality predicate by the “constructive” one. Technical Report NMSU-CSTR9907, New Mexico State University, 1999. 2. S. Blazy and P. Facon. SFAC, a tool for program comprehension by specialization. In Proc. IEEE Workshop on Program Compr., pages 162 –167, nov 1994. 3. J. Caballero, H. Yin, Z. Liang, and D. Song. Polyglot: Automatic extraction of protocol message format using dynamic binary analysis. In Proc. ACM Conf. on Computer and Comm. Security (CCS), pages 317–329, 2007. 4. G. Canfora, A. Cimitile, and A. D. Lucia. Conditioned program slicing. Information and Software Technology, 40(11):595 – 607, 1998. 5. Apache Common Log Format. http://httpd.apache.org/docs/current/logs. html, 2013. 6. Brain drain: Where Cobol systems go from here. ComputerWorld, May 21 2012. http://www.computerworld.com/s/article/9227263. 7. C. Consel, L. Hornof, R. Marlet, G. Muller, S. Thibault, E.-N. Volanschi, J. Lawall, and J. Noyé. Partial evaluation for software engineering. ACM Comput. Surv., 30(3es), Sept. 1998. 8. C. Consel and S. C. Khoo. Parameterized partial evaluation. ACM Transactions on Programming Languages and Systems (TOPLAS), 15(3):463–493, 1993. 9. P. Cousot and R. Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proc. ACM Symp. on Principles of Programming Languages (POPL), pages 238–252, 1977. 10. W. Cui, M. Peinado, K. Chen, H. J. Wang, and L. Irun-Briz. Tupni: Automatic reverse engineering of input formats. In Proc. ACM Conf. on Comp. and Comm. Security (CCS), pages 391–402, 2008. 11. M. Das, S. Lerner, and M. Seigle. ESP: Path-sensitive program verification in polynomial time. In Proc. Conf. Prog. Langs. Design and Impl. (PLDI), pages 57–68, 2002. 12. David Krop. CLIEOP Client Orders - File description. http://www.equens.com/ Images/CLIEOP%20EN.pdf. 13. P. Devaki and A. Kanade. Static analysis for checking data format compatibility of programs. In Proc. Foundations of Softw. Tech. and Theor. Comput. Science (FSTTCS), pages 522–533, 2012. 14. E. Driscoll, A. Burton, and T. Reps. Checking conformance of a producer and a consumer. In Proc. Foundations of Softw. Engg. (FSE), pages 113–123, 2011. 15. Retail Payment System(RPS),Deutsche Bundesbank. http://www.bundesbank. de/Redaktion/EN/Downloads/Core_business_areas/Payment_systems/ procedural_rules_rps.pdf, 2013. 16. J. Field, G. Ramalingam, and F. Tip. Parametric program slicing. In Proc. Sym. on Principles of Prog. Langs. (POPL), pages 379–392, 1995. 17. J. Fischer, R. Jhala, and R. Majumdar. Joining dataflow with predicates. In ACM SIGSOFT Int. Symp. on Foundations of Softw. Engg. (FSE), pages 227–236, 2005. 18. K. Fisher and D. Walker. The PADS project: An overview. In Proc. Int. Conf. on Database Theory (ICDT), pages 11–17, 2011. 19. P. Godefroid, A. Kiezun, and M. Y. Levin. Grammar-based whitebox fuzzing. In Proc. ACM Conf. on Prog. Lang. Design and Impl. (PLDI), pages 206–215, 2008. 20. M. Harman, R. Hierons, C. Fox, S. Danicic, and J. Howroyd. Pre/post conditioned slicing. In Proc. Int. Conf. on Software Maintenance (ICSM), pages 138–147, 2001. 21. Introduction to HL7 Standards. http://www.hl7.org/implement/standards/ index.cfm?ref=nav, 2013. 22. N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice Hall International, 1993. 23. S. Khare, S. Saraswat, and S. Kumar. Static program analysis of large embedded code base: an experience. In Proc. India Software Engg. Conf. (ISEC), 2011. 24. R. Komondoor and G. Ramalingam. Recovering data models via guarded dependences. In Working Conf. on Reverse Engg. (WCRE), pages 110–119, 2007. 25. J. Launchbury. Project Factorisations in Partial Evaluation, volume 1. Cambridge University Press, 1991. 26. A. Mine. The octagon abstract domain. Higher Order Symbol. Comput., 19(1):31100, March 2006. 27. M. Murach, A. Prince, and R. Menendez. How to work with Sequential files. In Murach’s Structured COBOL, chapter 13. Murach, 2000. 28. M. Sagiv, T. Reps, and R. Wilhelm. Parametric shape analysis via 3-valued logic. In Proc. Symp. on Principles of Prog. Langs. (POPL), pages 105–118, 1999. 29. P. Saxena, P. Poosankam, S. McCamant, and D. Song. Loop-extended symbolic execution on binary programs. In Proc. Int. Symposium on Softw. Testing and Analysis (ISSTA), pages 225–236, 2009. 30. M. Sharir and A. Pnueli. Two approaches to interprocedural data flow analysis. In S. S. Muchnick and N. D. Jones, editors, Program Flow Analysis: Theory and Application. Prentice Hall Professional Technical Reference, 1981. 31. S. Sinha, G. Ramalingam, and R. Komondoor. Parametric process model inference. In Working Conf. on Reverse Engg. (WCRE), pages 21–30, 2007. 32. R. E. Strom and S. Yemini. Typestate: A programming language concept for enhancing software reliability. Software Engineering, IEEE Transactions on, SE 12(1):157–171, 1986. 33. The United Nations rules for Electronic Data Interchange for Administration, Commerce and Transport. UN/EDIFACT DRAFT DIRECTORY. http://www.unece. org/trade/untdid/texts/d100_d.htm. 34. H. Xi. Dependent types in practical programming. PhD thesis, Carnegie-Mellon University, 1998. 35. B. Xu, J. Qian, X. Zhang, Z. Wu, and L. Chen. A brief survey of program slicing. SIGSOFT Softw. Eng. Notes, 30(2):1–36, Mar. 2005. A A.1 Appendix Precision of our approach We discuss here the precision of our approach, which was alluded to in Section 3.2, in more detail. An L-solution is a function from program points in the given program P to dataflow values from the lattice L. A (Q, L)-solution is a function from program points to functions in the domain Q → L, where Q is the set of file states in an input automaton. Given a (Q, L) solution g and an L-solution f (for the same program P ), we say that g is more precise than f iff at each program point p: tq∈Q {(g(p))(q)} vL f (p) Note that we are actually using “more precise” as shorthand for “equally precise or more precise”. Let f1 be the fix-point L-solution obtained for program P by directly using the underlying analysis U . Our first key result is as follows. Theorem 2. If S is any input automaton for P with set of files states Q, then the (Q, L) fix-point solution computed by our approach using S and using the underlying analysis U is more precise than fix-point solution computed by U directly. Intuitively, the above theorem captures the fact that the path-sensitivity that results from tracking different dataflow values (from lattice L) for different file states causes increase in precision. Note that the theorem above does not touch upon soundness. In order to ensure soundness, S would additionally need to accept all well-formed files or all files, depending on the notion of soundness that is sought. A different question that naturally arises is, if there are multiple candidate well-formed automatons that all accept the same set of well-formed files, will they all give equally precise results when used as part of our analysis? The answer, in general, turns out to be “no”. It can also be shown that if an input automaton accepts a smaller set of files than another automaton, then the first automaton need not necessarily give more precise results than the second one on all programs. In fact, precision is linked both to the set of files accepted as well as to the structure of the automatons themselves. In order to formalize the above intuition, we first define formally the notion of a precision ordering on different solutions for a program P using different input automatons. A (Q1 , L) solution g1 is said to be more precise than another (Q2 , L) solution g2 iff at each program point p, for each file state q1 ∈ Q1 , there exists a file state q2 ∈ Q2 such that: (g1 (p))(q1 ) vL (g2 (p))(q2 ) We then define a notion of refinement among input automatons for the same program P . We say that automaton S2 = (Q2 , Σ2 , ∆2 , qs2 , Qe2 ) is a refinement of automaton S1 = (Q1 , Σ1 , ∆1 , qs1 , Qe1 ) iff there exists a mapping function m : Q2 → Q1 such that: - m(qs2 ) = qs1 , and - For each transition p2 → q2 in ∆2 labeled with some symbol s2 ∈ Σ2 : There exists one or more transitions from m(p2 ) to m(q2 ) in S1 . Furthermore, if s1 is the label on any of these transitions, then either (1) s2 and s1 are both eof , or (2) s2 and s1 are both types, and s2 ’s constraint implies s1 ’s constraint. If an input automaton S2 is a refinement of an input automaton S1 , then the following two properties can be shown to hold: (1) each accepting state of S2 is mapped by m to an accepting state of S1 , and (2) the set of files accepted by S2 is a subset of files accepted by S1 . Now, our main result on precision ordering of input automatons is as follows. Theorem 3. For any program P and for any given underlying analysis U , if an input automaton S2 for P is a refinement of an input automaton S1 for P , then the fix-point solution computed by our approach using S2 and U is more precise than the fix-point solution computed by our approach using S1 and U . An important take away from the above theorem is: When there is a choice between two input automatons that accept the same set of files (e.g., two different well-formed automatons accepting the same set of well-formed files), if one of them is a refinement of the other then the refined automaton will give more precision than one of which it is a refinement. A.2 Checking over-acceptance errors We discuss here a procedure to extend a given well-formed automaton S = (Q, Σ = T ∪ {eof }, ∆, qs , Qe ) into a full automaton. We first create a new type named “NA” (none of the above), and associate with it a constraint that lets it cover all records that are not covered by any of the types in the original set of types T . We also add a new file state to the well-formed automaton, which we denote as qy in this discussion. Let T 0 ≡ T ∪ {NA}, and Q0 ≡ Q ∪ {qy }. For every state q in Q0 , and for every type t in T 0 , if there is no transition labeled t out of q we add a transition from q to qy labeled t. Finally, we add one more new file state qx to the automaton, make it a final state, add eof transitions from all non-final states to this state. The intuition behind this construction is that qx accepts all ill-formed files, while qy accepts all record sequences that are not prefixes of well-formed files.
6cs.PL
1 Achievability Performance Bounds for Integer-Forcing Source Coding Elad Domanovitz and Uri Erez arXiv:1712.05431v1 [cs.IT] 14 Dec 2017 Abstract Integer-forcing source coding has been proposed as a low-complexity method for compression of distributed correlated Gaussian sources. In this scheme, each encoder quantizes its observation using the same fine lattice and reduces the result modulo a coarse lattice. Rather than directly recovering the individual quantized signals, the decoder first recovers a full-rank set of judiciously chosen integer linear combinations of the quantized signals, and then inverts it. It has been observed that the method works very well for “most” but not all source covariance matrices. The present work quantifies the measure of bad covariance matrices by studying the probability that integer-forcing source coding fails as a function of the allocated rate, where the probability is with respect to a random orthonormal transformation that is applied to the sources prior to quantization. For the important case where the signals to be compressed correspond to the antenna inputs of relays in an i.i.d. Rayleigh fading environment, this orthonormal transformation can be viewed as being performed by nature. Hence, the results provide performance guarantees for distributed source coding via integer forcing in this scenario. I. I NTRODUCTION Integer-forcing (IF) source coding, proposed in [1], is a scheme for distributed lossy compression of correlated Gaussian sources under a minimum mean squared error distortion measure. Similar to its channel coding counterpart, in this scheme, all encoders use the same nested lattice codebook. Each encoder quantizes its observation using the fine lattice as a quantizer and reduces the result modulo the coarse lattice, which plays the role of binning. Rather than directly recovering the individual quantized signals, the decoder first recovers a full-rank set of judiciously chosen integer linear combinations of the quantized signals, and then inverts it. An appealing feature of integer-forcing source coding, not shared by previously proposed practical methods (e.g., Wyner-Ziv coding) for the distributed source coding problem, is its inherent symmetry, supporting equal distortion and quantization rates. A potential application of IF source coding is to distributed compression of signals received at several relays as suggested in [1] and further explored in [2]. Similar to IF channel coding, IF source coding works well for “most” but not all Gaussian vector sources. Following the approach of [3], in the present work we quantify the measure of bad source covariance matrices by considering a randomized version of IF source coding where a random unitary transformation is applied to the sources prior to quantization. While in general such a transformation implies joint processing at the encoders, we note that in some natural scenarios, including that of distributed compression of signals received at relays in an i.i.d. Rayleigh fading environment, the random transformation is actually performed by nature.1 In fact, it was already empirically observed in [1] that IF source coding performs very well in the latter scenario. The rest of this paper is organized as follows. Section II formulates the problem of distributed compression of Gaussian sources in a compound vector source setting and provides some relevant background on IF source coding. Section III describes randomly precoded IF source coding and its empirical performance. Section IV derives upper bounds on the probability of failure of randomly-precoded IF as a function of the excess rate. In Section V, deterministic linear precoding is considered. A bound on the worst-case excess rate needed is derived for any number of sources with any correlation matrix when spacetime precoding derived from non-vanishing determinant codes is used. Further, we show that this bound can be significantly tightened for the case of uncorrelated sources. Concluding remarks appear in Section V. II. P ROBLEM F ORMULATION AND BACKGROUND In this section we provide the problem formulation and briefly recall the achievable rates of IF source coding as developed in [1]. The work of E. Domanovitz and U. Erez was supported in part by the Israel Science Foundation under Grant No. 1956/16 and by the Heron consortium via the Israel Ministry of Economy and Industry. E. Domanovitz and U. Erez are with the Department of Electrical Engineering – Systems, Tel Aviv University, Tel Aviv, Israel (email: domanovi,uri@eng.tau.ac.il). 1 This follows since the left and right singular vector matrices of an i.i.d. Gaussian matrix K are equal to the eigenvector matrices of the Wishart ensembles KKT and KT K, respectively. The latter are known to be uniformly (Haar) distributed. See, e.g., Chapter 4.6 in [4]. 2 A. Distributed Compression of Gaussian Sources We start by recalling the classical problem of distributed lossy compression of jointly Gaussian real random variables under a quadratic distortion measure. Specifically, we consider a distributed source coding setting with K encoding terminals and one decoder. Each of the K encoders has access to a vector of n i.i.d. realizations of the random variable xk , k = 1, ..., K.2 The random vector x = (x1 , . . . , xK )T (corresponding to the different sources) is assumed to be Gaussian with zero mean and covariance matrix Kxx , E xxT . Each encoder maps its observation xk to an index using the encoding function  Ek : Rn → 1, ..., 2nRk , (1) and sends the index to the decoder. The decoder is equipped with K decoding functions   Dk : 1, ..., 2nR1 × · · · × 1, ..., 2nRK → Rn , (2) where k = 1, ..., K. Upon receiving K indices, one from each terminal, it generates the estimates x̂k = Dk (E1 (x1 ), ..., EK (xK )) , k = 1, ..., K. (3) A rate-distortion vector (R1 , ..., RK ; d1 , ..., dK ) is achievable if there exist encoding functions, E1 , ..., EK , and decoding functions, D1 , ..., DK , such that n1 E kxk − x̂k k2 ≤ dk , for all k = 1, ..., K. We focus on the symmetric case where d1 = · · · = dK = d and R1 = · · · = RK = R/K where we denote the sum rate by R. The best known achievable scheme (for this symmetric setting) is that of Berger and Tung [5], for which the following (in general, suboptimal) sum rate is achievable   K X 1 1 Rk ≥ log det I + Kxx 2 d k=1 , RBT . (4) As shown in [1], RBT is a lower bound on the achievable rate of IF source coding. We will refer to RBT as the Berger-Tung benchmark. To simplify notation, we note that d can be “absorbed” into Kxx . Hence, without loss of generality, we assume throughout that d = 1. B. Compound Source Model And Scheme Outage Formulation Consider distributed lossy compression of a vector of Gaussian sources x ∼ N (0, Kxx ). (5) We define the following compound class of Gaussian sources, having the same value of RBT , via their covariance matrix:   1 K(RBT ) = Kxx ∈ RK×K : log det (I + Kxx ) = RBT . (6) 2 We quantify the measure of the set of source covariance matrices by considering outage events, i.e., those events (sources) where integer forcing fails to achieve the desired level of distortion even though the rate exceeds RBT . More broadly, for a given quantization scheme, denote the necessary rate to achieve d = 1 for a given covariance matrix Kxx as Rscheme (Kxx ). Then, given a target rate R > RBT and a covariance matrix Kxx ∈ K(RBT ), a scheme outage occurs when Rscheme (Kxx ) > R. To quantify the measure of “bad” covariance matrices, we follow [3] and apply a random orthonormal precoding matrix to the (vector of) source samples prior to encoding. As mentioned above, this amounts to joint processing of the samples and hence the problem is no longer distributed in general. Nonetheless, as in the scenario described in Section IV-A, in certain statistical settings, this precoding operation is redundant as it can be viewed as being performed by nature. Applying a precoding matrix to the source vector, we obtain a transformed source vector x̃ = Px, (7) Kx̃x̃ = PKxx PT . (8) with covariance matrix It follows that the achievable rate of a quantization scheme for the precoded source is Rscheme (Kx̃x̃ ). When P is drawn at random, the latter rate is also random. The worst-case (WC) scheme outage probability is defined in turn as WC Pout,scheme (RBT , ∆R) 2 The time axis will be suppressed in the sequel and vector notation will be reserved to describe samples taken from different sources. 3 = Pr (Rscheme (Kx̃x̃ ) > RBT + ∆R) , sup (9) Kxx ∈K(RBT ) where the probability is over the ensemble of unitary precoding matrices considered and ∆R is the gap to the Berger-Tung benchmark. In the sequel, we quantify the tradeoff between the quantization rate R (or equivalently, between the excess rate ∆R = WC R − RBT ) and the outage probability Pout,IF (RBT , ∆R) as defined in (9). C. Integer-Forcing Source Coding In a manner similar to IF equalization for channel coding, IF can be applied to the problem of distributed lossy compression. The approach is based on standard quantization followed by lattice-based binning. However, in the IF framework, the decoder first uses the bin indices for recovering linear combinations with integer coefficients of the quantized signals, and only then recovers the quantized signals themselves. For our purposes, it suffices to state only the achievable rates of IF source coding. We refer the reader to [1] for the derivation and proofs. We recall Theorem 1 from [1], stating that for any covariance matrix Kxx , IF source coding can achieve any (sum) rate satisfying R > RIF (Kxx )   K log  min , max aTk (I + Kxx ) ak  , 2 A∈ZK×K k=1,...,K (10) RIF,m (Kxx , A) , aTk (I + Kxx ) ak (11) det A6=0 where aTk is the kth row of the integer matrix A. We denote by the effective rate that can be achieved at the m’th equation. The matrix I + Kxx is symmetric and positive definite, and therefore it admits a Cholesky decomposition I + Kxx = FFT . (12)   K RIF (Kxx ) = log  min max kFT ak k2  . 2 A∈ZK×K k=1,...,K (13) With this notation, we have det A6=0 T Denote by Λ(F ) the K-dimensional lattice spanned by the matrix FT , i.e.,  Λ(FT ) , FT a : a ∈ ZK . (14) Then the problem of finding the optimal matrix A is equivalent to finding the shortest set of K linearly independent vectors in Λ(FT ). Denoting the kth successive minimum of the lattice by λk (FT ), we have  K log λ2K (FT ) . (15) RIF (Kxx ) = 2 Just as successive interference cancellation significantly improves the achievable rate of IF equalization in channel coding, an analogous scheme can be implemented in the case of IF source coding. Specifically, for a given full-rand integer matrix A, let L be defined by the Cholesky decomposition A (I + Kxx ) AT = LLT (16) and denote the mth element of the diagonal of L by ℓm,m . Then, as shown in [6] and [7], the achievable rate of successive IF source coding (which we denote as IF-SUC) for this choice of A is given by RIF−SUC (Kxx ; A) = K · max m=1,...,K RIF−SUC,m (Kxx ), (17) where RIF−SUC,m (Kxx ; A) = Finally, by optimizing over the choice of A, we obtain RIF−SUC (Kxx ) = min A∈ZK×K det A6=0  1 log ℓ2m,m . 2 RIF−SUC (Kxx ; A). (18) (19) 4 While the gap between RIF (and even more so RIF−SUC ) and RBT is quite small for most covariance matrices, it can nevertheless be arbitrarily large. We next quantify the measure of bad covariance matrices by considering randomly-precoded IF source coding. III. CRE-P RECODED IF S OURCE C ODING AND ITS E MPIRICAL P ERFORMANCE Recalling (10), and with a slight abuse of notation, the rate of IF source coding for a given precoding matrix P is denoted by RIF (Kxx , P) , RIF (PKxx PT )    K = log  min max aTk I + PKxx PT ak  . 2 A∈ZK×K k=1,...,K (20) I + Kxx = UDUT . (21) I + PKxx PT = PUDUT PT . (22) det A6=0 Since Kxx is symmetric, it allows orthonormal diagonalization When unitary precoding is applied, we have To quantify the measure of “bad” sources, we consider precoding matrices that are uniformly (Haar) distributed over the group of orthonormal matrices. Such a matrix ensemble is referred to as the circular real ensemble (CRE) and is defined by the unique distribution on orthonormal matrices that is invariant under left and right orthonornal transformations [8]. That is, given a random matrix P drawn from the CRE, for any orthonormal matrix Ù, both PÙ and ÙP are equal in distribution to P. Since PUT is equal in distribution to P for CRE precoding, for the sake of computing outage probabilities, we may simply assume that UT (and also U) is drawn from the CRE. For a specific choice of integer vector ak , we define (again, with a slight abuse of notation)  1 RIF (D, U; ak ) , log aTk UDUT ak 2   1 = log kD1/2 UT ak k2 , (23) 2 and correspondingly RIF (D, U) ,   K log  min max kD1/2 UT ak k2  . 2 A∈ZK×K k=1,...,K (24) det A6=0 1/2 Let Λ be the lattice spanned by G = D T U . Then (24) may be rewritten as  K RIF (D, U) = log λ2K (Λ) . 2 Let us denote the set of all diagonal matrices having the same value of RBT , i.e., D(RBT , K) = {D : det (D) = 22RBT }. (25) (26) We may thus rewrite the worst-case outage probability of IF source coding, defined in (9), as WC Pout,IF (RBT , ∆R) = sup Pr (RIF (D, U) > RBT + ∆R) , (27) D∈D(RBT ,K) where the probability is with respect to the random selection of U that is drawn from the CRE. To illustrate the worst-case performance of CRE-precoded IF, we present its empirical performance for the case of a twodimensional compound Gaussian source vector, where the outage probability (27) is computed via Monte-Carlo simulation. Figure 1 depicts the results for different values of RBT . Rather than plotting the worst-case outage probability, its complement is depicted, i.e., we plot the probability that the rate of IF falls below RBT + ∆R. As can be seen from the figure, the WC outage probability (as a function of ∆R) converges to a limiting curve as RBT increases. Figure 2 depicts the results for the single (high) rate RBT = 16. The required compression rate required to support a given worst-case outage probability constraint is marked, for several outage probabilities. We observe that: • For 10% worst-case outage probability, a gap of ∆R = 3.292 bits (or 1.646 bits per source) is required. 5 1 0.9 0.8 0.6 out,IF BT 1−PWC (R ,∆ C) 0.7 0.5 Empirical outage (P−IF), RBT=2 0.4 Empirical outage (P−IF), RBT=4 Empirical outage (P−IF), RBT=6 0.3 Empirical outage (P−IF), RBT=8 Empirical outage (P−IF), RBT=10 0.2 Empirical outage (P−IF), RBT=12 Empirical outage (P−IF), RBT=14 0.1 Empirical outage (P−IF), RBT=16 0 0 1 2 3 ∆R 4 5 6 Fig. 1. Empirical results for (the complement of) the worst-case outage probability of IF source coding when applied to a two-dimensional compound Gaussian source vector as a function of ∆R, for various values of RBT . • • For 5% worst-case outage probability, a gap of ∆R = 4.293 bits (or 2.1465 bits per source) is required. For 1% worst-case outage probability, a gap of ∆R = 6.665 bits (or 3.3325 bits per source) is required. IV. U PPER B OUNDS ON THE O UTAGE P ROBABILITY FOR CRE-P RECODED I NTEGER -F ORCING S OURCE C ODING In this section we develop achievability bounds for randomly-precoded IF source coding. As the derivation is very much along the lines of the results for the analogous problem in channel coding as developed in [3], we refer to results from the latter in many points. The next lemma provides an upper bound on the outage probability of precoded IF source coding as a function of RBT and the rate gap ∆R (as well as the number of sources and dmax defined below). Denote ( r ) β K A(β, δ, K) = a ∈ Z : 0 < kak < . (28) δ Lemma 1. For any K Gaussian sources such that D ∈ D(RBT , K), and for U drawn from the CRE, we have Pr (RIF (D, U) < RBT + ∆R) K−1 K−1 X Kα(K) 2 2− K (RBT +∆R) ≤ kakK−1 √ dmax a∈A(β,1/dmax ,K) 2RBT where dmax = max Di,i , the set A(β, 1/dmax , K) is defined in (28), and where α(K) is defined in (34) below. i (29) 6 1 0.99 WC 1−Pout,IF(RBT,∆ C) 0.98 0.97 0.96 0.95 0.94 0.93 0.92 0.91 0.9 0 Empirical outage (P−IF), RBT=16 2 4 6 8 ∆R 10 12 14 16 Fig. 2. Zoom in on the empirical worst-case outage probability for a two-dimensional compound Gaussian source vector with RBT = 16. Proof. Let Λ∗ denote the dual lattice of Λ and note that it is spanned by the matrix (GT )−1 = D−1/2 UT . (30) The successive minima of Λ and Λ∗ are related by (Theorem 2.4 in [9]) λ1 (Λ∗ )2 λK (Λ)2 ≤ K +3 2 γ̄K , 4 (31) where γ̄K = max{γi : 1 ≤ i ≤ K} with γK denoting Hermite’s constant. The tightest known bound for Hermite’s constant, as derived in [10], is    2/K 2 K γK ≤ Γ 2+ . π 2 (32) (33) Since this is an increasing function of K, it follows that γ̄K is smaller than the r.h.s. of (33). Combining the latter with the exact values of the Hermite constant for dimensions for which it is known, we define ( K+3 2 K = 1 − 8, 24 4 γK , α(K) = K+3 . (34)  2 K 2/K Γ 2 + , otherwise 4 π 2 Therefore, we may bound the achievable rates of IF via the dual lattice as follows   1 K . log α(K) RIF (D, U) ≤ 2 λ1 (Λ∗ )2 (35) 7 Hence, we have Pr (RIF (D, U) > RBT + ∆R)     K 1 ≤ Pr > RBT + ∆R log α(K) 2 λ1 (Λ∗ )2   2 = Pr λ1 (Λ∗ )2 < α(K)2− K (RBT +∆R) . Denote (36) 2 β = α(K)2− K (RBT +∆R) . (37) We wish to bound (36), or equivalently, we wish to bound  p   Pr λ21 (Λ∗ ) < β = Pr λ1 (Λ∗ ) < β √ for a given matrix D ∈ D(RBT , K). Note that the event λ1 (Λ∗ ) < β is equivalent to the event [ p ||D−1/2 UT a|| < β. (38) (39) a∈ZK \{0} Applying the union bound yields  p  Pr λ1 (Λ∗ ) < β ≤ Note that whenever ||a|| √ dmax ≥ √ β, we have X a∈ZK \{0}  p  Pr ||D−1/2 UT a|| < β .  p  Pr ||D−1/2 UT a|| < β = 0. (40) (41) Therefore, substituting 1/dmax in (28), the set of relevant vectors a is n o p A(β, 1/dmax , K) = a ∈ ZK : 0 < ||a|| < βdmax . (42) It follows from (40) and (41) that  p  Pr λ1 (Λ∗ ) < β ≤ X a∈A(β,1/dmax ,K)  p  Pr kD−1/2 UT ak < β . (43) The rest of the proof follows the footsteps of Lemma 2 in [3] and is given in Appendix A. While Lemma 1 provides an explicit bound on the outage probability, in order to calculate it, one needs to go over all diagonal matrices in D(RBT , K) and for each such diagonal matrix, sum over all the relevant integer vectors in A(β, 1/dmax , K). Hence, the bound can be evaluated only for moderate compression rates and for a small number of sources. The following theorem, that may be viewed as the counterpart of Theorem 1 in [3], provides a looser, yet very simple closed-form bound. Another advantage for this bound is that it does not depend on the Berger-Tung achievable rate. Theorem 1. For any K sources such that D ∈ D(RBT , K), and for U drawn from the CRE we have Pr (RIF (D, U) > C + ∆R) ≤ c(K)2−∆R , (44) π K/2 , Γ(K/2 + 1) (45) where K c(K) = Kα(K) 2 (K + cmax ) α(K) = 2/K  K+3 2 K Γ 2+ 4 π 2 (46) and cmax   √ K   2+ K − 1− 2 =  K √   1+ K √ K 2 K 1≤K<4 K≥4 Note that c(K) is a constant that depends only on the number of sources K. Proof. See Appendix B. . (47) 8 Similarly to the case of IF channel coding (cf., Section IV-C in [3]), analyzing Theorem 1 reveals that there are two main sources for looseness that may be further tightened: • Union bound - While there is an inherent loss in the union bound, in fact, some terms in the summation (43) may be completely dropped.3 Specifically, using Corollary 1 in [3], the set A(β, 1/dmax , K) appearing in the summation in (1) may be replaced by the smaller set B(β, 1/dmax , K) where B(β, d, K) = ( a∈Z • K : 0 < kak < r β and ∄0 < c < 1 s.t. ca ∈ ZK d ) . (48) Dual Lattice - Bounding via the dual lattice induces a loss reflected in (31). This may be circumvented for the case of a two-dimensional source vector by using IF-SUC, as accomplished in Lemma 2 and Theorem 2 which we present next. Lemma 2. For a two-dimensional Gaussian source vector such that D ∈ D(RBT , K), and for U drawn from the CRE, we have Pr (RIF−SUC (D, U) > RBT + ∆R) √ X 2 β ≤ kak2RBT √d1 a∈B(β,dmin ,K) (49) min where dmin = min Di,i and A(β, dmin , K) is defined in (28), i Theorem 2. For a two-dimensional Gaussian source vector such that D ∈ D(RBT , K), and for U drawn from the CRE, we have Pr (RIF−SUC (D, U) > C + ∆R) ≤ c′ (K)2−∆R , (50)  √  c′ (K) = 2π 5 + 3 2 . (51) where Proof. See Appendix C. Figure 3 depicts the bounds derived as well as results of a Monte Carlo evaluation of (9) for the case of a two-dimensional Gaussian and CRE precoding.4 When calculating the empirical curves and the lemmas, we assumed high quantization rates (RBT = 14). The lemmas were calculated by going over a grid of values of d1 and d2 satisfying d1 d2 = 22·14 . A. Application: Distributed Compression for Cloud Radio Access Networks Since we described IF source coding as well as the precoding over the reals, we outline the application of IF source coding for the cloud radio access network (C-RAN) scenario assuming a real channel model. We then comment on the adaptation of the scheme to the more realistic scenario of a complex channel. Consider the C-RAN scenario depicted in Figure 4 where M transmitters send their data (that is modeled as an i.i.d. Gaussian source vector) over a K × M MIMO broadcast channel H ∈ RK×M . The data is received at K receivers (relays) that wish to compress and forward it for processing (decoding) at a central node via rate-constrained noiseless bit pipes. As we wish to minimize the distortion at the central node subject to the rate constraints, this is a distributed lossy source coding problem. See depiction in Figure 4. Here, the covariance matrix of the received signals at the relays is given by Kxx = SNRHHT + I. (52) We note that we can “absorb” the SNR into the channel and hence we set SNR = 1, so that Kxx = HHT + I. (53) We further assume that the entries of the channel matrix H are Gaussian i.i.d., i.e. ∀i,j Hi,j ∼ N (0, σ 2 ). As mentioned in the introduction, the SVD of this matrix H = ŨΣ̃ṼT (54) 3 Similar to the derivation in Section IV-C in [3], a simple factor of 2 can be deduced (regardless of the rate and number of sources) by noting that a and −a result in the same outcome and hence there is no need to account for both cases. 4 The bounds are computed after applying a factor of 2 to the lemmas in accordance to footnote 3. Again, rather than plotting the worst-case outage probability, we plot its complement. 9 1 0.9 out,IF BT 1−PWC (R ,∆ C) 0.8 0.7 0.6 0.5 Empirical outage of P−IF Empirical outage of P−IF−SIC Thm 1 (P−IF), K=2 Lemma 1 (P−IF), K=2 Thm 2 (P−IF−SIC), K=2 Lemma 2 (P−IF−SIC), K=2 Thm 1 (P−IF), K=3 Thm 1 (P−IF), K=4 0.4 0.3 0.2 0.1 0 0 5 10 15 ∆R 20 25 30 Fig. 3. Upper bounds on the outage probability of IF source coding for various values of source dimension K. BS/Relay Optical Distribution Network Managing Control Unit BS/Relay Fig. 4. Cloud radio access network communication scenario. Two relays compress and forward the correlated signals they receive from several users. 10 satisfies that Ũ and Ṽ belong to the CRE. We may therefore express the (random) covariance matrix as Kxx = Ũ(Σ̃ + I)(Σ̃ + I)T ŨT , (55) where Ũ is drawn from the CRE. It follows that the precoding matrix P is redundant (as we assumed that P is also drawn from the CRE). Thus, the analysis above holds also for the considered scenario. Specifically, assuming the encoders are subject to an equal rate constraint, then for a given distortion level, the relation between the compression rate of IF source coding and the guaranteed outage probability (for meeting the prescribed distortion) is bounded using Theorem 1 above. We note that just as precoded IF channel coding can be applied to complex channels as described in [3], so can precoded IF source coding be extended to complex Gaussian sources. In describing an outage event in this case we assume that the precoding matrix is drawn from the circular unitary ensemble (CUE). The bounds derived above (replacing K with 2K in all derivations) for the relation between the compression rate of IF source coding and the worst-case outage probability hold for the C-RAN scenario over complex Gaussian channels H ∈ CK×M , where the CUE precoding can be viewed as been performed by nature. V. P ERFORMANCE G UARANTEES FOR I NTEGER -F ORCING S OURCE C ODING WITH D ETERMINISTIC P RECODING In this section, we consider the performance of IF source coding when used in conjunction with judiciously chosen (deterministic) precoding. Worst-case performance will be measured in a stricter sense than in previous sections; namely, no outage is allowed. Achieving the goal of no outage for the case of general Gaussian sources requires performing space-time precoding, whereas for the case of parallel (independent) sources, space-only precoding still suffices. We note that while doing away with outage events is desirable, it does come at a price. Namely, the precoding assumed in this section requires joint processing of the different sources prior to quantization and is thus precluded in a distributed setting. On the other hand, the precoded IF scheme considered in this section has several advantages with respect to traditional source coding of correlated sources. Namely, the traditional approach requires utilizing the a statistical characterization of the source at the encoder side, e.g., via a prediction filter or via applying a transformation (such as DCT or DFT) along with bit loading. In contrast, IF as considered in this section is applied after applying a universal transformation, i.e., a transformation that is independent of the source statistics. In addition, all samples are quantized at the same bit rate. Knowledge of the statistics of the source needs of course be utilized, but only at the decoder side, a propertry that may be advatageous in certain applications. This is similar to the case of Wyner-Ziv compression but whereas the latter requires in general the use of bit allocation (unless the source is stationary), IF source coding does not. A. Additive Bound for General Sources Similar to the case of channel coding, we can derive a worst-case additive bound for the gap to the Berger-Tung benchmark. Achieving this guaranteed performance requires joint algebraic number theoretic based space-time precoding at the encoders. The following theorem is due to Or Ordentlich [11]. Theorem 3 (Ordentlich). For any K sources with covariance matrix Kxx and Berger-Tung benchmark RBT , the excess rate with respect to the Berger-Tung benchmark (normalized per the number of time-extensions used) of space-time IF source coding with an NVD precoding matrix with minimum determinant δmin is bounded by RIF − RBT ≤ 2K 3 log(2K 2 ) + K 2 log 1 . δmin (56) Proof. See Appendix D. We note that similarly to the case of IF for channel coding, the gap to the Berger-Tung benchmark is large and thus it has limited applicability. B. Uncorrelated Sources For the special case of uncorrelated Gaussian sources, much tighter bounds (in comparison to Theorem 3) on the worst-case quantization rate of IF for a given distortion level may be obtained. First, space-time precoding may be replaced with precoding over space only. This allows to obtain a tighter counterpart to Theorem 3, as derived in Section 2.4.2 of [6]. We next derive yet tighter performance guarantees, also following ideas developed in [6], by numerically evaluating the performance of IF source coding over a “densely” quantized set of source (diagonal) covariance matrices belonging to the compound class, and then bounding the excess rate w.r.t. to the evaluated ones for any possible source vector in the compound class. 11 In the case of uncorrelated sources, the covariance matrix Kxx is diagonal. Hence, (55) becomes Kxx = Σ̃Σ̃T , S, (57) where  2 s1 0  S=.  .. 0 s22 0 0 0 ··· ··· .. . 0 0 .. . ··· s2K    .  (58) We denote s = diag(S). The compound set of channels may be parameterized by ( ) K X  1 S(RBT ) = S : log 1 + s2i = RBT . 2 i=1 We note that we may associate with each diagonal element a “rate” corresponding to an individual source  1 Ri = log 1 + s2i . 2 Thus, the compound class of sources may equivalently be represented by the set of rates ) ( K X Ri = RBT . R(RBT ) = (R1 , R2 , . . . , RK ) ∈ RK : (59) (60) (61) i=1 We define a “quantized” rate-tuple set as follows. The interval [0, RBT ] is divided into N sub-intervals, each of length ∆ = RBT /N . Thus, the resolution is determined by the parameter ∆. The quantized rate-tuples belong to the grid n  K ∆ R∆ (RBT ) = R1∆ , R2∆ , . . . , RK ∈ ∆ · RBT · Z+ : K X i=1 o Ri∆ = RBT . (62) We may similarly define the (non-uniformly) quantized set S ∆ (RBT ) of diagonal matrices such that the diagonal entries satisfy ∆ s2i,∆ = 22Ri − 1, i = 1, . . . , K, where R∆ ∈ R∆ (RBT ). Theorem 4. For any Gaussian vector of independent sources with covariance matrix S such that S ∈ S(RBT ), the rate of IF source coding with a given precoding matrix P is upper bound by  (63) RIF (S, P) ≤ max RIF S∆ , P + K log η S∆ ∈S ∆ (RBT ) where 2 η= 2   RBT 2 K −1   RBT 2 K −(K−1)∆RBT . (64) −1 Proof. Assume we have a covariance matrix S in the compound class. Hence, its associated rate-tuple satisfies (R1 , R2 , . . . , RK ) ∈ R(RBT ). Assume without loss of generality that R1 ≤ R2 ≤ . . . ≤ RK . By (23), the rate of IF source coding associated with a specific integer linear combination vector a is  1 RIF (S, P; a) = log aT P (I + S) PT a . 2 Denote v = aT P. (65) (66) (67) We will need the following two lemmas, whose proofs appear in Appendices E and F, respectively. Lemma 3. For any diagonal covariance matrix S, associated with a rate-tuple (R1 , R2 , . . . , RK ) ∈ R(RBT ), there exists a 12 ∆ ) ∈ R∆ (RBT ), such that diagonal covariance matrix S∆ , associated with a rate-tuple (R1∆ , R2∆ , . . . , RK si ≤ η 2 s2i,∆ (68) for 1 ≤ i ≤ K, where η is defined in (64). Lemma 4. Consider a Gaussian vector with a diagonal covariance matrix S and let a be an integer vector. Then for any β ≥ 1, we have RIF (β 2 S, P; a) ≤ log (β) + RIF (S, P; a). (69) Using Lemma 3, and denoting by S∆ the covariance matrix associated with S, and whose existence is guaranteed by the lemma, it follows from (66) that ! K X 1 2 ∆ 2 2 2 RIF (η S , P; a) = log vi (1 + η si,∆ ) 2 i=1 ! K X 1 2 2 vi (1 + si ) ≥ log 2 i=1 = RIF (S, P; a). (70) Using Lemma 4, we further have that RIF (η 2 S∆ , P; a) ≤ 1 log(η) + RIF (S∆ , P; a). 2 (71) Combining (70) and (71), we obtain RIF (S, P; a) ≤ RIF (η 2 S∆ , P; a) ≤ log(η) + RIF (S∆ , P; a). (72) Recalling (20), we have RIF (S∆ , P) = ∆   K log  min max RIF (S∆ , P; ak ) . 2 A∈ZK×K k=1,...,K det A6=0 (73) Denoting A as the optimal integer matrix for the quantized channel S∆ (which is not necessarily the optimal matrix for S), it follows that RIF (S, P) ≤ RIF (S, P; A∆ ). (74) Now assuming aTk are the rows of A∆ , by (72) we have RIF (S, P; A∆ ) = K max RIF (S, P; ak ) k=1,...,K ≤ K max k=1,...,K  log(η 2 ) + RIF (S∆ , P; ak ) = K log(η) + RIF (S∆ , P; A∆ ). (75) RIF (S, P) ≤ RIF (S∆ , P) + K log(η) (76) Thus, we conclude that and therefore, for any S ∈ S(RBT ), we have RIF (S, P) ≤ max RIF (S∆ , P) + K log(η). S∆ ∈S∆ (77) This concludes the proof of the theorem. As an example for the achievable performance, show Fig. 5 gives the empirical worst-case performance for two and three (real) sources that is achieved when using IF source coding and a fixed precoding matrix over the grid R∆ (RBT ) for ∆ = 0.01. The precoding matrix was taken from [12]. The explicit precoding matrix used for two sources is P = cyclo2 where   −0.5257311121 −0.8506508083 cyclo2 = , (78) −0.8506508083 0.5257311121 13 and for three sources P = cyclo3 where   −0.3279852776 −0.5910090485 −0.7369762291 cyclo3 = −0.7369762291 −0.3279852776 0.5910090485  . −0.5910090485 0.7369762291 −0.3279852776 (79) RIF Rather than plotting the gap from the Berger-Tung benchmark, we plot the efficiency η = R , i.e., the ratio of the BT (worst-case) rate of IF source coding and RBT . We also plot the upper bound on RIF (S, P) given by Theorem 4. 3 Cyclo precoding + IF 2 2.8 Bound on the performance Cyclo precoding + IF 2.6 3 Bound on the performance 2.4 η 2.2 2 1.8 1.6 1.4 1.2 1 1 2 3 4 5 6 7 8 9 10 RBT Fig. 5. Empirical and guaranteed (upper bound) worst-case efficiency of IF source coding for two and three uncorrelated Gaussian sources, when using the precoding matrices cyclo2 and cyclo3 given in (78)-(79), respectively, and taking ∆ = 0.01 for the calculation of Theorem 4. A PPENDIX A P ROOF OF T HEOREM 1 Following the footsteps √ of Lemma 2 in [3] and adopting the same geometric interpretation described there, √ we may interpret Pr kD−1/2 UT ak < β as the ratio of the surface area of an ellipsoid that is inside a ball with radius β and the surface kak . area of the entire ellipsoid. The axes of this ellipsoid are defined by xi = √ di Denote the vector okak as a vector drawn from the CRE with norm kak. Using Lemma 1 in [3] and since we assume that UT is drawn from the CRE, we have that the right hand side of (43) is equal to  X p  Pr kD−1/2 okak < β a∈A(β,1/dmax,K) = X a∈A(β,1/dmax ,K) CAPell (x1 , · · · , xK ) L(x1 , · · · , xK ) (80) where CAPell (x1 , · · · , xK ) < K p K−1 π K/2 β , CAPell , Γ(1 + K/2) (81) 14 and K √ kakK X di π K/2 L(x1 , · · · , xK ) > √ Q Γ(1 + K/2) K kak i=1 di i=1 √ K/2 K−1 π kak dmax > , L. Γ(1 + K/2) 2RBT (82) (83) Substituting (81) and (83) in (80), we obtain X a∈A(β,1/dmax ,K) CAPell (x1 , · · · , xK ) L(x1 , · · · , xK ) CAPell L a∈A(β,1/dmax ,K) √ K−1 X K β = . kakK−1 √ d R max a∈A(β,1/dmax ,K) 2 BT < X (84) 2 Recalling (see (37)) that β = α(K)2− K (RBT +∆R) , we obtain Pr (RIF−SUC (D, U) > C + ∆R) K−1 K−1 X Kα(K) 2 2− K (RBT +∆R) < . kakK−1 √ dmax a∈A(β,1/dmax ,K) 2RBT (85) A PPENDIX B P ROOF OF T HEOREM 1 To establish Theorem 1, we follow the footsteps of the proof of Theorem 1 in [3] to obtain  X p  Pr kD−1/2 UT ak < β a∈A(β,1/dmax ,K) ≤ X a∈A(β,1/dmax ,K) √ K−1 K β kakK−1 √ dmax 2RBT (86) where A(β, 1/dmax , K) and β are defined in (28) and (37), respectively. Noting that n jp k o A(β, 1/dmax , K) ⊆ a : kak ≤ βdmax + 1 , the summation in (86) can be bounded as ≤ √ ⌊ βdmax ⌋ X k=0 X k<kak≤k+1 √ K−1 K β √ kK−1 dmax 2RBT (87) We apply Lemma 1 in [13] (a bound for the number of integer vectors contained in a ball of a given radius). Using this bound while noting that when kak = 1 there are exactly K integer vectors, the right hand side of (87) may be further bounded as  √ √ K−1 RBT ⌊ βdmax ⌋ X K β 2 √ ≤ Vol(BK (1)) × K + dmax k=1  K    √ K √ K K k+1+ 2 − max k − 2 , 0  (88)  k K−1 where we note that (88) trivially holds when the left hand side of (80) evaluates to zero.  √ βdmax = 0 since A(β, 1/dmax , K) is the empty set in this case and hence 15 The right hand side of (88) can further be rewritten as  j√ k K  √ K−1 RBT 2 X  K β 2 √ Vol(BK (1)) ×  K + |{z} dmax  I k=1 |  √ βd ⌊ X max ⌋ k+1+ k= j√ K 2 k √ K K 2  − k− k K−1  √ K K 2 k+1+  +1 {z | } III We search for c1 and c2 (independent of k) such that  √ K 2 k K−1 {z II    .    √ !K K k+1+ ≤ c1 k K−1 2 for 1 ≤ k ≤ j√ k K 2 K + } (89) (90) , and √ !K  k+1+ K − 2 for k ≥ 1, since it will then follow that (91) √ II + III ≤ = We note that since (again assuming √ !K  K  ≤ c2 k K−1 k− 2  √  βdmax ≥ 1) ⌊ βd max ⌋ X max(c1 , c2 ) k=1 k jp βdmax max(c1 , c2 ). (92) √ K≤ it will thus follow that ⌊ βd max ⌋ X K, (93) k=1 √ I + II + III ≤ = ⌊ βd max ⌋ X [K + max(c1 , c2 )] k=1 jp k βdmax [K + max(c1 , c2 )] . (94) An explicit derivation for c1 and c2 appears in Appendix B of [3] (where 2Nt should be replaced with K), from which we obtain  √ K c1 = 1 + K  √ !K √ !K  K K . c2 =  2 + − 1− (95) 2 2 In is also shown in Appendix √B of [3] that for K ≥ 4, c2 ≤ c1 holds. For 1 ≤ K < 4 we observe that c1 ≤ c2 . This is so since K < 4 implies that 1 − 2K > 0, and hence indeed for K < 4 we have  √ !K √ !K  K K  c2 =  2 + − 1− 2 2 √ !K √ !K √ K K = 1+ K +1− − 1− 2 2 16 ≥ (1 + √ K)K = c1 . (96) Recalling now (94) and denoting cmax = ( c2 c1 1≤K <4 K≥4 , (97) it follows that I + II + III ≤ k jp βdmax (K + cmax ). (98) K/2 π Using (98) and substituting the volume of a unit ball Vol(BK (1)) = Γ(K/2+1) , it follows that right hand side of (88) is upper bounded by √ K−1 RBT p 2 K β π K/2 √ βdmax (K + cmax ) (99) Γ(K/2 + 1) dmax p K π K/2 . (100) = K β 2RBT (K + cmax ) Γ(K/2 + 1) Finally, we substitute β, as defined in (37), into (100) to obtain  X p  Pr kD−1/2 UT ak < β a∈A(β,1/dmax ,K) K/2  2 ≤ K α(K)2− K (RBT +∆R) 2RBT (K + cmax ) K/2 2−(RBT +∆R) 2RBT (K + cmax ) K/2 (K + cmax )2−∆R ≤ K (α(K)) ≤ K (α(K)) = c(K)2−∆R , (101) where c(K) is as defined in (47). A PPENDIX C P ROOF OF T HEOREM 2 We first recall a theorem of Minkowski [14, Theorem 1.5] that upper bounds the product of the successive minima. Theorem 5 (Minkowski). For any lattice Λ(FT ) that is spanned by a full rank K × K matrix FT K Y m=1 λ2m (FT ) ≤ K K (det FT )2 . (102) To prove Theorem 2, we further need the following two lemmas. Lemma 5. For a Gaussian source vector with covariance matrix Kxx ∈ K(RBT ), and for any full-rank integer matrix A, the sum-rate of IF-SUC satisfies K X m=1 RIF−SUC,m (Kxx ; A) = RBT + log | det(A)|, where RIF−SUC,m (Kxx ; A) is defined in (18). Proof. K X m=1 RIF−SUC,m (Kxx ; A) = K 1 X log(ℓ2m,m ) 2 m=1 1 = log 2 K Y ℓ2m,m m=1 1 = log det(LLT ) 2 ! (103) 17     1 1 log det A I + Kxx AT 2 d = RBT + log | det(A)| = (104) Theorem 3 in [15] shows that for successive IF (used for channel coding) there is no loss (in terms of achievable rate) in restricting A to the class of unimodular matrices. We note that same claim holds also in our framework (that of successive integer-source source coding) by replacing G, the matrix spanning the lattice which was defined in Theorem 3 as −1 I + SNRHHT = GGT (105) with F, as defined in (12), and noting that the optimal A can be expressed (in both cases) as Aopt SIC/SUC = min max ℓ2k,k , A∈ZK×K k=1,...,K det A6=0 (106) where ℓk,k are the diagonal elements of the corresponding L matrix (derived from the Cholesky decomposition) in each case. PK Having established that the optimal A is unimodular, it now follows that m=1 RIF−SUC,m (Kxx ; Aopt SUC ) = RBT . We are now ready to prove the following lemma that is analogous to Theorem 3 in [16]. Lemma 6. For a Gaussian source vector with covariance matrix Kxx ∈ K(RBT ), and for the optimal integer matrix A, the sum-rate of IF is upper bounded as K X m=1 RIF,m (Kxx ) ≤ RBT + K log(K). 2 (107) where Rm,IF (Kxx ) is the rate of the mth equation (corresponding to the mth row of A) as defined in (11). Proof. K X K X  1 log λ2m (FT ) 2 m=1 m=1 ! K Y 1 2 T = log λm (F ) 2 m=1  1 ≤ log K K | det(F )|2 2 K = RBT + log (K) . 2 where the inequality is due to Theorem 5 (Minkowski’s Theorem). RIF,m (Kxx ) = (108) Now, for the case of two sources we have by Lemma 5 RIF−SUC,1 (Kxx ) + RIF−SUC,2 (Kxx ) = RBT , (109) RIF−SUC,2 (Kxx ) = RBT − RIF−SUC,1 (Kxx ). (110) RIF,1 (Kxx ) + RIF,2 (Kxx ) ≤ RBT + 1. (111) or equivalently We further have by lemma 6 that We note that the (optimal) integer matrix A used for IF in (111) is in general different than the (optimal) matrix A used for IF-SUC in (109)-(110). Nonetheless, when applying IF-SUC, one decodes first the equation with the lowest rate. Since for this equation SUC has no effect, it follows that the first row of A is the same in both cases and hence RIF−SUC,1 (Kxx ) = RIF,1 (Kxx ). (112) Since source 1 is decoded first, it follows that RIF,1 > RIF,2 and hence RIF,1 (Kxx ) ≤ RBT + 1 . 2 (113) 18 Therefore, RIF−SUC (Kxx ) = 2 max (RIF−SUC,1 (Kxx ), RIF−SUC,2 (Kxx )) RBT + 1 ≤ 2 max( , RBT − RIF,1 (Kxx )) 2 = max(RBT + 1, 2RBT − 2RIF,1 (Kxx )). (114) Henceforth, we analyze the outage for RBT > 1 and target rates that are no smaller than RBT + 1, so that the inequality 2RBT − 2RIF,1 (Kxx ) > RBT + 1 is satisfied. Thus, we consider excess rate values satisfying ∆R > 1. Our goal is to bound Pr (RIF−SUC (Kxx ) ≥ RBT + ∆R) = Pr (2RBT − 2RIF,1 (Kxx ) ≥ RBT + ∆R)   RBT − ∆R = Pr RIF,1 (Kxx ) ≤ 2   R 1 BT − ∆R 2 T log(λ1 (F )) ≤ = Pr 2 2  = Pr λ21 (FT ) ≤ 2RBT −∆R (115) Let β = 2RBT −∆R . We wish to bound (115), or equivalently  p   Pr λ21 (FT ) ≤ β = Pr λ1 (FT ) ≤ β for a given matrix D corresponding to Kxx (116) √ (via the relation (21)). Note that the event λ1 (Λ) < β is equivalent to the event [ p ||D1/2 UT a|| < β. (117) a∈ZK \{0} Applying the union bound yields  p  Pr λ1 (Λ) < β ≤ X a∈ZK \{0}  p  Pr ||D1/2 UT a|| < β . (118) Using the same derivation as in Lemma 2 in [3], we get Pr (RIF−SUC (D, U) ≥ RBT + ∆R) √ K−1 X K β ≤ . kakK−1 2RBT √d1 a∈A(β,dmin,K) (119) min Since we are analyzing the case of two sources, we have Pr (RIF−SUC (D, U) ≥ RBT + ∆R) √ X 2 β . ≤ kak2RBT √d1 a∈A(β,dmin ,K) (120) min Applying a similar argument as appears in Appendix B (as part of the proof of Theorem 1), and noting that K < 4 implies that cmax = c2 , we get Pr (RIF−SUC (D, U) ≥ RBT + ∆R)) √  2β  ≤ RBT 2 + 3 + 3 2 π. 2 Finally, substituting β as defined in (37), we obtain Pr (RIF−SUC (D, U) ≥ RBT + ∆R) √  2π · 2RBT −∆R  2 2 + 3 + 3 ≤ RBT 2 √  −∆R = 2π 5 + 3 2 2 . (121) (122) A PPENDIX D A DDITIVE (W ORST-C ASE ) B OUND FOR NVD S PACE -T IME P RECODED S OURCES Combining space-time precoding and integer forcing in the context of channel coding was suggested in [17], as we next briefly recall. We then present the necessary modifications for the case of source coding. 19 We derive below an additive bound using a unitary precoding matrix satisfying a non-vanishing determinant (NVD) property. As the theory of NVD space-time codes has been developed over the complex field, it will prove convenient for us to employ complex precoding matrices. To this end, we may assume that we stack samples from two time slots where the samples stacked at the first time slot represent the real part of a complex number and the samples stacked at the second time slot represent the imaginary part of a complex number. Hence, we have Kx̂x̂ = I2×2 ⊗ Kxx , (123) where ⊗ is the Kronecker product. We note that the Berger-Tung benchmark of this stacked source vector is RBT (Kx̂x̂ ) = 2RBT (Kxx ). (124) Next, in order to allow space-time precoding, we stack T times the K “complex” outputs of the K sources and let x̄c ∈ R2KT ×1 denote the effective source vector. Its corrlation matrix, which we refer to as the effective covariance matrix, takes the form K = IT ×T ⊗ Kx̂x̂ . (125) We assume a precoding matrix, that in principle can be either deterministic or random, is applied to the effective source vector. We analyze performance for the case where the precoding matrix Pst,c is deterministic, specifically a precoding matrix induced by a perefect space-time block code, operating on the stacked source x̄c having covariance matrix as given in (125). An explanation on how to extract the precoding matrix from a space-time code can be found in Section IV in [18]. We denote the corresponding precoding matrix over the reals as Pst ∈ R2KT ×2KT . We denote T I + Pst KPH st = F F . (126) As we assume that the precoding matrix is unitary, the Berger-Tung benchmark (normalized by the total number of time extensions used) remains unchanged, i.e., 2  1 1 1 1 log det I + Pst KPH log det F T st = 2T 2 2T 2 = RBT . (127) As noted above, we assume that the generating matrix of a perfect code [19], [20] is employed as a precoding matrix. A space-time code is called perfect if: • It is full rate; • It satisfies the non-vanishing determinant (NVD) condition; • The code’s generating matrix is unitary. Let δmin denote the minimal non-vanishing determinant of this code. Such codes further use the minimal number of time extensions possible, i.e., T = K. Thus, we have a total of K 2 stacked complex samples. Subsisting 2K 2 as the dimension (number of real samples jointly processsed) in (15), the rate of IF source coding for the time-stacked samples is given by  1 RIF (K, Pst ) = (2K 2 ) log λ22K 2 (F T ) . (128) 2 To bound λ22K 2 (F T ), we note that for every 2K 2 -dimensional lattice, we have 2(2K 2 −1) λ1 (F T )λ22K 2 (F T ) ≤ 2 2K Y λ2m (F T ). (129) m=1 Using Minkowski’s theorem (Theorem 5 in Appendix C), it follows that 1 2 λ22K 2 (F T ) ≤ (2K 2 )2K (det F T )2 2(2K 2 −1) λ1 (F T ) . Hence, the rate of IF source coding (normalized by the number of time extensions) can be bounded as: 1 RIF (K, Pst ) 2K   1 1 (2K 2 ) log λ22K 2 (F T ) = 2K 2 ! 1 K 2 2K 2 T 2 log (2K ) (det F ) 2(2K 2 −1) ≤ 2 (F T ) λ 1 K(2K 2 − 1) K log(det(F T )2 ) − log(λ21 (F T )) = K 3 log(2K 2 ) + 2 2 (130) 20 = K 3 log(2K 2 ) + 2K 2 RBT − K(2K 2 − 1) log(λ21 (F T )). 2 (131) We next use the results derived in [18] for channel coding (using NVD precoding). We note that since the covariance matrix is positive semi-definite, it may be written as Kxx = HHT . (132) The covariance matrix of the stacked source vector may be written as Kx̂x̂ = ĤĤT , (133) where we may take Ĥ = I2×2 ⊗ H. There are many such choices of H and any such choice corresponds to a channel matrix Ĥ that can be viewed as the real representation of a complex channel matrix (which in the present case is real, i.e., has no imaginary part) in the context of [18]. The effective covariance matrix can similarly be rewritten as K = HHT , (134) where H = IT ×T ⊗ Ĥ. Using the channel coding terminology of [18], we further define the minimum distance at the receiver dmin (H, L) as dmin (H, L) , min a∈QAMK (L)\0 kHak, (135) where QAM(L) ,{−L, −L + 1, . . . , L − 1, L} + i{−L, −L + 1, . . . , L − 1, L}. (136) Setting SNR = 1 and for Ĥ ∈ R2K×2K (which is the real representation of Hc ∈ CK×K ), Lemma 2 in [18] states that  1 H min aT I + PH st H HPst a 4K 4 a∈Z2K \0  1 ≥ min L2 + SNRdmin (HPst , L) . (137) 4 4K L=1,2,··· Using Corollary 1 in [18], we get 1 4K 4  HH HPst a min aT I + PH st a∈Z2K \0  i+  h 1 CWI 1 2 2 2 K K ≥ 2 − 2K L L + δ min min 4K 4 L=1,2,···  #+  " 1 CWI K K 1 δ 2 ≥ min L2 + min 2 − L2  4K 4 L=1,2,··· 2K ≥ 1 K1 CWI δ 2 K , 8K 6 min (138)  where CWI = 12 log det I + HH H is the mutual information of H. Since CWI is the rate of a 2K × 2K real matrix (resulting from a K × K complex matrix), it equals RBT (Kx̂x̂ ) defined in (124). Hence, we obtain  1 K1 2RKBT (139) a≥ min aT I + PH HH HPH δ 2 st st 2K 2 min a∈Z2K \0 which in turn yields λ21 (F T ) =  min aT I + Pst HHT PTst a a∈Z2K \0 1 K1 2RBT δ 2 K . 2K 2 min Finally, plugging the bound (140) into (131), we arrive at ≥ 1 RIF (K, Pst ) 2K ≤ 2K 2 RBT + K 3 log(2K 2 ) + K(2K 2 − 1) log(2K 2 ) 2 (140) 21 K(2K 2 − 1) 1 K(2K 2 − 1) )− log( 2RBT 2K δmin 2K 1 ≤ RBT + 2K 3 log(2K 2 ) + K 2 log . δmin + (141) A PPENDIX E P ROOF OF L EMMA 3 A Gaussian source component with a specific rate Ri can be transformed to a different Gaussian source with rate Ri∆ by appropriate scaling. Specifically, scaling each source component i by s ∆ 22Ri − 1 (142) αi = 22Ri − 1 results in parallel (uncorrelated) sources x̂i = αi xi (143) ŝ2i = α2i s2i . (144) with variances By (60), we therefore have  1 log 1 + ŝ2i 2  1 = log 1 + α2i s2i 2 ! ∆ 22Ri − 1 2 1 s = log 1 + 2Ri −1 i 2 2 R̂i = ! ∆ 22Ri − 1 2Ri 1 − 1) (2 = log 1 + 2Ri −1 2 2   ∆ 1 = log 1 + 22Ri − 1 2 = Ri∆ . (145) ∆ We associate with any rate tuple (R1 , R2 , . . . , RM ) ∈ R(RBT ) a rate tuple (R1∆ , R2∆ , . . . , RM ) ∈ R∆ (RBT ), according to the following transformation   Ri ∆ · ∆RBT , i = 1, 2, . . . , K − 1, Ri = ∆RBT K−1 X ∆ (Ri∆ − Ri ). (146) RK = RK − i=1 For i = K we have ∆ RK ≥ RK − (K − 1)∆RBT . (147) ∆ It follows that the scaling factor needed to achieve RK is bounded by ∆ α2K 22RK − 1 = 2RK −1 2 22(RK −(K−1)∆RBT ) − 1 ≥ 22RK − 1   ≥ 2 2 RBT K 2 −(K−1)∆RBT   RBT 2 K where (148) follows since it is readily verified that the function Denoting η = α1k , it follows from (148) that 2 η= 2 ax−1 x−1   RBT 2 K −1 . (148) −1 is monotonically increasing in x, for x ≥ 1 and 0 ≤ a ≤ 1. −1   RBT 2 K −(K−1)∆RBT . −1 (149) 22 Now for 1 ≤ i ≤ K − 1 we have by (146) that Ri∆ ≥ Ri . Hence, for such i it trivially holds that (since η ≥ 1) s2i ≤ s2i,∆ ≤ η 2 s2i,∆ . (150) (151) Thus, the lemma follows by observing that from (148) it follows that s2K ≤ η 2 s2K,∆ as well. A PPENDIX F P ROOF OF L EMMA 4 Recalling (67), we note that (66) can be written as ! K X 1 RIF (S, P; a) = log vi2 (1 + s2i ) . 2 i=1 (152) Therefore, when scaling the Gaussian input vector by a factor of β ≥ 1, we have ! K X 1 2 2 2 RIF (β S, P; a) = log vi (1 + β si ) 2 i=1 ! K X 1 vi2 (1 + s2i ) ≤ log β 2 2 i=1  1 = log β 2 + RIF (S, P; a) 2 = log (β) + RIF (S, P; a). 2 (153) R EFERENCES [1] O. Ordentlich and U. Erez, “Integer-forcing source coding,” IEEE Transactions on Information Theory, vol. 63, no. 2, pp. 1253–1269, 2017. [2] L. G. Ordóñez, I. E. Aguerri, and M. Guillaud, “Integer forcing analog-to-digital conversion for massive MIMO systems,” in Signals, Systems and Computers, 2016 50th Asilomar Conference on. IEEE, 2016, pp. 11–15. [3] E. Domanovitz and U. Erez, “Outage behavior of integer forcing with random unitary pre-processing,” IEEE Transactions on Information Theory, vol. PP, no. 99, pp. 1–1, 2017. [4] A. Edelman and N. R. Rao, Random matrix theory. Cambridge University Press, 2005, vol. 14. [5] S. Tung, “Multiterminal source coding (Ph.D. Thesis),” Information Theory, IEEE Transactions on, vol. 24, no. 6, pp. 787–787, November 1978. [6] O. Fischler, “Universal precoding for parallel Gaussian channels,” Master’s thesis, Tel Aviv University, Tel Aviv, 2014. [Online]. Available: https://www.eng.tau.ac.il/∼ uri/theses/fischler msc.pdf [7] W. He and B. Nazer, “Integer-forcing source coding: Successive cancellation and source-channel duality,” in Information Theory (ISIT), 2016 IEEE International Symposium on. IEEE, 2016, pp. 155–159. [8] M. Mehta, Random matrices and the statistical theory of energy level. Academic Press, 1967. [9] J. Lagarias, J. Lenstra, H.W., and C. Schnorr, “Korkin-Zolotarev bases and successive minima of a lattice and its reciprocal lattice,” Combinatorica, vol. 10, no. 4, pp. 333–348, 1990. [10] H. Blichfeldt, “The minimum value of quadratic forms, and the closest packing of spheres,” Mathematische Annalen, vol. 101, no. 1, pp. 605–608, 1929. [11] O. Ordentlich, Private communication, 2017. [12] F. Oggier and E. Viterbo, “Algebraic number theory and code design for rayleigh fading channels,” Foundations and Trends in Communications and Information Theory, vol. 1, no. 3, pp. 333–415, 2004. [13] O. Ordentlich and U. Erez, “A simple proof for the existence of good pairs of nested lattices,” IEEE Transactions on Information Theory, vol. 62, no. 8, pp. 4439–4453, 2016. [14] D. Micciancio and S. Goldwasser, Complexity of lattice problems: a cryptographic perspective. Springer Science & Business Media, 2012, vol. 671. [15] O. Ordentlich, U. Erez, and B. Nazer, “Successive Integer-Forcing and its Sum-Rate Optimality,” CoRR, vol. abs/1307.2105, 2013. [Online]. Available: http://arxiv.org/abs/1307.2105 [16] ——, “The approximate sum capacity of the symmetric gaussian k-user interference channel,” IEEE Transactions on Information Theory, vol. 60, no. 6, pp. 3450–3482, 2014. [17] E. Domanovitz and U. Erez, “Combining space-time block modulation with integer forcing receivers,” in Electrical Electronics Engineers in Israel (IEEEI), 2012 IEEE 27th Convention of, Nov 2012, pp. 1–4. [18] O. Ordentlich and U. Erez, “Precoded Integer-Forcing Universally Achieves the MIMO Capacity to Within a Constant Gap,” Information Theory, IEEE Transactions on, vol. 61, no. 1, pp. 323–340, Jan 2015. [19] F. Oggier, G. Rekaya, J.-C. Belfiore, and E. Viterbo, “Perfect space–time block codes,” IEEE Transactions on information theory, vol. 52, no. 9, pp. 3885–3902, 2006. [20] P. Elia, K. Kumar, S. Pawar, P. Kumar, and H. feng Lu, “Explicit Space Time Codes Achieving the Diversity Multiplexing Gain Tradeoff,” Information Theory, IEEE Transactions on, vol. 52, no. 9, pp. 3869–3884, Sept 2006.
7cs.IT
Position-based coding and convex splitting for private communication over quantum channels arXiv:1703.01733v2 [quant-ph] 27 Aug 2017 Mark M. Wilde∗ March 5, 2017 Abstract The classical-input quantum-output (cq) wiretap channel is a communication model involving a classical sender X, a legitimate quantum receiver B, and a quantum eavesdropper E. The goal of a private communication protocol that uses such a channel is for the sender X to transmit a message in such a way that the legitimate receiver B can decode it reliably, while the eavesdropper E learns essentially nothing about which message was transmitted. The ε-oneshot private capacity of a cq wiretap channel is equal to the maximum number of bits that can be transmitted over the channel, such that the privacy error is no larger than ε ∈ (0, 1). The present paper provides a lower bound on the ε-one-shot private classical capacity, by exploiting the recently developed techniques of Anshu, Devabathini, Jain, and Warsi, called position-based coding and convex splitting. The lower bound is equal to a difference of the hypothesis testing mutual information between X and B and the “alternate” smooth max-information between X and E. The one-shot lower bound then leads to a non-trivial lower bound on the second-order coding rate for private classical communication over a memoryless cq wiretap channel. 1 Introduction Among the many results of information theory, the ability to use the noise in a wiretap channel for the purpose of private communication stands out as one of the great conceptual insights [Wyn75]. A classical wiretap channel is modeled as a conditional probability distribution pY,Z|X , in which the sender Alice has access to the input X of the channel, the legitimate receiver Bob has access to the output Y , and the eavesdropper Eve has access to the output Z. The goal of private communication is for Alice and Bob to use the wiretap channel in such a way that Alice communicates a message reliably to Bob, while at the same time, Eve should not be able to determine which message was transmitted. The author of [Wyn75] proved that the mutual information difference max [I(X; Y ) − I(X; Z)] pX (1.1) is an achievable rate for private communication over the wiretap channel, when Alice and Bob are allowed to use it many independent times. Since then, the interest in the wiretap channel has not waned, and there have been many increasingly refined statements about achievable rates for private communication over wiretap channels [CK78, Hay06, Tan12, Hay13, YAG13, YSP16, TB16]. ∗ Hearne Institute for Theoretical Physics, Department of Physics and Astronomy, Center for Computation and Technology, Louisiana State University, Baton Rouge, Louisiana 70803, USA 1 Many years after the contribution of [Wyn75], the protocol of quantum key distribution was developed as a proposal for private communication over a quantum channel [BB84]. Quantum information theory started becoming a field in its own right, during which many researchers revisited several of the known results of Shannon’s information theory under a quantum lens. This was not merely an academic exercise: doing so revealed that remarkable improvements in communication rates could be attained for physical channels of practical interest if quantum-mechanical strategies are exploited [GGL+ 04]. One important setting which was revisited is the wiretap channel, and in the quantum case, the simplest extension of the classical model is given by the classical-input quantum-output wiretap channel (abbreviated as cq wiretap channel ) [Dev05, CWY04]. It is described as the following map: x → ρxBE , (1.2) where x is a classical symbol that Alice can input to the channel and ρxBE is the joint output quantum state of Bob and Eve’s system, represented as a density operator acting on the tensorproduct Hilbert space of Bob and Eve’s quantum systems. The goal of private communication over the cq wiretap channel is similar to that for the classical wiretap channel. However, in this case, Bob is allowed to perform a collective quantum measurement over all of his output quantum systems in order to determine Alice’s message, while at the same time, we would like for it be difficult for Eve to figure out anything about the transmitted message, even if she has access to a quantum computer memory that can store all of the quantum systems that she receives from the channel output. The authors of [Dev05, CWY04] independently proved that a quantum generalization of the formula in (1.1) is an achievable rate for private communication over a cq quantum wiretap channel, if Alice and Bob are allowed to use it many independent times. Namely, they proved that the following Holevo information difference is an achievable rate: max [I(X; B) − I(X; E)] , pX (1.3) where the information quantities in the above formula are the Holevo information to Bob and Eve, respectively, and will be formally defined later in the present paper. Since the developments of [Dev05, CWY04], there has been an increasing interest in the quantum information community to determine refined characterizations of communication tasks [TH13, Li14, TT15, DTW16, DHO16, DL15, BDL16, TBR16, WTB17], strongly motivated by the fact that it is experimentally difficult to control a large number of quantum systems, and in practice, one has access only to a finite number of quantum systems anyway. One such scenario of interest, as discussed above, is the quantum wiretap channel. Hitherto, the only work offering achievable oneshot rates for private communication over cq wiretap channels is [RR11]. However, that work did not consider bounding the second-order coding rate for private communication over the cq wiretap channel. The main contribution of the present paper is a lower bound on the one-shot private capacity of a cq wiretap channel. Namely, I prove that ∗ log2 Mpriv (ε1 + √ √ ε −η2 ε1 −η1 ε2 ) ≥ I H (X; B) − Iemax2 (E; X) − log2 (4ε1 /η12 ) − 2 log2 (1/η2 ). (1.4) ∗ (ε + √ε ) represents the maximum number of bits that can be sent from In the above, log2 Mpriv 1 2 Alice to Bob, using a cq wiretap channel once, such that the privacy error (to be defined formally √ later) does not exceed ε1 + ε2 ∈ (0, 1), with ε1 , ε2 ∈ (0, 1). The quantities on the right-hand side of 2 the above inequality are particular one-shot generalizations of the Holevo information to Bob and Eve, which will be defined later. It is worthwhile to note that the one-shot information quantities in (1.4) can be computed using semi-definite programming, and the computational runtime is polynomial in the dimension of the channel. Thus, for channels of reasonable dimension, the quantities can be efficiently estimated numerically. The constants η1 and η2 are chosen so that √ η1 ∈ (0, ε1 ) and η2 ∈ (0, ε2 ). By substituting an independent and identically distributed (i.i.d.) cq wiretap channel into the right-hand side of the above inequality, using second-order expansions √ for the one-shot Holevo informations [TH13, Li14], and picking η1 , η2 = 1/ n, we find the following lower bound on the second-order coding rate for private classical communication: √ ∗ log2 Mpriv (n, ε1 + ε2 ) ≥ n [I(X; B) − I(X; E)] p p + nV (X; B)Φ−1 (ε1 ) + nV (X; E)Φ−1 (ε2 ) + O(log n). (1.5) ∗ (n, ε + √ε ) represents the maximum number of bits that can be sent In the above, log2 Mpriv 2 1 from Alice to Bob, using a cq wiretap channel n times, such that the privacy error does not exceed √ ε1 + ε2 ∈ (0, 1). The Holevo informations from (1.3) make an appearance in the first-order term (proportional to the number n of channel uses) on the right-hand side above, while the second √ order term (proportional to n) consists of the quantum channel dispersion quantities V (X; B) and V (X; E) [TT15], which will be defined later. They additionally feature the inverse Φ−1 of the cumulative Gaussian distribution function Φ. Thus, the one-shot bound in (1.4) leads to a lower bound on the second-order coding rate, which is comparable to bounds that have appeared in the classical information theory literature [Tan12, YAG13, YSP16, TB16]. To prove the one-shot bound in (1.4), I use two recent and remarkable techniques: position-based coding [AJW17] and convex splitting [ADJ17]. The main idea of position-based coding [AJW17] is conceptually simple. To communicate a classical message from Alice to Bob, we allow them to share a quantum state ρ⊗M RA before communication begins, where M is the number of messages, Bob possesses the R systems, and Alice the A systems. If Alice wishes to communicate message m, then she sends the mth A system through the channel. The reduced state of Bob’s systems is then ρR1 ⊗ · · · ⊗ ρRm−1 ⊗ ρRm B ⊗ ρRm+1 ⊗ · · · ⊗ ρRM , (1.6) where ρRm B = NAm →B (ρRm Am ) and NAm →B is the quantum channel. For all m0 6= m, the reduced state for systems Rm0 and B is the product state ρRm0 ⊗ ρB . However, the reduced state of systems Rm B is the (generally) correlated state ρRm B . So if Bob has a binary measurement which can distinguish the joint state ρRB from the product state ρR ⊗ ρB sufficiently well, he can base a decoding strategy off of this, and the scheme will be reliable as long as the number of bits log2 M to be communicated is chosen to be roughly equal to a one-shot mutual information known as hypothesis testing mutual information (cf., [WR12]). This is exactly what is used in position-based coding, and the authors of [AJW17] thus forged a transparent and intuitive link between quantum hypothesis testing and communication for the case of entanglement-assisted communication. Convex splitting [ADJ17] is rather intuitive as well and can be thought of as dual to the coding scenario mentioned above. Suppose instead that Alice and Bob have a means of generating the state in (1.6), perhaps by the strategy mentioned above. But now suppose that Alice chooses the variable m uniformly at random, so that the state, from the perspective of someone ignorant of the choice of m, is the following mixture: M 1 X ρR1 ⊗ · · · ⊗ ρRm−1 ⊗ ρRm B ⊗ ρRm+1 ⊗ · · · ⊗ ρRM . M m=1 3 (1.7) The convex-split lemma guarantees that as long as log2 M is roughly equal to a one-shot mutual information known as the alternate smooth max-mutual information, then the state above is nearly indistinguishable from the product state ρ⊗M ⊗ ρB . R Both position-based coding and convex splitting have been used recently and effectively to establish a variety of results in one-shot quantum information theory [AJW17, ADJ17]. In the present paper, I use the approaches in conjunction to construct codes for the cq wiretap channel. The main underlying idea follows the original approach of [Wyn75], by allowing for a message variable m ∈ {1, . . . , M } and a local key variable k ∈ {1, . . . , K} (local randomness), the latter of which is selected uniformly at random and used to confuse the eavesdropper Eve. Before communication begins, Alice, P Bob, and Eve are allowed share to M K copies of the common randomness state θXA XB XE ≡ x pX (x)|xxxihxxx|XA XB XE . We can think of the M K copies of θXA XB XE as being partitioned into M blocks, each of which contain K copies of the state θXA XB XE . If Alice wishes to send message m, then she picks k uniformly at random and sends the (m, k) XA system through the cq wiretap channel in (1.2). As long as log2 M K is roughly equal to the ε (X; B), then Bob can use a position-based decoder to hypothesis testing mutual information IH figure out both m and k. As long as log2 K is roughly equal to the alternate smooth max-mutual ε (E; X), then the convex-split lemma guarantees that the overall state of Eve’s information Iemax systems, regardless of which message m was chosen, is nearly indistinguishable from the prodK uct state ρ⊗M ⊗ ρE . Thus, in such a scheme, Bob can figure out m while Eve cannot figure XE out anything about m. This is the intuition behind the coding scheme and gives a sense of why ε (X; B) − Ieε (E; X) is an achievable number of bits that can be log2 M = log2 M K − log2 K ≈ IH max sent privately from Alice to Bob. The main purpose of the present paper is to develop the details of this argument and furthermore show how the scheme can be derandomized, so that the M K copies of the common randomness state θXA XB XE are in fact not necessary. The rest of the paper proceeds as follows. In Section 2, I review some preliminary material, which includes several metrics for quantum states and pertinent information measures. Section 3 develops the position-based coding approach for classical-input quantum-output communication channels. Position-based coding was developed in [AJW17] to highlight a different approach to entanglement-assisted communication, but I show in Section 3 how the approach can be used for shared randomness-assisted communication; I also show therein how to derandomize codes in this case (i.e., the shared randomness is not actually necessary for classical communication over cq channels). Section 4 represents the main contribution of the present paper, which is a lower bound on the ε-one-shot private classical capacity of a cq wiretap channel. The last development in Section 4 is to show how the one-shot lower bound leads to a lower bound on the second-order coding rate for private classical communication over a memoryless cq wiretap channel. Therein, I also show how these lower bounds simplify for pure-state cq wiretap channels and when using binary phase-shift keying as a coding strategy for private communication over a pure-loss bosonic channel. Section 5 concludes with a summary and some open questions for future work. 2 Preliminaries I use notation and concepts that are standard in quantum information theory and point the reader to [Wil16] for background. In the rest of this section, I review concepts that are less standard and set some notation that will be used later in the paper. 4 Trace distance, fidelity, and purified distance. Let D(H) denote the set of density operators acting on a Hilbert space H, let D≤ (H) denote the set of subnormalized density operators (with trace not exceeding one) acting on H, and let L+ (H) denote the set of positive semi-definite operators acting on H. The √ trace distance between two quantum states ρ, σ ∈ D(H) is equal to kρ − σk1 , where kCk1 ≡ Tr{ C † C} for any operator C. It has a direct operational interpretation in terms of the distinguishability of these states. That is, if ρ or σ are prepared with equal probability and the task is to distinguish them via some quantum measurement, then the optimal success probability √ √ 2 ρ σ 1 [Uhl76], in doing so is equal to (1 + kρ − σk1 /2) /2. The fidelity is defined as F (ρ, σ) ≡ and more generally we can use the same formula to define F (P, Q) if P, Q ∈ L+ (H). Uhlmann’s theorem states that [Uhl76] F (ρA , σA ) = max |hφσ |RA UR ⊗ IA |φρ iRA |2 , U (2.1) where |φρ iRA and |φσ iRA are fixed purifications of ρA and σA , respectively, and the optimization is with respect to all unitaries UR . The same statement holds more generally for P, Q ∈ L+ (H). The fidelity is invariant with respect to isometries and monotone non-decreasing with respect to channels. The sine distance or C-distance between two quantum states ρ, σ ∈ D(H) was defined as p C(ρ, σ) ≡ 1 − F (ρ, σ) (2.2) and proven to be a metric in [Ras02, Ras03, GLN05, Ras06]. It was later [TCR09] (under the name “purified distance”) shown to be a metric on subnormalized states ρ, σ ∈ D≤ (H) via the embedding P (ρ, σ) ≡ C(ρ ⊕ [1 − Tr{ρ}] , σ ⊕ [1 − Tr{σ}]) . (2.3) The following inequality relates trace distance and purified distance: 1 kρ − σk1 ≤ P (ρ, σ). 2 (2.4) Relative entropies and variances. The quantum relative entropy of two states ω and τ is defined as [Ume62] D(ωkτ ) ≡ Tr{ω[log2 ω − log2 τ ]} (2.5) whenever supp(ω) ⊆ supp(τ ) and it is equal to +∞ otherwise. The quantum relative entropy variance is defined as [TH13, Li14] V (ωkτ ) ≡ Tr{ω[log2 ω − log2 τ − D(ωkτ )]2 }, (2.6) whenever supp(ω) ⊆ supp(τ ). The hypothesis testing relative entropy [BD10, WR12] of states ω and τ is defined as ε DH (ωkτ ) ≡ − log2 inf {Tr{Λτ } : 0 ≤ Λ ≤ I ∧ Tr{Λω} ≥ 1 − ε} . Λ The max-relative entropy for states ω and τ is defined as [Dat09] n o Dmax (ωkτ ) ≡ inf λ ∈ R : ω ≤ 2λ τ . 5 (2.7) (2.8) The smooth max-relative entropy for states ω and τ and a parameter ε ∈ (0, 1) is defined as [Dat09] n o ε Dmax (ωkτ ) ≡ inf λ ∈ R : ω e ≤ 2λ τ ∧ P (ω, ω e) ≤ ε . (2.9) ε and D ε The following second-order expansions hold for DH max when evaluated for tensor-power states [TH13, Li14]: p ε (2.10) DH (ω ⊗n kτ ⊗n ) = nD(ωkτ ) + nV (ωkτ )Φ−1 (ε) + O(log n), √ p ε (2.11) Dmax (ω ⊗n kτ ⊗n ) = nD(ωkτ ) − nV (ωkτ )Φ−1 (ε) + O(log n). The above expansion features the cumulative distribution function for a standard normal random variable: Z a  1 Φ(a) ≡ √ dx exp −x2 /2 , (2.12) 2π −∞ and its inverse, defined as Φ−1 (ε) ≡ sup {a ∈ R | Φ(a) ≤ ε}. Mutual informations and variances. The quantum mutual information I(X; B)ρ and information variance V (X; B)ρ of a bipartite state ρXB are defined as I(X; B)ρ ≡ D(ρXB kρX ⊗ ρB ), (2.13) V (X; B)ρ ≡ V (ρXB kρX ⊗ ρB ). (2.14) In this paper, we are exclusively interested in the case in which system X of ρXB is classical, so that ρXB can be written as X ρXB = pX (x)|xihx|X ⊗ ρxB , (2.15) x where pX is a probability distribution, {|xiX }x is an orthonormal basis, and {ρxB }x is a set of quantum states. The hypothesis testing mutual information is defined as follows for a bipartite state ρXB and a parameter ε ∈ (0, 1): ε ε IH (X; B)ρ ≡ DH (ρXB kρX ⊗ ρB ). (2.16) From the smooth max-relative entropy, one can define a mutual information-like quantity for a state θAB as follows: ε Dmax (θAB kθA ⊗ θB ). (2.17) Note that we have the following expansions, as a direct consequence of (2.10)–(2.11) and definitions: q ε IH (X n ; B n )ρ⊗n = nI(X; B)ρ + nV (X; B)ρ Φ−1 (ε) + O(log n), (2.18) q √ ⊗n ⊗n ε Dmax (ρ⊗n nV (X; B)ρ Φ−1 (ε) + O(log n). (2.19) XB kρX ⊗ ρB ) = nI(X; B)ρ − Another quantity, related to that in (2.17), is as follows [AJW17]: ε Iemax (B; A)θ ≡ inf 0 0 θAB : P (θAB ,θAB )≤ε 0 0 Dmax (θAB kθA ⊗ θB ). (2.20) We recall a relation [AJW17, Lemma 1] between the quantities in (2.17) and (2.20), giving a very slight modification of it which will be useful for our purposes here: 6 Lemma 1 For a state θAB , ε ∈ (0, 1), and γ ∈ (0, ε), the following inequality holds   3 ε ε−γ e Imax (B; A)θ ≤ Dmax (θAB kθA ⊗ θB ) + log2 2 . γ (2.21) Proof. To see this, recall [AJW17, Claim 2]: For states ωAB , ξA , κB , there exists a state ω AB such that P (ωAB , ω AB ) ≤ δ and   3 (2.22) Dmax (ω AB kξA ⊗ ω B ) ≤ Dmax (ωAB kξA ⊗ κB ) + log2 2 . δ ε−γ ∗ ∗ ,ξ =θ , Let θAB denote the optimizer for Dmax (θAB kθA ⊗θB ). Then, in (2.22), taking ωAB = θAB A A ∗ ,θ κB = θB , we find that there exists a state θAB such that P (θAB AB ) ≤ γ and   3 ε−γ (2.23) Dmax (θAB kθA ⊗ θB ) ≤ Dmax (θAB kθA ⊗ θB ) + log2 2 . γ ∗ )+ By the triangle inequality for the purified distance, we conclude that P (θAB , θAB ) ≤ P (θAB , θAB ∗ ,θ P (θAB AB ) ≤ (ε − γ) + γ = ε. Since the quantity on the left-hand side includes an optimization 0 0 ,θ over all states θAB satisfying P (θAB AB ) ≤ ε, we conclude the inequality in (2.21). Hayashi–Nagaoka operator inequality. A key tool in analyzing error probabilities in communication protocols is the Hayashi–Nagaoka operator inequality [HN03]: given operators S and T such that 0 ≤ S ≤ I and T ≥ 0, the following inequality holds for all c > 0 I − (S + T )−1/2 S(S + T )−1/2 ≤ (1 + c)(I − S) + (2 + c + c−1 )T. (2.24) Convex-split lemma. The convex-split lemma from [ADJ17] has been a key tool used in recent developments in quantum information theory [AJW17, ADJ17]. We now state a variant of the convex-split lemma, which is helpful for obtaining one-shot bounds for privacy and an ensuing lower bound on the second-order coding rate. Its proof closely follows proofs available in [AJW17, ADJ17] but has some slight differences. For completeness, Appendix A contains a proof of Lemma 2. Lemma 2 (Convex split) Let ρAB be a state, and let τA1 ···AK B be the following state: τA1 ···AK B ≡ K 1 X ρA1 ⊗ · · · ⊗ ρAk−1 ⊗ ρAk B ⊗ ρAk+1 ⊗ · · · ⊗ ρAK . K (2.25) k=1 √ Let ε ∈ (0, 1) and η ∈ (0, ε). If √ log2 K = ε−η Iemax (B; A)ρ   1 + 2 log2 , η then P (τA1 ···AK B , ρA1 ⊗ · · · ⊗ ρAK ⊗ ρeB ) ≤ √ for some state ρeB such that P (ρB , ρeB ) ≤ ε − η. 7 √ (2.26) ε, (2.27) 3 Public classical communication 3.1 Definition of the one-shot classical capacity We begin by defining the ε-one-shot classical capacity of a cq channel x → ρxB . (3.1) We can write the classical–quantum channel in fully quantum form as the following quantum channel: X hx|X 0 σX 0 |xiX 0 ρxB , (3.2) NX 0 →B (σX 0 ) = x where {|xiX 0 }x is some orthonormal basis. Let M ∈ N and ε ∈ (0, 1). An (M, ε) classical communication code consists of a collection of probability distributions {pX|M (x|m)}M m=1 (one for each M ,1 such that message m) and a decoding positive operator-valued measure (POVM) {Λm } B m=1 M M 1 X1 1 X m MB→M̂ (ρm Tr{(IB − Λm )ρ } = B ) − |mihm|M̂ B B M M 2 m=1 1 ≤ ε. (3.3) m=1 We refer to the left-hand side of the above inequality as the decoding error. In the above, {|miM̂ }M m=1 as is an orthonormal basis, we define the state ρm B X ρm pX|M (x|m)ρxB , (3.4) B = x and the measurement channel MB→M̂ as MB→M̂ (ωB ) ≡ X Tr{Λm B ωB }|mihm|M̂ . (3.5) m The equality in (3.3) follows by direct calculation: MB→M̂ (ρm B ) − |mihm|M̂ = X 1 0 m 0 0 Tr{Λm B ρB }|m ihm |M̂ − |mihm|M̂ m0 = 1 0 X m 0 0 m m Tr{Λm B ρB }|m ihm |M̂ − (1 − Tr{ΛB ρB })|mihm|M̂ m0 6=m = X (3.6) (3.7) 1 0 m m m Tr{Λm B ρB } + (1 − Tr{ΛB ρB }) (3.8) m0 6=m m = 2 Tr{(IB − Λm B )ρB }. (3.9) ∗ (ε), where For a given channel NX 0 →B and ε, the one-shot classical capacity is equal to log2 Mpub ∗ (ε) is the largest M such that (3.3) can be satisfied for a fixed ε. Mpub One can allow for shared randomness between Alice and Bob before communication begins, in which case one obtains the one-shot shared randomness assisted capacity of a cq channel. 1 M 0 We could allow for a decoding POVM to be {Λm B }m=0 , consisting of an extra operator ΛB = IB − needed. 8 PM m=1 Λm B , if 3.2 Lower bound on the one-shot, randomness-assisted classical capacity We first consider a one-shot protocol for randomness assisted, public classical communication in which the goal is for Alice to use the classical-input quantum-output (cq) channel in (3.1) once to send one of M messages with error probability no larger than ε ∈ (0, 1). The next section shows how to derandomize such that the shared randomness is not needed. The main result of this section is that ε−η IH (X; B)ρ − log2 (4ε/η 2 ), (3.10) for all η ∈ (0, ε), is a lower bound on the ε-one-shot randomness-assisted, classical capacity of the cq channel in (3.1). Although this result is already known from [WR12], the development in this section is an important building block for the wiretap channel result in Section 4.2, and so we go through it in full detail for the sake of completeness. Also, the approach given here uses position-based decoding for the cq channel. Fix a probability distribution pX over the channel input alphabet. Consider the following classical–classical state: X ρXX 0 ≡ pX (x)|xihx|X ⊗ |xihx|X 0 , (3.11) x which we can think of as representing shared randomness. Let ρXB denote the following state, which results from sending the X 0 system of ρXX 0 through the channel NX 0 →B : X ρXB ≡ NX 0 →B (ρXX 0 ) = pX (x)|xihx|X ⊗ ρxB . (3.12) x The coding scheme works as follows. Let Alice and Bob share M copies of the state ρXX 0 , so that their shared state is ⊗M 0 = ρ ρX M X 0M ≡ ρX1 X10 ⊗ · · · ⊗ ρXM XM XX 0 . (3.13) Alice has the systems labeled by X 0 , and Bob has the systems labeled by X. If Alice would like 0 over the classical–quantum to communicate message m to Bob, then she simply sends system Xm channel. In such a case, the reduced state for Bob is as follows: ρm X M B ≡ ρX1 ⊗ · · · ⊗ ρXm−1 ⊗ ρXm+1 ⊗ · · · ⊗ ρXM ⊗ ρXm B . (3.14) is related to the first one ρ1X M B by a permutation π(m) of the X M Observe that each state ρm XM B systems: π(m) π(m)† WX M ρ1X M B WX M = ρm (3.15) XM B , π(m) where WX M is a unitary representation of the permutation π(m). If Bob has a way of distinguishing the joint state ρXB from the product state ρX ⊗ ρB , then with high probability, he will be able to figure out which message m was communicated. Let TXB denote a test (measurement operator) satisfying 0 ≤ TXB ≤ IXB , which we think of as identifying ρXB with high probability (≥ 1−ε) and for which the complementary operator IXB −TXB identifies ρX ⊗ ρB with the highest probability subject to the constraint Tr{TXB ρXB } ≥ 1 − ε. From such a test, we form the following measurement operator: Γm X M B ≡ TXm B ⊗ IX1 ⊗ · · · ⊗ IXm−1 ⊗ IXm+1 ⊗ · · · ⊗ IXM , 9 (3.16) which we think of as a test to figure out whether the reduced state on systems Xm B is ρXB or ρX ⊗ ρB . Observe that each message operator Γm is related to the first one Γ1X M B by a XM B M permutation π(m) of the X systems: π(m) π(m)† WX M Γ1X M B WX M = Γm XM B . (3.17) If message m is transmitted and the measurement operator Γm acts, then the probability of it XM B accepting is m Tr{Γm (3.18) X M B ρX M B } = Tr{TXB ρXB }. 0 If however the measurement operator Γm acts, where m0 6= m, then the probability of it accepting XM B is 0 m Tr{Γm (3.19) X M B ρX M B } = Tr{TXB [ρX ⊗ ρB ]}. From these measurement operators, we then form a square-root measurement as follows: !−1/2 !−1/2 M M X X 0 0 Γm . Γm Λm Γm XM B XM B XM B XM B ≡ (3.20) m0 =1 m0 =1 Again, each message operator Λm is related to the first one Λ1X M B by a permutation of the X M XM B systems: π(m) π(m)† WX M Λ1X M B WX M = !−1/2 M X π(m) WX M m0 XM B Γ1X M B Γ m0 =1 = m0 XM B Γ π(m)† WX M (3.21) m0 =1 !−1/2 M X π(m) WX M !−1/2 M X 0 Γm XM B π(m)† π(m) π(m)† π(m) WX M WX M Γ1X M B WX M WX M m0 =1 !−1/2 M X 0 Γm XM B π(m)† WX M m0 =1 (3.22) = M X !−1/2 π(m) 0 π(m)† WX M Γm X M B WX M Γm XM B m0 =1 = M X m0 =1 M X !−1/2 π(m) 0 π(m)† WX M Γ m X M B WX M (3.23) m0 =1 !−1/2 Γ m0 XM B Γm XM B M X !−1/2 m0 XM B Γ . (3.24) m0 =1 This is called the position-based decoder and was analyzed in [AJW17] for the case of entanglementassisted communication. The error probability under this coding scheme is as follows for each message m: m Tr{(IRM B − Λm (3.25) RM B )ρRM B }. The error probability is in fact the same for each message, due to the observations in (3.15) and (3.21)–(3.24): π(m)† π(m) π(m)† π(m) Tr{(IRM B − Λ1RM B )ρ1RM B } = Tr{(IRM B − Λ1RM B )WX M WX M ρ1RM B WX M WX M } (3.26) π(m)† π(m) π(m)† π(m) WX M Λ1RM B WX M )WX M ρ1RM B WX M } m Λm RM B )ρRM B }. (3.27) = Tr{(IRM B − = Tr{(IRM B − 10 (3.28) So let us analyze the error probability for the first message m = 1. Applying the Hayashi-Nagaoka P 0 1 operator inequality in (2.24), with S = ΓX M B , T = m0 6=1 Γm , cI ≡ 1 + c, and cII = 2 + c + c−1 XM B for c > 0, we find that this error probability can be bounded from above as Tr{(IRM B − Λ1RM B )ρ1RM B } X ≤ cI Tr{(IX M B − Γ1X M B )ρ1X M B } + cII 0 1 Tr{Γm X M B ρX M B } (3.29) m0 6=1 = cI Tr{(IXB − TXB )ρXB } + cII X Tr{TRB [ρX ⊗ ρB ]} (3.30) m0 6=1 = cI Tr{(IXB − TXB )ρXB } + cII (M − 1) Tr{TXB [ρX ⊗ ρB ]}. (3.31) Consider the hypothesis testing mutual information: ε ε IH (X; B)ρ ≡ DH (ρXB kρX ⊗ ρB ), (3.32) ε DH (ρkσ) ≡ − log2 inf {Tr{Λσ} : 0 ≤ Λ ≤ I ∧ Tr{Λρ} ≥ 1 − ε} . (3.33) where Λ Take the test TXB in Bob’s decoder to be Υ∗XB , where Υ∗XB is the optimal measurement operator ε−η (X; B)ρ for η ∈ (0, ε). Then the error probability is bounded as for IH Tr{(IX M B − Λ1X M B )ρ1X M B } ≤ cI Tr{(IXB − Υ∗XB )ρXB } + cII M Tr{Υ∗XB [ρX ⊗ ρB ]} ≤ cI (ε − η) + cII M 2 ε−η −IH (X;B)ρ . (3.34) (3.35) Now pick c = η/(2ε − η) and we get that the last line above = ε, for ε−η (X; B)ρ − log2 (4ε/η 2 ). log2 M = IH (3.36) Indeed, consider that we would like to have c such that ε−η ε = cI (ε − η) + cII M 2−IH (X;B)ρ . (3.37) Rewriting this, we find that M should satisfy log2 M = ε−η IH (X; B)ρ  + log2 ε − cI (ε − η) cII  . (3.38) Picking c = η/(2ε − η) then implies (after some algebra) that ε − cI (ε − η) η2 = . cII 4ε (3.39) ε−η So the quantity IH (X; B)ρ −log2 (4ε/η 2 ) represents a lower bound on the ε-one-shot randomnessassisted, classical capacity of the cq channel in (3.1). The bound holds for both average error probability and maximal error probability, and this coincidence is due to the protocol having the assistance of shared randomness. 11 3.3 Lower bound on the one-shot classical capacity Now I show how to derandomize the above randomness-assisted code. The main result of this section is the following lower bound on the ε-one shot classical capacity of the cq channel in (3.1), holding for all η ∈ (0, ε): ε−η ∗ log2 Mpub (ε) ≥ IH (X; B)ρ − log2 (4ε/η 2 ). (3.40) Again, note that although this result is already known from [WR12], the development in this section is an important building block for the wiretap channel result in Section 4.2. As stated previously, the approach given here uses position-based decoding for the cq channel. By the reasoning from the previous section, we have the following bound on the average error probability for a randomness-assisted code: M 1 X m Tr{(IX M B − Λm X M B )ρX M B } ≤ ε, M (3.41) ε−η log2 M = IH (X; B)ρ − log2 (4ε/η 2 ). (3.42) m=1 if So let us analyze the expression Tr{(IX M B − Λm )ρm }. By definition, it follows that XM B XM B X (3.43) = pX (x1 ) · · · pX (xM )|x1 , . . . , xM ihx1 , . . . , xM |X1 ···XM ⊗ ρxBm . ρm M X B x1 ,...,xM ε−η (X; B)ρ , which implies that Also, recall that Υ∗XB is optimal for IH Tr{Υ∗XB ρXB } ≥ 1 − (ε − η) , ε−η −IH (X;B)ρ Tr{Υ∗XB [ρX ⊗ ρB ]} = 2 (3.44) . (3.45) But consider that ( ) Tr{Υ∗XB ρXB } = Tr Υ∗XB X pX (x)|xihx|X ⊗ ρxB (3.46) pX (x) Tr {hx|X Υ∗XB |xiX ρxB } (3.47) pX (x) Tr {QxB ρxB } , (3.48) x = X x = X x where we define QxB ≡ hx|X Υ∗XB |xiX . (3.49) Similarly, we have that ( ) Tr{Υ∗XB [ρX ⊗ ρB ]} = Tr Υ∗XB X pX (x)|xihx|X ⊗ ρB (3.50) pX (x) Tr {hx|X Υ∗XB |xiX ρB } (3.51) pX (x) Tr {QxB ρB } . (3.52) x = X x = X x 12 P This demonstrates that it suffices to take the optimal measurement operator Υ∗XB to be x |xihx|X ⊗ QxB , with QxB defined as in (3.49), and this will achieve the same optimal value as Υ∗XB does. Taking Υ∗XB as such, now consider that ∗ Γm X M B = ΥXm B ⊗ IX1 ⊗ · · · ⊗ IXm−1 ⊗ IXm+1 ⊗ · · · ⊗ IXM X |xm ihxm |Xm ⊗ QxBm ⊗ IX1 ⊗ · · · ⊗ IXm−1 ⊗ IXm+1 ⊗ · · · ⊗ IXM = (3.53) (3.54) xm X = |x1 , . . . , xM ihx1 , . . . , xM |X M ⊗ QxBm . (3.55) x1 ,...,xM Then this implies that !−1/2 M X 0 Γm = XM B !−1/2 M X m0 =1 X x |x1 , . . . , xM ihx1 , . . . , xM |X M ⊗ QBm 0 (3.56) m0 =1 x1 ,...,xM X = |x1 , . . . , xM ihx1 , . . . , xM |X M ⊗ = x 0 QBm (3.57) m0 =1 x1 ,...,xM X !−1/2 M X |x1 , . . . , xM ihx1 , . . . , xM |X M ⊗ !−1/2 M X x 0 QBm , (3.58) m0 =1 x1 ,...,xM so that Λm XM B = M X !−1/2 m0 XM B Γm XM B Γ X !−1/2 m0 XM B (3.59) Γ m0 =1 m0 =1 = M X |x1 , . . . , xM ihx1 , . . . , xM |X M ⊗ ΩxBm , (3.60) x1 ,...,xM where ΩxBm ≡ M X !−1/2 x 0 QBm M X QxBm !−1/2 x 0 QBm . (3.61) m0 =1 m0 =1 P xm 0 and can be completed to a of M Observe that {ΩxBm }M m=1 is a POVM on the support m0 =1 QB P xm0 POVM on the full space by adding ΩxB0 ≡ IB − M Q . By employing (3.43) and (3.60), we m0 =1 B find that X m Tr{(IX M B − Λm pX (x1 ) · · · pX (xM ) Tr{(IB − ΩxBm )ρxBm }, (3.62) X M B )ρX M B } = x1 ,...,xM so that the average error probability is as follows: M 1 X m Tr{(IX M B − Λm X M B )ρX M B } M m=1 M 1 X X pX (x1 ) · · · pX (xM ) Tr{(IB − ΩxBm )ρxBm } M m=1 x1 ,...,xM # " M X 1 X xm xm Tr{(IB − ΩB )ρB } . = pX (x1 ) · · · pX (xM ) M x ,...,x = 1 m=1 M 13 (3.63) (3.64) The last line above is the same as the usual “Shannon trick” of exchanging the average over the messages with the expectation over a random choice of code. By employing the bound in (3.41), we find that # " M X 1 X xm xm Tr{(IB − ΩB )ρB } ≤ ε. (3.65) pX (x1 ) · · · pX (xM ) M x ,...,x 1 m=1 M Then there exists a particular set of values of x1 , . . . , xM such that M 1 X Tr{(IB − ΩxBm )ρxBm } ≤ ε. M (3.66) m=1 This sequence x1 , . . . , xM constitutes the codewords and {ΩxBm }M m=1 is a corresponding POVM that can be used as a decoder. The number of bits that the code can transmit is equal to log2 M = ε−η IH (X; B)ρ −log2 (4ε/η 2 ). No shared randomness is required for this code (it is now derandomized). Remark 3 To achieve maximal error probability 2ε, one can remove the worst half of the codewords, and then a lower bound on the achievable number of bits is ε−η ε−η IH (X; B)ρ − log2 2 − log2 (4ε/η 2 ) = IH (X; B)ρ − log2 (8ε/η 2 ). 4 4.1 (3.67) Private classical communication Definition of the one-shot private classical capacity Now suppose that Alice, Bob, and Eve are connected by a classical-input quantum-quantum-output (cqq) channel of the following form: x → ρxBE , (4.1) where Bob has system B and Eve system E. The fully quantum version of this channel is as follows: X NX 0 →BE (σX 0 ) = hx|X 0 σX 0 |xiX 0 ρxBE , (4.2) x where {|xiX 0 }x is some orthonormal basis. We define the one-shot private classical capacity in the following way. Let M ∈ N and ε ∈ (0, 1). An (M, ε) private communication code consists of a collection of probability distributions m M {pX|M (x|m)}M m=1 (one for each message m) and a decoding POVM {ΛB }m=1 , such that M 1 X1 MB→M̂ (ρm BE ) − |mihm|M̂ ⊗ σE M 2 1 ≤ ε. (4.3) m=1 We refer to the left-hand side of the above inequality as the privacy error. In the above, {|miM̂ }M m=1 is an orthonormal basis, the state σE can be any state, we define the state ρm as BE X ρm pX|M (x|m)ρxBE , (4.4) BE = x 14 and the measurement channel MB→M̂ as MB→M̂ (ωB ) ≡ X Tr{Λm B ωB }|mihm|M̂ . (4.5) m ∗ (ε), For a given channel NX 0 →BE and ε, the one-shot private classical capacity is equal to log2 Mpriv ∗ (ε) is the largest M such that (4.3) can be satisfied for a fixed ε. where Mpriv The condition in (4.3) combines the reliable decoding and security conditions into a single average error criterion. We can see how it represents a generalization of the error criterion in (3.3), which was for public classical communication over a cq channel. One could have a different definition of one-shot private capacity, in which there are two separate criteria, but the approach above will be beneficial for our purposes. In any case, a code satisfying (4.3) satisfies the two separate criteria as well, as is easily seen by invoking the monotonicity of trace distance.2 Having a single error criterion for private capacity is the same as the approach taken in [HHHO09] and [WTB17], and in the latter paper, it was shown that notions of asymptotic private capacity are equivalent when using either a single error criterion or two separate error criteria. 4.2 Lower bound on the one-shot private classical capacity The main result of this section is the following lower bound on the ε-one shot private capacity of a √ cq wiretap channel, holding for all ε1 , ε2 ∈ (0, 1), such that ε1 + ε2 ∈ (0, 1), and η1 ∈ (0, ε1 ) and √ η2 ∈ (0, ε2 ): ∗ log2 Mpriv (ε1 + √ √ ε −η2 ε1 −η1 ε2 ) ≥ IH (X; B)ρ − Iemax2 (E; X)ρ − log2 (4ε1 /η12 ) − 2 log2 (1/η2 ) . (4.6) To begin with, we allow Alice, Bob, and Eve shared randomness of the following form: X ρXX 0 X 00 ≡ pX (x)|xihx|X ⊗ |xihx|X 0 ⊗ |xihx|X 00 , (4.7) x where Bob has the X system, Alice the X 0 system, and Eve the X 00 system. It is natural here to let Eve share the randomness as well, and this amounts to giving her knowledge of the code to be used. Let ρXX 00 BE denote the state resulting from sending the X 0 system through the channel NX 0 →BE in (4.2): X ρXX 00 BE ≡ pX (x)|xihx|X ⊗ ρxBE ⊗ |xihx|X 00 . (4.8) x The coding scheme that Alice and Bob use is as follows. There is the message m ∈ {1, . . . , M } and a local key k ∈ {1, . . . , K}. The local key k represents local, uniform randomness that Alice has, but which is not accessible to Bob or Eve. We assume that Alice, Bob, and Eve share M K copies of the state in (4.7) before communication begins, and we denote this state as K 0 X 00 ⊗ · · · ⊗ ρX 0 00 ρX M K X 0M K X 00M K = ρX1,1 X1,1 = ρ⊗M XX 0 X 00 . M,K XM,K XM,K 1,1 2 (4.9) Indeed, starting (4.3) and applying monotonicity of trace distance under partial trace of the E system, PM with m 1 1 we get that M m=1 2 kMB→M̂ (ρB ) − |mihm|M̂ k1 ≤ ε. Recalling (3.3), we can interpret this as asserting that the decoding error P probability does not exceed ε. Doing the same but considering a partial trace over the B system M m 1 1 implies that M m=1 2 kρE − σE k1 ≤ ε, which is a security criterion. So we get that the conventional two separate criteria are satisfied if a code satisfies the single privacy error criterion in (4.3). 15 To send the message m, Alice picks k uniformly at random from the set {1, . . . , K}. She then sends the (m, k)th X 0 system through the channel NX 0 →BE . Thus, when m and k are chosen, the reduced state on Bob and Eve’s systems is 00 00 BE ⊗ ρX 00 00 00 ⊗ · · · ⊗ ρX ⊗ ρXm,k Xm,k ⊗ · · · ⊗ ρXM,K XM,K , ρm,k = ρX1,1 X1,1 m,k−1 Xm,k−1 m,k+1 Xm,k+1 X M K X 00M K BE (4.10) and the state of Bob’s systems is ρm,k = ρX1,1 ⊗ · · · ⊗ ρXm,k−1 ⊗ ρXm,k B ⊗ ρXm,k+1 ⊗ · · · ⊗ ρXM,K . XMK B (4.11) For Bob to decode, he uses the position-based decoder to decode both the message m and the local key k. Let {Λm,k } denote his decoding POVM. By the reasoning from Section 3.2, as long X M,K B m,k as ε1 −η1 log2 M K = IH (X; B)ρ − log2 (4ε1 /η12 ), (4.12) where ε1 ∈ (0, 1) and η1 ∈ (0, ε1 ), then we have the following bound holding for all m, k: Tr{(IX M,K B − Λm,k )ρm,k } ≤ ε1 , XMK B XMK B (4.13) where Λm,k is defined as in Sections 3.2 and 3.3. By the reasoning from Section 3.3, we can also XMK B write (4.13) as " # M K X 1 XX x x pX (x1,1 ) · · · pX (xM,K ) (4.14) Tr{(IB − ΩBm,k )ρBm,k } ≤ ε1 , M K x ,...,x 1,1 m=1 k=1 M,K x with ΩBm,k defined as in Section 3.3. Define the following measurement channels: MB→M̂ (ωB ) ≡ X x Tr{ΩBm,k ωB }|mihm|M̂ , (4.15) m,k M0B→M̂ K̂ (ωB ) ≡ X x Tr{ΩBm,k ωB }|mihm|M̂ ⊗ |kihk|K̂ , (4.16) m,k with it being clear that TrK̂ ◦M0B→M̂ K̂ = MB→M̂ . Consider that  1 x M0B→M̂ K̂ ρBm,k − |mihm|M̂ ⊗ |kihk|K̂ 2 1 1 X x 0 0 x = Tr{ΩBm ,k ρBm,k }|m0 ihm0 |M̂ ⊗ |k 0 ihk 0 |K̂ − |mihm|M̂ ⊗ |kihk|K̂ 2 0 0 m ,k = 1 2 x X 0 0 x x (4.17) 1 x Tr{ΩBm ,k ρBm,k }|m0 ihm0 |M̂ ⊗ |k 0 ihk 0 |K̂ − (1 − Tr{ΩBm,k ρBm,k })|mihm|M̂ ⊗ |kihk|K̂ (m0 ,k0 )6=(m,k) 1 (4.18) x x = 1 − Tr{ΩBm,k ρBm,k } = Tr{(IB − (4.19) x x ΩBm,k )ρBm,k }. (4.20) 16 Now averaging the above quantity over m, k, and x1,1 , . . . , xM,K , and applying the condition in (4.14), we get that   X X  1 1 x M0B→M̂ K̂ ρBm,k − |mihm|M̂ ⊗ |kihk|K̂  ≤ ε1 . pX (x1,1 ) · · · pX (xM,K )  MK 2 1 x ,...,x 1,1 m,k M,K (4.21) Applying convexity of the trace distance to bring the average over k inside and monotonicity with respect to partial trace over system K̂ to the left-hand side of (4.21), we find that ! # M K X 1 X1 1 x m,k pX (x1,1 ) · · · pX (xM,K ) − |mihm|M̂ (TrK̂ ◦M0B→M̂ K̂ ) ρB M 2 K x1,1 ,...,xM,K m=1 k=1 1 " ! # M K X 1 X1 1 X xm,k = pX (x1,1 ) · · · pX (xM,K ) MB→M̂ ρB − |mihm|M̂ ≤ ε1 . M 2 K x ,...,x " X 1,1 m=1 M,K k=1 1 (4.22) Let us define the state x 0 ,x ωEm m ≡ 1 K xm0 ,k0 xm,k ρBE } k,k0 =1 TrB {ΩB PK q(xm0 |xm ) , (4.23) K 1 X x 0 0 xm,k }. Tr{ΩBm ,k ρBE q(xm0 |xm ) ≡ K 0 (4.24) k,k =1 Consider that X x q(xm0 |xm )ωEm 0 ,xm = m0 K 1 X xm,k ρE . K (4.25) k=1 Then we can write MB→M̂ K 1 X xm,k ρBE K ! = X k=1 so that MB→M̂ K 1 X xm,k ρB K x q(xm0 |xm )|m0 ihm0 |M̂ ⊗ ωEm 0 ,xm , (4.26) m0 ! = X m0 k=1 17 q(xm0 |xm )|m0 ihm0 |M̂ . (4.27) Using these observations, we can finally write ! M K K 1 X1 1 X xm,k 1 X xm,k MB→M̂ − |mihm|M̂ ⊗ ρBE ρE M 2 K K m=1 = 1 M ≤ 1 M = 1 M = 1 M k=1 k=1 1 M X X 1 X x 0 ,x x 0 ,x q(xm0 |xm )|m0 ihm0 |M̂ ⊗ ωEm m − |mihm|M̂ ⊗ q(xm0 |xm )ωEm m 2 m=1 m0 m0   M XX 1 xm0 ,xm xm0 ,xm 0 0 q(xm0 |xm ) |m ihm |M̂ ⊗ ωE − |mihm|M̂ ⊗ ωE 1 2 m=1 m0   M X X 1 0 0 q(xm0 |xm ) |m ihm |M̂ − |mihm|M̂ 1 2 0 m=1 m M X X (4.28) 1 q(xm0 |xm ) (4.29) (4.30) (4.31) m=1 m0 6=m M 1 X1 = MB→M̂ M 2 m=1 K 1 X xm,k ρB K ! − |mihm|M̂ k=1 . (4.32) 1 Combining with (4.22), the above development implies that X pX (x1,1 ) · · · pX (xM,K ) x1,1 ,...,xM,K M 1 X1 MB→M̂ × M 2 " m=1 K 1 X xm,k ρBE K ! − |mihm|M̂ k=1 K 1 X xm,k ρE ⊗ K k=1 # ≤ ε1 . (4.33) 1 Now we consider the state on Eve’s systems and the analysis of privacy. If m and k are fixed, then her state is ρm,k = ρX1,1 ⊗ · · · ⊗ ρXm,k−1 ⊗ ρXm,k E ⊗ ρXm,k+1 ⊗ · · · ⊗ ρXM,K . XMK E (4.34) (For simplicity of notation, in the above and what follows we are labeling her systems X 00 as X.) However, k is chosen uniformly at random, and so conditioned on the message m being fixed, the state of Eve’s systems is as follows: ρm XMK E K 1 X m,k ≡ ρX M K E K (4.35) k=1 = ρX1,1 ⊗ · · · ⊗ ρXm−1,K " # K 1 X ⊗ ρXm,1 ⊗ · · · ⊗ ρXm,k−1 ⊗ ρXm,k E ⊗ ρXm,k+1 ⊗ · · · ⊗ ρXm,K K k=1 ⊗ ρXm+1,1 ⊗ · · · ⊗ ρXM,K . (4.36) We would like to show for ε2 ∈ (0, 1) that 1 m ρ M K − ρX M K ⊗ ρeE 2 X E 18 1 ≤ ε2 , (4.37) for some state ρeE . By the invariance of the trace distance with respect to tensor-product states, i.e., kσ ⊗ τ − ω ⊗ τ k1 = kσ − ωk1 , (4.38) we find that 1 m ρ M K − ρX M K ⊗ ρeE 1 2 X E 1 m ρ − ρXm,1 ···Xm,K ⊗ ρeE = 2 Xm,1 ···Xm,K E 1 K  1 1 X = ρXm,1 ⊗ · · · ⊗ ρXm,k−1 ⊗ ρXm,k E − ρXm,k ⊗ ρeE ⊗ ρXm,k+1 ⊗ · · · ⊗ ρXm,K 2 K k=1 (4.39) (4.40) . (4.41) 1 From Lemma 2 and the relation in (2.4) between trace distance and purified distance, we find that if we pick K such that √ ε −η log2 K = Iemax2 2 (E; X)ρ + 2 log2 (1/η2 ), (4.42) then we are guaranteed that 1 m ρ M K − ρX M K ⊗ ρeE 2 X E √ where ρeE is some state such that P (e ρE , ρE ) ≤ ε2 − η2 . Consider that we can rewrite 1 ≤ √ ε2 , (4.43) 1 m (4.44) ρ M K − ρX M K ⊗ ρeE 1 2 X E K  1 1 X X x = pX (x1,1 ) · · · pX (xM,K )|x1,1 · · · xM,K ihx1,1 · · · xM,K |X M,K ⊗ ρEm,k − ρeE 2 K x ···x k=1 = 1 2 1,1 M,K 1 (4.45) ! X pX (x1,1 ) · · · pX (xM,K )|x1,1 · · · xM,K ihx1,1 · · · xM,K |X M,K ⊗ x1,1 ···xM,K K 1 X xm,k ρE − ρeE K k=1 1 (4.46) K 1 1 X xm,k pX (x1,1 ) · · · pX (xM,K ) ρE − ρeE 2 K " X = x1,1 ···xM,K k=1 # ≤ √ ε2 . 1 Applying (4.38) to (4.47), we find that " K X 1 X xm,k 1 |mihm|M̂ ⊗ pX (x1,1 ) · · · pX (xM,K ) ρE − |mihm|M̂ ⊗ ρeE 2 K x ···x 1,1 k=1 M,K (4.47) # ≤ ε2 . (4.48) 1 Putting together (4.12), (4.42), (4.33), and (4.48), we find that if h √ i ε −η log2 M = I ε1 −η1 (X; B)ρ − log2 (4ε1 /η 2 ) − Iemax2 2 (E; X)ρ + 2 log2 (1/η2 ) 1 H √ (4.49) √ ε −η ε1 −η1 = IH (X; B)ρ − Iemax2 2 (E; X)ρ − log2 (4ε1 /η12 ) − 2 log2 (1/η2 ), 19 (4.50) then we have by the triangle inequality that " X 1 pX (x1,1 ) · · · pX (xM,K ) MB→M̂ 2 x ,...,x 1,1 K 1 X xm,k ρBE K ! # − |mihm|M̂ ⊗ ρeE k=1 M,K ≤ ε1 + √ ε2 . 1 (4.51) So this gives what is achievable with shared randomness (again, no difference between average and maximal error if shared randomness is allowed). We now show how to derandomize the code. We take the above and average over all messages m. We find that ε1 + √ ε2 M 1 X ≥ M x m=1 = " X 1,1 ,...,xM,K X 1 pX (x1,1 ) · · · pX (xM,K ) MB→M̂ 2 pX (x1,1 ) · · · pX (xM,K ) x1,1 ,...,xM,K 1 M M X " m=1 1 MB→M̂ 2 K 1 X xm,k ρBE K ! # − |mihm|M̂ ⊗ ρeE k=1 1 K K X 1 (4.52) #! ! x m,k ρBE − |mihm|M̂ ⊗ ρeE k=1 . 1 (4.53) So we can conclude that there exist particular values x1,1 , . . . , xM,K such that " M 1 X 1 MB→M̂ M 2 m=1 K 1 X xm,k ρBE K # ! k=1 − |mihm|M̂ ⊗ ρeE ≤ ε1 + √ ε2 . (4.54) 1 Thus, our final conclusion is that the number of achievable bits that can be sent such that the √ privacy error is no larger than ε1 + ε2 is equal to √ ε −η ε1 −η1 log2 M = IH (X; B)ρ − Iemax2 2 (E; X)ρ − log2 (4ε1 /η12 ) − 2 log2 (1/η2 ). 4.3 (4.55) Second-order asymptotics for private classical communication In this section, I show how the lower bound on one-shot private capacity leads to a non-trivial lower bound on the second-order coding rate of private communication over an i.i.d. cq wiretap channel. I also show how the bounds simplify for pure-state cq wiretap channels and when using binary phase-shift keying as a coding strategy for private communication over a pure-loss bosonic channel. √ Applying Lemma 1 to (4.55) with γ ∈ (0, ε − η), we can take √ ε −η ε1 −η1 log2 M = IH (X; B)ρ − Iemax2 2 (E; X)ρ − log2 (4ε1 /η12 ) − 2 log2 (1/η2 ) ε1 −η1 ≥ IH (X; B)ρ − √ ε −η −γ Dmax2 2 (ρXE kρX (4.56) ⊗ ρE ) − log2 (4ε1 /η12 ) − 2 log2 (1/η2 ) − log2 (3/γ 2 ). (4.57) while still achieving the performance in (4.54). 20 Substituting an i.i.d. cq wiretap channel into the one-shot bounds, evaluating for such a case √ ε in (2.18) and D ε and using the expansions for IH max in (2.19), while taking η1 = η2 = γ = 1/ n, for sufficiently large n, we get that ∗ log2 Mpriv (n, ε1 + 4.3.1 √ ε2 ) ≥ n [I(X; B)ρ − I(X; E)ρ ] q q + nV (X; B)ρ Φ−1 (ε1 ) + nV (X; E)ρ Φ−1 (ε2 ) + O(log n). (4.58) Example: Pure-state cq wiretap channel Let us consider applying the inequality in (4.58) to a cq pure-state wiretap channel of the following form: x → |ψ x ihψ x |B ⊗ |ϕx ihϕx |E , (4.59) in which the classical input x leads to a pure quantum state |ψ x ihψ x |B for Bob and a pure quantum state |ϕx ihϕx |E for Eve. This channel may seem a bit particular, but we discuss in the next section how one can induce such a channel from a practically relevant channel, known as the pure-loss bosonic channel. In order to apply the inequality in (4.58) to the channel in (4.59), we fix a distribution pX (x) over the input symbols, leading to the following classical–quantum state: X ρXBE ≡ pX (x)|xihx|X ⊗ |ψ x ihψ x |B ⊗ |ϕx ihϕx |E . (4.60) x It is well known and straightforward to calculate that the following simplifications occur I(X; B)ρ = H(B)ρ = H(ρB ), (4.61) I(X; E)ρ = H(E)ρ = H(ρE ), (4.62) where H(σ) ≡ − Tr{σ log2 σ} denotes the quantum entropy of a state σ and X ρB = pX (x)|ψ x ihψ x |B , (4.63) x ρE = X pX (x)|ϕx ihϕx |E . (4.64) x Proposition 4 below demonstrates that a similar simplification occurs for the information variance quantities in (4.58), in the special case of a pure-state cq wiretap channel. By employing it, we find the following lower bound on the second-order coding rate for a pure-state cq wiretap channel: ∗ log2 Mpriv (n, ε1 + √ ε2 ) ≥ n [H(ρB ) − H(ρE )] p p + nV (ρB )Φ−1 (ε1 ) + nV (ρE )Φ−1 (ε2 ) + O(log n), (4.65) where V (ρB ) and V (ρE ) are defined from (4.67) below. Proposition 4 Let ρXB = X pX (x)|xihx|X ⊗ |ψ x ihψ x |B x 21 (4.66) be a classical–quantum state corresponding to a pure-state ensemble {pX (x), |ψ x iB }x . Then the Holevo information variance P V (X; B)ρ = V (ρXB kρX ⊗ ρB ) is equal to the entropy variance V (ρB ) of the expected state ρB = x pX (x)|ψ x ihψ x |B , where V (σ) = Tr{σ [− log2 σ − H(σ)]2 }. (4.67) That is, when ρXB takes the special form in (4.66), the following equality holds V (X; B)ρ = V (ρB ). (4.68) Proof. For the cq state in (4.66), consider that I(X; B)ρ = H(B)ρ = H(ρB ). Furthermore, we have that " # X log2 ρXB = log2 pX (x)|xihx|X ⊗ |ψ x ihψ x |B (4.69) x = X log2 (pX (x)) |xihx|X ⊗ |ψ x ihψ x |B , (4.70) x which holds because the eigenvectors of ρXB are {|xiX ⊗ |ψ x iB }x . Then V (X; B) = V (ρXB kρX ⊗ ρB ) (4.71) 2 = Tr{ρXB [log2 ρXB − log2 (ρX ⊗ ρB )] } − [I(X; B)ρ ] 2 (4.72) 2 2 = Tr{ρXB [log2 ρXB − log2 ρX ⊗ IB − IX ⊗ log2 ρB ] } − [H(B)ρ ] . (4.73) By direct calculation, we have that log2 ρXB − log2 ρX ⊗ IB − IX ⊗ log2 ρB X X X = log2 (pX (x)) |xihx|X ⊗ |ψ x ihψ x |B − log2 [pX (x)] |xihx|X ⊗ IB − |xihx|X ⊗ log2 ρB x x x (4.74) =− X x x |xihx|X ⊗ [log2 (pX (x)) (IB − |ψ ihψ |B ) + log2 ρB ] . (4.75) x Observe that IB − |ψ x ihψ x |B is the projection onto the space orthogonal to |ψ x iB . Then we find that [log2 ρXB − log2 ρX ⊗ IB − IX ⊗ log2 ρB ]2 " #2 X = − |xihx|X ⊗ [log2 (pX (x)) (IB − |ψ x ihψ x |B ) + log2 ρB ] (4.76) x = X |xihx|X ⊗ [log2 (pX (x)) (IB − |ψ x ihψ x |B ) + log2 ρB ]2 . (4.77) x Furthermore, we have that [log2 (pX (x)) (IB − |ψ x ihψ x |B ) + log2 ρB ]2 = [log2 (pX (x))]2 (IB − |ψ x ihψ x |B ) + log2 (pX (x)) (IB − |ψ x ihψ x |B ) (log2 ρB ) + log2 (pX (x)) (log2 ρB ) (IB − |ψ x ihψ x |B ) + [log2 ρB ]2 (4.78) 22 So then, by direct calculation, Tr{ρXB [log2 ρXB − log2 ρX ⊗ IB − IX ⊗ log2 ρB ]2 } (4.79) (" #" #) X X 2 0 0 0 x0 x0 x x = Tr pX (x )|x ihx |X ⊗ |ψ ihψ |B |xihx|X ⊗ [log2 (pX (x)) (IB − |ψ ihψ |B ) + log2 ρB ] x0 x (4.80) = X n h io pX (x) Tr |ψ x ihψ x |B [log2 (pX (x)) (IB − |ψ x ihψ x |B ) + log2 ρB ]2 (4.81) n o pX (x) Tr |ψ x ihψ x |B [log2 ρB ]2 (4.82) x = X x = Tr{ρB [log2 ρB ]2 }. (4.83) In the second-to-last equality, we used the expansion in (4.78) and the fact that |ψ x ihψ x |B and IB − |ψ x ihψ x |B are orthogonal. Finally, putting together (4.73) and (4.83), we conclude (4.68). 4.3.2 Example: Pure-loss bosonic channel We can induce a pure-state cq wiretap channel from a pure-loss bosonic channel. In what follows, we consider a coding scheme called binary phase-shift keying (BPSK). Let us recall just the basic facts needed from Gaussian quantum information to support the argument that follows (a curious reader can consult [Ser17] for further details). The pure-loss channel of transmissivity η ∈ (0, 1) is such that if the sender inputs a coherent state |αi with α ∈ C, then the outputs for Bob and Eve √ √ are the coherent states | ηαiB and | 1 − ηαiE , respectively. Note that the overlap of any two 2 coherent states |αi and |βi is equal to |hα|βi|2 = e−|α−β| , and this is in fact the main quantity that we need to evaluate the information quantities in (4.65). The average photon number of a coherent state |αi is equal to |α|2 . A BPSK-coding scheme induces the following pure-state cq wiretap channel from the pure-loss channel: p √ 0 → |αiA → | ηαiB ⊗ | 1 − ηαiE , (4.84) p √ 1 → | − αiA → | − ηαiB ⊗ | − 1 − ηαiE . (4.85) That is, if the sender would like to transmit the symbol “0,” then she prepares the coherent √ state |αiA at the input, and the physical channel prepares the coherent state | ηαiB for Bob and √ | 1 − ηαiE for Eve. A similar explanation holds for when the sender inputs the symbol “1.” A BPSK-coding scheme is such that the distribution pX (x) is unbiased: there is an equal probability 1/2 to pick “0” or “1” when selecting codewords. Thus, the expected density operators at the output for Bob and Eve are respectively as follows: 1 √ √ √ √ (| ηαih ηα|B + | − ηαih− ηα|B ) , 2  p p p 1p ρE = | 1 − ηαih 1 − ηα|B + | − 1 − ηαih− 1 − ηα|B . 2 ρB = (4.86) (4.87) A straightforward computation reveals that the eigenvalues for ρB are a function only of the overlap 2 √ √ 2 h− ηα| ηαi = e−4η|α| ≡ e−4ηn̄ and are equal to [GW12] pB (η, n̄) ≡  1 1 + e−2ηn̄ , 2 1 − pB (η, n̄) = 23  1 1 − e−2ηn̄ . 2 (4.88) Similarly, the eigenvalues of ρE are given by  1 pE (η, n̄) ≡ 1 + e−2(1−η)n̄ , 2 1 − pE (η, n̄) =  1 1 − e−2(1−η)n̄ . 2 (4.89) We can then immediately plug in to (4.65) to find a lower bound on the second-order coding rate for private communication over the pure-loss bosonic channel:   √ ∗ log2 Mpriv (n, ε1 + ε2 ) ≥ n h2 (pB (η, n̄)) − h2 (pE (η, n̄)) q q + nv2 (pB (η, n̄))Φ−1 (ε1 ) + nv2 (pE (η, n̄))Φ−1 (ε2 ) + O(log n), (4.90) where h2 and v2 respectively denote the binary entropy and binary entropy variance: h2 (γ) ≡ −γ log2 γ − (1 − γ) log2 (1 − γ), 2 (4.91) 2 v2 (γ) ≡ γ [log2 γ + h2 (γ)] + (1 − γ) [log2 (1 − γ) + h2 (γ)] . (4.92) A benchmark against which we can compare the performance of a BPSK code with |α|2 = n̄ is the energy-constrained private capacity of a pure-loss bosonic channel [WQ16], given by g(ηn̄) − g((1 − η)n̄), (4.93) where g(x) ≡ (x + 1) log2 (x + 1) − x log2 x. Figure 1 plots the normal approximation [PPV10] of the lower bound on the second-order coding rate of BPSK coding for various parameter choices for ε1 , ε2 , η, and n̄, comparing it against the asymptotic performance of BPSK and the actual energy-constrained private capacity in (4.93). The normal approximation consists of all terms in (4.90) besides the O(log n) term and typically serves as a good approximation for non-asymptotic capacity even for small values of n (when (4.90) is not necessarily valid), as previously observed in [PPV10, TH13, TBR16]. 5 Conclusion This paper establishes a lower bound on the ε-one-shot private classical capacity of a cq wiretap channel, which in turn leads to a lower bound on the second-order coding rate for private communication over an i.i.d. cq wiretap channel. The main techniques used are position-based decoding [AJW17] in order to guarantee that Bob can decode reliably and convex splitting [ADJ17] to guarantee that Eve cannot determine which message Alice transmitted. It is my opinion that these two methods represent a powerful approach to quantum information theory, having already been used effectively in a variety of contexts in [ADJ17, AJW17]. For future work, it would be good to improve upon the lower bounds given here. Extensions of the methods of [YSP16] and [TB16] might be helpful in this endeavor. Note: After the completion of the results in the present paper, Naqueeb Warsi informed the author of an unpublished result from [War15], which establishes a lower bound on the ε-one-shot private capacity of a cq wiretap channel in terms of a difference of the hypothesis testing mutual information and a smooth max-mutual information. Acknowledgements. I am grateful to Anurag Anshu, Saikat Guha, Rahul Jain, Haoyu Qi, Qingle Wang, and Naqueeb Warsi for discussions related to the topic of this paper. I acknowledge support from the Office of Naval Research and the National Science Foundation. 24 η = 0.75, n̄ = 0.1, ε1 = 1e-005, ε2 = 1e-005 0.24 η = 0.75, n̄ = 1, ε1 = 1e-005, ε2 = 1e-005 0.9 0.8 0.7 Private communication rate Private communication rate 0.22 0.2 0.18 0.16 Normal approximation BPSK asymptotic Private capacity 0.14 0.6 0.5 0.4 0.3 0.2 Normal approximation BPSK asymptotic Private capacity 0.1 0.12 4 10 5 10 6 10 Number of channel uses 7 10 0 2 10 8 10 3 4 10 (a)   η = 0.55, n̄ = 0.1, ε1 = 1e-005, ε2 = 1e-005 7 10   0.18 0.04 0.16 0.035 0.14 0.03 0.025 0.02 0.015 Normal approximation BPSK asymptotic Private capacity 0.01 0.12 Normal approximation BPSK asymptotic Private capacity 0.1 0.08 0.06 0.04 0.005 0 4 10 6 10 (b) Private communication rate Private communication rate 0.045 5 10 10 Number of channel uses 0.02 5 10 6 10 Number of channel uses 7 10 0 4 10 8 10 (c) 5 10 6 10 Number of channel uses 7 10 8 10 (d) Figure 1: The figures plot the normal approximation for non-asymptotic BPSK private communication (using (4.90)), the asymptotic limit for BPSK, and the asymptotic energy-constrained private capacity for various values of the channel transmissivity η, the mean photon number n̄, ε1 , and ε2 . 25 A Proof of convex-split lemma For the sake of completeness, this appendix features a proof of Lemma 2. Let ρeAB be the optimizer for √ ε−η λ∗ ≡ Iemax (B; A)ρ = inf (A.1) Dmax (ρ0AB kρA ⊗ ρ0B ). √ ρ0AB : P (ρ0AB ,ρAB )≤ ε−η We take ρeB as the marginal of ρeAB . We define the following state, which we think of as an approximation to τA1 ···AK B : τeA1 ···AK B K 1 X ≡ ρA1 ⊗ · · · ⊗ ρAk−1 ⊗ ρeAk B ⊗ ρAk+1 ⊗ · · · ⊗ ρAK . K (A.2) k=1 √ In fact, it is a good approximation if ε − η is small: Consider from joint concavity of the root fidelity that √ F (e τA1 ···AK B , τA1 ···AK B ) ≥ K 1 X√ F (ρA1 ⊗ · · · ⊗ ρAk−1 ⊗ ρeAk B ⊗ ρAk+1 ⊗ · · · ⊗ ρAK , K k=1 ρA1 ⊗ · · · ⊗ ρAk−1 ⊗ ρAk B ⊗ ρAk+1 ⊗ · · · ⊗ ρAK ) (A.3) K 1 X√ F (e ρAk B , ρAk B ) = K k=1 √ = F (e ρAB , ρAB ), (A.4) (A.5) which in turn implies that F (e τA1 ···AK B , τA1 ···AK B ) ≥ F (e ρAB , ρAB ). (A.6) So the inequality in (A.6), the definition of the purified distance, and the fact that P (ρAB , ρeAB ) ≤ √ ε − η imply that √ (A.7) P (e τA1 ···AK B , τA1 ···AK B ) ≤ ε − η. P Let ω = y pY (y)ω y , for pY a probability distribution and {ω y }y a set of states. Then the following property holds for quantum relative entropy and a state κ such that supp(ω) ⊆ supp(κ): X D(ωkκ) = pY (y) [D(ω y kκ) − D(ω y kω)] . (A.8) y Applying (A.8), it follows that D(e τA1 ···AK B kρA1 ⊗ · · · ⊗ ρAK ⊗ ρeB ) K 1 X = D(ρA1 ⊗ · · · ⊗ ρAk−1 ⊗ ρAk B ⊗ ρAk+1 ⊗ · · · ⊗ ρAK kρA1 ⊗ · · · ⊗ ρAK ⊗ ρeB ) K k=1 − K 1 X D(ρA1 ⊗ · · · ⊗ ρAk−1 ⊗ ρAk B ⊗ ρAk+1 ⊗ · · · ⊗ ρAK ke τA1 ···AK B ). (A.9) K k=1 26 The first term in (A.9) on the right-hand side of the equality simplifies as K 1 X D(ρA1 ⊗ · · · ⊗ ρAk−1 ⊗ ρAk B ⊗ ρAk+1 ⊗ · · · ⊗ ρAK kρA1 ⊗ · · · ⊗ ρAK ⊗ ρeB ) K k=1 K 1 X D(ρAk B kρAk ⊗ ρeB ) = K (A.10) = D(ρAB kρA ⊗ ρeB ). (A.11) k=1 We now lower bound the last term in (A.9). Consider that a partial trace over systems A1 , . . . , Ak−1 , Ak+1 , . . . , AK gives τA1 ···AK B ) D(ρA1 ⊗ · · · ⊗ ρAk−1 ⊗ ρAk B ⊗ ρAk+1 ⊗ · · · ⊗ ρAK ke ≥ D(ρAk B ke τAk B ) = D(ρAB k [1/K] ρeAB + [1 − 1/K] ρA ⊗ ρeB ), (A.12) where the equality follows because τeAk B = [1/K] ρeAB + [1 − 1/K] ρA ⊗ ρeB . Thus, averaging the inequality in (A.12) over k implies that K 1 X D(ρA1 ⊗ · · · ⊗ ρAk−1 ⊗ ρAk B ⊗ ρAk+1 ⊗ · · · ⊗ ρAK ke τA1 ···AK B ) K k=1 ≥ D(ρAB k [1/K] ρeAB + [1 − 1/K] ρA ⊗ ρeB ), (A.13) Putting together (A.9), (A.11), and (A.13), we find that D(e τA1 ···AK B kρA1 ⊗ · · · ⊗ ρAK ⊗ ρB ) ≤ D(ρAB kρA ⊗ ρeB ) − D(ρAB k [1/K] ρeAB + [1 − 1/K] ρA ⊗ ρeB ) (A.14) By the definition of λ∗ in (A.1), we have that ∗ ρeAB ≤ 2λ ρA ⊗ ρeB , (A.15) h i ∗ [1/K] ρeAB + [1 − 1/K] ρA ⊗ ρeB ≤ 1 + (2λ − 1)/K ρA ⊗ ρeB . (A.16) which means that An important property of quantum relative entropy is that D(ωkτ ) ≥ D(ωkτ 0 ) if τ ≤ τ 0 . Applying it to (A.16) and the right-hand side of (A.14), we get that D(ρAB kρA ⊗ ρeB ) − D(ρAB k [1/K] ρeAB + [1 − 1/K] ρA ⊗ ρeB ) h i ∗ ≤ D(ρAB kρA ⊗ ρeB ) − D(ρAB k 1 + (2λ − 1)/K ρA ⊗ ρeB ) h i ∗ = D(ρAB kρA ⊗ ρeB ) − D(ρAB kρA ⊗ ρeB ) + log2 1 + (2λ − 1)/K h i ∗ = log2 1 + (2λ − 1)/K . 27 (A.17) (A.18) (A.19) Then the well known inequality D(ωkτ ) ≥ − log2 F (ω, τ ), (A.14), and (A.17)–(A.19) imply that h i ∗ − log2 F (e τA1 ···AK B , ρA1 ⊗ · · · ⊗ ρAK ⊗ ρeB ) ≤ log2 1 + (2λ − 1)/K , (A.20) which in turn implies that F (e τA1 ···AK B , ρA1 ⊗ · · · ⊗ ρAK ⊗ ρeB ) ≥ 1 1+ 2λ∗ −1 K ∗ ∗ 2λ − 1 2λ =1− ≥ 1 − . ∗ K K + 2λ − 1 (A.21) So if we pick K such that log2 K = inf √ ρ0AB : P (ρ0AB ,ρAB )≤ ε−η Dmax (ρ0AB kρA ⊗ ρ0B )   1 , + 2 log2 η (A.22) then we are guaranteed that P (e τA1 ···AK B , ρA1 ⊗ · · · ⊗ ρAK ⊗ ρeB ) ≤ η. (A.23) By the triangle inequality for the purified distance, we then get that P (τA1 ···AK B , ρA1 ⊗ · · · ⊗ ρAK ⊗ ρeB ) ≤ P (τA1 ···AK B , τeA1 ···AK B ) + P (e τA1 ···AK B , ρA1 ⊗ · · · ⊗ ρAK ⊗ ρeB )  √ √ ε − η + η = ε. ≤ (A.24) (A.25) This concludes the proof. References [ADJ17] Anurag Anshu, Vamsi Krishna Devabathini, and Rahul Jain. Quantum message compression with applications. February 2017. arXiv:1410.3031v4. [AJW17] Anurag Anshu, Rahul Jain, and Naqueeb Ahmad Warsi. One shot entanglement assisted classical and quantum communication over noisy quantum channels: A hypothesis testing and convex split approach. February 2017. arXiv:1702.01940. [BB84] Charles H. Bennett and Gilles Brassard. Quantum cryptography: Public key distribution and coin tossing. In Proceedings of IEEE International Conference on Computers Systems and Signal Processing, pages 175–179, Bangalore, India, December 1984. [BD10] Francesco Buscemi and Nilanjana Datta. The quantum capacity of channels with arbitrarily correlated noise. IEEE Transactions on Information Theory, 56(3):1447–1460, March 2010. arXiv:0902.0158. [BDL16] Salman Beigi, Nilanjana Datta, and Felix Leditzky. Decoding quantum information via the Petz recovery map. Journal of Mathematical Physics, 57(8):082203, August 2016. arXiv:1504.04449. [CK78] Imre Csiszár and Janos Körner. Broadcast channels with confidential messages. IEEE Transactions on Information Theory, 24(3):339–348, May 1978. 28 [CWY04] Ning Cai, Andreas Winter, and Raymond W. Yeung. Quantum privacy and quantum wiretap channels. Problems of Information Transmission, 40(4):318–336, October 2004. [Dat09] Nilanjana Datta. Min- and max-relative entropies and a new entanglement monotone. IEEE Transactions on Information Theory, 55(6):2816–2826, June 2009. arXiv:0803.2770. [Dev05] Igor Devetak. The private classical capacity and quantum capacity of a quantum channel. IEEE Transactions on Information Theory, 51(1):44–55, January 2005. arXiv:quant-ph/0304127. [DHO16] Nilanjana Datta, Min-Hsiu Hsieh, and Jonathan Oppenheim. An upper bound on the second order asymptotic expansion for the quantum communication cost of state redistribution. Journal of Mathematical Physics, 57(5):052203, May 2016. arXiv:1409.4352. [DL15] Nilanjana Datta and Felix Leditzky. Second-order asymptotics for source coding, dense coding, and pure-state entanglement conversions. IEEE Transactions on Information Theory, 61(1):582–608, January 2015. arXiv:1403.2543. [DTW16] Nilanjana Datta, Marco Tomamichel, and Mark M. Wilde. On the second-order asymptotics for entanglement-assisted communication. Quantum Information Processing, 15(6):2569–2591, June 2016. arXiv:1405.1797. [GGL+ 04] Vittorio Giovannetti, Saikat Guha, Seth Lloyd, Lorenzo Maccone, Jeffrey H. Shapiro, and Horace P. Yuen. Classical capacity of the lossy bosonic channel: The exact solution. Physical Review Letters, 92(2):027902, January 2004. arXiv:quant-ph/0308012. [GLN05] Alexei Gilchrist, Nathan K. Langford, and Michael A. Nielsen. Distance measures to compare real and ideal quantum processes. Physical Review A, 71(6):062310, June 2005. arXiv:quant-ph/0408063. [GW12] Saikat Guha and Mark M. Wilde. Polar coding to achieve the Holevo capacity of a pure-loss optical channel. Proceedings of the 2012 IEEE International Symposium on Information Theory, pages 546–550, 2012. arXiv:1202.0533. [Hay06] Masahito Hayashi. General nonasymptotic and asymptotic formulas in channel resolvability and identification capacity and their application to the wiretap channel. IEEE Transactions on Information Theory, 52(4):1562–1575, April 2006. arXiv:cs/0503088. [Hay13] Masahito Hayashi. Tight exponential analysis of universally composable privacy amplification and its applications. IEEE Transactions on Information Theory, 59(11):7728– 7746, November 2013. arXiv:1010.1358. [HHHO09] Karol Horodecki, Michal Horodecki, Pawel Horodecki, and Jonathan Oppenheim. General paradigm for distilling classical key from quantum states. IEEE Transactions on Information Theory, 55(4):1898–1929, April 2009. arXiv:quant-ph/0506189. [HN03] Masahito Hayashi and Hiroshi Nagaoka. General formulas for capacity of classicalquantum channels. IEEE Transactions on Information Theory, 49(7):1753–1768, July 2003. arXiv:quant-ph/0206186. 29 [Li14] Ke Li. Second order asymptotics for quantum hypothesis testing. Annals of Statistics, 42(1):171–189, February 2014. arXiv:1208.1400. [PPV10] Yury Polyanskiy, H. Vincent Poor, and Sergio Verdú. Channel coding rate in the finite blocklength regime. IEEE Transactions on Information Theory, 56(5):2307–2359, May 2010. [Ras02] Alexey E. Rastegin. Relative error of state-dependent cloning. Physical Review A, 66(4):042304, October 2002. [Ras03] Alexey E. Rastegin. A lower bound on the relative error of mixed-state cloning and related operations. Journal of Optics B: Quantum and Semiclassical Optics, 5(6):S647, December 2003. arXiv:quant-ph/0208159. [Ras06] Alexey E. Rastegin. Sine distance for quantum states. February 2006. arXiv:quantph/0602112. [RR11] Joseph M. Renes and Renato Renner. Noisy channel coding via privacy amplification and information reconciliation. IEEE Transactions on Information Theory, 57(11):7377–7385, Nov 2011. [Ser17] Alessio Serafini. Quantum Continuous Variables. CRC Press, 2017. [Tan12] Vincent Y. F. Tan. Achievable second-order coding rates for the wiretap channel. In 2012 IEEE International Conference on Communication Systems (ICCS), pages 65–69, November 2012. [TB16] Mehrdad Tahmasbi and Matthieu R. Bloch. Second order asymptotics for degraded wiretap channels: How good are existing codes? In 2016 54th Annual Allerton Conference on Communication, Control, and Computing (Allerton), pages 830–837, September 2016. [TBR16] Marco Tomamichel, Mario Berta, and Joseph M. Renes. Quantum coding with finite resources. Nature Communications, 7:11419, May 2016. arXiv:1504.04617. [TCR09] Marco Tomamichel, Roger Colbeck, and Renato Renner. A fully quantum asymptotic equipartition property. IEEE Transactions on Information Theory, 55(12):5840–5847, December 2009. arXiv:0811.1221. [TH13] Marco Tomamichel and Masahito Hayashi. A hierarchy of information quantities for finite block length analysis of quantum tasks. IEEE Transactions on Information Theory, 59(11):7693–7710, November 2013. arXiv:1208.1478. [TT15] Marco Tomamichel and Vincent Y. F. Tan. Second-order asymptotics for the classical capacity of image-additive quantum channels. Communications in Mathematical Physics, 338(1):103–137, August 2015. arXiv:1308.6503. [Uhl76] Armin Uhlmann. The “transition probability” in the state space of a *-algebra. Reports on Mathematical Physics, 9(2):273–279, 1976. 30 [Ume62] Hisaharu Umegaki. Conditional expectations in an operator algebra IV (entropy and information). Kodai Mathematical Seminar Reports, 14(2):59–85, 1962. [War15] Naqueeb Ahmad Warsi. One-shot bounds in classical and quantum information theory. PhD thesis, Tata Institute of Fundamental Research, Mumbai, India, December 2015. Not publicly available; communicated by email on March 5, 2017. [Wil16] Mark M. Wilde. From Classical to Quantum Shannon Theory. arXiv:1106.1445v7. [WQ16] Mark M. Wilde and Haoyu Qi. Energy-constrained private and quantum capacities of quantum channels. September 2016. arXiv:1609.01997. [WR12] Ligong Wang and Renato Renner. One-shot classical-quantum capacity and hypothesis testing. Physical Review Letters, 108(20):200501, May 2012. arXiv:1007.5456. [WTB17] Mark M. Wilde, Marco Tomamichel, and Mario Berta. Converse bounds for private communication over quantum channels. IEEE Transactions on Information Theory, 63(3):1792–1817, March 2017. arXiv:1602.08898. [Wyn75] Aaron D. Wyner. The wire-tap channel. Bell System Technical Journal, 54(8):1355– 1387, October 1975. [YAG13] Mohammad Hossein Yassaee, Mohammad Reza Aref, and Amin Gohari. Nonasymptotic output statistics of random binning and its applications. In 2013 IEEE International Symposium on Information Theory, pages 1849–1853, July 2013. arXiv:1303.0695. [YSP16] Wei Yang, Rafael F. Schaefer, and H. Vincent Poor. Finite-blocklength bounds for wiretap channels. In 2016 IEEE International Symposium on Information Theory (ISIT), pages 3087–3091, July 2016. arXiv:1601.06055. 31 March 2016.
7cs.IT
Web-Based Implementation of Travelling Salesperson Problem Using Genetic Algorithm A Comparative Study of Python, PHP, and Ruby Aryo Pinandito1, Novanto Yudistira2, Fajar Pradana3 Program Teknologi Informasi dan Ilmu Komputer1 Universitas Brawijaya Malang, Indonesia aryo@ub.ac.id1, yudistira@ub.ac.id2, fajar.p@ub.ac.id3 Abstract—The world is connected through the Internet. As the abundance of Internet users connected into the Web and the popularity of cloud computing research, the need of Artificial Intelligence (AI) is demanding. In this research, Genetic Algorithm (GA) as AI optimization method through natural selection and genetic evolution is utilized. There are many applications of GA such as web mining, load balancing, routing, and scheduling or web service selection. Hence, it is a challenging task to discover whether the code mainly server side and web based language technology affects the performance of GA. Travelling Salesperson Problem (TSP) as Non Polynomial-hard (NP-hard) problem is provided to be a problem domain to be solved by GA. While many scientists prefer Python in GA implementation, another popular high-level interpreter programming language such as PHP (PHP Hypertext Preprocessor) and Ruby were benchmarked. Line of codes, file sizes, and performances based on GA implementation and runtime were found varies among these programming languages. Based on the result, the use of Ruby in GA implementation is recommended. Keywords—TSP; Genetic Algorithm; web-programming language I. INTRODUCTION AI refers to intelligent behaviour unexceptionally in webbased application. A combination of the web application and AI has been becoming the future trends of web-based application [1]. Moreover, the trend of cloud computing has already risen [2]. There are many web-based applications use GA for various purposes. GA as a well known algorithm that use heuristic approach to gather fully optimized solutions, has been used widely in various web applications such as search engine and web mining application [3]. GA has become the effective algorithm in terms of pattern recognition. Recently, it is found that new trend like social graph technology with optimization is promising [4]. From the scientific point of view, data processing and analysis scripts often time consuming and require many hours to be computed on a computer device, so the iteration process along with its debugging process will be longer [5]. Moreover, scientists have a different focus on his work compared to professional programmers. They are keen on methodology rather than the tools they are utilizing. Faster completion of programming task is surely dreamed by many scientists or even beginner programmers who have a This research supported by Program Teknologi Informasi dan Ilmu Komputer (PTIIK), Universitas Brawijaya. consideration of being effective. Naturally, they will choose that kind of Programming Language (PL). It is also based on a psychological review as narrated in [5]. To catch up with the rapidly progressive research in AI, speed and simplicity become necessary in AI programming. Therefore it is needed to give scientists PLs that could quickly iterate while preserve the tidiness and simplicity so that it can be easily used. Even though compiled PL is faster at run time than interpreter PL, it is not as simple as recent emerging PL such as Python [6], PHP [7] and Ruby [8]. The advantages of using Python basically lie in its ease of use, interpreted and object oriented programming language that can bridge many scientists need without loosing the sense of object oriented style. However, the effectiveness of PL can be measured by how many lines of code should be written or how much syntaxes should be initiated to implement the same GA. Another drawback of using compiled PL is by looking at the denial of service type of attacks [9]. II. COMPUTATIONAL There are many researches use GA for benchmarking purposes [10]. This paper benchmarks interpreter PL in supporting AI. Problem domain to be solved by GA in this case is Travelling Salesperson Problem (TSP) in which has become a benchmark for several heuristics in GA performance test [11]. The use of TSP varies based on its domain problems. TSP is an NP-hard problem which solution is optimized by GA based on natural selections and genetic evolutions to solve NP complete domain problems. At TSP, it is the idea of finding a route of a given number of cities by visiting each city exactly once and return to the starting city where the length of the route is minimized. A path that visits every city and returns to the starting city creating a closed circuit is called a route. The simplest and direct method to solve TSP of any number of cities is by enumerating every possible route, calculating every route length, and choosing one route with the shortest length. It is possible that every city may become the starting point of the route and one route may have the same length regardless of the direction of the route taken. Logically, the problem can be set up by using integer n>0 and the distance between every pair of n cities and represented by an n×n matrix [11]. Each possible route can be represented as a permutation of n, where n is the number of cities, thus the number of possible routes is a factorial of n (n!). It turns out to be more computationally burdened and difficult to enumerate and find the length of every route as n may become larger in polynomial complexity. Hence, TSP needs an algorithm that able to find a route that produces the minimum length without having to enumerate all possible routes from cities given. Genetic Algorithm (GA) is basically a search algorithm that is used to find solutions of evolution in such search space to solve problems such as TSP. To this end, a solution is so called an individual while a set of solutions is normally called as population. Individuals are evolving through many generations in populations. The important thing that must be initiated is the genetic representation of the solution domain and the fitness function in order to evaluate the quality of such individuals [12]. Moreover, selection is a stochastic function. It selects individuals based on the fitness value of a generated population, and yields so called the best-selected individual. Even though GA that utilizes crossover and mutation steps does not define the end of the iteration, every generation has the probability to obtain better individuals than its ancestors in terms of their fitness cost. It has been a state-of-the-art that solving the TSP problem using GA is optimal but it depends on crossover and mutation method used in this research. A. Crossover Crossover is the step to produce various chromosomes (individuals), which is chosen from the chromosomes in previous generation. In this research, selecting two best chromosomes that have the best fitness cost to crossover does the crossover steps. Then, randomly picking a gene or point from both chromosomes, and finally pick the rest of remaining genes randomly until all unique genes has been picked up. A new population later will be generated from previously selected chromosomes. Therefore, recombination process of two parent individuals will generate new chromosomes. An example in producing an individual from two individuals as parents, which represented using “a” and “b”, by doing crossover, is explained below: a = ABCDEFGH b = EFGHABCD Each gene of a new individual was taken from both parent genes. The crossover process is done until it generates a new individual “c” like the following example: c = AEBCGFDH B. Mutation Mutation is an extension of the crossover process that executed by such a probability rate. It is used to avoid a local optimum. If the mating process only depends on crossover, it probably yields to a local optimum because the chance to approach the fitness value is relatively high. Mutation process is given to cover the problem in such a way to reach global optimum solution. The mutation method used in this research was done by choosing a gene in such an index and switch the pointed gene to be the first index along with the rest of the genes that follows in the sequence. For example, if an offspring “c” produced by the crossover process is “ABCDEFGH”, and the pointed gene for mutation is E, then the resulting mutation offspring is “EFGHABCD”. III. INTERPRETED LANGUAGES PLs are related to programmable and dynamic environment in which components were bound together at a high level [13]. The emergence of compiled languages such as Java or C has led to be World Wide Web (WWW) transformation [9]. However, these PL leave drawbacks such as parsed codes produced by compilers are stored in scattered files. Hence, in a compiled environment, some of those files must be included such as the instruction codes, parsed codes, header files, and the executable or linked codes altogether. Nonetheless, the significant distinction of compilers and interpreters is that compilers parse and execute in different actions sequentially. Though its speed and standalone executable existence of compiled PL, there is an increasing complexity in its process. Nevertheless, many recent compilers are able to compile and execute the code directly in memory, giving such an interpreted language (IL) fashion [14]. The use of interpreted PL is beneficial since in an interpreted environment every instruction of PL is executed right away after being parsed. This has eased the programmers since the result can be presented quickly. Moreover, the interpreted code can be run without compilers and linkers to produce executable codes. However, there are disadvantages related to IL such as its poor performance, no executable program, and interpreter dependence compared to a compiled PL [14]. After all, ILs such as PHP, Python, and Ruby were merely made by hobbyists without any long-term research goal such as Lisp but they are widely applicable. A. Interpreter Support for GA There are many GA implementations built into Python such as pyGA. The exact result of effectiveness between Python, PHP, and Ruby in GA implementation is still a domain of interest to be explored. GA, despite of its pros and cons, is quite easy to be implemented, but yields into a very slow process in its usage to solve such problems. IV. METHODOLOGY TSP based GA in this research is implemented into three commonly used server-side object oriented programming language and without any frameworks. They are Python, PHP, and Ruby. All of GA codes that represent each PL are written based on the given pseudo code. They were implemented using the same variable names, methods, and initialization logic. During implementation, they were tested using one data source and the same parameter values for all PL. GA codes of each PL are implemented as close as possible. If any parts of pseudo code are implemented on one PL using multiple methods, functions, or variables, then the other PL had to be implemented in the same manner. Keeping the code to be as close as possible supposedly yields to objective measurement results. One of many important functions used in GA is a random number generator. In GA, random number generator functions utilized to generate a random number in order to compensate the probability of doing a crossover, copy, or mutate the parents. The random number generator is implemented using a Pseudo-Random Number Generator (PRNG) function. PRNG is a random number generator function in which when it was given the same seed number, it will always return the same random value. This technique is used to ensure that all programs will go through the same method and loop inside the program when run under the same circumstances, thus giving the same result. The PRNG function used in this research is implemented using a separate script that is run by a system call by each of implemented PL. In performance measurement of implemented PL, a small modification was added to the scripts by adding current time or micro time function at several points in code while taking account into current generation best fitness cost value. Before carrying out any measurement values, testing units were made using a specified value and data to ensure all implemented scripts are using the same seed number and random values, therefore all implemented PL will mate the equal parents and generating the same candidate population in every generation. They should return the same best individual in the same generation at the end of script execution. The scripts were run and measured on a MacBook Pro computer running on Mac OS X 10.8.2, 2.5 GHz Intel Core i5 processor, 8 GB 1600 MHz DDR3 memory, and Intel HD 4000 graphics with 512 MB shared-memory. The version of Python, Ruby, and PHP interpreter used in measurement processes are 2.7.3, 1.9.3, and 5.3.15 respectively. The main objective of this paper is to automatically infer more precise bounds on execution times and best fitness that depends on input data sizes of the three different PL. Thus, a recommendation to a widely used server-side PL in GA implementation is given. A. Genetic Algorithm Pseudo Code for TSP TABLE I shows how GA can solve TSP. It will be written in Python, PHP, and Ruby. As of the initial population, individuals are generated from a Comma Separated Value (CSV) file that contains names of cities along with its x and y coordinates. TABLE I. GENETIC ALGORITHM PSEUDO CODE GA Pseudo Code class City function initialize (name, x, y) Initialize name of city along with its coordinate in x and y class Individual function initialize (route) Initialization of an individual which consists of cities or nodes function makeChromosome (file) Generate an individual chromosomes from a file function evaluate Calculate the length of given population (a set of cities) using Euclid's distance formula function crossover (other) Do a recombination to return a new offspring from given spouse class Environment function initialize Initialization to population data, population size, maximum number of generations, crossover rate, mutation rate, and optimum number of generation related to the best fitness cost convergence value function makePopulation Create an initial population consists of two parents, from file (as parent A), other parent is generated from shuffled parent A function evaluate Sorts all individual based on the its calculated length value, starting from the least length (best) until the largest individual in current population. Do getBestIndividual function getBestIndividual if the best length obtained so far is less than the best individual in population obtained from crossover then the best fitness cost remains unchanged else the best fitness cost obtained is updated from the first individual order of population in the current crossover’s offspring population. function run while the goal is not achieved Do a generation step Increase generation number by 1 function goal if current generation reached maximum generation or current generation reached optimum (when current generation minus best individual generation is larger than optimum number given) then the goal has been achieved otherwise continue iteration. function step Do a crossover Evaluate fitness costs of all individual in the current population function crossover Initialize candidate population Select two best parent candidates (parent A and parent B) from current population. While candidate population is still less than given size, do randomise crossover rate if in crossover rate then offspring = crossover parent A with parent B else offspring = copy parent A randomise mutation rate if in mutation rate then offspring = mutate current offspring evaluate offspring's fitness cost if offspring not exists in candidate population then add offspring (individual) into candidate population Candidate population become the new population function mutate (individual) Mutating individual in the manner of switching half of given individual orderly Run GA environment with parameters: CSV file containing population data, number of population, number of maximum generation, crossover rate, mutation rate, and optimum best generation. B. PL Implementation of GA Pseudo Code GA pseudo code used to solve TSP in this research was implemented in Python, PHP, and Ruby. Every method and variables are unit-tested, ensuring they have the same results and values across all implementations of pseudo-code given. The codes are utilizing the same population data. It is impossible to implement methods and variables in the exact ways due to the different natures of programming style of each PL. However, all implemented codes of methods and variables across all PL are ensured to behave the same and having the same values under the same GA environment variables and population data. C. Random Number Generation As previously mentioned, the random number generator such as PRNG is used in GA are implemented using a separate code. It is called by a system call function from the implemented PL. therefore all implemented scripts will have the same random number performance and value under the same circumstances. The PRNG code is implemented in Ruby because of its known good performance [15] and it is shown in TABLE II. Native random number generator functions across different PL behave differently. Separation of PRNG code from main script is required to ensure all PL are using the same random number during running time and therefore the execution time measurement would be objective. In real world GA implementation, the use of native random function is recommended. This research proved that the use of system call causes bottleneck in program execution. TABLE II. PRNG IMPLEMENTATION IN RUBY PRNG Code Implementation in Ruby if(ARGV.length == 2) seed = ARGV[0].to_i max = ARGV[1].to_i srand(seed) if(ARGV[1].to_i == 1) puts rand else puts rand(ARGV[1].to_i) end else puts 0 end. D. Seed Number Generation The seed number, which is used to generate random values, is incremented by one (+1 from the previous seed value) before calling the PRNG script. The seed itself implemented as a global variable, therefore its value will always be available before it is fed to the PRNG and its value will be maintained during runtime. E. Data In this experiment, genome data for an individual that used in unit tests and measurements are shown on TABLE III. They are stored in a CSV file as a plain text. Values stored on each line in a CSV file consist of the name of cities along with their coordinates in X and Y-axis. The file is read during initialization of GA environment and its values are used as population’s initial genome data. TABLE III. INITIAL POPULATIONS OF GNOME DATA No City Name X Y 1 Balikpapan 5 4.2 2 Malang 9.2 1.1 3 Jayapura 16.4 8.2 4 Manado 10.3 9.7 5 Bandung 6 1.3 6 Banjarmasin 5 3.1 7 Pontianak 5.3 5.2 8 Jakarta 5.3 2.3 9 Medan 2.1 10.6 10 Makassar 10 4 F. PL Execution Time Measurement Workarounds have to be used in order to do a portable time measurement where high-resolution timing is difficult or im- possible to achieve. Synthetic benchmark approach were followed, which on purpose repeatedly execute the instructions under estimation for a large enough time, and later averaging the total execution time by the number of times it is being run. Generally, it is not possible to run a single instruction repeatedly within the abstract machine, since the resulting sequence would not be legal and may "break" the abstract machine, run out of memory, etc. Therefore, more complex sequences of instructions must be constructed and be repeated instead. As of previous measurement research conducted in the case of 0/1 Knapsack problem [16] were measured by using each PL’s native timing function. The execution time measurements in our TSP problem were also doing so. In getting program execution time, the difference between the start time and end time of script execution is calculated. These measurements are done several times under the same environment circumstances on all PL. Each measurement is done with different number of population data from CSV file. Program execution times are measured using five, six, seven, eight, nine, and ten cities in consecutive ways. GA environmental parameters were set to 100 maximum generations, 5 populations within each generation, with a 90% crossover rate, 1% mutation rate, and 20 generations limit of best fitness cost as a GA convergence termination limit. Each GA environment is measured 10 times, and then the average values and their standard deviations are estimated. V. RESULT AND ANALYSIS Implementation of GA pseudo code provided is resulting in Python, PHP, and Ruby codes. Python, PHP, and Ruby codes were implemented in 237, 280, and, 302 lines of code respectively. Python, PHP, and Ruby file size are 7771, 6786, and 5703 bytes respectively. The shortest line of codes is Python because of Python scripting nature does not require closing tags on its method, function, or loop implementation as in PHP and Ruby. But when it comes to code file size, Python consumes more bytes to implement. Ruby programming style characteristic is shorter and simpler compared to the other PL, thus resulting the smallest file size on the implementation of GA. The results of program execution measurement in this research are shown in TABLE IV. Python was used as the basis of performance measurement because it is the most widely used PL for research purposes [17]. Therefore we compare the execution time of all PL to Python. When it comes to the Web environment, as of research conducted by Jafar et al. [18], PHP outperform Python. Based on last seed, best fitness cost, and best generation measurement results in TABLE IV we can infer that all of the tests returning the same best individual on the same generation for the same number of cities. Therefore proving that all PL executions and their flow of run are exactly the same. During tests, Ruby proved to outperform Python and PHP in execution time of GA. Ruby’s performance improvements vary from 6,5% to 9,99% while PHP performance are 0,22% to 6,09% slower over Python. TABLE IV. MEASUREMENT RESULT 5 PHP 43,43 41,85 42,44 0,54 Coefficient of Variant (%) 1,27 11 2516 Best Fitness Cost (Length) 30,305 5 Python 43,00 41,84 42,35 0,37 0,88 11 2516 30,305 - 5 Ruby 38,65 37,68 38,12 0,36 0,93 11 2516 30,305 9,99 6 PHP 38,44 36,00 37,18 0,84 2,27 7 2127 30,397 -5,53 6 Python 35,73 34,94 35,23 0,26 0,74 7 2127 30,397 - 6 Ruby 32,95 31,90 32,55 0,34 1,04 7 2127 30,397 7,61 7 PHP 47,91 45,85 46,79 0,73 1,55 10 2735 41,135 -1,56 7 Python 47,11 45,36 46,07 0,57 1,23 10 2735 41,135 - 7 Ruby 43,81 41,20 42,58 0,80 1,88 10 2735 41,135 7,57 8 PHP 62,23 58,61 60,14 1,18 1,97 9 3395 34,020 -6,09 8 Python 57,25 56,21 56,69 0,36 0,63 9 3395 34,020 - 8 Ruby 53,57 52,10 53,00 0,52 0,98 9 3395 34,020 6,50 9 PHP 51,16 49,49 50,06 0,58 1,16 4 2891 49,062 -3,56 9 Python 49,44 47,75 48,34 0,50 1,04 4 2891 49,062 - 9 Ruby 44,67 43,24 43,87 0,44 1,01 4 2891 49,062 9,25 10 PHP 72,97 69,72 71,67 1,15 1,61 9 4197 51,881 -2,63 10 Python 71,66 68,56 69,84 0,85 1,21 9 4197 51,881 - 10 Ruby 65,19 62,61 63,99 0,93 1,46 9 4197 51,881 8,37 Number of Cities PL Maximum (ms) Minimum (ms) Average (ms) Standard Deviation Fig. 1. Program execution time in milliseconds by number of cities In TSP, expected solution of fitness cost is the minimum, the smaller the value the result will be better. Execution time grows longer when the number of cities in an individual increase as shown in Fig. 1. The relation between fitness cost (total distance on selected routes) and number of cities in an individual is shown in Fig. 2. Because of all PL were implemented in the same way, the resulting fitness cost value for the same number of cities will be the same regardless the PL used. Regression analysis using Analysis of Variance (ANOVA) was conducted to the measurement result shown in TABLE IV. From the regression analysis result, we can infer that: • Script execution times are highly correlated to data sizes on all implemented PL under the same GA environment. The more cities included in an individual, which mean the higher the number of inputs, the longer program execution time would be. Best Generation Last Seed Performance over Python (%) -0,22 Fig. 2. Fitness cost (route’s total distance) by number of cities • It is proved that the fitness cost (route length) is highly correlated to data size on all implemented PL under the same GA environment. The higher the number of inputs (cities included in an individual), the larger the fitness cost would be. An individual which has larger fitness cost is worse. VI. CONCLUSION Based on measurement and analysis process, program execution time and best fitness cost are highly relied on data size (the number of cities) in all PL. The larger the data size the longer execution time will be and the worse the outcome of GA as TSP solution. This research GA pseudo code implementation shows that Ruby code has the smallest file size compared to Python and PHP, but Python has the least line of codes. In testing of the overall program execution time, Ruby is faster than Python and PHP. Therefore, the usage of Ruby is recommended to gain performance in implementation of GA for TSP in a web environment over Python and PHP. ACKNOWLEDGMENT The authors would like to acknowledge the assistance of Program Teknologi Informasi dan Ilmu Komputer (PTIIK) and Universitas Brawijaya (UB) for their research facilities and financial support. The authors also acknowledge for the assistance of colleagues in PTIIK UB for their great assistance in improving the manuscript. REFERENCES [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] E. Andaur, S. Rios, P. Roman, and J. Velasquez. "Best web site structure for users based on a genetic algorithm approach, " Department of Industrial Engineering, University of Chile, Santiago, Chile, 2009. F. Ren. "From cloud computing to language engineering, effective computing and advanced intelligence," International Journal of Advanced Intelligence vol. 2, Number 1, pp. 1–14, 2010. B. Minaei-Bidgolu, W. F. Punch III. "Using genetic algorithms for data mining optimization in an educational web-based systems," Michigan State University, 2003. A. Gursel and S.Sen. "Improving search in social networks by agent based mining, " 2009. P. J. Guo and D. Engler. "Toward practical incremental recomputation for scientists: an implementation for python language, " Stanford University, 2010. Python. http://www.python.org. PHP. http://www.php.net Ruby. http://www.ruby-lang.org S. Branigan. "Risk with web programming technologies, " Lucent Technologies, 2000. D. Dunlop, S. Varrette, and Pascal. "On the use of a genetic algorithm in high performance computer benchmark tuning," University of Luxembourg, 2008. A. G. Najera. "TSP: three evolutionary approaches vs. local search," University of Birmingham, 2009. S. Sarmady. "An investigation on genetic algorithm parameters," Universiti Sains Malaysia, 2007. C. Strachey. "Fundamental concepts in programming languages," Higher Order and Symbolic Computation, 13, pp. 11-49, Kluwe Academic Publishers, 2000. J. S. Riley. ”Interpreted vs. Compiled Languages”. Internet: http://www.dsbscience.com/freepubs/start_programming/node6.html November 1, 2008 [August 28,2013] K. Purer. "PHP vs. Python vs. Ruby - the web scripting language shootout," Vienna University of Technology. 2009. Pospichal, "Parallel genetic algorithm solving 0/1 knapsack problem running on The GPU," Brno University of Technology, 2010. H. Koepke. "10 reasons python rocks for research (and a few reasons it doesn’t), " 2010. Jafar, Anderson, and Abdullat. "Comparison of dynamic web content processing language performance under a LAMP architecture," West Texas A&M University Canyon, 2008. View publication stats
6cs.PL
Qualitative Assessment of Recurrent Human Motion Andre Ebert, Michael Till Beck, Andy Mattausch, Lenz Belzner, and Claudia Linnhoff-Popien arXiv:1703.02363v2 [cs.LG] 22 Nov 2017 Mobile and Distributed Systems Group Institute for Computer Science Ludwig-Maximilians-University, Munich, Germany Email: andre.ebert@ifi.lmu.de, michael.beck@ifi.lmu.de, andy.mattausch@ifi.lmu.de, belzner@ifi.lmu.de, linnhoff@ifi.lmu.de Abstract—Smartphone applications designed to track human motion in combination with wearable sensors, e.g., during physical exercising, raised huge attention recently. Commonly, they provide quantitative services, such as personalized training instructions or the counting of distances. But qualitative monitoring and assessment is still missing, e.g., to detect malpositions, to prevent injuries, or to optimize training success. We address this issue by presenting a concept for qualitative as well as generic assessment of recurrent human motion by processing multi-dimensional, continuous time series tracked with motion sensors. Therefore, our segmentation procedure extracts individual events of specific length and we propose expressive features to accomplish a qualitative motion assessment by supervised classification. We verified our approach within a comprehensive study encompassing 27 athletes undertaking different body weight exercises. We are able to recognize six different exercise types with a success rate of 100% and to assess them qualitatively with an average success rate of 99.3%. Keywords—Motion assessment; Activity recognition; Physical exercises; Segmentation I. I NTRODUCTION Regular physical exercising improves an athlete’s health and well-being; sufferings from chronic diseases or even the Alzheimer’s disease are lowered [1]. In that context, mobile phone applications for training support (e.g., running, CrossFit, etc.) became popular. They provide customized workout plans, detailed exercise instructions as well as quantitative and statistical functions. But by providing know-how about challenging exercises without supervision to non-experienced athletes arises new problems. Wrong execution of exercises, malpositions, or the absence of sufficient warming up phases may lead to less training success or even to serious injuries. Especially non-experienced athletes are likely to harm themselves during an unsupevised workout [2]. We believe that a pro-active and automated monitoring reduces such injuries drastically while a training’s success could be improved significantly. Moreover, a generic concept capable of recognizing and assessing various recurrent human motions is also applicable in other areas, e.g., medical observations, gait analysis or optimization of workflows. To address this unsolved issue we previously introduced SensX, which is a distributed sensor system for capturing and processing human motion [3]. We established a paradigm for qualitative analysis of human motion consisting of four fundamental steps (see Figure 1): (1) Detection of a motion event, (2) its Recognition, (3) its qualitative Assessment, and (4) the Characterization of Personal use of this preprint copy is permitted. Republication, redistribution and other uses require the permission of IEEE. This paper was published within the proceedings of the 25th European Signal Processing Conference (EUSIPCO), 2017, Kos, Greece DOI: 10.23919/EUSIPCO.2017.8081218, c 2017 IEEE. Fig. 1: Four fundamental steps of human motion analysis within the logical layer, the hardware layer functions as a sensor and feedback provider, as proposed by [3]. reasons for a specific assessment. Step (1) and (2) were treated within [3], while this paper focuses on step (3) by using the existing SensX architecture as a basis. Thereby, our contributions within this paper are as follows: • We propose a novel concept for qualitative assessment of complex, recurrent human motion. • It covers the extraction of multi-dimensional motion events into segments of individual length. • An expressive feature set as well as a system for supervised classification are selected and implemented. • To validate our concept, we conducted an comprehensive exemplary study with 27 athletes executing more than 7,500 repetitions of six different types of body weight exercises. • We present state-of-the-art results concerning the assessment of human motion as well as for human activity recognition on basis of motion sensor data. II. R ELATED W ORK In the following, we provide a brief overview on related work concerning 1) segmentation, 2) recognition and 3) assessment of human motion. Thereby, we are focusing on complex motion sequences which are described by multiple, coordinated movements conducted by several extremities at the same time (e.g., body weight exercises), instead of more simple activities which have often been subject to activity recognition within previous research (e.g., walking or sitting). 1) Before analysis and assessment of reoccurring events within multi-dimensional time series become feasible, they need to be extracted into segments first. Bulling et al. name (1) sliding windows, (2) energy-based segmentation, (3) restposition based segmentation, and (4) the use of additional sensors or context resources as applicable procedures [4]. Sliding window approaches (1) move a window of static size sequentially across an incoming stream of data and extract the window’s current content for further analysis. E.g., authors of RecoFit and ClimbAX used a 5s sliding window which they moved in discrete steps across a motion data stream [5], [6], [7]. These approaches offer valuable ideas for our segmentation concept. Still, due to the absence of a length adjustment to an events actual duration, they do not cover all of our needs. The actual start and endpoints of short events (e.g., a pushup) are not captured accurately, which leads to noise within an event’s segment (e.g., fragments of preceding or following events). This noise may disturb the qualitative assessment process of a specific event significantly. Energybased solutions (2) perform well for segmentation of long term activities, which are describable by different energy potentials (e.g., sitting, running). We examine individual repetitions of short movements - their energy potential is not diverse enough from each other and is not suitable for segmentation. (3) Restposition based segmentation is also not feasible, for there are no rest positions within a continuous event set. The use of external information sources (4), e.g. GPS, is not suitable for such fine-grained movements targeted by us. Other approaches also facilitated manual segmentation, which is not suitable for great numbers of events or realtime analysis [8]. The review of these procedures led us to the necessity of developing an individualized segmentation process, which considers our requirements concerning fine-grained, dynamic and accurate extraction of complex and multi-dimensional motion events. 2) Quantitative counting of repetitive activities as well as its recognition and classification are well-trodden fields of research, which is why we do not present much work bound to that topic within this paper. E.g., Jiang et al. recognize simple activities like lying, walking, and sitting, while Morris et al. are dealing with more complex exercises [5], [9]. Facilitated techniques are neuronal networks as well as typical classifiers for supervised learning and combinations of both. 3) In contrast to that, qualitative assessment of human motion data was examined only sparsely, yet. Ladha et al. as well as Pansiot et al. assessed the performance of climbers by extracting and analyzing features such as power, control, stability, and speed without examining individual climbing moves [6], [10]. Their work provides valuable information concerning the handling and preprocessing of motion data. Still, it does not allow the assessment of individual movements of specific extremities within a chain of multiple climbing features. Velloso et al. assessed repetitions of recurrent motion by recording five wrongly executed weight-lifting exercises and classified them afterwards by template comparison [11]. Though they were able to classify exercise mistakes with a success rate of 78%, their template-based approach is only able to identify a fixed number of predefined error cases. Thus, it is not suitable for generic assessment of human motion. GymSkill is a system for qualitative evaluation of exercises conducted on a balance board [12]. Exercises are examined and assessed with an individualized Principal Component Analysis, but GymSkill is bound to analysis in combination with a balance board. Therefore, it is also not capable of generic motion analysis. Concluding, we are not aware of a concept which enables qualitative assessment of human motion in a generic way and without being bound to predefined motions or equipment. As a solution, we now present a novel approach for tracking, recognizing and assessing human motion. III. A N APPROACH FOR QUALITATIVE ASSESSMENT OF HUMAN MOTION In the following, we explain our advance for extracting recurring events out of multi-dimensional time series. Afterwards, we describe the preprocessing and selection of expressive features to prepare a qualitative assessment via supervised learning. Data input of our analysis procedure are 30 individual streams of motion data, see [3] for technical details. Therefore, five sensor devices are tracking acceleration and rotation information in X-, Y-, and Z-dimension. Two are fastened on the tracked person’s ankles, two are attached to the wrist, and the fifth is worn on the chest in combination with a processing unit. A. Preprocessing and segmentation To extract individual events out of the incoming multidimensional signal set, we developed a dynamic and multipeak-based segmentation algorithm, which is capable of segmenting heterogeneous sets of motion events individually: each signal in each segment may be of specific length and contains all information about exactly one rotation or acceleration axis of exactly one specific event. All extracted event segments are also of individual temporal length in comparison to each other. To identify individual motion events, we first examine the most meaningful signal vector within a signal set. Typically, this signal contains the highest dynamics and variance within its values and allows a distinct identification of a segment’s S1 start point ts1 and its end point te1 . For that, we are calculating the standard deviation σ of all signals, whereby X defines the current signal, xi is the i-th measured value and µ is the expectancy value: n P (xi − µ)2 p i=1 σ = V ar(X) = n The signal with the highest deviation is taken for further analysis. We assume that every type of motion event can be described by an individual set of local extrema and we use these sets to identify distinct events. Figure 2 depicts the whole segmentation process for a set of bicycle crunches. Within this setting, the acceleration of the ankle sensors along the X-axis proved to provide the most meaningful signal. As depicted in Figure 2-1, signals of individual repetitions contain a high amount of noise as well as unique peaks which are Fig. 2: Step by step procedure of segmenting recurrent motion events of individual length out of a set of bicycle crunches. Fig. 3: Auto-correlated signal of a set of mountain climbers (1) and determination of the ideal cutoff factor cf (2). not representative for a specific class of movements. These peaks may contain information which is critical for assessing a movement in terms of quality, but they are irrelevant for segmentation. That is why we designed and applied an aggressive Butterworth low pass filter to the signal (see Figure 2-2). Thus, all information unnecessary for segmentation is extinguished and only essential periodicities are left. The filter’s cutoff-frequency fc is determined by multiplying the sampling frequency fs with a cutoff factor fc = fs ∗cf , which is essential for the filter’s effect onto the signal. Figure 3-2 shows the results of the empirical determination of ∆cf . It indicates that our sensor setup cf must be within a range of 0.0065-0.025 in order to recognize all individual event occurrences within a set of 20 repetitions. Thereby, a different cf setup is used for each individual exercise. Due to the low pass filtering in combination with the usage of extrema patterns, the identification of the individual duration ∆t of a segment as well as its starting point tsx and its ending point tex (see Figure 2-3) becomes feasible. This is achieved as follows: e.g., a bicycle twist can be described by a set of one local minimum and one local maximum. Other movements may be characterized by differing combinations of multiple local extrema, as depicted by the auto-correlation for a set of mountain climbers in Figure 3-1 (at least two different signal parts are identifiable for this example). Our filtered signal is now scanned sequentially for this pattern. When a new occurrence is detected, a window of the size of the estimated event length is applied to the signal in a first phase. The estimated event length ∆t is derived from the event sets auto-correlation, as depicted in Figure 3-1. But since every repetition is of individual length and content, we need to adjust the segments start and end points individually within a second phase. Precondition for the following is the assumption, that origin and terminus of a repeated motion event is located at the signal’s zero crossing in between the rest periods. Now we check if the segment window encompasses the demanded number and types of extrema. If not, we sequentially add sub segments of a predefined length l, until the relevant extrema pattern is matched. After this matching phase, some fine tuning is undertaken to capture the exact segment ending: if the last element within the segment is a positive value, we wind forward and add single samples until we reach the next zero crossing. Otherwise, if the last element within the segment is a negative value, we wind back to the last zero crossing and remove all values on this way. After determining the individual length of the current segment, we only keep the timestamps of its starting and its endpoint tsx and tex . Subsequently these are used to cut out the specific segment from the slightly smoothed original signals (see Figure 2-4), which still contain all important movement information. Output of this procedure is a quantity S = {S1 , S2 , S3 , Sx } of event segments of differing length, whereby each segment has its exact borders and contains only information of exactly one motion event. B. Feature selection and labeling Commonly, a feature vector within machine learning scenarios consists of a fixed number of features describing one instance. Due to the fact that all of our activity segments are of individual length and consist of 30 individual signals, this issue is challenging. If we use the segmented time series directly for feature set creation, their length would need to be trimmed or interpolated to match the fixed length of a feature vector. Interpolation would result in unwanted artificial noise, trimming could lead to the loss of important information and finally, all preceding efforts to extract each event into a segment of individual length would be worthless. Furthermore, one event of the dataset that we recorded for evaluation (see Section IV) consists of 3455 sample values in average (roughly 155 per signal). Building feature vectors of this length and greater leads to massive computational load during classification. To overcome these challenges were exploited some observations we made during the examination of our dataset: Figure 4 visualizes the standard deviations of the acceleration and rotation signals of 100 randomly selected lunges labeled with quality class 1 (very good) and 100 lunges labeled with quality class 4 (poor). In general, lunges labeled class 1 show a much higher deviation in rotation and acceleration values for the users feet (bottom-left (BL), and bottom-right (BR)), while class 4 values are significantly lower. This is because a proper A. Dataset Fig. 4: Standard deviations of all rotation and acceleration signals of a set of 200 lunges labeled class 1 and class 4. Fig. 5: Components of the feature vector, which is describing one individual motion event (1) and the confusion matrix visualizing the results for qualitative assessment of bicycle crunches (2). lunge is described by a big step forward as well as bringing one knee nearly to the ground, which results in a greater movement energy while not decently conducted lunges result in less energy within these signals. The same happens forwards (Y-Axis) and downwards (X-axis) for the wrist’s acceleration (top-left (TL) and top-right (TR)), which are placed onto the users hip during the workout. In contrast to that, the rotation is low for proper lunges and higher for the improper ones. This is related to a smooth movement, conducted by skilled athletes and more unsteady movements conducted by unskilled athletes. Due to a relatively smooth and steady movement of the athletes torso, the chest sensor (CH) did not provide significant information concerning this activity. These observations show that even the individual signal’s standard deviation contains enough information to assess an activity in a qualitative way. Based on this cognition we designed a feature vector to describe each individual activity instance. It contains the standard deviations of all 30 signals plus the time interval ∆t of the specific instance in milliseconds (see Figure 5-1). All in all, one event out of our evaluation data set (see Section IV) consists of an average of 3.364 sampling values – by utilizing the procedure described above, we are able to compress this information by a ratio of 1:109. Additionally, we added a label r concerning the individual motion events’ quality rating from 1-5 (very good to very poor, see Section IV-A. For evaluation, we recorded six body weight exercises (crunches (cr.), lunges (lu.), jumping jack (j.j.), mountain climber (m.c.), bicycle crunches (b.c.), and squats (sq.)) conducted by 27 athletes of male and of female sex and aged from 20 till 53. Each athlete had to complete 3 sets with 20 repetitions of each exercise; between the individual sets we scheduled a mandatory break of 30s. An instruction video was shown to the athletes for each exercise and in prior of its execution. All in all we tracked motion data of 7,534 individual exercise repetitions – additionally, all conducted exercises were taped on video for later on labeling by experts. The labeling range is 1 (very good) to 5 (very bad). The data is labeled as follows: all exercises were labeled initially with class 1. For each mistake (each specific deviation from the video instructions), e.g., steps are too small for a mountain climber, the initial class gets added 0.5 (small deviation) or 1 (severe deviation) error points. The final class is the rounded result of the overall error score. Hence, completely different errors during the performance of a motion event may lead to the same error score and therefore the same quality class. B. Qualitative motion assessment All in all, we used two different classification approaches for supervised learning, one with 1) manual and one with automated hyper parameter optimization. Within 1), we manually configured four popular classification algorithms for human activity recognition (see Section II): the decision tree driven Random Forest (RF) and C4.5, a Support Vector Machine (SVM) classifier, and the Naive Bayes (NB) algorithm. Table I classifier RF C4.5 SVM NB cr. 88.0% 79.1% 73.2% 54.3% lu. 90.0% 80.5% 80.8% 70.3% j.j. 92.1% 83.6% 85.0% 72.5% b.c. 92.1% 82.1% 85.7% 76.3% sq. 93.4% 84.6% 80.2% 58.5% m.c. 82.5% 67.9% 60.2% 54.6% average 89.7% 79.6% 77.5% 64.4% duration 447ms 65ms 83ms 83ms TABLE I: Correct classification rates for qualitative assessment with manual classifier selection and configuration. presents the performance of manual classifier selection within a 10-fold cross validation. RF provides the best results with an average correct classification rate of 89.7% while taking 447ms for building its evaluation model. NB performed way faster, but with worse results. cr. Success Rate 100% Training time 2,071ms Classifier RF lu. 100% 673ms RF j.j. 99.9% 1ms k* b.c. 96.0% 2ms IBk sq. 100% 757ms RF m.c. 100% 1ms k* average 99.3% 584ms - TABLE II: Correct classification rates for facilitating a hyper parameter optimization with Auto-WEKA. IV. E VALUATION In this section, we first describe the setup of our study. Subsequently, we present the results of our evaluation and give insights into the performance of the segmentation algorithm. Approach 2) facilitates Auto-WEKA as hyper parameter optimization layer for automated selection of appropriate classifiers and hyper parameter tuning [13]. Table II shows significantly improved results by facilitating RF, k-nearest neighbor (IBk), and K-Star (k*), also for a 10-fold cross validation. Four out of six exercise types are assessed correctly with a success rate of 100% while the average rate is about 99.3%. Despite varying time spans for different classifiers, all test models except one were trained within less than a second for thousands of event instances. This demonstrates the efficiency and scalability of our light weight feature vector design and offers promising chances for mobile and realtime usage. Volatile classification rates in between different exercise types may be explained with the discrete value domain of our labels as well as with the subjective labeling procedure – this assumption is also indicated by Figure 5-2, which shows a confusion matrix for the qualitative assessment of bicycle crunches. Incorrectly classified events became assigned to neighboring quality classes. Because an event’s label originates from its rounded error score, it may occur that the label score is a border value, e.g. 2.5. The event gets the label 3, although its quality is rated between 2 and 3. By contrast, the classifier may now decide that the feature vector looks more like a member of class 2, which finally leads to a wrong classification. C. Segmentation results All in all, we were able to extract 7,413 out of 7,534 recorded motion events into individual segments of specific length, using the segmentation approach described in Section III-A, which makes a total of 98,4% of extracted events. D. Activity recognition Our preliminary study in [3] evaluated the automated recognition of eight different body weight exercises on basis of acceleration data. In this paper, our feature vectors are built on basis of the individual acceleration and rotation signals’ standard deviations, rather than of time series with a fixed and significantly bigger length. We applied this new design to our dataset (see Section IV-A) and achieved a correct recognition rate of 99.9% for manual classifier configuration (RF). 100% were reached for applying automated hyper parameter optimization within 10-fold cross validation – training of the evaluation model took 4.9s for 7,413 instances. Compared to our preliminary studies and related approaches, this performance can be regarded as state-of-art within the field of complex human motion recognition [5], [9]. V. C ONCLUSION AND F UTURE W ORK In this paper we presented a generic approach for dynamic and individual segmentation of recurrent human motion events as well as for qualitative assessment of complex human motion. For evaluation we recorded an exemplary dataset containing 7,534 repetitions of six different different body weight exercises and extracted them into multi-dimensional segments of individual length. Additionally, all segments were tagged with a quality label. We are able to estimate a generic quality class of an individual event occurrence with an average correct classification rate of 99.3% and up to 100% for individual exercise types by adapting an expressive and heavily compressed feature vector. For sheer recognition of activities, we actually reach a correct classification rate of 100%. Automatic hyper parameter optimization performed significantly better than manual approaches. Our concept features a generic analysis approach and we conjecture it is applicable to various recurrent human motions and transferable into multiple operational areas, such as sports, medical observation, or even workflow optimization. These results offer promising options for future work, e.g., a more fine-grained assessment process. By adapting compressed feature vectors, information which is valuable for identifying tangible errors or the positioning of malpositions gets lost. Thereby, a conducted movement can be rated good or bad in a qualitative manner – but neither can the exact reason for that be identified, nor can we carve out concrete characteristics of a specific quality assessment. New features and principal components may be crucial to explore these issues. More dynamic and generic analysis approaches, e.g., neural networks, may bring new insights and are subject of ongoing research. R EFERENCES [1] Z. Radak, N. Hart, L. Sarga, E. Koltai, M. Atalay, H. Ohno, and I. Boldogh, “Exercise plays a preventive role against alzheimer’s disease,” Journal of Alzheimer’s Disease, vol. 20, no. 3, pp. 777–783, 2010. [2] J. P. Koplan, D. S. Siscovick, and G. M. Goldbaum, “The risks of exercise: a public health view of injuries and hazards.” Public Health Reports, vol. 100, no. 2, p. 189, 1985. [3] A. Ebert, M. Kiermeier, C. Marouane, and C. Linnhoff-Popien, “Sensx: About sensing and assessment of complex human motion,” in Networking, Sensing and Control (ICNSC), 2017 14th IEEE International Conference on. IEEE, 2017. [4] A. Bulling, U. Blanke, and B. Schiele, “A tutorial on human activity recognition using body-worn inertial sensors,” ACM Computing Surveys (CSUR), vol. 46, no. 3, p. 33, 2014. [5] D. Morris, T. S. Saponas, A. Guillory, and I. Kelner, “Recofit: using a wearable sensor to find, recognize, and count repetitive exercises,” in Proceedings of the 32nd annual ACM conference on Human factors in computing systems. ACM, 2014, pp. 3225–3234. [6] C. Ladha, N. Y. Hammerla, P. Olivier, and T. Plötz, “Climbax: skill assessment for climbing enthusiasts,” in Proceedings of the 2013 ACM international joint conference on Pervasive and ubiquitous computing. ACM, 2013, pp. 235–244. [7] H. Ding, L. Shangguan, Z. Yang, J. Han, Z. Zhou, P. Yang, W. Xi, and J. Zhao, “Femo: A platform for free-weight exercise monitoring with rfids,” in Proceedings of the 13th ACM Conference on Embedded Networked Sensor Systems. ACM, 2015, pp. 141–154. [8] B. J. Mortazavi, M. Pourhomayoun, G. Alsheikh, N. Alshurafa, S. I. Lee, and M. Sarrafzadeh, “Determining the single best axis for exercise repetition recognition and counting on smartwatches,” in Wearable and Implantable Body Sensor Networks (BSN), 2014 11th International Conference on. IEEE, 2014, pp. 33–38. [9] W. Jiang and Z. Yin, “Human activity recognition using wearable sensors by deep convolutional neural networks,” in Proceedings of the 23rd ACM international conference on Multimedia. ACM, 2015, pp. 1307–1310. [10] J. Pansiot, R. C. King, D. G. McIlwraith, B. P. Lo, and G.-Z. Yang, “Climbsn: Climber performance monitoring with bsn,” in Medical Devices and Biosensors, 2008. ISSS-MDBS 2008. 5th International Summer School and Symposium on. IEEE, 2008, pp. 33–36. [11] E. Velloso, A. Bulling, H. Gellersen, W. Ugulino, and H. Fuks, “Qualitative activity recognition of weight lifting exercises,” in Proceedings of the 4th Augmented Human International Conference. ACM, 2013, pp. 116–123. [12] A. Möller, L. Roalter, S. Diewald, J. Scherr, M. Kranz, N. Hammerla, P. Olivier, and T. Plötz, “Gymskill: A personal trainer for physical exercises,” in Pervasive Computing and Communications (PerCom), 2012 IEEE International Conference on. IEEE, 2012, pp. 213–220. [13] C. Thornton, F. Hutter, H. H. Hoos, and K. Leyton-Brown, “Auto-weka: Combined selection and hyperparameter optimization of classification algorithms,” in Proceedings of the 19th ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, 2013, pp. 847–855.
1cs.CV
The Earth System Grid: Supporting the Next Generation of Climate Modeling Research DAVID BERNHOLDT, SHISHIR BHARATHI, DAVID BROWN, KASIDIT CHANCHIO, MEILI CHEN, ANN CHERVENAK, LUCA CINQUINI, BOB DRACH, IAN FOSTER, PETER FOX, JOSE GARCIA, CARL KESSELMAN, ROB MARKEL, DON MIDDLETON, VERONIKA NEFEDOVA, LINE POUCHARD, ARIE SHOSHANI, ALEX SIM, GARY STRAND, AND DEAN WILLIAMS Invited Paper Understanding the earth’s climate system and how it might be changing is a preeminent scientific challenge. Global climate models are used to simulate past, present, and future climates, and experiments are executed continuously on an array of distributed supercomputers. The resulting data archive, spread over several sites, currently contains upwards of 100 TB of simulation data and is growing rapidly. Looking toward mid-decade and beyond, we must anticipate and prepare for distributed climate research data holdings of many petabytes. The Earth System Grid (ESG) is a collaborative interdisciplinary project aimed at addressing the challenge of enabling management, discovery, access, and analysis of these critically important datasets in a distributed and heterogeneous computational environment. The problem is fundamentally a Grid problem. Building upon the Globus toolkit and a variety of other technologies, ESG is developing an environment that addresses authentication, authorization Manuscript received March 1, 2004; revised June 1, 2004. This work was supported in part by the U.S. Department of Energy under the Scientific Discovery Through Advanced Computation (SciDAC) Program Grant DE-FC02-01ER25453. D. Bernholdt, K. Chanchio, M. Chen, and L. Pouchard are with the Oak Ridge National Laboratory, Oak Ridge, TN 37831 USA (e-mail: bernholdtde@ornl.gov; chanchiok@ornl.gov; chenml@ornl.gov; pouchardlc@ornl.gov). S. Bharathi, A. Chervenak, and C. Kesselman are with the USC Information Sciences Institute, Marina del Rey, CA 90292 USA (e-mail: shishir@isi.edu; annc@isi.edu; carl@isi.edu). D. Brown, L. Cinquini, P. Fox, J. Garcia, R. Markel, D. Middleton, and G. Strand are with the National Center for Atmospheric Research, Boulder, CO 80305 USA (e-mail: dbrown@ucar.edu; luca@ucar.edu; pfox@ucar.edu; jgarcia@ucar.edu; don@ucar.edu; strandwg@ucar.edu). B. Drach and D. Williams are with the Lawrence Livermore National Laboratory, Livermore, CA 94550 USA (e-mail: drach@llnl.gov; williams13@llnl.gov). I. Foster and V. Nefedova are with the Argonne National Laboratory, Argonne, IL 60439 USA (e-mail: foster@mcs.anl.gov; nefedova@ mcs.anl.gov). A. Shoshani and A. Sim are with the Lawrence Berkeley National Laboratory, Berkeley, CA 94720 USA (e-mail: shoshani@lbl.gov; asim@lbl.gov). Digital Object Identifier 10.1109/JPROC.2004.842745 for data access, large-scale data transport and management, services and abstractions for high-performance remote data access, mechanisms for scalable data replication, cataloging with rich semantic and syntactic information, data discovery, distributed monitoring, and Web-based portals for using the system. Keywords—Climate modeling, data management, Earth System Grid (ESG), Grid computing. I. INTRODUCTION Global climate research today faces a critical challenge: how to deal with increasingly complex datasets that are fast becoming too massive for current storage, manipulation, archiving, navigation, and retrieval capabilities. High-resolution and long-duration simulations performed with more advanced earth-system components (e.g., the atmosphere, oceans, land, sea ice, and biosphere) produce petabytes of data. To be useful, this output must be made easily accessible by researchers nationwide, at national laboratories, universities, other research laboratories, and other institutions. Thus, we need to create and deploy new tools that allow data producers to publish their data in a secure manner and that allow data consumers to access that data flexibly and reliably. In this way, we can increase the scientific productivity of U.S. climate researchers by turning climate datasets into community resources. The goal of the Earth System Grid (ESG) project [1] is to create a virtual collaborative environment linking distributed centers, users, models, and data. The ESG research and development program was designed to develop and deploy the technologies required to provide scientists with virtual proximity to the distributed data and resources that they need to perform their research. Participants in ESG include 0018-9219/$20.00 © 2005 IEEE PROCEEDINGS OF THE IEEE, VOL. 93, NO. 3, MARCH 2005 485 the National Center for Atmospheric Research (NCAR), Boulder, CO; Lawrence Livermore National Laboratory (LLNL), Livermore, CA; Oak Ridge National Laboratory (ORNL), Oak Ridge, TN; Argonne National Laboratory (ANL), Argonne, IL; Lawrence Berkeley National Laboratory (LBNL), Berkeley, CA; USC Information Sciences Institute (USC-ISI), Marina del Rey, CA; and, most recently, Los Alamos National Laboratory (LANL), Los Alamos, NM. Over the past three years, ESG has made considerable progress towards the goal of providing a collaborative environment for Earth System scientists. First, we have developed a suite of metadata technologies including standard schema, automated metadata extraction, and a metadata catalog service. Second, we have developed and deployed security technologies that include Web-based user registration and authentication and community authorization. Data transport technologies developed for ESG include grid-enabled data transport for high-performance access; robust multiple file transport; integration of this transport with mass storage systems; and support for dataset aggregation and subsetting. Finally, we have developed a Web portal that integrates many of these capabilities and provides interactive user access to climate data holdings. We have cataloged close to 100 TB of climate data, all with rich scientific metadata, which provides the beginnings of a digital scientific notebook describing the experiments that were conducted. We have demonstrated a series of increasingly functional versions of this software at events such as the NCAR Community Climate System Model (CCSM) [2] workshop and the Supercomputing (SC) conference [3], and we deployed a system in Spring 2004 that will provide community access to assessment datasets produced by the Intergovernmental Panel on Climate Change (IPCC) [4]. ESG aims to improve greatly the utility of shared community climate model datasets by enhancing the scientist’s ability to discover and access datasets of interest as well as enabling increased access to the tools required to analyze and interpret the data. Current global climate models are run on supercomputers within the U.S. and beyond (e.g., the Earth Simulator Center in Japan) and produce terabytes of data that are stored on local archival storage. The analyses of these data contribute to our understanding of our planet, how we are influencing climate change, and how policy makers react and respond to the scientific information that we, as a global community, produce. Future trends in climate modeling will only increase computational and storage requirements. Scientific advances will require a massive increase in computing capability and a sublinear but still extremely substantial increase in the volume and distribution of climate modeling data. We will see increases in the physical resolution of the models, an elevation of the number of ensemble runs, enhanced “quality” in terms of clouds, aerosols, biogeochemical cycles, and other parameters, and a broadening of overall scope that extends into the upper-atmosphere regions. If we project into the future, it is clear that our global earth system modeling activities are going to produce petabytes of data that are increasingly com486 plex and distributed due to the nature of our computational resources. The climate modeling community has been creating shared organization- or project-specific data archives for some time. However, while these archives help enable the work of specific well-defined groups, they limit access to the community at large and prohibit analysis and comparison across archives. With the current infrastructure, analysis of these large distributed datasets that are confined to separate storage systems at geographically distributed centers is a daunting task. ESG’s goal is to dramatically improve this situation. By leveraging emerging developments in Grid technology, we can break down these artificial barriers, creating a data-access environment that encompasses multiple computational realms spanning organizational boundaries with the goal of delivering seamless access of diverse climate modeling data to a broad user base. This task is challenging from both the technical and cultural standpoints. In this paper, we describe what the ESG project has accomplished during the last three years and discuss ongoing and future efforts that will increase the utility of the ESG to the climate community over the coming decade. II. FUNCTIONAL OBJECTIVES Next, we present functional objectives and use cases related to climate model dataset management and access. Various climate model simulations have been performed, and the output from these simulations has been stored on archival storage, with each simulation output comprising several thousand files and several hundred gigabytes of data. The resulting data are of great interest to many researchers, policy makers, educators, and others. However, with current technology, not only must the data manager spend considerable time managing the process of data creation, but any user who wishes to access this data must engage in a difficult and tedious process that requires considerable knowledge of all the services and resources necessary: metadata for search and discovery, specifics of the archival system software, system accounts, analysis software for extracting specific subsets, and so on. Because of this complexity, data access tends to be restricted to privileged specialists. The goal of the ESG system is to simplify both the data management task, by making it easier for data managers to make data available to others, and the data access task, by making climate data as easy to access as Web pages via a Web browser. A. Making Data Available to the ESG Community A first requirement is for tools that allow climate model data managers to make model data available to the ESG community. These tools include the means to create searchable databases of the metadata, provide catalogs of the data that locate a given piece of data on an archival system or online storage, and make catalogs and data accessible via the Web. Prior to the advent of ESG, these capabilities did not exist, so potential users of the model data had to contact the data PROCEEDINGS OF THE IEEE, VOL. 93, NO. 3, MARCH 2005 managers personally and begin the laborious process of retrieving the data they wanted. It is important that tools for data publishers and curators are robust and easy to use. Data publishers should not have to be familiar with all the implementation details of the system. Thus, the tools must be intuitive, reflect the user’s perspective of the data, and be accessible on the user’s local workstation. Although climate simulation datasets are relatively static, they can change over time as errors are corrected, existing runs are extended, and new postrun analyses are added. Thus, it is not sufficient just to be able to publish a dataset once. It must be easy for publishers to update metadata over time. The publishing tools must allow sufficiently privileged users to search and update the metadata database, ensuring that the metadata and physical datasets stay synchronized. B. Defining Virtual Datasets In addition to the “physical” datasets that are generated directly by climate simulations and maintained on archival storage, data producers want to define virtual datasets, datasets that are defined by a set of transformation operations on other physical or virtual datasets. These virtual datasets can then be instantiated to yield physical datasets by the ESG system, either proactively or in an on-demand fashion following a user request. Physical datasets can be discarded following use or, alternatively, cached to avoid the cost of subsequent regeneration. Virtual datasets are important, as they allow data producers to define abstractions over the physical files that may be more convenient and/or efficient for users to access. The transformations used to define virtual datasets may include concatenation (of files from one or more datasets), subsetting (along one or more dimensions), and/or computation (e.g., reduction operations). In our work in ESG, we consider only concatenation and subsetting, but our architecture can be extended in the future to support arbitrary transformations, as in the Chimera system [5]. The following is an example of a virtual dataset defined via concatenation and subsetting: “A dataset that contains, from each of two datasets file1.nc and file2.nc, the ‘PS’ field for 10 time periods.” The net effect is to provide the data consumer with a virtual view of a dataset that hides the underlying organization and complexity of thousands of related files. C. Providing Simple, Convenient Web-Based Access A member of the ESG community should be able to browse, search, discover, and access distributed climate model data easily using the ESG Web portal [1]. She can browse the ESG data holdings hierarchically, and a simple text search capability allows her to perform metadata-based searches of data catalogs. Subsequent to browsing and/or search, she can select the data she wants, after possibly narrowing her choices via additional possibilities presented by the search results. She can also select individual fields and/or regions of interest, specifying a selection that will ultimately come from multiple physical files. The Web portal creates an efficient means of finding and accessing published model data; the user states what she wants to access and ESG performs the tasks required to deliver the desired result. D. Retrieving Large or Numerous Datasets If an ESG user wishes to access large amounts of climate model data, particularly data located on an archival system, ESG has a tool called DataMover [6] that efficiently and robustly accomplishes this task. For example, an ESG user may wish to access many simulated years of model data and store that data on his local online storage. DataMover allows the user to move this large volume of data without requiring him to personally monitor all the steps involved. It manages the processes and takes corrective actions as needed to transmit the data from the archival storage system to a location of the user’s choosing. E. Using a Climate Analysis Application to Access ESG Holdings An ESG user may choose to utilize a common data analysis package like Climate Data Analysis Tools (CDAT) [7] or NCAR Graphics Command Language (NCL) [8] to access the data published via ESG. For example, a Web portal search will give her the information she needs to pull the data directly into her software package. This implies a requirement for interfaces that are compatible with these applications and distributed data access protocols that provide for remote access. Such a capability allows the ESG user community far greater access to climate model data than was previously available as well as the ability to do extensive and complicated analyses on large sets of data efficiently, since there is no need to retrieve and store all the data locally before beginning analysis. III. ESG ARCHITECTURE Next, we present a description of the overall ESG architecture. Fig. 1 shows the major components involved in the ESG system, which are, from bottom to top, the following. • Database, Storage, and Application Servers: These are the basic resources on which ESG is constructed and include the computational resources used for creation of virtual data, disk caches and mass storage systems used to hold data assets, database servers used to store metadata, and application servers for hosting the ESG portal services. • Globus/Grid infrastructure: This provides remote, authenticated access to shared ESG resources, enabling access to credentials, data, and metadata, replica location services (RLSs), and the submission and management of computational jobs. • High-level and ESG-specific services: These services span ESG resources and provide capabilities such as site to site data movement, distributed and reliable metadata access, and data aggregation and filtering. • ESG applications: The most important of these is the ESG portal, which provides a convenient, browser-based interface to ESG services. Other applications include user level tools for data publication BERNHOLDT et al.: THE EARTH SYSTEM GRID: SUPPORTING THE NEXT GENERATION OF CLIMATE MODELING RESEARCH 487 Fig. 1. ESG architecture schematic showing major components. as well as assorted clients for data analysis and visualization. IV. ACCOMPLISHMENTS: BRINGING TO THE USER COMMUNITY CLIMATE DATASETS During our first three years of ESG development, we have reached milestone achievements in the following areas: • speed of access and transport of data at user request, via the integration of advanced GridFTP data transfer technologies into the widely used Open-source Project for a Network Data Access Protocol (OPeNDAP) software; • robust multifile movement between various storage systems, via the development of DataMover technology; • standardization of data formats; • XML-based metadata schemas and tools for discovery, use, analysis, managing, and sharing of scientific data; • security and access controls, supporting both low-cost user registration and authentication for purposes of auditing and highly secure access control for more sensitive operations; • development of a Web-based portal enabling interactive searching of ESG data holdings, browsing of associated metadata, and retrieval of datasets that may be large. Our first official release of ESG to the greater climate community began in Spring 2004. The portal is being used to deliver to the community data produced by the Intergovernmental Panel on Climate Change (IPCC) assessment program. With this first production release, ESG’s vision of providing the foundation for the next-generation data publication, analysis applications, Web-based portals, and collaborative problem-solving environments for climate research [9] has been demonstrated. 488 A. ESG Web Portal We have developed the ESG Web portal, which provides the entry point to ESG data holdings. Its purpose is to allow climate scientists from around the world to authenticate themselves to the ESG services and to browse, search, subset, and retrieve data. The ESG portal uses Grid-enabled ESG services to associate metadata with datasets, determine data location, and deliver data to the location desired by the user. The portal includes an “Aggregated Data Selection” option that allows the user to select a variable and a subregion and time and level ranges. B. Metadata The role of data descriptions, i.e., metadata, is critical in the discovery, analysis, management, and sharing of scientific data. We have developed standardized metadata descriptions and metadata services to support this important functionality. ESG has developed metadata schema oriented toward the types of metadata generated by atmospheric general circulation and coupled ocean-atmospheric models. These schema are defined in terms of the Network Common Data Format (NetCDF) markup language (NcML) [10] and provide an XML-based representation of metadata that appears in NetCDF encoded simulation data. The ESG metadata schema are supported by a range of services that are used to provide access to specific metadata values. The ESG Metadata Catalog is based on the Open Grid Services Architecture Data Access and Integration (OGSA-DAI) service [11] and uses relational technology for browsing and searching ESG metadata holdings. We have also deployed a separate metadata service called the Replica Location Service (RLS) [12], [13] to provide information about the location of datasets, allowing data to be replicated and migrated without having to modify entries in the main catalog of NcML data. PROCEEDINGS OF THE IEEE, VOL. 93, NO. 3, MARCH 2005 ESG CA, generates a certificate and stores it in the MyProxy service, and gives the user an ID/password for MyProxy. The registration system also has an administrator’s interface that allows the CA administrator to accept or reject a user request. The most important benefits of this system are that users never have to deal with certificates and that the portal can get a user certificate from the MyProxy service when needed. Shared data access requires the ability to specify and enforce group-based access control for individual datasets. We have implemented a prototype authorization service by integrating the Community Authorization Service (CAS) [17] into the GridFTP [18] server used to implement OPeNDAP-g [19] data queries. This system supports group-based access control based on community specified policy stored in the CAS server’s policy database. D. Data Transport and Access Services Fig. 2. Registration system architecture. We provide the ability to bridge ESG metadata into dataset catalogs conforming to the Thematic Realtime Environmental Data Distributed Services (THREDDS) specification [14]. THREDDS catalogs are automatically generated from the data description information contained in the OGSA-DAI database and the location information retrieved from the distributed RLS databases. C. Security ESG’s large and diverse user community and the multiple laboratories that participate in ESG make security a challenging problem. We have devoted considerable effort to analyzing and documenting security requirements. ESG has adopted a security approach that includes user authentication, user registration with the ESG portal, and group-based access control. The Grid Security Infrastructure (GSI) [15], [16] is used as a common underlying basis for secure single sign-on and mutual user-resource authentication. This machinery provides for secure access control to all ESG resources using public key infrastructure (PKI) with credentials from the DOE Grids Certificate Authority (CA). The ESG is recognized by the DOE CA as an accredited virtual organization and participates in the Policy Management Authority Board. Because of the overhead associated with obtaining public key credentials, an online registration process is used to access “moderate-quality” PKI credentials without the overhead normally associated with certificate generation. This mechanism allows for a broad base of users to access “public” data while providing an auditing of access by remote users with whom ESG has no existing trust relationship, as required by research sponsors. ESG has developed a registration system that allows users to register easily with the ESG portal. The registration system architecture is shown in Fig. 2. The focus of this system is ease of use. We developed portal extensions (CGI scripts) that automate user registration requests. The system solicits basic data from the user, generates a certificate request for the OPeNDAP is a protocol and suite of technologies that provide flexible, easy access to remote data. Based on the widely accepted community OPeNDAP software, ESG has extended OPeNDAP to create OPeNDAP-g, a Grid-enabled OPeNDAP server and clients that support GSI security [15] and can use GridFTP [20] as a data transport mechanism. In addition, seamless joining of data stored in different OPeNDAP servers (“aggregation”) is now part of the ESG production release. ESG has also built a prototype end-to-end data access and transport system demonstrating the use of CDAT [3] and NCL [6] to access remote datasets using the GridFTP protocol via the OPeNDAP-g client. Continued work will be necessary before this goes into production, including support of aggregation, but the goal is that this OPeNDAP-g client software will be the foundation for distributed climate applications to gain access to ESG resources. E. Multiple File Transport ESG has developed tools for the efficient and reliable transfer of multiple files among storage sites. The transport of thousands of files is a tedious, error-prone, but extremely important task in climate modeling and analysis applications. The scientists who run models on powerful supercomputers often need the massive volume of data generated to be moved reliably to another site. Often the source and destination storage systems are specialized mass storage systems, such as the High Performance Storage System (HPSS) at the National Energy Research Scientific Computing Center (NERSC), Berkeley, CA, or the Mass Storage Systems (MSS) at NCAR. During the analysis phase, subsets of the data need to be accessed from various storage systems and moved reliably to a destination site where the analysis takes place. The automation of the file replication task requires automatic space acquisition and reuse; monitoring the progress of thousands of files being staged from the source mass storage system; transferring the files over the network; and archiving them at the target mass storage system. We have leveraged the software developed by the Storage Resource Manager (SRM) [21] project to BERNHOLDT et al.: THE EARTH SYSTEM GRID: SUPPORTING THE NEXT GENERATION OF CLIMATE MODELING RESEARCH 489 achieve robust multifile transport for ESG. SRMs are software components that are placed in front of storage systems, accept multifile requests, manage the incremental access of files from the storage system, and then use GridFTP to transport the files to their destination. Two important results related to multiple file transport were achieved in the first phase of the ESG project. The first was motivated by a practical need to Grid-enable the MSS at NCAR; that is, to be able to store files into and get files from the MSS directly from remote sites. To achieve this goal, we adapted a version of an SRM to NCAR’s MSS. This allowed multifile movement between various sites, such as LBNL/NERSC and NCAR. This system has been used repeatedly to move reliably thousands of file between ESG sites. Second, reliability is achieved in the SRM by monitoring the staging, transfer, and archiving of files and by recovering from transient failures. A Web-based tool was deployed to dynamically monitor the progress of the multifile replication. In response to ESG user requirements for the ability to move entire directories in a single command, a software module called the DataMover [6] was developed. The DataMover interacts with the source and destination storage systems through SRMs to setup the target directory and instructs the SRMs to perform the robust multifile movement. The DataMover and an SRM are used by the ESG portal to copy user-requested files into the portal’s disk space from the files’ source locations, which may be remote storage systems. The user is then able to access those files directly from the portal. This capability makes it possible for the portal to act on behalf of a user to get files from remote sites without requiring the user to have direct access to those sites. F. Monitoring We have built monitoring infrastructure that allows us to keep track of the state of resources distributed across seven ESG institutions. Monitoring is required to provide users with a robust and reliable environment they can depend upon as part of their daily research activities. We monitor the hardware and software components that make up the ESG and provide status information to ESG operators and users. Our monitoring infrastructure builds upon the Globus Toolkit’s Grid information services [22]. G. Ontologies for ESG Metadata We developed a prototype ESG ontology [23], [24] that is available on the ESG portal. The ontology contains the following classes: • • • • • • 490 scientific investigation (with subclasses simulation, observation, experiment, analysis); datasets (with subclasses campaign, ensembles); pedigree (with subclasses identity, provenance, project); service; access; other. Relationships supported by the ontology include isPartOf, isGeneratedBy, isDerivedFrom, hasParameter, and usesService. While climate simulation data are the current focus of ESG, the scientific investigation metadata defined by our ontology accommodates other types of scientific investigation, for example, observational data collected by oceanographers. Dataset metadata includes time and space coverage and other parameters. Pedigree or provenance metadata trace the origins of a dataset and the successive operations that were performed by recording the conditions under which a dataset of interest was produced; for instance, provenance describes what models, what versions of a model, and what software and hardware configurations were used for a run of interest. Service metadata associates earth science data formats with servers providing functionality such as subsetting in coordinate space, visualization, and expression evaluation. The ESG ontology clearly separates metadata potentially reusable by other scientific applications (such as project information) from metadata specific to an application. The iterative work of detailed concept definition and the rigor needed for specifying relationships between entities required in ontology authoring substantially improved the ESG schema. H. Current ESG Data Holdings One of the key goals of ESG is to serve a critical mass of data of interest to the climate community. We are steadily increasing the amount of data provided to the climate community through ESG. In the first phase or the project, ESG data holdings consisted of a small set of CCSM [2], [25] and Parallel Climate Model (PCM) [26] data. The number of early users accessing these data via our prototype ESG system was deliberately kept small and ranged from one to five concurrent users. By the end of 2003, PCM data totaled approximately 100 TB at several sites, including NCAR, the Program for Climate Model Diagnosis and Intercomparison (PCMDI), NERSC, ORNL, and LANL. About 65 users requested accounts at PCMDI to access the PCM data holdings there, representing around 15 science projects, including university researchers, DOE collaborators, and various groups interested in climate simulation on a regional scale. In 2004, NCAR focused on publishing CCSM data, while LLNL publishED climate simulation data generated by the major climate modeling groups worldwide for the Intergovernmental Panel on Climate Change (IPCC) Fourth Assessment Report (FAR). The IPCC, which was jointly established by the World Meteorological Organization (WMO) and the United Nations Environment Program, carries out periodic assessments of the science of climate change, which serve governments and others interested in the potential impact of future climate change. Fundamental to this effort is the production, collection, and analysis of climate model simulations carried out by major international research centers. Although these centers individually often produce useful analyses of the individual results, the collective model output from several modeling centers often yields a better PROCEEDINGS OF THE IEEE, VOL. 93, NO. 3, MARCH 2005 Fig. 3. Schematic of ESG data portals, services, and archives. understanding of the uncertainties associated with these models. Toward this end, the WMO’s Working Group on Coupled Modeling (WGCM), in consultation with the IPCC leadership, coordinates a set of standard climate-change simulations carried out by the major modeling centers. In order for this tremendous commitment of computational and scientific effort to be of maximum benefit, it is essential that a wide community of climate scientists critically analyze the model output. The IPCC and WGCM have, therefore, asked PCMDI to collect model output data from these IPCC simulations and to distribute these to the community via ESG. By late 2004, the CCSM and IPCC model runs totaled approximately 20 TB of data. CCSM is one of the major climate simulation efforts worldwide, so interest in this data from the scientific community and others will be significant, on the order of hundreds of scientists, researchers, policy makers and others. ESG is providing access to this considerable store of data. based on the same code, configured differently to address ESG and IPCC requirements. I. Deployment of Portals, Services, and Archives In this section, we discuss future work in the ESG project. Over the next two years, the goal of the ESG collaborative is to increase the amount of data made available to scientists through the ESG portal and to enhance the functionality, performance, and robustness of ESG components. The critical role of the IPCC data and the commitments made by LLNL’s PCMDI to provide community access to that data led us to adopt the overall deployment strategy depicted in Fig. 3. At the lowest level, data are maintained in archives at PCMDI (for IPCC data) and NCAR (for other climate simulation data, e.g., from CCSM and PCM). Above these, services enable remote access to data archives by maintaining metadata used for data discovery, implementing authentication and authorization, and so on. A copy of these services, located primarily at NCAR, is available for ESG-wide use, and another copy at PCMDI will provide access only to IPCC data. (Currently, the software has been installed at PCMDI, but the site is not yet supporting users of IPCC data.) Similarly, there are two Web data portals for data access: one based at PCMDI for IPCC data only, and an ESG-wide portal that will provide access to IPCC, CCSM, PCM, LANL, and eventually other data. The NCAR and PCMDI instantiations of the data portal and services are J. External Collaborations Where appropriate, we have developed ESG tools and services in collaboration with national and international groups. Currently, ESG is in close collaboration with the British Atmospheric Data Centre in the U.K., the National Oceanic and Atmospheric Administration (NOAA) Operational Model Archive and Distribution System (NOMADS), the Earth Science Portal (ESP) Consortium, THREDDS [14], NOAA’s Geophysical Fluid Dynamics Laboratory, and the OPeNDAP project. We have also held discussions with the Linked Environments for Atmospheric Discovery (LEAD) project [28], the Geosciences Cyberinfrastructure Network (GEON) project [29], and the Earth System Modeling Framework (ESMF) [27]. V. FUTURE WORK: INCREASING THE UTILITY OF ESG TO THE CLIMATE MODELING COMMUNITY A. Additional Deployment of Data Archives, Services, and Portals The ESG data services and a Web data portal have been installed at PCMDI to support IPCC data distribution there, and they will soon be registering users who want to access the data. Eventually, we plan to include more sites as data archives providing climate datasets to ESG users, including LBNL and ORNL. B. Web Portal and Overall System Integration The ESG data portal integrates the different ESG services (authentication and authorization, metadata, data processing, and data transport). We will revise the existing Web portal as required and support new user communities (e.g., ocean BERNHOLDT et al.: THE EARTH SYSTEM GRID: SUPPORTING THE NEXT GENERATION OF CLIMATE MODELING RESEARCH 491 modelers) as needed, either by providing restricted-access areas on the same portal or by developing customized virtual portals for each community. We will also be engaged in formal usability testing with select members of the research community. C. Security Services The current ESG security architecture deals primarily with authentication of users to the various Grid resources (Grid services, storage systems, etc.). Several key points remain to be addressed, including authorization (or role-based access control to the resources) and support of specific site requirements, such as one-time passwords (OTPs). 1) Authorization: Our authorization infrastructure will build upon the Community Authorization Service (CAS) [17] being developed as part of the Globus Toolkit. Building on the Globus Toolkit Grid Security Infrastructure (GSI) [16], [30], CAS allows resource providers to specify course-grained access control policies and delegate fine-grained access control policy management to the community, which specifies its policies via the CAS. Resource providers maintain ultimate authority over their resources but are spared day-to-day policy administration tasks (e.g., adding and deleting users, modifying user privileges). ESG distinguishes between two types of authorization: file-oriented and services-oriented. File-oriented authorization makes access control decisions based on file access permissions for groups of users. The same data on the same server could be accessed by one group of users but inaccessible for another group. Service-oriented authorization makes access control decisions based on a group’s permission to access particular services. For example, some privileged users might be allowed to access data efficiently from hierarchical storage systems using the DataMover service, while less powerful users would be able to access that data only through the OpenDAP-g server. For both types of authorization, users will be given their access rights at their initial sign-up with the ESG portal via the ESG registration system. Any further changes to user access rights would be done by the resource providers using special tools (to be developed). 2) One-Time Password (OTP) Authentication: There are various options for supporting the use of one-time passwords, including an online CA that generates GSI credentials automatically for a user who has authenticated with the OTP system (thus allowing them to access other ESG sites without further authentication). Another possibility is for GSI credentials generated by an online CA at one site following OTP authentication to be accepted at another site with the same requirement. A third option would include changing GSI credentials to specify whether authentication to generate the user certificate used OTP. We will investigate these options and implement the one that best fits ESG. D. Metadata Schema and Services ESG has focused strongly on metadata. Remaining tasks include the following. 492 1) Metadata Schema: From the start, it has been our aim in ESG to develop a system that has the potential for longevity and interoperation with other emerging data systems worldwide. New standards, like ISO-911, are emerging that can facilitate interoperation of multiple data systems, and we plan to spend some effort evolving our metadata in this direction. This work will be undertaken primarily by LLNL and NCAR, but in concert with a number of other projects (e.g., British Atmospheric Data Center [31], THREDDS [14], etc.) that face the same future needs. The metadata changes required by ESG researchers will be incorporated into the existing OGSA DAI-based metadata service. 2) Metadata Catalog Support for Virtual Data: Work is required to extend our metadata catalogs to support virtual data definitions, so that data producers can define virtual datasets and data consumers can discover and request virtual datasets. We intend to work with NcML as our virtual data definition language. 3) Multiple Metadata Catalog Services: We will implement a replicated metadata catalog to avoid a single point of failure. The initial goal of this work will be to improve reliability, but we also note that replication can improve performance by load balancing of the metadata query workload. Initially, we plan to use the OGSA-DAI metadata catalog at NCAR as the master catalog and do periodic updates to a second catalog located at Lawrence Livermore National Laboratory. We will deploy more general distributed metadata services as they are developed. We have also done some exploratory work in using the Open Archive Initiative (OAI) protocols [32] to accomplish this function, and we will evaluate the relative effectiveness and level of effort required to do this. 4) Browse, Search, and Query: We will support richer metadata catalog query capabilities for ESG scientists. 5) Federation: We will provide for the interoperation of two heterogeneous metadata services: our ESG Metadata Services and the THREDDS catalogs. We will provide simple distributed queries across the two catalog types. E. DataMover Services Our work thus far with the DataMover application [6] has resulted in a unique capability that copies directories (effectively providing the equivalent of a Unix “rcp—r” copy command) across a heterogeneous online/archival storage environment, including NCAR’s locally developed MSS. Strong security—a critical prerequisite for such actions—is required and, thus, the use of DataMover is largely restricted to the “power users” (i.e., users that have formal accounts at all sites involved in data transfer). But this leaves out the average user who may want to use the Web portal to locate and identify a large number of files that must be moved back to a local system. The Web portal provides a workable interface for the selection of a small number of files (limited to a few gigabytes). However, if a user wants a large number of files, then we need a different sort of capability, because such transfers require automation to deal with queuing, PROCEEDINGS OF THE IEEE, VOL. 93, NO. 3, MARCH 2005 Fig. 4. Steps involved in defining, discovering, requesting, and instantiating a virtual dataset. management of cache disk space, network problems, and recovery from transient failures. We will continue to refine, enhance, and increase the robustness and scaling of the DataMover tool. Beyond that, we will evolve the current DataMover into a “DataMover-Lite” application that will work seamlessly with the Web portal, allowing a user to make a selection of a large number of files and then trigger the launch of this application. We plan to provide data movement capabilities for two types of users which we refer to as “casual users” and “frequent users.” Casual users are those that do not have Grid credentials, and frequent users are those that are willing to go through the process of acquiring Grid credentials to achieve more efficient transport of files. For casual users, the requested files will have to be moved to the disk cache managed by the Web portal first, and only then can they be “pulled” by the users to their systems. For frequent users, we plan to develop a client-side “DataMover-Lite” that will “pull” the files directly from their source location to the user’s location, avoiding transport through the Web portal’s disk cache. This more efficient method of file transport is necessary when moving a large volume of data. Also, to conform to security policies, “DataMover-Lite” will work from behind the firewall and adapt to the local security policy. F. Aggregation Services and OPeNDAP-g Additional development of OPeNDAP-g will enhance virtual data services for the Web portal, native client access, performance, and robustness. 1) Clients: ESG clients include the Web portal and user desktop applications such as CDAT [7] and NCL [8]. We plan to complete the netCDF client interface to these applications, providing full functionality of the API and transparently handling aggregation and subsetting (i.e., Virtual Data Services) to return useful data to users. It will be necessary for client applications to operate with various implementations of ESG security and to utilize an OPeNDAP-constrained URL to access data. In some cases, the client may need to generate these URLs, thus requiring access to the ESG catalogs. 2) Servers: We will migrate the OPeNDAP-g services to the latest release of the Globus Toolkit Web services-based components and the new striped GridFTP server. Integration of ESG security models and connections to catalog services from OPeNDAP-g client interface are expected to require modifications to the OPeNDAP-g core libraries. In addition, we plan to complete the integration of the data access and transport with RLSs and SRMs for hierarchical storage systems. G. Monitoring We will provide enhanced monitoring capabilities to improve the robustness of the ESG infrastructure. These will include monitoring a larger number of ESG services and components and providing better interfaces for querying historical information about resource availability. H. Virtual Data Support We will provide support for virtual data in the next phase of ESG. Fig. 4 depicts the tasks involved in publishing, discovering, and accessing a virtual dataset, which include the following. 1) A data provider publishes to an ESG metadata catalog a definition of a new dataset, indicating its name (“D3”), associated metadata (“P”), and either its constituent component files (if a physical dataset) or its definition (if a virtual dataset, as here: “f(D1, D2)”). 2) A client (user or program) issues a query to the metadata catalog for datasets of interest. 3) The names of any datasets matching the user query are returned. In the figure, this query happens to match the properties associated with the virtual dataset D3, and so the name D3 is returned. 4) A client requests that dataset by requesting the “Virtual Data Service” (shown as “Data Service” in the figure) for the dataset D3 or any subset of D3. 5) The Virtual Data Service retrieves the recipe for D3 from the metadata catalog. 6) The Virtual Data Service instantiates D3 (or a specified subset of D3) by fetching appropriate data from D1 and D2 and assembling those pieces to create a new dataset D3. Finally, the Virtual Data Service returns the requested data to the user (step not shown). The Virtual Data Service may also publish the location of the new physical dataset into the metadata catalog so as BERNHOLDT et al.: THE EARTH SYSTEM GRID: SUPPORTING THE NEXT GENERATION OF CLIMATE MODELING RESEARCH 493 to accelerate the processing of subsequent requests for the dataset (step also not shown). VI. RELATED WORK ESG has worked closely with several existing efforts. These include the DOE Science Grid Project [33], whose work on authentication infrastructure and related security issues has been particularly useful to ESG. ESG uses the DOE Science Grid Certification Authority as the basis for its authentication. ESG has also worked closely with Unidata [34] on several initiatives, including joint development of the NcML specification [10] that provides a standard XML encoding for the content of netCDF files. NcML has been extended to support coordinate system information, aggregation/subsetting logic, and GIS interoperability. NcML is still being developed and is being established as a community standard. ESG also makes use of the THREDDS specification developed within Unidata. The ESG collaborative includes members from the Globus Alliance [35]. ESG has made extensive use of Globus Toolkit components. For example, ESG acted as an early adopter and stringent beta tester of the GridFTP code [18], identifying a number of subtle errors in the implementation. ESG has collaborated with Globus on compelling technology demonstrations involving data movement at close to 1 GB/s over wide area networks. ESG also made use of the GSI [16], the RLS [12], [13], remote job submission capabilities, monitoring and information systems, and the CAS [17] provided by the Globus Toolkit. ESG also includes members of the SRM Project at LBNL [21], [36]. SRMs provide dynamic storage management and support for multifile requests. The LBNL team adapted the SRM developed for HPSS to the MSS at NCAR. As part of ESG, the SRM team also developed DataMover, providing the ability to move entire directories robustly (with recovery from failures) between diverse mass storage systems at NCAR, LBNL, and ORNL, as well as disk systems at NCAR and LLNL. The DataMover has been used repeatedly by members of the ESG team to move thousands of files robustly between mass storage systems at these sites. The ESMF [27] is a NASA-funded project that has engaged staff at NCAR, NASA, and DOE laboratories to develop a standard framework for the construction of modular climate models. In a next phase, the scope of ESMF and ESG both expand to embrace problem-solving environments for earth system researchers. We see strong opportunities for mutually beneficial interaction between ESG and ESMF as models are extended both to access remote data and to publish data. A number of scientific projects face challenges similar to those being explored in ESG. The Grid Physics Network (GriPhyN) project [37] uses grid technologies to support physicists, with emphasis on support for virtual data, data management and workflow management. The Particle Physics Data Grid [38] also employs grid technologies to 494 support physics research. The LEAD project [28] is developing scientific and Grid infrastructure to support mesoscale meteorological research. The GEON project [29] supports geoscientists with an emphasis on data modeling, indexing, semantic mediation, and visualization. ESG technology is based on Globus Toolkit and SRM middleware. Other scientific grid projects use the Storage Resource Broker (SRB) middleware [39], [40]. Unlike the layered approach taken by the Globus Toolkit, SRB provides tightly integrated functionality that includes extensive data management capabilities, including support for metadata, organizing data in collections and containers, and maintaining consistency among replicas. VII. CONCLUSION The increasingly complex datasets being produced by global climate simulations are fast becoming too massive for current storage, manipulation, archiving, navigation, and retrieval capabilities. The goal of the ESG is to provide data management and manipulation infrastructure in a virtual collaborative environment that overcomes these challenges by linking distributed centers, users, models, and data. An important role of the ESG project is to provide a critical mass of data of interest to the climate community, including CCSM, PCM, and IPCC simulation model output. Over the past three years, the ESG project has made considerable progress toward the goal of a community ESG. We have developed a suite of technologies including standard metadata schema; tools for metadata extraction; metadata services for data discovery; security technologies that provide authentication, registration and some authorization capabilities; a grid-enabled version of “OPeNDAP-g” for high-performance data access; robust multiple file transport using SRM and DataMover; a monitoring infrastructure; and the development of a Web portal for interactive user access to climate data holdings. To date, we have catalogued close to 100 TB of climate data, all with rich scientific metadata. In the next phase of ESG, we will increase the utility of ESG to the climate modeling community by expanding both the data holdings that we provide and the capabilities of the system. Over the next two years, the ESG will provide enhanced performance and reliability as well as richer authorization, metadata, data transport, and aggregation capabilities and support for virtual data. REFERENCES [1] Earth System Grid (ESG) [Online]. Available: http://www. earthsystemgrid.org [2] CSSM—Community Climate System Model [Online]. Available: http://www.ccsm.ucar.edu/ [3] A. Chervenak et al., “High-performance remote access to climate simulation data: A challenge problem for data grid technologies,” Parallel Comput., vol. 29, no. 10, pp. 1335–1356, 2003. [4] Intergovernmental Panel on Climate Change (IPCC) [Online]. Available: http://www.ipcc.ch/ [5] I. Foster et al., “Chimera: A virtual data system for representing, querying, and automating data derivation,” presented at the 14th Int. Conf. Scientific and Statistical Database Management, Edinburgh, U.K., 2002. PROCEEDINGS OF THE IEEE, VOL. 93, NO. 3, MARCH 2005 [6] A. Sim, J. Gu, A. Shoshani, and V. Natarajan, “DataMover: Robust terabyte-scale multi-file replication over wide-area networks,” presented at the 16th Int. Conf. Scientific and Statistical Database Management (SSDBM), Santorini Island, Greece, 2004. [7] Climate Data Analysis Tools (CDAT) (2004). [Online]. Available: http://esg.llnl.gov/cdat [8] NCAR Command Language (NCL) (2004). [Online]. Available: http://ngwww.ucar.edu/ncl/ [9] I. Foster et al., “The Earth System Grid II: Turning climate datasets into community resources,” presented at the Annu. Meeting Amer. Meteorological Soc., Orlando, FL, 2002. [10] J. Caron et al., “The NetCDF Markup Language (NcML),” Unidata, Boulder, CO, 2003. [11] M. Atkinson et al., “Data access, integration, and management,” in The Grid: Blueprint for a New Computing Infrastructure. San Mateo, CA: Morgan Kaufmann, 2004. [12] A. Chervenak et al., “Giggle: A framework for constructing scalable replica location services,” presented at the SC Conf. ’02: High Performance Networking and Computing, Baltimore, MD. [13] A. Chervenak, N. Palavalli, S. Bharathi, C. Kesselman, and R. Schwartzkopf, “Performance and scalability of a replica location service,” presented at the High Performance Distributed Computing (HPDC-13) Conf., Honolulu, HI, 2004. [14] Thematic Realtime Environmental Data Distributed Services (THREDDS) (2004). [Online]. Available: http://www. unidata.ucar.edu/projects/THREDDS/ [15] R. Butler et al., “A national-scale authentication infrastructure,” IEEE Computer, vol. 33, no. 12, pp. 60–66, Dec. 2000. [16] I. Foster et al., “A security architecture for computational grids,” in Proc. 5th ACM Conf. Computer and Communications Security, 1998, pp. 83–92. [17] L. Pearlman et al., “A community authorization service for group collaboration,” in Proc. IEEE 3rd Int. Workshop Policies for Distributed Systems and Networks, 2002, pp. 50–59. [18] W. Allcock, et al. (2001) GridFTP: Protocol extension to FTP for the Grid. Global Grid Forum. [Online]. Available: http://www. gridforum.org [19] OPeNDAP [Online]. Available: http://opendap.org/ [20] W. Allcock et al., “Data management and transfer in high-performance computational grid environments,” Parallel Comput., vol. 28, no. 5, pp. 749–771, 2002. [21] Storage Resource Management Project (2004). [Online]. Available: http://sdm.lbl.gov/srm; http://sdm.lbl.gov/srm-wg [22] K. Czajkowski et al., “Grid information services for distributed resource sharing,” in Proc. 10th IEEE Int. Symp. High Performance Distributed Computing, 2001, pp. 181–194. [23] L. Pouchard et al., “An ontology for scientific information in a grid environment: The Earth System Grid,” presented at the Symp. Cluster Computing and the Grid (CCGrid 2003), Tokyo, Japan, 2003. [24] L. Pouchard et al., “Data discovery and semantic Web technologies for the earth sciences,” Int. J. Dig. Libraries, to be published. [25] M. B. Blackmon et al., “The Community Climate System Model,” Bull. Amer. Meteorol. Soc., vol. 82, no. 11, pp. 2357–2376, 2001. [26] Parallel Climate Model (PCM) [Online]. Available: http://www.cgd.ucar.edu/pcm/ [27] Earth System Modeling Framework [Online]. Available: http://www.esmf.ucar.edu/ [28] Linked Environments for Atmospheric Discovery (LEAD) (2004). [Online]. Available: http://lead.ou.edu [29] GEON: The Geosciences Network (2004). [Online]. Available: www.geongrid.org [30] V. Welch et al., “Security for Grid services,” in Proc. 12th IEEE Int. Symp. High Performance Distributed Computing, 2003, pp. 48–57. [31] British Atmospheric Data Center (BADC) (2004). [Online]. Available: http://badc.nerc.ac.uk/home/index.html [32] H. V. D. Sompel and C. Lagoze. (2001) The open archives initiative protocol for metadata harvesting. The Open Archives Initiative [Online]. Available: http://www.openarchives.org/OAI_protocol/ openarchivesprotocol.html [33] DOE Science Grid Project (2004). [Online]. Available: http://www.doesciencegrid.org [34] D. W. Fulker, S. Bates, and C. Jacobs, “Unidata: A virtual community sharing resources via technological infrastructure,” Bull. Amer. Meteorol. Soc., vol. 78, pp. 457–468, 1997. [35] The Globus Toolkit [Online]. Available: http://www.globus. org/toolkit/ [36] A. Shoshani, A. Sim, and J. Gu, “Storage resource managers: Essential components for the Grid,” in Grid Resource Management: State of the Art and Future Trends, J. Nabrzyski, J. Schopf, and J. Weglarz, Eds. New York: Kluwer, 2003. [37] The GriPhyN project: Toward petascale virtual data grids, P. Avery and I. Foster. (2001). [Online]. Available: http://www.griphyn.org [38] Particle Physics Data Grid (PPDG) project (2004). [Online]. Available: http://www.ppdg.net [39] The Storage Resource Broker (2002). [Online]. Available: http://www.npaci.edu/DICE/SRB/ [40] C. Baru et al., “The SDSC storage resource broker,” presented at the 8th Annu. IBM Centers for Advanced Studies Conf., Toronto, ON, Canada, 1998. Authors’ photographs and biographies not available at the time of publication. BERNHOLDT et al.: THE EARTH SYSTEM GRID: SUPPORTING THE NEXT GENERATION OF CLIMATE MODELING RESEARCH 495
5cs.CE
High Performance Non-Binary Spatially-Coupled Codes for Flash Memories Ahmed Hareedy, Homa Esfahanizadeh, and Lara Dolecek arXiv:1706.07531v5 [cs.IT] 11 Mar 2018 Electrical Eng. Department, University of California, Los Angeles, Los Angeles, CA 90095 USA {ahareedy, hesfahanizadeh}@ucla.edu and dolecek@ee.ucla.edu Abstract—Modern dense Flash memory devices operate at very low error rates, which require powerful error correcting coding (ECC) techniques. An emerging class of graph-based ECC techniques that has broad applications is the class of spatiallycoupled (SC) codes, where a block code is partitioned into components that are then rewired multiple times to construct an SC code. Here, our focus is on SC codes with the underlying circulant-based structure. In this paper, we present a three-stage approach for the design of high performance non-binary SC (NBSC) codes optimized for practical Flash channels; we aim at minimizing the number of detrimental general absorbing sets of type two (GASTs) in the graph of the designed NB-SC code. In the first stage, we deploy a novel partitioning mechanism, called the optimal overlap partitioning, which acts on the protograph of the SC code to produce optimal partitioning corresponding to the smallest number of detrimental objects. In the second stage, we apply a new circulant power optimizer to further reduce the number of detrimental GASTs. In the third stage, we use the weight consistency matrix framework to manipulate edge weights to eliminate as many as possible of the GASTs that remain in the NB-SC code after the first two stages (that operate on the unlabeled graph of the code). Simulation results reveal that NBSC codes designed using our approach outperform state-of-theart NB-SC codes when used over Flash channels. I. I NTRODUCTION Because of their excellent performance, graph-based codes are among the most attractive error correction techniques deployed in modern storage devices [1], [2]. Non-binary (NB) codes offer superior performance over binary codes, and are thus well suited for modern Flash memories. The nature of the detrimental objects that dominate the error floor region of nonbinary graph-based codes depends on the underlying channel of the device. Unlike in the case of canonical channels, in a recent research [3], it was revealed that general absorbing sets of type two (GASTs) are the objects that dominate the error floor of NB graph-based codes over practical, inherently asymmetric Flash channels [3], [4]. We analyzed GASTs, and proposed a combinatorial framework, called the weight consistency matrix (WCM) framework, that removes GASTs from the Tanner graph of NB codes, and results in at least 1 order of magnitude performance gain over asymmetric Flash channels [3], [5]. A particular class of graph-based codes that has received recent attention is the class of spatially-coupled (SC) codes [6]. SC codes are constructed via partitioning an underlying LDPC code into components, and then coupling them together multiple times. Recent results on SC codes include asymptotic analysis, e.g., [7], and finite length designs, e.g., [8]–[10]. Non-binary SC (NB-SC) codes designed using cutting vector (CV) partitioning and optimized for 1-D magnetic recording applications were introduced in [11]. The idea of partitioning the underlying block code by minimizing the overlap of its rows of circulants (so called minimum overlap (MO)) was recently introduced and applied to AWGN channels in [12]. In this paper, we present the first study of NB-SC codes designed for practical Flash channels. The underlying block codes we focus on are circulant-based (CB) codes. Our combinatorial approach to design NB-SC codes comprises three stages. The first two stages aim at optimizing the unlabeled graph of the SC code (the graph of the SC code with all edge weights set to 1), while the third stage aims at optimizing the edge weights. The three consecutive stages are: 1) We operate on the binary protograph of the SC code, and express the number of subgraphs we want to minimize in terms of the overlap parameters, which characterize the partitioning of the block code. Then, we solve this discrete optimization problem to determine the optimal overlap parameters. We call this new partitioning technique the optimal overlap (OO) partitioning. 2) Given the optimal partitioning, we then apply a new heuristic program to optimize the circulant powers of the underlying block code to further reduce the number of problematic subgraphs in the unlabeled graph of the SC code. We call this heuristic program the circulant power optimizer (CPO). 3) Having optimized the underlying topology using the first two stages (OO-CPO), in the last stage, we focus on the edge weight processing in order to remove as many as possible of the remaining detrimental GASTs in the NB-SC code. To achieve this goal, we use the WCM framework [3], [5]. We also enumerate the minimum cardinality sets of edge weight changes that are candidates for the GAST removal. The three stages are necessary for the NB-SC code design procedure. We demonstrate the advantages of our code design approach over approaches that use CV partitioning and MO partitioning in the context of column weight 3 SC codes. The rest of the paper is organized as follows. In Section II, we present some preliminaries. In Section III, we detail the theory of the OO partitioning in the context of column weight 3 SC codes. The CPO is then described in Section IV. Next, in Section V, we propose a further discussion about the WCM framework. Our NB-SC code design steps and simulation results are presented in Section VI. Finally, the paper is concluded in Section VII. II. P RELIMINARIES In this section, we review the construction of NB-SC codes, as well as the CV and MO partitioning techniques. Furthermore, we recall the definition of GASTs and the key idea of the WCM framework. Throughout this paper, each column (resp., row) in a paritycheck matrix corresponds to a variable node (VN) (resp., check node (CN)) in the equivalent graph of the matrix. Moreover, each non-zero entry in a parity-check matrix corresponds to an edge in the equivalent graph of the matrix. Let H be the parity-check matrix of the underlying regular non-binary CB code that has column weight (VN degree) γ and row weight (CN degree) κ. The binary image of H, which is Hb , consists of γκ circulants. Each circulant is of the form σ fi,j , where i, 0 ≤ i ≤ γ − 1, is the row group index, j, 0 ≤ j ≤ κ − 1, is the column group index, and σ is the p × p identity matrix cyclically shifted one unit to the left (a circulant permutation matrix). Circulant powers are fi,j , ∀i and ∀j. Array-based (AB) codes are CB codes with fi,j = ij, κ = p, and p prime. In this paper, the underlying block codes we use to design SC codes are CB codes with no zero circulants. The NB-SC code is constructed as follows. First, Hb is partitioned into m + 1 disjoint components (of the same size as Hb ): Hb0 , Hb1 , . . . , Hbm , where m is defined as the memory of the SC code. Each component Hby , 0 ≤ y ≤ m, contains some of the γκ circulants of Hb and zero circulants elsewhere Pm b b such that H = y=0 Hy . In this work, we focus on m = 1, i.e., Hb = Hb0 +Hb1 . Second, Hb0 and Hb1 are coupled together L times (see [9] and [11]) to construct the binary image of the parity-check matrix of the NB-SC code, HbSC , which is of size (L+1)γp×Lκp. A replica is any (L+1)γp×κp submatrix of   bT T HbSC that contains HbT and zero circulants elsewhere 0 H1 (see [12]). Replicas are denoted by Rr , 1 ≤ r ≤ L. Overlap parameters for partitioning as well as circulant powers can be selected to enhance the properties of HbSC . Third, the matrix H is generated by replacing each 1 in Hb with a value ∈ GF(q)\{0} (we focus on q = 2λ ≥ 4). Fourth, the parity-check matrix of the NB-SC code, HSC , is constructed by applying the partitioning and coupling scheme described above to H. The binary protograph matrix (BPM) of a general binary CB matrix is the matrix resulting from replacing each p × p non-zero circulant with 1, and each p × p zero circulant with bp 0. The BPMs of Hb , Hb0 , and Hb1 are Hbp , Hbp 0 , and H1 , b respectively, and they are all of size γ × κ. The BPM of HSC bp is Hbp SC , and it is of size (L + 1)γ × Lκ. This HSC also has L replicas, Rr , 1 ≤ r ≤ L, but with 1 × 1 circulants. A technique for partitioning Hb to construct HbSC is the CV partitioning [9], [11]. In this technique, a vector of ascending non-negative integers, ζ = [ζ0 ζ1 . . . ζγ−1 ], is used to partition Hb into Hb0 and Hb1 . The matrix Hb0 has all the circulants in Hb with the indices {(i, j) : j < ζi }, and zero circulants elsewhere, and the matrix Hb1 is Hb − Hb0 . Another recently introduced partitioning technique is the MO partitioning [12], in which Hb is partitioned into Hb0 and Hb1 such that the overlap of each pair of rows of circulants in both Hb0 and Hb1 is minimized. Moreover, the MO partitioning assumes balanced partitioning between Hb0 and Hb1 , and also balanced distribution of circulants among the rows in each of them. The MO partitioning significantly outperforms the CV partitioning [12]. In this paper, we demonstrate that the new OO-CPO technique outperforms the MO technique. GASTs are the objects that dominate the error floor of NB codes on asymmetric channels, e.g., practical Flash channels. We recall the definitions of GASTs and unlabeled GASTs. Definition 1. (cf. [3]) Consider a subgraph induced by a subset V of VNs in the Tanner graph of an NB code. Set all the VNs in V to values ∈ GF(q)\{0} and set all other VNs to 0. The set V is said to be an (a, b, d1 , d2 , d3 ) general absorbing set of type two (GAST) over GF(q) if the size of V is a, the number of unsatisfied CNs connected to V is b, the number of degree-1 (resp., 2 and > 2) CNs connected to V is d1 (resp., d2 and d3 ), d2 > d3 , all the unsatisfied CNs connected to V (if any) have either degree 1 or degree 2, and each VN in V is connected to strictly more satisfied than unsatisfied neighboring CNs (for some set of given VN values). Definition 2. (cf. [3]) Let V be a subset of VNs in the unlabeled Tanner graph of an NB code. Let O (resp., T and H) be the set of degree-1 (resp., 2 and > 2) CNs connected to V. This graphical configuration is an (a, d1 , d2 , d3 ) unlabeled GAST (UGAST) if it satisfies the following two conditions: 1) |V| = a, |O| = d1 , |T | = d2 , |H| = d3 , and d2 > d3 . 2) Each VN in V is connected to strictly more neighbors in {T ∪ H} than in O. Examples on GASTs and UGASTs are shown in Fig. 1. The WCM framework [3], [5] removes a GAST by careful processing of its edge weights. The key idea of this framework is to represent the GAST in terms of a set of submatrices of the GAST adjacency matrix. These submatrices are the WCMs, and they have the property that once the edge weights of the GAST are processed to force the null spaces of the WCMs to have a particular property, the GAST is completely removed from the Tanner graph of the NB code (see [3] and [5]). III. OO PARTITIONING : T HEORETICAL A NALYSIS In order to simultaneously reduce the number of multiple UGASTs, we determine a common substructure in them, then minimize the number of instances of this substructure in the unlabeled Tanner graph of the SC code (the graph of HbSC ) [11]. We propose our new partitioning scheme in the context of SC codes with γ = 3 (the scheme can be extended to higher column weights). For the overwhelming majority of dominant GASTs we have encountered in NB codes with γ = 3 simulated over Flash channels, the (3, 3, 3, 0) UGAST occurs as a common substructure most frequently [3], [5] (see Fig. 1). Thus, we focus on the removal of (3, 3, 3, 0) UGASTs. (a) (b) Fig. 1. (a) Two dominant GASTs for NB codes with γ = 3 over Flash; a (4, 2, 2, 5, 0) and a (6, 0, 0, 9, 0) GASTs. Appropriate edge weights (w’s) are assumed. (b) A (3, 3, 3, 0) UGAST (γ = 3). A cycle of length 2z in the graph of Hbp SC (the binary protograph of the SC code), which is defined by the non-zero entries {(h1 , `1 ), (h2 , `2 ), . . . , (h2z , `2z )} in Hbp SC , results in p cycles of length 2z in the graph of HbSC if and only if [13], [14]: z z X X fh2e−1 ,`2e−1 ≡ fh2e ,`2e (mod p), (1) e=1 e=1 where fh,` is the power of the circulant indexed by (h, `) in HbSC . Otherwise, this cycle results in p/β cycle(s) of length 2zβ in the graph of HbSC , where β is an integer ≥ 2 that divides p [13]. It is clear from Fig. 1(b) that the (3, 3, 3, 0) UGAST is a cycle of length 6. Thus, and motivated by the above fact, our OO partitioning aims at deriving the overlap parameters of Hbp that result in the minimum number of cycles of length 6 in the graph of Hbp SC , which is the binary protograph of the SC code. Then, we run the CPO to further reduce the number of (3, 3, 3, 0) UGASTs in the graph of HbSC (which is the unlabeled graph of the SC code) by breaking the condition in (1) (with z = 3 for cycles of length 6) for as many cycles in the optimized graph of Hbp SC as possible. The goal here is to minimize the number of cycles of length 6 in the binary protograph of the SC code via the OO partitioning of Hbp , which is also the OO partitioning of Hb . To achieve this goal, we establish a discrete optimization problem by expressing the number of cycles of length 6 in the graph of Hbp SC as a function of the overlap parameters and standard code parameters, then solve for the optimal overlap parameters. We start off with the following lemma. Lemma 1. In the Tanner graph of an SC code with parameters γ = 3, κ, p = 1, m = 1, and L (which is the binary protograph), the number of cycles of length 6 is given by: F = LFs + (L − 1)Fd , (2) where Fs is the number of cycles of length 6 that have their VNs spanning only one particular replica (say R1 ), and Fd is the number of cycles of length 6 that have their VNs spanning two particular consecutive replicas (say R1 and R2 ). Proof. From [12, Lemma 1], the maximum number of consecutive replicas spanned by the 3 VNs of a cycle of length 6 in an SC code with m = 1 is 2. Thus, the VNs of any cycle of length 6 span either one replica or two consecutive replicas. Since there exist L replicas and L − 1 distinct pairs of consecutive replicas, and because of the repetitive nature of the SC code, (2) follows. Let the overlapping set of x rows of a binary matrix be the set of positions in which all the x rows have 1’s simultaneously (overlap). Now, define the overlap parameters as follows: • • • • ti (resp., ti+3 ), 0 ≤ i ≤ 2, is the number of 1’s in row bp bp i of Hbp 0 (resp., H1 ). From the definitions of H0 and bp H1 , ti+3 = κ − ti . ti1 ,i2 , 0 ≤ i1 ≤ 2, 0 ≤ i2 ≤ 2, and i2 > i1 , is the size of the overlapping set of rows i1 and i2 of Hbp 0 . ti3 ,i4 , i3 = i1 + 3, i4 = i2 + 3, and i4 > i3 , is the size of the overlapping set of rows i1 and i2 of Hbp 1 . From the definitions, ti3 ,i4 = κ − ti1 − ti2 + ti1 ,i2 . t0,1,2 (resp., t3,4,5 ) is the size of the overlapping set of bp rows 0, 1, and 2 of Hbp 0 (resp., H1 ). Moreover, t3,4,5 = κ − (t0 + t1 + t2 ) + (t0,1 + t0,2 + t1,2 ) − t0,1,2 . Let [x]+ = max(x, 0). We define the following functions to be used in Theorem 1: + A(t0,1 , t0,2 , t1,2 , t0,1,2 ) = [t0,1,2 (t0,1,2 − 1)(t1,2 − 2)] + + [t0,1,2 (t0,2 − t0,1,2 )(t1,2 − 1)] + + [(t0,1 − t0,1,2 )t0,1,2 (t1,2 − 1)] + + [(t0,1 − t0,1,2 )(t0,2 − t0,1,2 )t1,2 ] , (3) B(t0 , t1 , t2 , t0,1 , t0,2 , t1,2 , t0,1,2 ) + = [t0,1,2 (t0,1 − t0,1,2 )(t1 − t1,2 − 1)] + + [t0,1,2 (t0 − t0,1 − t0,2 + t0,1,2 )(t1 − t1,2 )] + + [(t0,1 − t0,1,2 )(t0,1 − t0,1,2 − 1)(t1 − t1,2 − 2)] + + [(t0,1 − t0,1,2 )(t0 − t0,1 − t0,2 + t0,1,2 )(t1 − t1,2 − 1)] + + [t0,1,2 (t0,2 − t0,1,2 )(t0 − t0,1 − 1)] + + [t0,1,2 (t2 − t0,2 − t1,2 + t0,1,2 )(t0 − t0,1 )] + + [(t0,2 − t0,1,2 )(t0,2 − t0,1,2 − 1)(t0 − t0,1 − 2)] + + [(t0,2 − t0,1,2 )(t2 − t0,2 − t1,2 + t0,1,2 )(t0 − t0,1 − 1)] + + [t0,1,2 (t1,2 − t0,1,2 )(t2 − t0,2 − 1)] + + [t0,1,2 (t1 − t0,1 − t1,2 + t0,1,2 )(t2 − t0,2 )] + + [(t1,2 − t0,1,2 )(t1,2 − t0,1,2 − 1)(t2 − t0,2 − 2)] + + [(t1,2 − t0,1,2 )(t1 − t0,1 − t1,2 + t0,1,2 )(t2 − t0,2 − 1)] , (4) C(κ, t0 , t1 , t2 , t0,1 , t0,2 , t1,2 , t0,1,2 ) + + + + + + = [t3,4 t0,1,2 (t1,2 − 1)] + [t3,4 (t0,2 − t0,1,2 )t1,2 ] + [t3,5 t0,1,2 (t0,1 − 1)] + [t3,5 (t1,2 − t0,1,2 )t0,1 ] + [t4,5 t0,1,2 (t0,2 − 1)] + [t4,5 (t0,1 − t0,1,2 )t0,2 ] , and (5) D(t0 , t1 , t2 , t0,1 , t0,2 , t1,2 , t0,1,2 ) + = [t0,1 (t2 − t0,2 − t1,2 + t0,1,2 )(t2 − t1,2 − 1)] + + [t0,1 (t1,2 − t0,1,2 )(t2 − t1,2 )] + + [t0,2 (t1 − t0,1 − t1,2 + t0,1,2 )(t1 − t0,1 − 1)] + + [t0,2 (t0,1 − t0,1,2 )(t1 − t0,1 )] + + [t1,2 (t0 − t0,1 − t0,2 + t0,1,2 )(t0 − t0,2 − 1)] + + [t1,2 (t0,2 − t0,1,2 )(t0 − t0,2 )] . (6) Theorem 1 uses combinatorics to give the exact expressions for Fs and Fd in terms of the above overlap parameters. Theorem 1. In the Tanner graph of an SC code with parameters γ = 3, κ, p = 1, m = 1, and L (which is the binary protograph), Fs and Fd are computed as follows: Fs = Fs,0 + Fs,1 + Fs,2 + Fs,3 , and Fd = Fd,0 + Fd,1 + Fd,2 + Fd,3 , (7) (8) where Fs,0 , Fs,1 , Fs,2 , Fs,3 , Fd,0 , Fd,1 , Fd,2 , and Fd,3 are: Fs,0 = A(t0,1 , t0,2 , t1,2 , t0,1,2 ), Fs,1 = A(t3,4 , t3,5 , t4,5 , t3,4,5 ), Fs,2 = B(t0 , t1 , t2 , t0,1 , t0,2 , t1,2 , t0,1,2 ), Fs,3 = B(t3 , t4 , t5 , t3,4 , t3,5 , t4,5 , t3,4,5 ), (9) Fd,0 = C(κ, t0 , t1 , t2 , t0,1 , t0,2 , t1,2 , t0,1,2 ), Fd,1 = C(κ, t3 , t4 , t5 , t3,4 , t3,5 , t4,5 , t3,4,5 ), Fd,2 = D(t0 , t1 , t2 , t0,1 , t0,2 , t1,2 , t0,1,2 ), and Fd,3 = D(t3 , t4 , t5 , t3,4 , t3,5 , t4,5 , t3,4,5 ). (10) Proof. The term Fs represents the number of cycles of length 6 that have their VNs spanning h only one ireplica. The nonT zero submatrix of a replica is HbpT HbpT . There are four 0 1 possible cases of arrangement for the CNs of a cycle of length 6 that has its VNs spanning only one replica. These cases are listed below: 1) All the three CNs are within Hbp 0 . The number of cycles of length 6 that have all their CNs inside Hbp 0 is denoted by Fs,0 . 2) All the three CNs are within Hbp 1 . The number of cycles of length 6 that have all their CNs inside Hbp 1 is denoted by Fs,1 . bp 3) Two CNs are within Hbp 0 , and one CN is within H1 . The number of cycles of length 6 in this case is denoted by Fs,2 . bp 4) Two CNs are within Hbp 1 , and one CN is within H0 . The number of cycles of length 6 in this case is denoted by Fs,3 . These four different cases of arrangement are illustrated in the upper panel of Fig. 2. Next, we find the number of cycles of length 6 in each of the four cases in terms of the overlap parameters and standard code parameters, particularly, {κ, t0 , t1 , t2 , t0,1 , t0,2 , t1,2 , t0,1,2 }. In case 1, a cycle of length 6 is comprised of an overlap between rows 0 and 1, an overlap between rows 0 and 2, and an overlap between rows 1 and 2 of Hbp 0 . Note that each overlap must have a distinct associated column index (position) to result in a valid cycle of length 6. The overlap between rows 0 and 1 can be selected among t0,1 possible choices. Among these t0,1 overlaps, there exist t0,1,2 overlaps that have the same associated column indices as some overlaps between other pairs of rows. Thus, these t0,1,2 overlaps need to be considered separately to avoid incorrect counting. The same argument applies when we choose the overlap between the other two pairs of rows. As a result, the number of different ways to choose these overlaps and form a cycle of length 6 is Fs,0 = A(t0,1 , t0,2 , t1,2 , t0,1,2 ), and A is defined in (3). In case 2, the number of cycles of length 6, Fs,1 , is computed exactly as in case 1, but using the overlap parameters of the matrix Hbp 1 . Thus, Fs,1 = A(t3,4 , t3,5 , t4,5 , t3,4,5 ). In case 3, one overlap solely belongs to Hbp 0 , and the two bp other overlaps cross Hbp to H (see Fig. 2). For the overlap 0 1 , we have three options to choose two rows out of three. in Hbp 0 For example, suppose that the overlap is chosen between rows 0 and 1 of Hbp 0 . Then, the cross overlaps will be between bp row 0 of Hbp 0 and row 2 of H1 , and also between row 1 bp bp bp of H0 and row 2 of H1 . Note that since Hbp 0 and H1 are bp the result of partitioning H , there are no overlaps between bp row i of Hbp 0 and row i of H1 , 0 ≤ i ≤ 2. Based on which option of the three is chosen, the number of cycles of length bp 6 is computed using the overlap parameters of Hbp 0 and H1 . The total number of cycles of length 6 in this case is Fs,2 = B(t0 , t1 , t2 , t0,1 , t0,2 , t1,2 , t0,1,2 ), and B is defined in (4). In case 4, the number of cycles of length 6, Fs,3 , is computed as in case 3. The only difference is that in case 4, one overlap solely belongs to Hbp 1 , and the two other bp overlaps cross Hbp to H (see Fig. 2). Consequently, Fs,3 = 0 1 B(t3 , t4 , t5 , t3,4 , t3,5 , t4,5 , t3,4,5 ). On the other hand, the term Fd represents the number of cycles of length 6 that have their VNs spanning two consecutive replicas. The non-zero submatrix of two consecutive replicas is:   bp H0 0  Hbp Hbp  . 0 1 0 Hbp 1 There are four possible cases of arrangement for the CNs and VNs of a cycle of length 6 that has its VNs spanning two consecutive replicas. These cases are listed below: bp 1) All the three CNs are within [Hbp 1 H0 ], two VNs belong to the first replica, and one VN belongs to the second replica. The number of cycles of length 6 in this case is denoted by Fd,0 . bp 2) All the three CNs are within [Hbp 1 H0 ], one VN belongs to the first replica, and two VNs belong to the second replica. The number of cycles of length 6 in this case is denoted by Fd,1 . 3) One CN is within [Hbp 0 0], and two CNs are within bp [Hbp 1 H0 ]. Besides, two VNs belong to the first replica, and one VN belongs to the second replica. The number of cycles of length 6 in this case is denoted by Fd,2 . bp 4) Two CNs are within [Hbp 1 H0 ], and one CN is within bp [0 H1 ]. Besides, one VN belongs to the first replica, and two VNs belong to the second replica. The number of cycles of length 6 in this case is denoted by Fd,3 . These four different cases of arrangement are illustrated in the lower panel of Fig. 2. Next, we find the number of cycles of length 6 in each of the four cases in terms of the overlap parameters and standard code parameters, particularly, {κ, t0 , t1 , t2 , t0,1 , t0,2 , t1,2 , t0,1,2 }. In case 1, two overlaps belong to Hbp 1 in the first replica, and one overlap belongs to Hbp in the second replica (see Fig. 2). 0 For the overlap in Hbp , we have three options to choose two 0 rows out of three. For each option, the two overlaps inside Hbp 1 must have distinct associated column indices (positions) to result in a valid cycle of length 6 (the overlap inside Hbp 0 cannot have the same column index as any of the other two overlaps). Thus, the number of different ways to choose these overlaps and form a cycle of length 6 is given by Fd,0 = C(κ, t0 , t1 , t2 , t0,1 , t0,2 , t1,2 , t0,1,2 ), and C is defined in (5). In case 2, the number of cycles of length 6, Fd,1 , is computed as in case 1. The only difference is that in case 2, one overlap belongs to Hbp 1 in the first replica, and two overlaps belong to Hbp in the second replica (see Fig. 2). 0 Thus, Fd,1 = C(κ, t3 , t4 , t5 , t3,4 , t3,5 , t4,5 , t3,4,5 ). In case 3, one overlap solely belongs to Hbp 0 in the second bp replica, and the two other overlaps cross Hbp 0 to H1 in bp the first replica (see Fig. 2). For the overlap in H0 of the second replica, we have three options to choose two rows out of three. The two overlaps that belong to the first replica must have distinct corresponding column indices (positions). Consequently, the total number of cycles of length 6 in this case is given by Fd,2 = D(t0 , t1 , t2 , t0,1 , t0,2 , t1,2 , t0,1,2 ), and D is defined in (6). In case 4, the number of cycles of length 6, Fd,3 , is computed as in case 3. The only difference is that in case 4, one overlap solely belongs to Hbp 1 in the first replica, and the bp two other overlaps cross Hbp 0 to H1 in the second replica (see Fig. 2). Thus, Fd,3 = D(t3 , t4 , t5 , t3,4 , t3,5 , t4,5 , t3,4,5 ). Note that the operator [.]+ is used to avoid counting options that are not valid. 𝐑1 𝐑1 𝑏𝑝 𝐹𝑠,0 𝐑1 𝑏𝑝 𝑣3 𝐑2 𝑐1 𝑐2 𝐑1 𝑏𝑝 𝐹𝑑,0 𝐹𝑠,2 𝐑2 𝑏𝑝 𝐇1 𝑏𝑝 𝐇1 𝐑1 𝐹𝑠,3 𝐑2 𝑏𝑝 𝑏𝑝 𝐇0 𝐹𝑑,1 𝑏𝑝 𝐇1 𝑏𝑝 𝐇1 𝐹𝑑,2 𝐑2 where α is the number of distinct solutions (optimal vectors). 𝑏𝑝 𝐇0 𝐇1 𝑏𝑝 𝐇1 𝐑1 𝑏𝑝 𝐇0 𝐇0 𝑐3 𝑏𝑝 𝑏𝑝 𝑏𝑝 𝐇0 𝐇0 𝐇0 𝐇1 𝐹𝑠,1 𝐑1 𝑏𝑝 𝑏𝑝 𝐇0 𝐇1 𝑣1 𝑣2 𝐑1 𝑏𝑝 𝐇0 𝐇0 𝑏𝑝 𝐇0 𝑏𝑝 𝐇1 𝑏𝑝 𝐇1 𝐹𝑑,3 𝑏𝑝 𝐇0 𝑏𝑝 𝐇1 Fig. 2. Different cases for the cycle of length 6 (in red) in a γ = 3 SC binary protograph. The upper panel (resp., lower panel) is for the case of the VNs spanning R1 (resp., R1 and R2 ). The main idea of Theorem 1 is that both Fs and Fd can be computed by decomposing each of them into four more tractable terms. Each term represents a distinct case for the existence of a cycle of length 6 in the SC binary protograph, and the union of these cases covers all the existence possibilities. Each case is characterized by the locations of the CNs bp and VNs comprising the cycle with respect to Hbp 0 and H1 of the replica R1 (for Fs ) or the replicas R1 and R2 (for Fd ). Fig. 2 illustrates these eight cases, along with the terms in Fs and Fd that corresponds to each case. Remark 1. Consider the special situation of t0,1,2 = 0 (rows 0, 1, and 2 in Hbp 0 do not have a 3-way overlap). Here, Fs,0 reduces to t0,1 t0,2 t1,2 , which is simply the number of ways to select one position from the overlapping set of each pair. Now, define F ∗ to be the minimum number of cycles of length 6 in the graph of Hbp SC (the binary protograph). Thus, our discrete optimization problem is formulated as follows: F∗ = min t0 ,t1 ,t2 ,t0,1 ,t0,2 ,t1,2 ,t0,1,2 Lemma 2. The total number of OO partitioning choices for an SC code with parameters γ = 3, κ, p = 1, m = 1, and L (which is the binary protograph) given an optimal vector t∗ is given by:   ∗  ∗   ∗  t0 − t∗0,1 t0,1 κ − t∗0 t0 κ N =α ∗ t∗0,2 − t∗0,1,2 t∗0,1,2 t∗1 − t∗0,1 t∗ t   0 ∗ 0,1  t1 − t∗0,1 κ − t∗0 − t∗1 + t∗0,1 , (13) t∗1,2 − t∗0,1,2 t∗2 − t∗0,2 − t∗1,2 + t∗0,1,2 F. (11) The constraints of our optimization problem are the conditions under which the overlap parameters are valid. Thus, these constraints on the seven parameters in (11) are: 0 ≤ t0 ≤ κ, 0 ≤ t0,1 ≤ t0 , t0,1 ≤ t1 ≤ κ − t0 + t0,1 , 0 ≤ t0,1,2 ≤ t0,1 , t0,1,2 ≤ t0,2 ≤ t0 − t0,1 + t0,1,2 , t0,1,2 ≤ t1,2 ≤ t1 − t0,1 + t0,1,2 , t0,2 + t1,2 − t0,1,2 ≤ t2 ≤ κ − t0 − t1 + t0,1 + t0,2 + t1,2 − t0,1,2 , and b3κ/2c ≤ t0 + t1 + t2 ≤ d3κ/2e . (12) The last constraint in (12) guarantees balanced partitioning bp between Hbp 0 and H1 , and it is needed to prevent the case that a group of non-zero elements (a group of 1’s) in either Hbp 0 or Hbp 1 are involved in significantly more cycles than the remaining non-zero elements (the remaining 1’s). The solution of our optimization problem is not unique. However, since all the solutions result in the same number of OO partitioning choices and the same F ∗ , we work with one of these solutions, and call it an optimal vector, t∗ = [t∗0 t∗1 t∗2 t∗0,1 t∗0,2 t∗1,2 t∗0,1,2 ]. Lemma 2 gives the total number of OO partitioning choices. Proof. The goal is to find the number of partitioning choices that achieve a general set of overlap parameters {t0 , t1 , t2 , t0,1 , t0,2 , t1,2 , t0,1,2 } (not necessarily optimal). In particular, we need to find the number of different partitioning choices of an SC code with γ = 3, κ, p = 1, m = 1, and L such that: bp • The number of 1’s in row i, 0 ≤ i ≤ 2, of H0 is ti . • The size of the overlapping set of rows i1 and i2 , 0 ≤ i1 ≤ 2, 0 ≤ i2 ≤ 2, and i2 > i1 , of Hbp 0 is ti1 ,i2 . • The size of the overlapping set of rows 0, 1, and 2 (3-way overlap) of Hbp 0 is t0,1,2 . We factorize the number of partitioning choices, N g , into three more tractable factors: – Choose t0 positions, in which row 0 of Hbp 0 has 1’s, out of κ positions. The number of choices is:   κ N0g = . t0 – Choose t1 positions, in which row 1 of Hbp 0 has 1’s, out of κ positions. Among these t1 positions, there exist t0,1 positions in which row 0 simultaneously has 1’s. The number of choices is:    t0 κ − t0 N1g = . t0,1 t1 − t0,1 – Choose t2 positions, in which row 2 of Hbp 0 has 1’s, out of κ positions. Among these t2 positions, there exist t0,1,2 positions in which rows 0 and 1 simultaneously have 1’s, t0,2 positions in which only rows 0 simultaneously has 1’s, and t1,2 positions in which only rows 1 simultaneously has 1’s. The number of choices is:     t0,1 t0 − t0,1 t1 − t0,1 g N2 = t t0,2 − t0,1,2 t − t0,1,2  0,1,2 1,2 κ − t0 − t1 + t0,1 . t2 − t0,2 − t1,2 + t0,1,2 In conclusion, the number of partitioning choices that achieve a general set of overlap parameters is N0g N1g N2g . The solution of the optimization problem in (11) is not unique, and there are α distinct solutions (optimal vectors) that all achieve F ∗ . Because of the symmetry of these α optimal vectors, each of them corresponds to the same N0 N1 N2 partitioning choices. The factors N0 , N1 , and N2 are obtianed by replacing each t with t∗ (from an optimal vector t∗ ) in the equations of N0g , N1g , and N2g , respectively. Thus, the total number of OO partitioning choices given an optimal vector t∗ is N = αN0 N1 N2 , which proves Lemma 2. Remark 2. The first seven constraints of the optimization problem, which are stated in (12), can be easily verified from (13) in Lemma 2 by replacing each t∗ with t. IV. C IRCULANT P OWER O PTIMIZATION ∗ bp After picking an optimal vector t to partition H and design Hbp SC , we run our heuristic CPO to further reduce the number of (3, 3, 3, 0) UGASTs in the graph of HbSC , which has γ = 3. The steps of the CPO are: 1) Initially, assign circulant powers as in AB codes to all the γκ 1’s in Hbp (results in no cycles of length 4 in Hb and HbSC ). bp 2) Design Hbp and t∗ such that Hbp SC2 using H SC2 contains only two replicas, R1 and R2 . Circulant powers bp of the 1’s in Hbp SC2 are copied from the 1’s in H . bp 3) Locate all the cycles of lengths 4 and 6 in HSC2 . 4) Specify the cycles of length 6 in Hbp SC2 that have (1) satisfied, and call them active cycles. Let 2Fsa (resp., Fda ) be the number of active cycles having their VNs spanning only R1 or only R2 (resp., both R1 and R2 ). 5) Compute the number of (3, 3, 3, 0) UGASTs in HbSC using the following formula: FSC = (LFsa + (L − 1)Fda ) p. (14) Hbp SC2 6) Count the number of active cycles each 1 in is involved in. Give weight 1 (resp., 2) to the number of active cycles having their VNs spanning only R1 or only R2 (resp., both R1 and R2 ). 7) Map the counts from step 6 to the 1’s in Hbp , and sort these 1’s in a list descendingly according to the counts. 8) Pick a subset of 1’s from the top of this list, and change the circulant powers associated with them. 9) Using these interim new powers, do steps 4 and 5. 10) If FSC is reduced while maintaining no cycles of length 4 in HbSC , update FSC and the circulant powers, then go to step 6. Otherwise, return to step 8. 11) Iterate until the target FSC is achieved. Note that step 8 is performed heuristically. (a) (b) Hbp Hb ) Fig. 3. (a) The OO partitioning of (or of the SC code in Example 1. bp Entries with circles (resp., squares) are assigned to Hbp 0 (resp., H1 ). (b) The b circulant power arrangement for the circulants in H . Example 1. Suppose we want to design an SC code with γ = 3, κ = 7, p = 7, m = 1, and L = 30 using the OO partitioning and the CPO. Solving the optimization problem in (11) yields an optimal vector t∗ = [3 4 3 0 1 2 0], which gives F ∗ = 1170 cycles of length 6 in the graph of Hbp SC . Fig. 3(a) shows how the partitioning is applied on Hbp (or Hb ). Next, applying the CPO results in only 203 (3, 3, 3, 0) UGASTs in the unlabeled graph of the SC code, which is the graph of HbSC . Fig. 3(b) shows the final circulant power arrangement for all circulants in Hb . The OO-CPO technique for designing HbSC is based on solving a set of equations, then applying a heuristic program on two replicas to optimize the circulant powers. Moreover, the OO partitioning has orders of magnitude fewer number of partitioning choices compared to the MO partitioning (see [12, Lemma 3]). We can even use any choice of the OO partitioning choices without having to compare their performances explicitly. All these reasons demonstrate that the OO-CPO technique is not only better in performance (see Section VI for details), but also much faster than the MO technique. V. WCM F RAMEWORK : O N T HE R EMOVAL OF GAST S After applying the OO-CPO technique to optimize the unlabeled graph of the SC code, we optimize the edge weights. In particular, we use the WCM framework [3], [5] to remove GASTs from the labeled graph of the NB-SC code through edge weight processing. There are multiple parameters that control the difficulty of the removal of a certain GAST from the Tanner graph of a code. The number of distinct WCMs associated with the UGAST and the minimum number of edge weight changes needed to remove the GAST, denoted by EGAST,min , are among these parameters. A third parameter is the number of sets of edge weight changes that have cardinality EGAST,min and are candidates for the GAST removal process. The first two parameters are studied in [5]. We discuss the third parameter in this section. As the number of candidate sets of cardinality EGAST,min increases, the difficulty of the GAST removal decreases. In this section, unless otherwise stated, when we say nodes are “connected”, we mean they are “directly connected” or they are “neighbors”. The same applies conceptually when we say an edge is “connected” to a node or vice versa. Remark 3. A GAST is removed by performing EGAST,min edge weight changes for edges connected to degree-2 CNs only (see also [5]). Whether a candidate set of edge weight changes indeed results in the GAST removal or not is determined by checking the null spaces of the WCMs [3], [5]. To minimize the number of edge weight changes performed to remove a GAST, we need to work on the VNs that are connected to the maximum number of unsatisfied CNs. Thus,  and EGAST,min = g − bvm + 1 (see [5]), where g = γ−1 2 bvm is the maximum number of existing unsatisfied CNs per VN in the GAST. Define Emu as the topological upper bound on EGAST,min and d1,vm as the maximum number of existing degree-1 CNs per VN in the GAST. Thus, from [5]: Emu = g − d1,vm + 1 ≥ EGAST,min . (15) Note that (15) follows from d1,vm ≤ bvm . In this section, we study GASTs with b = d1 , which means the upper bound is achieved, i.e., EGAST,min = Emu . Moreover, for simplicity, we assume that all the VNs that are connected to d1,vm degree1 CNs each are only connected to CNs of degree ≤ 2. Theorem 2. Consider an (a, b, d1 , d2 , d3 ) GAST, with b = d1 , in an NB code defined over GF (q) that has column weight γ and no cycles of length 4. The number of sets of edge weight changes with cardinality EGAST,min (or Emu ) that are candidates for the GAST removal process is given as follows. If d1,vm 6= g:   γ − d1,vm Smu = avm (2(q − 2))Emu , (16) Emu where avm is the number of VNs connected to d1,vm degree-1 CNs each. If d1,vm = g:  Smu =  avm   γ+1 − nco 2(q − 2), 2 (17) where nco is the number of degree-2 CNs connecting any two of these avm VNs. Proof. Whether d1,vm 6= g or not, to minimize the number of edge weight changes, we need to target the VNs that are connected to the maximum number of unsatisfied CNs. By definition, and since b = d1 , the number of VNs of this type is avm , and each is connected to d1,vm unsatisfied CNs. In the case of d1,vm 6= g, which is the general case,  for any 1,vm VN of the avm pertinent VNs, there are γ−d different Emu ways of selecting Emu degree-2 satisfied CNs connected to this VN. Each of these CNs has 2 edges we can change their weights (not simultaneously). Moreover, each edge can have (q − 2) different new weights (excluding the 0 and the current weight). Thus, the number of candidate sets is:   γ − d1,vm Emu (q − 2)Emu , (18) Smu = avm 2 Emu which is a rephrased version of (16). In the case of d1,vm = g, from (15), Emu = 1 (the GAST is removed by a single edge weight change). Moreover,   γ+1 γ − d1,vm = γ − g = . (19) 2 Substituting (19) and Emu = 1 into (18) gives that the number of candidate sets follows the inequality:   γ+1 2(q − 2). (20) Smu ≤ avm 2 In (20), the equality is achieved only if there are no shared degree-2 CNs between the VNs that have g unsatisfied CNs, i.e., nco = 0. Otherwise, nco has to be subtracted from , which proves (17). avm γ+1 2 Note that the subtraction of nco is not needed if d1,vm 6= g. The reason is that if d1,vm 6= g (or Emu 6= 1) multiple edges connected to the same CN cannot exist in the same candidate set. Additionally, since our codes have girth at least 6, there does not exist more than one degree-2 CN connecting the same two VNs in a GAST. (a) (b) Fig. 4. (a) A (7, 9, 9, 13, 0) GAST (γ = 5). (b) An (8, 0, 0, 16, 0) GAST (γ = 4). Appropriate non-binary edge weights are assumed. Example 2. Consider the (7, 9, 9, 13, 0) GAST over GF(q) in Fig. 4(a) (γ = 5). For this GAST, g = 2, d1,vm = 2, avm = 3, and from (15), EGAST,min = Emu = 1. Moreover, nco = 1 (only one shared degree-2 CN between two VNs having two unsatisfied CNs each). Thus, from (17), the number of candidate sets of cardinality 1 is: Smu = (3(3) − 1)(2)(q − 2) = 16(q − 2). (21) Contrarily, for the (8, 0, 0, 16, 0) GAST over GF(q) in Fig. 4(b) (γ = 4), g = 1, d1,vm = 0, avm = 8, and from (15), EGAST,min = Emu = 2. Thus, from (16) (the general relation), the number of candidate sets of cardinality 2 is:   4 Smu = 8 (2)2 (q − 2)2 = 192(q − 2)2 . (22) 2 VI. C ODE D ESIGN S TEPS AND S IMULATION R ESULTS In this section, we present our γ = 3 NB-SC code design approach for Flash memories, and the experimental results demonstrating its effectiveness. The steps of our OO-CPOWCM approach are: 1) Specify the code parameters, κ, p, and L, with m = 1. 2) Solve the optimization problem in (11) for an optimal vector of overlap parameters, t∗ . 3) Using Hbp and t∗ , apply the circulant power optimizer to reach the powers of the circulants in Hb and HbSC . Now, the binary image, HbSC , is designed. 4) Assign the edge weights in Hb to generate H. Next, partition H using t∗ , and couple the components to construct HSC . 5) Using initial simulations over a practical Flash channel and combinatorial techniques, determine the set G of GASTs to be removed from the graph of HSC . 6) Use the WCM framework (see [3, Algorithm 2]) to remove as many as possible of the GASTs in G. In this section, the CV and MO results proposed are the best that can be achieved by these two techniques [11], [12]. TABLE I N UMBER OF (3, 3, 3, 0) UGAST S IN SC CODES WITH γ = 3, m = 1, AND L = 30 DESIGNED USING DIFFERENT TECHNIQUES . Design technique Uncoupled with AB SC CV with AB SC MO with AB SC best with AB SC OO-CPO with CB κ=p=7 8820 3290 609 609 203 Number of (3, 3, 3, 0) UGASTs κ = p = 11 κ = p = 13 κ = p = 17 36300 60840 138720 14872 25233 59024 3850 6851 15997 3520 2596 5356 14960 We start our experimental results with a table comparing the number of (3, 3, 3, 0) UGASTs in SC codes designed using various techniques. All the SC codes have γ = 3, m = 1, and L = 30. AB codes are used as the underlying block codes in all the SC code design techniques we are comparing the proposed OO-CPO technique against. Table I demonstrates reductions in the number of (3, 3, 3, 0) UGASTs achieved by the OO-CPO technique over the MO technique (resp., the CV technique) that ranges between 6.5% and 66.7% (resp., 74.7% and 93.8%). More intriguingly, the table shows that the OO-CPO technique provides lower number of (3, 3, 3, 0) UGASTs than the best that can be achieved if AB underlying block codes are used. Note that this “best” is reached using exhaustive search, and that is the reason why we could not provide its counts for κ = p > 11. Next, we provide simulation results verifying the performance gains achieved by our NB-SC code design approach for Flash memories. The Flash channel we use is a practical Flash channel, which is the normal-Laplace mixture (NLM) Flash channel [4]. Here, we use 3 reads, and the sector size is 512 bytes. We define RBER as the raw bit error rate [3], and UBER as the uncorrectable bit error rate [3]. One formulation of UBER, which is recommended by industry, is the frame error rate (FER) divided by the sector size in bits. Simulations were done in software on a high speed cluster of machines. All the NB-SC codes we simulated are defined over GF(4), and have γ = 3, κ = p = 19, m = 1, and L = 20 (block length = 14440 bits and rate ≈ 0.834). Code 1 is uncoupled (AB). Code 2 is designed using the CV technique. Code 3 is designed using the OO technique (with no CPO applied). The underlying block codes of Codes 2 and 3 are AB codes. Code 4 is designed using the OO-CPO technique. The edge weights of Codes 1, 2, 3, and 4 are selected randomly. Code 5 (resp., Code 6) is the result of applying the WCM framework to Code 1 (resp., Code 4) to optimize the edge weights. Code 1 (resp., Code 2 and Code 4) has 129960 (resp., 55366 and 16340) (3, 3, 3, 0) UGASTs. Additionally, Code 1 (resp., Code 2 and Code 4) has 4873500 (resp., 2002353 and 1156264) (4, 4, 4, 0) UGASTs. The (4, 4, 4, 0) UGAST is the second most common substructure in the dominant GASTs of NB codes with γ = 3 simulated over Flash channels. −6 10 −7 10 −8 UBER 10 −9 10 1: Uncoupled w AB, rand weights 5: Uncoupled w AB, opt weights 2: SC CV w AB, rand weights 3: SC OO w AB, rand weights 4: SC OO−CPO w CB, rand weights 6: SC OO−CPO w CB, opt weights −10 10 −11 10 0.001 0.002 0.003 0.004 0.006 0.008 0.01 RBER 0.02 Fig. 5. Simulation results over the NLM Flash channel for SC codes with γ = 3, m = 1, and L = 20 designed using different techniques. Fig. 5 demonstrates the performance gains achieved by each stage of our NB-SC code design approach. Code 3 outperforms Code 2 by about 0.6 of an order of magnitude, which is the gain of the first stage (OO). Code 4 outperforms Code 3 by about 0.7 of an order of magnitude, which is the gain of the second stage (CPO). Code 6 outperforms Code 4 by about 1.2 orders of magnitude, which is the gain of the third stage (WCM). Moreover, the figure shows that the NB-SC code designed using our OO-CPO-WCM approach, which is Code 6, achieves about 200% (resp., more than 500%) RBER gain compared to Code 2 (resp., Code 1) over a practical Flash channel. An intriguing observation we have encountered while performing these simulations is the change in the error floor properties when we go from Code 2 to Code 4. In particular, while the (6, 0, 0, 9, 0) GAST was a dominant object in the case of Code 2, we have encountered very few (6, 0, 0, 9, 0) GASTs in the error profile of Code 4. VII. C ONCLUSION We proposed a combinatorial approach for the design of NB-SC codes optimized for practical Flash channels. The OOCPO technique efficiently optimizes the underlying topology of the NB-SC code, then the WCM framework optimizes the edge weights. NB-SC codes designed using our approach have reduced number of detrimental GASTs, thus outperforming existing NB-SC codes over Flash channels. The proposed approach can help increase the reliability of ultra dense storage devices, e.g., emerging 3-D Flash devices. ACKNOWLEDGEMENT The research was supported in part by a grant from ASTCIDEMA and by NSF. R EFERENCES [1] J. Wang, K. Vakilinia, T.-Y. Chen, T. Courtade, G. Dong, T. Zhang, H. Shankar, and R. Wesel, “Enhanced precision through multiple reads for LDPC decoding in flash memories,” IEEE J. Sel. Areas Commun., vol. 32, no. 5, pp. 880–891, May 2014. [2] Y. Maeda and H. Kaneko, “Error control coding for multilevel cell Flash memories using nonbinary low-density parity-check codes,” in Proc. 24th IEEE DFTS, Chicago, IL, USA, Oct. 2009, pp. 367–375. [3] A. Hareedy, C. Lanka, and L. Dolecek, “A general non-binary LDPC code optimization framework suitable for dense Flash memory and magnetic storage,” IEEE J. Sel. Areas Commun., vol. 34, no. 9, pp. 2402–2415, Sep. 2016. [4] T. Parnell, N. Papandreou, T. Mittelholzer, and H. Pozidis, “Modelling of the threshold voltage distributions of sub-20nm NAND flash memory," in Proc. IEEE GLOBECOM, Austin, TX, USA, Dec. 2014, pp. 2351–2356. [5] A. Hareedy, C. Lanka, N. Guo, and L. Dolecek, “A combinatorial methodology for optimizing non-binary graph-based codes: theoretical analysis and applications in data storage,” Jun. 2017. [Online]. Available: http://arxiv.org/abs/1706.07529 [6] A. J. Felstrom and K. S. Zigangirov, “Time-varying periodic convolutional codes with low-density parity-check matrix,” IEEE Trans. Inf. Theory, vol. 45, no. 6, pp. 2181–2191, Sep. 1999. [7] S. Kudekar, T. J. Richardson, and R. L. Urbanke, “Spatially coupled ensembles universally achieve capacity under belief propagation,” IEEE Trans. Inf. Theory, vol. 59, no. 12, pp. 7761–7813, Dec. 2013. [8] A. E. Pusane, R. Smarandache, P. O. Vontobel, and D. J. Costello, “Deriving good LDPC convolutional codes from LDPC block codes,” IEEE Trans. Inf. Theory, vol. 57, no. 2, pp. 835–857, Feb. 2011. [9] D. G. Mitchell, L. Dolecek, and D. J. Costello, “Absorbing set characterization of array-based spatially coupled LDPC codes," in Proc. IEEE ISIT, Honolulu, HI, Jun. 2014, pp. 886–890. [10] A. R. Iyengar, M. Papaleo, P. H. Siegel, J. K. Wolf, A. Vanelli-Coralli, and G. E. Corazza, “Windowed decoding of protograph-based LDPC convolutional codes over erasure channels,” IEEE Trans. Inf. Theory, vol. 58, no. 4, pp. 2303–2320, Apr. 2012. [11] H. Esfahanizadeh, A. Hareedy, and L. Dolecek, “Spatially-coupled codes optimized for magnetic recording applications,” IEEE Trans. Magn., vol. 53, no. 2, pp. 1–11, Feb. 2016. [12] H. Esfahanizadeh, A. Hareedy, and L. Dolecek, “A novel combinatorial framework to construct spatially-coupled codes: minimum overlap partitioning,” in Proc. IEEE ISIT, Aachen, Germany, Jun. 2017, pp. 1693– 1697. [13] A. Bazarsky, N. Presman, and S. Litsyn, “Design of non-binary quasicyclic LDPC codes by ACE optimization,” in Proc. IEEE ITW, Sevilla, Spain, Sep. 2013, pp. 1–5. [14] M. Fossorier, “Quasi-cyclic low-density parity-check codes from circulant permutation matrices,” IEEE Trans. Inf. Theory, vol. 50, no. 8, pp. 1788–1793, Aug. 2004.
7cs.IT
arXiv:1712.08401v2 [math.RT] 16 Jan 2018 STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS GUNTER MALLE AND ALEXANDRE ZALESSKI Abstract. Let G be a finite group and, for a prime p, let S be a Sylow p-subgroup of G. A character χ of G is called Sylp -regular if the restriction of χ to S is the character of the regular representation of S. If, in addition, χ vanishes at all elements of order divisible by p, χ is said to be Steinberg-like. For every finite simple group G we determine all primes p for which G admits a Steinberg-like character, except for alternating groups in characteristic 2. Moreover, we determine all primes for which G has a projective F G-module of dimension |S|, where F is an algebraically closed field of characteristic p. 1. Introduction Let G be a finite group and, for a prime p, let S be a Sylow p-subgroup of G. A character χ of G is called Sylp -vanishing if χ(u) = 0 for every 1 6= u ∈ S; and if, additionally, χ(1) = |S| then we say that χ is Sylp -regular. If χ(g) = 0 whenever |g| is divisible by p then χ is called p-vanishing; and if, additionally, χ(1) = |S| then we say that χ is Steinberg-like. Steinberg-like and Sylp -regular characters for Chevalley groups in defining characteristic p are studied in [17]. Specifically, for all simple groups of Lie type in characteristic p except Bn (q), n = 3, 4, 5, and Dn (q), n = 4, 5, the Steinberg-like characters for the prime p have been determined in [17]. Our main motivation to study this kind of characters is their connection with characters of projective indecomposable modules. The study of projective indecomposable modules of dimension |S| was initiated by Malle and Weigel [13]; they obtained a full classification of such modules for arbitrary finite simple groups G assuming that the character of the module has the trivial character 1G as a constituent. In [22], this restriction was removed for simple groups of Lie type with defining characteristic p. Some parts of the proofs there were valid not only for characters of projective modules, but also for Steinberg-like or even Sylp -regular characters. In this paper we complete the classification of projective indecomposable modules of dimension |S| for simple groups G. The first main result is a classification of Steinberg-like characters for simple groups, with the sole exception of alternating groups for the prime p = 2: Theorem 1.1. Let G be a finite non-abelian simple group, p a prime dividing |G| and let χ be a Steinberg-like character of G with respect to p. Then one of the following holds: (1) χ is irreducible, and the triple (G, p, χ(1)) is as in Proposition 3.1; (2) Sylow p-subgroups of G are cyclic and (G, p, χ(1)) is as in Proposition 4.4; (3) G is of Lie type in characteristic p (see [17]); (4) p = 2 and G = PSL2 (q) with q + 1 = 2k ; or Date: January 17, 2018. 2010 Mathematics Subject Classification. 20C15,20C30,20C33. Key words and phrases. characters of projective indecomposable modules, Steinberg-like characters. The first author gratefully acknowledges financial support by SFB TRR 195. 1 2 GUNTER MALLE AND ALEXANDRE ZALESSKI (5) p = 2 and G = An , n ≥ 8. In fact, in many instances we even classify all Sylp -regular characters. Examples for case (5) when n = 2k or 2k + 1 are presented in Corollaries 6.8 and 6.10. We are not aware of any further examples. Our second main result determines reducible projective modules of simple groups of minimal possible dimension |G|p . Theorem 1.2. Let G be a finite non-abelian simple group, p a prime dividing |G| and S a Sylow p-subgroup of G. Then G has a reducible projective Fp G-module of dimension |S| if and only if one of the following holds: (1) G = PSL2 (q), q > 4, |S| = q + 1; (2) G = PSLn (q), n is an odd prime, n6 |(q − 1), |S| = (q n − 1)/(q − 1); (3) G = Ap , |S| = p ≥ 5; (4) G = M11 , |S| = 11; or (5) G = M23 , |S| = 23. Note that irreducible projective Fp G-modules of dimension |G|p are in bijection with irreducible characters of defect 0 of that degree, listed in Proposition 3.1 for simple groups. The paper is built up as follows. After some preliminaries we recall the classification of irreducible Steinberg-like characters in Section 3 (Proposition 3.1). In Section 4 we classify Sylp -regular characters in the case of cyclic Sylow p-subgroups (Proposition 4.4), in Section 5 we treat the sporadic groups (Theorem 5.1). The alternating groups are handled in Section 6 (Theorem 6.4 for p odd, and in Section 6.2 some partial results for p = 2, see Theorems 6.12 and 6.14). The exceptional groups of Lie type are considered in Section 7 (Theorem 7.1). The rest of our paper deals with the classical groups of Lie type. We start off in Section 8 by ruling out the remaining possibilities in defining characteristic from [17]. The case of large Sylow psubgroups for non-defining primes p is settled in Section 9. In Section 10 we discuss the small cases when p > 2, while the proof of our main theorems is achieved in Section 11 by treating the case when p = 2. 2. Preliminaries We start off by fixing some notation. Let Fq be the finite field of q elements and Fq an algebraic closure of Fq . The cardinality of a set X is denoted by |X|. The greatest common divisor of integers m, n is denoted by (m, n); if p is a prime then |n|p is the p-part of n, that is, n = |n|p m, where (m, p) = 1. If (m, n) = m, we write m|n. For a finite group G, Irr(G) is the set of its irreducible characters and Irr1 (G) is the set of all linear characters of G (that is, of degree 1). We denote by 1G the trivial character and by ρreg G the regular character of G. We write S ∈ Sylp (G) to mean that S is a Sylow p-subgroup of G. A group of order coprime to p is called a p′ -group. Further, Z(G), G′ denote the center and the derived subgroup of G, respectively. If H is a subgroup of G then CG (H), NG (H) denote the centraliser and normaliser of H in G, respectively. If χ is a character of G then we write χ|H for the restriction of χ to H. The H-level of χ is the maximal integer l ≥ 0 such that χ|H − l · ρreg H is a proper character of H. If a prime p is fixed then the p-level lp (χ) of χ is the S-level of χ for S ∈ Sylp (G). (For quasi-simple groups with cyclic Sylow p-subgroups irreducible characters of p-level l = 1, 2 are studied in STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 3 [21, 18], respectively.) The inner product of characters λ, µ of G is denoted by (λ, µ), sometimes by (λ, µ)G . The character of G induced from a character µ of H is denoted by µH . Let P ≤ G be finite groups, N a normal subgroup of P and L = P/N . Let F be a field and M an F G-module. Then M N := CM (N ) becomes an F L-module, which is called generalised G M in [2, §70A, p. 667]. If β is the Brauer (or ordinary) restriction of M to L and denoted by rP/N G β for the Brauer (or ordinary) character of L afforded character of M then we also write rP/N by M N . Let e = ep (q) (p > 2, (p, q) = 1) be the minimal integer i > 0 such that q i − 1 is divisible by p. If p = 2 and q is odd then we set e2 (q) = 1 if 4|(q − 1) and e2 (q) = 2 if 4|(q + 1). The next two lemmas follow from the definitions; here G is a finite group and S ∈ Sylp (G). Lemma 2.1. Let χ be a Sylp -regular character of G. Then every linear character occurs in χ|S with multiplicity 1. In particular, (χ|S , 1S ) = 1. If S is abelian then χ|S is multiplicity free. reg Proof. As χ|S = ρreg S , this follows from the corresponding properties of ρS .  Lemma 2.2. Let G = G1 × G2 be a direct product, and let χ1 , χ2 be irreducible characters of G1 , G2 respectively. Then the p-level of χ1 ⊗ χ2 is the product of the p-levels of χ1 and χ2 . Lemma 2.3. Let N be a p′ -subgroup of G normalised by S. Let χ be a faithful Steinberg-like character of G. Then N is abelian and CG (S) = Z(G)Z(S). Proof. Let H = N S. Then χ|H is Steinberg-like. As H is p-solvable, every p-vanishing character is the character of a projective module [15, Lemma 10.16]. As χ(1) = |S|, the module in question is indecomposable. Then χ|H is induced from an irreducible character α, say, of N [15, Thm. 10.13]. As αH (1) = α(1) · |H : N | = α(1) · |S| and χ(1) = |S|, it follows that α(1) = 1. Let N ′ be the derived subgroup of N . Then N ′ is normal in H and α(N ′ ) = 1. Therefore, αH |N ′ = |S| · 1N ′ , that is, N ′ lies in the kernel of αH . Since χ and hence χ|H = αH is faithful, we have N ′ = 1. So N is abelian as claimed. Note that CG (S) = A × Z(S), where A is a p′ -group. Take N = A above, so H = A × S. So now [N, S] = 1 and N is abelian. It follows that in any representation afforded by αH , N consists of scalar matrices. As χ is faithful, we have [N, G] = 1, as required.  Thus, if G is a simple group then CG (S) = Z(S) is a necessary condition for G to have a Steinberg-like character. Remark 2.4. A p′ -subgroup N normalised by a Sylow p-subgroup of G is called a p-signaliser in the theory of finite groups. Thus, Lemma 2.3 tells us that if G admits a faithful Steinberg-like character then every p-signaliser is abelian, and CG (S) = Z(G)Z(S). Lemma 2.5. Let G be a finite group, P a subgroup with (|G : P |, p) = 1, U a normal p-subgroup of P and let L = P/U . Let T, S be Sylow p-subgroups of L, G, respectively. Let χ be a character G (χ). of G and λ = rP/U reg (a) If χ|S = m · ρreg S then λ|T = m · ρT . In other words, lp (χ) = lp (λ). In particular, if χ is Sylp -regular then so is λ. (b) If χ is a p-vanishing character of G then λ is a p-vanishing character of L. ′ (c) Let K := Op (L). If χ is a Steinberg-like or Sylp -regular character of G then so is the character λ|K of K. 4 GUNTER MALLE AND ALEXANDRE ZALESSKI Proof. We can assume that S ≤ P and T = S/U . reg (a) As χ|S = m · ρreg S , it follows that λ|T coincides with m · ρT , whence the claim. (b) We have to show that λ vanishesPat all p-singular elements of L. Let M be a CG-module afforded by χ. Then CM (U ) = { |U1 | u∈U ux | x ∈ M }. Observe that if g ∈ P has projection to L which is not a p′ -element, thenP gu is not a p′ -element for any u ∈ U . Thus, for any such 1 element g, it follows that λ(g) = |U | u∈U χ(gu) = 0 by assumption, whence the claim. (c) Obvious.  Lemma 2.6. Let G = G1 × G2 be a direct product. Suppose that lp (σ) ≥ k for every non-zero Sylp -vanishing (resp., p-vanishing) character σ of G2 . Then lp (χ) ≥ k for every Sylp -vanishing (resp., p-vanishing) character χ of G. Proof. Let S1 ∈ Sylp (G1 ). Set U = S1 and P = NG (U ), so P = NG1 (S1 ) × G2 . Then L := P/U = L1 × G2 , where L1 = NG1 (S1 )/S1 . Let χ be a Sylp -vanishing (resp., p-vanishing) G (χ) be the generalised restriction of χ to L. By Lemma 2.5, λ is a character of G. Let λ = rP/U Sylp -vanishing (resp., p-vanishing) character of L and lp (χ) = lp (λ). Then lp (λ) = lp (λ|G2 ), as L1 is a p′ -group. By assumption, lp (λ|G2 ) ≥ k, whence the result.  Lemma 2.7. P Let G = G1 × G2 , where |G2 |p > 1 and let χ be a p-vanishing character of G. Then χ = i ηi σi , P where ηi ∈ Irr(G1 ) are all distinct, and σi are p-vanishing characters of G2 . In addition, χ1 := i lp (σi )ηi is a p-vanishing character of G1 , and lp (χ1 ) = lp (χ). P Proof. Write χ = i ηi σi , where ηi ∈ Irr(G1 ) are all distinct, and the σi ’s are some characters of P G2 (reducible, in general). Let g ∈ G1 , and let x ∈ G2 be p-singular. Then 0 = χ(gx) = i ηi (g)σi (x). As the characters ηi are linearly independent, it follows that σi (x) = 0 for every i, that is, the σi ’s arePp-vanishing.P P In addition, |G2 |p lp (σi )ηi = i ηi σi (1) i lp (σi )ηi is p-vanishing. Let lp (χ) = P= χ|G1 . So P m; then χ(1) = m|G| = m|G | |G | = η (1)σ (1) = ηi (1)lp (σi )|G|2 , whence m|G1 |p = p 1 p 2 p i i P ηi (1)lp (σi ), as required.  Corollary 2.8. Let G = G1 × G2 and χ be as in Lemma 2.7, and Si a Sylow p-subgroup of Gi , i = 1, 2. Let η1 , . . . , ηk be the irreducible constituents of χ|G1 , and η = η1 + · · · + ηk . Suppose that lp (σ) ≥ m for every non-zero p-vanishing character σ of G2 . Then lp (χ) ≥ m · η(1)/|S1 |. P Proof. Let χ = ηi σi be as in Lemma 2.7. By assumption, σi |S2 = mi · ρreg , where mi ≥ m. P S2 P reg reg So m · ρreg is a subcharacter of σ | . Therefore, (η | · m · ρ ) = ( η )| i S2 i i S1 i i S1 · m · ρS2 is a S2 S2 subcharacter of χ|S1 ×S2 . Now χ(1) ≥ m η(1) |S2 | = m η(1) |G|p /|S1 |. As χ(1) is a multiple of |G|p , we have χ(1) = lp (χ)|G|p , and the result follows.  Proposition 2.9. Let G be a finite group and N ⊳ G a normal subgroup such that G/N is a cyclic p-group. Let χ be a p-vanishing character of G. Then: (a) χ = ψ G for some character ψ of N; (b) if h ∈ N is p-singular and the conjugacy classes of h in G and in N coincide then ψ(h) = 0; (c) if ψ is G-invariant then ψ is p-vanishing. Proof. (a) Let λ ∈ Irr(G) be a linear character that generates Irr(G/N ). As all elements P of G\N are p-singular, χ vanishes on G \ N . It follows that λ · χ = χ. Thus, if we write χ = j aj χj as STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 5 a non-negative linear combination of irreducible characters χj ∈ Irr(G), then aj is constant on orbits under multiplication with λ. It clearly suffices to show the claim for a single orbit, say Pf f χ = pi=1 λi χ′ with χ′ ∈ Irr(G) and f minimal such that λp χ′ = χ′ . f Set M := ker(λp ). Then χ′ |M is irreducible as so is χ′ , so χ = (χ′ |M )G . Now note that f f f / (M \ N ). Thus, as λp χ′ = χ′ , it follows λp generates Irr(G/M ), so λp (m) 6= 1 for m ∈ that χ′ vanishes on M \ N , and hence χ′ |M = ψ M is induced from some ψ ∈ Irr(N ). Then χ = (χ′ |M )G = (ψ M )G = ψ G as claimed. (b) For g ∈ G define the character ψ g of N by ψ g (x) = ψ(gxg −1 ) (x ∈ N ). It is well know that ψ G |N is a sum of pk characters ψ g for suitable g ∈ G. By assumption, ψ g (h) = ψ(h), and hence 0 = χ(h) = pk ψ(h), whence (b). (c) If ψ is G-invariant then ψ g = ψ, and hence χ|N = pk · ψ. It follows that ψ is p-vanishing whence the result.  Remark 2.10. Let G, N, p, χ, ψ be as in Proposition 2.9. Then ψ is not necessarily p-vanishing. Indeed, let C = hci be the cyclic group of order P 4, and let ε be a square root of −1. Define µi ∈ Irr(C) (i = 1, 2, 3, 4) by µi (c) = εi . Then i µi = ρreg character of C. Let D C , the regular P D be the dihedral group of order 8 with normal subgroup C. Then ( i µi ) = ρreg D . One observes D , and hence (2µ + µ + µ )D = ρreg . However, 2µ + µ + µ is not a 2-vanishing that µD = µ 1 2 4 1 2 4 1 3 D character of C. Corollary 2.11. Let G, N be as in Proposition 2.9, and let χ be a Steinberg-like character of G. Suppose that every irreducible character of N of degree at most |N |p is G-invariant. Then χ = ψ G for some Steinberg-like character ψ of N . In particular, if N does not have Steinberg-like characters then neither has G. Proof. By Proposition 2.9(a), χ = ψ G for some character ψ of N . Clearly, ψ(1) = χ(1)/|G : N | = |G|p /|G : N | = |N |p , so, by assumption, every irreducible constituent of ψ is G-invariant. Therefore, so is ψ, and the claim follows from Proposition 2.9(c).  Lemma 2.12. Let G be a finite group and N ⊳ G a normal subgroup of p-power index. Suppose that lp (χ) ≥ m for some integer m > 0 and every p-vanishing character χ of G. Then lp (χ1 ) ≥ m for every p-vanishing character χ1 of N . Proof. Suppose the contrary. Let χ1 be a p-vanishing character of N such that lp (χ1 ) < m. Then G  the induced character χG 1 is p-vanishing and lp (χ1 ) = lp (χ1 ) < m. This is a contradiction. The following fact is well known. Lemma 2.13. Let G be a finite group and N ⊳ G a normal subgroup of p-power index. Let F be an algebraically closed field of characteristic p. Let Φ be a projective indecomposable F G-module. Then Φ = ΨG , where Ψ is a projective indecomposable F N -module and lp (Ψ) = lp (Φ). Proof. It is well-known that induction sends projective modules to projective modules. Furthermore, by Green’s indecomposability theorem [4, Thm. 3.8] induction from normal subgroups of p-power index preserves indecomposability. So, if Ψ is an indecomposable direct summand of Φ|N , then Ψ is projective, ΨG is projective indecomposable and so ΨG = Φ. The statement lp (Ψ) = lp (Φ) also follows as |G : N | = |G : N |p by assumption.  6 GUNTER MALLE AND ALEXANDRE ZALESSKI 3. Irreducible Steinberg-like characters for simple groups Here we complete the list of irreducible characters of simple groups G of degree |G|p . For this it suffices to extract the characters of degree |G|p from the list of irreducible characters of prime-power degree obtained in [14, Thm. 1.1]. This list already appeared in [23, Prop. 2.8], where the case with p = 3, G = 2F4 (2)′ was inadvertently omitted. Note that an irreducible character is Steinberg-like if and only if it is Sylp -regular. Proposition 3.1. Let G be a non-abelian simple group. Suppose that G has an irreducible Sylp -regular character χ. Then one of the following holds: (1) G is a simple group of Lie type in characteristic p and χ is its Steinberg character; (2) G = PSL2 (q), q even, and p = χ(1) = q ± 1, or G = SL2 (8), p = 3 and χ(1) = 9; (3) G = PSL2 (q), q odd, χ(1) = (q ± 1)/2 is a p-power for p > 2, or p = 2 and χ(1) = q ± 1 is a 2-power; (4) G = PSLn (q), q > 2, n is an odd prime, (n, q − 1) = 1, such that χ(1) = (q n − 1)/(q − 1) is a p-power; (5) G = PSUn (q), n is an odd prime, (n, q + 1) = 1, such that χ(1) = (q n + 1)/(q + 1) is a p-power; (6) G = PSp2n (q), n > 1, q = r k with r an odd prime, kn is a 2-power such that χ(1) = (q n + 1)/2 is a p-power; (7) G = PSp2n (3), n > 2 is a prime such that χ(1) = (3n − 1)/2 is a p-power; (8) G = Ap+1 and χ(1) = p; (9) G = Sp6 (2) and χ(1) = 7; (10) G ∈ {M11 , M12 } and χ(1) = 11; (11) G ∈ {M11 , PSL3 (3)} and χ(1) = 16; (12) G ∈ {M24 , Co2 , Co3 } and χ(1) = 23; (13) G = 2F4 (2)′ and χ(1) = 27; (14) G = PSU3 (3) ∼ = G2 (2)′ and χ(1) = 32; or (15) G = G2 (3) and χ(1) = 64. The problem of determining the minimal degree of irreducible characters of p-defect 0 looks much more complicated. Remark 3.2. Let us point out the following cases not explicitly mentioned in Proposition 3.1. SL3 (2) ∼ = PSL2 (7), A6 ∼ = PSL2 (9), PSU4 (2) ∼ = PSp4 (3), A8 ∼ = SL4 (2). 4. Cyclic Sylow p-subgroups In this section we determine the reducible Steinberg-like characters for simple groups with cyclic Sylow p-subgroups. Proposition 4.1. Let G be a finite group with a cyclic TI Sylow p-subgroup S, and assume that NG (S)/S is abelian. Then lp (τ ) = ⌊τ (1)/|S|⌋ for all τ ∈ Irr(G). Proof. Let N := NG (S). By assumption, N/S is abelian of order prime to p, so it has |N : S| irreducible p-Brauer characters of degree 1. Hence, each of the corresponding PIMs of N has dimension |S|. Since the Brauer tree for any p-block of N is a star, all PIMs are uniserial [4, Ch. VII, Cor. 2.22]. But then by [4, Ch. I, Thm. 16.14], any indecomposable F N -module, where STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 7 F is a sufficiently large field of characteristic p, is a quotient of a PIM, so has dimension strictly smaller than |S| if it is not projective. Now let τ ∈ Irr(G). If τ is of p-defect zero, τ |S is a multiple of ρreg S , and the claim follows. Else, τ lies in a block of full defect, and there exists an indecomposable F G-module X with lift τ [4, Ch. I, Thm. 17.12]. Then X|F N = Y ⊕ P , where P is projective (and hence of dimension divisible by |S|) and Y is the Green correspondent of X, an indecomposable, nonprojective F N -module [4, Ch. VII, Lem. 1.5]. Thus, dim Y < |S| by what we said before, so τ (1)/|S| ≤ lp (τ ) < τ (1)/|S| + 1, and the claim follows.  Lemma 4.2. Let G be a non-abelian simple group. Let p be a prime such that a Sylow psubgroup of G is cyclic. Let µ denote the minimal degree of any non-linear irreducible character of G. Then 2µ > |G|p , except in the case where G = PSL2 (p), p ≡ 3 (mod 4) and µ = (p − 1)/2. Proof. The values of µ = µ(G) for every simple group G are either known explicitly or there is a good lower bound. For the sporadic simple groups one can inspect [1], for the alternating groups An we have µ(An ) = n − 1 for n > 5, and µ(A5 ) = 3, for simple groups G of Lie type the values µ(G) are listed in [19]. The lemma follows by comparison of these data with |G|p .  Proposition 4.3. Let p be a prime and let G be a non-abelian simple group with a cyclic Sylow p-subgroup S. Let χ be a Sylp -regular character of G. Then one of the following holds: (1) χ is irreducible of degree |G|p ; (2) (χ, 1G ) = 1, τ := χ − 1G is irreducible and (τ |S , 1S ) = 0; or (3) G = PSL2 (p), p ≡ 3 (mod 4) and χ = 1G + τ1 + τ2 , where τ1 , τ2 are distinct irreducible characters of degree (p − 1)/2. Proof. Suppose that χ is reducible. The result for G = PSL2 (p) easily follows by computation with the character table of this group. Suppose G ∼ 6 PSL2 (p). Let τ 6= 1G be an irreducible = constituent of χ. By Lemma 4.2, χ = τ + k · 1G , where k = |G|p − τ (1). Therefore, 1G is a constituent of χ. By Lemma 2.1, k = 1 and (τ |S , 1S ) = 0.  Proposition 4.4. Let p be a prime and let G be a non-abelian simple group with a cyclic Sylow p-subgroup S. Then G has a reducible Sylp -regular character χ if and only if one of the following holds: (1) G = PSL2 (q), q > 4 even, |S| = q + 1; (2) G = PSL2 (p), |S| = p > 5; (3) G = PSLn (q), n is an odd prime, n6 |(q − 1), |S| = (q n − 1)/(q − 1); (4) G = PSUn (q), n is an odd prime, n6 |(q + 1), |S| = (q n + 1)/(q + 1); (5) G = Ap , |S| = p ≥ 5; (6) G = M11 , |S| = 11; or (7) G = M23 , |S| = 23. Furthermore, in each case (1)–(7), CG (S) = S and χ is Steinberg-like. In addition, χ − 1G is an irreducible character of G, unless possibly when (2) holds, when χ − 1G may be the sum of two irreducible constituents of equal degree. Proof. The additional statement follows from Proposition 4.3. If χ − 1G is reducible, we have the case (3) of Proposition 4.3. So we may assume that τ = χ − 1G is irreducible and thus that (τ |S , 1S ) = 0. The irreducible characters of G of level 0 are determined in [21, Thm. 1.1], so τ belongs to the list in [21, Thm. 1.1]. If we drop from that list the characters of degree other 8 GUNTER MALLE AND ALEXANDRE ZALESSKI than |S| − 1, the remaining cases are given in the statement of the proposition. (Note that the list in [21, Thm. 1.1] includes quasi-simple groups so one first needs to delete the representations non-trivial on the center. For instance, if G = PSp2n (q) then |S| = (q n + 1)/2 is odd, and hence τ (1) = χ(1) − 1 = |S| − 1 is even. However, every irreducible representation of Sp2n (q) of even degree (q n − 1)/2 is faithful. In other words, G has no irreducible representation of even degree (q n − 1)/2. In contrast, there do exist irreducible representations of G = PSLn (q) and PSUn (q) for n odd of degree |S| − 1.) To prove the converse, we have to show that in each case 1G + τ is Sylp -regular, that is, χ|S = ρreg S . Let Ψ be a representations of G afforded by τ . Let s ∈ S with S = hsi. By [21, Cor. 1.3(2)], the multiplicity of every eigenvalue of Ψ(s) is 1. As det Ψ(s) = 1, it follows that 1 is not an eigenvalue of Ψ(s). Therefore, χ|S = ρreg S , as required. Next, we show that CG (S) = S. In cases (6) and (7) this follows by inspection in [1]. The cases (1), (2), (5) are trivial. In cases (3), (4) one can take the preimage T , say, of S in G1 = SLn (q), SUn (q), respectively. Then T is irreducible on the natural module for G1 . The groups CG1 (T ) are described by Huppert [8, Sätze 4,5]. It easily follows that T is self-centralising in G1 . Then CG (S) = S unless [g, T ] ⊆ Z(G1 ) for some g ∈ NG1 (T ) \ T . By order consideration, S is a Sylow p-subgroup of G, so g is not a p-element. Let t ∈ T . Then [g, ti ] = [g i , t] = 1 for i = |S|, so g|S| ∈ CG1 (T ) = T by the above. This is a contradiction as S is a Sylow p-subgroup. It follows that every element of G is either a p- or a p′ -element. Therefore, χ is Steinberg-like if and only if χ|S = ρreg  S . Lemma 4.5. Under the assumptions and in the notation of Proposition 4.4 we have: (a) χ is unique unless (2) or (6) holds; (b) χ is the character of a projective module when (1), (3), (5) or (7) holds; and (c) χ − 1G is a proper character, and if m is the minimal degree of a non-linear character of G then either m = χ(1) − 1, or (1) holds and m = χ(1) − 2, or (2) holds and m = (χ(1) ± 1)/2. Proof. (a) Let τ = χ − 1G . Then τ (1) = |S| − 1 and τ is irreducible unless (2) holds. We show that an irreducible character of this degree is unique unless (2) or (6) holds. If G = M23 , this follows from the character table of this group, for Ap this is well known. For G = PSLn (q), n > 2, and PSUn (q), n > 2, this is observed in [19, Table II]. In case (2) the number of characters equals the number of irreducible characters of degree p − 1, which is (p − 3)/4 if p ≡ 3 (mod 4), otherwise (p − 1)/4. If G = M11 then there are three Steinberg-like characters, see [1]. (b) Recall that the principal projective indecomposable module is the only PIM whose character contains 1G as a constituent. All the characters χ in Proposition 4.4 contain 1G as a constituent. Therefore, if χ is the character of a projective module Φ, say, then Φ is indecomposable and principal. So we compare the list of characters χ in Proposition 4.4 with the main result of [13]. The comparison rules out the case (4) of Proposition 4.4. Furthermore, if G admits at least two Steinberg-like characters then at most one of them can be the character of a projective module. By (a) this leaves us with cases (1), (5) and (7). As in each of these cases χ is unique, it must be the character of the principal projective indecomposable module listed in [13]. (c) This follows by inspection in [19, Table II].  STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 9 Remark 4.6. The group G = PSL2 (p) has several Sylp -regular characters, all of them are Steinberg-like, and only one of them is projective. 5. Sporadic groups Theorem 5.1. Let G be a sporadic simple group. Then G does not have a reducible Sylp -regular character unless one of the following holds: (1) G = M12 , p = 3, four characters with constituents of degrees 11 and 16 each, all Steinberg-like; (2) G = M24 , p = 2, six characters, none of them Steinberg-like; (3) G = M11 , |S| = 11; or (4) G = M23 , |S| = 23. Proof. For most groups and primes, by [1] there is a conjugacy class of non-trivial p-elements taking strictly positive value at all irreducible characters of degree at most |G|p . In a few cases, like in Co3 and F i23 at p = 3, or Co1 and J4 at p = 2, one has to solve a little linear system of equations for non-negative integral solutions. The only cases where such solutions exist are listed in the statement. Note that the cases (3), (4) occur also in Proposition 4.4.  6. Alternating groups In this section we consider Steinberg-like characters of alternating groups. 6.1. Alternating groups for p > 2. For odd primes we give a short proof using a recent result of Giannelli and Law [5] which replaces our earlier more direct proof. Lemma 6.1. Let G = Ap , p > 3, and χ ∈ Irr(G). Then lp (χ) = ⌊χ(1)/p⌋. In addition, lp (χ) 6= 1 for p > 7 (this fact has also been observed in [18]). Proof. The first part is just Proposition 4.1. In addition, if p > 7 then G has no irreducible character of degree d for p ≤ d < 2p. This implies the claim.  Lemma 6.2. Let n = kp, where p > 5 and k < p. Let G = An and let χ be a p-vanishing character. Then lp (χ) ≥ 2k−1 , equivalently, χ(1) ≥ 2k−1 |G|p . ∼ Ap , X2 = ∼ An−p be commuting Proof. For k = 1 the lemma is trivial. Let k P > 1. Let X1 = subgroups of G. Set X = X1 X2 . Then χ|X = ηi σi , where the σi ’s are p-vanishing characters of X2 and the ηi ’s are distinct irreducible characters of X1 (Lemma 2.7). By induction, lp (σi ) ≥ 2k−2 . If lp (ηi ) ≥ 2 for some i then lp (χ) ≥ lp (ηi σi ) ≥ 2k−1 . By Lemma 6.1, if lp (ηi ) < 2 and p > 7 then lp (ηi ) = 0, and hence either ηi = 1X1 or ηi is the unique irreducible character of degree p − 1. (If p = 7 then we may have ηi (1) = 10, see [18].) Suppose the lemma is false and p > 7. Then we can rearrange the above to get χ|X = 1X1 · σ1 + η2 · σ2 , where η2 (1) = p − 1 and σ1 , σ2 are p-vanishing characters of X2 . It follows that χ|X1 , as well as τ |X1 for every irreducible constituent τ of χ, contains no irreducible constituent distinct from 1X1 , η2 . It is well known and easily follows from the branching rule that this implies τ (1) = n − 1 or 1. Recall that G has a single character of degree n − 1. Therefore, χ = a · 1G + b · τ , where τ (1) = n − 1. Let x ∈ X1 be of order p. Then τ (x) = n − p − 1 > 0, which implies χ(x) > 0. 10 GUNTER MALLE AND ALEXANDRE ZALESSKI Suppose p = 7. Then ηi (1) ∈ {1, 6, 10}. There are two irreducible characters of X1 of degree 10, let us denote them by η3 , η3′ . Therefore, assuming the lemma is false, we can write χ|X = 1X · σ1 + η2 σ2 + η3 σ3 + η3′ σ4 . Let 1 6= x ∈ X1 be a p-element. Then η3 (x) = ε + ε4 + ε2 and η3′ (x) = ε−1 + ε−4 + ε−2 , where ε is some primitive 7th root of unity. As χ(x), η2 (x) are integers, so is η3 (x)σ3 (1) + η3′ (x)σ4 (1). This implies σ3 (1) = σ4 (1). Then χ(1) = σ1 (1) + (p − 1)σ2 (1) + 20σ3 (1) > 14σ3 (1), and the lemma follows unless σ3 (1) = 0. If σ3 (1) = 0 then χ|X = 1X1 · σ1 + η2 · σ2 , and the above argument applies.  Lemma 6.3. Let p ≥ 3 be odd and let λ be a hook partition of n ≥ 2p. Then the corresponding character χλ of Sn takes a positive value on p-cycles. Proof. It is well known that any hook character χλ is the mth exterior power, for some 0 ≤ m ≤ n − 1, of the irreducible reflection character ρn of Sn (the constituent of degree n − 1 of the natural permutation character πn ). Let Y = Y1 × Y2 , with Y1 = Sp and Y2 = Sn−p , be a Young subgroup of Sn and g = g ′ × 1 ∈ Y a p-cycle. Clearly ρn |Y = ρp ⊠ 1Y2 + 1Y1 ⊠ (πn−p ), and Λi (ρp )(g′ ) = (−1)i for i < p, Λi (ρp )(g ′ ) = 0 for i ≥ p. Thus   min(p−1,m) m X X i ′ m−i i n−p λ m Λ (ρp )(g )Λ (πn−p )(1) = (−1) χ (g) = Λ (ρn )(g) = , m−i i=0 i=0 which clearly is positive for m ≤ (n − p)/2 since the binomial coefficients are (strictly) increasing up to the middle. Now observe that it suffices to prove the claim for n = 2p, since the restriction of a hook character from Sn to Sn−1 only contains hook characters. But for n = 2p we are done since by symmetry we may assume that m ≤ p = (n − p)/2.  Theorem 6.4. Let p be odd and G = An with n > max{6, p + 1}. Then G has no Sylp regular character. If n = p + 1 > 4 then every Sylp -regular character of G is irreducible, unless (n, p) = (6, 3). Proof. If p ≤ n < 2p the Sylow p-subgroups of G are cyclic and so the claim is in Proposition 4.4. Now assume that n ≥ 2p and let S be a Sylow p-subgroup of Sn . First assume that n 6= pk for some k ≥ 2 and that n > 10 when p = 3. Then by the main result of [5], the restriction of any irreducible character of Sn to S contains the trivial character. A moments thought shows that the same is true for the restriction of any irreducible character of An to S. So by Lemma 2.1 any Sylp -regular character of An is irreducible. Now assume that n = pk for some k ≥ 2, and n > 10 when p = 3. Then again by [5, Thm. A] the only irreducible characters of Sn whose restriction to S does not contain the trivial character are the two characters of degree n − 1. So the only irreducible character of An whose restriction to S does not contain the trivial character is ψ of degree n − 1. Hence a Sylp -regular character χ of An has the form χ = aψ + ψ ′ , for some a ≥ 0 and some ψ ′ ∈ Irr(An ). Let g ∈ An be a pk -cycle. Then ψ(g) = −1, and by the Murnaghan–Nakayama rule any irreducible character of Sn takes value 0 or ±1 on g. In particular, if χ is reducible then we have  that a = 1 and for some m ≤ n. ψ ′ (g) 6= 0. But then ψ ′ is parametrised by a hook partition, of degree n−1 m But then χ takes positive values on p-cycles by Lemma 6.3, a contradiction. Finally, the cases when p = 3 and 6 ≤ n ≤ 10 can easily be checked individually. For example, all irreducible characters of A9 of degree at most 81 are non-negative on class 3C, and those which vanish there are positive either on class 3B or 3A. So A9 has no Syl3 -regular character. As A10 has the same Sylow 2-subgroup, this also deals with n = 10.  STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 11 Corollary 6.5. Let G be a finite group and p > 2. Suppose that G has a subgroup P containing a Sylow p-subgroup of G and such that P/Op (P ) ∼ = An with n > max{6, p + 1}. Then G has no Steinberg-like character. Proof. This follows from Lemma 2.5 and Theorem 6.4.  6.2. Alternating groups for p = 2. The situation is more complicated in the case of p = 2 and we don’t have complete results. This is in part due to the existence of an infinite family of examples which P we now construct. Set Γ = ni=1 Γi , where Γi is the irreducible character of Sn corresponding to the partition [i, 1n−i ] for i > 1, and [1n ] for i = 1. So the Young diagram γi of Γi is a hook with leg length n − i, and   n−1 n! = Γi (1) = i−1 n(n − i)!(i − 1)! Pn n−1 so Γ(1) = i=1 Γi (1) = 2 . Lemma 6.6. Let 0 < m < n, where m is even, and g = ch ∈ Sm × Sn−m ≤ Sn , where c is an m-cycle and h fixes all letters moved by c. Let Γkn−m ∈ Irr(Sn−m ) correspond to the hook  −Γin−m (h) if i ≤ m,  n−m n−m−k partition [k, 1 ]. Then Γi (g) = Γi−m (h) if n − m < i,   n−m Γi−m (h) − Γin−m (h) if m < i ≤ n − m. Proof. One observes that the restriction of Γi to Sm × Sn−m is a sum of irreducible characters στ , where σ, τ are irreducible characters of Sm , Sn−m , resp., and both σ, τ are hook characters of the respective groups (see [9, Lemma 21.3]). Next we use [9, Lemma 21.1] which states that P j χ (h), where χ Γi (g) = (−1) νj νj ∈ Irr(Sn−m ), νj is the Young diagram of χνj , and νj is j such that γi \ νj is a skew hook with leg length j. In our case γi is a hook, so the rim of γi is γi itself. By definition, a skew hook is connected, so it is either a row or a column in our case, and hence j = 0 or j = m − 1. (A column hook of length m has leg length m − 1, which is odd as m is even.) If j = 0, m − 1 then ν = [i − m, 1n−i ], [i, 1n−i−m ], respectively. This is a proper diagram if and only if i > m, resp., n − i ≥ m. So if n − i < m then n−m ν = [i − m, 1n−i ], j = 0, and Γi (g) = χν (h) = Γi−m (h); if i ≤ m then ν = [i, 1n−i−m ], j = m − 1, n−m and Γi (g) = −χν (h) = −Γi (h); if m < i ≤ n − m then ν ∈ {[i − m, 1n−i ], [i, 1n−i−m ]} and n−m Γi (g) = Γi−m (h) − Γin−m (h), as claimed.  Proposition 6.7. Suppose that n is even. Then: (a) Γ is a 2-vanishing character of Sn . (b) Γ is Steinberg-like if and only if n = 2k for some integer k > 0. Proof. (a) Let g ∈ Sn be of even order. Suppose first that g is a cycle of length n. By [9, Lemma 21.1], Γi (g) = (−1)n−i , so Γ(g) = 0. Suppose that g is not a cycle of length n. Then we can express g as the product ch of a cycle c of even size m, say, and an element h fixing all letters moved by c. Then g ∈ Sm × Sn−m . By Lemma 6.6, we have Γ(g) = n X i=1 Γi (g) = n X i=m+1 n−m Γi−m (h) − n−m X i=1 Γin−m (h) = n−m X k=1 Γkn−m (h) − n−m X i=1 Γin−m (h) = 0. 12 GUNTER MALLE AND ALEXANDRE ZALESSKI (b) If n = 2k then |Sn |2 = 2 · |Sn/2 |22 . As |S2 |2 = 2, by induction we have k−1 −1 |Sn |2 = 2 · (22 k −1 )2 = 22 = 2n−1 . Write n = 2k + l where 0 < l < 2k . Then |Sn |2 = |S2k |2 · |Sl |2 . By induction, |Sl |2 ≤ 2l−1 , so k k k |Sn |2 = 22 −1 ·|Sl |2 ≤ 2(2 −1)+(l−1) = 22 +l−2 = 2n−2 . The statement follows as Γ(1) = 2n−1 .  Pn/2 Corollary 6.8. Let n be even, and Γ0 = i=1 Γi |An . Then Γ0 is a 2-vanishing character of An . If n = 2k then this character is Steinberg-like. Proof. The characters Γi remain irreducible under restriction to An and Γi |An = Γn−i+1 |An . It follows that Γ|An = 2Γ0 . Therefore, Γ0 (g) = Γ(g)/2 = 0 by Proposition 6.7 for elements g of even order. The last claim follows from Proposition 6.7(b).  Suppose that n is odd. Set (n−1)/2 Γe = X Γ2i = Γ2 + Γ4 + · · · + Γn−1 , X Γ2i−1 = Γ1 + Γ3 + · · · + Γn . and i=1 (n+1)/2 Γo = i=1 n−1 n−1 Observe that Γi |Sn−1 = Γin−1 + Γi−1 provided 1 < i < n, and Γ1 |Sn−1 = Γ1n−1 , Γn |Sn−1 = Γn−1 . n−1 n−1 e o e o e o Therefore, Γ |Sn−1 = Γ1 + · · · + Γn−1 = Γ |Sn−1 . As Γ = Γ + Γ we have Γ (1) = Γ (1) = Γ(1)/2 = 2n−2 . Proposition 6.9. Suppose that n is odd. Then: (a) Γe and Γo are 2-vanishing characters of Sn . (b) Γe is Steinberg-like if and only if n = 2k + 1 for some integer k > 0. Proof. (a) Let g ∈ Sn be of even order, and g = ch where c is a cycle of even size m. By Lemma 6.6, e Γ (g) = (n−1)/2 (n−1−m)/2 X X Γn−2i+1 (g) = i=1 (n−1)/2 n−m (h) Γn−m−2i+1 − i=1 X n−m (h), Γn−2i+1 i=(m+2)/2 n−m n−m as γn−m−2i+1 is a proper diagram only for i < (n−m)/2 and γn−2i+1 is a proper diagram only for P(n−1−m)/2 n−m Γn−m−2k+1 (h), i ≥ (m+2)/2. Set k = i−m/2. So the second sum can be written as k=1 e whence Γ (g) = 0. Similarly, (n+1)/2 Γo (g) = X i=1 (n−1−m)/2 Γn−2i+2 (g) = X i=1 (n−1)/2 n−m (h) − Γn−m−2i+2 X n−m (h), Γn−2i+2 i=(m+2)/2 n−m n−m as γn−m−2i+1 is a proper diagram only for i ≤ (n − m − 1)/2 and γn−2i+2 is a proper diagram only for i ≥ (m + 2)/2. Set k = i − m/2. Then the second sum can be written as P(n−1−m)/2 n−m Γn−m−2k+2 (h). So Γo (g) = 0 as well. k=1 STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 13 (b) If n = 2k + 1 then |Sn |2 = |Sn−1 |2 = 2n−2 (see the proof of Proposition 6.7(b)). By the above, Γe (1) = Γo (1) = 2n−2 , so both Γe and Γo are Steinberg-like. If n − 1 is not a 2-power then |Sn |2 = |Sn−1 |2 < 2n−2 by Proposition 6.7(b).  Let n be odd. Then Γi |An = Γn+1−i |An is irreducible for i 6= (n + 1)/2, whereas Γ(n+1)/2 |An is − the sum of two irreducible constituents which we denote by Γ+ (n+1)/2 and Γ(n+1)/2 . If n = 4l + 1 then set (n−1)/4 Γ ea = X Γ2i |An = (Γ2 + Γ4 + · · · + Γ(n−1)/2 )|An , and i=1 (n−1)/4 Γo± = Γ± (n+1)/2 + X Γ2i−1 |An = (Γ1 + Γ3 + · · · + Γ(n−3)/2 )|An + Γ± (n+1)/2 , i=1 while for n = 4l + 3 we set (n+1)/4 Γ oa = X Γ2i−1 |An = (Γ1 + Γ3 + · · · + Γ(n−1)/2 )|An , and i=1 Γ e± = Γ± (n+1)/2 (n−3)/4 + X Γ2i |An = (Γ2 + Γ4 + · · · + Γ(n−3)/2 )|An + Γ± (n+1)/2 . i=1 Corollary 6.10. (a) Let n = 4l + 1. Then Γea , Γo+ and Γo+ are 2-vanishing characters of k An . If n = 2 + 1 then they are Steinberg-like characters. (b) Let n = 4l + 3 > 3. Then Γe+ , Γe− and Γoa are 2-vanishing characters of An . None of them is Steinberg-like. Proof. Let g ∈ An be of even order. (a) Let i 6= (n + 1)/2. Then Γi remains irreducible under restriction to An . As Γi and Γn−i+1 coincide under restriction to An , it follows that Γe |An = 2Γea , and hence Γea is a 2-vanishing character. As Γea (1) = 2n−3 = |An |2 , this is Steinberg-like for n = 2k + 1. − + − Observe that Γ+ (n+1)/2 (g) = Γ(n+1)/2 (g) and Γ(n+1)/2 (g) + Γ(n+1)/2 (g) = Γ(n+1)/2 (g). It follows that Γo+ (g) = Γo− (g) = Γo (g)/2, and thus Γo+ (g) = Γo− (g) = 0 by Proposition 6.9. Therefore, Γo+ and Γo+ are 2-vanishing characters of An . In addition, suppose that n = 2k + 1. Then Γo+ (1) = Γo− (1) = Γo (1)/2 = |An |2 , so both Γo+ and Γo− are Steinberg-like. (b) Let i 6= (n + 1)/2. Then as above it follows that Γo |An = 2Γoa , and hence Γoa is a 2-vanishing character. In addition, Γoa (1) = Γo (1)/2 = 2n−3 . As here we never have n = 2k + 1, Γoa is not Steinberg-like. (g) = (g) + Γ− (g) and Γ+ (g) = Γ− Consider Γe± . Observe that Γ+ (n+1)/2 (n+1)/2 (n+1)/2 (n+1)/2 e+ e− e e+ e− Γ(n+1)/2 (g). It follows that Γ (g) = Γ (g) = Γ (g)/2, and so Γ (g) = Γ (g) = 0 by Proposition 6.9. Therefore, Γe+ and Γe− are 2-vanishing characters of An but not Steinberglike.  Lemma 6.11. Let 2 ≤ n ≤ 12. Then in addition to the character Γ when n = 2k , and the characters Γe and Γo when n = 2k + 1, the only Steinberg-like characters of Sn are: (a) if n = 4 the sum of all non-linear irreducible characters; 14 GUNTER MALLE AND ALEXANDRE ZALESSKI (b) if n = 6 the irreducible character of degree 16; (c) if n = 8 the sum of the two irreducible characters of degree 64. Proof. For n ≤ 6 this is easily checked from the know character tables. For n = 8 we use a computer program to go through all possibilities. For S10 one checks that no character exists with the right restriction to S8 ×S2 , and similarly for S12 one considers the restriction to S8 ×S4 . Finally, the cases n ∈ {7, 9, 11} are treated by restricting to Sn−1 .  Theorem 6.12. Suppose that the only Steinberg-like character of S2k , k ≥ 4, for p = 2 is the one constructed in Proposition 6.7. Then An does not have Steinberg-like characters for p = 2 for n ≥ 13 unless n or n − 1 is a 2-power. In the latter case, the only Steinberg-like characters are those listed in Proposition 6.9. Proof. Let ψ be a Steinberg-like character for p = 2 of An , with n ≥ 10. Then χ := ψ Sn is Steinberg-like for Sn . We argue by induction on n that Sn does not have a Steinberg like character, unless n or n − 1 is a power of 2. Assume that n is not a power of 2 and write n = 2a1 + . . . + 2ar for distinct exponents a1 , . . . , ar > 0. By Lemma 6.11 we may assume n 6= 12, so one of the summands, say 2a1 is different from 4 and 8. Then the Young subgroup Y = Y1 × Y2 := S2a1 × Sn−2a1 of Sn contains P a Sylow 2-subgroup, so χ|Y is Steinberg-like. Then by Lemma 2.7 we have that χ|Y P = i ηi σi where ηi ∈ Irr(Y1 ) are all distinct, the σi are 2-vanishing characters of Y2 , and χ1 := i lp (σi )ηi is a 2-vanishing character of Y1 with l2 (χ1 ) = l2 (χ) = 1. Thus by assumption χ1 is the character Γ from Proposition 6.7. In particular, χ1 is multiplicity-free and so lp (σi ) = 1 for all i. So the σi are Steinberg-like as well. This is not possible, unless n − 2a1 is a 2-power as well. In the latter case, by Lemma 6.11 we conclude that n ≥ 17. The above argument shows that χ|Y = Γ(1) ⊠ Γ(2) , with Γ(j) a Steinberg-like character of Yj . So in particular χ|Y and hence also χ is multiplicity-free. By possibly interchanging a1 , a2 we may assume that 2a1 > 8. Now consider χ|Y1 = |Y2 |2 Γ(1) , a sum of hooks. By the branching rule, any non-hook character of Sm restricted to Sm−1 contains a non-hook character (except when m = 4 which is excluded here). Thus, inductively, χ cannot contain any non-hook constituent. This in turn means that all constituents of χ|Y2 are hooks and thus by induction that χ|Y2 = |Y1 |2 Γ(2) . Now observe (1) (2) that by the Littlewood–Richardson rule [9, Lemma 21.3], Γi |Y contains Γj ⊠ Γl if and only if j + l ∈ {i, i + 1}. Thus, on the one hand side, Γi |Y and Γi+1 |Y have a common constituent, and so at most every second hook character occurs in χ. On the other hand, every second hook must indeed occur. Thus either χ = Γe or χ = Γo as defined above. If n = 2a1 + 1 then our claim follows from Proposition 6.9, otherwise the degree of χ is larger than |Sn |2 .  6.3. Projective characters for p = 2. Lemma 6.13. Let p = 2. Then An has a projective character of degree |An |2 if and only if Sn has a projective character of degree |Sn |2 . Proof. This follows from Lemma 2.13.  Theorem 6.14. Let p = 2 and G = An or Sn for n > 4. Then G has no reducible projective character of degree |G|2 . Proof. One can inspect the decomposition matrix modulo 2 of G = An for n ≤ 9 to observe that G has no projective character of degree |G|2 . Analysing the character table of G = An for STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 15 9 < n ≤ 15 one observes that G has no Syl2 -regular characters, and hence no PIM of dimension |G|2 . One can inspect the decomposition matrix of G = A9 to observe that the minimal dimension of a PIM is 320. Analysing the character table of G = An for 9 < n ≤ 15 one observes that G has no Syl2 -regular characters, and hence no PIM of dimension |G|2 . Let n = 16. Using the known character table of A16 one finds that there is a unique Syl2 regular character, viz. the character Γ0 ; it is multiplicity-free with constituents of degrees 1, 15, 105, 455, 1365, 3003, 5005, 6435, and Steinberg-like. Recall that the principal PIM is the only one that has 1G as a constituent. However, by [13], the principal PIM is not of degree |G|2 . Let n = 2k , where k > 4. Then G has a subgroup Y such that Y /N ∼ = A16 for some normal 2-subgroup N and |Y |2 = |G|2 . Indeed, let P1 , . . . , P16 be a partition of {1, . . . , n} with all parts of size n/16. If G = Sn then N is the direct product of 16 copies of a Sylow 2-subgroup of Sn/16 . If G = An then we take N ∩ An for the subgroup in question. Then Y is a semidirect product of N with S16 . The latter permutes P1 , . . . , P16 in the natural way. One easily observes that |G : Y | is odd. If Φ is a PIM of degree |G|2 = |Y |2 then so is Φ|Y . By [22, Lemma 3.8], the generalised restriction rYG/N (Φ) of Φ is a PIM of dimension |Y /N |2 . Such a PIM does not exist as we have just seen. Let n > 16 be not a 2-power, and write n = 2k + m, where m < 2k . Let X = X1 × X2 ≤ Sn , where X1 ∼ = S2k and X2 ∼ = Sm . Then the index |Sn : X| is odd, so Φ|X is a PIM of degree |X|2 . Therefore, Φ|X is a direct product Φ1 × Φ2 , where Φi is a PIM for Xi for i = 1, 2. Obviously, dim Φi = |Xi |2 . This is a contradiction, as X1 has no PIM of degree |X|1 . For G = An the result follows from Lemma 6.13.  7. Exceptional groups of Lie type Theorem 7.1. Let G be a simple group of Lie type which is not classical. Then G does not have a Sylp -regular character in non-defining characteristic, except for the group G = 2F4 (2)′ which has two reducible Syl3 -regular characters and two irreducible Steinberg-like characters for p = 3. Proof. As in the proof of [13, Thm. 4.1] we compare the maximal order of a Sylow p-subgroup of G, which is bounded above by the order of the normaliser of a maximal torus, with the smallest irreducible character degrees (given for example in [19, Tab. I]). This shows that except for very small q there cannot be any examples of Sylp -regular characters. A closer inspection of the finitely many remaining cases shows that G = 2F4 (2)′ has two reducible Syl3 -regular characters and two irreducible Steinberg-like character for p = 3, but no further cases arise.  8. Groups of Lie type in their defining characteristic It was shown in [17] that simple groups of Lie type of sufficiently large rank don’t have Steinberg-like characters with respect to the defining characteristic apart from the (irreducible) Steinberg character. More precisely, the Steinberg-like characters were classified except for groups of types Bn with 3 ≤ n ≤ 5 and Dn with n = 4, 5. Here we deal with the remaining cases. 16 GUNTER MALLE AND ALEXANDRE ZALESSKI Proposition 8.1. Let G = Spin2n+1 (q), n ∈ {3, 4, 5}, with q = pf odd. Then G has no reducible Steinberg-like character with respect to p. Proof. We freely use results and methods from [17]. First assume that n = 3. According to [17, Prop. 6.2] it suffices to consider a group H (coming from an algebraic group with connected centre) such that [H, H] = Spin7 (q). Let χ be a reducible Steinberg-like character of H. Then χ has a linear constituent by [17, Thm. 8.6]. Multiplying by the inverse of that character, we may assume that the trivial character occurs in χ (exactly once). By [17, Lemma 2.1], then all constituents of χ belong to the principal p-block, so we may in fact replace H by H/Z(H), that is, we may assume that H is of adjoint type. Let P ≤ H be a parabolic subgroup of H and U = Op (P ). Then by Lemma 2.5(c) the Harish-Chandra restriction rLH (χ) is a Steinberg-like character of L = P/U . We will show that there is no possibility for χ compatible with Harish-Chandra restriction to all Levi subgroups. Clearly, rLH (χ) also contains the trivial character, so is again reducible. The reducible Steinberg-like characters of all proper Levi subgroups of H are known by [17, Lemmas 7.4 and 7.8]. In particular we must have 7|(q + 1) and for L of type A2 we have rLH (χ) = 1L + µ with µ ∈ Irr(L) of degree q 3 − 1. Thus µ lies in the Lusztig series of a regular semisimple element s ∈ L∗ (the dual group of L) with centraliser a maximal torus of order (q 2 − 1)(q − 1). Thus χ has to contain a constituent ψ1 lying in the Lusztig series of s. It is easily seen that the centraliser of s in G∗ is either a maximal torus, or of type A1 (q).(q 2 − 1). Correspondingly, ψ1 (1) ∈ {(q 6 − 1)(q 2 + 1)(q + 1), (q 6 − 1)(q 2 + 1), q(q 6 − 1)(q 2 + 1)}. But the first and the last are bigger than q 9 , so ψ1 (1) = (q 6 − 1)(q 2 + 1). Now if χ contains any other constituent apart from 1G in the principal series, then its generalised restriction to L is non-zero, contradicting rLH (χ) = 1L + µ. Next, the Harish-Chandra restriction to a Levi subgroup L of type B2 has the form rLH (χ) = 1L + ν1 + ν2 + ν3 with ν1 (1) = (q − 1)2 (q 2 + 1) and ν2 (1) = ν3 (1) = (q − 1)(q 2 + 1). In particular ν1 lies in the Lusztig series of a regular semisimple element t ∈ L∗ (of order 7 dividing q + 1) with centraliser a maximal torus of order (q 2 − 1)(q + 1). The centraliser of t in G∗ then either is the same maximal torus, or of type A1 (q).(q + 1)2 . Correspondingly, χ has a constituent ψ2 in the Lusztig series of t of degree d1 := (q 6 −1)(q 2 +1)(q −1)/(q +1), d2 := q(q 6 −1)(q 2 +1)(q −1)/(q +1) or (q 6 −1)(q 2 +1)(q −1). The last one is larger than q 9 − 1 − ψ1 (1), so ψ2 (1) ∈ {d1 , d2 }. Furthermore, by [17, Lemma 3.1], χ contains at least one regular constituent. This is either ψ2 of degree d2 , or, if ψ2 (1) = d1 then one can check from the known list of character degrees of H (which can be found at [12]) that the only regular character ψ3 of small enough degree has degree d3 := (q 6 − 1)(q 2 + 1)(q − 1)2 /(q + 1). Observe that d2 = d1 + d3 . So the sum of remaining character degrees is d := q 9 − 1 − ψ1 (1) − d2 = q(q 3 − 1)(q 4 − 3q 3 + 3q 2 − 3q + 1). Now note that χ cannot have further unipotent constituents since they would lead to unipotent constituents of rLH (χ) (as H has no cuspidal unipotent characters). It turns out that all remaining candidates except for one of degree λ(1) = (q 3 −1)(q 2 +1)(q−1) have degree divisible by q 2 −q+1. Now λ(1) ≡ 2 (mod q 2 − q + 1), while d ≡ −2 (mod q 2 − q + 1). It follows that λ would have to occur at least q 2 − q times in χ. As (q 2 − q)λ(1) > d, this is not possible. This contradiction concludes the proof for the case n = 3. STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 17 The cases of Spin9 (q) and Spin11 (q) now follow from the previous one by application of the inductive argument in the proof of [17, Thm. 10.1].  f Proposition 8.2. Let G = Spin+ 2n (q), n ∈ {4, 5}, q = p . Then G has no reducible Steinberg-like character with respect to p. Proof. First consider the case n = 4. As in the previous proof, by [17, Prop. 6.2 and Lemma 2.1] we may work with H of adjoint type. Let χ be a reducible Steinberg-like character of H. Then χ contains 1H by [17, Thm. 8.6] and hence so does its Harish-Chandra restriction rLH (χ) to a Levi subgroup of type A3 . Then by [17, Lemma 9.1] we have q ≡ −1 (mod 3) and rLH (χ) = 1L + µ1 + µ2 + µ3 with µ1 a cuspidal character labelled by a regular element s ∈ L∗ in a torus of order q 4 − 1, of order dividing (q 2 + 1)(q + 1) in L∗ /Z(L∗ ). But then s is also regular in H ∗ , that is, χ has a constituent ψ of degree (q 6 − 1)(q 4 − 1)(q 2 − 1). This holds for all three conjugacy classes of Levi subgroups of type A3 . Comparison of degrees shows that this is not possible. The case of Spin10 (q) again follows from the previous one by application of the argument in the proof of [17, Thm. 10.1].  9. Classical groups of large rank As an application of results obtained in Section 6 we show here that classical groups of large rank have no Steinberg like character for p > 2, provided p is not the defining characteristic of G. Throughout p is an odd prime not dividing q and we set e := ep (q), the order of q modulo p. We first illustrate our method on the groups GLn (q). Lemma 9.1. Let G = GLn (q), p > 2, and let S be a Sylow p-subgroup of G. (a) Write n = me + m′ , where 0 ≤ m′ < e. Then there exist subgroups U ≤ S ≤ N ≤ G, where U is an abelian normal p-subgroup of N and N/U ∼ = Am . (b) If m > max{6, p + 1} or m′ > 0 then G has no Steinberg-like character. Proof. (a) See [20]. (b) If m′ > 0 then G contains a subgroup X such that X ∼ = GLm′ (q) and CG (X) contains a Sylow p-subgroup of G. As X is a p′ -group, the result follows from Lemma 2.3. Let m′ = 0. Suppose the contrary, and let χ be a Steinberg-like character of G. By Lemma 2.5, Am must have a Steinberg-like character. However, this is false by Theorem 6.4.  For other classical groups the argument is similar, but involves more technical details. Let d = ep (−q) be the order of −q modulo p, equivalently, d = 2e if e is odd, d = e/2 if e ≡ 2 (mod 4), and d = e if 4|e. So d = 1 if and only if e = 2, equivalently, p|(q + 1). Note that e = 2ep (q 2 ) if e is even. Lemma 9.2. [20] Let G = GUn (q) and p > 2. Then the Sylow p-subgroups of G are isomorphic to those of H, where H ∼ = GL⌊n/2⌋ (q) if e is odd, H ∼ = GL⌊n/2⌋ (q 2 ) if 4|e and H ∼ = GLn (q 2 ) if e ≡ 2 (mod 4). Lemma 9.3. Let G = GUn (q), p > 2, and let S be a Sylow p-subgroup of G. Suppose that e ≡ 2 (mod 4), equivalently, d is odd. (a) Write n = md + m′ , where 0 ≤ m′ < d. Then there exist subgroups U ≤ S ≤ N ≤ G, where U is an abelian normal p-subgroup of N and N/U ∼ = Am . (b) If m > max{6, p + 1} or m′ > 0 then G has no Steinberg-like character. 18 GUNTER MALLE AND ALEXANDRE ZALESSKI Proof. (a) Suppose first that e = 2. Let V be the natural Fq2 H-module. Then V is a direct sum ⊕ni=1 Vi , where Vi ’s are non-degenerate subspaces of dimension 1. Let X be the stabiliser of this decomposition, that is, X = {x ∈ G | xVi = Vj for some j = j(x) ∈ {1, . . . , n}}. Then X ∼ = X1 · Sn (a semidirect product), where X1 ∼ = (GU1 (q) × · · · × GU1 (q)) (n factors). Let U be the Sylow p-subgroup of X1 . Then U is normal in X and abelian. It is well known that X contains a Sylow p-subgroup of G. Therefore, N = U An satisfies the statement. Let e > 2. As d is odd, there is an embedding GUm (q d ) → GUmd (q) (see [8, Hilfssatz 1]). Note that ep (q d ) = 2 and |GUm (q d )|p = |GUmd (q)|p . As GUmd (q) is isomorphic to a subgroup of G, the result follows. (b) is similar to the proof of Lemma 9.1(b).  Lemma 9.4. Let p > 2, 2n = me, where e = ep (q) is even, and X = GUm (q e/2 ). − (a) If m is even (resp. odd) then X is isomorphic to a subgroup of GO+ 2n (q) (resp. GO2n (q)). + (b) X is isomorphic to a subgroup of Sp2n (q), of GO2n+1 (q), of GO2n+e (q) as well as of GO− 2n+e (q). In addition, X contains a Sylow p-subgroup of the respective group. Proof. (a) follows from [3, Lemma 6.6] as well as (b) for Sp2n (q). The second case in (b) follows − from (a) as the groups GO2n+1 (q), GO+ 2n+e (q) and GO2n+e (q) contain subgroups isomorphic to − GO+ 2n (q) and GO2n (q). The additional statement can be read off from the orders of the groups in question. (The cases with Sp2n (q), GO− 2n (q) and GO2n+1 (q) are considered in [6, Lemmas 3.14 and 3.16], that + of GO2n (q) is similar.)  Lemma 9.5. Let p > 2. Let H be one of the following groups: (1) H = GUn (q) with n = md + m′ , where m′ < d; − ′ (2) H ∈ {Sp2n (q), GO2n+1 (q), GO+ 2n (q), GO2(n+1) (q)} with n = me + m , where e is odd and m′ < e; (3) H ∈ {Sp2n (q), GO2n+1 (q)} with 2n = me + m′ where e is even and m′ < e; ′ ′ ′ ′ (4) H = GO± 2n (q) with 2n = me + m where e is even, m < e, and either m > 0, or m = 0 + − and then either H = GO2n (q), m is even, or H = GO2n (q), m is odd; − (5) let e be even, 2n = (m + 1)e and H = GO+ 2n (q), m + 1 is odd, or H = GO2n (q) and m + 1 is even. Let S denote a Sylow p-subgroup of H. Then there exist subgroups U ≤ S ≤ P ≤ H, where U is an abelian normal p-subgroup of P and P/U ∼ = Am . Proof. (1) The case e ≡ 2 (mod 4) is handled in Lemma 9.3. In the remaining cases the result follows from Lemmas 9.1 and 9.2, as GL[n/2] (q 2 ) is isomorphic to a subgroup of G. (2) By Lemma 9.2, |H|p = |GLn (q)|p . So the result follows from Lemma 9.1. (3) This follows from Lemmas 9.4 and 9.1. (Note that H = GO2n+1 (q) contains subgroups − isomorphic to GO+ 2n+1 (q) and GO2n (q) and one of them contains a Sylow p-subgroup of H.) (4) Similar to (3). Note that if m′ > 0 then H contains subgroups isomorphic to GO+ me (q) (q), and one of them contains a Sylow p-subgroup of H. and GO− me − (5) In this case a subgroup X of H isomorphic to GO+ 2n−e (q) and GO2n−e (q), respectively, contains a Sylow p-subgroup of H. (One can easily check that |H : X|p = 1.) So the result follows from (4).  STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 19 Our result for alternating groups (Corollary 6.5) implies the following: Proposition 9.6. Let p > 2 and e = ep (q). Let m = max{7, p + 2}. Let G be one of the following groups: (1) PSLn (q) and n ≥ em; (2) PSUn (q) and n ≥ dm, where d = ep (−q); (3) Ω2n+1 (q), q odd, or PSp2n (q), n > 1, and n ≥ em if e is odd, otherwise 2n ≥ em; (4) PΩ+ 2n (q), and n ≥ em if e is odd, otherwise 2n ≥ em; (5) PΩ− 2n (q), and n − 1 ≥ em if e is odd, otherwise 2n ≥ em. Then G has no Steinberg-like character. This remains true for any group H such that G is normal in H/Z(H) and (H/Z(H))/G is abelian. Proof. Suppose first that H is as in Lemma 9.5. Let S ∈ Sylp (H). Then there are subgroups U ≤ S ≤ P ≤ H, where U is normal in P and N/U ∼ = Am with m ≥ m = max{7, p + 2}. So Am is perfect. Let H1 be the derived subgroup of H. Set P1 = P ∩ H1 , S1 = S ∩ H1 , U1 = U ∩ H1 . Then S1 ∈ Sylp (H1 ), U1 ≤ S1 ≤ P1 ≤ H1 and P1 /U1 ∼ = Am , as Am is perfect. A similar statement is true for the quotient of H1 by a central subgroup. Then the result follows from Theorem 6.4 using Lemma 2.5.  10. Minimal characters and Sylow p-subgroups, p > 2 In this section we show that if p > 2 and G is a simple classical group not satisfying the assumptions in Proposition 9.6, p is not the defining characteristic of G and a Sylow p-subgroup S of G is not cyclic, then G has no Sylp -regular character and hence no Steinberg-like character. Observe that S is cyclic if and only if m = 1, and abelian if and only if m < p, where m is as in Lemma 9.5. The case where S is cyclic has been dealt with in Section 4. For a group G, let µ0 (G) = 1 < µ1 (G) < µ2 (G) < · · · denote the sequence of integers such that for i > 0, G has an irreducible character of degree µi (G) and no irreducible character ρ with µi−1 (G) < ρ(1) < µi (G). For universal covering groups of finite classical groups the values µ1 (G), µ2 (G), µ3 (G) were determined in [19]. In our analysis below these three values play a significant role, but mainly for classical centerless groups G such as PGLn (q), PGUn (q), PSp2n (q), PΩ± 2n (q) and Ω2n+1 (q). For these groups, mainly for 2e ≤ n ≤ pe with p > 2, we observe that |G|p < µ3 (G) and sometimes |G|p < µ1 (G). In the latter case it is immediate to conclude that G has no Sylp -regular character, in the other cases we observe that there exists an element g ∈ G of order p such that ρ(g) > 0 for each irreducible character ρ of degree at most µ2 (G). For n > pe we use a different method. Recall that e = ep (q) denotes the minimal integer i > 0 such that q i − 1 is divisible by p. 10.1. The groups GLn (q), n ≥ 2e. Set dn = (q n − 1)/(q − 1). Let G = SLn (q). The minimal degrees of projective irreducible representations of PSLn (q) are given in [19, Table IV]. Table 1 is obtained from this by omitting the representations that are not realisable as ordinary representations of SLn (q). Lemma 10.1. Let p > 2, e > 1, and G = GLen (q). Suppose that 1 < n ≤ p, and if q = 2 suppose that either n < p or p < 2e − 1. Then |G|p < µ1 (G) and G has no Sylp -regular character. Proof. If n < p then |G|p ≤ (q e − 1)n /(q − 1)n (as p is coprime to q − 1), and µ1 (G) = (q en − q)/(q − 1). So the statement is obvious in this case. 20 GUNTER MALLE AND ALEXANDRE ZALESSKI n, q n = 3, n = 4, n = 4, n > 4, n > 4, n = 6, n = 6, q q q q q q q µ1 (G) µ2 (G) µ3 (G) 2 >2 d3 − 1 d3 (q − 1)(q − 1)/(3, q − 1) >3 d4 − 1 d4 (q 3 − 1)(q − 1)/(2, q − 1) =3 26 39 52 > 2, (n, q) 6= (6, 3) dn − 1 dn dn (q n−1 − q 2 )/(q 2 − 1) = 2, n 6= 6 dn − 1 dn (2n−1 − 4)/3 dn dn−1 /3 =2 62 217 588 =3 363 364 6318 Table 1. Minimal degrees of irreducible characters of SLn (q) e p ep −1) q −q Let n = p. If q > 2 then |G|p ≤ p(q (q−1)p , while µ1 (G) = q−1 . (As p > 2, the exceptions in Table 1 can be ignored, except for e = 3 and (n, q) = (6, 2) or (6, 3); these two cases are trivial.) We have p(q e − 1)p < (q − 1)p−1 (q ep − q) as p < (q − 1)p−1 for q > 2 and (q e − 1)p < q ep − q. If q = 2 and p < 2e − 1 then p ≤ (2e − 1)/3 and |S| ≤ p(2e − 1)p /3p is less than 2ep − 2 = µ1 (G) as p < 3p .  Remark 10.2. Lemma 10.1 does not extend to the case q = 2 with n = p = 2e − 1 as then |G|p = p(2e − 1)p = pp+1 > (p + 1)p − 2 = 2ep − 2 = µ1 (G). So the case e > 1 leaves us with q = 2, which we deal with next. Lemma 10.3. Let e > 1 and G = GLep (2). Then |G|p < µ2 (G) and G has no Sylp -regular character. Proof. We have |G|p ≤ p(2e − 1)p . By Table 1 we have µ1 (G) = 2ep − 2 and µ2 (G) = (2ep − 1)(2ep−1 − 4)/3 > |G|p , or ep = 3, 4, 6. As p is odd and e > 1, we have ep 6= 3, 4, so in the exceptional cases e = 2, p = 3 where |G|p = 81 < µ2 (G) = 217. Let π be the permutation character of G associated with the action of G on the non-zero vectors of the natural F2 G-module. Then π = τ + 1G , where τ is a character of G of degree τ (1) = 2ep − 2. There is a unique irreducible character of G of degree 2ep − 2 [19, Table IV], and hence it coincides with τ . Let χ be a Sylp -regular character of G. As χ(1) = |G|p , it follows that the irreducible constituents of χ are either 1G or τ . As χ(g) = 0 for every p-element g ∈ G, we get a contradiction as soon as we show that τ (g) > 0 for some p-element g ∈ G. This is equivalent to showing that π(g) > 1. This can be easily verified.  Lemma 10.4. Suppose that p > 2, p|(q − 1) and let SLn (q) ≤ G ≤ GLn (q) for 2 < n < p. Then G has no Sylp -regular character. Proof. Let G1 = G/Z(G). Then |G1 |p ≤ |q − 1|pn−1 and µ1 (G1 ) = (q n − q)/(q − 1) > q n−1 as above. So |G1 |p < µ1 (G1 ), and G1 has no Sylp -regular character. Then neither has G by Lemma 2.5.  10.2. The groups GUn (q), n > 2. In this section we consider the case where p > 2 and a Sylow p-subgroup of GUn (q) is abelian or abelian-by-cyclic. This implies n < dp2 , where d is the order of −q modulo p, equivalently, d = 2e if e is odd, d = e/2 if e ≡ 2 (mod 4), and d = e if 4|e. So d = 1 if and only if e = 2, equivalently, p|(q + 1). Note that e = 2ep (q 2 ) if e is even. STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 21 Lemma 10.5. Let p be odd, let S be a Sylow p-subgroup of G = GUn (q). Then S is abelian and not cyclic if and only if 2d ≤ n < dp. Proof. If X = GLn (q) then Sylow p-subgroups of X are abelian if and only if n < ep. Let S be a Sylow p-subgroup of G. We use Lemma 9.2. If e ≡ 2 (mod 4) then |G|p = |GLn (q 2 )|p , so S is abelian if and only if n < ep (q 2 )p = ep/2 = dp. If e is odd then |G|p = |GL⌊n/2⌋ (q)|p , so S is abelian if and only if ⌊n/2⌋ < ep, equivalently, n < 2ep = dp. If 4|e then |G|p = |GL⌊n/2⌋ (q 2 )|p , so S is abelian if and only if ⌊n/2⌋ < ep (q 2 )p, equivalently, n < ep = dp. Similarly, S is cyclic if and only if n < 2d. So the lemma follows.  Lemma 10.6. Let p > 2, d > 1 and SUdp (q) ≤ G ≤ GUdp (q). Then |G|p < µ1 (G) and G has no Sylp -regular character. This remains true if SUn (q) ≤ G ≤ GUn (q) with 2d ≤ n < dp. Proof. Note that d > 1 means that p does not divide q + 1, so |G|p = |SUd (q)|p . So it suffices to prove the lemma for G = SUdp (q). First assume that d is odd, so e ≡ 2 (mod 4) and d = e/2. Then we have |G|p ≤ p(q e/2 + 1)p /(q + 1)p = p(q d + 1)p /(q + 1)p and µ1 (G) = (q dp − q)/(q + 1). In this case |G|p < µ1 (G). Similarly, if e is odd then d = 2e, |G|p ≤ p(q d − 1)p /(q + 1)p and µ1 (G) = (q dp − 1)/(q + 1), so again |G|p < µ1 (G). Finally assume that 4|e. Then d = e, |G|p ≤ p(q e −1)p /(q 2 −1)p and µ1 (G) = (q ep −1)/(q +1). So |G|p < µ1 (G) again. This implies that G has no Sylp -regular character. The proof of the additional statement is similar.  Thus, we are left with primes such that p|(q + 1). We first consider the case where n < p. Lemma 10.7. Let p|(q +1), 2 < n < p, and SUn (q) ≤ G ≤ GUn (q). Then G has no Sylp -regular character. Proof. Let G1 = {g ∈ G | det g is an element of GU1 (q) of p′ -order}. Then |G : G1 | = |Zp |, where Zp is the Sylow p-subgroup of Z(G). As Zp ∩ G1 = 1, it follows that G = G1 × Zp . By Lemma 2.6, the result for G follows if we show that G1 has no Sylp -regular character. In turn, this follows from the same result for G′ = SUn (q) as |G1 : G′ | is coprime to p. So we deal with G′ . Suppose the contrary, and let χ be a Sylp -regular character of G′ . First, let n = 3. Then χ(1) = |G′ |p = (q + 1)2p for p > 3. By [19, Table V], µ1 (G′ ) = q 2 − q. Let q > 4. Then χ(1) = |G′ |p = (q + 1)2p < 2(q 2 − q) = 2µ1 (G′ ). So χ has a single non-trivial irreducible constituent ρ, and ρ(1) ≤ χ(1). Again by [19, Table V], q 2 − q ≤ ρ(1) ≤ q 2 − q + 1. As χ is Sylp -regular, (χ, 1G′ ) ≤ 1 (Lemma 2.1). Therefore, χ(1) ≤ ρ(1) + 1 ≤ q 2 − q + 2, which is false. The case with q = 4 can be read off from the character table of G′ . Let n > 3 and let V be the natural Fq2 G′ -module. Let b1 , . . . , bn be an orthogonal basis in V and let W = hb1 , b2 , b3 i. Then W is a non-degenerate subspace of V of dimension 3. Set X = {h ∈ G′ | hW = W and hbi ∈ hbi i for i = 4, . . . , n} and U := Op (X). Then U ⊆ Z(X) and every element of U acts scalarly on W . Let X ′ be the derived subgroup of X ′ and P = X ′ U . Then X ′ ∼ = SU3 (q) and P/U ∼ = SU3 (q) (as p > 3). By the above, SU3 (q) has no Sylp -regular character. As P contains a Sylow p-subgroup of G′ , the result follows from Lemma 2.5.  Lemma 10.8. Let SU3 (8) ≤ G ≤ GU3 (8). Then G has no Syl3 -regular character. Proof. By Lemma 2.5, it suffices to prove that PSU3 (8) and PGU3 (8) have no Syl3 -regular character. Suppose the contrary, and let χ be a Syl3 -regular character of any of these groups. 22 GUNTER MALLE AND ALEXANDRE ZALESSKI As |PGU3 (8)|3 = 243, we have χ(1) ≤ 243. Let ρ be an irreducible constituent of χ. Then ρ(1) ≤ 243. By [1], ρ(1) ∈ {1, 56, 57, 133}, and the characters of degree 1,56,133 are positive at the class 9A, whereas those of degree 57 vanish at this class. It follows that ρ(1) = 57, but then ρ is positive at the class 3C. This is a contradiction.  Lemma 10.9. Let H = SUp (q), p > 2, p|(q + 1), or H = SLp (q), p > 2, p|(q − 1), and is a primitive p-th root of unity. Let χ be an h = diag(1, ε, ε2 , . . . , εp−1 ) ∈ H, where ε ∈ F× q2 irreducible character of H whose kernel has order prime to p. Then χ(h) = 0. Proof. The element h is written in an orthogonal basis of the underlying vector space in the unitary case. Then h ∈ E, where E ≤ H is an extraspecial group of order p3 such that Z(E) = Z(H). The restriction of χ to E is a direct sum of irreducible representations of E non-trivial on Z(E). It is well known and can be easily checked that the character of every such representation vanishes at h. So the claim follows.  Let H = GUn (q) or GLn (q) with n > 2. Weil representations of these groups were studied by Howe [7] and other authors, and have many applications, mainly due to the fact that their irreducible constituents (which we call irreducible Weil representations) essentially exhaust the irreducible representations of degree µ1 (H) and µ2 (H). More details are given below for n = p, p odd. Let M be the underlying space of the Weil representation of H. Then M = ⊕ζ∈Irr(Z(H)) Mζ , where Mζ = {m ∈ M | zm = ζ(z)m for z ∈ Z(H)}. In general, H is irreducible on Mζ , except for the case where H = GLp (q) and ζ = 1Z(H) . In this case Mζ is a sum of a one-dimensional and an irreducible H-invariant subspace. So the irreducible Weil representations ρ of H of dimension greater than 1 are parameterised by their restriction to Z(H), and each of them remains irreducible under restriction to H ′ = SUn (q) or SLn (q). By [19], every irreducible representation of H ′ of degree µ1 (H) and µ2 (H) is an irreducible Weil representation. Moreover, every irreducible representation of H of degree µ1 (H) and µ2 (H) is obtained from an irreducible Weil representation by tensoring with a onedimensional representation. Lemma 10.10. Let p > 2, and H = GUp (q), p|(q + 1), (p, q) 6= (3, 2), or GLp (q), p|(q − 1). Let ζ ∈ Irr(Z(H)). Let ρ = ρζ be the character of an irreducible constituent of the Weil representation ω of H labeled by ζ (where ρ(1) > 1). Let h be as in Lemma 10.9. Then ρ(h) ∈ {0, p, p − 1}, except for the case with G = GLp (q) and ζ = 1Z(H) , where ρ(h) = p − 2. In addition, ρ(h) 6= 0 if and only if ρ(z) = 1 for an element z ∈ Z(H) of order p. Proof. We only consider the case H = GUp (q), as the case H = GLp (q) is similar. Let Z = Z(H), ζ ∈ Irr(Z) and ρ = ρζ be the irreducible constituent of ω labeled by ζ. This means that ρ(z) = ρ(1)ζ(z). Let X = hZ, hi. Let εi be the character of hhi such that εi (h) = ν i , where ν is a fixed pth root of unity, i = 1, . . . , p. Then the multiplicity of the eigenvalue ν i of ρ(h) equals (ω|X , ζ · εi ). Recall that ω(x) = −(−q)d , where d is the multiplicity of the eigenvalue 1 of x as a matrix in GUp (q). Therefore, ω(1) = q n , and if x = zhk and z p 6= 1 then ω(x) = −1; if z p = 1, h 6= 1 then ω(x) = q (also for z = 1). STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 23 P We compute |X| · (ω|X , ζ · εi ) = x∈X ω(x)ζ(z)εi (h), where x = zh. Note that ω(x) is an integer, so ω is self-dual. Let Zp be the subgroup of order p in Z, and Xp = hZp , hi. Then X X X ω(x)ζ(z)εi (h). ω(x)ζ(z)εi (h) + ω(x)ζ(z)εi (h) = x∈X x∈Xp x∈X / p We first show that the second sum equals 0 if i < p. Note that x = zh ∈ / Xp is equivalent to z∈ / ZP . Therefore, d = d(x) = 0 for x ∈ / X , and ω(x) = −1. For z fixed we have a partial sum p p P ζ(z) h εi (h), and h εi (h) = 0, as claimed. If i = p and ζ 6= 1Z then X X X X ζ(z)) = p2 ζ(z) = −p( ζ(z) − ω(x)ζ(z)εi (h) = −p z∈Z z ∈Z / p x∈X / p z∈Zp as ζ(z) = 1 for z ∈ Zp . If i = p and ζ = 1Z then X ω(x)ζ(z)εi (h) = −(|X| − |Xp |) = −p(q + 1) + p2 . x∈X / p P Next, we compute x∈Xp ω(x)ζ(z)εi (h). Observe that ζ(z) = 1 for z ∈ Zp so this sum P simplifies to zh∈Xp ω(zh)εi (h). Note that d(zh) = 1 if h 6= 1 and any z ∈ Zp . So if h 6= 1 then ω(zh) = q. If h = 1 then d(zh) = d(z) = 0 for z 6= 1 so ω(z) = −1. And ω(1) = q p . Therefore, we have X X X ω(z) + q p ω(zh)εi (h) + ω(zh)εi (h) = z∈Zp ,z6=1 z∈Zp ,h6=1 zh∈Xp = X z∈Zp ,h6=1 q · εi (h) + X (−1) + q p = pq z∈Zp ,z6=1 X εi (h) − (p − 1) + q p . h6=1 P (i) Let i 6= p. Then h6=1 εi (h) = −1, and the last sum equals −pq−p+1+q p = q p +1−p(q+1). P (ii) Let i = p. Then h6=1 εi (h) = p − 1, and the last sum equals pq(p − 1) − (p − 1) + q p = q p + 1 + p2 q − pq − p. Therefore, |X| · (ω|X , ζ · εi ) = q p + 1 − p(q + 1) if i 6= p, q p + 1 + (p − 1)p(q + 1) if i = p, ζ 6= 1Z , and q p + 1 + (p − 2)p(q + 1) if i = p, ζ = 1Z . In particular, the of eigenvalue ν i for i 6= p of h on the module Mζ for fixed ζ P multiplicities i are the same. As i6=p ν = −1, the trace of h on Mζ for ζ 6= 1Z with ζ(Zp ) = 1 equals (1/|X|)(q p + 1 + (p − 1)p(q + 1) − (q p + 1 − p(q + 1)) = p as |X| = p(q + 1). Similarly, if ζ = 1Z then the trace in question equals p − 1. In other words, if ωζ is the character of Mζ and ζ(Zp ) = 1 then ωζ (h) = p for ζ 6= 1Z and p − 1 otherwise.  Lemma 10.11. Let H = GUp (q), p|(q + 1), p > 2, (p, q) 6= (3, 2) or GLp (q), p|(q − 1). Then H has no Sylp -regular character. The same is true for H ′ = SUp (q) and SLp (q) and for all groups X with H ′ ≤ X ≤ H. Proof. Set G = H/Op (Z(H)). By Lemma 2.5, it suffices to prove the lemma for G in place of H. Suppose the contrary, and let χ be a Sylp -regular character of G, and let λ be an irreducible constituent of χ. We first observe that λ(1) < µ3 (G), and hence by [19], λ(1) ∈ {1, µ1 (G), µ2 (G)}. 24 GUNTER MALLE AND ALEXANDRE ZALESSKI Indeed, note that |G|p = p|q + 1|p−1 in the unitary case, respectively |G|p = p|q − 1|p−1 in the p p (q p −1)(q p−1 −q 2 ) (q p +1)(q p−1 −q 2 ) ′ linear case. By [19, Table IV], µ3 (G) ≥ µ3 (H ) ≥ (q+1)(q2 −1) , resp., (q−1)(q2 −1) if p > 3. This value is greater than |G|p . Let p = 3. Then µ3 (G) ≥ µ3 (H ′ ) ≥ (q 2 − q + 1)(q − 1)/3, resp., (q 2 − 1)(q − 1)/3 for q > 4. Again, |G|3 < µ3 (G), unless G = PGU3 (8) or PGL3 (4). The former case is settled in Lemma 10.8. Let G = PGL3 (4). Then |G|3 = 27. In this case µ1 (G) = 20, µ2 (G) = 35 and µ3 (G) = 45. So λ(1) ≤ |G|p implies λ(1) ≤ 20. The character of degree 20 is positive at class 3A, a contradiction. So |G|p ≤ µ2 (G). As mentioned prior Lemma 10.10, λ is either one-dimensional or can be seen as a character of H obtained from an irreducible Weil character by tensoring with a linear character of H. Let h ∈ H as in Lemma 10.10. Then h ∈ H ′ , so tensoring can be ignored, and we can assume that λ is an irreducible Weil character of H. Then, by Lemma 10.10, λ(h) ∈ {0, p, p − 1} in the unitary case and λ(h) ∈ {0, p, p − 2} in the linear case. If λ(1) = 1 then λ(h) = 1. So λ(h) ≥ 0. As χ is p-vanishing and |h| = p, we have χ(h) = 0. So λ(h) = 0 for every irreducible constituent of χ. This is false as λ is trivial on Op (Z(H)) by the definition of G, and hence λ(h) 6= 0 by Lemma 10.10. This is a contradiction. As irreducible Weil representations of H remain irreducible upon restriction to H ′ , this argument works for intermediate groups X too.  Lemma 10.12. Let p > 2 and let G be a group such that SLn (q) ≤ G ≤ GLn (q) with 2e < n ≤ ep, or SUn (q) ≤ G ≤ GUn (q) with 2d < n ≤ dp and (n, q) 6= (3, 2). Then G and G/Op (G) have no Sylp -regular character. Proof. For the unitary case with d > 1 the result for G is stated in Lemma 10.6. The case with d = 1 and n < p is dealt with in Lemma 10.7, and the remaining case d = 1 and n = p is examined in Lemma 10.11. Let H = GLn (q). The result for e > 1, q > 2 follows from Lemma 10.1, and that for e > 1, q = 2 is proved in Lemma 10.3. The result for e = 1, n = p is stated in Lemma 10.11. The case with e = 1, n < p is examined in Lemma 10.4. The statement on G/Op (G) follows from Lemma 2.5.  Lemma 10.13. For p > 2 let H = GLn (q), H ′ = SLn (q) with ep < n < ep2 , or H = GUn (q), H ′ = SUn (q) with dp < n < dp2 . Let G be a group such that H ′ ≤ G ≤ H. Then G has no Sylp -regular character, unless p = 3 and H = GU4 (2). Proof. Suppose the contrary, and let χ be a Sylp -regular character of G. Suppose first that e > 1, d > 1. Note that G has a subgroup X, say, isomorphic to SLep (q) × SLn−ep (q), resp., SUdp (q) × SUn−dp (q), and |G : X|p = 1. Let S be a Sylow p-subgroup of SLn−ep (q), resp., SUn−dp (q). Let Y = S × SLep (q), resp., S × SUdp (q). As |G : Y |p = 1, by Lemma 2.5, rYG/S (χ) is a Sylp -regular character of Y /S ∼ = SLep (q), resp., SUdp (q). This contradicts Lemma 10.12, unless, possibly, if G = SUn (2) and p = 3. As d > 1, this case does not occur. Next, suppose that e = d = 1, that is p|(q − 1) or q + 1. Then we refine the above argument. Set D = GLp (q) or GUp (q). Then Y /S ∼ = D. Set Y1 = G ∩ Y . Then Y1 is normal in Y and hence Op (Y1 ) = Y1 ∩ Op (Y ). As Y /S ∼ = D, it follows that Y /Op (Y ) = D/Op (D) = D/Op (Z(D)), and hence E := Y1 /Op (Y1 ) is a non-central normal subgroup of D/Op (Z(D)). By Lemma 2.5, rYG1 /Op (Y1 ) (χ) is a Sylp -regular character of E = Y1 /Op (Y1 ). However, by Lemma 10.12, E has no STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 25 Sylp -regular character, unless D = GU3 (2) and p = 3. So we are left with the case H = GUn (2), p = 3 and 3 < n < 9. The group H = GU4 (2) is excluded by assumption, so consider first H = GU5 (2). As H = H ′ × Z(H), it suffices to deal with G = SU5 (2). Suppose the contrary, and let χ be a Syl3 -regular character of G. Then χ(1) = |G|p = 243. Let λ be an irreducible constituent of χ, so λ(1) ≤ 243. If g ∈ G is an element from class 3E then λ(g) > 0 unless λ(1) = 176 or 220. As χ(g) = 0, there is a constituent λ1 , say, of χ such that λ1 (1) ∈ {176, 220}. Then λ(1) ≤ 67 = 243 − 176. Pick h ∈ G from the class 3F . Then λ1 (h) > 0, and if λ(1) ≤ 67 then λ(h) > 0, unless λ(1) = 10. So χ must have a constituent λ2 , say, of degree 10. Then λ2 (g) = 4. If λ1 (1) = 176 then λ1 (g) = −4, and hence (χ − λ1 − λ2 )(g) = 0. As λ(g) > 0 if λ(1) ≤ 67, it follows that χ = λ1 + λ2 , but then 0 = χ(h) = λ1 (h) + λ2 (h) = 3, a contradiction. So λ1 (1) = 220, and the other constituents are of degree at most 23. As λ1 (g) = −5, λ2 (g) = 4, we have (χ − λ1 − λ2 )(g) = −1, in particular, for the other constituents λ of χ we have λ(g) ≤ 1. By [1], this implies λ(1) = 1, and λ must occur with multiplicity 1, whence χ(1) = 220+10+1 = 231, a contradiction. Let H = GU6 (2). By Lemma 2.5, it suffices to deal with X := PGU6 (2). Set X ′ = PSU6 (2). Then |X ′ |3 = 36 = 729 and the irreducible characters of X ′ of degree less than 616 are positive on class 3A. In addition, |X|3 = 37 = 2187, and the irreducible characters of X of degree less than 2187 and not equal to 616 are positive on class 3A. Let χ be a Syl3 -regular character of X or X ′ . Then the irreducible character µ of degree 616 is a constituent of χ. Note that τ (3A) = −14. If χ ∈ Irr(X ′ ) then the sum of the other constituents of χ is at most 113. By [1], they are of degree 1 or 22. The trivial character cannot occur with multiplicity greater than 1, so 113 or 112 must be a multiple of 22, which is false. Let χ ∈ Irr(X). Note that the multiplicity of µ in χ is at most 3, and if µ occurs with multiplicity 3 then the sum of the other constituents of χ is at most 2187 − 1848 = 339. The irreducible characters of degree at most 339 have degrees 252,232,22,1, and all them as well as µ are positive at class 3C. This is a contradiction. Suppose that µ occurs once. Then the sum of the other constituent values at class 3A is −14. It follows that these constituents may only be of degrees 770,252,232,22,1. Inspecting [1], one observes that all them as well as µ are positive at class 3C. This is a contradiction. So the multiplicity of µ must be 2. Then the sum of the other constituent values at class 3A is −28. Therefore, the degrees of the other constituents may only be 770,560,385,252,232,22,1. Let ν be the character of degree 385. Then ν(3A) = 25. If (χ, ν) > 0 then the sum of the other constituent values at class 3A is −3. The trivial character is the only one whose value is at most 3. As this cannot occur twice, we get a contradiction. Therefore, (χ, ν) = 0. As above, this contradicts χ(3C) = 0. This completes the analysis of the case with n = 6. Let n = 7. Then H ′ = SU7 (2) contains a subgroup isomorphic to GU6 (2), which contains a Sylow 3-subgroup of H ′ . So the result for this case follows from n = 6. In addition, H = H ′ · Z(H), so we are done by Lemma 2.5. Similarly, the result for n = 8 follows from that with n = 7.  Remark 10.14. The group SU4 (2) has an irreducible projective character of degree 81 (for p = 3), and hence H = GU4 (2) = SU4 (2)×Z(H) has a projective character of degree |H|3 = 243. Theorem 10.15. Let p > 2 and G be a group such that SLn (q) ≤ G ≤ GLn (q), or SUn (q) ≤ G ≤ GUn (q). Suppose that Sylow p-subgroups of G/Z(G) are not cyclic. Then G has no Steinberg-like character, unless p = 3 and G ∈ {SU3 (2), GU 3 (2), SU4 (2), GU4 (2)}. 26 GUNTER MALLE AND ALEXANDRE ZALESSKI Proof. If n ≥ ep2 in the linear case and n ≥ dp2 in the unitary case then the result follows from Proposition 9.6 for G/Op (G) in place of G, and then for G in view of Lemma 2.5. If ep < n < ep2 in the linear case and dp < n < dp2 in the unitary case then the result follows from Lemma 10.13. If 2e ≤ n ≤ ep in the linear case and 2d ≤ n ≤ dp in the unitary case then the result follows from Lemma 10.12. If n < 2e in the linear case and n < 2d in the unitary case then Sylow p-subgroups of G/Z(G) are cyclic.  Remark 10.16. Proposition 9.6 gives a better bound for n, but this does not yield an essential advantage as the cases with n = e(p + 1) and d(p + 1) are not covered by Proposition 9.6, and we have to use Lemma 10.13 anyway. 10.3. The symplectic and orthogonal groups for p > 2. Lemma 10.17. Let G = Sp2n (q) (q even, n ≥ 2, (n, q) 6= (2, 2)), G = Spin2n+1 (q) (q odd, n ≥ 3, (n, q) 6= (3, 3)), or G = Spin± 2n (q) (n ≥ 4). Suppose that Sylow p-subgroups of G are abelian. Then |G|p < µ1 (G). Proof. Let S ∈ Sylp (G). As S is abelian, we have p > 2 and |S| ≤ (q + 1)n . If G = Sp2n (q), q even, n ≥ 2, (n, q) 6= (2, 2), or Spin2n+1 (3) then µ1 (G) ≥ (q n − 1)(q n − q)/2(q + 1) (see [19, Table II]). This is greater than (q + 1)n . If G = Spin2n+1 (q), q > 3 odd, n ≥ 3, then µ1 (G) ≥ (q 2n − 1)/(q 2 − 1). Again µ1 (G) > (q + 1)n , whence the result. The cases with G = Spin±  2n (q), n ≥ 4, are similar, see [19, Thm. 7.6]. Proposition 10.18. Let e be odd, p > 2, and let H = Sp2n (q) with n > 1, GO2n+1 (q) with − 2 n > 2, GO+ 2n (q) with n > 3, or GO2n+2 (q) with n > 2. Suppose that 2e ≤ n < ep . Then H has no Sylp -regular character. Proof. Let S ∈ Sylp (H). By Lemma 9.2(1), S is conjugate to a Sylow p-subgroup of a subgroup H1 ∼ = GLn (q) of H. By Lemmas 10.1, 10.3, 10.12 and 10.13, GLn (q) for 2e ≤ n < ep2 has no Sylp -regular character, unless possibly when n = 2. Let n = 2, so H = Sp4 (q), e = 1 and p|(q − 1). Then |H|p = |q − 1|2p . If q is even then µ1 (G) = q(q − 1)2 /2 for q > 2. This is greater than |H|p , whence the result. If q is odd then |H|p ≤ (q − 1)2 /4 and µ1 (H) = (q 2 − 1)/2. So again |H|p < µ1 (H).  Proposition 10.19. Let e be even, p > 2, and let H = Sp2n (q) (n > 1, (n, q) 6= (2, 2)), 2 GO2n+1 (q) (q odd, n > 2), or GO± 2n (q) with n > 3. Suppose that 2e ≤ 2n < ep . Then H has no Sylp -regular character. Proof. Write 2n = ek + m with m < e, where k > 1 is an integer. As H contains a subgroup H1 with (|H : H1 |, p) = 1, where H1 ∼ = Spke (q) or GOke+1 (q), respectively, it suffices to prove the lemma for 2n = ke. Let 2n = ke. By Lemma 9.4, a Sylow p-subgroup of H is contained in a subgroup isomorphic to GUk (q e/2 ). By Lemma 10.12 for 2 < k ≤ p and Lemma 10.13 for p < k < p2 (with d = 1 and q e/2 in place of q), the group GUk (q e/2 ) with (k, q e/2 ) 6= (3, 2) has no Sylp -regular character, whence the claim. (The exceptional case H = Sp6 (2), p = 3 is considered below.) Let k = 2. Then H = Sp2e (q), and p|(q e/2 + 1). Then |H|p = |q e/2 + 1|2p . If q is even then µ1 (G) = (q e − 1)(q e − q)/2(q + 1) for q > 2. This is greater than |H|p , whence the result. If q is odd then |H|p ≤ (q e/2 + 1)2 /4 and µ1 (H) = (q e − 1)/2. So |H|p < µ1 (H), whence the result. STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 27 A similar argument works if H = GOke+1 (q) as well as for H = GO− ke (q) with k odd, and for + H = GO+ (q) with k > 2 even, except when H = GO (2) and e = 2. 8 ke (2) and e = 2 so p = 3. Then |G| = 243 and the irreducible characters of Let H = GO+ 3 8 degree less than 243 are of degrees 1, 28, 35, 50, 84, 175, 210. Let χ be a Sylp -vanishing character of degree 243 and λ an irreducible constituent of χ. By [1], λ(3E) > 0 whenever λ(1) ≤ 243. This is a contradiction as χ(3E) = 0. e/2 + 1|2 < µ (H) = (q e − 1)(q e−1 − 1)/(q 2 − 1) Let k = 2 and H = GO+ 1 p 2e (q). Then |H|p = |q for q > 2 and q = 2, e > 4. (If q = 2, e = 4 then p = 5, and |H|5 = 25 < µ1 (H) = 28.) So the result follows. (The case e = 2 has been examined above.) + Suppose that H = GO− 2n (q) with k even or H = GO2n (q) with k odd. Then some Sylow + p-subgroup of H is contained in a subgroup H1 isomorphic to GO− 2n−e (q) or GO2n−e (q), respectively. Note that 2n − e = (k − 1)e. For the groups H1 the result has been proven above, except for the cases where k − 1 = 1 or (k − 1)e ≤ 6. However, if k − 1 = 1 then Sylow p-subgroups of H1 , and hence of H are cyclic, and this case has been examined in Propositions 3.1 and 4.4. Let (k − 1)e ≤ 6. As k − 1 > 1, we have k = 3, e = 2 as e is even. Then H = GO− 8 (q) 3 4 3 and µ1 (H) = q(q + 1) [19]. If p > 3 then |H|p = |q + 1|p , otherwise |H|3 = 3|q + 1|3 . Then |H|p < µ1 (H), unless q = 2. Let q = 2, p = 3. Then |G|3 = 81. By [1] the irreducible characters of degree less than 81 are of degrees 1, 26, 52. Therefore only these characters can occur as irreducible constituents of a Syl3 -regular character χ. However, the values of these characters at an element g ∈ G in class 9A are 1, 2, 1, in particular, positive. As χ(g) = 0, this is a contradiction. Suppose that G = Sp6 (2) and p = 3. Then |S| = 81. Let τ be an irreducible constituent of χ. Then τ (1) ≤ 81. Let g ∈ G belong to the conjugacy class 3C in notation of [1]. By inspection of the character table of G one observes that τ (g) ≥ 0 whenever τ (1) ≤ 81. Therefore, τ (g) = 0 for every irreducible constituent τ of χ. This implies τ (1) ∈ {21, 27}, see [1]. However, such a character takes positive values at the elements of class 3A. So this case is ruled out.  Remark 10.20. Let G be the universal covering group of SO+ 8 (2). One observes that G has a Syl5 -regular character, and has no Syl3 -regular characters. If H = Sp4 (2) then H has Steinberglike characters for p = 3, both reducible and irreducible. 11. Classical groups at p = 2 In this section we investigate Sylp -regular and Steinberg-like characters of simple classical groups over fields of odd order q > 3 at the prime p = 2. 11.1. Linear and unitary groups at p = 2. We first deal with the smallest case: Proposition 11.1. Let q > 3 be odd. (a) Let G = PSL2 (q). Then G has a reducible Syl2 -regular character if and only if q + 1 = 2k for some k ≥ 3 or if q = 5. (b) Let G = SL2 (q). Then G has a reducible Syl2 -regular character if and only if q ± 1 is a 2-power. Proof. (a) The 2-part of |G| is |q − 1|2 if q ≡ 1 (mod 4) and |q + 1|2 else. The smallest non-trivial character degree is (q + 1)/2 in the first case, (q − 1)/2 in the second. It follows that there cannot be Syl2 -regular characters in the first case, unless q = 5. In the second case, it follows from the 28 GUNTER MALLE AND ALEXANDRE ZALESSKI character table of G that the sum of the trivial and the Steinberg character is Syl2 -regular when q + 1 is a power of 2, and there are no cases otherwise. If q = 5 then there are two reducible Syl2 -regular characters of degree 4 by [1]. (b) Let χ be a reducible Syl2 -regular character. Let 1 6= z ∈ Z(G); then χ = χ1 + χ2 , where χ1 (z) = χ1 (1) and χ2 (z) = −χ2 (1). By Lemma 2.5 (with P = G and U = Z(G)), χ1 is a Syl2 -regular character for G/Z(G) = PSL2 (q). If χ1 is irreducible then q ± 1 is a 2-power by Proposition 3.1(2); by (a), this is also true if χ1 is reducible. So q ± 1 is a 2-power. Then there are irreducible characters χ1 , χ2 such that χ1 +χ2 is 2-vanishing of degree 2(q±1) = |G|2 . Indeed, using the character table of G one observes that there exist irreducible characters χ1 , χ2 of G that vanish at non-central 2-elements of G, and such that χ1 (z) = χ1 (1) and χ2 (z) = −χ2 (1). It follows that χ1 + χ2 is a reducible Syl2 -regular character.  We recall that µ3 (G) denotes the third smallest degree of a non-trivial irreducible representation of G. Lemma 11.2. Let G be a quasi-simple group such that G/Z(G) ∈ {PSLn (q), PSUn (q)} with n ≥ 3, q > 3 odd and |Z(G)|2 = 1. Then |G|2 < µ3 (G). Proof. Let first G/Z(G) = PSL3 (q), q > 3 odd. Then µ1 (G) = q(q + 1) by Table 1, while |G|2 = 2|q − 1|22 if q ≡ 1 (mod 4), respectively |G|2 = 4|q + 1|2 if q ≡ 3 (mod 4). Thus, |G|2 < µ1 (G) unless q − 1 is a 2-power. In the latter case, µ3 (G) = (q 2 − 1)(q − 1), and our claim follows. Next, let G/Z(G) = PSL4 (q) with q > 3 odd. Then µ3 (G) = (q 3 − 1)(q − 1)/2, which is larger than |G|2 ≤ 2(q − 1)3 for q ≥ 5. Now assume that G/Z(G) = PSLn (q), with n ≥ 5 and n n−1 −q 2 ) (see Table 1) while |G|2 ≤ (q − 1)n−1 2n−1 when q ≡ 1 q > 3 odd. Then µ3 (G) = (q (q−1)(q 2 −1)(q−1) (mod 4), and |G|2 ≤ (q + 1)⌊n/2⌋ 2n−1 when q ≡ 3 (mod 4). Again, the claim follows. Let G/Z(G) = PSU3 (q), q > 3 odd. Then µ1 (G) = q(q − 1) by [19, Table V], while |G|2 = 2|q + 1|22 if q ≡ 3 (mod 4), respectively |G|2 = 4|q − 1|2 if q ≡ 1 (mod 4). Thus, |G|2 < µ1 (G) unless q + 1 is a 2-power. In the latter case, µ3 (G) = (q 2 − q + 1)(q − 1), and our claim follows. 2 2 +1) Now let G/Z(G) = PSU4 (q), q > 3 odd. Then µ3 (G) = (q −q+1)(q . Suppose first that 2 4|(q + 1). We have |G|2 = |PSU4 (q)|2 ≤ 2(q + 1)3 , whereas µ3 (G) = (q 2 + 1)(q 2 − q + 1)/2. Then |G|2 < µ3 (G). Suppose now that 4|(q − 1). Then |G|2 ≤ 2(q − 1)2 which is less than µ1 (G) = (q 4 − 1)/(q + 1). Now assume that G/Z(G) = PSUn (q) with n ≥ 5 odd. Here n n−1 −q 2 ) µ3 (G) = (q (q+1)(q , while |G|2 ≤ (q − 1)(n−1)/2 2n−1 if q ≡ 1 (mod 4), respectively |G|2 ≤ 2 −1)(q+1) (q + 1)n−1 2n−1 if q ≡ 3 (mod 4). The claim follows. Finally, assume that G/Z(G) = PSUn (q) n n−1 +1) with n ≥ 6 even. Here µ3 (G) = (q (q−1)(q , while the 2-part of |G| is bounded above as given 2 −1)(q+1) before. Again we can conclude.  Proposition 11.3. Let G be quasi-simple with G/Z(G) ∈ {PSLn (q), PSUn (q)} with n ≥ 3 and q > 3 odd. (a) If n = 3, 4 then G has no Syl2 -regular character. (b) If n ≥ 5 then G has no Steinberg-like character for p = 2. Proof. By Lemma 2.5 (with P = G), it suffices to prove the result in the case where |Z(G)|2 = 1. So we assume this, and then |G|2 equals the order of a Sylow 2-subgroup of G/Z(G). Let first G/Z(G) = PSLn (q), q > 3 odd. Let χ be a Syl2 -regular character for G. By Lemma 11.2, χ(1) < µ3 (G), and hence the non-trivial irreducible constituents of χ are of degree STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 29 (q n − 1)/(q − 1) or (q n − q)/(q − 1), see Table 1. It is known that the irreducible characters of degree (q n − 1)/(q − 1) are induced characters λG , where λ 6= 1P is a one-dimensional character of the stabiliser P of a line of the underlying space for GLn (q), while the irreducible character of degree (q n − q)/(q − 1) is the unique non-trivial constituent τ of the permutation character 1G P = τ + 1G on P . Let n ≥ 5 and let g ∈ SLn (q) be a block-diagonal matrix, with an (n − 2) × (n − 2)-block corresponding to a primitive element of Fqn−2 with determinant 1, and a 2×2-block corresponding to an element of order q + 1. Since g has no eigenvalue in Fq , no conjugate of g is contained in P , so all induced characters from P to G vanish on g. In particular λG (g) = 0 and τ (g) = −1. Note that the image ḡ ∈ G of g has even order, so χ(g) = 0 if χ is Steinberg-like. Write χ = x1 1G + x2 τ + Λ, where Λ is a sum of x3 induced characters of degree (q n − 1)/(q − 1), with suitable xi ≥ 0. Evaluating on g we see that x1 = x2 , but then χ(1) = (x1 + x3 )(q n − 1)/(q − 1) is divisible by some odd prime, so cannot equal the 2-power |G|2 . This proves part (b) for G/Z(G) = PSLn (q). Now assume that n = 4. Then an easy estimate shows that when q − 1 is not a 2-power, so |q − 1|2 ≤ (q − 1)/3, and q 6= 7, then |G|2 < µ1 (G). So we may assume that in addition either q = 7 or q − 1 is a power of 2. For q 6= 7 let g be the 2-element   0 1 0 0 a 0 0 0  g= 0 0 0 1 ∈ SL4 (q), 0 0 a−1 0 where a ∈ F× q is a 2-element of order q − 1. Observe that again g is not conjugate to an element of P , thus λG (h) = 0 and τ (h) = −1. As g is a 2-element and χ is Syl2 -regular, we have χ(g) = 0. We may now argue as above to conclude. When q = 7 then the candidate characters have degrees 1, 399 and 400, while |G|2 = 29 = 512, so clearly there can be no Syl2 -regular character. Now consider the case when G/Z(G) = PSL3 (q). The proof of Lemma 11.2 shows that µ1 (G) > |G|2 unless q − 1 is a 2-power. In the latter case the possible constituents of χ can have degrees 1, q 2 + q, q 2 + q + 1, while |G|2 = 2(q − 1)2 . Clearly at most one of the degrees q 2 + q, q 2 + q + 1 can contribute to χ(1), but then necessarily q = 5. But in that case the character table shows that there’s no Syl2 -regular character. This completes the proof of (a) when G/Z(G) = PSLn (q). Now let G/Z(G) = PSUn (q) with q > 3 odd, and let χ be a Syl2 -regular character of G. According to Lemma 11.2, χ(1) < µ3 (G), and hence the non-trivial irreducible constituents of χ are of degree (q n − (−1)n )/(q + 1) or (q n + (−1)n q)/(q + 1), see [19, Table V]. The first of these are semisimple characters lying in the Lusztig series of an element s of order q + 1 in the dual group G∗ = PGUn (q) with centraliser CG∗ (s) ∼ = GUn−1 (q), the second is a unipotent character, τ say, corresponding to the character of the Weyl group Sn parametrised by the partition (n − 1, 1). Let g ∈ SUn (q) be a regular element of even order in a maximal torus T of order (q 2 − 1)(q 2n−2 − (−1)2n−2 )/(q + 1), see [10, Lemma 3.1(a)]. Then no conjugate of the dual maximal torus T ∗ contains s, so the characters in E(G, s) vanish on g (see e.g. [11, Prop. 6.4]). If χ is Steinberg-like, then χ(g) = 0. As τ is unipotent, its value on g is (up to sign) the same as ψ(h) where ψ ∈ Irr(Sn ) is labelled by (n − 1, 1) and h is a permutation of cycle shape (n − 2, 2), see [10, Prop. 3.3 and remark before Prop. 4.2]. The Murnaghan–Nakayama rule gives that 30 GUNTER MALLE AND ALEXANDRE ZALESSKI ψ(h) ∈ {±1}, so τ (g) ∈ {±1}. We may now argue as in the first part to conclude that χ cannot be Steinberg-like, thus completing the proof of (b). Next, assume that G/Z(G) = PSU4 (q) with q > 3 odd. If q +1 is not a power of 2 and q 6= 5, 9 then |G|2 < µ1 (G), as |q + 1|2 ≤ (q + 1)/3. So now assume that q + 1 is a power of 2, and hence in particular q ≡ 3 (mod 4). Then |G|2 = 2(q + 1)3 , while the three smallest character degrees are 1, (q 4 − 1)/(q + 1), (q 4 + q)/(q + 1), with the trivial character occurring at most once. It is easily seen that there is no non-negative integral solution for a possible decomposition of χ. When q = 5 then the three smallest degrees are 1, 104, 105, while |G|2 = 128; if q = 9 then the three smallest degrees are 1, 656, 657 while |G|2 = 512; so in neither case can there be Syl2 -regular characters either. Finally, when G/Z(G) = PSU3 (q) then again the proof of Lemma 11.2 shows that q + 1 must be a 2-power. Here the possible constituents of χ have degrees 1, q 2 − q, q 2 − q + 1, while |G|2 = 2(q + 1)2 . Again an easy consideration shows that at most the case q = 7 needs special attention. But there the existence of Syl2 -regular characters can be ruled out from the known character table.  We now treat the case q = 3, which is considerably more delicate. Lemma 11.4. Let G = PSL3 (3) or PSU3 (3). Then G does not have reducible Syl2 -regular characters. Proof. For G = PSL3 (3) we have |G|2 = 16, and all irreducible characters of degree less than 16 take non-negative values on class 4A, so there are no Syl2 -regular characters. For G = PSU3 (3) we have |G|2 = 32, and all irreducible characters have degree at most that large. Since the smallest non-trivial character degree is 6, those of degrees 27 and 28 cannot be constituents of a Syl2 -regular character χ. Thus, we need to consider the characters of degrees 1, 6, 7, 14, 21. Clearly those of degree 21 cannot occur either. As 32 ≡ 4 (mod 7) we see that the character of degree 6 has to appear at least three times, but then the values on elements of order 4 give a contradiction.  Remark 11.5. PSL3 (3) and PSU3 (3) both have irreducible Syl2 -regular characters, see Proposition 3.1. Lemma 11.6. Let G = PSL4 (3) or PSU4 (3). Let χ be a Syl2 -vanishing character of G. Then l2 (χ) ≥ 4. Proof. Suppose the contrary. Note that χ is reducible. As |G|2 = 128, we have χ(1) ≤ |G|2 · 3 = 384. Let τ be an irreducible constituent of χ of maximal degree. For all numerical data see [1]. Let G = PSL4 (3). Then τ (1) < 351 (otherwise τ (1) = 351, so (χ − τ )(1) = 33, and then χ(2B) > 0, which is false). Let µ ∈ Irr(G) and µ(1) < 351. Then µ(4B) ≥ 0 unless µ(1) = 90, and µ(4B) 6= 0 unless µ(1) = 52 or 260. Let µ(1) = 90. Then (χ, µ) > 0. Indeed, otherwise the irreducible constituents of χ are of degree 52 or 260, which implies χ(2A) > 0, a contradiction. It follows that (χ − µ)(1) ≤ 294. Let σ ∈ Irr(G) with σ(1) = 39. The irreducible characters of G of degree at most 294 and distinct from σ are non-negative at 2A. In addition, σ(2A) = −1, and µ(2A) = 10. As χ(2A) = 0, it follows that (χ, σ) ≥ 10. Then χ(1) ≥ µ(1) + 10σ(1) > 384, a contradiction. STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 31 Let G = PSU4 (3) and µ ∈ Irr(G) with (χ, µ) > 0. The irreducible characters of degree at most 384 are of degree at most 315. If τ (1) = 315 then µ(1) ≤ 69. Then τ (2A) > 0 and µ(2A) > 0, a contradiction. Suppose that τ (1) = 280. Then µ(1) ≤ 104, but then we obtain a positive value on class 2A. The same consideration rules out τ (1) = 210. Suppose that τ (1) = 189. It occurs once as otherwise 1G occurs 6 times, which is false as (χ, 1G ) ≤ 3. Then µ(1) 6= 140, 90, so µ(4A) > 0, τ (4A) > 0, a contradiction. No more option exists, as the irreducible characters of degree less than 189 are positive on 2A.  Lemma 11.7. Let PSL4 (3) ≤ G ≤ PGL4 (3) or PSU4 (3) ≤ G ≤ PGU4 (3). Let χ be a 2vanishing character of G. Then l2 (χ) ≥ 4. Proof. By Lemma 2.9(a), χ = ψ G , where ψ is a proper character of G′ . By inspection of the character table of G′ , see [1], it is easily checked that the conjugacy class of any element g ∈ G′ of 2-power order is G-invariant. Then, by Lemma 2.9(b), ψ(g) = 0 for every 2-element g 6= 1 of G′ . This means that ψ is Syl2 -vanishing. By Lemma 11.6, l2 (ψ) ≥ 4. Then l2 (ψ G ) ≥ 4.  Lemma 11.8. Let G = PGL4 (3), and let χ be a 2-vanishing character of G. Let η1 , . . . , ηk be the irreducible constituents of χ disregarding multiplicities, and η = η1 + · · · + ηk . Then η(1) ≥ 2|G|2 . Proof. Let G′ = PSL4 (3). Then |G′ |2 = 128 and thus 2·|G|2 = 512. Suppose the contrary. Then η(1) < 512. We can assume that ηi (1) ≥ ηj (1) for 1 ≤ i < j ≤ k. Note that k > 1, otherwise χ = aη1 for some a, and hence η1 is a 2-vanishing character of G and η1 (1) is a multiple of |G|2 . By [1], G has no character of degree at most 512 with this property. By [1], we have η1 (1) ≤ 468. Note that all irreducible characters of G′ of degree at most 468 extend to G = G′ · 2 except χ11 , χ12 of degree 260, χ9 , χ10 of degree 234, χ6 , χ7 of degree 65 and χ2 , χ3 of degree 26. P The corresponding characters of G are of degrees 520, 468, 130 and 52, respectively. Let χ = ai ηi , where aiP > 0 are integers. (i) Suppose that ηP 1 (1) = 468. Then i>1 ηi (1) ≤ 44. Computing χ(4B) we get a contradiction (as η1 (4B) = 0 and i>1 ai ηi (4B) > 0 and k > 1). P (ii) Suppose η1 (1) = 416. If η2 (1) ≤ 90 then i>2 ηi (1) ≤ 6, whence k = 3 and η3 = 1G . Computing χ(2B) we get a contradiction. P So η2 (1) ≤ 52. If η2 (1) = 52 then i>2 ηi (1) ≤ 44. Computing χ(4B) we get a contradiction, unless k = 2 and η2 (4B) = 0 (that is, η2 = χ5 in [1]). In this case computing χ(4C) gives a contradiction. So ηi (1) ≤ 39 for i > 1. This violates χ(2B) = 0. (iii) Let η1 (1) = 390. Then η2 (1) ≤ 90. If η2 (1) = 90 then η3 (1) ≤ 32, whence k = 1 and η3 (1) = 1. This conflicts with χ(4A) = 0. If η2 (1) ≤ 52 then computing χ(4B) yields a contradiction. P P (iv) Let η1 (1) = 351 so i>1 ηi (1) ≤ 161. If η2 (1) = 130 then i>1 ηi (1) ≤ 31, and hence η3 (1) = 1, which yields a contradiction with χ(20A) = 0. Let η2 (1) ≤ 90. Then ηi (1) ≤ 71 for i > 2. Then ηi (2A) + ηi (2B) > 0 for i = 1, . . . , k, which violates χ(2A) + χ(2B) = 0. (v) Let η1 (1) = 260. Then η1 (2A) ≥ 0 and the only irreducible character λ of degree less than 260 with negative value at 2A has λ(1) = 39. It follows that (χ, λ) ≥ 0, and then ηi (1) ≤ 213 if i > 1 and ηi 6= λ. Note that λ(8A) = 1 and η1 (8A) = 0. As χ(8A) = 0, it follows that a character of degree 130 occurs in χ, which implies η2 (1) = 130. Then we get contradiction to χ(2A) + χ(4B) = 0. 32 GUNTER MALLE AND ALEXANDRE ZALESSKI (vi) Let η1 (1) ≤ 234. Computing χ(2A) + χ(4B) leads to a contradiction.  Lemma 11.9. Let G = PGU4 (3), and χ a 2-vanishing character of G. Let η1 , . . . , ηk be the irreducible constituents of χ disregarding multiplicities, and η = η1 +· · ·+ηk . Then η(1) ≥ 2|G|2 . Proof. Let G′ = PSU4 (3). Then |G′ |2 = 128, |G|2 = 512 and 2 · |G|2 = 1024. Suppose the contrary. Then η(1) < 1024. We can assume that ηi (1) ≥ ηj (1) for 1 ≤ i < j ≤ k. Note that χ · τ = χ for every linear character τ of G. Therefore, ηi τ is a constituent of η. Let g ∈ G \ G′ . Then ηi τ = η implies ηi (g) = 0. By [1], if 630 6= ηi (1) > 420 then ηi (4E) 6= 0 or ηi (4G) 6= 0; it follows that η must contain at least 2 representations of the same degree, which contradicts η(1) ≤ 1024. So ηi (1) either equals 630 or ηi (1) ≤ 420. By [1], ηi (2A) + ηi (4B) > 0 for these ηi , unless ηi (1) = 210. This violates χ(2A) + χ(4B) = 0 unless k = 1 and η1 (1) = 210. Then χ(2A) > 0, a contradiction.  ∼ ··· ∼ Lemma 11.10. Let H = H1 × · · · × Hn , where H1 = = Hn ∼ = PGL4 (3) or PGU4 (3). Let χ be a 2-vanishing character of H. Then χ(1) ≥ 2n+1 |H|2 . Proof. By Lemma 11.7, the claim holds for n = P 1, so by induction we can assume that it is true for X := H2 × · · · × Hn . By Lemma 2.7, χ = i ηi σi , where ηi ∈ Irr(H1 ), σi are 2-vanishing P characters of X and χ′ = i l2 (σi )ηi is a 2-vanishing character of H1 . By induction, σi (1) ≥ P 2n |X|2 . By Lemmas 11.8 and 11.9 applied to χ′ , we have i ηi (1) ≥ 2|H1 |2 , so χ(1) ≥ 2n+1 |H|2 by Lemma 2.9.  Proposition 11.11. Let n > 1 and G = GL4n (3) or GU4n (3). Let χ be a 2-vanishing character of G. Then l2 (χ) ≥ 4. Proof. Let X be the direct product of n copies of GL4 (3) or GU4 (3). Let χ be a 2-vanishing character of X. By Lemmas 2.5 and 11.10, χ(1) ≥ 2n+1 |X|2 . Let Y = X · Sn , the semidirect product, where Sn acts on X by permuting the factors. Then Y contains a Sylow 2-subgroup of G. Let M = X · S, where S ∈ Syl2 (Sn ), so the index |G : M | is odd. Note that |G|2 = |X|2 · |Sn |2 . As |Sn |2 ≤ 2n−1 (see the proof of Proposition 6.7), the result follows for these groups.  Theorem 11.12. Let p = 2, m > 3 and G one of GLm (3), SLm (3), PSLm (3), GUm (3), SUm (3), PSUm (3). Then G has no Steinberg-like character. Moreover, if χ is a 2-vanishing character of G then l2 (χ) ≥ 4. Proof. Let first G = GLm (3) or GUm (3). For m ≡ 0 (mod 4) the result is stated in Proposition 11.11. Let m = 4n + l, where 1 ≤ l < 4, and H = GL4n (3) or GU4n (3). Let S0 be a Sylow 2-subgroup of GLl (3) or GUl (3) and set U = H × S0 . Then U contains a Sylow 2-subgroup of G. Therefore, l2 (χ) = l2 (χ|U ). By Lemma 2.5, if ν is a 2-vanishing character of U then l2 (ν) = l2 (µ) for some 2-vanishing character µ of H. So l2 (ν) ≥ 4 by Proposition 11.11. So the result follows for these groups. For G = SLm (3) or SUm (3) the result follows from the above and Lemma 2.12. For G = PSLm (3) or PSUm (3) the statement follows from the above and Lemma 2.5.  11.2. Orthogonal and symplectic groups at p = 2. Let V be the natural module for H = Sp2n (q), q odd, and for g ∈ G let d(g) be the dimension of the fixed point subspace of g on V . Let STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 33 ωn denote the Weil character of H. By Howe [7, Prop. 2], |ωn (g)| = q d(g)/2 . Let ωn = ωn′ + ωn′′ , where ωn′ , ωn′′ ∈ Irr(H) and ωn′ (z) = −ωn′ (1) for 1 6= z ∈ Z(H). Lemma 11.13. (a) Let h ∈ H be semisimple such that h and zh fix no non-zero vector on V. Then |ωn′′ (h)| ≤ 1. (b) Let V = V1 ⊕ V2 , where V1 is a non-degenerate subspace of dimension 2, let g ∈ H be an element such that gVi = Vi , i = 1, 2, g|V1 = −Id, and g and zg fix no non-zero vector on V2 . Then |ωn′′ (g)| ≥ (q − 1)/2. (c) Let q > 3. Then ωn′′ is not constant on the 2-singular elements of PSp2n (q). Proof. (a) We have ωn (h) = ωn′ (h) + ωn′′ (h) and ωn (zh) = −ωn′ (h) + ωn′′ (h). Therefore, by [7, Prop. 2], 2 ≥ |ωn (h) + ωn (zh)| = |2ωn′′ (h)|, whence the claim. (b) We have |ωn (g)| = 1 and |ωn (zg)| = q by [7, Prop. 2]. Then q − 1 ≤ |ωn (g) + ωn (zg)| = |2ωn′′ (g)|, whence the claim. (c) Choose g as in (b) and h to be an element stabilising   V1 , V2 such that h coincides with 0 1 g on V2 and the matrix of h on V1 is similar to . Then h is a 2-singular element −1 0 satisfying (a), and hence |ωn′′ (h)| ≤ 1. Let h and g be the images of h, g in H/Z(H). Then h and g are 2-singular elements of PSp2n (q). As Z(H) is in the kernel of ωn′′ , this can be viewed as a character of H/Z(H). As (q − 1)/2 is greater than 1 for q > 3, (c) follows.  Proposition 11.14. Let G = PSp2n (q), with q > 3 odd and n ≥ 2. Then G has no Syl2 -regular characters. Proof. We have ( |q − 1|n2 · 2n−1 · |n!|2 |PSp2n (q)|2 = |q + 1|n2 · 2n−1 · |n!|2 if 4 divides q − 1, if 4 divides q + 1. k Let k be minimal with n ≤ 2k , then as |n!|2 ≤ |2k !|2 = 22 −1 we have ( |q − 1|n2 · 4n−1 if 4|(q − 1), |PSp2n (q)|2 ≤ |q + 1|n2 · 4n−1 if 4|(q + 1). On the other hand µ3 (G) = (q n − 1)(q n − q)/(2(q + 1)) by [19, Thm. 5.2], and this is larger than |G|2 , unless n = 2 and q = 5, 7. Let’s set aside these cases for a moment. Then otherwise if χ is Syl2 -regular, the constituents of χ are either Weil characters or the trivial character. Now note that a Weil character of Sp2n (q) of degree (q n ± 1)/2 has the centre in its kernel if and only if its degree is odd. So, the non-trivial constituents of χ have degree (q n − 1)/2 if q ≡ 3 mod 4 and n is odd, and (q n + 1)/2 else. According to Lemma 2.1 the trivial character occurs at most once in χ. As (q n ± 1)/2 is never a power of 2 for n ≥ 2 and odd q (consider a Zsigmondy prime divisor), the trivial character must occur exactly once. Let ψ1 , ψ2 denote the two Weil characters of G, interchanged by the outer diagonal automorphism γ of G. Observe that γ is induced by an element of GL2n (q) and thus fixes all involution classes of G. Let g ∈ G be an involution and write a := ψ1 (g) = ψ2 (g). Then χ(g) = ma + 1, where m is the number of non-trivial constituents of χ. As necessarily m > 1 (compare the degrees) we see that χ(g) 6= 0, so χ is not Syl2 -regular. 34 GUNTER MALLE AND ALEXANDRE ZALESSKI We now discuss the two exceptions. For G = PSp4 (5), |G|2 = 26 = 64 and all irreducible characters of degree at most 64 take non-negative values on class 2B, so there is no Syl2 -regular character. For G = PSp4 (7), |G|2 = 28 = 256 and all irreducible characters of degree at most 256 take positive values on class 8A, except for one of degree 175 which takes value −1, and one of degree 224 which takes value 0. As at most one of those latter two characters could occur, and at most once, there can be no Syl2 -regular character for p = 2.  Proposition 11.15. Let G = Ω2n+1 (q) with q > 3 odd and n ≥ 3. Then G has no Syl2 -regular characters. Proof. According to [19, Thm. 6.1] we have µ1 (G) = (q 2n − 1)/(q 2 − 1), which is larger than |G|2 unless either n = 3 and q = 7, or n = 4 and q = 5, 7. For G = Ω7 (7) the only non-trivial character of degree less than |G|2 = 212 is the semisimple character of degree 2451 (see [19]). Since the trivial character can occur at most once in a Syl2 regular character, we see that no example can arise here. For G = Ω9 (5) the only non-trivial character of degree less than |G|2 = 214 is the semisimple character of degree 16276 (see [19]). Again, this does not lead to an example. For G = Ω9 (7) the only non-trivial character of degree less than |G|2 = 218 is the character of degree 120100, and we conclude as before.  Proposition 11.16. Let G = PΩ± 2n (q) with q > 3 odd and n ≥ 4. Then G has no Syl2 -regular characters. Proof. The second smallest non-trivial character degree of G = PΩ+ 2n (q) is given by µ2 (G) = n n−1 (q − 1)(q − 1)/(q + 1)/2 (see [16, Thm. 1.4]), which is larger than |G|2 unless (n, q) = (4, 7). Leaving that cases aside for a moment, we see that any Syl2 -regular character of G is a multiple of the smallest non-trivial character, of degree (q n − 1)(q n−1 + q)/(q 2 − 1), plus possibly the trivial character. Arguing as in the case of symplectic groups we see that such characters take non-zero value on involutions. For G = PΩ+ 8 (7) the constituents of a Syl2 -regular character could have degree 1, 17500, or 51300. No non-negative integral linear combination of these three degrees, with 1G appearing at most once, adds up to |G|2 = 216 = 65536. n n−1 + The second smallest non-trivial character degree of G = PΩ− 2n (q) is µ2 (G) = (q + 1)(q 1)/(q + 1)/2 (see again [16, Thm. 1.4]), which is larger than |G|2 . We conclude as before.  Again, we are left with the case that p = 2, q = 3. Lemma 11.17. Let G = PSp6 (3), Ω7 (3) or PΩ− 8 (3). Then G has no Steinberg-like character. Proof. For G = PSp6 (3) we have |G|2 = 29 , and all irreducible characters of G of degree at most 512 take positive value on the class 4A, see [1]. Let G = Ω7 (3). Then |G|2 = 29 . All irreducible characters of G of at most that degree are positive at the elements of conjugacy class 2B [1]. 10 Let G = PΩ− 8 (3). By [1], G has 8 irreducible characters of degree at most |G|2 = 2 . All of them take positive values on class 2A. So the result follows. This implies the result.  Lemma 11.18. Let G = PGO+ 8 (3) or PSp8 (3). Let χ be a 2-vanishing character of G, and η1 , . . . , ηk the irreducible constituents of χ disregarding their multiplicities. Set η = η1 + · · · + ηk . Then η(1) ≥ 2|G|2 . STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 35 ′ 12 15 = 32768. Proof. Suppose first that G = PGO+ 8 (3). Note that |G |2 = 2 , so 2 · |G|2 = 2 Suppose the contrary. Then η(1) < 32768. We use notation from [1]. There are 43 characters of G′ of degree less than 32768, the maximal degree among them is 29120. There is only one irreducible character of G′ of degree less that 32768 that is negative at 4A (this is of degree 9450), while all other are positive. So it must be a constituent of η|G′ . This character extends to G, so the other constituents of η are of degrees at most 32768−9450 = 23318. It follows that ηi (1) ≤ 18200. In fact, ηi (1) < 18200. Indeed, if ηi (1) = 18200 and ηj (1) = 9450 for some i 6= j then ηl for l 6= i, j are of degree at most 23318 − 18200 = 5118. These characters are positive at 2A (as well as those of degree 18200 and 9450). This violates χ(2A) = 0. Thus, ηi (1) < 18200, and hence ηi (1) ≤ 17550. Furthermore, computing the character table of G by a program in the computer package GAP, one observes that there are 4 distinct irreducible characters of degree 17550, and only one irreducible character of this degree for G′ . It follows that these 4 characters differ from each other by multiplication by a linear character. As |G/G′ | = 4, one observes that χ · λ = χ for every linear character λ of G. Therefore, ηi · λ must be a constituent of χ. So, if ηi (1) = 17550 then there are 3 more constituents of η of this degree, which contradicts the inequality η(1) < 32768. Thus, ηi (1) < 17550 for i = 1, . . . , k. By [1], all such irreducible characters of G′ , and hence of G, are positive at 4A, which contradicts χ(4A) = 0. Let G = PSp8 (3). Note that |G|2 = 214 , so 2 · |G|2 = 215 = 32768. Suppose the contrary. Then η(1) < 32768. There are 19 irreducible characters of degree less than 32768. All such characters are positive at 4A, which violates χ(4A) = 0.  + ∼ ··· = ∼ Hn = ∼ PGO (3) or PSp (3). Lemma 11.19. (a) Let H = H1 × · · · × Hn , where H1 = 8 8 n Let χ be a 2-vanishing character of H. Then χ(1) ≥ 2 |H|2 . (b) Let G = G1 × · · · × Gn , where G1 ∼ = ··· ∼ = Gn ∼ = GO+ 8 (3) or Sp8 (3). Let χ be a 2-vanishing n character of G. Then χ(1) ≥ 2 |G|2 . Proof. (a) If n = 1 then the result is contained in Lemma 11.18. P So by induction we can assume that it is true for X := H2 × · · · × HnP . By Lemma 2.7, χ = i ηi σi , where ηi ∈ Irr(H1 ), σi are 2-vanishing characters of X and χ′ = l2 (σi )ηi is a 2-vanishing P character of H1 . By induction, σi (1) ≥ 2n−1 |X|2 . By Lemma 11.18 applied to χ′ , we have i ηi (1) ≥ 2|H1 |2 , so χ(1) ≥ 2n |H|2 by Lemma 2.9. (b) This follows from (a) and Lemma 2.5, as Z(G) is a 2-group.  + + Lemma 11.20. Let G = GO+ 8n (3), Ω8n (3), PΩ8n (3), Sp8n (3) or PSp8n (3). Then G has no Steinberg-like character for p = 2. Proof. Let X be the direct product of n copies of GO+ 8 (3) or Sp8 (3). Let ν be a 2-vanishing n character of X. By Lemma 11.10, ν(1) ≥ 2 |X|2 . Let Y = X · Sn , the semidirect product, where Sn acts on X by permuting the factors. Then Y contains a Sylow 2-subgroup of G. Let M = X · S, where S ∈ Syl2 (Sn ), so the index |G : M | is odd. Note that |G|2 = |X|2 · |Sn |2 . As |Sn |2 ≤ 2n−1 (see the proof of Proposition 6.7), the result follows for the groups GO+ 8n (3) and Sp8n (3). For G = Ω+ (3) the result follows from the above and Lemma 2.12. For G = PΩ+ 8n 8n (3) or PSp8n (3) the statement follows from the above and Lemma 2.5.  Proposition 11.21. Let m ≥ 4 and G = GO+ 2m (3) or Sp2m (3). Then G has no Steinberg-like character for p = 2. 36 GUNTER MALLE AND ALEXANDRE ZALESSKI Proof. For m ≡ 0 (mod 4) the result is stated in Lemma 11.20. Let m = 4n+l, where 1 ≤ l < 4, + and H = GO+ 8n (3) or Sp8n (3). Let S0 be a Sylow 2-subgroup of GO2l (3) or Sp2l (3). Set U = H × S0 . Then U contains a Sylow 2-subgroup of G. Let χ be a 2-vanishing character of G. Therefore, l2 (χ) = l2 (χ|U ). By Lemma 2.5, if ν is a 2-vanishing character of U then l2 (ν) = l2 (µ) for some 2-vanishing character µ of H. By Lemma 11.20, l2 (µ) ≥ 2. So l2 (ν) ≥ 2, and the result follows.  Proposition 11.22. Let G = GO− 2m (3), m ≥ 5. Then G has no Steinberg-like character for p = 2. Proof. Let m = 4n + l, where 1 ≤ l ≤ 4, and let H = GO+ 8n (3). Then G contains a subgroup D − isomorphic to H × GO2l (3). Then one concludes that D contains a Sylow 2-subgroup of G. Let S0 be a Sylow 2-subgroup of GO− 2l (3). Set U = H × S0 . Then U contains a Sylow 2-subgroup of G. By Lemma 2.5, if ν is a 2-vanishing character of U then l2 (ν) = l2 (µ) for some 2-vanishing character µ of H. So l2 (ν) ≥ 2 by Lemma 11.20 and the result follows.  Proposition 11.23. Let G = GO2m+1 (3), m ≥ 3. Then G has no Steinberg-like character for p = 2. Proof. The case m = 3 is dealt with in Lemma 11.17. So we assume that m > 3, that is, 2m + 1 ≥ 9. Let m = 4n + l, where 0 ≤ l ≤ 3, and let H = GO+ 8n (3). Then G contains a subgroup D isomorphic to H × GO2l+1 (3). Then D contains a Sylow 2-subgroup of G. Set U = H × S0 , where S0 is a Sylow 2-subgroup of GO2l+1 (3), so U contains a Sylow 2-subgroups of G. By Lemma 2.5, if ν is a 2-vanishing character of U then l2 (ν) = l2 (µ) for some 2-vanishing character µ of H. So l2 (ν) ≥ 2 by Lemma 11.20, and the result follows.  Theorem 11.24. Let G = GO2m+1 (3) with m ≥ 3, GO± 2m (3) with m ≥ 4, or Sp2m (3) with m ≥ 3, and let G′ be the derived group of G. Let H be a group such that G′ ≤ H ≤ G. Then H and H/Z(H) have no Steinberg-like character for p = 2. Proof. For H the statement follows from Lemma 11.17, Propositions 11.21, 11.22 and 11.23 using Lemma 2.12, and for H/Z(H) from Lemma 2.5.  We now collect our results to prove our main theorems from the introduction. Proof of Theorem 1.1. Assume that G is a finite non-abelian simple group possessing a Steinberglike character χ with respect to a prime p. The cases when χ is irreducible have been recalled in Proposition 3.1. If Sylow p-subgroups of G are cyclic, then (G, p, χ) is as in Proposition 4.4. So we may now assume that Sylow p-subgroups of G are non-cyclic. For G alternating and p odd there are no cases by Theorem 6.4 except for A6 ∼ = PSL2 (9) with p = 3. The Steinberg-like characters of sporadic groups are listed in Theorem 5.1. Thus G is of Lie type. The case when p is the defining prime was handled in [17] and Propositions 8.1 and 8.2, respectively. So now assume p is not the defining prime for G. Groups of exceptional Lie type were handled in Theorem 7.1. For classical groups of large rank with p odd, our result is contained in Proposition 9.6, the cases for PSLn (q) and PSUn (q) with p > 2 are completed in Theorem 10.15, those for the other classical groups in Propositions 10.18 and 10.19. Finally, the cases with p = 2 are covered by Proposition 11.1 for G = PSL2 (q), Proposition 11.3 for PSLn (q) and PSUn (q) with q 6= 3, Theorem 11.12 for PSLn (3) and PSUn (3), Propositions 11.14, 11.15 and 11.16 for classical groups with q 6= 3, and Theorem 11.24 for the case that q = 3.  STEINBERG-LIKE CHARACTERS FOR FINITE SIMPLE GROUPS 37 Proof of Theorem 1.2. The characters of projective Fp G-modules of dimension |G|p are in particular Steinberg-like, so in order to prove this result we need to go through the list given in Theorem 1.1(2)–(5). When Sylow p-subgroups of G are cyclic, the possibilities are given in Lemma 4.5(b). For G of Lie type in characteristic p, see [22, Thm. 1.1]. The case (4) of Theorem 1.1 is subsumed in statement (1), and finally the alternating groups for p = 2 are discussed in Theorem 6.14.  References [1] J. Conway, R. Curtis, S. Norton, R. Parker and R. Wilson. Atlas of Finite Groups. Clarendon Press, Oxford, 1985. [2] C. W. Curtis and I. Reiner, Methods of Representation Theory with Applications to Finite Groups and Orders. Wiley, New York, 1990. [3] L. Emmett and A.E. Zalesski, On regular orbits of elements of classical groups in their permutation representations. Comm. Algebra 39 (2011), 3356–3409. [4] W. Feit, The Representation Theory of Finite Groups. North-Holland, Amsterdam, 1982. [5] E. Giannelli, S. Law, On permutation characters and Sylow p-subgroups of Sn . arXiv:1712.02642. [6] L. Héthelyi, M. Shoke and A. Zalesski, On p-stability in groups and fusion systems. J. Algebra 492 (2017), 253–297. [7] R. Howe, On the character of Weil’s representation. Trans. Amer. Math. Soc. 177 (1973), 287–298. [8] B. Huppert, Singer-Zyklen in klassischen Gruppen. Math. Z. 117 (1970), 141–150. [9] G. James, The Representation Theory of the Symmetric Groups. Springer-Verlag, Berlin, 1978. [10] C. Lassueur and G. Malle, Simple endotrivial modules for linear, unitary and exceptional groups. Math. Z. 280 (2015), 1047–1074. [11] C. Lassueur, G. Malle and E. Schulte, Simple endotrivial modules for quasi-simple groups. J. reine angew. Math. 712 (2016), 141–174. [12] F. Lübeck, Character degrees and their multiplicities for some groups of Lie type of rank < 9. Available at http://www.math.rwth-aachen.de/∼Frank.Luebeck/chev/DegMult/ [13] G. Malle and Th. Weigel, Finite groups with minimal 1-PIM. Manuscripta Math. 126 (2008), 315–332. [14] G. Malle and A.E. Zalesski, Prime power degree representations of quasi-simple groups. Archiv Math. 77 (2001), 461–468. [15] G. Navarro, Characters and Blocks of Finite Groups. Cambridge Univ. Press, Cambridge, 1998. [16] Hung Ngoc Nguyen, Low dimensional complex characters of the symplectic and orthogonal groups. Comm. Algebra 38 (2010), 1157–1197. [17] M. Pellegrini and A.E. Zalesski, On characters of Chevalley groups vanishing at the non-semisimple elements. Internat. J. Algebra Comput. 26 (2016), 789–841. [18] Ch. Rudloff and A.E. Zalesski, On multiplicity 1 eigenvalues of elements in irreducible representations of finite quasi-simple groups. J. Group Theory 10 (2007), 585–612. [19] P. H. Tiep and A.E. Zalesskii, Minimal characters of the finite classical groups. Comm. Algebra 24 (1996), 2093–2167. [20] A.J. Weir, Sylow p-subgroups of the classical groups over finite fields with characteristic coprime to p. Proc. Amer. Math. Soc. 6 (1955), 529–533. [21] A.E. Zalesski, Minimal polynomials and eigenvalues of p-elements in representations of quasi-simple groups with a cyclic Sylow p-subgroup. J. London Math. Soc. 59 (1999), 845–866. [22] A.E. Zalesski, Low dimensional projective indecomposable modules for Chevalley groups in defining characteristic. J. Algebra 377 (2013), 125–156. [23] A.E. Zalesski, Remarks on Gelfand-Graev characters for simple groups. Archiv Math. 100 (2013), 221–230. 38 GUNTER MALLE AND ALEXANDRE ZALESSKI FB Mathematik, TU Kaiserslautern, Postfach 3049, 67653 Kaiserslautern, Germany E-mail address: malle@mathematik.uni-kl.de Department of Physics, Informatics and Mathematics, National Academy of Sciences of Belarus, Minsk, Belarus E-mail address: alexandre.zalesski@gmail.com
4math.GR
STABILITY OF INTEGRAL DELAY EQUATIONS AND STABILIZATION OF AGE-STRUCTURED MODELS Iasson Karafyllis* and Miroslav Krstic** * Dept. of Mathematics, National Technical University of Athens, Zografou Campus, 15780, Athens, Greece, email: iasonkar@central.ntua.gr ** Dept. of Mechanical and Aerospace Eng., University of California, San Diego, La Jolla, CA 92093-0411, U.S.A., email: krstic@ucsd.edu Abstract We present bounded dynamic (but observer-free) output feedback laws that achieve global stabilization of equilibrium profiles of the partial differential equation (PDE) model of a simplified, age-structured chemostat model. The chemostat PDE state is positive-valued, which means that our global stabilization is established in the positive orthant of a particular function space—a rather non-standard situation, for which we develop non-standard tools. Our feedback laws do not employ any of the (distributed) parametric knowledge of the model. Moreover, we provide a family of highly unconventional Control Lyapunov Functionals (CLFs) for the age-structured chemostat PDE model. Two kinds of feedback stabilizers are provided: stabilizers with continuously adjusted input and sampled-data stabilizers. The results are based on the transformation of the first-order hyperbolic partial differential equation to an ordinary differential equation (one-dimensional) and an integral delay equation (infinite-dimensional). Novel stability results for integral delay equations are also provided; the results are of independent interest and allow the explicit construction of the CLF for the age-structured chemostat model. Keywords: first-order hyperbolic partial differential equation, age-structured models, chemostat, integral delay equations, nonlinear feedback control. 1. Introduction Continuous-time age-structured models are described by the so-called McKendrick-von Foerster equation (see [3,4,5,26] and the references therein), which is a first order hyperbolic Partial Differential Equation (PDE) with a non-local boundary condition. Age-structured models are natural extensions of standard chemostat models (see [27]). Optimal control problems for agestructured models have been studied (see [3,8,28] and the references therein). The ergodic theorem (see [11,12] and [26] for similar results on asymptotic similarity) has been proved an important tool for the study of the dynamics of continuous-time age structured models (see also [29] for a study of the existence of limit cycles). This work initiates the study of the global stabilization problem by means of feedback control for age-structured models. More specifically, the design of explicit output feedback stabilizers is sought for the global stabilization of an equilibrium age profile for an age-structured chemostat model. Just as in other chemostat feedback control problems described by Ordinary Differential Equations (ODEs; see [9,13,14,15,21,22]), the dilution rate is selected to be the control input while the output 1 is a weighted integral of the age distribution function. The assumed output functional form is chosen because it is an appropriate form for the expression of the measurement of the total concentration of the microorganism in the bioreactor or for the expression of any other measured variable (e.g., light absorption) that depends on the amount (and its size distribution) of the microorganism in the bioreactor. The main idea for the solution of the feedback control problem is the transformation of the first order hyperbolic PDE to an Integral Delay Equation (IDE; see [16]) and the application of the strong ergodic theorem. This feature differentiates the present work from recent works on feedback control problems for first order hyperbolic PDEs (see [1,2,6,7,16,20]). The present work studies the global stabilization problem of an equilibrium age profile for an agestructured chemostat model by means of two kinds of feedback stabilizers: (i) a continuously applied feedback stabilizer, and (ii) a sampled-data feedback stabilizer. The entire model is assumed to be unknown and two cases are considered for the equilibrium value of the dilution rate: the case where the equilibrium value of the dilution rate is unknown (i.e., absolutely nothing is known about the model), and the case where the equilibrium value of the dilution rate is a priori known. In the first case, a family of observer-based (dynamic), output feedback laws with continuously adjusted dilution rate is proposed: the equilibrium value of the dilution rate is estimated by the observer. In the second case, a sampled-data output feedback law is proposed for arbitrarily sparse sampling schedule. In all cases, the dilution rate (control input) takes values in a pre-specified bounded interval and consequently input constraints are taken into account. The main idea for the solution of the feedback control problem is the transformation of the PDE to an ODE and an IDE. Some preliminary results for the sampled-data case, which are extended in the present work, were given in [17,18]. However, instead of simply designing dynamic, output feedback laws which guarantee global asymptotic stability of an equilibrium age profile, the present work has an additional goal: the explicit construction of a family of Control Lyapunov Functionals (CLFs) for the age-structured chemostat model. In order to achieve this goal, the present work provides/uses novel stability results on linear IDEs, which are of independent interest. The newly developed results, provide a Lyapunov-like proof of the scalar, strong ergodic theorem for special cases of the integral kernel. Stability results for linear IDEs similar to those studied in this work have been also studied in [23]. Since the state of the chemostat model is the population density of a particular age at a given time, the state of the chemostat PDE is non-negative valued. Accordingly, the desired equilibrium profile (a function of the age variable) is positive-valued. So the state space of this PDE system is the positive orthant in a particular function space. We pursue global stabilization of the positive equilibrium profile in such a state space. This requires a novel approach and even a novel formulation of stability estimates in which the norm of the state at the desired equilibrium is zero but takes the infinite value not only when the population density (of some age) is infinite but also when it is zero, i.e., we infinitely penalize the population death (the so-called “washout”), as we should. Our main idea in this development is a particular logarithmic transformation of the state, which penalizes both the overpopulated and underpopulated conditions, with an infinite penalty on the washout condition. The structure of the paper is described next. In Section 2, we describe the chemostat stabilization problem in a precise way and we provide the statements of the main results of the paper (Theorem 2.1 and Theorem 2.4). Section 3 provides useful existing results for the uncontrolled PDE, while Section 4 is devoted to the presentation of stability results on IDEs, which allow us to construct CLFs for the chemostat problem. The proofs of the main results are provided in Section 5. Section 6 presents a result, which is similar to Theorem 2.1, but uses a reduced order observer instead of a full-order observer. Simulations, which illustrate the application of the obtained results, are given in Section 7. The concluding remarks of the paper are given in Section 8. Finally, the Appendix provides the proofs of certain auxiliary results. 2 Notation. Throughout this paper we adopt the following notation.  For a real number x   , x  denotes the integer part of x   .   denotes the interval [0,) .  Let U be an open subset of a metric space and    m be a set. By C 0 (U ; ) , we denote the class of continuous mappings on U , which take values in  . When U   n , by C 1 (U ; ) , we denote the class of continuously differentiable functions on U , which take values in  . When U  [a, b)   (or U  [a, b]   ) with a  b , C 0 ([a, b) ; ) (or C 0 ([a, b] ; ) ) denotes all functions f : [a, b)   (or f : [a, b]   ), which are continuous on (a, b) and satisfy lim  f (s)   f (a) (or lim  f (s)   f (a) and s a  s a lim  f ( s)   f (b) ). When U  [a, b)   , C ([a, b) ; ) denotes all functions 1 s b  f : [a, b)   which are continuously differentiable on (a, b) and satisfy lim h 1  f (a  h)  f (a)  lim f (s) . h0 lim  f (s)   f (a) and s a  s a  K  is the class of all strictly increasing, unbounded functions a C 0 (  ;   ) , with a(0)  0 (see [19]).  For any subset S   and for any A  0 , PC1 [0, A]; S  denotes the class of all functions f  C 0 ([0, A]; S ) for which there exists a finite (or empty) set B  (0, A) such that: (i) the derivative f (a) exists at every a  (0, A) \ B and is a continuous function on (0, A) \ B , (ii) all meaningful right and left limits of f (a) when a tends to a point in B  {0, A} exist and are finite.  Let a function f  C 0 (   [0, A]) be given, where A  0 is a constant. We use the notation f [t ] to denote the profile at certain t  0 , i.e., ( f [t ])(a)  f (t, a) for all a [0, A] .  Let a function x  C 0 ([ A,); ) be given, where A  0 is a constant. We use the notation xt  C 0 ([ A,0]; ) to denote the “ A  history” of x at certain t  0 , i.e., xt (a)  x(t  a) for all a [0, A] .  Let 0  Dmin  Dmax be given constants. The saturation function sat (x) for the interval [ Dmin , Dmax ] is defined by sat ( x) : min Dmax , maxDmin , x  , for all x   . 2. Problem Description and Main Results 2. I. The model Consider the age-structured chemostat model: f f (t , a)  (t , a)   (a)  D(t )  f (t , a) , for t  0 , a  (0, A) t a (2.1) A  f (t ,0)  k (a) f (t , a)da , for t  0 (2.2) 0 where D(t )  [ Dmin , Dmax ] is the dilution rate, Dmax  Dmin  0 are constants, A  0 is a constant and A  : [0, A]   , k : [0, A]   are continuous functions with  k (a)da  0 . System (2.1), (2.2) is a 0 continuous age-structured model of a microbial population in a chemostat. The function  (a)  0 is called the mortality function, the function f (t, a) denotes the density of the population of age 3 a [0, A] at time t  0 and the function k (a)  0 is the birth modulus of the population. The boundary condition (2.2) is the renewal condition, which determines the number of newborn individuals f (t,0) . Finally, A  0 is the maximum reproductive age. Physically meaningful solutions of (2.1), (2.2) are only the non-negative solutions, i.e., solutions satisfying f (t , a)  0 , for all (t , a)    [0, A] . The chemostat model (2.1), (2.2) is derived by neglecting the dependence of the growth of the microorganism on the concentration of a limiting substrate. A more accurate model would involve an enlarged system that has one PDE for the age distribution, coupled with one ODE for the substrate (as proposed in [29], in the context of studying limit cycles with constant dilution rates). However, the approach of neglecting the nutrient's equation in the chemostat is not new (see for example [25]). We assume that there exists D  ( Dmin , Dmax ) such that A a   1  k (a ) exp  D  a   ( s )ds da   0 0     (2.3) This assumption is necessary for the existence of an equilibrium point for the control system (2.1), (2.2), which is different from the identically zero function. Any function of the form: a   f  (a )  M exp  D  a   ( s )ds  ,   0    for a [0, A] (2.4) with M  0 being an arbitrary constant, is an equilibrium point for the control system (2.1), (2.2) with D(t )  D  . Notice that there is a continuum of equilibria. The measured output of the control system (2.1), (2.2) is given by the equation: A y (t )   p(a) f (t, a)da , for t  0 (2.5) 0 A where p : [0, A]    is a continuous function with  p(a)da  0 . Notice that the case p(a)  1 0 corresponds to the total concentration of the microorganism in the chemostat. 2.II. Feedback Control with Continuously Adjusted Input Let y   0 be an arbitrary constant (the set point) and let f  (a) be the equilibrium age profile A given by (2.4) with a    M  y  p (a ) exp  D  a   ( s )ds da      0    0   1  . Consider the dynamic feedback law given by   y (t )   z1 (t )  z 2 (t )  D(t )  l1  z1 (t )  ln      y        y (t )   z 2 (t )  l 2  z1 (t )  ln      y      z (t )  ( z1 (t ), z 2 (t ))    2 and 4 (2.6)   y (t )   D(t )  sat  z 2 (t )   ln      y      (2.7) where l1 , l 2 ,   0 are constants. Next consider solutions of the initial-value problem (2.1), (2.2), ~ ~ (2.5), (2.6), (2.7) with initial condition ( f 0 , z 0 )  X   2 , where X is the set A  ~  X   f  PC 1 ([0, A]; (0,)) : f (0)  k (a ) f (a )da  .   0  By a solution of the initial-value problem (2.1), (2.2), ~ (2.5), (2.6), (2.7) with initial condition ( f 0 , z 0 )  X   2 , we mean a pair of mappings f  C 0 [0,  )  [0, A]; (0,) , z  C 1 [0,  );  2  , where   (0,] , which satisfies the following properties: (i) f  C 1 D f ; (0,) , where D f   (t, a)  (0,  )  (0, A) : (a  t )  B {0, A}  and B  (0, A) is the finite ~ (possibly empty) set where the derivative of f 0  X is not defined or is not continuous, ~ (ii) f [t ]  X for all t  [0,  ) , where ( f [t ])(a)  f (t, a) for a [0, A] (see Notation), (iii) equations (2.5), (2.6), (2.7) hold for all t  [0,  ) , (iv) equation f f (t , a)  (t , a)   (a)  D(t )  f (t , a) holds for all (t , a)  D f , and t a (v) z (0)  z 0  ( z1,0 , z 2,0 ) , f (0, a)  f 0 (a) for all a [0, A] . ~ The mapping [0,  )  t  ( f [t ], z(t ))  X   2 is called the solution of the closed-loop system (2.1), (2.2), ~ (2.5) with (2.6), (2.7) and initial condition ( f 0 , z 0 )  X   2 defined for t  [0,  ) . Define the functional  : C 0 ([0, A]; )   by means of the equation A   ( f ) : 0 A a    f (a) k ( s) exp  (l )  D  dl ds da     s   a    (2.8) A  ak (a) f  (a)da 0 and assume that the following technical assumption holds for the non-negative function a   ~ k ( a ) : k ( a ) exp  D  a   ( s )ds  ,   0    A that satisfies for a [0, A] (2.9) ~  k (a)da  1 (recall (2.3)): 0 A (A) There exists a constant   0 such that  A ~ ~ k (a )  r k ( s )ds da  1 ,  0 a 1 A ~  where r :  ak (a)da  . 0   We are now ready to state the first main result of the present work, which provides stabilizers with continuously adjusted input. Theorem 2.1 (continuously adjusted input and unknown equilibrium value of the dilution rate): Consider the age-structured chemostat model (2.1), (2.2) with k  PC1 ([0, A];   ) under ~ Assumption (A). Then for every f 0  X and z 0   2 there exists a unique solution of the closed-loop ~ (2.1), (2.2), (2.5) with (2.6), (2.7) and initial condition ( f 0 , z 0 )  X   2 . Furthermore, there exist a ~ constant L  0 and a function   K  such that for every f 0  X and z 0   2 the unique solution of 5 ~ the closed-loop (2.1), (2.2), (2.5) with (2.6), (2.7) and initial condition ( f 0 , z 0 )  X   2 is defined for all t  0 and satisfies the following estimate:   f (t , a )      z1 (t )  z 2 (t )  D   max  ln    f (a)   a[ 0, A]       f (a)    L     z1,0  z 2,0  D  exp  t    max  ln  0  4   a[ 0, A]  f (a )        , for all t  0 (2.10) Moreover, let p1 , p 2  0 be a pair of constants satisfying 2  l1 p1  2l2 p2 2  8l1 p1  4l2 p12 , p12  4 p 2 . Then the continuous functional W :  2  C 0 ([0, A]; (0,))    defined by: W ( z, f ) : ln ( f )2  G Q( z, f )   Q( z, f ) (2.11) where   0 is an arbitrary constant, Q( z , f ) :     max  exp(  a) f (a)   ( f ) f (a)  a[0, A] f  (a )  z1  ln  ( f )2  p1z1  ln  ( f )( z2  D )  p2 ( z2  D )2  M  2    f (a)   min   ( f ), min       a[ 0, A] f ( a )               2 (2.12)   0 is a sufficiently small constant and M , G  0 are sufficiently large constants, is a Lyapunov functional for the closed-loop system (2.1), (2.2), (2.5) with (2.6), (2.7), in the sense that every ~ solution ( f [t ], z(t ))  X   2 of the closed-loop system (2.1), (2.2), (2.5) with (2.6), (2.7) satisfies the inequality:   lim sup h 1 W ( z (t  h), f [t  h])  W ( z (t ), f [t ])   L h 0  W ( z (t ), f [t ]) 1  W ( z (t ), f [t ]) , for all t  0 (2.13) As remarked in the Introduction, Theorem 2.1 does not only provide formulas for dynamic output feedback stabilizers that guarantee global asymptotic stability of the selected equilibrium age profile, but also provides explicit formulas for a family of CLFs for system (2.1), (2.2). Indeed, the continuous functional W :  2  C 0 ([0, A]; (0,))    defined by (2.11), (2.12) is a CLF for system (2.1), (2.2). Remark 2.2: i) The family of feedback laws (2.6), (2.7) (parameterized by l1 , l 2 ,   0 ) guarantees global asymptotic stabilization of every selected equilibrium age profile. Moreover, the feedback law (2.6), (2.7) achieves a global exponential convergence rate (see estimate (2.10)), in the sense that estimate ~ (2.10) holds for all physically meaningful initial conditions ( f 0  X ). As indicated in the Introduction, the logarithmic penalty in (2.10) penalizes both the overpopulated and underpopulated conditions, with an infinite penalty on zero density for some age. The state converges to the desired equilibrium profiles from all positive initial conditions, but not from the zero-density initial condition, which itself is an equilibrium (population cannot develop from a “dead” initial state). ii) The feedback law (2.6), (2.7) is a dynamic output feedback law. The subsystem (2.6) is an observer that primarily estimates the equilibrium value of the dilution rate D . The observer (2.6) is a highly reduced order, since it estimates only two variables, the afore-mentioned constant D and the scalar functional of the infinite-dimensional state, ( f ) , introduced in (2.8). All the remaining infinitely many states are not estimated. This is the key achievement of our paper—attaining stabilization without the estimation of nearly the entire infinite-dimensional state and proving this result in an appropriately constructed transformed representation of that unmeasured infinitedimensional state. 6 iii) The family of feedback laws (2.6), (2.7) does not require knowledge of the mortality function of the population, the birth modulus of the population and the maximum reproductive age of the population. Accordingly, it does not require the knowledge of the equilibrium value of the dilution rate D either. Instead, D is estimated by the observer state z 2 (t ) (see estimate (2.10)). iv) The feedback law (2.6), (2.7) can work with arbitrary input constraints. The only condition that needs to be satisfied is that the equilibrium value of the dilution rate D must satisfy the input constraints, i.e., D  ( Dmin , Dmax ) , which is a reasonable requirement (otherwise the selected equilibrium age profile is not feasible). v) The parameters l1 , l 2 ,   0 can be used by the control practitioner for tuning the controller (2.6), (2.7): the selection of the values of these parameters affects the value of the constant L  0 that determines the exponential convergence rate. Since the proof of Theorem 2.1 is constructive, useful formulas showing the dependence of the constant L  0 on the parameters l1 , l 2 ,   0 are established in the proof of Theorem 2.1. vi) It should be noted that for every pair of constants l1 , l 2  0 it is possible to find constants p1 , p 2  0 satisfying   l1  l  2 2  l1 p1  2l2 p2 2  8l1 p1  4l2 p12 , p12  4 p 2 . Indeed, for every l1 , l 2  0 the matrix 1 0  1 is a Hurwitz matrix. Consequently, there exists a positive definite matrix   p1 / 2 so that the matrix  l1  1   p1 / 2  1  p1 / 2   l1  l2  1   p / 2   p 2   p1 / 2 p 2   l 2 0  1  p1 / 2 p 2  1   2l1  l 2 p1 1  l1 p1 / 2  l 2 p 2     0 1  l1 p1 / 2  l 2 p 2  p1  is negative definite. This implies the inequalities p12  4 p 2 and 2  l1 p1  2l2 p2 2  8l1 p1  4l2 p12 . vii) The main idea for the construction of the feedback law (2.6), (2.7) is the transformation of the PDE problem (2.1), (2.2) into a system that consists of an ODE and an IDE along with the  y (t )   . The transformations are presented in Figure 1 and   y   logarithmic output transformation Y (t )  ln  are exploited rigorously in the proof of Theorem 2.1. Figure 1 also shows that the full-order observer (2.6) is actually an observer for the system (t )  D  (t )  D(t ) , D  (t )  0 . 2.III. Checking Assumption (A) Theorem 2.1 assumes that the birth modulus of the population satisfies Assumption (A). This is not an assumption that is needed for the establishment of the exponential estimate (2.10). Estimate (2.10) could have been established without Assumption (A) by means of the strong ergodic theorem (see Section 3). The role of Assumption (A) is crucial for the establishment of the CLF, given by (2.11), (2.12). However, since Assumption (A) demands a specific property for the function a   ~   k ( a ) : k ( a ) exp  D a   ( s )ds    0    that involves the (unknown) equilibrium value of the dilution rate D , the verification of the validity of Assumption (A) becomes an issue. The following proposition provides useful sufficient conditions for Assumption (A). Its proof is provided in the Appendix. ~ Proposition 2.3 (Means of checking Assumption (A)): Let k  C 0 ([0, A]; ) be a function that satisfies the following assumption: 7 ~ A ~ ~  k (a)da  1 . Moreover, there ~ ~ S   a  [0, T ]: k (a)   , where T : supa [0, A]: k (a)  0, has (B) The function k  C 0 ([0, A]; ) satisfies k (a)  0 for all a [0, A] and 0 exists a constant   0 such that the set 1 A ~  Lebesgue measure S  (2r ) , where r :  ak (a)da  . 0   1 A Then for every   [0, r 1 ] it holds that  A ~ ~ k (a )  r k ( s )ds da  1   1  2r S  0  . a Proposition 2.3 shows that Assumption (A) is valid for a function that satisfies Assumption (B). ~ On the other hand, we know that Assumption (B) holds for every function k  C 0 ([0, A];   ) A satisfying ~  k (a)da  1 and having only a finite number of zeros in the interval [0, A] . Since 0 a   ~ k ( a ) : k ( a ) exp  D  a   ( s )ds  ,   0    we can be sure that Assumption (A) necessarily holds for all birth moduli k  C 0 ([0, A];   ) of the population with only a finite number of zeros in the interval [0, A] , no matter what the equilibrium value of the dilution rate D is and no matter what the mortality function  : [0, A]   is. f f (t , a )  (t , a )   (a )  D(t )  f (t , a ) t a  (t  a)   A  f (t ,0)  k (a ) f (t , a )da f (a) ( f [t ])  (t )  ln  ( f [t ])  Y (t )  ln y (t ) / y  0 A y (t )  f (t , a)  1   p(a) f (t, a)da 0    (t )  D   D(t ) A  ~  (t )  k (a) (t  a)da f (t , a)  1  (t  a)  f  (a) exp( (t ))  y (t )  y expY (t )   0 A A ~ 0   (t  a ) k ( s )dsda   0 a  A  Y (t )   (t )  ln 1  g (a ) (t  a )da     0   Figure 1: The transformation of the PDE (2.1) with boundary condition given by (2.2) to an IDE and an ODE and the inverse transformation. 8 2.IV. Sampled-Data Control On the other hand, when the equilibrium value of the dilution rate D is a priori known, then we are in a position to achieve sampled-data stabilization. Let T  0 be the sampling period and consider the closed-loop system (2.1), (2.2), (2.5) with the sample-and-hold feedback law   y(iT )   D(t )  sat  D   T 1 ln     , for all t  [iT , (i  1)T ) and for all integers i  0  y      (2.14) ~ By a solution of the initial-value problem (2.1), (2.2), (2.5), (2.14) with initial condition f 0  X , where ~ X is the set A  ~  X   f  PC 1 ([0, A]; (0,)) : f (0)  k (a ) f (a )da  ,   0  we mean a mapping f  C 0 [0,  )  [0, A]; (0,) , where   (0,] , which satisfies the following properties:   (i) f  C 1 D f ; (0,) , where D f  (t, a)  (0, )  (0, A) : (a  t )  B {0, A} , t  T T 1t and B  (0, A) is the ~ finite (possibly empty) set where the derivative of f 0  X is not defined or is not continuous, ~ (ii) f [t ]  X for all t  [0,  ) , (iii) equations (2.5), (2.14) hold for all t  [0,  ) , (iv) equation f f (t , a)  (t , a)   (a)  D(t )  f (t , a) holds for all (t , a)  D f , and t a (v) f (0, a)  f 0 (a) for all a [0, A] . ~ The mapping [0,  )  t  f [t ]  X is called the solution of the closed-loop system (2.1), (2.2), (2.5) ~ with (2.14) and initial condition f 0  X defined for t  [0,  ) . We are now ready to state the second main result of the present work. Theorem 2.4 (sampled-data feedback and known equilibrium value for the dilution rate): Consider the age-structured chemostat model (2.1), (2.2) with k  PC1 ([0, A];   ) . Then for every ~ f 0  X there exists a unique solution of the closed-loop (2.1), (2.2), (2.5) with (2.14) and initial ~ condition f 0  X . Furthermore, there exist a constant L  0 and a function   K  such that for ~ every f 0  X the unique solution of the closed-loop (2.1), (2.2), (2.5) with (2.14) and initial ~ condition f 0  X is defined for all t  0 and satisfies the following estimate:    f (t , a )     f (a)       exp L t    max  ln  0   max  ln    a[0, A]  f  (a )    ,  f (a)   a[ 0, A]         for all t  0 (2.15) The differences of Theorem 2.4 with Theorem 2.1 are: (i) Theorem 2.4 applies the sampled-data feedback (2.14) while Theorem 2.1 applies a continuously adjusted feedback, (ii) Theorem 2.4 assumes knowledge of the equilibrium value of the dilution rate D , (iii) Theorem 2.4 does not assume property (A) but does not provide a CLF for the system. This was explained above: assumption (A) is only needed for the explicit construction of a CLF. Finally, the reader should notice that there is no constraint for the sampling period T  0 : arbitrarily large values for T  0 are allowed (arbitrarily sparse sampling). In the case where the output is given by (2.16) y(t )  f (t ,0) , for t  0 9 instead of (2.5), the proof of Theorem 2.4 works with only minor changes (the proof is omitted; this is the case considered in [18]). 2.V. Ideas Behind the Proofs of the Main Results The basic tool for the proofs of the main results of the present work is the transformation shown in Figure 1. The main idea comes from the recent work [16]: the transformation of a first-order hyperbolic PDE to an IDE. However, if we applied the results of [16] in a straightforward way, then we would end up with the following IDE: A  a   t  v(t )  k (a ) exp   ( s )ds  exp  D ( s )ds v(t  a )da ,     0  0   t a   where v(t )  f (t ,0) and    a   t    f (t , a )  exp   ( s )ds exp  D ( s )ds v(t  a ) .      0   t a    (2.17) However, the IDE is input- dependent. Instead, we would like to describe the effect of the control input in a more convenient way: this is achieved by introducing one more state (2.18)  (t )  ln ( f [t ]) ,  where  is given by (2.8). The evolution of  (t ) is described by the ODE (t )  D  D(t ) . Then we are in a position to obtain the transformation  (t  a)  f (t , a)  f (a) ( f [t ]) 1 , for all (t , a)    [0, A] (2.19) which decomposes the dynamics of (2.17) to the input-independent dynamics of the IDE A  A A  (t  a) k (s)dsda  0 0 0 a ~  (t )  k (a) (t  a)da evolving on the subspace described by the equation ~ and the input-dependent ODE (t )  D   D(t ) . After achieving this objective, the next step is the stability A ~ analysis of the zero solution of the IDE  (t )   k (a) (t  a)da : this is exactly the point where the 0 strong ergodic theorem or the results on linear IDEs are used. 3. The Uncontrolled PDE The present section aims to give to the reader the background mathematical knowledge which is used for the study of age-structured PDEs. More specifically, we aim to make the reader familiar to the strong ergodic theorem for age-structured PDEs and to show the relation of age-structured PDEs to linear IDEs. Let A  0 be a constant and let  : [0, A]   , k : [0, A]   be continuous functions with A  k (a)da  0 . Consider the initial value PDE problem: 0 z z (t , a)  (t , a)    (a) z (t , a) , for t  0 , a  (0, A) t a (3.1) A  z (t ,0)  k (a) z (t , a)da , for t  0 (3.2) 0 with initial condition z(0, a)  z 0 (a) for all a [0, A] . The following existence and uniqueness result follows directly from Proposition 2.4 in [10] and Theorems 1.3-1.4 on pages 102-104 in [24]: 10 Lemma 3.1 (existence/uniqueness): For each absolutely continuous function z 0  C 0 [0, A];  with A  z 0 (0)  k (a) z 0 (a)da , there exists a unique function z : [0,)  [0, A]   with z(0, a)  z 0 (a) for all 0 a [0, A] that satisfies: (a) For each t  0 , the function z[t ] defined by ( z[t ])(a)  z (t , a) for a [0, A] is A absolutely continuous and satisfies ( z[t ])(0)   k (a)( z[t ])(a)da for all t  0 , (b) the mapping 0    t  z[t ]  L1 [0, A];  is continuously differentiable, and (c) equation (3.1) holds for almost all t  0 and a  (0, A) . Moreover, if z 0 (a)  0 for all a [0, A] then z (t , a)  0 , for all (t , a)    [0, A] . The function z : [0,)  [0, A]   is called the solution of (3.1), (3.2). When additional regularity properties hold then the solution of (3.1), (3.2) satisfies the properties shown by the following lemma. Lemma 3.2 (regularity/relation to IDEs): If k  PC1 [0, A];    , then for every z 0  PC1 [0, A];  A satisfying z 0 (0)   k (a) z 0 (a)da the function z : [0,)  [0, A]   from Lemma 3.1 is C 1 on 0 S   (t , a)  (0,)  (0, A) : (a  t )  B  {0, A}  where B is the finite (or empty) set where the derivative of z 0 is not defined or is not continuous, satisfies (3.1) on S and equation (3.2) for all t  0 . Also,  a  z (t , a )  exp   ( s )ds v(t  a ) ,    0   for all (t , a)    [0, A] (3.3) where v  C 0 [ A,);   C 1 (0,);  is the unique solution of the Integral Delay Equation (IDE): A  a  v(t )  k (a ) exp   ( s )ds v(t  a )da ,   0  0    a  0  for t  0 (3.4) with initial condition v(a)  exp   ( s)ds  z 0 (a) , for all a  (0, A] . Lemma 3.2 is obtained by integration on the characteristic lines of (3.1). The solution v  C 0 [ A,);   C 1 (0,);  of the IDE (3.4) is obtained as the solution of the delay differential equation A v(t )  k (0)v(t )  k ( A)v(t  A)   da (a)v(t  a)da dk (3.5) 0  a   0  where k (a ) : k (a ) exp    ( s )ds  for a [0, A] . The differential equation (3.5) is obtained by formal differentiation of the IDE (3.4) and its solution satisfies (3.4) (the verification requires integration by parts). 11 A  a  0  0  It is straightforward to show that the function h( D)   k (a) exp  Da    ( s)ds da is strictly decreasing with lim h( D)  0 and lim h( D)   . Therefore, there exists a unique D    such that D  D (2.3) holds. Equation (2.3) is the Lotka-Sharpe condition [4]. The following strong ergodicity result follows from the results of Section 3 in [11] and Proposition 3.2 in [10]: Theorem 3.3 (scalar strong ergodic theorem): Let D    be the unique solution of (2.3). Then, there exist constants   0 , K  1 such that for every absolutely continuous function z 0  C 0 [0, A];  A with z 0 (0)   k (a) z 0 (a)da , the corresponding solution z : [0,)  [0, A]   of (3.1), (3.2) satisfies for 0 all t  0 : a a        exp  ( s )ds z (t , a)  exp D (t  a)   ( s )ds  ( z 0 ) da  K exp ( D    )t     0 0 0    A     A a 0 0   exp   (s)ds  z   0 ( a ) da (3.6) where  : L1 [0, A];    is the linear continuous functional defined by: A  ( z 0 ) : 0 a  z 0 (a) k ( s ) exp  (l )  D  dl dsda   a s  A a   ak (a) exp   (l )  D  dl da   0  0   A      (3.7) 4. Results on Linear Integral Delay Equations Since the previous sections have demonstrated the relation of age-structured PDEs to linear IDEs, we next focus on the study of linear IDEs. The present section provides stability results for the system described by the following linear IDE: A  x(t )   (a) x(t  a)da (4.1) 0 where x(t )   , A  0 is a constant and   C 0 ([0, A]; ) . The results of the present section allow the construction of Lyapunov functionals for linear IDEs, which provide formulas for Lyapunov functionals of age-structured PDEs (since the zero dynamics of the controlled age-structured model are described by linear IDEs). All proofs of the results of the present section are provided in the Appendix. 4.I. The notion of the solution-existence/uniqueness A For every x0  C 0 ([ A,0]; ) with  x 0 (0)   (a) x 0 (a)da there exists a unique function 0 x  C 0 ([ A,); ) that satisfies (4.1) for t  0 and x(a)  x0 (a) for all a [0, A] . This function is called the solution of (4.1) with initial condition x0  C 0 ([ A,0];) . The solution is obtained as the 12 solution of the neutral delay equation d dt A    x(t )   (a ) x(t  a )da   0   0    (Theorem 1.1 on page 256 in [10] guarantees the existence of a unique function x  C 0 ([ A,); )  C 1 ((0,); ) that satisfies d dt A    x(t )   (a ) x(t  a )da   0   0   for t  0 and x(a)  x0 (a) for all a [0, A] ). Therefore, IDE  the (4.1)   X   x  C 0 ([ A,0]; ) : x(0)   (a ) x( a )da    0 A  defines a dynamical system on with state xt  X , where xt (a)  x(t  a) for all a [0, A] (see Notation). 4.II. A Basic Estimate and its Consequences The first result of this section provides useful bounds for the solution of (4.1) with non-negative kernel. Notice that the following lemma allows discontinuous solutions for (4.1) as well as discontinuous initial conditions. Lemma 4.1 (A Basic Estimate for the solution of linear IDEs): Let   C 0 0, A;    be a given A function with   (a)da  1 and consider the IDE (4.1). Let   0 be an arbitrary constant with 0    L [ A,0);  there exists a unique function x  Lloc [ A,);  with   (a)da  1 . Then for every 0 x(a)   (a) for a  [ A,0) that satisfies (4.1) for t  0 a.e.. Moreover, x  Lloc [ A,);  satisfies for all t  0 the following inequality: 1 h 1t    Lc  min  inf  (a)  ,  inf  (a )   inf x(t  a )    A a  0   A a  0   A a  0  1 c     L  c 1 h 1t     sup x(t  a)   max  sup  (a )  , sup  (a )    1 c    A a  0  A a  0  A a  0   A  0 0 (4.2) where h : min( , A   ) , L :   (a)da  1 , c :   (a)da  1 . A direct consequence of Lemma 4.1 and Lemma 3.2 is that if k  PC1 [0, A];    , then for every A z 0  PC1 [0, A];  satisfying z 0 (0)  k (a) z 0 (a)da and z 0 (a)  0 for all a [0, A] , the corresponding  0 solution of (3.1), (3.2) satisfies z(t , a)  0 , for all (t , a)    [0, A] . To see this, notice that if  a  k (a ) exp   ( s )ds da  1   0  0  A    a  k (a ) exp   ( s )ds da  1   0  0  A On the other hand, if then we may apply Lemma 3.2 and Lemma 4.1 directly for the IDE (3.4).   then we define x(t )  exp( pt )v(t ) for all t   A , where 13 p0. It follows a   k (a ) exp pa   ( s )ds da  1   0 0   A  A a   x(t )  k (a ) exp pa   ( s )ds  x(t  a )da   0 0    that   t0 for and that for p  0 sufficiently large. Another direct consequence of Lemma 4.1 and Lemma 3.2 is that if k  PC1 [0, A];    , then the quantity f (t , a )  f ( a ) ( f [t ]) 1 appearing in the right hand side of the transformation (2.19) is only a function of t  a (and thus (2.19) is a valid transformation). Indeed, it is straightforward to verify that for every piecewise continuous function D :    [ Dmin , Dmax ] and for every A f 0  PC [0, A]; (0,) with f 0 (0)  k (a) f 0 (a)da , the solution of (2.1), (2.2) with f (0, a)  f 0 (a) for  1 0  t  a [0, A] , corresponding to input D :    [ Dmin , Dmax ] satisfies f (t , a )  z (t , a ) exp  D ( s )ds  for all  0  (t , a)    [0, A] , where z : [0,)  [0, A]   is the solution of (3.1), (3.2) with same initial condition   t  z(0, a)  f 0 (a) for a [0, A] . Using (2.4), (3.3) and equation f (t , a )  z (t , a ) exp  D ( s )ds  , we get:    0   f (t , a ) f  (a) 1 M t     exp D a  D ( s )ds v(t  a ) ,   0    for all (t , a)    [0, A]  t  f (t , a )  z (t , a ) exp  D ( s )ds     0   Using (2.4), (2.8), (3.3), equation and definition (2.9), we get: A  t A A~  ~ M wk ( w)dw  ( f [t ])  exp  D( s )ds  v(t  a ) exp D  a  k ( s )ds da     0  0 0 a       t   t  A~   exp D  t  D( s )ds  v(l ) exp  D  l  k ( s )ds dl     0  t  A  t l      Since v(t )  0 for all t   A (a consequence of (3.3) and the conclusion of the previous paragraph), the above equation implies that ( f [t ])  0 for all t  0 . Combining the two above equations, we get:   A ~ v(t  a) exp  D  (t  a) wk ( w)dw f (t , a)  d dt 0  ~  v(l ) exp  D  l  k ( s )ds dl   tA  t l  a   ~ k (a )  k (a ) exp  D  a   ( s )ds  for a [0, A] .   0   f (a) ( f [t ]) where     A   A~  v(l ) exp  D l  k ( s )ds dl  0   tA  t l  t  t  d dt   , for all (t , a)    [0, A] Notice that (3.4) implies for all t  0 . Indeed, we have for all t  0 :  A~  A~  t ~ v(l ) exp  D  l  k ( s )ds dl  v(t ) exp  D  t  k ( s )ds   v(l )k (t  l ) exp  D  l dl     tA  t l  0  tA  t      A~  A ~  v(t ) exp  D  t  k ( s )ds   v(t  a )k (a ) exp  D  (t  a ) da   0  0     14    that   a Using definition k (a)  k (a) exp  D  a    ( s)ds  for a [0, A] and the fact that ~   0 A ~  k (s)ds  1 (a 0 consequence of (2.3)), we get for all t  0 : d dt A   A~   a   v(l ) exp  D  l  k ( s )ds dl  exp  D  t  v(t )  v(t  a )k (a ) exp   ( s )ds da        tA 0  t l   0     t   which combined with (3.4) gives fact that  d dt    A~  v(l ) exp  D  l  k ( s )ds dl  0   tA  t l   t   a  a    v( a )  exp  ( s )ds z (0, a )  exp  ( s )ds  f 0 (a ) ,     0  0     for all t  0 . Therefore, using the for all a  (0, A] , we get 0  A~  A    ~   v(l ) exp  D l k ( s )ds dl  v(l ) exp  D l k ( s )ds dl     tA A  t l   l   t    w   A ~   f 0 ( w) exp D  w   ( s )ds  k ( s )ds dw    0 0   w  f (t , a )  1 is a function the quantity  f ( a ) ( f [t ]) A  Consequently,  A f (t , a)  f (a) ( f [t ])    0 only of t  a , since we have: ~ 0  , for all t  0   wk (w)dw A  w   A ~  f 0 ( w) exp D  w   ( s )ds  k ( s)ds dw    0   w    v(t  a) exp  D  (t  a) , for all (t, a)     [0, A]  4.III. The Strong Ergodic Theorem in terms of IDEs Next, we state the strong ergodic theorem (Theorem 3.3) in terms of the IDE (4.1). To this goal, we define the operator G : C 0 [ A,0];   C 0 [0, A];  for every v  C 0 [ A,0];  by the relation (Gv)(a)  v(a) for all a [0, A] . If   C 0 [0, A];   , k  PC1 [0, A];    satisfy (2.3) for certain D    , then it follows from Lemma 3.2 and Theorem 3.3 that there exist constants   0 , K  1 such that for every z 0  PC1 [0, A];  A satisfying z 0 (0)   k (a) z 0 (a)da , the unique solution of the IDE (3.4) with initial condition 0 a  v( a )  exp  ( s )ds  z 0 (a )   0   for all a [0, A] satisfies for all t  0 the following estimate:  A    v(t  a)  exp D  (t  a) ( z 0 ) da  K exp ( D    )t 0  v(a) da A (4.3) 0 The above property can be rephrased without any reference to the PDE: for every  A  k  PC [0, A];    with 1  k (a) exp  D  a da there exist constants   0 , K  1 such that for every 1  0 A v0  C 0 [ A,0];  with v 0 (0)  k (a)v 0 (a)da and (Gv0 )  PC1 [0, A];  , the unique solution of the IDE  0 15 A  v(t )  k (a)v(t  a)da with initial condition v(a)  v 0 (a) , for all a [0, A] satisfies (4.3) for all t  0 , 0 with  a  z 0 (a )  v( a ) exp   ( s )ds     0   for a [0, A] . Using the transformation x(t )  exp D t v(t ) , for all t   A , we obtain a “one-to-one” mapping of solutions of the IDE v(t )   k (a)v(t  a)da to the solutions of the IDE (4.1) with  (a) : k (a) exp D  a  A 0 for all a [0, A] . Moreover, estimate (4.3) implies the following estimate for all t  0 : A  x(t  a)  P( x 0 ) da   x(a) da  K exp  t  exp D A  0 A 0 where the functional P : C 0 [ A,0];    , is defined by means of the equation A A   0 a P( x)  r x(a)  ( s)dsda A (4.4) 1  is found by substituting P : C 0 [ A,0];    r :  a (a)da  . The functional   0  a   z 0 (a )  x( a ) exp  D  a   ( s )ds  (for a [0, A] ) in the functional  : L1 [0, A];    defined by (3.7).   0    and  Therefore, we are in a position to conclude that the following property holds: for every   PC [0, A];    1 A with 1    (a)da there exist constants ~ K,  0 such that for every 0 A x0  C 0 [ A,0];  with x 0 (0)   (a) x 0 (a)da and (Gx0 )  PC1 [0, A];  , the unique solution of the IDE  0 (4.1) with initial condition x(a)  x0 (a) , for all a [0, A] satisfies the following estimate for all t0 A  A ~ x(t  a)  P( x 0 ) da  K exp  t  x(a) da  0 (4.5) 0 Using this property, we obtain the following corollary, which is a restatement of the strong ergodic theorem (Theorem 3.3) in terms of IDEs and the L norm (instead of the L1 norm). Recall that A   0 X   x  C ([ A,0]; ) : x(0)   (a ) x( a )da  .   0  Corollary 4.2 (The strong ergodic theorem in terms of IDEs): Suppose that   PC1 [0, A];    A with 1    (a)da . Then there exist constants M ,   0 such that for every x0  X with 0 1 (Gx0 )  PC [0, A];  , the unique solution of the IDE (4.1) with initial condition x(a)  x0 (a) for all a [0, A] satisfies the following estimate for all t  0 : max  x(t   )  P( x 0 )   M exp  t  max  x 0 (a)   A  0  A a  0 16 (4.6) 4.IV. The Construction of Lyapunov Functionals The problem with Corollary 4.2 is that it does not provide a Lyapunov-like functional which can allow the derivation of the important property (4.6). Moreover, it does not provide information about the magnitude of the constant   0 . In order to construct a Lyapunov-like functional and obtain information about the magnitude of the constant   0 , we need some technical results. The first result deals with the exponential stability of the zero solution for (4.1). Notice that the proof of the exponential stability property is made by means of a Lyapunov functional. A Lemma 4.3 (Lyapunov functional for the general case): Suppose that   (a) da  1 . Then 0  X is 0 globally exponentially stable for (4.1). Moreover, the functional V : X   defined by V ( x) : max exp( a) x(a)  , where   0 is a constant that satisfies a[0, A] A   (a) exp(a)da  1 , satisfies the 0 differential inequality:   lim sup h 1 V ( xt  h )  V ( xt )    V ( xt ) , h 0  for all t  0 (4.7) for every solution of (4.1). Lemma 4.3 is useful because we next construct Lyapunov functionals of the form used in Lemma 4.3. However, we are mostly interested in kernels   C 0 ([0, A]; ) with non-negative values that A satisfy   (a)da  1 . We show next that even for this specific case, it is possible to construct a 0 Lyapunov functional on an   X   x  C 0 ([ A,0]; ) : x(0)   (a ) x( a )da  .   0 invariant subspace of the state space A  We next introduce a technical assumption. A (H1) The function   C 0 ([0, A]; ) satisfies  (a)  0 for all a [0, A] and   (a)da  1 . Moreover, 0 A there exists   0 such that  0 A 1   (a )  r  ( s )ds da  1 , where r :  a (a)da  .   a 0  A   The following result provides the construction of a Lyapunov functional for system (4.1) under assumption (H1). Theorem 4.4 (Lyapunov functional for linear IDEs with special kernels): Consider system (4.1), where   C 0 ([0, A];   ) satisfies assumption (H1). Let   0 be a real number for which A  0 1 A   (a )  r  ( s )ds da  1 , where r :  a (a)da  . Define the functional V : X    by means of the   a 0  equation: A   V ( x) : max exp( a) x(a)  P( x)  a[0, A] A where   0 is a real number for which  (4.8) A   (a )  r  ( s )ds exp(a )da  1 and P : X   is the 0 a functional defined by (4.4). Then the following relations hold 17 P( xt )  P( x 0 ) , for all t  0  (4.9)  lim sup h 1 V ( xt  h )  V ( xt )    V ( xt ) , h 0  for all t  0 (4.10) for every solution of (4.1). Remark 4.5: Theorem 4.4 is a Lyapunov-like version of the scalar strong ergodic theorem (compare with Corollary 4.2) for kernels that satisfy assumption (H1). Corollary 4.2 does not allow us to estimate the magnitude of the constant   0 that determines the convergence rate. On the other hand, Theorem 4.4 allows us to estimate   0 : the Comparison Lemma on page 85 in [19] and differential inequality (4.10) guarantee that V ( xt )  exp( t )V ( x0 ) for all t  0 and for every solution of (4.1). Using (4.9), definition (4.8) and the previous estimate, we can guarantee that max  x(t  a)  P( xt )   max  x(t  a)  P( x0 )   exp( (t  A)) max  x(a)  P( x0 )  , for all t  0 a[0, A] a[0, A] a[0, A] Therefore, bounds for   0 can be computed in a straightforward way using the inequality A  0 A A A   (a )  r  ( s )ds exp(a )da  1 (e.g., an allowable value for   0 is  A 1 ln   (a)  r  ( s)ds da  ).   a a 0     Moreover, Corollary 4.2 does not provide a Lyapunov-like functional for equation (4.1). However, the cost of these features is the loss of generality: while Corollary 4.2 holds for all kernels   PC1 [0, A];    that satisfy  (a)  0 for all a [0, A] and A   (a)da  1 , Theorem 4.4 holds only for 0 kernels that satisfy Assumption (H1). Theorem 4.4 can allow us to guarantee exponential stability for the zero solution of (4.1), when the state evolves in certain invariant subsets of the state space. This is shown in the following result. Corollary 4.6 (Lyapunov functional for linear IDEs on invariant sets): Consider system (4.1), where   C 0 ([0, A];   ) satisfies assumption (H1). Let   0 be a real number for which 1 A   (a )  r  ( s )ds da  1 , where r :  a (a)da  . Let P : X   be the functional defined by (4.4).   0 a 0  Define the functional W : X    by means of the equation: A  A   W ( x) : max exp( a) x(a)  a[0, A] A where   0 is a real number for which  (4.11) A   (a )  r  ( s )ds exp(a )da  1 . Let S  X be a positively 0 a invariant set for system (4.1) and let C : S   [ ,) , where   0 is a constant and S   C 0 ([ A,0]; ) is an open set with S  S  , be a continuous functional that satisfies   lim sup h 1 C ( x t  h )  C ( x t )   0 h 0  (4.12) for every t  0 and for every solution x(t )   of (4.1) with x t  S . Then for every x0  S with P( x0 )  0 and for every b  K   C 1 ([0,);   ) , the following hold for the solution x(t )   of (4.1) with initial condition x0  S : lim suph 1 C ( x t  h )b(W ( x t  h ))  C ( x t )b(W ( x t ))   C ( x t )b (W ( x t ))W ( x t ) , for all t  0 (4.13) h 0  P( xt )  0 , for all t  0 18 (4.14) Remark 4.7: (a) The differential inequality (4.12) is equivalent to the assumption that the mapping t  C ( xt ) is non-increasing. (b) Using assumption (H1) and Lemma 4.1, we can guarantee that the mapping t  g1 ( xt ) is nondecreasing and that the mapping t  g 2 ( xt ) is non-increasing for every solution of (4.1), where g1 , g 2 : C 0 ([ A,0]; )   are the continuous functionals g 1 ( x) : min x(a )  and g 2 ( x) : max x(a )  . a[ 0, A] a[ 0, A] Indeed, Lemma 4.1 implies that for every solution of (4.1) it holds that: g1 ( x 0 )  g1 ( xt )  g 2 ( xt )  g 2 ( x0 ) , for all t  0 (4.15) Consequently, any set S  X of the form S   x  X : min x(a)   c1  , S   x  X : max x(a)   c2  , a[ 0, A] a[ 0, A]    S   x  X : c1  min x(a)   max x(a)   c2  , a[ 0, A] a[ 0, A]      where c1  c 2 are constants, is a positively invariant set for (4.1). Moreover, using the semigroup property for the solution of (4.1) and (4.15), we get g1 ( xt2 )  g1 ( xt1 )  g 2 ( xt1 )  g 2 ( xt2 ) , for all t1  t 2  0 The above inequality shows that the mapping t  g1 ( xt ) is non-decreasing and that the mapping t  g 2 ( xt ) is non-increasing for every solution of (4.1). 5. Proofs of Main Results We next turn our attention to the proof of Theorem 2.1. Throughout this section we use the notation: (5.1) q( x) : min Dmax  D  , max ( D   Dmin ), x , for all x   Notice that q(x) is a non-decreasing function, which satisfies the equation: q( x)  sat ( D   x)  D  , for all x   (5.2) Equation (5.2) and the fact D  ( Dmin , Dmax ) imply the inequality  q( x)  max Dmax  D  , D   Dmin  , for all x  (5.3) for all x   (5.4) We also notice that the inequality  xq ( x)  min 1, D max  D  , D   D min 1 x x 2 holds. Indeed, inequality (5.4) can be derived by using definition (5.1) and distinguishing three cases: (i)  ( D   Dmin )  x  Dmax  D  , (ii) x  Dmax  D  , and (iii)  ( D   Dmin )  x . For case (i) we get from (5.1) xq( x)  x 2 and since 1  case. For case  (ii)  min 1, Dmax  D  , D   Dmin 1 x we get  Dmax  D   min 1, Dmax  D  , D   Dmin , x  from (5.1)  , we conclude that (5.4) holds in this   xq ( x)  Dmax  D  x and since 2 x 1 x , we conclude that (5.4) holds in this case. The proof is similar for case (iii). The proof of Theorem 2.1 is based on the transformation shown in Figure 1 and on the following lemmas. Their proofs can be found in the Appendix. 19 Lemma 5.1: Consider the control system A ~  (t )  D   D(t ) ,  (t )  k (a) (t  a)da , ( (t ), (t ))   2  (5.5) 0 where A  0 is a constant , D  ( Dmin , Dmax ) is a constant, Dmax  Dmin  0 are constants, ~ k  C 0 ([0, A];  ) satisfies assumption (A) and A ~  k (a)da  1 . The control system (5.5) is defined on the 0 set  S , where A ~ ~  ~ S  S    C 0 ([ A,0]; ) : P( )  0 , S     C 0 ([ A,0]; (1,)) : (0)  k (a ) ( a )da  0       1 A ~  ~ and P( ) is the linear functional P( ) : r  (a) k (s)dsda with r :  ak (a)da  . The measured 0 a 0  A A    output of system (5.5) is given by the equation  A  Y (t )   (t )  ln 1  g (a ) (t  a )da     0   (5.6) A where the function g  C 0 ([0, A];) satisfies g (a)  0 for all a [0, A] and  g (a)da  1 . Consider the 0 closed-loop system (5.5) with the dynamic feedback law given by z1 (t )  z 2 (t )  D(t )  l1 z1 (t )  Y (t ) , and z 2 (t )  l 2 z1 (t )  Y (t ) , z(t )  ( z1 (t ), z 2 (t ))   2 (5.7) D(t )  sat z 2 (t )   Y (t ) (5.8) where l1 , l 2 ,   0 are constants. Let p1 , p 2  0 be a pair of constants satisfying 2  l1 p1  2l2 p2 2  8l1 p1  4l2 p12 , p12  4 p 2 . Then there exist sufficiently large constants M , G  0 and sufficiently small constants L,   0 such that for every constant   0 and for every z 0   2 , ( 0 , 0 )    S the solution ( z(t ), (t ), t )   2    S of the closed-loop system (5.5), (5.6) with (5.7), (5.8) and initial condition ( (0), z(0))  ( 0 , z 0 ) ,  (a)   0 (a) for all a [0, A] , is unique, exists for all t  0 and satisfies the differential inequality   lim sup h 1 V ( (t  h), z (t  h), t  h )  V ( (t ), z (t ), t )    L h 0  V ( (t ), z (t ), t ) 1  V ( (t ), z (t ), t ) , for all t  0 (5.9) where V :    2  C 0 ([ A,0]; (1,))    is the continuous functional defined by: V (, z, ) :  2  G Q( z,, )   Q( z,, ) (5.10)    max exp( a) (a)   M a[ 0, A]  Q( z, , ) : ( z1   )2  p1 ( z1   )( z2  D )  p2 ( z2  D )2   2     (a)   1  min  0, amin [ 0 , A]    2 (5.11) Lemma 5.2: Suppose that there exists a constant L  0 such that the continuous function  :      satisfies:   lim sup h 1  (t  h)   (t )    L h 0   (t ) , for all t  0 1   (t ) (5.12) Then the following estimate holds:  L  t ,  2   (t )   (0) expmax0,  (0)  1 exp  20 for all t  0 (5.13) We are now ready to provide the proof of Theorem 2.1. Proof of Theorem 2.1: Define  0 (a)  f 0 (a)  f ( a ) ( f 0 ) 1 , for all a [0, A] (5.14)  0  ln ( f 0 ) (5.15) It is straightforward to verify (using definitions (2.8), (5.14), equation (2.4) and the fact that a   ~ k (a )  k (a ) exp  D  a   ( s )ds    0    A A 0 a ~ for all a [0, A] ) that P( 0 )  0 , where P( )  r  (a) k (s)dsda with 1 A ~  r :  ak (a)da  . Define   0   g (a) : p(a) f  (a) / y  , for all a [0, A] A Notice that (2.4) and the fact that a    M  y  p (a ) exp  D  a   ( s )ds da      0    0    (5.16) 1 imply that the function A g  C ([0, A]; ) satisfies g (a)  0 for all a [0, A] and 0  g (a)da  1 . 0 Next consider the solution ( z(t ), (t ), t )      S of the closed-loop system (5.5) with (5.7), (5.8) and initial condition ( (0), z(0))  ( 0 , z 0 ) ,  (a)   0 (a) for all a [0, A] . Lemma 5.1 guarantees that the solution ( z(t ), (t ), t )   2    S of the closed-loop system (5.5) with (5.7), (5.8) 2 A ~ exists for all t  0 . The solution of the IDE  (t )   k (a) (t  a)da is C 1 on (0,) since it coincides 0 ~ A ~ ~ with the solution of the delay differential equation  (t )  k (0) (t )  k ( A) (t  A)   k (a) (t  a)da with 0 the same initial condition. Therefore by virtue of (5.14), the function defined by: f (t , a)  1  (t  a) f  (a) exp( (t )) for (t , a)     [0, A] (5.17) is continuous and f  C 1 D f ; (0,) , where D f   (t, a)  (0,)  (0, A) : (a  t )  B {0, A}  and B  (0, A) ~ is the finite (possibly empty) set where the derivative of f 0  X is not defined or is not continuous. ~ Since  t  S , it follows that f [t ]  X for all t  0 , where ( f [t ])(a)  f (t, a) for a [0, A] . Using (5.15), (5.17) and (5.5) we conclude that (5.18)  (t )  ln ( f [t ]) , for all t  0 Moreover, using (5.5), (5.6), (5.7), (5.8), (5.16), (5.17) and (5.18), we conclude that equations (2.5), (2.6), (2.7) hold for all t  0 and equation (2.1) holds for all (t, a)  D f . Finally, by virtue of (5.14), (5.15) and (5.17), it follows that z(0)  z 0 , f (0, a)  f 0 (a) for all a [0, A] . Using (2.11), (2.12), (5.17), (5.18) we conclude that V ( (t ), z(t ), t )  W ( z(t ), f [t ]) for all t  0 . Therefore, the differential inequality (5.9) implies the differential inequality (2.13). Lemma 5.2 in conjunction with inequality (5.9), implies that the following estimate holds:  L  V ( (t ), z (t ), t )  V ( 0 , z 0 , 0 ) expmax 0, V ( 0 , z 0 , 0 )  1 exp  t  ,  2  21 for all t  0 (5.19) Since p1 , p 2  0 is a pair of constants with p12  4 p 2 , it follows that the quadratic form A(e) : e12  p1e1e2  p 2 e22 is positive definite. Therefore, there exist constants K 2  K1  0 , such that 2 2 K1 e  A(e)  e12  p1e1e 2  p 2 e 22  K 2 e , for all e   2 . Using the previous inequality, (5.10), (5.11) and (5.19), we obtain the following estimates for all t  0 :  L  t  2   2 (t )  V ( 0 , z 0 , 0 ) expmax0, V ( 0 , z 0 , 0 )  1 exp  G M 2 max exp(  a) t (a)  a[ 0, A]   1  min  0, min  t (a)  a  [ 0 , A ]     L   V ( 0 , z 0 , 0 ) expmax0, V ( 0 , z 0 , 0 )  1 exp  t   2    L  G  1 max z1 (t )   (t ) , z 2 (t )  D   V ( 0 , z 0 , 0 ) expmax 0, V ( 0 , z 0 , 0 )  1 exp  t   2  (5.20) (5.21) (5.22) Estimates (5.20), (5.21), (5.22) and the fact that M , G  0 are sufficiently large constants (with G 1  3 and G M  3 ), imply the following estimate for all t  0 : 2 max exp(  a ) t (a )  a[ 0, A]  (t )   z1 (t )  z 2 (t )  D    1  min  0, min  t (a )   a[0, A]   Using (5.17) and the (5.23)   L   V ( 0 , z 0 , 0 )  V ( 0 , z 0 , 0 ) expmax 0, V ( 0 , z 0 , 0 )  1 exp  t   4  x fact that ln(1  x)  for all x  1 , we get the estimate 1  min( x,0) for all a  [0, A] : exp(A) max exp(  s) t ( s)   f (t , a)   (t  a) s[ 0, A]    (t )  ln     (t )   f (a)    1  min 0 ,  ( t  a )     1  min  0, min  t ( s)   s[0, A]  which implies the following estimate for all t  0 : exp(A) max exp(  a) t (a)    f (t , a)   a[ 0, A]     (t )  max  ln   a[ 0, A]  f ( a )        1  min  0, min  t (a)   a[0, A]  Combining (5.23) and (5.24), we obtain the following estimate for all t  0 :   f (t , a )      z1 (t )  z 2 (t )  D  max  ln    f (a)   a[ 0, A]     L   exp(A) V ( 0 , z 0 , 0 )  V ( 0 , z 0 , 0 ) expmax 0, V ( 0 , z 0 , 0 )  1 exp  t   4    (5.24) (5.25) Taking into account (5.25), we conclude that the validity of (2.10) relies on showing that there ~ exists a function b  K  that satisfies the following inequality for all f 0  X and z 0   2 and for ( 0 , 0 )    S satisfying (5.14), (5.15):    f (a)      z1,0  z 2,0  D  V ( 0 , z 0 , 0 )  b max  ln  0  a[0, A]  f (a)          (5.26) In order to show (5.26), and taking into account definitions (5.10), (5.11), it suffices to show there ~ exist functions b1 , b2  K  for which the following inequalities hold for all f 0  X and for ( 0 , 0 )    S satisfying (5.14), (5.15): 22  exp( a) 0 (a)     f (a)     f 0 (a )    amax  , [0, A]  b2  max  ln  0         a[0, A]    f ( a )     1  min  0, min  0 (a)    f (a)      a[0, A]    0  b1  max  ln   a[ 0, A]    (5.27)  f (a)   In what follows we are using repeatedly the notation v  max  ln  0   and the fact that a[ 0, A]   f (a)    f (a)   f (a)    max  0   exp(v) exp(v)  min  0   a[ 0, A] f (a) a[ 0, A] f  (a)       (5.28)  f (a)   Inequality (5.28) follows from the definition v  max  ln  0   and the following implications a[ 0, A]   f (a)    f (a)    v , for all a [0, A]  ln  0  f (a)    Using (2.4) and (2.8) we get  f (a)    v , for all a [0, A]    v  ln  0  f  (a)    f (a)  exp( v)  0  exp(v) , for all a [0, A] f (a) ~ for all f 0  X :  f (a)   f (a)     ( f 0 )  max  0  min  0 a[ 0, A] f (a )  a[ 0, A] f  (a )      (5.29) Inequalities (5.29) is derived by means of definition (2.8), which directly implies A  ( f 0 )  0 A a   f  (a) k ( s) exp  (l )  D  dl ds da     s   a    A  ak (a) f  (a)da  f (a )   f (a)     ( f  ) max  0  max  0 a[ 0, A] f ( a )  a[ 0, A] f  ( a )      0 A  ( f 0 )  0 A a    f (a) k ( s) exp  (l )  D  dl ds da     s   a     A  ak (a) f  (a)da  f (a )   f (a)     ( f  ) min  0  min  0 a[ 0, A] f ( a )  a[ 0, A] f  ( a )      0 Moreover, by virtue of (2.4) and (2.8), we have ( f  )  1 , since A ( f  )   0 A a   f  (a ) k ( s ) exp  (l )  D  dl ds da     s   a    A  ak (a) f  (a )da 0   A a   M exp  D  a   ( s )ds  k ( s ) exp  (l )  D  dl ds da      0 0   a s    A a   M ak (a ) exp  D  a   ( s )ds da   0 0   A a    AA    s     k ( s ) exp  D  s   (l )dl ds da     0a 0     1 A a   ak (a ) exp  D  a   ( s )ds da   0 0       23  Notice that for the last equality above we have used integration by parts for the integral in the numerator. Combining (5.28), (5.29) and using (5.15) we get: 0  v (5.30) Consequently, (5.30) shows that the first inequality (5.27) holds with b1 (s)  s for all s  0 . On the ~ other hand, using (5.14), (5.15) we get for all f 0  X and a  [0, A] :  f 0 (a)    1 and  1  exp(   )  1  (  a )  exp(   ) min 0 0 0 a[ 0, A] f  (a )  f  (a)   ~ Using (5.28) and (5.30), we obtain for all f 0  X and a  [0, A] :  0 (a)  exp(  0 ) f 0 (a) (5.31)  0 (a)  exp(2v)  1 and  0 (a)  exp(2v)  1 (5.32) The following inequality is a direct consequence of (5.32): max exp(  a) 0 (a)  a[ 0, A]   1  min  0, min  0 (a)   a[0, A]   exp( 2v)(exp(2v)  1) (5.33) Consequently, (5.33) shows that the second inequality (5.27) holds with b2 (s)  exp(2s)(exp(2s)  1) for all s  0 . The proof is complete.  The proof of Theorem 2.4 is based on the transformation shown in Figure 1 and on the following lemma. Its proof can be found in the Appendix. Lemma 5.3: Consider the control system (5.5) where A  0 is a constant , D  ( Dmin , Dmax ) is a A ~ constant, Dmax  Dmin  0 are constants, k  C 0 ([0, A];  ) satisfies ~  k (a)da  1 . The control system 0 (5.5) is defined on the set  S , where A ~ ~  ~ S  S    C 0 ([ A,0]; ) : P( )  0 , S     C 0 ([ A,0]; (1,)) : (0)  k (a ) ( a )da  0    A ~  ~ and P( ) : r  (a) k (s)dsda with r :  ak (a)da  0 a 0  A A      1  is a linear functional. The measured output of system (5.5) is given by the equation (5.6), where the function g  C 0 ([0, A];) satisfies g (a)  0 for A all a [0, A] and  g (a)da  1 . Consider the closed-loop system (5.5) with the dynamic feedback law 0 given by   D(t )  sat D   T 1Y (iT ) , for all t  [iT , (i  1)T ) and for all integers i  0 (5.34) where T  0 is a constant. Let G : C 0 [ A,0];   C 0 [0, A];  be the operator defined by the relation (Gv)(a)  v(a) for all a [0, A] for every v  C 0 [ A,0];  . Then there exist a constant L  0 and a function   K  such that for every ( 0 , 0 )    S with (G 0 )  PC1 [0, A];  the solution ( (t ), t )    S of the closed-loop system (5.5), (5.6) with (5.34) and initial condition  (0)   0 ,  (a)   0 (a) for all a [0, A] , is unique, exists for all t  0 and satisfies the following estimate max  (t  s)    max  0 ( s)     A  s  0 ,  (t )   exp L t    0       1  min  0 , min  (t  s )  1  min  0, min  0 ( s)      A s  0    A s  0    A s  0 We are now ready to provide the proof of Theorem 2.4. 24 for all t  0 (5.35) Proof of Theorem 2.4: Define ( 0 , 0 )    S by means of (5.14), (5.15). It is straightforward to  a  0  verify (using definitions (2.8), (5.14), equation (2.4) and the fact that k (a)  k (a) exp  D  a    ( s)ds  ~  A A 0 a for all a [0, A] ) that P( 0 )  0 and (G 0 )  PC1 [0, A];  , where P( )  r  (a) k (s)dsda with A ~ 1  ~ and G : C 0 [ A,0];   C 0 [0, A];  is the operator defined by the relation r :  ak (a)da    0  (Gv)(a)  v(a) for all a [0, A] for every v  C 0 [ A,0];  . Define g by means of (5.16) and notice  that (2.4) and the fact that a A       M  y  p (a ) exp  D a   ( s )ds da      0    0   1 imply that the function A g  C ([0, A]; ) satisfies g (a)  0 for all a [0, A] and  g (a)da  1 . 0 0 Next consider the solution ( (t ), t )    S of the closed-loop system (5.5), (5.6) with (5.34) and initial condition  (0)   0 ,  (a)   0 (a) for all a [0, A] . Lemma 5.3 guarantees that the solution ( (t ), t )    S of the closed-loop system (5.5), (5.6) with (5.34) exists for all t  0 . Moreover, there exist a constants L  0 and a function   K  such that for every ( 0 , 0 )    S with (G 0 )  PC1 [0, A];  the solution ( (t ), t )    S of the closed-loop system (5.5), (5.6) with (5.34) and initial condition  (0)   0 ,  (a)   0 (a) for all a [0, A] , satisfies estimate (5.35). The solution A ~ of the IDE  (t )   k (a) (t  a)da is C 1 on (0,) since it coincides with the solution of the delay 0 ~ A ~ ~ differential equation  (t )  k (0) (t )  k ( A) (t  A)   k (a) (t  a)da with the same initial condition. 0 Therefore by virtue of (5.14), the function defined by (5.17) is continuous and f  C 1 D f ; (0,) ,   where D f  (t, a)  (0, )  (0, A) : (a  t )  B {0, A} , t  T T 1t and B  (0, A) is the finite (possibly ~ empty) set where the derivative of f 0  X is not defined or is not continuous. Since  t  S , it ~ follows that f [t ]  X for all t  0 , where ( f [t ])(a)  f (t, a) for a [0, A] . Using (5.15), (5.17) and (5.5) we conclude that (5.18) holds. Moreover, using (5.5), (5.6), (5.34), (5.16), (5.17) and (5.18), we conclude that equations (2.5), (2.14) hold for all t  0 and equation (2.1) holds for all (t, a)  D f . Finally, by virtue of (5.14), (5.15) and (5.17), it follows that f (0, a)  f 0 (a) for all a [0, A] . Using (5.17) and the fact that ln(1  x)  x 1  min( x,0) for all x  1 , we get the estimate for all t  0 : max  t (a)    f (t , a)   a[ 0, A]     max ln   (t )  a[ 0, A]  f  (a )        1  min  0, min  t (a)   a[0, A]  Combining (5.35) and (5.36), we obtain the following estimate for all t  0 :   max  0 ( s )      f (t , a)    A s  0    exp Lt    0   max  ln   a[ 0, A]  f ( a )       1  min  0, min  0 ( s )        A s  0   (5.36) (5.37) Estimate (2.15) for certain   K  is a direct consequence and inequalities (5.27) for certain b1 , b2  K  . The proof is complete.  25 6. Using a Reduced Order Observer Instead of using the full-order observer (2.6) of the system (t )  D  (t )  D(t ) , D  (t )  0 , one can think of the possibility of using a reduced order observer that estimates the equilibrium value of the dilution rate D . Such a dynamic, output feedback law will be given by the equations:  y(t )  z (t )  l1l 21 z (t )  l12 l 21 ln     l1 D(t ) ,  y    z (t )   (6.1) and   y (t )   D(t )  sat   l 21 z (t )  (  l1l 21 ) ln      y      (6.2) where l1 , l 2 ,   0 are constants. In such a case, a solution of the initial-value problem (2.1), (2.2), ~ (2.5) with (6.1), (6.2) with initial condition where ( f 0 , z0 )  X   , A  ~  X   f  PC 1 ([0, A]; (0,)) : f (0)  k (a ) f (a )da  ,   0  means a pair of mappings f  C 0 [0,  ) [0, A]; (0,) , z  C 1 [0,  );  , where   0 , which satisfies the following properties: (i) f  C 1 D f ; (0,) , where D f   (t, a)  (0,  )  (0, A) : (a  t )  B {0, A}  and B  (0, A) is the finite ~ (possibly empty) set where the derivative of f 0  X is not defined or is not continuous, ~ (ii) f [t ]  X for all t  [0,  ) , (iii) equations (2.5), (6.1), (6.2) hold for all t  [0,  ) , (iv) equation f f (t , a)  (t , a)   (a)  D(t )  f (t , a) holds for all (t , a)  D f , and t a (v) z(0)  z 0 , f (0, a)  f 0 (a) for all a [0, A] . ~ The mapping [0,  )  t  ( f [t ], z(t ))  X   is called the solution of the closed-loop system (2.1), (2.2), ~ (2.5) with (6.1), (6.2) and initial condition ( f 0 , z 0 )  X   defined for t  [0,  ) . For the reduced-order observer case, we are in a position to prove, exactly in the same way of proving Theorem 2.1, the following result. Since its proof is almost identical to the proof of Theorem 2.1, it is omitted. Theorem 6.1 (Stabilization with a reduced order observer): Consider the age-structured ~ chemostat model (2.1), (2.2) with k  PC1 ([0, A];   ) under Assumption (A). Then for every f 0  X and z 0   there exists a unique solution of the closed-loop (2.1), (2.2), (2.5) with (6.1), (6.2) and ~ initial condition ( f 0 , z 0 )  X   . Furthermore, there exist a constant L  0 and a function   K  ~ such that for every f 0  X and z 0   the unique solution of the closed-loop (2.1), (2.2), (2.5) with ~ (6.1), (6.2) and initial condition ( f 0 , z 0 )  X   2 is defined for all t  0 and satisfies the following estimate:   f (t , a )      z (t )  l 2 D   max  ln    f (a)   a[ 0, A]       f (a)    L     z0  l2 D exp  t    max  ln  0  4   a[0, A]  f (a )        , for all t  0 Moreover, the continuous functional W :   C 0 ([0, A]; (0,))    defined by: 26 (6.3) W ( z, f ) : ln ( f )2  G Q( z, f )   Q( z, f ) (6.4) where   0 is an arbitrary constant,     max  exp(  a) f (a)   ( f ) f (a) f  (a) 2 M  a[0, A] Q( z, f ) : z  l1 ln  ( f )   l2 D   2   f (a)   min   ( f ), min       a[ 0, A] f (a )                 2 (6.5)  : C 0 ([0, A]; )   is given by (2.8),   0 is a sufficiently small constant and M , G  0 are sufficiently large constants, is a Lyapunov functional for the closed-loop system (2.1), (2.2), (2.5) ~ with (6.1), (6.2), in the sense that every solution ( f [t ], z(t ))  X   of the closed-loop system (2.1), (2.2), (2.5) with (6.1), (6.2) satisfies the inequality:   lim sup h 1 W ( z (t  h), f [t  h])  W ( z (t ), f [t ])   L h 0  W ( z (t ), f [t ]) 1  W ( z (t ), f [t ]) , for all t  0 (6.6) The family of dynamic, bounded, output feedback laws (6.1), (6.2) presents the same features as the family (2.6), (2.7). The only difference lies in the dimension of the observer. 7. Simulations To demonstrate the sampled-data control design from Theorem 2.4, three simulations were carried out. In each simulation we considered the case where A  2 ,  (a)    0.1 , D  1 (7.1) k (a)  ag , a [0,1] and k (a)  (2  a) g , a  (1,2] , (7.2) and the birth modulus is given by where g  0 is the constant for which the Lotka-Sharpe condition (2.3) holds. The model is dimensionless (a dimensionless version of (2.1), (2.2) can be obtained by using appropriate scaling of all variables). After a simple calculation it can be found that the constant g  0 is given by: g (  D ) 2 1  e (   D )  2  2.718728 (7.3) The output is given by the equation 2 y(t )   f (t, a)da , t  0 (7.4) 0 In other words, the output is the total concentration of the microorganism in the chemostat. The chosen equilibrium profile that has to be stabilized is the profile that is given by the equation:   f  (a)  exp  ( D   )a , for a [0,2] (7.5) The equilibrium value of the output is given by: y*   1  exp  2( D    ) D   27   0.808361 (7.6) Two sampled-data feedback laws were tested: the state feedback law given by    D(t )  Di  sat D   T 1 ln f (iT ,0) / f  (0) , for all t  [iT , (i  1)T ) and for all integers i  0 (7.7) which is the sampled-data feedback law proposed in [18], and the output feedback law given by    D(t )  Di  sat D   T 1 ln y(iT ) / y  , for all t  [iT , (i  1)T ) and for all integers i  0 (7.8) which is the sampled-data feedback law given by Theorem 2.4. For both feedback laws we chose: T  0.4 , Dmin  0.5 , Dmax  1.5 (7.9) The following family of functions was used for initial conditions: f 0 (a)  b0  b1a  c exp( a) , for a [0,2] (7.10) where b0 , c,  0 are free parameters and the constant b1   is chosen so that the condition 2  f 0 (0)  k (a) f 0 (a)da holds. After some simple calculations we find that 0  b1  g 1 ( g  1)b0  c 2 1  e    cg 2 1 (7.11) However, we notice that not all parameters b0 , c,  0 can be used because the additional condition min  f 0 ( a )   0 must hold as well. a[ 0, 2 ] The simulations were made with the generation of a uniform grid of function values: f (ih, jh) , for j  0,1,...,50 and i  0 (7.12) where h  0.04 . For i  0 we had f (0, jh)  f 0 ( jh) for j  0,1,...,50 . The calculation of the integrals 2 y (ih)   2  f (ih, a)da and f (ih,0)  k (a) f (ih, a)da for every i  0 , was made numerically. However, since 0 0 2 we wanted the numerical integrator to be able to evaluate exactly the integrals y(ih)   f (ih, a)da and 0 2  f (ih,0)  k (a) f (ih, a)da for every i  0 when f [ih] is an exponential function, i.e., when 0 f (ih, a)  C exp(a) for a [0,2] and for certain constants C ,    , we could not use a conventional numerical integration scheme like the trapezoid’s rule or Simpson’s rule. The reason for this 2 2 0 0 demand to be able to evaluate exactly the integrals y(ih)   f (ih, a)da and f (ih,0)   k (a) f (ih, a)da for every i  0 when f [ih] is an exponential function is explained by the fact that the equilibrium profile (given by (7.5)) is an exponential function and we would like to avoid a steady-state error due to the error induced by the numerical integration. To this end, we used the following integration schemes: 28 ( j 1) h f (ih, ( j  1)h)  f (ih, jh)  f (ih, a)da  I ( j)  h ln  f (ih, ( j  1)h)  ln  f (ih, jh) i for f (ih, ( j  1)h)  f (ih, jh) jh ( j 1) h  f (ih, a)da  I ( j)  hf (ih, jh) i for f (ih, ( j  1)h)  f (ih, jh) jh for j  2,3,...,49 and i  0 2h  f (ih, a)da  I i (2)  h 0 2h (7.13) f (ih,2h)  f 2 (ih, h) / f (ih,2h) ln  f (ih,2h)   ln  f (ih, h)   f (ih, a)da  I (2)  2hf (ih, h) i for for f (ih, h)  f (ih,2h) (7.14) f (ih, h)  f (ih,2h) 0 ( j 1) h  af (ih, a)da  J ( j)  h f (ih, ( j  1)h)  j  f (ih, ( j  1)h)  f (ih, jh)  ln  f (ih, ( j  1)h)   ln  f (ih, jh)  2 i jh  ( j 1) h  af (ih, a)da  J ( j)  i jh h 2  f (ih, ( j  1)h)  f (ih, jh)  ln  f (ih, ( j  1)h)   ln  f (ih, jh) 2 2 j 1 2 h f (ih, jh) 2 for f (ih, ( j  1)h)  f (ih, jh) for f (ih, ( j  1)h)  f (ih, jh) for j  2,3,...,24 and i  0 2h  af (ih, a )da  J i ( j )  0 (7.15) 2h 2 f (ih,2h) ln  f (ih,2h)   ln  f (ih, h)   f 2 (ih, h)  h 2  f (ih,2h)  f (ih,2h)    ln  f (ih,2h)  ln  f (ih, h)2 for f (ih, h)  f (ih,2h) (7.16) 2h  af (ih, a)da  J ( j)  2h 2 i f (ih,2h) for f (ih, h)  f (ih,2h) 0 ( j 1) h  (2  a) f (ih, a)da  K ( j)  h f (ih, ( j  1)h) ln  f (ih, ( j  1)h) / f (ih, jh)  2 i jh   hf (ih, ( j  1)h)  hf (ih, jh) h    2  jh  ln  f (ih, ( j  1)h) / f (ih, jh)   ln  f (ih, ( j  1)h) / f (ih, jh)   ( j 1) h   (2  a) f (ih, a)da  K ( j)   2  i jh 2 j 1  h hf (ih, jh) 2  for for f (ih, ( j  1)h)  f (ih, jh) f (ih, ( j  1)h)  f (ih, jh) for j  25,26,...,49 and i  0 (7.17) The derivation of formulas (7.13), (7.14), (7.15), (7.16), (7.17) is based on the interpolation of the ~ function f j (a)  C j exp( j a) through the points  jh, f (ih, jh) and ( j  1)h, f (ih, ( j  1)h) for j  1,2,...,49 . More specifically, we obtain for j  1,2,...,49 :  j  h 1 ln  f (ih, ( j  1)h) / f (ih, jh)  C j  f (ih, jh) f (ih, ( j  1) h) / f (ih, jh)  j 29 (7.18) Based on the above interpolation, the exact integration formulas are used. For example, for the ( j 1) h integral j  2,3,...,24 , we get when  j  h 1 ln  f (ih, ( j  1)h) / f (ih, jh)  0  af (ih, a)da for jh ( j 1) h ( j 1) h ( j 1) h jh jh jh ~ af j (a)da  C j  af (ih, a)da     a exp( j a ) da    C j j 1h exp( j jh) ( j  1) exp( j h)  j  C j j 2 exp( j ( j  1)h)  exp( j jh)  and when  j  h 1 ln  f (ih, ( j  1)h) / f (ih, jh)  0 ( j 1) h  ( j 1) h af (ih, a)da  jh  ~ af j (a)da  C j jh ( j 1) h  ada  jh h2 C j 2 j  1 2 Combining the above formulas with the estimated values for C j ,  j given by (7.18), we obtain formula (7.15). Similarly, we derive formulas (7.13), (7.14), (7.16) and (7.17). Notice that the formulas (7.13), (7.14), (7.15), (7.16), (7.17) allow the numerical evaluation of the integrals 2 y (ih)   2  f (ih, a)da and f (ih,0)  k (a) f (ih, a)da for every i  0 without knowledge of f (ih,0) . 0 0 Since the time step has been chosen to be equal to the discretization space step h , we are able to use the exact formula: (7.19) f ((i  1)h, jh)  f (ih, ( j  1)h) exp (  Di )h , for j  1,2,...,50 and i  0 Therefore, we are in a position to use the following algorithm for the simulation of the closed-loop system under the effect of the output feedback law (7.8). Algorithm: Given f (ih, jh) , for j  1,...,50 and certain i  0 do the following:  24 49 j 2 j  25 Calculate f (ih,0)  g  J i ( j )  g  K i ( j ) , where J i ( j ), K i ( j ) are given by (7.15), (7.16), (7.17). 49  Calculate y (ih)   I i ( j ) , where I i ( j ) is given by (7.13), (7.14). j 2     ih is an integer then set Di  max Dmin , min Dmax , D  T 1 ln y(ih) / y ; else set Di  Di 1 .  If T  Calculate f ((i  1)h, jh) , for j  1,...,50 using (7.19). The above algorithm with obvious modifications was also used for the simulation of the open-loop system as well as for the simulation of the closed-loop system under the effect of the output feedback law (7.7). In our first simulation, we used the parameter values b0  0.2 , b1  0.15184212 , c  0.8 ,   1 in our initial conditions. In Figure 2, we plot the control values and the newborn individual values. We show the values for the open loop feedback D(t )  1 , and for the state and output feedbacks from (7.7) and (7.8). Our simulation shows the efficacy of our control design. In our second simulation, we changed the parameter values to b0  1 , b1  0.7592106 , c  4 ,   1 and plotted the same values as before, in Figure 3. The responses for the output feedback law (7.7) and the output feedback law (7.8) are almost identical. The second simulation was made with an initial condition which is not close to the equilibrium profile (in the sense that it is an initial 30 condition with very large initial population). The difference in the performance of the feedback controllers (7.7) and (7.8) cannot be distinguished. In the final simulation, we tested the robustness of the controller with respect to errors in the choice of D being used in the controllers. We chose the values b0  0.2 , b1  0.15184212 , c  0.8 ,   1 , but instead of (7.7) and (7.8), we applied the following controllers: the state feedback law    D(t )  Di  sat 0.7  T 1 ln f (iT ,0) / f  (0) , for all t  [iT , (i  1)T ) and for all integers i  0 and the output feedback law given by   (7.20)  D(t )  Di  sat 0.7  T 1 ln y(iT ) / y  , for all t  [iT , (i  1)T ) and for all integers i  0 (7.21) We obtained in both cases: lim  f (t ,0)  1.1275 and lim D(t )  D  1 . A -30% error in D gives a t  t  +12.75% steady-state deviation from the desired value of the newborn individuals. See Figure 4. Notice that a constant error in D is equivalent to an error in the set point since we have:    ln  f (iT ,0) / f (0)  T 0.12 ln  f (iT ,0) /(1.1275 f (0)) D(t )  Di  sat 0.7  T 1 ln f (iT ,0) / f  (0)   sat D  1   T 1  sat D  T  1  for the state feedback case (7.7) and    ln y (iT ) / y  T 0.12 ln y (iT ) /(1.1275 y )  D(t )  Di  sat 0.7  T 1 ln y (iT ) / y    sat D  1   T 1  sat D  T  1  for the output feedback case (7.8). 8. Concluding Remarks Age-structured chemostats present challenging control problems for first-order hyperbolic PDEs that require novel results. We studied the problem of stabilizing an equilibrium age profile in an age-structured chemostat, using the dilution rate as the control. We built a family of dynamic, bounded, output feedback laws with continuously adjusted input that ensures asymptotic stability under arbitrary physically meaningful initial conditions and does not require knowledge of the model. We also built a sampled-data, bounded, output feedback stabilizer which guarantees asymptotic stability under arbitrary physically meaningful initial conditions and requires only the knowledge of one parameter: the equilibrium value of the dilution rate. In addition, we provided a family of CLFs for the age-structured chemostat model. The construction of the CLF was based on novel stability results on linear IDEs, which are of independent interest. The newly developed results, provide a Lyapunov-like proof of the scalar, strong ergodic theorem for special cases of the integral kernel. Since the growth of the microorganism may sometimes depend on the concentration of a limiting substrate, it would be useful to solve the stabilization problem for an enlarged system that has one PDE for the age distribution, coupled with one ODE for the substrate (as proposed in [29], in the context of studying limit cycles with constant dilution rates instead of a control). This is going to be the topic of our future research. Acknowledgements: The authors would like to thank Michael Malisoff for his help in the initial stages of the writing process of the paper. 31 Figure 2: Simulation for the initial condition given by (7.10) with b0  0.2 , b1  0.15184212 , c  0.8 ,   1 . The upper part of the figure shows the response for the newborn individuals. The solid line with bullets is for the state feedback (7.7), the dashed line is for the output feedback (7.8) and the bulleted line is for the open-loop system with D(t )  1 . The lower part of the figure shows the applied control action D(t ) . Again, the solid line is for the state feedback (7.7), the dashed line is for the output feedback (7.8), while the bulleted line shows the equilibrium value ( D  1 ) of the dilution rate. 32 Figure 3: Simulation for the initial condition given by (7.10) with b0  1 , b1  0.7592106 , c  4 ,   1 . The upper part of the figure shows the response for the newborn individuals. The solid line is both for the state feedback (7.7) and for the output feedback (7.8) (identical) and the bulleted line is for the open-loop system with D(t )  1 . The lower part of the figure shows the applied control action D(t ) . Again, the solid line is both for the state feedback (7.7) and for the output feedback (7.8), while the bulleted line shows the equilibrium value ( D  1 ) of the dilution rate. 33 Figure 4: Control in presence of modeling errors (-30% error in D ). Simulation for the initial condition given by (7.10) with b0  0.2 , b1  0.15184212 , c  0.8 ,   1 . The upper part of the figure shows the response for the newborn individuals. The solid line is for the state feedback (7.20), the dashed line is for the output feedback (7.21), while the dotted line shows the equilibrium value ( f   1 ) of the newborn individuals. The lower part of the figure shows the applied control action D(t ) . Again, the solid line is for the state feedback (7.20), the dashed line is for the output feedback (7.21), while the bulleted line shows the equilibrium value ( D  1 ) of the dilution rate. 34 References [1] Bastin, G., and J.-M. Coron, “On Boundary Feedback Stabilization of Non-Uniform Linear 2x2 Hyperbolic Systems Over a Bounded Interval”, Systems and Control Letters, 60, 2011, 900-906. [2] Bernard, P. and M. Krstic, “Adaptive Output-Feedback Stabilization of Non-Local Hyperbolic PDEs”, Automatica, 50, 2014, 2692-2699. [3] Boucekkine, R., N. Hritonenko and Y. Yatsenko, Optimal Control of Age-structured Populations in Economy, Demography, and the Environment (Google eBook), 2013. [4] Brauer, F. and C. Castillo-Chavez, Mathematical Models in Population Biology and Epidemiology, Springer-Verlag, New York, 2001. [5] Charlesworth, B., Evolution in Age-Structured Populations, 2nd Edition, Cambridge University Press, 1994. [6] Coron, J.-M., R. Vazquez, M. Krstic, and G. Bastin, “Local Exponential H2 Stabilization of a 2x2 Quasilinear Hyperbolic System Using Backstepping”, SIAM Journal of Control and Optimization, 51, 2013, 2005-2035. [7] Di Meglio, F., R. Vazquez, and M. Krstic, “Stabilization of a System of n + 1 Coupled FirstOrder Hyperbolic Linear PDEs with a Single Boundary Input,” IEEE Transactions on Automatic Control, 58, 2013, 3097-3111. [8] Feichtinger, G., G. Tragler and V. M. Veliov, “Optimality Conditions for Age-Structured Control Systems”, Journal of Mathematical Analysis and Applications, 288(1), 2003, 47–68. [9] Gouze, J. L. and G. Robledo, “Robust Control for an Uncertain Chemostat Model”, International Journal of Robust and Nonlinear Control, 16(A.19), 2006, 133-155. [10] Hale, J. K. and S. M. V. Lunel, Introduction to Functional Differential Equations, SpringerVerlag, New York, 1993. [11] Inaba, H., “A Semigroup Approach to the Strong Ergodic Theorem of the Multistate Stable Population Process”, Mathematical Population Studies, 1(4.1), 1988, 49-77. [12] Inaba, H., “Asymptotic Properties of the Inhomogeneous Lotka-Von Foerster System”, Mathematical Population Studies, 1(A.19), 1988, 247-264. [13] Karafyllis, I., C. Kravaris, L. Syrou and G. Lyberatos, “A Vector Lyapunov Function Characterization of Input-to-State Stability with Application to Robust Global Stabilization of the Chemostat”, European Journal of Control, 14(4.1), 2008, 47-61. [14] Karafyllis, I., C. Kravaris and N. Kalogerakis, “Relaxed Lyapunov Criteria for Robust Global Stabilization of Nonlinear Systems”, International Journal of Control, 82(7.11), 2009, 20772094. [15] Karafyllis, I., and Z.-P. Jiang, “A New Small-Gain Theorem with an Application to the Stabilization of the Chemostat”, International Journal of Robust and Nonlinear Control, 22(7.14), 2012, 1602–1630. [16] Karafyllis, I. and M. Krstic, “On the Relation of Delay Equations to First-Order Hyperbolic Partial Differential Equations”, ESAIM Control, Optimisation and Calculus of Variations, 20(A.19), 2014, 894 - 923. [17] Karafyllis, Ι., M. Malisoff and M. Krstic, “Ergodic Theorem for Stabilization of a Hyperbolic PDE Inspired by Age-Structured Chemostat”, arXiv:1501.04321 [math.OC]. [18] Karafyllis, Ι., M. Malisoff and M. Krstic, “Sampled-Data Feedback Stabilization of AgeStructured Chemostat Models”, Proceedings of the American Control Conference 2015, Chicago, IL, U.S.A., pp. 4549-4554. [19] Khalil, H. K., Nonlinear Systems, 2nd Edition, Prentice-Hall, 1996. [20] Krstic, M., and A. Smyshlyaev, “Backstepping Boundary Control for First-Order Hyperbolic PDEs and Application to Systems With Actuator and Sensor Delays”, Systems and Control Letters, 57(A.24), 2008, 750-758. [21] Mazenc, F., M. Malisoff, J. Harmand, “Stabilization and Robustness Analysis for a Chemostat Model with Two Species and Monod Growth Rates via a Lyapunov Approach”, Proceedings of the 46th IEEE Conference on Decision and Control, New Orleans, 2007. 35 [22] Mazenc, F., M. Malisoff and J. Harmand, “Further Results on Stabilization of Periodic Trajectories for a Chemostat with Two Species”, IEEE Transactions on Automatic Control, 53(4.1), 2008, 66-74. [23] Melchor-Aguilar, D., “Exponential Stability of Some Linear Continuous Time Difference Systems”, Systems and Control Letters, 61, 2012, 62–68. [24] Pazy, A., Semigroups of Linear Operators and Applications to Partial Differential Equations, Springer-Verlag, New York, 1983. [25] Rao N. S., and E. O. Roxin, “Controlled Growth of Competing Species”, SIAM Journal on Applied Mathematics, 50(3), 1990, 853-864. [26] Rundnicki, R. and M. C. Mackey, “Asymptotic Similarity and Malthusian Growth in Autonomous and Nonautonomous Populations”, Journal of Mathematical Analysis and Applications, 187, 1994, 548-566. [27] Smith, H. and P. Waltman, The Theory of the Chemostat. Dynamics of Microbial Competition, Cambridge Studies in Mathematical Biology, 13, Cambridge University Press: Cambridge, 1995. [28] Sun, B., “Optimal Control of Age-Structured Population Dynamics for Spread of Universally Fatal Diseases II”, Applicable Analysis: An International Journal, 93(A.23), 2014, 1730-1744. [29] Toth, D., and M. Kot, “Limit Cycles in a Chemostat Model for a Single Species with Age Structure”, Mathematical Biosciences, 202, 2006 194–217. Appendix Proof of Proposition 2.3: Define for   [0, r 1 ] : A A g ( ) :  ~ ~ k (a )  r k ( s )ds da Since T : supa [0, A]: k (a)  0, we have: 0 a  (A.1) ~ T g ( )  A T A  ~ ~ k ( a )  r k ( s )ds da 0 a  AA  ~ ~ ak (a)da  ak (a)da    0 0 0 a ~ k ( s)dsda  T A  and ~ k ( s)dsda  0 a T T ~   k (s)dsda (A.2) 0 a Define the Lebesgue measurable sets: A   ~ ~ S   a  [0, T ] : k (a )  r k ( s )ds    a  A   ~ ~ S   a  [0, T ] : k (a )  r k ( s )ds    a  (A.3) and the integrals I   S  ~ k (a )da J   A~   k ( s )ds da    S a  (A.4)  Notice that S  S  [0, T ] and consequently, equations (A.2) in conjunction with the fact that 1 A ~  r   ak (a)da  , implies that:   0   A ~   A~ ~ ~    g ( )  k (a )  r k ( s )ds da   r k ( s )ds  k (a ) da     a a   S S     T  A ~  A~ ~  ~      I  rJ   r k ( s )ds  k (a ) da   r k ( s )ds  k (a ) da        a    S 0 a        I   rJ   r (r 1  J  )  (1  I  )  2 I   1   (1  2rJ  ) 36 (A.5) A ~ Since S   S   [0, T ] and  k (s)ds  1 for all a [0, A] , we get: a A~  A~      k ( s )ds da  J   k ( s )ds da  S   J      0a   S a T r 1  A Moreover, since   [0, r 1 ] and  ~  k (s)ds  1 for all (A.6) a [0, A] , it follows that S   S  . Therefore, we a obtain from (A.6): 2  2r S   2rJ  or equivalently 1  2rJ   2r S   1 (A.7) A ~ Definition (A.4) and the fact that k (a)  0 for all a [0, A] with ~  k (a)da  1 implies that I   1 . 0 Combining the previous inequality with (A.7) and (A.5) we obtain the desired inequality A  0 A ~ ~ k (a )  r k ( s )ds da  1   1  2r S    for all   [0, r 1 ] . The proof is complete.  a Proof of Lemma 4.1: Local existence and uniqueness for every initial condition   L [ A,0);  is guaranteed by Theorem 2.1 in [16]. Define for all t  0 for which the solution of (4.1) exists: V (t )  sup x(t  a) , W (t )  inf  A a 0  A a 0 x(t  a) (A.8) Let q  0 and t  0 be sufficiently small so that the solution exists on [t , t  q) . We get from definition (A.8) and equation (4.1): V (t  q )  sup x(t  q  a )   A a  0  sup q  A s  q  x(t  s)  max sup  q  A s  0  x(t  s), sup x(t  s)  0 s  q  A   maxV (t ), sup   (a) x(t  s  a )da      0 s  q 0      A   maxV (t ), sup   (a ) x(t  s  a)da   (a ) x(t  s  a )da      0 s  q 0      (A.9) A         maxV (t ), sup sup x(t  l )   (a )da  sup x(t  l )   (a )da       0 s  q s  Al  s  s  l  s  0      A      max V (t ), sup x(t  l )   (a)da  sup x(t  l )   (a )da     Al  q   l  q  0     A Using the fact that L :   (a)da  1 and assuming that q  min( , A   ) , we obtain from (A.9): 0 V (t  q)  maxV (t ), V (t )L  c   cV (t  q) 37 (A.10)  A 0 0 Using the fact that   0 is a constant with c :   (a)da  1 and the fact that L :   (a)da  1 , we distinguish the following cases: (i) V (t )  V (t )L  c   cV (t  q) and in this case (A.10) implies that  Lc V (t  q)   V (t ) ,  1 c  (ii) V (t )  V (t )L  c   cV (t  q) and in this case (A.10) implies that V (t  q)  V (t ) . Therefore, in any case we get:  Lc  V (t  q)  max V (t ) , V (t )   1 c  (A.11) Similarly, we get from definition (A.8), equation (4.1) and the fact that q  min( , A   ) : W (t  q)  inf  A a  0  inf q  A s  q x(t  q  a)  x(t  s)  min   inf x(t  s ) , inf x(t  s )  0 s  q  q  A s  0   A     min W (t ), inf   (a ) x(t  s  a )da     0  s  q   0      A   min W (t ), inf   (a ) x(t  s  a )da   (a ) x(t  s  a )da    0 s  q  0      (A.12) A        min W (t ), inf  inf x(t  l )   (a )da  inf x(t  l )   (a)da    0 s  q s  Al  s  s  l  s   0         min W (t ), ( L  c) inf x(t  l )   c inf x(t  l )   Al  q   l  q    min W (t ), W (t )L  c   cW (t  q )   A 0 0 Using the fact that   0 is a constant with c :   (a)da  1 and the fact that L :   (a)da  1 , we obtain (again by distinguishing cases) from (A.12):    Lc W (t  q)  min W (t ) ,  W (t )   1 c    (A.13) It follows from (A.11) and (A.13) that the solution of (4.1) is bounded on [t , t  q) for q  min( , A   ) . A standard contradiction argument in conjunction with Theorem 2.1 in [16] implies that the solution exists for all t  0 . Indeed, a finite maximal existence time t max   for the solution in conjunction with Theorem 2.1 in [16] would imply that lim sup V (t )   or  t  t max lim inf W (t )   . Using induction and (A.11), (A.13), we are in a position to show that:  t t max i i      Lc   Lc  min W (0) ,   W (0)   W (ih)  V (ih)  maxV (0) ,   V (0)       1 c   1 c        (A.14) for all integers 0  i  h 1t max , where h  min( , A   ) . Moreover, using the fact that L  1 , (A.14), (A.11) and (A.13) with t  h h 1t max for the case t max  h h 1t max or t  t max  h for the case t max  h h 1t max and arbitrary q  0 , t max  t   0, h , we get       1 h 1t max  1 h 1t max       Lc  Lc    min W (0) ,  W (0)   sup W (t )  sup V (t )  maxV (0) ,  V (0)      0t t max   0t t max  1 c   1 c      38 which contradicts the assertion that lim sup V (t )   or lim inf W (t )   .  t t max  t  t max Inequality (4.2) is a direct consequence of definitions (A.8), the fact that L  1 and inequalities (A.11), (A.13), (A.14). The proof is complete.  A Proof of Corollary 4.2: Since (4.1) holds and since 1    (a)da , we get: 0 A x(t )  P( x 0 )   (a)x(t  a)  P( x 0 ) da , for all t  0  (A.15) 0 ~ Let K ,   0 be the constants involved in (4.5). Using (4.5) and (A.15), we get for all t  0 : A A ~ x(t )  P( x 0 )  max  (a)  x(t  a)  P( x 0 ) da  max  (a) K exp  t  x(a) da 0 a  A   0 a  A 0 (A.16) 0 It follows from (A.16) that the following estimate holds for all t  A : ~ max  x(t   )  P( x 0 )   max  (a)K exp  (t  A)A max  x 0 (a)   A 0 0 a  A  A a 0 (A.17) When 0  t  A , we get from (A.16): A   ~ max  x(t   )  P( x 0 )   max  x( s)  P( x 0 )   max max  (a) K exp  s  x(a)da   t   0 0 s t 0 s t  0 a  A 0    A ~ ~  max  (a) K x 0 (a)da  max  (a) KA max  x 0 (a)  0 a  A  0 a  A  A a  0 0 Moreover, using definition (4.4) and the fact that P( x 0 )  max  x 0 (a)   A a  0 A  r :  a (a)da    0   1 (which imply that for all x0  C 0 [ A,0];  ), we get for 0  t  A :  x(t   )  P( x 0 )   t max  x(s)  P( x 0 )   max  x( s )  P( x 0 )  A s  0 A s  0  max  x 0 ( s )  P( x 0 )   max  x 0 ( s )  P( x 0 )   max  x 0 ( s )   P( x 0 )  2 max  x 0 (a )   A s  0  A s  0  A s  0  A a  0 max  A  t The two above inequalities give for 0  t  A : max  x(t   )  P( x 0 )   max max  x(t   )  P( x 0 ) , max  x(t   )  P( x 0 )    A  t  t  0  ~ ~  max max  (a) KA , 2  max  x 0 (a)   exp  (t  A)  max max  (a) KA , 2  max  x 0 (a)   0 a  A   A a  0  0 a  A   A a  0  A  0 (A.18) Combining (A.17) and (A.18), we conclude that estimate (4.6) holds with    ~ M  exp A max max  (a)KA , 2  . The proof is complete.  0 a  A  39  and Proof of Lemma 4.3: Notice that since x  C 0 ([ A,); ) , it follows that the mapping    t  V ( xt ) is continuous. We have for all t, h  0 with h  A : V ( x t  h )  max exp(  a) x(t  h  a )   a[ 0, A] max t  h  A s  t  h exp( (t  h  s)) x(s)   max max exp(  (t  h  s )) x( s ) , max exp(  (t  h  s )) x( s )  t  s t  h  t  h  A s  t  (A.19)  exp( h) max max exp(  a) x(t  a ) , max exp(  (t  s )) x( s )  t  s t  h  0 a  A h   exp( h) maxV ( x t ) , max exp(  (t  s )) x( s )  t  s t  h   Using (4.1) and (A.19) we obtain: A      exp( (t  h))V ( x t  h )  max exp( t )V ( x t ) , max  exp( s )  (a) x( s  a)da   t  s  t  h     0     A     max exp( t )V ( x t ) ,  (a) exp(a)da max  exp( s ) max exp(  a) x( s  a)    t  s  t  h 0 a  A  0    (A.20) A    max exp( t )V ( x t ) ,  (a) exp(a)da max exp( s )V ( x s )    t  s t  h 0   Consequently, we obtain from (A.20) for all t, h  0 with h  A :  A   max exp( s )V ( x s )   max exp( t )V ( x t ) ,  (a ) exp( a )da max exp( s )V ( x s )    t  s t  h t  s t  h 0    (A.21) A Since   (a) exp(a)da  1 , we obtain from (A.21) for all t, h  0 with h  A : 0 max exp( s)V ( x s )   exp( t )V ( xt ) (A.22) t  s t  h Indeed, the proof of (A.22) follows A exp( t )V ( xt )   (a) exp( a)da max exp( s)V ( x s )  ,  t  s t  h from distinguishing the cases (i) A and (ii) exp( t )V ( xt )    (a) exp( a)da max exp( s)V ( x s ) . t  s t  h 0 0 A Case (ii) leads to a contradiction, since in this case (A.21) in conjunction with max exp( s)V ( x s )   0 , implies t  s t  h   (a) exp(a)da  1 0 which contradicts the assumption A exp( t )V ( xt )   (a) exp( a)da max exp( s)V ( x s )  .  t  s t  h Therefore, we obtain from (A.22) for all t, h  0 with 0 h A: V ( xt  h )  exp( h)V ( xt ) (A.23) It follows from (A.23) for all t  0 and h (0, A) : h 1 V ( xt  h )  V ( xt )  h 1 exp( h)  1V ( xt ) Letting h 0  and using (A.24), we obtain (4.7). The proof is complete. (A.24)  Proof of Theorem 4.4: Notice that since x  C 0 ([ A,); ) , it follows that the mappings    t  V ( xt ) ,    t  P( xt ) are continuous. Moreover, definition (4.4) implies that 40 A A   0 a t P( xt )  r x(t  a)  ( s)dsda  r  A  x( w)  ( s)dsdw tA t w It follows from Leibniz’s rule that the mapping (0,)  t  P( xt ) is continuously differentiable and its derivative satisfies d P( x t )  rx (t )  r dt A   x( w) (t  w)dw  r  x(t )  x(t  a ) (a )da  ,   tA 0   t   for all t  0 A Notice that for the derivation of the above equality we have used the fact that   (a)da  1 . Using 0 (4.1) we can conclude that (4.9) holds. Next, define y(t )  x(t )  P( x 0 ) , for all t   A (A.25) A Using (4.1), definition (A.25) and the fact that   (a)da  1 , we obtain: 0 A  y(t )   (a) y(t  a)da , for all t  0 (A.26) 0 Moreover, it follows from definition (4.4) and (4.9) that: A A   0 a 0  P( x t )  P( x 0 )  r x(t  a)  ( s)dsda  P( x 0 ) , for all t  0 AA A 0 a 0 (A.27) Since r    ( s)dsda  r  a (a)da  1 , we obtain from (A.25) and (A.27): A 0  0  A  y (t  a ) r  ( s )ds da ,    a   for all t  0 (A.28) Combining (A.26) and (A.28), we get: A y (t )   0 A   y (t  a )  (a )   r  ( s )ds da ,   a    A where   0 is the real number for which  for all t  0 (A.29) A   (a )  r  ( s )ds da  1 . Therefore, we are in a position to 0 a apply Lemma 4.3 for the solution of (A.29). More specifically, we get:   lim sup h 1 W ( y t  h )  W ( y t )    W ( y t ) , h0  where W ( y t ) : max exp( a) y(t  a)  a[ 0, A] A A 0 a  0 and is for all t  0 a real (A.30) number for which   (a)  r   (s)ds exp(a)da  1 . Finally, we notice that definitions (4.8), (A.25) and equality (4.9) imply the following equalities: V ( x t )  max exp( a) x(t  a)  P( x t )   max exp( a) x(t  a)  P( x 0 )  a[ 0, A]  max exp( a) y (t  a)   W ( y t ) a[ 0, A] (A.31) a[ 0, A] The differential inequality (4.10) is a direct consequence of equation (A.31) and inequality (A.30). The proof is complete.  Proof of Corollary 4.6: Working as in the proof of Theorem 4.4, we show that (4.14) holds. Since C : S   [ ,) is a continuous functional and x  C 0 ([ A,); ) , it follows that the mappings 41    t  C ( xt ) ,    t  W ( xt ) are continuous. Applying Theorem 4.4 and taking into account the fact that P( xt )  0 for all t  0 , we obtain:   lim sup h 1 W ( x t  h )  W ( x t )    W ( x t ) , h 0  for all t  0 (A.32) Let x(t )   be a solution of (4.1). The differential inequalities (4.12), (A.32) imply that the mappings are non-increasing. Consequently, we get t  C ( xt ) , t  W ( xt ) C ( xt  h )b(W ( xt  h ))  C ( xt )b(W ( xt  h )) for all h  0 , which implies h 1 C( xt h )b(W ( xt h ))  C( xt )b(W ( xt ))  h 1C( xt )b(W ( xt h ))  b(W ( xt )) , for all h  0 By virtue of the mean value theorem, we obtain the existence of s  (0,1) such that b(W ( xt  h ))  b(W ( xt ))  W ( xt  h )  W ( xt )b sW ( xt )  (1  s)W ( xt  h ) . Using the fact that the mapping t  W ( xt ) is non-increasing and combining the above relations, we obtain h 1 C ( x t  h )b(W ( x t  h ))  C ( x t )b(W ( x t ))  C ( x t )h 1 W ( x t  h )  W ( x t )  min b sW ( x t )  (1  s )W ( x t  h )  (A.33) s[ 0,1] for all sufficiently small h  0 . The differential inequality (4.13) is a direct consequence of inequalities (A.32), (A.33) and the fact that the mapping t  W ( xt ) is continuous. The proof is complete.  Proof of Lemma 5.1: By virtue of Remark 4.7 and Corollary 4.6, for every  0  S the solution of A ~ the IDE  (t )   k (a) (t  a)da exists for all t  0 , is unique and satisfies  t  S for all t  0 . More 0 specifically, using Lemma 4.1, we can guarantee that the solution  t  C 0 ([ A,); (1,)) of the A ~ IDE  (t )   k (a) (t  a)da satisfies 0 inf  (t )   min  0 ( s)   1 , for all t  0 t  A ~ Indeed, since k  C 0 0, A;    with A (A.34)  A s 0 ~  k (a)da  1 , it follows that all assumptions of Lemma 4.1 hold. 0 Therefore, we get from (4.2) with L 1 and arbitrary c  (0,1) that the inequality inf  0 (a)  inf  (t  a)  sup  (t  a)  sup  0 (a)  A a 0  A a 0  A a 0  A a 0 holds for all t  0 . Inequality (A.34) is a direct consequence of continuity of  0  S and the above inequality. A Given the facts that g  C 0 ([0, A];) satisfies g (a)  0 for all a [0, A] with  g (a)da  1 and that the 0 A ~ solution  t  C 0 ([ A,); (1,)) of the IDE  (t )   k (a) (t  a)da satisfies (A.34), we are in a 0 position to guarantee that the mapping    t  v(t )   defined by 42  A  v (t )  ln 1  g (a ) (t  a ) da  ,    0   for all t  0 (A.35) is well-defined and is a continuous mapping. It follows that for every z 0   2 ,  0   the solution of the system of differential equations (t )  D   sat z 2 (t )    (t )   v(t ) , z1 (t )  z 2 (t )  sat z 2 (t )    (t )   v(t )  l1 z1 (t )  (t )  v(t ) , z 2 (t )  l 2 z1 (t )  (t )  v(t ) exists locally and is unique. Moreover, due to the fact that the right hand side of the differential equations satisfies a linear growth condition, it follows that the solution ( z(t ), (t ))   2   of the system of differential equations (t )  D   sat z 2 (t )    (t )   v(t ) , z1 (t )  z 2 (t )  sat z 2 (t )    (t )   v(t )  l1 z1 (t )  (t )  v(t ) , z 2 (t )  l 2 z1 (t )  (t )  v(t ) exists for all t  0 . Due to definition (A.35) and equations (5.6), (5.8), we are in a position to conclude that the constructed mappings coincide with a solution ( z(t ), (t ), t )   2    S of the closed-loop system (5.5) with (5.7), (5.8) with initial condition z 0   2 , ( 0 , 0 )    S . Uniqueness of solution of the closed-loop system (5.5) with (5.7), (5.8) is a direct consequence of the above procedure of the construction of the solution. Define e1 (t )  z1 (t )   (t ) e 2 (t )  z 2 (t )  D  , for all t  0 (A.36) and notice that equations (5.5), (5.6), (5.7), (A.35) and definition (A.36) allow us to conclude that the following differential equations hold for all t  0 :   d 2 e1 (t )  p1e1 (t )e 2 (t )  p 2 e 22 (t )  (2l1  l 2 p1 )e12 (t )  2  l1 p1  2 p 2 l 2 e1 (t )e 2 (t )  p1e 22 (t ) dt  2l1  p1l 2 e1 (t )  2 p 2 l 2  p1l1 e 2 (t ) v(t ) e1 (t )  e 2 (t )  l1 e1 (t )  l1 v(t ) e 2 (t )  l 2 e1 (t )  l 2 v(t ) (A.37) (A.38) Since the inequalities l1 , l 2  0 , p1 , p 2  0 , 2  l1 p1  2l2 p2 2  8l1 p1  4l2 p12 , p12  4 p 2 hold, it follows that the quadratic forms A(e) : e12  p1e1e2  p 2 e22 , B(e) : (2l1  l 2 p1 )e12  2  l1 p1  2 p 2 l 2 e1e2  p1e22 are positive definite (recall Remark 2.2(vi)). It follows that there exist constants K 2  K1  0 , K 4  K 3  0 such that 2 2 K1 e  A(e)  e12  p1e1e 2  p 2 e 22  K 2 e , for all e   2 (A.39) K 3 e  B(e)  (2l1  l 2 p1 )e12  2  l1 p1  2 p 2 l 2 e1e 2  p1e 22  K 4 e , for all e   2 (A.40) 2 Using (A.37), 2l1  p1l 2 e1  2 p 2 l 2  p1l1 e 2 v  2 (A.39), (A.40) and K 3 2 2l1  p1l 2   2 p 2 l 2  p1l1  2 e  v 2 2K 3 2 the inequality 2 (which holds for all e   2 and v   ), we conclude that there exist constants , c  0 such that the following differential inequality holds for all t  0 :     d 2 2 e1 (t )  p1e1 (t )e 2 (t )  p 2 e 22 (t )  2 e12 (t )  p1e1 (t )e 2 (t )  p 2 e 22 (t )  c v(t ) dt 43 (A.41) ~ Since k  C 0 ([0, A];  ) satisfies assumption (H1) and since the mapping t  g1 ( t ) is nonA ~ decreasing for every solution of the IDE  (t )   k (a) (t  a)da , where g1 is the continuous g 1 ( ) : min  ( a )  functional a[ 0, A]    t  C ( t ) : 1  min  0, min  t (a)    a[0, A]   0 (recall Remark 4.7), it follows that the mapping 2 is non-increasing. Using Remark 4.7 and Corollary 4.6 with b(s)  Ms 2 / 2 , where M  0 is an arbitrary constant, we conclude that      M lim sup h 1 h 0    2     2      max exp( a) t  h (a)    max exp( a ) t (a)   M a  [ 0 , A ] a  [ 0 , A ]       2       t  h (a)   t (a)   1  min  0, amin  1  min  0, amin [ 0 , A] [ 0, A]          max exp( a) t (a)   a  [ 0 , A ]   M      t (a)   1  min  0, amin [ 0 , A]    A  A ~ ~ k (a )  r k ( s )ds da  1  0 a Since ln(1  x)  x 1  min( x,0) (A.42)  A ~ ~ k (a )  r k ( s )ds exp(a )da  1 ,   0  0 A        , for all t  0 2 where   0 is a real number for which which 2  is a real number for a A ~  0  1 and r :   ak (a)da  . for all x  1 and using the facts that g (a)  0 for all a [0, A] and A  g (a)da  1 , we obtain from (A.35): 0 v(t )  exp(A) max  t (a) exp(  a)  a[ 0, A]   1  min  0, min  t (a)   a[0, A]  , for all t  0 (A.43) Using (A.41), (A.42), (A.43) we obtain the following differential inequality   ~ ~ lim sup h 1 Q (e(t  h), t  h )  Q (e(t ), t ) h 0   2    max exp( a) t (a)   , for all t  0 a  [ 0 , A ] 2 2   2 e1 (t )  p1e1 (t )e2 (t )  p2e2 (t )  M  c exp(2A)      t (a)   1  min  0, amin [ 0, A]      (A.44) where    max exp( a) (a)   ~ M a[0, A]  Q (e, ) : e12  p1e1e2  p2e22   2     (a)   1  min  0, amin [ 0 , A]    2 (A.45) Selecting M   1c exp(2A) , we obtain from (A.44) and definition (A.45):    ~ ~ ~ lim sup h1 Q(e(t  h), t  h )  Q(e(t ), t )  2~ Q(e(t ), t ) , for all t  0 h 0   M  c exp( 2A)  where ~  min   , .  2M  44 (A.46) ~ ~ Suppose that Q(e(t ), t )  0 . Since the mapping t  Q(e(t ), t ) is continuous, it follows that ~ Q(e(t  h), t h ) for all sufficiently small h  0 . The differential inequality (A.46) implies that the ~ mapping t  Q(e(t ), t ) is non-increasing. Consequently, by virtue of the mean value theorem, we obtain: ~ ~ Q(e(t  h), t  h ))  Q(e(t ), t )) ~ ~ h 1  Q(e(t  h), t  h ))  Q(e(t ), t ))   ~   2h Q(e(t ), )) (A.47) t for all sufficiently small h  0 . Therefore, using (A.46), (A.47), we obtain the differential inequality ~ ~ ~   lim sup h1 Q(e(t  h), t  h )  Q(e(t ), t )     ~ Q(e(t ), t )     h 0 (A.48) ~ for all t  0 with Q(e(t ), t )  0 . On the other hand, using (A.39) and (A.45), we are in a position to ~ conclude that e(t )  0 ,  t  0 when Q(e(t ), t )  0 . In this case and using (5.5), we conclude that A  ~  t h  0 for all h  0 (the unique solution of  (t )  k (a) (t  a)da ). Therefore, in this case (A.35) 0 implies that v(t  h)  0 for all h  0 . Finally, (A.38) and the facts that e(t )  0 and v(t  h)  0 for all ~ h  0 , imply that e(t  h)  0 for all h  0 , when Q(e(t ), t )  0 . Definition (A.45) allows us to ~ ~ conclude that Q(e(t  h), t h )  0 for all h  0 , when Q(e(t ), t )  0 . Therefore, the differential inequality (A.48) holds for all t  0 . Finally, using (5.2), (5.5), (5.6), (5.8), (A.35), (A.36) we get for all t  0 :     d 2  (t )  2 (t ) D   sat z 2 (t )    (t )   v(t )   2 (t )qe 2 (t )    (t )   v(t )  dt (A.49) We distinguish the following cases:   2 2 -Case 1: e2 (t )   v(t )   (t ) and  (t )  0 . In this case, we have  (t )  e 2 (t )   v(t )    (t )  3  (t ) . 2 Using the fact that the function q defined by (5.1) is non-decreasing and the previous inequality we   d 2    (t )  2 (t )q  (t )  . dt 2  obtain from (A.49) that  -Case 2: e2 (t )   v(t )   (t ) and  (t )  0 . In this case, we have 2 3   (t )  e 2 (t )   v(t )    (t )   (t ) . 2 2 Using the fact that the function q defined by (5.1) is non-decreasing and the previous inequality we obtain from (A.49) that -Case 3:   d 2    (t )  2 (t )q  (t )  . dt 2   e2 (t )   v(t )   2  (t ) .  qe 2 (t )    (t )   v(t )   max Dmax  D  , D   Dmin Inequality     d 2    (t )  2 (t )q  (t )   4  (t ) max D max  D  , D   D min dt 2   8  e 2 (t )   v(t ) max D max  D  , D   D min    Combining all the above three cases, we conclude that 45 implies that   q  (t )   max D max  D  , D   Dmin 2   and Consequently, we obtain from (A.49) that  (5.3)  .   d 2    (t )  2 (t )q  (t )   R e 2 (t )   v(t ) dt 2   , for all t  0 (A.50) where R : 8 1 maxDmax  D  , D   Dmin  . Combining (A.46), (A.48) with (A.50) and using the triangle inequality, we obtain for every G,   0 : ~ ~ ~ ~   lim sup h 1 2 (t  h)  G Q (e(t  h), t  h )   Q (e(t  h), t  h )   2 (t )  G Q (e(t ), t )   Q (e(t ), t )       h 0 ~ ~    2 (t )q  (t )   R e2 (t )  R v(t )  ~G Q (e(t ), t )  2 ~ Q (e(t ), t ) 2   for all t  0 , (A.51) Using (A.39), (A.43) and definition (A.45), we obtain:   ~ M max K1 e2 (t ) , exp(A) v(t )   Q(e(t ), t ) , for all t  0   2   (A.52) Using (A.51) and (A.52), we obtain for every G,   0 : ~ ~ ~ ~   lim sup h 1 2 (t  h)  G Q (e(t  h), t  h )   Q (e(t  h), t  h )   2 (t )  G Q (e(t ), t )   Q (e(t ), t )       h 0  ~ ~ R R 2     2 (t )q  (t )    ~G   exp(A)  Q(e(t ), t )  2~ Q (e(t ), t )   2 K M    1  , for all t  0 (A.53) Therefore, we obtain from (A.53), (5.4) and definitions (5.10), (5.11), (A.36), (A.45) for R R 2 G ~  ~ exp(A)  K1  M the differential inequality  R R 2 L : min  ~   exp(A), min 2,  min 1, Dmax  D , D  Dmin  G K G M 1   (5.9)  . The proof is complete. with   Proof of Lemma 5.2: First we notice that the differential inequality (5.12) shows that  :      is non-increasing. We also make the following claim. Claim:  (t )  1 for all t  T , where T  2L1 max0,  (0)  1 . If  (0)  1 then the claim holds by virtue of the fact that  :      is non-increasing. If  (0)  1 then the proof of the claim is made by contradiction. Suppose that there exists t  T with  (t )  1 . Since  :      is non-increasing, it follows that  ( )  1 for all   [0, t ] . Consequently, we obtain from (5.12):   lim sup h 1  (  h)   ( )    L h 0   ( ) 1   ( )  L , for all   [0, t ] 2 (A.54) L 2 Using the Comparison Lemma on page 85 in [19] and (A.54), we obtain  ( )   (0)   for all   [0, t ] . Since  (T )   (0)  L T  1 , we obtain a contradiction. 2 Since  (t )  1 for all t  T , we obtain from (5.12): 46   lim sup h 1  (t  h)   (t )    h0  L  (t ) , 2 for all t  T (A.55) Using the Comparison Lemma on page 85 in [19] and (A.55), we obtain  (t )   (T ) exp  (t  T )  L  2  for all t  T . Using the fact that T  2L max0,  (0)  1 (which implies the fact that T  0 when  (0)  1 and  (T )  1 when  (0)  1 ), we obtain the estimate (5.13) for all t  T . Since  :      is non-increasing and satisfies  (t )   (0) for all t [0, T ] , we conclude that (5.13) holds for all t  0 . The proof is complete.  1 Proof of Lemma 5.3: By virtue of Remark 4.7 and Corollary 4.6, for every  0  S the solution of A ~ the IDE  (t )   k (a) (t  a)da exists for all t  0 , is unique and satisfies  t  S for all t  0 . More 0 specifically, using Lemma 4.1, we can guarantee that the solution  t  C 0 ([ A,); (1,)) of the A ~ IDE  (t )   k (a) (t  a)da satisfies (A.34). Working as in the proof of Theorem 4.4, we can also 0 show that P( t )  0 , for all t  0 (A.56) A Given the facts that g  C 0 ([0, A];) satisfies g (a)  0 for all a [0, A] with  g (a)da  1 and that the 0 A ~ solution  t  C 0 ([ A,); (1,)) of the IDE  (t )   k (a) (t  a)da satisfies (A.34), we are in a 0 position to guarantee that the mapping    t  v(t )   defined by (A.35) is well-defined and is a continuous mapping. It follows that for every  0   the solution of the differential equation (t )  D   sat D   T 1 (iT )  T 1v(iT ) , for all integers i  0 and t  [iT , (i  1)T ) with initial condition  (0)   0 exists locally and is unique. Moreover, due to the fact that the right hand side of the differential equation is bounded, it follows that the solution  (t )   of the differential equation (t )  D   sat D   T 1 (iT )  T 1v(iT ) , for all integers i  0 and t  [iT , (i  1)T ) with initial condition  (0)   0 exists for all t  0 . Due to definition (A.35) and equations (5.6), (5.34), we are in a position to conclude that the constructed mappings coincide with a solution ( (t ), t )    S of the closedloop system (5.5), (5.6) with (5.34) with initial condition ( 0 , 0 )    S . Uniqueness of solution of the closed-loop system (5.5), (5.6) with (5.34) is a direct consequence of the above procedure of the construction of the solution. ~ Using Corollary 4.2 with  (a)  k (a) for all a [0, A] , we conclude that there exist constants M ,   0 such that for every  0  S with (G 0 )  PC1 [0, A];  , the unique solution of the IDE A  ~  (t )  k (a) (t  a)da with initial condition  (a)   0 (a) , for all a [0, A] satisfies the following 0 estimate for all t  0 : max  (t   )   M exp  t  max  0 (a)   A  0  A a  0 (A.57) It follows from (5.5), (5.6), (A.35) and (5.34) that the following equation holds for all integers i  0 and t  [iT , (i  1)T ] :  (t )   (iT )  ( Di  D  )(t  iT ) 47 (A.58) where   Di  sat D   T 1 (iT )  T 1v(iT ) , for all integers i  0 (A.59) We next show the following claim. Claim 1: The following inequality holds for all integers i  0 :  ((i  1)T )   (iT )  min  (iT ) ,2   2 v(iT ) (A.60) where  : min ( Dmax  D )T , ( D  Dmin )T   0 . 1 2 Proof of Claim 1: We distinguish the following cases. Case 1: Dmin  D   T 1 (iT )  T 1v(iT )  Dmax . Definition (A.59) implies that Di  D   T 1 (iT )  T 1v(iT ) . Using (A.58), we get  ((i  1)T )  v(iT ) , which directly implies (A.60). Case 2: D   T 1 (iT )  T 1v(iT )  Dmin . Definition (A.59) implies that Di  Dmin . Using (A.58), we get  ((i  1)T )   (iT )  ( Dmin  D  )T . The inequality D   T 1 (iT )  T 1v(iT )  Dmin implies that  ( Dmin  D  )T  (iT )  v(iT )  0 . Thus, we get:  ((i  1)T )   (iT )  ( D min  D  )T  v(iT )  v(iT )   (iT )  ( D min  D  )T  v(iT )  v(iT )   (iT )  ( D min  D  )T  v(iT )  v(iT )   (iT )  ( D   D min )T  2 v(iT ) The above inequality in conjunction with the fact that  : min ( Dmax  D )T , ( D  Dmin )T   0 implies 1 2 that (A.60) holds. Case 3: D   T 1 (iT )  T 1v(iT )  Dmax . Definition (A.59) implies that Di  Dmax . Using (A.58) we get  ((i  1)T )   (iT )  ( Dmax  D  )T . The inequality D   T 1 (iT )  T 1v(iT )  Dmax implies that  ( Dmax  D  )T  (iT )  v(iT )  0 . Thus, we get:  ((i  1)T )   (iT )  ( D max  D  )T  v(iT )  v(iT )   (iT )  ( D max  D  )T  v(iT )  v(iT )   (iT )  ( D max  D  )T  v(iT )  v(iT )   (iT )  ( D max  D  )T  2 v(iT ) The above inequality in conjunction with the fact that  : min ( Dmax  D )T , ( D  Dmin )T   0 implies 1 2 that (A.60) holds. The proof of Claim 1 is complete.  48 Claim 2: The following inequalities hold for all integers i  0 :    (iT )  max0,   iD   D T  max max(0,v(kT ))  (iT )  min 0,  0  i D   Dmin T  min min( 0,v(kT )) 0 k 0,...,i  max (A.61) k 0,...,i Proof of Claim 2: The proof of inequalities (A.61) is made by induction. First notice that both inequalities (A.61) hold for i  0 . Next assume that inequalities (A.61) hold for certain integer i  0 . We distinguish the following cases. Case 1: Dmin  D   T 1 (iT )  T 1v(iT )  Dmax . Definition (A.59) implies that Di  D   T 1 (iT )  T 1v(iT ) . Using (A.58), we get  ((i  1)T )  v(iT ) . Consequently, we get:  ((i  1)T )  v(iT )  max(0,v(iT ))  max max(0,v(kT ))   k  0,...,i 1  max 0,  0  (i  1)(Dmax  D )T  max max(0,v(kT ))  k  0,...,i 1 which directly implies the second inequality (A.61) with i  1 in place of i  0 . Similarly, we obtain the first inequality (A.61) with i  1 in place of i  0 . Case 2: D   T 1 (iT )  T 1v(iT )  Dmin . Definition (A.59) implies that Di  Dmin . Using (A.58) we get  ((i  1)T )   (iT )  ( Dmin  D  )T . Consequently, we get from (A.61):  ((i  1)T )   (iT )  ( D   D min )T    min ( D  D )T ,   (i  1)( D  D  min 0,   (i  1)( D  D )T   min  min 0,  0  i ( D   D min )T  ( D   D min )T  min min( 0,v(kT ))   min min )T 0  0 min k  0,...,i  min min( 0,v(kT )) k  0,...,i 1 min( 0,v(kT )) k  0,...,i 1 which is the first inequality (A.61) with i  1 in place of i  0 . Furthermore, the inequality D   T 1 (iT )  T 1v(iT )  Dmin implies that  ( Dmin  D  )T   (iT )  v(iT ) . Consequently, we get:  ((i  1)T )   (iT )  ( D   Dmin )T  v(iT )  max(0,v(iT ))  max max(0,v(kT ))   k 0,...,i 1  max 0,  0  (i  1)(Dmax  D )T  max max(0,v(kT ))  k 0,...,i 1 which is the second inequality (A.61) with i  1 in place of i  0 . Case 3: D   T 1 (iT )  T 1v(iT )  Dmax . Definition (A.59) implies that Di  Dmax . Using (A.58) we get  ((i  1)T )   (iT )  ( Dmax  D  )T . Consequently, we get from (A.61): 49  ((i  1)T )   (iT )  ( D max  D  )T    max  ( D  D )T ,   (i  1)( D  D )T   max max(0,v(kT ))  max 0,   (i  1)( D  D )T   max max(0,v(kT ))  max 0,  0  i ( D max  D  )T  ( D max  D  )T  max max(0,v(kT )) k  0,...,i   max 0 max k  0,...,i 1  0 max k  0,...,i 1 which is the second inequality (A.61) with i  1 in place of i  0 . Furthermore, the inequality D   T 1 (iT )  T 1v(iT )  Dmax implies that  ( Dmax  D  )T  (iT )  v(iT ) . Consequently, we get:  ((i  1)T )   (iT )  ( Dmax  D  )T  v(iT )  min( 0,v(iT ))  min   min( 0,v(kT )) k  0,...,i 1 min( 0,v(kT ))  min 0,  0  (i  1)(D   Dmin )T  min k 0,...,i 1 which is the first inequality (A.61) with i  1 in place of i  0 . The proof of Claim 2 is complete.  We next show the following claim. Claim 3: The following inequalities hold for all t  0 : min 0,  0   2 min min( 0,v(kT ))   (t )  max0, 0   2 k  0,...,[t / T ] max max(0,v(kT )) k  0,...,[t / T ]  (t )   [t / T ]T   v[t / T ]T  (A.62) (A.63) Proof of Claim 3: Let arbitrary t  0 and define i  [t / T ] . Notice that the definition i  [t / T ] implies the inclusion t  [iT , (i  1)T ) . We distinguish the following cases. Case 1: Dmin  D   T 1 (iT )  T 1v(iT )  Dmax . Definition (A.59) implies that Di  D   T 1 (iT )  T 1v(iT ) . Using (A.58), we get for all s  [iT , (i  1)T ] :    (s)  1  (s  iT )T 1  (iT )  (s  iT )T 1v(iT ) The above equality in conjunction with the facts that 0  1  (s  iT )T 1  1 , 0  (s  iT )T 1  1 and inequality (A.61) gives estimates (A.62), (A.63). More specifically, the above inequality in conjunction with the facts that 0  1  (s  iT )T 1  1 , 0  (s  iT )T 1  1 implies for all s [iT , (i  1)T ]    ( s)  1  ( s  iT )T 1  (iT )  ( s  iT )T 1 v(iT )   (iT )  v(iT ) and since t  [iT , (i  1)T ) , the above inequality shows that (A.63) holds in this case. Moreover, the equation  (s)  1  (s  iT )T 1  (iT )  (s  iT )T 1v(iT ) gives for all s [iT , (i  1)T ]    (s)  1  (s  iT )T 1 max0, (iT )  (s  iT )T 1 max0,v(iT ) which in conjunction with the facts that 0  1  (s  iT )T 1  1 , 0  (s  iT )T 1  1 implies for all s  [iT , (i  1)T ]  (s)  max0, (iT )  max0,v(iT ) On the other hand, inequality (A.61) gives 50    max0,  (iT )   max 0,  0  i Dmax  D  T  max max(0,v(kT ))  max0,  0   max max(0,v(kT )) k  0,...,i k  0,...,i Combining the two above inequalities, we get for all s [iT , (i  1)T ]  ( s)  max0,  0   2 max max(0,v(kT )) k  0,...,i and since t  [iT , (i  1)T ) , the above inequality shows that the right inequality (A.62) holds in this case. The left inequality (A.62) is proved in the same way. Case 2: D   T 1 (iT )  T 1v(iT )  Dmin . Definition (A.59) implies that Di  Dmin . Using (A.58) we get  (s)   (iT )  ( Dmin  D  )(s  iT ) for all s  [iT , (i  1)T ] . Therefore, we get for all s  [iT , (i  1)T ]  (s)   (iT ) which combined with (A.61) gives for all s [iT , (i  1)T ]     ( s)  min 0,  0  i D   Dmin T  min min( 0,v(kT )) k  0,...,i  min 0,  0   min min( 0,v(kT )) k  0,...,i  min 0,  0   2 min min( 0,v(kT )) k  0,...,i Since t  [iT , (i  1)T ) , the above inequality shows that the left inequality (A.62) holds in this case. Furthermore, the inequality D   T 1 (iT )  T 1v(iT )  Dmin implies that  ( Dmin  D  )T  (iT )  v(iT ) . Since  (s)   (iT )  ( Dmin  D  )(s  iT ) for all s [iT , (i  1)T ] , we get for all s [iT , (i  1)T ] :     ( s)   (iT )  ( Dmin  D  )(s  iT )  1  ( s  iT )T 1  (iT )  ( s  iT )T 1  (iT )  ( Dmin  D  )T    1  ( s  iT )T max0,  (iT )   ( s  iT )T   1  ( s  iT )T 1  (iT )  ( s  iT )T 1v(iT ) 1 1 max0,v(iT )  The above equality in conjunction with (A.61) and the facts that 0  1  (s  iT )T 1  1 , 0  (s  iT )T 1  1 shows that the right inequality (A.62) holds (exactly as in Case 1). Finally, we notice that the following inequalities hold for all s [iT , (i  1)T ]    (iT )   (s)  1  (s  iT )T 1 max0, (iT )  (s  iT )T 1 max0,v(iT ) which combined with the facts that 0  1  (s  iT )T 1  1 , 0  (s  iT )T 1  1 implies for all s  [iT , (i  1)T ]   (iT )  v(iT )   (s)   (iT )  v(iT ) Since t  [iT , (i  1)T ) , the above inequality shows that inequality (A.63) holds in this case. Case 3: D   T 1 (iT )  T 1v(iT )  Dmax . Definition (A.59) implies that Di  Dmax . Using (A.58) we get  (s)   (iT )  ( Dmax  D  )(s  iT ) for all s  [iT , (i  1)T ] . Therefore, we get for all s  [iT , (i  1)T ] 51  (s)   (iT ) which combined with (A.61) gives for all s [iT , (i  1)T ]     ( s)  max 0,  0  i Dmax  D  T  max max(0,v(kT )) k  0,...,i  max0,  0   max max(0,v(kT )) k  0,...,i  max0,  0   2 max max(0,v(kT )) k  0,...,i Since t  [iT , (i  1)T ) , the above inequality shows that the right inequality (A.62) holds in this case. Furthermore, the inequality D   T 1 (iT )  T 1v(iT )  Dmax implies that  ( Dmax  D  )T  (iT )  v(iT ) . Since  (s)   (iT )  ( Dmax  D  )(s  iT ) for all s [iT , (i  1)T ] , we get for all s [iT , (i  1)T ] :  ( s)   (iT )  ( Dmax  D  )(s  iT )     1  ( s  iT )T  (iT )  ( s  iT )T v(iT )  1  ( s  iT )T 1  (iT )  ( s  iT )T 1  (iT )  ( Dmax  D  )T 1  1 The above equality in conjunction with the facts that 0  1  (s  iT )T 1  1 , 0  (s  iT )T 1  1 gives for all s [iT , (i  1)T ] :    (s)  1  (s  iT )T 1 min( 0, (iT ))  ( s  iT )T 1 min( 0,v(iT ))  min( 0, (iT ))  min( 0,v(iT )) On the other hand, inequality (A.61) gives    min( 0,  (iT ))  min 0,  0  i D   Dmin T  min min( 0,v(kT ))  min 0,  0   min min( 0,v(kT )) k  0,...,i k  0,...,i Combining the two above inequalities, we get for all s [iT , (i  1)T ]  ( s)  min 0,  0   2 min min( 0,v(kT )) k  0,...,i and since t  [iT , (i  1)T ) , the above inequality shows that the left inequality (A.62) holds in this case. Finally, we notice that the following inequalities hold for all s [iT , (i  1)T ]    (iT )   (s)  1  (s  iT )T 1 min 0, (iT )  (s  iT )T 1 min 0,v(iT ) which combined with the facts that 0  1  (s  iT )T 1  1 , 0  (s  iT )T 1  1 implies for all s  [iT , (i  1)T ]   (iT )  v(iT )   (s)   (iT )  v(iT ) Since t  [iT , (i  1)T ) , the above inequality shows that inequality (A.63) holds in this case. The proof of Claim 3 is complete.  52 Using (A.34), (A.35), (A.57) and the fact that ln(1  x)  x 1  min( x,0) for all x  1 , we get the estimate for all t  0 : A  A  v(t )  ln 1  g (a) (t  a )da      0    M exp(  t ) max  0 ( s )   g (a) (t  a)da 0  A  1  min  0, g (a ) (t  a)da     0    max  (t  s )   A s  0 1  min  0, min  (t  s )    A s  0  (A.64)  A s  0 1  min  0, min  0 ( s )    A s  0  Let j  0 be an integer with v(kT )   / 2 for all k  j . We next show that the following inequality holds for all i  j : exp ((i  1)T )   1  exp( )exp (iT )   1  exp2 v(iT )   1 (A.65) Indeed, when  (iT )  2 , we get from (A.60) that  ((i  1)T )  2 v(iT ) , which directly implies (A.65). On the other hand, when  (iT )  2 , we get from (A.60) that  ((i  1)T )   (iT )  2  2 v(iT ) . The previous inequality, in conjunction with the fact that v(iT )   / 2 for all i  j gives: exp(  ((i  1)T ) )  1  exp (iT )  2  2 v(iT )   1  exp2 v(iT )   1  exp (iT )  2  2 v(iT )   exp2 v(iT )   exp2 v(iT )   1  exp2 v(iT ) exp (iT )  2   1  exp2 v(iT )   1  exp2 v(iT )  2 exp (iT )   1  1  exp( 2 )   exp2 v(iT )   1  exp2 v(iT )  2 exp (iT )   1  exp2 v(iT )   1  exp  exp (iT )   1 Consequently, (A.65) holds for all i  j . Using (A.65) and induction, we are in a position to prove the following inequality for all i  j : exp (iT )   1  exp  (i  j ) exp ( jT )   1  i 1  exp  (i  1  l )exp2 v(lT )   1 (A.66) l j More specifically, inequality (A.66) follows from the definition of the sequence  i ;  exp (iT )  1 and the fact that inequality (A.65) gives  i 1  exp( )  i  exp2 v(iT )  1 for all i  j . Using i 1 induction, we can prove the formula  i  exp  (i  j )  j   exp  (i  1  l ) exp2 v(lT )   1 for all l j i  j , which directly implies (A.66) for all i  j . Using the fact that x  exp( x)  1  x exp( x) for all x  0 , we obtain from (A.66) and (A.64) the following inequality for all i  j : 53  (iT )  exp  (i  j )  exp ( jT )  ( jT ) i 1  exp2 v(lT ) exp  (i  l ) v(lT ) ~  exp   (i  j ) exp ( jT )  ( jT )  2 exp( ) l j (A.67) 2M exp( ) max  0 ( s )    2M max  0 ( s)   i 1  ~  A  s  0  exp   (i  l ) exp(  lT )  exp       1  min  0, min  0 ( s)   1  min  0, min  0 ( s)   l  j   A s  0    A s  0      A s  0  where   min( ,  T ) . Since    T , it follows that exp  (i  l )exp( lT )  exp  i  for all l  j,...,i  1 and thus we obtain from (A.67) the following inequality for all i  j : ~ ~  ~ ~   (iT )  exp   (i  j ) exp ( jT )  ( jT ) ~ 2M exp( ) max  0 ( s )    2M max  0 ( s )    ~  A  s  0  exp   i  (i  j ) exp       1  min  0, min  0 ( s )   1  min  0, min  0 ( s )     A s  0    A s  0      A s  0 Using (A.62) which implies  (t )   0  2 max  v(kT)  for all k 0,...,[t / T ] obtain:  (t )   0  2M max  0 ( s )   A s  0 1  min  0, min  0 ( s )    A s  0  (A.68) t  0 in conjunction with (A.64), we , for all t  0 (A.69) Notice that (A.68) holds for i  j as well and consequently, (A.68) holds for all i  j . Since j  0 is an integer with v(kT )   / 2 for all k  j , it follows from (A.64) that j  0 may be selected as the smallest integer conjunction with   2M 1 max  0 ( s )   1   A s  0  . The fact that ~  min( ,  T ) that satisfies j  ln T  1  min  0, min  ( s)        A s  0 0   ~ ~ 2 (A.68), (A.69) and the fact that (i  j ) exp   i / 2  i exp   i / 2  ~ exp 1 for      in all integers i  j  0 , we get the following inequality for all i  j :   2M max  0 ( s )     A s  0   (iT )  exp   i / 2 J   0     1  min  0, min  0 ( s)      A s  0    ~  (A.70) where J (s) : sexp( ) 1 max  , s   2 1 exp( 1)exp(s) for all s  0 . Using (A.69) and the fact that ~ ~ j  0 is the smallest integer that satisfies   2M 1 max  0 ( s )   1   A s  0 , j ln T  1  min  0, min  ( s)        A s  0 0   we can guarantee that (A.70) holds for all i  0 . Using (A.63), (A.57), (A.34), (A.70) and the fact that [t / T ]  1  t / T , we ~ ~ obtain (5.35) with  (s) : exp / 2J (1  2M )s   (1  2M )s  and L :  T 1 / 2 . The proof is complete.  54
3cs.SY
Self-triggered Pursuit of a Single Evader with Uncertain Information ⋆ Saad A. Aleem a arXiv:1512.06184v2 [cs.SY] 19 Jan 2016 a Cameron Nowzari a George J. Pappas a Department of Electrical & Systems Engineering, University of Pennsylvania, Philadelphia, PA 19104, USA Abstract This paper studies a pursuit-evasion problem involving a single pursuer and a single evader, where we are interested in developing a pursuit strategy that doesn’t require continuous, or even periodic, information about the position of the evader. We propose a self-triggered control strategy that allows the pursuer to sample the evader’s position autonomously, while satisfying desired performance metric of evader capture. The work in this paper builds on the previously proposed self-triggered pursuit strategy which guarantees capture of the evader in finite time with a finite number of evader samples. However, this algorithm relied on the unrealistic assumption that the evader’s exact position was available to the pursuer. Instead, we extend our previous framework to develop an algorithm which allows for uncertainties in sampling the information about the evader, and derive tolerable upper-bounds on the error such that the pursuer can guarantee capture of the evader. In addition, we outline the advantages of retaining the evader’s history in improving the current estimate of the true location of the evader that can be used to capture the evader with even less samples. Our approach is in sharp contrast to the existing works in literature and our results ensure capture without sacrificing any performance in terms of guaranteed time-to-capture, as compared to classic algorithms that assume continuous availability of information. Key words: Pursuit-evasion; Self-triggered control; Sampled-data control; Set-valued analysis 1 Introduction In this paper we study a continuous-time pursuit-evasion problem, involving a single pursuer and a single evader where the objective of the pursuer is to catch the evader. Traditionally, treatment of this problem assumes continuous or periodic availability of sensing/communication on the part of the agents, which entails numerous unwanted drawbacks like increased energy expenditure in terms of sensing requirement, network congestion, inefficient bandwidth utilization, increased risk of exposure to adversarial detection, etc. In contrast, we are interested in the scenario where we can relax this continuous/periodic sensing requirement for the pursuer and replace it with triggered decision making, where the pursuer autonomously decides when it needs to sense the evader and update its trajectory to guarantee capture of the evader. ⋆ The material in this paper was partially presented at the 54th IEEE Conference on Decision and Control, December 15 - 18, 2015, Osaka, Japan. Corresponding author: Saad A. Aleem. Tel.: +1-832-670-9958. Email addresses: aleems@seas.upenn.edu (Saad A. Aleem), cnowzari@seas.upenn.edu (Cameron Nowzari), pappasg@seas.upenn.edu (George J. Pappas). Preprint submitted to Automatica Literature review: There are two main areas related to the contents of this paper. The first is the popular problem of pursuit-evasion which has garnered a lot of interest in the past. From an engineering perspective, pursuit-evasion problems have been studied extensively in context of differential games [Isaacs, 1999, Başar and Olsder, 1999]. In [Sgall, 2001], sufficient conditions are derived for a pursuer to capture an evader where the agents have equal maximum speeds and are constrained to move within the nonnegative quadrant of R2 . In [Alonso et al., 1992], upper and lower bounds on the time-to-capture have been discussed where the agents are constrained in a circular environment. These pursuit strategies have been generalized and extended by [Kopparty and Ravishankar, 2005] to guarantee capture using multiple pursuers in an unbounded environment Rn , as long as the evader is initially located inside the convex hull of the pursuers. In context of multi-agent robotic systems, the visibilitybased pursuit-evasion has received a lot of interest in the past [LaValle and Hinrichsen, 2001, Sachs et al., 2004, Isler et al., 2005]. In these problems, the pursuer is visually searching for an unpredictable evader that can move arbitrarily fast in a simply connected polygonal environment. Similar problems have been studied in [Suzuki and Yamashita, 1992, Gerkey et al., 2006, 21 March 2018 Isler et al., 2006], where visibility limitations are introduced for the pursuers but the agents actively sense and communicate at all times. A related problem has been discussed in [Bopardikar et al., 2007], where the agents can move in R2 but each agent has limited range of spatial sensing. A detailed review of recent applications in context of search and rescue missions and motion planning involving adversarial elements can be found in [Chung et al., 2011]. The vast literature on pursuit-evasion problems highlights their multifaceted applications in a variety of contexts. However, the previous works usually assume continuous or periodic availability of sensing information, especially on the part of the pursuer. Towards this end, we want to apply the new ideas of triggered control to the problem of pursuit-evasion, which has not been studied so far. In contrast to conventional time-driven approaches, strategies based on triggered control schemes study how information could be sampled for control purposes where the agents act in an opportunistic fashion to meet their desired objective [Åström and Bernhardsson, 1999, Velasco et al., 2003]. Triggered control allows us to analyze the cost to make up for less communication effort on the part of the agents, while achieving a desired task with a guaranteed level of performance of the system (see [Heemels et al., 2012] for an overview of more recent studies). Of particular relevance to this paper are works that study self-triggered [Subramanian and Fekri, 2006, Nowzari and Cortés, 2012] or event-triggered [Eqtami et al., 2010, Mazo and Tabuada, 2011] implementations of local agent strategies. In event-triggered control, the focus is on detecting events (both intrinsic and exogenous) during the execution that trigger pre-defined agent actions. In self-triggered control, the emphasis is instead on developing autonomous tests that rely only on current information available to individual agents to schedule or pre-compute future actions. In the context of pursuit-evasion problems, we will make use of the self-triggered approach which equips the pursuer with autonomous decision making in order to decrease its required sensing effort in tracking the evader. In principle, our paper shares with the above works the aim of trading increased decision making at the agent (pursuer) level for less sensing effort while still guaranteeing capture of the evader. The key result in [Aleem et al., 2015] relied on receiving perfect information about the evader, whenever the pursuer decided to sample. In reality, exact position information about the evader may never be available to the pursuer. The main contribution in this paper is to design a robust self-triggered policy, where we allow for noisy sensor measurements on the part of the pursuer, while still guaranteeing capture with only sporadic evader observations. Our triggered control framework provides fresh insights into dealing with information uncertainties and worst-case scenarios in the pursuit-evasion problem. Our framework readily incorporates the uncertainty in sensing the evader and allows us to derive tolerable error bounds in estimating the evader’s position that preserve our capture guarantees. The theme of our pursuit policy is quite similar to existing works on triggered control; based on the latest current estimate of the evader, the pursuer computes a certificate of sleep duration for which it can follow its current trajectory without having to sense the evader. In addition, we discuss the relative advantages of retaining previous estimates, where we leverage the past information about the evader to arrive at a better estimate of the evader’s true location. We show that incorporating additional knowledge about evader’s past improves the self-triggered update duration for the pursuer and mitigates uncertainty in detecting the evader. Organization: The problem formulation and its mathematical model are presented in Section 2. In Section 3, we present the design of self-triggered update duration for the pursuer as derived in [Aleem et al., 2015]. It is followed by Section 4, where we allow for uncertainty in sampling the evader’s position and outline the maximum tolerable error that can be accommodated on the part of the pursuer, without compromising its self-triggered strategy. Section 5 discusses the relative merits of retaining previous estimates of the evader’s position in the hope of increasing the sleep durations for the pursuer. The readers are encouraged to go over the detailed analysis of our problem in the Appendix. Notation: We let R>0 , R≥0 and Z≥0 to be the sets of positive real, nonnegative real and nonnegative integer numbers, respectively. Rn denotes the n−dimensional Euclidean space and k · k is the Euclidean distance. Contribution: This paper builds on our earlier work in [Aleem et al., 2015], where we applied the framework of triggered control to design a self-triggered pursuit policy for the pursuer which guarantees capture of the evader with a finite number of observations. Our work was different from the existing methods in the literature as our analysis did not assume the availability of continuous or periodic information about the evader. Instead, the self-triggered framework guaranteed capture of the evader without sacrificing any performance, in terms of guaranteed time-to-capture, as compared to classic algorithms that assume continuous information is available at all times. 2 Problem statement We consider a system with a single pursuer P and a single evader E. At any given time t, the position of the evader is given by re (t) ∈ R2 and its velocity is given by ue (t) ∈ R2 with kue (t)k ≤ ve , where ve is the maximum speed of the evader. Similarly, the position and velocity of the pursuer are given by rp (t) and up (t) with kup (t)k ≤ vp , where vp > ve is the maximum speed 2 on a plane (R2 ), where both agents are modelled as single integrators. Note that it is not necessary to assume that the agents, particularly the evader, are moving with constant speeds at all times. For all practical purposes, we can upper bound the evader speed by vemax such that vemax < vp and the analysis will remain unchanged. We denote the positions of the agents by rp = (xp , yp ) and re = (xe , ye ). Additionally, the pursuer is moving along θp and the relative angle between the agents’ headings is denoted by θe (see Fig. 1). Without loss of generality, we normalize the speed of the pursuer to vp = 1 and the evader moves with a speed ν, where ν < 1 at all times. The dynamics of the pursuer and the evader are given by of the pursuer. The system evolves as ṙp = up , ṙe = ue . In our problem, the goal of the pursuer is to capture the evader. We define capture of the evader as the instance when the pursuer is within some pre-defined capture radius ε > 0 of the evader. Assuming that the pursuer has exact information about the evader’s state at all times, it is well known that the time-optimal strategy for the pursuer is to move with maximum speed in the direction of the evader [Isaacs, 1999]. Such a strategy, known as classical pursuit, is given by the control law up (t) = vp re (t) − rp (t) . kre (t) − rp (t)k ẋp = cos θp , x˙e = ν cos(θe + θp ), ẏp = sin θp , y˙e = ν sin(θe + θp ). (1) θe The issue with the control law (1) is that it requires continuous access to the evader’s state at all times and instantaneous updates of the control input. Instead, we want to guarantee capture of the evader without tracking it at all times and only updating the controller sporadically. We do this by having the pursuer decide in an opportunistic fashion when to sample the evader’s position, and update its control input. Under this framework, the pursuer only knows the position of the evader at the time of its last observation. Let {tk }k∈Z≥0 be a sequence of times at which the pursuer receives information about the evader’s position. In between updates, the pursuer implements a zero-order hold of the control signal computed at the last time of observation using (1) which is given by up (t) = vp re (tk ) − rp (tk ) , kre (tk ) − rp (tk )k (xe , ye ) E y (xp , yp ) O x Fig. 1. Figure shows the pursuer P at rp = (xp , yp ) and the evader E at re = (xe , ye ) in R2 . The pursuer is moving along θp and the relative angle between agents’ headings is denoted by θe . The arrows indicate the velocity vectors of the agents. 3.1 Self-triggered Update Policy for Pursuer Suppose at time tk the pursuer, at rp (tk ), observes the evader at re (tk ) such that the distance between the agents is Dk , krp (tk ) − re (tk )k. For notational brevity, we will denote the position of the agents at the instance of observation by rek := re (tk ) and rpk := rp (tk ). We are interested in the duration for which the pursuer can maintain its course of trajectory, without observing the evader. More specifically, we are interested in the first instance at which the separation between the agents can possibly increase, thus prompting the pursuer to sample the evader’s state and update its trajectory. Let r(t) denote the separation between the pursuer and the evader at time t. Then, we consider the objective function (2) R= (3) where Dk , kre (tk ) − rp (tk )k is the separation between the agents at time tk . Our goal is to design the triggering function φ such that the pursuer is guaranteed to capture the evader while also being aware of the number of samples of the evader required. 3 θp P for t ∈ [tk , tk+1 ). In this paper, our purpose is to identify a function for the self-triggered update duration φ for the pursuer that determines the next time at which the updated information is required. In other words, each time the pursuer receives updated information about the evader at some time tk , we want to find the duration, φ (Dk , ve , vp ), until the next update such that tk+1 = tk + φ (Dk , ve , vp ) , (4) r2 (xe − xp )2 + (ye − yp )2 = . 2 2 Note that the time at which Ṙ becomes nonnegative is same as the time at which ṙ becomes nonnegative. Using (4), the derivative of R (see Appendix for details) is given by Ṙ = ν(xe − τ ) cos θe + νye sin θe + τ − xe , Design of Self-triggered Update Law We study the continuous-time pursuit and evasion problem consisting of a single pursuer and a single evader (5) for τ ≥ 0, and is a function of evader parameters (xe , ye , θe ). For τ ≥ 0, the reachable set of the evader 3 Dk+1 . To see that the separation is strictly decreasing, note that 1 0.8 k Dk+1 ≤ Dmax = Dk − (1 − ν)φkν (Dk ) , Dk h(ν), φk ν Dk 0.6 k where Dmax is the maximum possible separation between the agents after the duration φkν (see Appendix for details) and h(ν) is given by 0.4 Sfrag replacements 0.2 √ ν(1 − ν) 1 − ν 2 − (1 − ν)(1 − ν 2 ) h(ν) = 1 − , 2ν 2 − 1 0 0 0.2 0.4 ν 0.6 0.8 1 Fig. 2. Figure shows a plot of normalized update time against evader speed ν ∈ [0, 1). φkν (Dk ) is given by (6). φk ν Dk (7) where h(ν) ∈ [0, 1) for ν ∈ [0, 1) . Thus, Dk+1 < Dk . ✷ is given by the ball Be (rek , ντ ). Additionally, for fixed τ , we write Ṙ in (5) explicitly as a function of evader parameters and denote it by Ṙτ (xe , ye , θe ). Let g(τ ) = sup Ṙτ (xe , ye , θe ), subject to the reachable 3.2 Capture Time & Number of Samples Using the self-triggered update policy (6), the pursuer is guaranteed to capture the evader in finite time with finite number updates. More specifically, we can find the maximum number of samples in terms of the capture radius ε and evader speed ν and use it to guarantee finite time-to-capture. This is summarized in the following theorem. xe ,ye ,θe set of the evader, i.e re ∈ Be (rek , ντ ). For the dynamics in (4), where vp = 1 and ve = ν, we can denote update duration in (3) by φkν , φ(Dk , vp , ve ) and it is defined as φkν = inf {τ ∈ R>0 | g(τ ) = 0} . Theorem 3.2 (Capture with Finite Samples) Let the pursuer and evader dynamics be given by (4) where the agents are initially separated by D0 . Given some pre-defined positive capture radius ε < D0 , the selftriggered update policy φkν in (6) ensures capture with finite observations in finite time. φkν is the smallest duration after which there exists an evader state that may increase the separation between the agents. For the agents modelled by (4), our self-triggered update duration is obtained by solving inf {τ ∈ R>0 | g(τ ) = 0} (see Appendix for derivation) and is given by √ Dk ν 1 − ν 2 − Dk (1 − ν 2 ) k . (6) φν = 2ν 2 − 1 PROOF. According to Proposition 3.1, the separation between the agents is strictly decreasing between successive updates. In fact, the new separation between the agents satisfies the inequality Dk+1 ≤ Dk h(ν), where h(ν) is given by (7). This implies that after n observations of the evader, the separation between the agents satisfies the inequality Dn ≤ D0 hn (ν), where D0 is the initial separation between the agents. Using this result, the maximum number of samples can be calculated by setting D0 hn (ν) ≤ ε. The graph of φkν against evader speed ν is shown in Fig. 2. From the plot, we observe that increasing the evader speed decreases the self-triggered update duration for the pursuer. So, if the evader moves faster our law prescribes more frequent updates of it to guarantee capture. The underlying objective in the design of the selftriggered policy is that at each instance of fresh observation, the separation between the agents must have decreased. The following proposition characterizes this result.  log  ε D0   nmax =   log (h(ν))  .   (8) The expression in (8) shows that for any pre-defined positive capture radius ε < D0 , the pursuer is guaranteed to capture the evader with finite number of samples. This completes the first part of the proof. For selftriggered pursuit policy φkν in (6), the sequence of times at which the pursuer samples the evader position, denoted by {tk }k∈Z≥0 , follows the criteria tk+1 = tk + φkν . This means that after N updates, the total duration of PN pursuit (denoted by TN ) is given by TN = t0 + k=0 φkν . Without loss of generality, we can assume t0 = 0. Since the pursuer is guaranteed to capture the evader with Proposition 3.1 (Decreasing Separation) Let the pursuer and evader dynamics be given by (4) where the agents are separated by Dk at time tk . If the pursuer updates its trajectory using the self-triggered update policy φkν in (6), then the distance between the agents at time tk+1 has strictly decreased, i.e., Dk+1 < Dk for tk+1 = tk + φkν . PROOF. Given the separation Dk at time tk , the new separation between the agents, after a duration of φkν , is 4 Tcap ≤ nX max φkν = f (ν) k=0 where f (ν) denotes nX max Dk , k=0 φk ν Dk and satisfies the relationship 1−h(ν) PSfrag we replacements f (ν) = 1−ν . Using the inequality Dk ≤ D0 hk (ν), get nX max Tcap ≤ D0 f (ν) hk (ν). As h(ν) ∈ [0, 1) for ν ∈ [0, 1), we have hk (ν) < k=0 Thus, Tcap < D0 1−ν , ∞ X hk (ν) = k=0 1 . 1 − h(ν) 4 use of the relationship f (ν) = 1−h(ν) 1−ν . This shows that, for any evader speed ν ∈ [0, 1), Tcap is finite. ✷ Remark 3.3 (Self-triggered Performance) Note that in proving finite time-to-capture in Theorem 3.2, D0 . we showed that time-to-capture is strictly less than 1−ν However, given a pre-defined capture radius ε < D0 , it can be shown that the time-to-capture satisfies the inequality D0 − ε . 1−ν (9) This is because the evader is captured as soon as the actual separation is within the capture radius at any time, not just at the instance of updates. The relationship in (9) is the same upper bound for time-to-capture in classical pursuit strategy. In classical pursuit, Tcap is bounded by Tcap ≤ D0 − ε , vp − ve 10 4 10 3 10 2 10 1 0 0.2 0.4 ν 0.6 0.8 1 Allowable Error in Evader’s Estimate In this section, we study the scenario in which the pursuer acquires the information about the position of the evader with some uncertainty. We are interested in analyzing the effect of imperfect observations on our selftriggered framework. Our objective is to investigate the maximum allowable error in estimating the evader’s position which still allows us to catch the evader using a self-triggered pursuit policy. More specifically, we want to find the maximum tolerable uncertainty in estimating evader’s position at each instance of observation, as a function of the evader’s speed. Suppose at tk the pursuer estimates the evader at rbe (tk ). This observation is imperfect and is corrupted by an associated noise γk , where γk ∈ R≥0 . So, at the instance of observation, the true position of the evader re (tk ) ∈ Be (b re (tk ), γk ). For notational brevity we will denote rbe (tk ) by rbek . Our objective is to find the allowable range for the error γk , as a function of the evader speed ν, such that the self-triggered pursuit policy can still guarantee capture. The reachable set of the evader is  given by Be rbek , ν(t − tk ) + γk , for t ∈ [tk , tk+1 ). This is illustrated in Fig. 4. Let τ = t − tk . Applying the previous framework of analysis, we want to maximize Ṙ over the evader parameters, subject to the constraint re ∈ Be (b rek , ντ + γk ). Let gγk (τ ) = sup Ṙτ (xe , ye , θe ), where in the last step we have made Tcap ≤ 10 5 Fig. 3. Figure shows the variation of the maximum number of samples against evader speed as given by the expression D0 in (8) where ε is chosen as 10 3. k=0 nX max Maximum number of samples finite number of maximum samples nmax , the time-tocapture (denoted by Tcap ) is bounded by (10) xe ,ye ,θe subject to the reachable set of the evader, i.e. re ∈ Be (b rek , ντ + γk ). Finding gγk (τ ) is very similar to the procedure of finding g(τ ) as outlined in the Appendix. The only difference is in the reachable set of the evader, which is now increased by γk , whereas Ṙ remains the b k , the same. For the error γk and estimated separation D self-triggered update duration is defined as where D0 is the initial separation, ε is the pre-defined capture radius and vp > ve [Isaacs, 1999]. The worstcase time-to-capture occurs in the scenario where evader is actively moving away at all times. This shows that our self-triggered pursuit policy guarantees capture with the same performance as the classical case but with only finite number of evader samples. • The expression in (8) guarantees capture with finite samples of evader’s state. Fig. 3 shows a graph of the maximum number of samples required to guarantee capture against the evader speed, for pre-defined capture radius D0 ε = 10 3 . The number of samples increase quite sharply as ν approaches 1. This makes intuitive sense as the maximum number of evader observations should increase as evader approaches the maximum speed of the pursuer. b k , γk , ν) , inf {τ ∈ R>0 | gγ (τ ) = 0} . φkγk ,ν = φ(D k Solving inf {τ ∈ R>0 | gγk (τ ) = 0} yields φkγk ,ν 5 √ √ b k (1 − ν 2 ) + γk ( 1 − ν 2 − ν) bkν 1 − ν2 − D D , = 2ν 2 − 1 (11)  Be r̂ek , ν(t − tk ) + γk  D̂k+1 r̂ek rpk P D̂k E rpk θe r̂ek γk φkν rpk+1 P γk   Be r̂ek , νφkβ,ν + γk r̂ek+1 γk+1 E D̂k νφkβ,ν + γk ν(t − tk ) + γk k Dmax Fig. 5. At time tk , the pursuer P , measures the evader E at b k+1 indicates krpk+1 − rbek+1 k. rbek . After the duration φkβ,ν , D k k Be (b re , νφβ,ν +γk ) outlines the boundary of the reachable set k of the evader after φkβ,ν . Dmax denotes the maximum possible separation between the agents at tk+1 = tk + φkβ,ν . for ν ∈ [0, 1). To simplify the analysis, we can select the error as a scaled version of the current estimate of b k , where β ∈ R≥0 . Such the separation, i.e. γk , β D a parametrization will allow us to study the effect of changing β on the self-triggered update duration and will also tell us the maximum tolerable error relative PSfrag replacements b k . Setting to the current estimate of the separation D b k , we get γk := β D φkβ,ν = bk D 1 ν ν ν ν 0.9 0.8 = 0.2 = 0.4 = 0.6 = 0.8 0.7 0.6 φk β,ν Dk Fig. 4. Figure shows the pursuer at rpk estimating the observer b k , at time tk . The pursuer detects at rbek , separated by D  the evader with an uncertainty γk . Be rbek , ν(t − tk ) + γk indicates the reachable set of the evader for t ∈ [tk , tk+1 ). 0.5 0.4 √  ν 1 − ν 2 − (1 − ν 2 ) + β( 1 − ν 2 − ν) , 2ν 2 − 1 (12) √ 0.3 0.2 0.1 0 0 where, with a slight abuse of notation, we have used φkβ,ν b k , β, ν) = inf{τ ∈ R>0 | gβ (τ ) = 0} 1 . instead of φ(D Note that β can not be chosen arbitrarily. To find the feasible domain of the of β, we invoke the of √   criteria φkβ,ν ∈ R>0 for ν ∈ [0, 1). This yields β ∈ 0, 1 − ν 2 . However, imposing the positivity of self-triggered duration is not sufficient to come up with the desired domain. The design of the self-triggered update duration rests on the underlying performance objective of evader capture. This requires strict decrease in true separation in between updates 2 . At the instance of update, the new k b k+1 ≤ Dmax estimate of the separation satisfies D where k Dmax is given by 0.05 0.1 β 0.15 0.2 0.25 Fig. 6. Figure shows the variation of φkβ,ν in (12) against β, for different values of evader speeds, where β satisfies the condition in (13). For any evader speed ν ∈ [0, 1), increasing the value of β decreases φkβ,ν . the previous inequality, we have allowed for the worstcase scenarios in estimating the evader’s position. There1−(1−ν)φ̄k +β β,ν < 1 is sufficient to guarantee fore, setting 1−β strict decrease in actual separation in between updates. This results in a more conservative set of allowable values for β as shown in (13). ! √ (1 − ν) 1 − ν 2 − 2(1 − ν)2 . β ∈ 0, 5ν − 3 " k b k + νφkβ,ν + γk + γk+1 − φkβ,ν . Dmax =D (13) This is illustrated in Fig. 5. Thus, Thus, for evader speed ν, the maximum allowable error for k-th observation (denoted by γk∗ ) satisfies the inequality k b k + νφkβ,ν + γk + γk+1 − φkβ,ν . b k+1 ≤ Dmax D =D φk b k . Let φ̄k , β,ν . This Recall that φkβ,ν is a function of D β,ν bk D   1−(1−ν)φ̄k +β β,ν b b . In deriving means that Dk+1 ≤ Dk 1−β 1 gβ (τ ) = γk∗ Note that the maximum allowable error dynamically changes (decreases) as the pursuer closes in on the evader. This also means that, for the duration of entire pursuit, the maximum allowable error for all observa- bk) rek , ντ + β D sup Ṙτ (xe , ye , θe ), s.t. re ∈ Be (b xe ,ye ,θe 2 √  b k (1 − ν) 1 − ν 2 − 2(1 − ν)2 D < . 5ν − 3 In the case of uncertainty, we have access to the estimates b k , instead of true separation Dk of current separation D 6 tions (denoted by γ ∗ ) satisfies the relationship samples in the presence of uncertainty. Given an initial b 0 between agents and a preestimated separation of D b 0 , the maximum defined positive capture radius ε < D number of evader updates can be calculated by setting b 0 (hβ (ν))n ≤ ε, which results in D √  ε (1 − ν) 1 − ν 2 − 2(1 − ν)2 γ < , 5ν − 3 ∗ where ε is the pre-defined capture radius. We incur no Zeno behavior using the self-triggered policy in (12), i.e. the pursuer does not require infinitely many samples to capture the evader. The following theorem characterizes this important result.  √ 1−ν 2 −(1−ν 2 )+p(ν)( 1−ν 2 −ν) and p(ν) = 2 −1 2ν √ (1−ν) 1−ν 2 −2(1−ν)2 . It is easy to verify that q(ν) is a 5ν−3 √ 5 b k+1 ≤ D b k hβ (ν), D where hβ (ν) 1 ∈ [0, 1) for ν ∈ [0, 1) and β satisfies the condition in (13). Using similar analysis from previous section, we can estimate the maximum number of  √ √ 2 hβ (ν) = 1−ν 2 −(1−ν )+β( 2ν 2 −1 1−β 1−ν 2 −ν) Maximum number of samples 10 3 10 2 10 1 ν ν ν ν +β 0 0.05 0.1 β 0.15 0.2 = 0.20 = 0.40 = 0.60 = 0.80 0.25 Self-triggered Analysis with Memory In the previous section, we studied the effect of uncertainty in sensing the evader’s position and provided bounds on the maximum tolerable error (as a function of evader’s speed) which allowed us to capture the evader with sporadic updates. In the absence of uncertainty, as outlined in Section 3, the pursuer employs a memoryless pursuit policy to catch the evader, i.e. the pursuer only needs the current sample of the evader’s (true) position rek in order to calculate the self-triggered update duration φkν in (6). This is because, for τ ∈ [0, φkν ), the current reachable set of the evader, Be (rek , ντ ), is always a subset of theprevious reachable set of the evader, Be rek−1 , ν(φkν + τ ) . When we introduce uncertainty in estimating evader’s position, the above statement is no longer true. The idea behind retaining evader’s estimated history is that we can potentially reduce the actual reachable set of the evader when we combine the current reachable set of the evader with the previous reachable sets, thus improving our current estimate of the true position of the evader. This allows us to improve (increase) our update duration, as compared to An important consequence of Theorem 4.1 is that, in the presence of uncertainty, our self-triggered framework guarantees capture with only finite estimates of the evader. This means that we can find the maximum number of samples that will guarantee capture. By design, β satisfies the condition in (13) and guarantees strict decrease in measured separation between successive updates. In general, we can write this as (1−ν) ν (14) Fig. 7. Figure shows the plot of maximum number of samples in (14) against β, for different values of evader speeds, where β satisfies the condition in (13). The capture radius is taken b0 D as ε = 10 3. positive and monotonically decreasing function for ν ∈ [0, 1). Thus, for any evader speed ν ∈ [0, 1), we have tk+1 − tk := φkβ,ν ≥ εq(ν) > 0, ∀k. So, inter-event duration is lower-bounded by a positive constant for all observations, which suffices to show that our self-triggered duration does not incur any Zeno behavior. ✷ 1−   10 4 10 0 φkβ,ν ≥ φ(ε, ν) = εq(ν), 1 ε b0 D For evader speed ν, the maximum number of samples for guaranteed capture increases as the parameter β is increased (see Fig. 7). This shows that, for any ν ∈ [0, 1), we need to sample the evader’s state more frequently in order to allow for more uncertainty in estimating evader’s position at each instance of update. PROOF. Suppose that pursuer observes the evader at the instance tk . In order to show no Zeno behavior, it suffices to prove that the inter-event duration is lowerbounded by a positive constant for all observations, i.e. tk+1 − tk := φkβ,ν ≥ c > 0, ∀k. According the con h √ 2 −2(1−ν)2 for the selfdition (13), β ∈ 0, (1−ν) 1−ν 5ν−3 PSfrag replacements triggered update policy φkβ,ν in (12). Note that the higher values of β result in a smaller inter-event duration (see Fig. 6). Then, given a capture radius ε, the following relationship is satisfied for all observations. ν   nβmax =   log (hβ (ν))  .   Theorem 4.1 (No Zeno Behavior) If the pursuer updates its trajectory using the self-triggered update policy φkβ,ν in (12), where β satisfies the condition in (13), then pursuer is guaranteed to incur no Zeno behavior for the duration of the pursuit. where q(ν) = log . 7 the memoryless case with uncertainty (derived in Section 4). More specifically, we can leverage our knowledge about the previous estimates of the evader in improving the current update duration for the pursuer, while mitigating the effect of uncertainty in estimating evader’s position. Consider the problem in which the pursuer receives uncertain information about the evader, while keeping track of its previous estimates. For the purpose of illustration, we analyze the case where the pursuer retains only the previous estimate of the evader’s position. Extending the framework to the case for more than one previous estimates will be similar and straightforward. Additionally, we assume that the pursuer samples the evader with an associated error γ. Suppose that the pursuer sampled the evader at time tk−1 , computed k−1 the self-triggered update duration φbγ,ν and observed the evader again at the instance tk . For t ∈ [tk , tk+1 ), the current reachable  set of the evader is given by of Be rbek , ν(t − tk ) + γ , andthe previous reachable set  k−1 k−1 b the evader is given by Be rbe , ν(t − tk + φγ,ν ) + γ . Based on this information, the actual reachable set of the evader is given by the intersection of the two. One particular scenario is illustrated in Fig. 8, where the actual reachable set is not the same as the current reachable set.  Be r̂ek−1 , γ + ν(t − tk + φ̂k−1 γ,ν ) The self-triggered update duration is then defined as φbkγ,ν = inf {τ ∈ R>0 | b gγ (τ ) = 0} . Equivalently, for fixed τ and γ, b gγ (τ ) is the optimal value of the following optimization problem. Ṙτ (xe , ye , θe ),   k−1 )+γ , subject to re ∈ Be rbek−1 , ν(τ + φbγ,ν sup xe ,ye ,θe As explained earlier, incorporating evader’s previous estimate can potentially reduce the actual reachable set of the evader in the case of noisy measurements. By keeping track of the previous estimate(s), we are equivalently adding more constraints to the feasible (reachable) set in our optimization problem. We want to formalize the benefit of retaining evader’s history in terms of improvement (increase) in the update duration, as compared to the memoryless update duration given by (11). Recall that the self-triggered update duration in (11) was derived using only the current reachable set of the evader, Be (b rek , ντ + γ), based on its latest estimate. Let gγ (τ ) denote the optimal value of the problem (17), which is used to obtain the memoryless update duration in (11). sup  xe ,ye ,θe Ṙτ (xe , ye , θe ), γ rpk P D̂k  (17) Observe that (17) is a relaxation of (16), as it is obtained by removing the constraint corresponding to the previous reachable set of the evader. As a result, gbγ (τ ) ≤ gγ (τ ) for any τ ≥ 0. We notice that both gbγ and gγ are monotonically increasing in the parameter τ , because increasing τ increases the feasible set in the optimization problem thus yielding a potentially greater maximum value. Using the monotonicity of b g and g in τ , along with the fact that b gγ (τ ) ≤ gγ (τ ) (for any τ ≥ 0), allows us to infer that the first instance, at which b g approaches 0, will be greater than or equal to the first instance at which g approaches 0. This means that r̂ek−1 Be r̂ek , ν(t − tk ) + γ (16) re ∈ Be (b rek , ντ + γ). re ∈ Be (b rek , ντ + γ). D̂k−1 (15)  r̂ek E γ Fig. 8. The figure shows the reachable sets of the evader, based on its current (b rek ) and previous(b rek−1 ) estimates. For t ∈ [tk , tk+1 ), the  current reachable set is denoted by Be rbek , ν(t − tk ) + γ and the previous reachable set is de  bk−1 noted by Be rbek−1 , ν(t − tk + φ γ,ν ) + γ . The actual reachable set is the intersection of the two. inf {τ ∈ R>0 | gbγ (τ ) = 0} ≥ inf {τ ∈ R>0 | gγ (τ ) = 0} and as a consequence, we have φbkγ,ν ≥ φkγ,ν . Using τ = t − tk for t ∈ [tk , tk+1 ), let b gγ (τ ) = sup Ṙτ (xe , ye , θe ), subject to the actual reachable set (18) Leveraging Memory against Uncertainty: The relationship in (18) shows that by using previous estimate(s) of the evader’s position, we can potentially increase the update durations for the pursuer. Case I in Fig. 9 demonstrates one particular instance of leveraging evader’s history which yields the greatest improvement xe ,ye ,θe of the evader i.e.    k−1 )+γ . re ∈ Be rbek , ντ + γ ∩ Be rbek−1 , ν(τ + φbγ,ν 8  k−1 Be r̂ek−1, ν φ̂γ,ν +γ r̂ek−1 γ   Be r̂ek−1, ν φ̂k−1 γ,ν + γ rek rek−1 γ r̂ek E  Be r̂ek , γ ous and the current reachable set intersect at a point. b 1 = 10 Suppose the measured separation at t1 is D units. Using a memoryless pursuit policy in (11) results in φ1γ,ν = 6.529, whereas obtaining self-triggered update duration from solving the problem (16) results in φb1γ,ν = 6.674. Observe that φb1γ,ν − φ1γ,ν ≈ ∆φ∗ , which shows that, in certain cases, knowing one previous estimate of the evader can almost nullify the uncertainty in sensing evader’s position and consequently allow for greater update duration. •  r̂ek−1 γ  r̂ek E γ  Be r̂ek , γ (a) Case I  (b) Case II Fig. 9. Figure shows the two possible cases at the instance of fresh observation of the evader. Case I shows the extreme case where incorporating the evader’s history precisely determines its true position. Case II shows the scenario in which the current reachable set is a subset of the previous reachable set, thus the previous estimate provides no additional information. Towards Multiple Estimates: Extending the above framework to the case of multiple previous estimates is relatively straightforward. Suppose, for the k-th observation of the evader, we have the information about the m previous updates (where m ∈ Z≥0 such that m ≤ k − 1). Then the current sleep duration can be computed by φbkγ,ν = inf {τ ∈ R>0 | gbγ (τ ) = 0}, where gbγ (τ ) is an optimal value of the optimization problem (20) for τ ≥ 0. The value m can be treated as the length of the sliding window for retaining fixed number of previous estimates, to compute the current update duration for the pursuer. in the current update duration. In the extreme case, at the instance of observation, the current and the previous reachable sets of the evader intersect such that the actual reachable set is reduced to a point. Equivalently, this means that we know precisely where the evader is. This will result in a longer update duration as compared to memoryless case (11), where we would have incorporated uncertainty in our observation to yield a more conservative update duration. Let ∆φ denote the improvement in self-triggered update duration, i.e. ∆φ := |φbkγ,ν − φkγ,ν |. Comparing Eq. (6) and Eq. (11), we see that the greatest improvement (denoted by ∆φ∗ ) is given by √  2γ ν − 1 − ν 2 ∆φ = , 2ν 2 − 1 ∗ Ṙτ (xe , ye , θe ), sup xe ,ye ,θe subject to re ∈ Be (b rek , ντ + γ), m \ Bej (τ ), re ∈ (20) j=1 where Bej (τ ) is the current reachable set of the j-th previous estimate of the evader’s position and is given by (19) for ν ∈ [0, 1). While sometimes adding information about the previous estimate can be advantageous, it is important to realize that incorporating the previous reachable set of the evader does not always results in an improvement (increase) in the update duration. We can increase the selftriggered update duration only when the evader’s past provides more information about its current true position. In the scenario where the current reachable set of the evader is a subset of the previous reachable set, we get no additional information about the evader’s true position and hence no improvement in our update duration as compared to the memoryless case in (11). This is illustrated in case II in Fig. 9, where we can drop (forget) the previous estimate of the evader’s position as it is a subset of the previous reachable set and will yield no improvement in increasing the current update duration. Bej (τ ) := Be rbek−j , ν τ+ j X l=1 for j ∈ {1, . . . , m} and m ≤ k − 1. k−l φbγ,ν ! +γ ! , Remark 5.2 (Forgetting Previous Estimates) Note that, while we might have the capability to store m previous estimates of the evader, it is not necessary to use all of them in computing the current sleep duration for the pursuer. As illustrated earlier, retaining the history improves our update duration when it reduces the current reachable set of the evader. This allows us to forget all those estimates whose reachable sets either completely contain the current reachable set or a reachable set of another previous estimate. To formalize this notion, at the instance of k-th observation of the evader, we can construct a set Remark 5.1 (Numerical Example) To illustrate the improvement in update duration numerically, let ν = 0.5 and γ = 0.1. For these values, ∆φ∗ = 0.146 from (19). Based on some initial measurement, the pursuer finds the first update duration φ0γ,ν by using (11) and samples the evader at t1 to find that the previ-    I := i | Be rbek , γ ⊆ Bei (0) ∪ i | Bel (0) ⊆ Bei (0), l 6= i ,   P k−l + γ for i ∈ where Bei (0) denotes Be rbek−i , ν il=1 φbγ,ν {1, . . . , m} and m ≤ k − 1. I denotes the collection of 9 indices among the m previous samples of all those estimates which we can forget to reduce the computation complexity of the problem (20). Thus, our improved update duration can be computed from solving the problem (21). The problem (21) is guaranteed to have the same optimal value as that of (20) because all the estimates belonging to the set I have no effective contribution to the actual reachable set of the evader and thus removing them will have no change in the optimal value. Ṙτ (xe , ye , θe ), sup xe ,ye ,θe subject to re ∈ Be (b rek , ντ + γ), m \ Bej (τ ). re ∈ (21) • In this section, we provide numerical results for the case when the pursuer retains past samples of the evader as outlined in Section 5. We study the potential benefit of retaining only the previous estimate of the evader’s observation as the pursuer tries to capture the evader. Thus, in our simulations, m = 1 in (21) and the selftriggered update duration will be obtained from solving the optimization problem in (16). We model our agents as single integrators, where we normalize the speeds of the agents, such that vp = 1 and the maximum speed of the evader is ν = 0.5. The evader is restricted to move in any of 4 directions: right, left, up and down and chooses the best direction to actively move away, with its maximum possible speed, from the pursuer at all times. We initialize the agents with an actual separation D0 = 15 units. For every observation, the pursuer samples the evader’s current position with an associated error of γ = 0.1 such that, initially, the  true position of the evader rek ∈ Be rbek , 0.1 . Note that we can not arbitrarily set the capture radius, as outlined in Section 4. For an evader speed ν and error γ, the capγ , where ture radius must satisfy the relationship ε > p(ν) 2 φkγ,ν φk γ,ν Dk D̄k 0 15.00 9.500 0.633 1 10.25 6.488 2 7.006 3 4 bk φ γ,ν 15.00 bkγ,ν φ 9.500 0.633 0.633 10.24 6.674 0.652 4.432 0.633 6.949 4.511 0.649 4.790 3.027 0.632 4.659 2.996 0.643 3.277 2.067 0.631 3.196 2.037 0.637 5 2.243 1.412 0.630 2.194 1.393 0.634 6 1.537 0.965 0.628 1.500 0.947 0.632 7 1.055 0.659 0.625 1.033 0.648 0.628 D̄k that guarantees capture with finite updates. We observe that, in the beginning of the pursuit, adding history results in relatively better gains as compared to towards the end, when the agents are nearby. The values indicate that as the separation decreases, so does the potential benefit of adding computational overhead by retaining the previous observation. Simulations √ Dk 8 0.754 0.463 0.621 0.752 0.464 0.623 Table 1 Comparison between memoryless and memory-aware update times. j=1,j ∈I / 6 k 7 Conclusions The robust self-triggered framework in this paper extends our previous results to address the practical issues related with uncertainty in information about the evader. We elaborate the case when the sampling is not perfect and design self-triggered update duration along with tolerable error bounds in estimating the evader’s state. We show that our analysis preserve the selftriggered controller updates for the pursuer, such that it incurs no Zeno behavior in catching the evader without losing any of the previous performance guarantees. Our methodology offers a fresh perspective on dealing with uncertain information in pursuit-evasion problems, besides being in contrast to a majority of previous works that assume continuous, or at least periodic, information about the evader is available at all times. Additionally, we study the merits of retaining evader’s history and show that we can allow for potentially longer update durations by incorporating past observations of the evader in the pursuer’s autonomous decision making. In the future, we are interested in extending our methods to scenarios involving multiple agents and deriving conditions for team-triggered cooperative strategies. 2 −2(1−ν) p(ν) = (1−ν) 1−ν . For ν = 0.5 and γ = 0.1, 5ν−3 setting ε = 0.75 satisfies the aforementioned relationship. Table 1 shows the variation between the memoryless update duration φkγ,ν and the improved update duration φbkγ,ν , which takes into account the previous estimate of the evader’s observation. Since, φbkγ,ν is different from φkγ,ν , they result in different measures of separation at the instance of observation. For a fair comparison, we need to compare the normalized update durations, i.e bkγ,ν φ φk and Dγ,ν where D̄k and Dk denote the true separaD̄k k tions at the instance of evader observation for memoryaware and memoryless pursuit strategies, respectively. The results in Table 1 indicate that in the presence of uncertainty in sampling the evader, incorporating only the previous estimate allows for greater sleep durations References S. A. Aleem, C. Nowzari, and G. J. Pappas. Self-triggered pursuit of a single evader. In Proceedings of the IEEE Conference on Decision and Control, pages 1433–1440, Osaka, Japan, 2015. L. Alonso, A. S. Goldstein, and E. M. Reingold. Lion and man: upper and lower bounds. ORSA Journal on Computing, 4(4): 447–452, 1992. K. J. Åström and B. Bernhardsson. Comparison of periodic and event based sampling for first-order stochastic systems. In Proceedings of the 14th IFAC World congress, volume 11, pages 301–306, 1999. 10 Be rek , ν(t − tk ) T. Başar and G. J. Olsder. Dynamic Noncooperative Game Theory, volume 23. SIAM, 1999. S. D. Bopardikar, F. Bullo, and J. P. Hespanha. Cooperative pursuit with sensing limitations. In Proceedings of the IEEE American Control Conference, pages 5394–5399, New York, NY, 2007. T. H. Chung, G. A. Hollinger, and V. Isler. Search and pursuitevasion in mobile robotics - a survey. Autonomous Robots, 31 (4):299–316, 2011. A. Eqtami, D. V. Dimarogonas, and K. J. Kyriakopoulos. Eventtriggered control for discrete-time systems. In Proceedings of the IEEE American Control Conference, pages 4719–4724, Baltimore, MD, 2010. B. P. Gerkey, S. Thrun, and G. Gordon. Visibility-based pursuitevasion with limited field of view. The International Journal of Robotics Research, 25(4):299–315, 2006. W. P. M. H. Heemels, K. H. Johansson, and P. Tabuada. An introduction to event-triggered and self-triggered control. In Proceedings of the IEEE Conference on Decision and Control, pages 3270–3285, Maui, HI, 2012. R. Isaacs. Differential Games: A Mathematical Theory with Applications to Warfare and Pursuit, Control and Optimization. Courier Corporation, 1999. V. Isler, S. Kannan, and S. Khanna. Randomized pursuit-evasion in a polygonal environment. IEEE Transactions on Robotics, 21(5):875–884, 2005. V. Isler, S. Kannan, and S. Khanna. Randomized pursuit-evasion with local visibility. SIAM Journal on Discrete Mathematics, 20(1):26–41, 2006. S. Kopparty and C. V. Ravishankar. A framework for pursuit evasion games in Rn . Information Processing Letters, 96(3): 114–122, 2005. S. M. LaValle and J. E. Hinrichsen. Visibility-based pursuitevasion: The case of curved environments. IEEE Transactions on Robotics and Automation, 17(2):196–202, 2001. M. Mazo and P. Tabuada. Decentralized event-triggered control over wireless sensor/actuator networks. IEEE Transactions on Automatic Control, 56(10):2456–2461, 2011. C. Nowzari and J. Cortés. Self-triggered coordination of robotic networks for optimal deployment. Automatica, 48(6):1077– 1087, 2012. S. Sachs, S. M. LaValle, and S. Rajko. Visibility-based pursuitevasion in an unknown planar environment. The International Journal of Robotics Research, 23(1):3–26, 2004. J. Sgall. Solution of David Gale’s lion and man problem. Theoretical Computer Science, 259(1-2):663–670, 2001. R. Subramanian and F. Fekri. Sleep scheduling and lifetime maximization in sensor networks: fundamental limits and optimal solutions. In Symposium on Information Processing in Sensor Networks, pages 218–225, New York, NY, 2006. ACM. I. Suzuki and M. Yamashita. Searching for a mobile intruder in a polygonal region. SIAM Journal on Computing, 21(5):863– 888, 1992. M. Velasco, J. Fuertes, and P. Marti. The self triggered task model for real-time control systems. In Proceedings of the 24th IEEE Real-Time Systems Symposium, volume 384, pages 67– 70, 2003. A rek rpk = (0, 0) P Dk y  θe E ν(t − tk ) x Fig. A.1. Figure shows the pursuer and the evader, at rpk = (0, 0) and rek = (Dk , 0)  respectively, separated by Dk at time tk . Be rek , ν(t − tk ) is the ball centered at rek with radius ν(t − tk ) and indicates the reachable set of the evader for t ∈ [tk , tk+1 ). Thus, our pursuit trajectory is parallel to the x−axis as θp (tk ) = 0. The pursuer does not observe the evader till the next update instance, thus θp (t) = 0 for tk+1 − tk . The modified dynamics are given by ẋp = 1, ẋe = ν cos θe , ẏp = 0, ẏe = ν sin θe . (A.1) From (A.1), rp (t) = (t − tk , 0) for t ∈ [tk , tk+1 ). Thus, 2 Ṙ = (xe −xp )(ẋe − ẋp )+(ye −yp )(ẏe − ẏp ), where R = r2 and r is the separation. Ṙ = ν(xe − t + tk ) cos θe + νye sin θe + t − tk − xe . Using τ , t − tk , Ṙ = ν(xe − τ ) cos θe + νye sin θe + τ − xe . (A.2) The agent updates when Ṙ can possibly become nonnegative. For τ ≥ 0, re ∈ Be (rek , ντ ). Ṙτ (xe , ye , θe ) explicitly denotes Ṙ in (A.2) in terms of evader parameters, for fixed τ . The problem is formulated as sup xe ,ye ,θe subject to Ṙτ (xe , ye , θe ), (A.3) (xe , ye ) ∈ Be (rek , ντ ). For τ ≥ 0, g(τ ) denotes the optimal value of problem (A.3) and the self-triggered update duration is defined as φkν = inf {τ ∈ R>0 | g(τ ) = 0} . In R2 , Be (rek , ντ ) , (xe − Dk )2 + ye2 ≤ (ντ )2 . The constraint of the problem (A.3) is independent of θe . Ṙτ ∂ Ṙτ θ + νy cos θe . Setting ∂∂θ =0 ∂θe = −ν(xe − τ ) sin e  e  e ye ∗ yields θe = arctan xe −τ . Note that for τ ∈ [0, φkν ), xe − τ ≥ 0. To see this, suppose xe − τ < 0. Setting θe = 0 in (A.2), we get Ṙτ = −(1 − ν)(xe − τ ) > 0 for ν ∈ [0, 1), which is a contradiction as Ṙ ≤ 0 for any τ ∈ [0, φkν ). Due to symmetry of the problem, we can assume ye ≥ 0. Since xe − τ ≥ 0, we have θe∗ ∈ [0, π2 ]. Substituting θe∗ in (A.2), we get Derivation of Self-triggered Update Duration The agents are modelled by the dynamics in (4). At time tk , the pursuer observes the evader at a distance Dk = krek − rpk k. Without loss of generality, we make the relative vector between pursuer and the evader parallel to the x−axis such that yp (tk ) = 0 and ye (tk ) = 0. Additionally, as a matter of convenience, we assume that 0 = xp (tk ) < xe (tk ) = Dk . This is elaborated in Fig. A.1. Ṙτ (xe , ye ) = ν 11 p ye2 + (xe − τ )2 + τ − xe , where which simplifies the problem in (A.3) to √ ν 2 1 − ν 2 − ν(1 − ν 2 ) ϕ± (ν) = 1 ± , 2ν 2 − 1 √ √ 3ν 3 + 1 − ν 2 − 2ν − 2ν 4 1 − ν 2 √ ϕ2 (ν) = . (ν − 1 − ν 2 )(2ν 2 − 1) p Ṙτ (xe , ye ) = ν ye2 + (xe − τ )2 + τ − xe sup xe ,ye (A.4) subject to (xe , ye ) ∈ Be (rek , ντ ). For ν ∈ [0, 1), ϕ− (ν) ≤ ϕ2 (ν) ≤ ϕ+ (ν). This shows that x̃∗e (φ̃kν ) satisfies the constraints in the problem (A.5) at τ = φ̃kν . This means, at the instance of update, the maximizer x̃∗e of the relaxed problem is a feasible solution of the original problem (A.5) and hence it is optimal solution x∗e for (A.5). Thus g̃(τ ) = g(τ ) and as a result φ̃kν = φkν . Note that φkν is continuous in the parameter ν √ 2 −D (1−ν 2 ) k as limν→ √1 Dk ν 1−ν = D2k . 2ν 2 −1 From the constraint (xe , ye ) ∈ Be (rek , ντ ) we get ye2 ≤ (ντ )2 − (xe − Dk )2 , which means that ye∗ must lie at the boundary of Be (rek , ντ ). Thus, ye∗ = p (ντ )2 − (xe − Dk )2 . Substituting ye∗ in Ṙτ (xe , ye ), we get Ṙτ (xe ) = ν p (xe − τ )2 + (ντ )2 − (xe − Dk )2 + τ − xe . 2 This reduces the problem in (A.4) to Ṙτ (xe ) sup xe subject to B Maximum Separation If the pursuer updates its trajectory using the selftriggered update policy described in (A.6), then the maximum distance between the agents, between successive updates, is given by (A.5) xe ∈ [Dk − ντ, Dk + ντ ]. k Dmax = Dk − (1 − ν)φkν . Note that we can relax the problem in (A.5) by omitting the constraint xe ∈ [Dk − ντ, Dk + ντ ]. The relaxation of (A.5) results in an unconstrained optimization problem. Ignoring the constraints of problem (A.5), let g̃(τ ) , sup Ṙτ (xe ) and φ̃kν = inf{τ ∈ R>0 | g̃(τ ) = 0}. To see this, after the duration φkν , the pursuer moves a distance of φkν units and the evader evader can be anywhere inside a ball of radius νφkν centered at rek . This is shown in Fig. B.1. The maximum separation between k the pursuer and the evader is denoted by Dmax and is k given by Dk − (1 − ν)φν . xe As a result of this relaxation, we have φ̃kν ≤ φkν . Let x̃∗e := argmax Ṙτ (xe ) for the unconstrained problem. To perform unconstrained maximization of Ṙτ (xe ), the derivaν(Dk −τ ) Ṙτ tive is given by ∂∂x = √ − 1. 2 2 2 e (xe −τ ) +(ντ ) −(xe −Dk ) 2 D2 ν 2 +Dk −2τ Dk ν 2 −τ 2 ∂ Ṙτ ∗ . As Setting ∂xe = 0 yields x̃e = k 2(Dk −τ ) ∗ ∗ x̃e := argmax Ṙτ (xe ), g̃(τ ) = Ṙτ (x̃e ) and is given by 2 D2 ν 2 +Dk −2τ Dk ν 2 −τ 2 g̃(τ ) = τ − k + ν 2 (Dk − τ ). Solving 2(Dk −τ ) rpk P Be rek , νφkν rek+1 Dk+1  rek φkν rpk+1 E Dk νφkν for inf{τ ∈ R>0 |, g̃(τ ) = 0}, yields √ Dk ν 1 − ν 2 − Dk (1 − ν 2 ) k φ̃ν = . 2ν 2 − 1 k Dmax (A.6) Fig. B.1. Dk+1 indicates the new separation between the agents at tk+1 . Be (rek , νφkν ) outlines the boundary of the k reachable set of the evader after φkν . Dmax denotes the maximum possible separation between the pursuer and the evader at t = tk + φkν . Recall that φ̃kν ≤ φkν , where φ̃kν was obtained from relaxing the constraint in problem (A.5). Our claim is that at the instance of update (τ = φ̃kν ), the maximizer x̃∗e of the relaxed problem is a feasible solution of the problem (A.5), i.e. x̃∗e (τ ) ∈ [Dk − ντ, Dk + ντ ] for τ = φ̃kν . To see this, at τ = φ̃kν , the maximizer x̃∗e , Dk + ντ and Dk − ντ are given by Dk − ν φ̃kν = Dk ϕ− (ν), x̃∗e (φ̃kν ) = Dk ϕ2 (ν), Dk + ν φ̃kν = Dk ϕ+ (ν), 12
3cs.SY
Diffeomorphic random sampling using optimal information transport arXiv:1704.07897v1 [math.NA] 25 Apr 2017 Martin Bauer1 , Sarang Joshi2 , and Klas Modin3 1 3 Department of Mathematics, Florida State University bauer@math.fsu.edu 2 Department of Bioengineering, Scientific Computing and Imaging Institute, University of Utah sjoshi@sci.utah.edu Department of Mathematical Sciences, Chalmers University of Technology and the University of Gothenburg klas.modin@chalmers.se Abstract. In this article we explore an algorithm for diffeomorphic random sampling of nonuniform probability distributions on Riemannian manifolds. The algorithm is based on optimal information transport (OIT)—an analogue of optimal mass transport (OMT). Our framework uses the deep geometric connections between the Fisher-Rao metric on the space of probability densities and the right-invariant information metric on the group of diffeomorphisms. The resulting sampling algorithm is a promising alternative to OMT, in particular as our formulation is semi-explicit, free of the nonlinear Monge–Ampere equation. Compared to Markov Chain Monte Carlo methods, we expect our algorithm to stand up well when a large number of samples from a low dimensional nonuniform distribution is needed. Keywords: density matching, information geometry, Fisher–Rao metric, optimal transport, image registration, diffeomorphism groups, random sampling MSC2010: 58E50, 49Q10, 58E10 1 Introduction We construct algorithms for random sampling, addressing the following problem. Problem 1. Let µ be a probability distribution on a manifold M . Generate N random samples from µ. The classic approach to sample from a probability distribution on a higher dimensional space is to use Markov Chain Monte Carlo (MCMC) methods, for example the Metropolis–Hastings algorithm [6]. An alternative idea is to use diffeomorphic density matching between the density µ and a standard density µ0 from which samples can be drawn easily. Standard samples are then transformed by the diffeomorphism to generate non-uniform samples. In Bayesian inference, for example, the distribution µ would be the posterior distribution and µ0 would be the prior distribution. In case the prior itself is hard to sample from the uniform distribution can be used. For M being a subset of the real line, the standard approach is to use the cumulative distribution function to define the diffeomorphic transformation. If, however, the dimension of M is greater then one there is no obvious change of variables to transform the samples to the distribution of the prior. We are thus led to the following matching problem. Problem 2. Given a probability distribution µ on M , find a diffeomorpism ϕ such that ϕ∗ µ0 = µ. Here, µ0 denotes a standard distribution on M from which samples can be drawn, and ϕ∗ is the the push-forward of ϕ acting on densities, i.e., ϕ∗ µ0 = |Dϕ|µ0 ◦ ϕ, where |Dϕ| is the Jacobian determinant. A benefit of transport-based methods over traditional MCMC methods is cheap computation of additional samples; it amounts to drawing uniform samples and then evaluating the transformation. On the other hand, transport-based methods scale poorly with increasing dimensionality of M , contrary to MCMC. The action of the diffeomorphism group on the space of smooth probability densities is transitive (Moser’s lemma [13]), so existence of a solution to Problem 2 is guaranteed. However, if the dimension of M is greater then one, there is an infinite-dimensional space of solutions. Thus, one needs to select a specific diffeomorphism within the set of all solutions. Moselhy and Marzouk [12] and Reich [15] proposed to use optimal mass transport (OMT) to construct the desired diffeomorphism ϕ, thereby enforcing ϕ = ∇c for some convex function c. The OMT approach implies solving, in one form or another, the heavily nonlinear Monge–Ampere equation for c. A survey of the OMT approach to random sampling is given by Marzouk et. al. [9]. In this article we pursue an alternative approach for diffeomorphic based random sampling, replacing OMT by optimal information transport (OIT), which is diffeomorphic transport based on the Fisher–Rao geometry [11]. Building on deep geometric connections between the Fisher–Rao metric on the space of probability densities and the right-invariant information metric on the group of diffeomorphisms [7, 11], we developed in [3] an efficient numerical method for density matching. The efficiency stems from a solution formula for ϕ that is explicit up to inversion of the Laplace operator, thus avoiding the solution of nonlinear PDE such as Monge–Ampere. In this paper we explore this method for random sampling (the initial motivation in [3] is medical imaging, although other applications, including random sampling, are also suggested). The resulting algorithm is implemented in a short MATLAB code, available under MIT license at https://github.com/kmodin/oit-random. 2 2 Density Transport Problems Let M be an d–dimensional orientable, compact manifold equipped with a Riemannian metric g = h., .i. The volume density induced by g is denoted µ0 and without loss ofRgenerality we assume that the total volume of M with respect to µ0 is one, i.e., M µ0 = 1. Furthermore, the space of smooth probability densities on M is given by Z Prob(M ) = {µ ∈ Ω d (M ) | µ > 0, µ = 1}, (1) M d where Ω (M ) denotes the space of smooth d-forms. The group of smooth diffeomorphisms Diff(M ) acts on the space of probability densities via push-forward: Diff(M ) × Prob(M ) 7→ Prob(M ) (ϕ, µ) → ϕ∗ µ . (2) (3) By a result of Moser [13] this action is transitive. We introduce the subgroup of volume preserving diffeomorphisms SDiff(M ) = {ϕ ∈ Diff(M ) | ϕ∗ µ0 = µ0 } . (4) Note that SDiff(M ) is the isotropy group of µ0 with respect to the action of Diff(M ). The spaces Prob(M ), Diff(M ), and SDiff(M ) all have the structure of smooth, infinite dimensional Fréchet manifold. Furthermore, Diff(M ) and SDiff(M ) are infinite dimensional Fréchet Lie groups. A careful treatment of these Fréchet topologies can be found in the work by Hamilton [5]. In the following we will focus our attention on the diffeomorphic density matching problem (Problem 2). A common approach to overcome the nonuniqueness in the solution is to add a regularization term to the problem. That is, to search for a minimum energy solution that has the required matching property, for some energy functional E on the diffeomorphism group. Following ideas from mathematical shape analysis [10] it is a natural approach to define this energy functional using the geodesic distance function dist of a Riemannian metric on the diffeomorphism group. Then the regularized diffeomorphic matching problem can be written as follows. Problem 3. Given a probability density µ ∈ Prob(M ) we want to find the diffeomorphism ϕ ∈ Diff(M ) that minimizes the energy functional E(ϕ) = dist2 (id, ϕ) (5) over all diffeomorphisms ϕ with ϕ∗ µ0 = µ. The free variable in the above matching problem is the choice of Riemannian metric—thus distance function—on the group of diffeomorphisms. Although not formulated as here, Moselhy and Marzouk [12] proposed to use the L2 metric on Diff(M ) Z Gϕ (u ◦ ϕ, v ◦ ϕ) = hu ◦ ϕ, v ◦ ϕi µ0 (6) M 3 for u ◦ ϕ, v ◦ ϕ ∈ Tϕ Diff(M ). This corresponds to distance-squared optimal mass transport (OMT), which induces the Wasserstein L2 distance on Prob(M ), see, for example, [14, 8, 16]. In this article we use the right-invariant H 1 -type metric GIϕ (u ◦ ϕ, v ◦ ϕ) = − Z h∆u, viµ0 + λ M k Z X i=1 Z hu, ξi iµ0 M hv, ξi iµ0 , (7) M where λ > 0, ∆ is the Laplace–de Rham operator lifted to vector fields, and ξ1 , . . . , ξk is an orthonormal basis of the harmonic 1-forms on M . Because of the Hodge decomposition theorem, GI is independent of the choice of orthonormal basis ξ1 , . . . , ξk for the harmonic vector fields. This construction is related to the Fisher-Rao metric on the space of probability density [4, 2], which is predominant in the field of information geometry [1]. We call GI the information metric. See [7, 11, 3] for more information on the underlying geometry. The connection between the information metric and the Fisher-Rao metric allows us to construct almost explicit solutions formulas for Problem 2 using the explicit formulas for the geodesics of the Fisher-Rao metric. Theorem 1 ([11, 3]) Let µ ∈ Prob(M ) be a smooth probability density. The diffeomorphism ϕ ∈ Diff(M ) minimizing distGI (id, ϕ) under the constraint ϕ∗ µ0 = µ is given by ϕ(1), where ϕ(t) is obtained as the solution to the problem µ̇(t) ◦ ϕ(t), µ(t) v(t) = ∇(f (t)), ∆f (t) = d ϕ(t)−1 = v(t) ◦ ϕ(t)−1 , dt (8) ϕ(0) = id where µ(t) is the (unique) Fisher-Rao geodesic connecting µ0 and µ  r 2 Z r sin ((1 − t)θ) sin (tθ) µ µ + µ0 . µ0 , cos θ = µ(t) = sin θ sin θ µ0 µ0 M (9) The algorithm for diffeomorphic random sampling, described in the following section, is directly based on solving the equations (8). 3 Numerical Algorithm In this section we explain the algorithm for random sampling using optimal information transport. It is a direct adaptation of [3, Algorithm 1]. Algorithm 1 (OIT based random sampling) Assume we have a numerical way to represent functions, vector fields, and diffeomorphisms on M , and numerical methods for 4 – – – – – composing functions and vector fields with diffeomorphisms, computing the gradient of functions, computing solutions to Poisson’s equation on M , sampling from the standard distribution µ0 on M , and evaluating diffeomorphisms. An OIT based algorithm for Problem 1 is then given as follows: 1. Choose a step size ε = 1/K for some positive integer K and calculate the k Fisher-Rao geodesic µ(t) and its derivative µ̇(t) at all time points tk = K using equation (9). 2. Initialize ϕ0 = id. Set k ← 0. k) 3. Compute sk = µ̇(t µ(tk ) ◦ ϕk and solve the Poisson equation ∆fk = sk . (10) 4. Compute the gradient vector field vk = ∇fk . 5. Construct approximations ψk to exp(−εvk ), for example ψk = id −εvk . (11) ϕk+1 = ϕk ◦ ψk . (12) 6. Update the diffeomorphism4 7. Set k ← k + 1 and continue from step 3 unless k = K. 8. Draw N random samples x1 , . . . xN from the uniform distribution µ0 . 9. Set yn = ϕK (xn ), n ∈ {1, . . . N }. The algorithm generates N random samples y1 , . . . , yN from the distribution µ. One can save ϕK and repeat 8-9 whenever additional samples are needed. The computationally most intensive part of the algorithm is the solution of Poisson’s equation at each time step. Notice, however, that we do not need to solve nonlinear equations, such as Monge–Ampere, as is necessary in OMT. 4 Example In this example we consider M = T2 ' (R/2πZ)2 with distribution defined in Cartesian coordinates x, y ∈ [−π, π) by µ ∼ 3 exp(−x2 − 10(y − x2 /2 + 1)2 ) + 2 exp(−(x + 1)2 − y 2 ) + 1/10, (13) normalized so that the ratio between the maximum and mimimum of µ is 100. The resulting density is depicted in Fig. 1 (left). We draw 105 samples from this distribution using a MATLAB implementation of our algorithm, available under MIT license at 4 −1 −1 If needed, one may also compute the inverse by ϕ−1 k+1 = ϕk + εv ◦ ϕk . 5 https://github.com/kmodin/oit-random The implementation can be summarized as follows. To solve the lifting equations (8) we discretize the torus by a 256 × 256 mesh and use the fast Fourier transform (FFT) to invert the Laplacian. We use 100 time steps. The resulting diffeomorphism is shown as a mesh warp in Fig. 2. We then draw 105 uniform samples on [−π, π]2 and apply the diffeomorphism on each sample (applying the diffeomorphism corresponds to interpolation on the warped mesh). The resulting random samples are depicted in Fig. 1 (right). To draw new samples is very efficient. For example, another 107 samples can be drawn in less than a second on a standard laptop. Fig. 1. (left) The probability density µ of (13). The maximal density ratio is 100. (right) 105 samples from µ calculated using our OIT based random sampling algorithm. 5 Conclusions In this paper we explore random sampling based on the optimal information transport algorithm developed in [3]. Given the semi-explicit nature of the algorithm, we expect it to be an efficient competitor to existing methods, especially for drawing a large number of samples from a low dimensional manifold. However, a detailed comparison with other methods, including MCMC methods, is outside the scope of this paper and left for future work. We provide an example of a complicated distribution on the flat 2-torus. The method is straighforward to extended to more elaborate manifolds, e.g., by using finite element methods for the efficient solution of Poisson’s equation on manifolds. For non-compact manifolds, most importantly Rn , one might use standard techniques, such as Box–Muller, to first transform the required distribution to a compact domain. 6 Fig. 2. The computed diffeomorphism ϕK shown as a warp of the uniform 256 × 256 mesh (every 4th mesh-line is shown). Notice that the warp is periodic. It satisfies ϕ∗ µ0 = µ and solves Problem 3 by minimizing the information metric (7). The ratio between the largest and smallest warped volumes is 100. 7 Bibliography [1] Amari, S., Nagaoka, H.: Methods of information geometry. Amer. Math. Soc., Providence, RI (2000) [2] Bauer, M., Bruveris, M., Michor, P.W.: Uniqueness of the Fisher-Rao metric on the space of smooth densities. Bull. Lond. Math. Soc. 48(3), 499–506 (2016) [3] Bauer, M., Joshi, S., Modin, K.: Diffeomorphic density matching by optimal information transport. SIAM J. Imaging Sci. 8(3), 1718–1751 (2015) [4] Friedrich, T.: Die Fisher-information und symplektische strukturen. Math. Nachr. 153(1), 273–296 (1991) [5] Hamilton, R.S.: The inverse function theorem of Nash and Moser. Bull. Amer. Math. Soc. (N.S.) 7(1), 65–222 (1982) [6] Hastings, W.K.: Monte Carlo sampling methods using Markov chains and their applications. Biometrika 57(1), 97–109 (1970) [7] Khesin, B., Lenells, J., Misiolek, G., Preston, S.C.: Geometry of diffeomorphism groups, complete integrability and geometric statistics. Geom. Funct. Anal. 23(1), 334–366 (2013) [8] Khesin, B., Wendt, R.: The Geometry of Infinite-dimensional Groups, A Series of Modern Surveys in Mathematics, vol. 51. Springer-Verlag, Berlin (2009) [9] Marzouk, Y., Moselhy, T., Parno, M., Spantini, A.: Sampling via measure transport: An introduction. In: Ghanem, R., Higdon, D., Owhadi, H. (eds.) Handbook of Uncertainty Quantification. Springer International Publishing, Cham (2016) [10] Miller, M.I., Trouvé, A., Younes, L.: On the metrics and euler-lagrange equations of computational anatomy. Annu Rev Biomed Eng. (4), 375–405 (2002) [11] Modin, K.: Generalized Hunter–Saxton equations, optimal information transport, and factorization of diffeomorphisms. J. Geom. Anal. 25(2), 1306–1334 (2015) [12] Moselhy, T.A.E., Marzouk, Y.M.: Bayesian inference with optimal maps. Journal of Computational Physics 231(23), 7815 – 7850 (2012) [13] Moser, J.: On the volume elements on a manifold. Trans. Amer. Math. Soc. 120, 286–294 (1965) [14] Otto, F.: The geometry of dissipative evolution equations: the porous medium equation. Comm. Partial Differential Equations 26(1-2), 101–174 (2001) [15] Reich, S.: A nonparametric ensemble transform method for Bayesian inference. SIAM Journal on Scientific Computing 35(4), A2013–A2024 (2013) [16] Villani, C.: Optimal transport: old and new, Grundlehren der Mathematischen Wissenschaften, vol. 338. Springer-Verlag, Berlin (2009)
10math.ST
arXiv:1705.05783v1 [math.NA] 15 May 2017 Adaptive Algebraic Multiscale Solver for Compressible Flow in Heterogeneous Porous Media Matei Ţene a,1,∗ Yixuan Wang b,2 Hadi Hajibeygi a,3 a Department of Geoscience and Engineering, Faculty of Civil Engineering and Geosciences, Delft University of Technology, P.O. Box 5048, 2600 GA Delft, The Netherlands. b Department of Energy Resources Engineering, Stanford University, 367 Panama St., Rm. 065, Stanford, CA 94305-2220, USA. Abstract This paper presents the development of an Adaptive Algebraic Multiscale Solver for Compressible flow (C-AMS) in heterogeneous porous media. Similar to the recently developed AMS for incompressible (linear) flows [Wang et al., JCP, 2014], C-AMS operates by defining primal and dual-coarse blocks on top of the fine-scale grid. These coarse grids facilitate the construction of a conservative (finite volume) coarsescale system and the computation of local basis functions, respectively. However, unlike the incompressible (elliptic) case, the choice of equations to solve for basis functions in compressible problems is not trivial. Therefore, several basis function formulations (incompressible and compressible, with and without accumulation) are considered in order to construct an efficient multiscale prolongation operator. As for the restriction operator, C-AMS allows for both multiscale finite volume (MSFV) and finite element (MSFE) methods. Finally, in order to resolve highfrequency errors, fine-scale (pre- and post-) smoother stages are employed. In order to reduce computational expense, the C-AMS operators (prolongation, restriction, and smoothers) are updated adaptively. In addition to this, the linear system in the Newton-Raphson loop is infrequently updated. Systematic numerical experiments are performed to determine the effect of the various options, outlined above, on the C-AMS convergence behaviour. An efficient C-AMS strategy for heterogeneous 3D compressible problems is developed based on overall CPU times. Finally, C-AMS is compared against an industrial-grade Algebraic MultiGrid (AMG) solver. Results of this comparison illustrate that the C-AMS is quite efficient as a nonlinear solver, even when iterated to machine accuracy. Key words: multiscale methods, compressible flows, heterogeneous porous media, scalable linear solvers, multiscale finite volume method, multiscale finite element method, iterative multiscale methods, algebraic multiscale methods. Preprint submitted to Elsevier Science 20 July 2015 1 Introduction Accurate and efficient simulation of multiphase flow in large-scale heterogeneous natural formations is crucial for a wide range of applications, including hydrocarbon production optimization, risk management of Carbon Capture and Storage, water resource utilizations and geothermal power extractions. Unfortunately, considering the size of the domain along with the high resolution heterogeneity of the geological properties, such numerical simulation is often beyond the computational capacity of traditional reservoir simulators. Therefore, Multiscale Finite Element (MSFE) [1, 2, 3, 4, 5] and Finite Volume (MSFV) [6, 7] methods and their extensions have been developed to resolve this challenge. A comparison of different multiscale methods, based on their original descriptions, has been studied in the literature [8]. MSFV and MSFE methods map a discrete fine-scale system to a much coarser space. In MultiGrid (MG) terminology [9], this map is considered as a special prolongation operator, represented by locally-supported (and adaptively updated) basis functions [10]. The restriction operator is then defined based on either a Finite Element (MSFE), Finite Volume (MSFV), or a combination of both. MSFV has been applied to a wide range of applications (see, e.g., [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]), thus recommending multiscale as a very promising framework for the next-generation reservoir simulators. However, most of these developments, including the state-of-the-art algebraic multiscale formulation (AMS) [19], have focused on the incompressible (linear) flow equations. When compressibility effects are considered, the pressure equation becomes nonlinear, and its solution requires an iterative procedure involving a parabolictype linear system of equations [22]. Therefore, the development of an efficient and general algebraic formulation for compressible nonlinear flows is crucial in order to advance the applicability of multiscale methods towards more realistic problems. The present study introduces the first algebraic multiscale iterative solver for compressible flows in heterogeneous porous media (C-AMS), along with a thorough study of its computational efficiency (CPU time) and convergence behaviour (number of iterations). In contrast to cases with incompressible flows, the construction of basis functions for compressible flow problems is not straightforward. In the past, incom∗ Corresponding author. 1 m.tene@tudelft.nl 2 yixuanw@stanford.edu 3 h.hajibeygi@tudelft.nl 2 pressible elliptic [23], compressible elliptic [10, 24], and pressure-independent parabolic [25] basis functions have been considered. However, the literature lacks a systematic study to reveal the benefit of using one option over the other, especially when combined with a fine-scale smoother stage. Moreover, no study of the overall efficiency of the multiscale methods (based on the CPU time measurements) has been done so far for compressible three-dimensional problems. In order to develop an efficient prolongation operator, in this work, several formulations for basis functions are considered. These basis functions differ from each other in the amount of compressibility involved in their formulation, ranging from incompressible elliptic to compressible parabolic types. In terms of the restriction operator, both MSFE and MSFV are considered, along with the possibility of mixing iterations of the former with those of the latter, allowing C-AMS to benefit from the Symmetric Positive Definite (SPD) property of MSFE and the conservative physically correct solutions of MSFV. The low-frequency errors are resolved in the global (multiscale) stage of CAMS, while high-frequency errors are tackled using a second-stage smoother at fine-scale. In this paper, we consider two options for the smoothing stage: the widely used local correction functions with different types of compressibility involved (i.e., more general than the specific pressure-independent operator [25]), as well as ILU(0) [26]. The best C-AMS procedure is determined among these various strategies, on the basis of the CPU time for 3D heterogeneous problems. It is important to note that the setup and linear system population are measured alongside the solve time - a study which has so far not appeared in the previously published compressible multiscale works. Though C-AMS is a conservative method (i.e., only a few iterations are enough in order to obtain a high-quality approximation of the fine-scale solution), in the benchmark studies of this work, it is iterated until machine accuracy is reached. And, thus, its performance as an exact solver is compared against an industrial-grade Algebraic MultiGrid (AMG) method, SAMG [27]. This comparative study for compressible problems is the first of its kind, and is made possible through the presented algebraic formulation, which allows for easy integration of C-AMS in existing advanced simulation platforms. Numerical results, presented for a wide range of heterogeneous 3D domains, illustrate that the C-AMS is quite efficient for simulation of nonlinear compressible flow problems. The paper is structured as follows. First, the Compressible Algebraic Multiscale Solver (C-AMS) is presented, where several options for the prolongation, restriction operators as well as the second-stage solver are considered. Then the adaptive updating of the C-AMS operators are studied, along with the possibility of infrequent linear system updates in the Newton-Raphson loop. 3 Numerical results are subsequently presented for a wide range of 3D heterogeneous test cases, aimed at determining the optimum strategy. Finally, the C-AMS is compared with an Algebraic MultiGrid Solver (i.e., SAMG) both in terms of the number of iterations and overall CPU time. 2 Compressible Flow in Heterogeneous Porous Media Single phase compressible flow in porous media, using Darcy’s law (without gravity and capillary effects), can be stated as:   ∂ (φρ) − ∇ . ρ λ · ∇p = ρq, ∂t (1) where φ, ρ, and q are the porosity, density, and the source terms, respectively. Moreover, λ = K/µ is the fluid mobility with positive-definite permeability tensor, K, while µ is the fluid viscosity. The semi-discrete form of this nonlinear flow equation using implicit (Eulerbackward) time integration reads   φn ρn 1 φn+1 n+1 n+1 − − ∇ . ρ λ · ∇p = q, ∆t ∆tρn+1 ρn+1 (2) which is linearized as cν (pν+1 − pν ) − 1 ∇ . (ρν λ · ∇pν+1 ) = bν , ν ρ (3) where " ν !ν 1 ∂φ  ∂ 1    n c =  − φn  ρ ∆t ∂p  ∂p ρ  ν # (4) and bν = − φν φ n ρn + + q. ∆t ∆t ρν (5) The superscripts (ν) and (ν + 1) denote the old and new Newton-Raphson iteration levels, respectively. Notethat, as (ν → ∞), Eq. (3) converges to the  ν+1 nonlinear Eq. (2), and p − pν → 0. Therefore, the coefficient c, which is a by-product of the linearization lemma, plays a role only during iterations. This fact opens up the possibility to alter c by computing it based on either pν (resulting in cν ) or pn (corresponding to cn ) -the pressure at the previous timestep. Each choice can potentially lead to a different convergence behaviour and, thus, computational efficiency. 4 Algebraically, Eq. (3) can be written for the unknown pressure vector p as   C ν + Ãν pν+1 ≡ Aν pν+1 = f ν ≡ bν + C ν pν , (6) where C ν is a diagonal matrix having (cνi dVi ) at cell i in its i-th diagonal entry, where dVi is the volume of cell i. Also, Ã is the convective compressible flow matrix, having fine-scale transmissibilities computed on the basis of a finitevolume scheme as entries. Moreover, the vector bν contains the integrated source terms in the fine-scale volumes, i.e., (qi dVi ). The total Right-HandSide (RHS) terms are denoted by the vector f ν . 3 Compressible Algebraic Multiscale Solver (C-AMS) The C-AMS relies on the primal- and dual-coarse grids, which are superimposed on the fine-scale grid (See Fig. 1). There are Np and Nd coarse and dual-coarse grid cells in a domain with Nf fine-grid cells. ˘k ⌦ ˜j ⌦ xk Dual-Coarse Cell Coarse Cell Fig. 1. Multiscale grids imposed on the given fine grid. A primal- and a dual-coarse block are highlighted on the right and left sides, respectively. The transfer operators between fine-scale and coarse-scale are defined as the multiscale Restriction (R) and Prolongation (P ). The former is defined based on either Finite Element (MSFE), i.e., RF E = P T , or Finite Volume (MSFV), for which RF V corresponds to the integral over primal-coarse blocks, i.e., RF V (i, j) =  1 , if fine-cell j is contained in primal-coarse block i 0 , otherwise. (7) The columns of P are the basis functions, which are computed on dual-coarse cells (see Fig. 1), subject to simplified boundary conditions (the localization assumption). 5 In contrast to the (incompressible) AMS, C-AMS can be formulated based on different choices of the basis functions, depending on the level of compressibility involved. The first two types read cν Φν+1 k,h − 1 ∇(ρν λ · ∇Φν+1 k,h ) = 0 ν ρ (8) and − 1 ∇ · (ρν λ · ∇Φν+1 k,h ) = 0, ρν (9) both being pressure dependent (through c and ρ), but different in the sense of the consideration of the accumulation term, c. Alternatively, one can also formulate basis functions using cn Φk,h − ∇ · (λ · ∇Φk,h ) = 0, (10) −∇ · (λ · ∇Φk,h ) = 0 (11) or which are both pressure independent (since c is now based on the pressure from the previous time step). All of these equations are subject to reduced-problem boundary conditions along dual-coarse cell boundaries ∂ Ω̃h [19]. One can also obtain the equations for the corresponding four types of local correction functions, Ψh , by substituting the corresponding RHS term in Eqs. (8)-(11). As mentioned before, in this work, systematic studies on the basis of the CPU time as well as the number of iterations are performed in order to find the optimum formulation for basis function (i.e., prolongation operator). The basis functions Φk are assembled over dual-coarse cells Ω̃h , ∀h ∈ {1, ..., Nd }, S d i.e., Φk = N Φ , and, if used, the correction functions are also assembled SNd h=1ν k,h as Ψ = h=1 Ψh . Fig. 2 illustrates that the basis functions do not form a partition of unity when compressibility effects are included, which is the intrinsic nature of the parabolic compressible equation. The choices formulated above affect computational efficiency of constructing and updating the multiscale operators. More precisely, while basis functions of Eqs. (8) and (9) depend on pressure (hence, updated adaptively when pressure changes), Eqs. (10) and (11) are pressure independent; thus, they only need to be computed once for single-phase problems (for multi-phase flows, they need to be adaptively updated when local transmissibility changes beyond a prescribed threshold value). While the basis and correction functions from Eq. (10) were previously used [25], the other options are, as of yet, have not been studied. 6 1 1 0.5 0.5 0 0 (a): cν Φν+1 − 1 ∇ ρν . (ρν λ · ∇Φν+1 ) = 0 1 1 0.5 0.5 0 0 (b): −∇ . (λ · ∇Φ) = 0 Fig. 2. Two choices of multiscale basis functions in a reference dual-coarse block (left column), Summation of the basis functions over the dual-coarse block (right column), i.e., partition of unity check. The C-AMS approximates the fine-scale solution pν by p0ν using the Prolongation operator P , which is a matrix of size Nf × Nc , having basis function Φk in its k − th column. The map between the coarse (p̆) and fine-scale solution (p0 ) reads p0 = P p̆. (12) The coarse-scale system is obtained using the restriction operator, R, as Ăν p̆ν+1 ≡ (RAν P )p̆ν+1 = Rf ν , (13) and its solution is prolonged to the fine-scale using Eq. (12), i.e., p0ν+1 = P (RAν P )−1 Rf ν . (14) δp0ν+1 = P (RAν P )−1 Rr ν . (15) In residual form, it reads Here p0ν+1 = (pν + δp0ν+1 ), while r ν = (f ν − Aν pν ) is the fine-scale residual. 7 Note that all the different options for basis functions can be considered in construction of the prolongation operator. The C-AMS employs Eq. (14) as the global solver (for resolving low-frequency errors). In addition to the coarse-scale solver, an efficient convergent multiscale solver needs to include a second-stage smoother at fine scale. The smoother accounts for the high-frequency errors, arising from simplified localization conditions, the nonlinearity of the operator, and the complex RHS term. Among the choices for this smoother (block-, line-, or point-wise solvers), the correction functions (CF) and ILU(0) are considered in this work. The C-AMS procedure is finally summarized in Table 1. Do until convergence (kkν2 < e) achieved (See Eq. (19)) { 1. Initialize: update linear system components, Aν and f ν , based on pν 2. Update residual: r ν = f ν − Aν pν 3. Adaptively compute Basis Functions: use either of Eqs. (8)-(11) 4. Pre-smoothing Stage: only if CF is used, apply CF on r ν and update residual 5. Multiscale Stage: Solve (15) for δp0ν+1/2 6. Post-smoothing Stage: smooth δp0ν+1/2 for ns times using a fine-scale iterative solver (here, ILU(0) is used), obtaining δp0ν+1 7. Update solution: pν+1 = (pν + δp0ν+1/2 + δp0ν+1 ) 8. Update error: compute ν , and assign pν ← pν+1 } Table 1 C-AMS iteration procedure, converging to pn+1 with tolerance e. In the next section, numerical results for 3D heterogeneous test cases are presented, in order to provide a thorough assessment of the applicability of C-AMS to large-scale problems. 4 Numerical Results The numerical experiments presented in this section are divided into: (1) finding a proper iterative procedure and multi-stage multiscale components for efficiently capturing the nonlinearity within the flow equation, and (2) systematic performance study by comparing against a commercial algebraic multigrid solver, i.e., SAMG [27]. Note that the second aspect is mainly to provide the computational physics community with an accurate assessment of the convergence properties of the state-of-the-art compressible multiscale solver (i.e., C-AMS). As an advantage over many advanced linear solvers, C-AMS allows 8 for construction of locally conservative velocity after any MSFV stage. Therefore, for multiphase flow scenarios, only a few C-AMS iterations are necessary to obtain accurate solutions [16]. For the studied numerical experiments of this paper, sets of log-normally distributed permeability fields with spherical variograms are generated by using sequential Gaussian simulations [28]. The variance and mean of natural logarithm of the permeability, i.e., ln(k), for all test cases are 4 and -1, respectively, unless otherwise is mentioned. Furthermore, the fine-scale grid size and dimensionless correlation lengths in the principle directions, i.e., ψ1 , ψ2 and ψ3 , are provided in Table 2. Each set has 20 statistically-equivalent realizations. The sets with orientation angle of 15◦ are referred to as the layered fields. Also, the grid aspect ratio α is 1, i.e., ∆x/α = ∆y = ∆z = 1 m, unless otherwise is specified. Permeability Set 1 2 3 4 5 6 Fine-scale grid 643 1283 2563 643 1283 2563 ψ1 0.125 0.125 0.125 0.5 0.5 0.5 ψ2 0.125 0.125 0.125 0.03 0.03 0.03 ψ3 0.125 0.125 0.125 0.01 0.06 0.01 Angle between ψ1 and y direction 15◦ patchy Variance of ln(k) 4 Mean of ln(k) -1 Table 2 Permeability sets (each with 20 statistically-equivalent realizations) used for numerical experiments of this paper. Layered fields refer to the sets 4-6, in which the orientation angle between ψ1 and y direction is 15◦ . Phase properties and simulation time are described as non-domensional numbers. The non-dimensional pressure and density are introduced as p∗ = p − peast , pwest − peast (16) and ρ = 1 + η p∗ , (17) ρ0 respectively, where the coefficient η is set to 1 for all subsequent test cases in this paper. ρ∗ = The pwest and peast values of 106 and 0 Pa, relative to the Standard (Atmospheric) condition, are considered. These correspond to non-dimensional pressure values of 1 and 0, which are set as Dirichlet conditions at the west and 9 east boundaries, respectively, for all the cases unless otherwise is mentioned. Also, all the other surfaces are subject to no-flow Neumann conditions. The non-dimensional time is introduced as t∗ = t/τ , where τ= µφL2 . K̄(pwest − peast ) (18) Here, K̄ is the average permeability, and L is a length scale of the domain. With the values of 106 Pa pressure difference, in-situ viscosity of 2×10−6 Pa.s, ∆x = 1 m, φ = 0.1, and K̄ value of 10−12 m2 for homogeneous cases, the τ will be 128 s for problem size of L = 64 m in SI units. The implementation used to obtain the results presented in this paper consists of a single-threaded object-oriented C++ code, and the CPU times were measured on an Intel Xeon E5-1620 v2 quad-core system with 64GB RAM. 4.1 C-AMS: determining the most effective iterative procedure and multistage multiscale components The efficient capturing of the nonlinearity within the iterations is important in designing an efficient multiscale strategy. For the purposes of a conclusive result, in this section, a set of 20 statistically-equivalent patchy fields, i.e., permeability Set 1 from Table 2, is considered. One of the realizations and its corresponding solution at t∗ = 0.4 are shown in Fig. 3. Fig. 3. Natural-log of the permeability (left) and pressure solution after t∗ = 0.4 (right) corresponding to one of the realization of permeability Set 1 from Table 2. 10 4.1.1 Nonlinear and linear level updates In formulating a convergence criterion for the C-AMS, one can express the error of the approximate solution at step ν on the basis of either the linear or nonlinear expressions. According to Eq. (2), the nonlinear error in each grid cell reads ν = q −   φn ρn Sαn 1 φn+1 n+1 n+1 + + ∇ · ρ λ · ∇p , ∆t ∆t ρn+1 ρn+1 (19) and is assembled in the vector ν , which allows the computation of the error norm, kν k2 . On the other hand, the linear-level error is based on the linearized equation (3), which leads to the computation of the residual norm, kr ν k2 . In order to determine a suitable sequence of the linear and nonlinear stages, the same patchy domain of 64 × 64 × 64 grid cells is considered (Fig. ??), for which the pressure equation is solved using the following solution strategy: Do until (kk2 < 10−6 ) is reached { 0. Update parameters, linear system matrix and RHS vector based on pν 1. Solve linear system using the Richardson iterative scheme, preconditioned with one multigrid V-cycle until krk2 < 10−6 } Table 3 Solution strategy used to determine a suitable stopping criterion The error and residual norms were recorded after each iteration of the Richardson loop and are presented in Fig. 4. Note that the reduction of the residual norm beyond the first few iterations does not contribute to the reduction in the (nonlinear) error norm. Therefore, one could ideally speed up the solution scheme by monitoring the error norm and updating the linear system after its decrease starts to stagnate. However, the computational cost of evaluating the nonlinear equation is roughly the same as that of a linear system update and, thus, much more expensive than the evaluation of the residual norm. Fig. 4(a) also reveals that the stagnation of the error norm happens roughly after the residual norm has been approximately reduced by 1/10 of its initial value (i.e., immediately after the linear system update). Fig. 4(b) shows the convergence behaviour after implementing this heuristic strategy, which is deemed quite efficient, since the two norms are in agreement. Hence, in the following experiments the same strategy is employed, i.e., for linear level, kr i k2 < 10−1 after iteration i of the inner (linear) loop and, for nonlinear kr 0 k2 level, kν k2 < 10−6 after iteration ν of the outer (nonlinear) loop are set (see Table 3). 11 2 2 10 10 Error norm Residual norm 1 10 0 0 10 −1 10 −2 10 −3 10 −4 10 −5 10 −6 10 10 −1 10 −2 10 −3 10 −4 10 −5 10 −6 10 −7 −7 10 0 Error norm Residual norm 1 10 20 40 60 Iteration 80 100 10 120 0 5 (a) 10 15 Iteration 20 25 30 (b) Fig. 4. Error and residual norm histories for one of the realizations of permeability Set 1 from Table 2 over a single time step of t∗ = 0.4. Shown on the left is the strategy where at each nonlinear stage, the fully converged linear solution is obtained. Shown on the right is the strategy where in each outer (nonlinear) loop the residual is reduced only by one order of magnitude. 4.1.2 Adaptive updating of multiscale operators The previous study described the first adaptive aspect considered in this work, namely, updating the linear system only after the residual norm drops by an order of magnitude. The C-AMS procedure can be further optimized by employing adaptive updates of its multiscale components, i.e., the basis and (if considered) the correction functions. To this end, one has to monitor the changes in the entries of the transmissibility matrix A and RHS f between the iteration steps. Fig. 5(c) shows that the adaptive update of the C-AMS basis functions leads to a significant speed-up in terms of CPU time. Furthermore, the two adaptivity methods (for linear system and local function updates) are combined and shown in Fig. 5(d). Hence, C-AMS will perform its iterations such that it exploits all adaptivity within the multiscale components and the nonlinearity within the flow equation. Note that for this case, the compressible variant from Eq. (8) was used for both basis and correction functions. However, if the incompressible Eqs (10) and (11) are used, then the basis functions do not require updates during iterations. Finally, for this and all the following results (unless otherwise stated), the C-AMS coarsening ratio was taken as 8 × 8 × 8 , because it was found efficient (see Subsection 4.1.6). 4.1.3 C-AMS global stage: choice of basis functions The aim of this study is to determine an optimum choice for the type of basis functions for the C-AMS algorithm. The correction function is computed based on Eq. (8) in all cases (and, hence, updated adaptively with pressure), 20 iterations of ILU(0) are used for smoothing and all possibilities for the basis functions, i.e., Eqs. (8)-(11), are considered. Finally, there is a single 12 279.5869 sec 25 20 20 CPU time (sec) CPU time (sec) 515.8598 sec 25 15 10 5 0 0 15 10 5 5 10 15 Iteration 20 0 0 25 5 10 (a) 25 20 25 74.2812 sec 25 25 20 20 CPU time (sec) CPU time (sec) 20 (b) 83.1234 sec 15 10 5 0 0 15 Iteration 15 10 5 5 10 15 Iteration 20 0 0 25 (c) Multiscale solution Smoother solution 5 10 15 Iteration (d) Lin. sys. construction Basis functions Correction function Fig. 5. Effect of different types of adaptivity on the C-AMS performance for the permeability Set 1 from Table 2 after a time step of t∗ = 0.4: (a): No adaptivity, (b): Linear system update adaptivity only, (c): Multiscale operator update adaptivity only, (d): Fully adaptive, i.e in terms of both linear system and multiscale operator updates. time step in the simulation, which takes the initial solution at time 0 (p∗0 = 0 everywhere) to the solution at time t∗ = 0.4. The total CPU time spent in each stage of the solver, as well as the number of iterations (given on top of each bar in Fig. 6), are measured. Also, the success rate of convergence is given inside parentheses beside the average number of iterations. The results show that including compressibility in the basis functions does not translate into faster convergence and, thus the additional CPU time required to adaptively update them is not justified. In fact, it is more efficient to use the incompressible (pressure independent) basis functions from Eqs. (10) and (11). Also, the inclusion of the accumulation term and the type of Restriction (MSFE or MSFV) does not play an important role for this patchy test case. Note that none of the choices results in 100% successful convergence, even though 20 ILU(0) smoothing iterations have been employed at each iteration. 13 This can be attributed to the use of correction functions, as investigated in the next paragraph. CPU time (sec) Average CPU time of CF + MS + 20 ILU with different types of Prolongation and Restriction 80 Multiscale solution Smoother solution Lin. sys. construction Basis functions Correction function 29 (80%) 30 (95%) 34 (85%) 20 (95%) 60 40 30 (80%) 39 (95%) 34 (85%) 21 (95%) 20 0 M FE p: m co In EM :F m VM EM :F :F m cu Ac M FV p: m co In p+ m co cu Ac p+ M FE p: m co In In om C m VM :F m cu M Ac FV p: om C p+ om C cu Ac p+ om C Fig. 6. Effect of the choice of basis function on the C-AMS performance for the 643 grid-cell problem after a time step of t∗ = 0.4. Results are averaged over 20 statistically-equivalent realizations. The number of iterations is shown on top of each bar. The success percentage is also shown in parentheses. Note that all simulations employ correction functions. 4.1.4 C-AMS smoothing stage: choice of correction function Note that none of the results from the previous test case (Fig. 6) has a 100% success rate. As described in [19], the CF can be seen as an independent stage, the inclusion of which should be seen as an option and not a necessity for convergence. Fig. 7 presents the results of rerunning the previous experiment, this time varying the type of correction function. The plot confirms that eliminating the CF altogether leads to an overall speed-up, and, in addition, a convergence success rate of 100%. As described in [19], this can be explained by the sensitivity of CF to the heterogeneity of the permeability field, which leads to solver instability. Therefore, the CF should not be considered as candidate for the pre-smoothing stage in an efficient C-AMS procedure. Instead, ILU(0) is performed as post-smoother in order to resolve high-frequency errors. 4.1.5 C-AMS smoothing stage: number of smoother iterations Another variable in the C-AMS framework is the number of smoothing steps (here, ILU(0)) that should be applied in order to obtain the best trade-off between convergence rate and CPU time. The results of several experiments with the optimum choices (i.e., incompressible basis functions and no incorporation of CF) and various numbers of ILU applications are illustrated in Fig. 8. It is clear that with this C-AMS setup, an optimum scenario would 14 CPU time (sec) 40 30 Average CPU time of CF + MS + 20 ILU with different types of Correction and Restriction Multiscale solution Smoother solution Lin. sys. construction Basis functions Correction function 34(85%) 21(95%) 36(80%) 31(95%) 20 32(85%) 10 35(80%) 31(95%) 21(95%) 20(100%) 20(100%) 0 N N o rre co rre io ct io ct M FE n: EM M FV :F m VM EM :F :F m n: M cu M FE p: m co co o In FV p: m co In Ac cu M Ac p+ m co In p+ m co m cu M FE p: om FV p: om VM :F m cu Ac p+ om Ac p+ om In C C C C Fig. 7. Effect of the choice of correction function on the CPU time of the multiscale solution on the permeability Set 1 from Table 2 after a time step of t∗ = 0.4. The number of iterations is shown on top of each bar. Only the last 2 bars on the right correspond to runs in which no correction function was used (i.e., MS + 20 ILU). be found with 5-10 ILU iterations per second-stage call. Note that all C-AMS runs (without correction functions) converged successfully. Average CPU time of C-AMS[FV] with different number of smoothing steps 10 CPU time (sec) 8 217 (100%) 51 (100%) 30 (100%) 5 10 Multiscale solution Smoother solution Lin. sys. construction Basis functions Correction function 20 (100%) 23 (100%) 6 4 2 0 1 15 20 # smoothing steps Fig. 8. Effect of the number of ILU smoothing steps on the C-AMS[FV] performance for the permeability Set 1 from Table 2 (grid aspect ratio is 1) after a time step of t∗ = 0.4. The number of iterations is shown on top of each bar, with convergence success rate inside parentheses. Note that excluding CF leads to 100% success rate for all scenarios. 4.1.6 C-AMS sensitivity to coarsening ratio: trade-off between size of coarse system and local problem cost The coarsening factors used in this paper were found to be optimal after a careful study of the C-AMS sensitivity with the coarsening ratio. As for a thorough study of the new C-AMS solver, it is important to illustrate also its 15 sensitivity with change of coarse-scale system size (and thus the coarsening ratio). This important fact is studied and shown in Figs. 9-11 for patchy fields. Not that for the cases studied in this paper, the optimum overall CPU times were obtained with coarse-grid cells with the size of (approximately) the square-root of the domain length in each direction. C-AMS[FV] on 64x64x64 grid-cell reservoirs with different coarsening ratios 40 35 Initialization Lin. sys. construction Solution 865 20 CPU time (sec) 30 828 789 25 20 285 15 282 269 10 49 16 5 0 4 t∗ : 8 16 32 4 0.0-0.4∗ 15 44 8 16 32 41 4 0.4-1.0 ∗ 8 16 32 1.0-2.0∗ Fig. 9. Patchy fields: Averaged CPU time (over 20 realizations) of C-AMS[FV] for different coarsening ratios for the permeability Set 1 from Table 2. Results support the use of coarsening ratio of 83 . A similar behaviour was observed with the FE restriction operator. C-AMS[FV] on 128x128x128 grid-cell reservoirs with different coarsening ratios 1800 Initialization Lin. sys. construction Solution 20 4037 1600 CPU time (sec) 1400 1200 3683 1000 3547 800 600 1387 1379 400 200 0 4 t∗ : 39 197 8 16 15 32 64 4 15 179 31 0.0-0.4∗ 1321 8 16 29 32 ∗ 0.4-1.0 64 4 8 158 16 32 64 ∗ 1.0-2.0 Fig. 10. Patchy fields: Averaged CPU time (over 20 realizations) comparison of C-AMS [FV] for different coarsening ratios for the permeability Set 2 from Table 2. Results support the use of coarsening ratio of 83 . A similar behaviour was observed with the FE restriction operator. 16 C-AMS[FV] on 256x256x256 grid-cell reservoirs with different coarsening ratios 2500 Initialization Lin. sys. construction Solution 660 2000 CPU time (sec) 33 1500 624 566 1000 129 500 115 107 28 0 8 t∗ : 16 0.0-0.4∗ 32 26 8 16 0.4-1.0 ∗ 32 8 16 32 1.0-2.0∗ Fig. 11. Patchy fields: Averaged CPU time (over 20 realizations) comparison of C-AMS[FV] for different coarsening ratios for the permeability Set 3 from Table 2. A coarsening ratio of 163 offers the best balance between initialization (basis function computation) and solution time, while 83 results in a more expensive initialization but faster convergence in subsequent time-steps. A similar behaviour was observed with the FE restriction operator. 4.2 C-AMS benchmark versus SAMG On the basis of the previously presented studies, the optimal C-AMS strategy includes a global multiscale stage using incompressible basis functions (Eq. (11)), accompanied by 5 iterations of ILU for post-smoothing. In this subsection, C-AMS is compared against SAMG for three sets of different test cases: (1) the heterogeneous domains of different sizes from Table 2; (2): permeability Set 1 from Table 2 with stretched grids and line-source terms; and, (3): permeability Set 1 from Table 2 with different ln(k) variances (i.e., permeability contrasts). In all the presentd experiments, SAMG is called to perform a single V-cycle, repeatedly in a Richardson loop. Its adaptivity is controlled manually, i.e., at the beginning of each Newton-Raphson outer iteration, SAMG is allowed to update its Galerkin operators. On the other hand, during linear iterations, SAMG is instructed to reuse its previous grids and operators. For the test cases considered here, this approach was found more efficient (by a factor in excess of 2) than the automatic solver control described in [27], In all other aspects, SAMG has been used as a black-box commercial solver. 17 4.2.1 Test case 1: heterogeneous domains of different sizes from Table 2 In this subsection, C-AMS is compared against the SAMG algebraic multigrid solver for both patchy and layered permeability fields of Table 2 over 3 consecutive time steps. The time-lapse pressure solution for one patchy and one layered sample are shown in Fig. 12, illustrating the propagation of the signal from the western face through the entire domain. Figs. 13 and 14 show the number of iterations and CPU time at 3 consecutive non-dimensional times for different problem Sets 1, 2, 4, and 5 from Table 2. Note that C-AMS with FV-based restriction operator did not converge in some of the test cases, while the FE-based variant achieved 100% success rate due to its SPD property. Therefore, an ideal solution strategy would use MSFE to converge to the desired level of accuracy and then employ a single MSFV sweep, in order to ensure mass conservation [16]. In addition, Figs. 15 illustrate CPU time (vertical axis) and the total number of iterations (on top of each column), for permeability Sets 3 and 6 from Table 2, with 83 and 163 coarsening ratios. Note that, except for the first time-step, when all the basis functions are fully computed, C-AMS has a slight edge over SAMG, mainly due to its adaptivity and relatively inexpensive iterations. The initialization cost of C-AMS is particularly high in the 2563 case, due to the large number of linear systems (solved with a direct solver) needed for the basis functions. It is clear from Fig. 15 that with larger primal-coarse blocks C-AMS requires less setup time, but more iterations to converge. Note that all performance studies presented in this paper are for single-process computations. Since reservoir simulators are typically run for many time-steps, the high initialization time of C-AMS is outweighed by the efficiency gained in subsequent steps. Moreover, given the local support of the basis functions, this initialization can be greatly improved through parallel processing. Furthermore, only a few multiscale iteration may prove necessary to obtain an accurate approximation of the pressure solution in each time step for multi-phase flow problems. 18 Fig. 12. Pressure solution on one of the realizations of permeability Sets 1 (left) and 4 (right) from Table 2 at t∗ = 0.4, 1.0, and 2.0 from top to bottom, respectively. 19 64x64x64 patchy reservoir 7 CPU time (sec) 8 Initialization Lin. sys. construction Solution 6 5 64x64x64 layered reservoir 21 46 43 6 23 24 94 87 23 4 39 3 42 40 37 Initialization Lin. sys. construction Solution 86 80 78 71 21 21 4 2 2 1 0 0 ] FE S[ M V] -A [F C MS -A C G M SA ] FE S[ M V] -A [F C MS -A C G M SA ] FE S[ M V] -A [F C S M -A G M 1.0-2.0 C 0.4-1.0 SA ] FE S[ M V] -A [F C MS -A C G M SA ] FE S[ M V] -A [F C MS -A C G M SA ] FE S[ M V] -A [F C S M -A C G M SA t∗ : 0.0-0.4 0.0-0.4 0.4-1.0 1.0-2.0 Fig. 13. Averaged CPU time (over 20 realizations) comparison between the C-AMS and SAMG solvers on permeability Sets 1 (a) and 4 (b) from Table 2 over 3 successive time-steps. The coarsening ratio of C-AMS is 83 . Moreover, C-AMS employs 5 ILU smoothing steps per iteration. The number of iterations is given on top of each bar. 128x128x128 layered reservoir 128x128x128 patchy reservoir 60 34 35 Initialization Lin. sys. construction Solution CPU time (sec) 50 95 ⊗ 85 80 27 Initialization Lin. sys. construction Solution 60 40 26 27 30 30 20 89 ⊗ 76 29 33 27 40 30 26 82 ⊗ 68 25 20 10 0 0 ] FE S[ M V] -A [F C MS -A C G M SA ] FE S[ M V] -A [F C MS -A C G M SA ] FE S[ M V] -A [F C S M -A G M 1.0-2.0 C 0.4-1.0 SA ] FE S[ M V] -A [F C MS -A C G M SA ] FE S[ M V] -A [F C MS -A C G M SA ] FE S[ M V] -A [F C S M -A G M C SA t∗ : 0.0-0.4 0.0-0.4 0.4-1.0 1.0-2.0 Fig. 14. Averaged CPU time (over 20 realizations) comparison between the C-AMS and SAMG solvers on permeability Sets 2 (a) and 5 (b) from Table 2 over 3 successive time steps. C-AMS employs the coarsening ratio of 83 , along with 5 ILU smoothing steps per iteration. The number of iterations is given on top of each bar. The ⊗ symbol signifies convergence success rate of 72% when FV-based restriction operator was employed. 20 256x256x256 patchy, 8 3 coarsening ratio 2000 34 35 256x256x256 layered, 83 coarsening ratio 2000 Initialization Lin. sys. construction Solution CPU time (sec) CPU time (sec) 1500 1000 500 31 28 29 1000 32 28 29 0 31 29 39 40 29 35 37 0 135 133 Initialization Lin. sys. construction Solution 500 400 120 29 300 256x256x256 layered, 163 coarsening ratio 121 31 112 114 32 200 Initialization Lin. sys. construction Solution 281 254 800 CPU time (sec) 600 ] FE S[ ] M V -A [F C MS -A C G M ] SA FE S[ M V] -A [F C S M -A C G M ] SA FE S[ ] M V -A [F C MS -A C G M SA ] FE S[ ] M V -A [F C MS -A C G M ] SA FE S[ M V] -A [F C S M -A C G M ] SA FE S[ ] M V -A [F C MS -A C G M SA 256x256x256 patchy, 163 coarsening ratio CPU time (sec) Initialization Lin. sys. construction Solution 1500 500 29 45 47 254 232 600 400 232 207 31 29 29 200 100 0 0 0.4-1.0 1.0-2.0 ] FE S[ M V] -A [F C S M -A C G M SA ] FE S[ M V] -A [F C S M -A C G M SA ] FE S[ M V] -A [F C S M -A C G M SA ] FE S[ M V] -A [F C S M -A C G M SA ] FE S[ M V] -A [F C S M -A C G M SA ] FE S[ M V] -A [F C S M -A C G M SA t∗ : 0.0-0.4 0.0-0.4 0.4-1.0 1.0-2.0 Fig. 15. Averaged CPU time (over 20 realizations) comparison between the C-AMS and SAMG solvers on permeability Sets 3 (left column) and 6 (right column) from Table 2 over 3 successive time-steps. Different coarsening ratios of 83 (top row) and 163 (bottom row) are considered for C-AMS. Moreover, C-AMS employs 5 ILU smoothing steps per iteration. The number of iterations is given on top of each bar. 21 4.2.2 Test Case 2: stretched grids with line-source terms To study the effect of anisotropic permeability fields along with radial injection flow pattern, the permeability Set 1 from Table 2 is considered. The settings are all the same as previous test cases, except the following items. Dirichlet boundary conditions are set at the centers of two vertical sets of fine-scale grid cells: one from (1,1,1) to (1,1,64) and the other from (64,64,1) to (64,64,64) with the values of 1 and 0, respectively. In addition, grid aspect ratios of α = 1, 5, and 10 are considered (Note that ∆x/α = ∆y = ∆z). The nondimensional time is calculated using αL as the characteristic length. Figure 16 illustrates the pressure solutions for one of the permeability realizations after the first time step t∗ = 0.4. Fig. 16. Converged pressure solution for one of the realizations of permeability Sets 1 with grid aspect ratio α = 1, 5, and 10, respectively from left to right, after one time step t∗ = 0.4. Dirichlet boundary conditions are set at the centers of two vertical sets of fine-scale grid cells: one from (1,1,1) to (1,1,64) and the other from (64,64,1) to (64,64,64) with the values of 1 and 0, respectively. The performance of C-AMS[FE] and SAMG are presented in Fig. 17. In contrast to C-AMS[FE], the C-AMS[FV] (not shown) did not lead to 100% convergence success. However, for those C-AMS[FV] successful runs, similar CPU times as in C-AMS[FE] were observed. Results shown in Fig. 17 are obtained with the C-AMS coarsening ratios of 8 × 8 × 8, 2 × 8 × 8, and 2 × 8 × 8 for the cases of α = 1, 5, and 10, respectively. Note that as shown in Fig. 16, the anisotropic transmissibility (caused by stretched grid effect) would further motivate the use of enhanced coarse-grid geometries for C-AMS. Such a strategy is well developed in algebraic multigrid community, and is the subject of our future studies. 22 C-AMS[FE], 64x64x64 patchy CPU time (sec) 193 10 195 64 173 169 99 87 5 55 86 55 0 120 15 184 10 178 169 181 168 118 112 5 0 CPU time (sec) 18 18 10 = α 5 = α 1 = α 21 21 19 10 = α 5 = α 1 10 20 31 Initialization Lin. sys. construction Solution 20 15 5 = Initialization Lin. sys. construction Solution 20 α = 10 = α 5 = α 1 = α 10 = α 5 = α 1 α 10 = α 5 = α 1 = α 10 = α 5 = α 1 = α SAMG, 64x64x64 layered SAMG, 64x64x64 patchy CPU time (sec) Initialization Lin. sys. construction Solution 20 CPU time (sec) 20 15 C-AMS[FE], 64x64x64 layered Initialization Lin. sys. construction Solution 34 34 0 15 10 5 21 23 24 19 21 22 32 35 35 0 10 = α 5 = α 1 = 10 = α 5 = α 1 = α 0.0-0.4 0.4-1.0 1.0-2.0 α α 1.0-2.0 10 = α 5 = α 1 = 10 = α 5 = α 1 = 0.4-1.0 α 10 = α 5 = α 1 = α 10 = α 5 = α 1 = α t∗ : 0.0-0.4 Fig. 17. Performance of C-AMS (top) and SAMG (bottom) for permeability Set 1 from Table 2 for different grid aspect rations α in ∆x/α = ∆y = ∆z for three successive time steps. Pressure solutions for the first time step is shown for one of the realizations in Fig. 16. 23 4.2.3 Test Case 3: effect of permeability contrast To study the effect of permeability contrast, permeability Set 1 from Table 2 is considered with different ln(k) variances of σ = 2, 4, and 8. Note that the so-far studied cases were for variance 4, as described in Table 2. The settings are all the same as the default test cases, i.e., Dirichlet conditions are set at the east and west faces with no-flow condition everywhere else. Figure 18 illustrates the performances of C-AMS[FE] and SAMG for this test case. Note that the C-AMS requires more iterations when the permeability contrast is increased. To improve its performance, one can consider enriched multiscale strategies which are based on local spectral analysis [29], and modified permeability field (with less contrast) for calculation of basis functions [30]. Note that the success rates of C-AMS[FV] (not shown) were 90% (patchy, σ = 2), 95% (patchy, σ = 8) and 40% (layered, σ = 8). For the successful runs, the CPU times of C-AMS[FV] were comparable with C-AMS[FE]. C-AMS[FE], 64x64x64 patchy C-AMS[FE], 64x64x64 layered Initialization Lin. sys. construction Solution 25 20 CPU time (sec) 20 CPU time (sec) Initialization Lin. sys. construction Solution 25 15 10 111 46 5 46 104 38 42 107 295 15 57 0 8 = σ 4 = σ 2 σ = 8 = σ 4 = σ 2 = σ = = 8 = σ 4 = σ 2 σ 8 = σ 4 = σ 2 σ = 8 = σ 4 = σ 2 σ 8 = σ 4 = σ 2 = σ SAMG, 64x64x64 layered Initialization Lin. sys. construction Solution Initialization Lin. sys. construction Solution 25 20 CPU time (sec) 20 CPU time (sec) 71 41 0 25 15 10 13 21 17 13 23 19 14 24 23 15 10 5 0 14 23 26 13 21 25 14 21 24 0 σ 0.0-0.4 0.4-1.0 8 = σ 4 = σ 2 = 8 = σ 4 = σ 2 = 1.0-2.0 σ σ 8 = σ 4 = σ 2 = 8 = σ 4 = σ 2 = 0.4-1.0 σ 8 = σ 4 = σ 2 = 0.0-0.4 σ 8 = σ 4 = σ 2 = σ t∗ : 80 49 SAMG, 64x64x64 patchy 5 87 5 34 40 290 285 10 1.0-2.0 Fig. 18. Averaged CPU time comparison between C-AMS (top) and SAMG (bottom) for permeability Set 1 from Table 2 for different ln(k) variances of σ = 2, 4 and 5. 24 5 Conclusions Algebraic Multiscale Solver for Compressible flows (C-AMS) in heterogeneous porous media was introduced. Its algebraic formulation benefits from adaptivity, both in terms of the infrequent updating of the linearized system and from the selective update of the basis functions used to construct the prolongation operator. Extensive numerical experiments on heterogeneous patchy and layered reservoirs revealed that the most efficient strategy is to use basis functions with incompressible advection terms, paired with 5 iterations of ILU(0) for postsmoothing. Finally, several benchmark studies were presented, where the developed CAMS research similator was compared with an industrial-grade multigrid solver, i.e., SAMG. The results show that C-AMS is a competitive solver, especially in experiments that involve the simulation of a large number of time steps. The only drawback is the relatively high initialization time, which can be reduced by choosing an appropriate coarsening strategy or by running the basis function updates in parallel [31]. Moreover, due to its conservative property, C-AMS requires only a few iterations per time step to obtain a good quality approximation of the pressure solution for practical purposes. Systematic error estimate analyses for 3D multiphase simulations are a subject of ongoing research and, in addition, the C-AMS performance can be further extended by enrichment of the multiscale operators [29, 32, 20], and enriched coarse grid geometries on the basis of the underlying fine-scale transmissibility. Both are subjects of our future studies. 6 Acknowledgements We would like to acknowledge the financial support from the Chevron/Schlumberger Intersect Alliance Technology and Schlumberger Petroleum Services CV during Matei Ţene’s scientific visit at TU Delft between November - February 2014. Since March 2014, Matei Ţene is a PhD Research Assistant at TU Delft, sponsored by PI/ADNOC. The authors also thank Prof. Hamdi Tchelepi of Stanford University for the many helpful discussions. I as 25 References [1] T. Y. Hou, X.-H. Wu, A multiscale finite element method for elliptic problems in composite materials and porous media. J. Comput. Phys., 134 (1997) 169–189. [2] T. Y. Hou, X.-H. Wu, Z. Cai, Convergence of a multiscale finite element method for elliptic problems with rapidly oscillating coefficients. Math. Comp., 68 (1999) 913–943. [3] Y. Efendiev, T. Y. Hou, Multiscale Finite Element Methods: Theory and Applications. Springer, 2009. [4] Y. Efendiev, V. Ginting, T. Hou, R. Ewing, Convergence of a nonconforming multiscale finite element method. SIAM J. NUMER. ANAL., 37 (2000) 888– 910. [5] J. Aarnes, T. Y. Hou, Multiscale domain decomposition methods for elliptic problems with high aspect ratios. Acta Math. Appl., 18 (2002) 63–76. [6] P. Jenny, S. H. Lee, H. A. Tchelepi, Multi-scale finite-volume method for elliptic problems in subsurface flow simulation. J. Comput. Phys., 187 (2003) 47–67. [7] P. Jenny, S. H. Lee, H. A. Tchelepi, Adaptive fully implicit multi-scale finitevolume method for multi-phase flow and transport in heterogeneous porous media. J. Comput. Phys., 217 (2006) 627–641. [8] V. Kippe, J. E. Aarnes, K.-A. Lie, A comparison of multiscale methods for elliptic problems in porous media flow. Comput. Geosci., 12 (2008) 377–398. [9] U. Trottenberg, C.W. Oosterlee, A. Schueller, Multigrid. Elsevier Academic Press, 2001. [10] H. Zhou, H. A. Tchelepi. Operator based multiscale method for compressible flow. SPE Journal, 13 (2008) 267–273. [11] H. Zhou, H. A. Tchelepi, Two-stage algebraic multiscale linear solver for highly heterogeneous reservoir models. SPE J., SPE 141473-PA, 17 (2012) 523–539. [12] I. Lunati, P. Jenny, Multiscale finite-volume method for density-driven flow in porous media. Comput. Geosci., 12 (2008) 337–350. [13] S.H. Lee, H. Zhou, H. Techelpi, Adaptive multiscale finite-volume method for nonlinear multiphase transport in heterogeneous formations. J. Comput. Phys., 228 (2009) 9036–9058. [14] H. Hajibeygi, G. Bonfigli, M.A. Hesse, P. Jenny, Iterative multiscale finitevolume method. J. Comput. Phys., 227 (2008) 8604–8621. [15] H. Hajibeygi, D. Karvounis, P. Jenny, A hierarchical fracture model for the iterative multiscale finite volume method. J. Comput. Phys., 230 (2011) 8729– 8743. 26 [16] H. Hajibeygi, S. H. Lee, I. Lunati, Accurate and efficient simulation of multiphase flow in a heterogeneous reservoir by using error estimate and control in the multiscale finite-volume framework. SPE Journal, 17 (2012) 1071–1083. [17] C. Wolfsteiner, S. H. Lee, H. A. Tchelepi, Well modeling in the multiscale finite volume method for subsurface flow simulation. SIAM Multiscale Model. Simul., 5 (2006) 900–917. [18] H. Hajibeygi, H. A. Tchelepi, Compositional multiscale finite-volume formulation. SPE Journal, 19 (2014) 316–326. [19] Y. Wang, H. Hajibeygi, H. A. Tchelepi, Algebraic multiscale linear solver for heterogeneous elliptic problems. Journal of Computational Physics, 259 (2014) 284–303. [20] D. Cortinovis, Patrick Jenny, Iterative galerkin-enriched multiscale finitevolume method. J. Comp. Phys., 277 (2014) 248–267. [21] O. Moyner, K.A. Lie, A multiscale two-point flux-approximation method. J. Comput. Phys., 275 (2014) 273–293. [22] K. Aziz, A. Settari, Petroleum Reservoir Simulation. Blitzprint Ltd., Cagary, Alberta, 1979. [23] I. Lunati, P. Jenny, Multiscale finite-volume method for compressible multiphase flow in porous media. J. Comput. Phys., 216 (2006) 616–636. [24] S. H. Lee, C. Wolfsteiner, H. A. Tchelepi, Multiscale finite-volume formulation for multiphase flow in porous media: black oil formulation of compressible, three-phase flow with gravity. Comput. Geosci., 12 (2008) 351–366. [25] H. Hajibeygi, P. Jenny, Multiscale finite-volume method for parabolic problems arising from compressible multiphase flow in porous media. J. Comput. Phys., 228 (2009) 5129–5147. [26] Y. Saad, Iterative Methods for Sparse Linear Systems. SIAM, Philadelphia, USA, 2003. [27] K. Stuben. SAMG User’s Manual. Fraunhofer Institute SCAI, 2010. [28] N. Remy, A. Boucher, J. Wu, Applied geostatistics with SGeMS : a user’s guide. Cambridge University Press, New York, 2009. [29] Y. Efendiev, J. Galvis, X.H. Wu, Multiscale finite element methods for highcontrast problems using local spectral basis functions. J. Comput. Phys., 230 (2011) 937–955. [30] G. Bonfigli, P. Jenny, An efficient multi-scale poisson solver for the incompressible navier-stockes equations with immersed boundaries. J. Comput. Phys., 228 (2009) 4568–4587. [31] A. M. Manea, J. Sewall, and H. A. Tchelepi, Parallel multiscale linear solver for highly detailed reservoir models. Proceedings of SPE RSS, (2015) 1–26, DOI: 10.2118/173259-MS. 27 [32] V. Dolean, P. Jolivet, F. Nataf, N. Spillane, H. Xiang, Two-level domain decomposition methods for highly heterogeneous darcy equations. connections with multiscale methods. Oil & Gas Science and Technology - Revue d’IFP Energies nouvelles, DOI: 10.2516/ogst/2013206, 2014. 28
5cs.CE
Decoupling schemes for predicting compressible fluid flows Petr N. Vabishchevicha,b,∗ a Nuclear Safety Institute, Russian Academy of Sciences, 52, B. Tulskaya, Moscow, Russia Friendship University of Russia (RUDN University), 6 Miklukho-Maklaya St., 117198 Moscow, Russia arXiv:1801.06391v1 [cs.CE] 19 Jan 2018 b Peoples’ Abstract Numerical simulation of compressible fluid flows is performed using the Euler equations. They include the scalar advection equation for the density, the vector advection equation for the velocity and a given pressure dependence on the density. An approximate solution of an initial–boundary value problem is calculated using the finite element approximation in space. The fully implicit two–level scheme is used for discretization in time. Numerical implementation is based on Newton’s method. The main attention is paid to fulfilling conservation laws for the mass and total mechanical energy for the discrete formulation. Two–level schemes of splitting by physical processes are employed for numerical solving problems of barotropic fluid flows. For a transition from one time level to the next one, an iterative process is used, where at each iteration the linearized scheme is implemented via solving individual problems for the density and velocity. Possibilities of the proposed schemes are illustrated by numerical results for a two–dimensional model problem with density perturbations. Keywords: Compressible fluids, the Euler system, barotropic fluid, finite element method, conservation laws, two–level schemes, decoupling scheme 1. Introduction Applied models of continuum mechanics [1, 2] are based on conservation laws for the mass, momentum and energy. The transport of scalar and vector quantities due to advection determines a mathematical form of conservation laws [3, 4]. In addition, some parameters of a flow have the positivity property (monotonicity). Such important properties of the differential problem of continuum mechanics must be inherited in a discrete problem [5, 6]. Flows of ideal fluids are governed by the Euler equations, whereas the Navier–Stokes equations are applied to describing viscous flows. Mathematical problems of validation of such models are considered, for example, in the ∗ Corresponding author Email address: vabishchevich@gmail.com (Petr N. Vabishchevich) Preprint submitted to arXiv.org January 22, 2018 books [7, 8]. When discussing the existence of solutions in various Sobolev spaces, the principal problems of the positivity (non–negativity) of the fluid density are also should be highlighted. Such a consideration is also carried out (see, for instance, [9]) at the discrete level for various approximations in time and space. In computational fluid dynamics, the most important problems are associated with two contradictory requirements. Namely, it is necessary to construct monotone approximations for advective terms and to fulfil conservation laws. The construction of monotone approximations is discussed in many papers (see, e.g., [10, 11, 12]). In [13, 14], standard linear approximations are considered for the basic problems of continuum mechanics (convection–diffusion problems). For discretization in space, conservative approximations are constructed on the basis of using the conservative (divergent) formulation of continuum mechanics equations. This approach is most naturally implemented using integro– interpolation method (balance method) for regular and irregular grids [15], and in the control method volume [4, 16]. Nowadays, the main numerical technique to solve applied problems is the finite element method [17, 18]. It is widely used in computational fluid dynamics [19, 20], too. Discretizations in time for computational fluid dynamics are often constructed using explicit schemes that have strong restrictions on a time step in sense of stability. Moreover, explicit schemes have similar restrictions on the monotonicity of an approximate solution. So, it is more natural to focus on implicit schemes. To solve boundary value problems for partial differential equations, two–level schemes are widely used [11, 21, 22] (θ–method, schemes with weights). For linear problems, a study of discretizations in time can be based on the general theory of stability (well–posedness) for operator–difference schemes [15, 23]. In particular, it is possible to apply unimprovable (coinciding necessary and sufficient) stability conditions, which are formulated as operator inequalities in finite–dimensional Hilbert spaces. In the present work, an initial–boundary value problem is considered for the Euler equations describing barotropic fluid flows (Section 2), which are conservation laws for the mass, momentum, and total mechanical energy. Discretization in space is performed (Section 3) using standard Lagrange elements for the density and cartesian velocity components. To evaluate an approximate solution at a new time level, the fully implicit scheme is employed. For the approximate solution, the mass conservation law holds and an estimate for the dissipation of the total mechanical energy is fulfilled. The fully implicit scheme is not convenient for numerical implementation. The solution at the new time level is determined from a system of coupled nonlinear equations for the density and velocity. A decoupling scheme is proposed in Section 4, which refers to the class of linearized schemes of splitting by physical processes [24, 25]. Linearization is carried out over the field of advective transport in such a way that at each time level we solve individual problems for the density and velocity. Possibilities of the proposed schemes are illustrated by the results of numerical solving a model two–dimensional problem with a perturbation of the fluid density being initially at rest (Section 5). To solve numerically the nonlinear discrete problem at the 2 new time level, the Newton method is used. In the above calculations, a small number of iterations (two or three) is sufficient for the process convergence. The influence of the grid size in space and time is investigated. It was observed that decreasing of the time step results in the monotonization of the numerical solution. The main result of the paper is the proof of the robustness of the linearized decoupling scheme. The scheme involves separate solving standard advection problems for the density and velocity and demonstrates high iteration convergence. Such an approach can be used for other problems of continuum mechanics, e.g., for numerical solving initial–boundary value problems for the Navier–Stokes equations. 2. Mathematical models An initial–boundary value problem is considered for describing barotropic fluid flows. The system of equations includes the scalar advection equation for the density and the vector advection equation for the velocity with a given pressure dependence on the density. The conservation laws for the mass, momentum, and total mechanical energy are discussed. 2.1. Barotropic fluid The continuity equation in a bounded domain Ω has the form ∂% + div(%u) = 0, ∂t x ∈ Ω, 0 < t ≤ T, (1) where %(x, t) > 0 is the density and u(x, t) is the velocity. The momentum equation is written in the conservative form ∂ (%u) + div(%u ⊗ u) + grad p = 0, ∂t x ∈ Ω, 0 < t ≤ T, (2) where p(x, t) is the pressure. The considered fluid is assumed to be barotropic, i.e., we have a known dependence of the pressure on the density p = p(%), dp > 0. d% Assume that the domain boundaries are rigid and so, the impermeability condition is imposed: (u · n) = 0, x ∈ ∂Ω. (3) Initial conditions for the density and velocity are also specified: %(x, 0) = %0 (x), u(x, 0) = u0 (x), x ∈ Ω. (4) The initial–boundary value problem (1)–(4) describes transient flows of an ideal barotropic fluid. The direct integration of the continuity equation (1) over the domain Ω taking into account the boundary condition (3) results in the mass conservation law Z m(t) = m(0), m(t) = %(x, t)dx. (5) Ω 3 In the Hilbert space L2 (Ω), we define the scalar product and norm in the standard way: Z (w, u) = kwk = (w, w)1/2 . w(x)u(x)dx, Ω In a similar way, the space of vector functions L2 (Ω) is defined. If the density is non–negative, the conservation law for the mass can be written as 1/2 k%1/2 k = k%0 k. This relation can be treated as an a priori estimate for %1/2 in L2 (Ω). The equation (2) directly expresses the conservation law for the momentum. Integrating this equation over Ω, we obtain Z Z ∂ (%u)dx + p(%)ndx = 0. ∂Ω Ω ∂t Thus, we have Z I(t) = I(0) − Z p(%)ndx, I(t) = ∂Ω %udx. (6) Ω Multiplying by u and taking into account equation (1), rewrite equation (2) as 1 ∂ 1 (%|u|2 ) + div(%|u|2 u) + div(p(%)u) − p div u = 0. 2 ∂t 2 Integration over the domain Ω, in view of (3), leads to Z Z 1 d %|u|2 dx − p(%) div u dx = 0. 2 dt Ω Ω (7) The second term in (7) is expressed from the renormalized equation of continuity. Define the pressure potential Π(%) from the equation % dΠ − Π(%) = p(%). d% (8) In particular, for an ideal fluid, we have p(%) = a%γ , Π(%) = a %γ , γ−1 a = const > 0, γ > 1. (9) From the continuity equation (1), we have ∂Π + div(Πu) + p(%) div u = 0, ∂t 0 < t ≤ T. (10) Integration of the renormalized equation of continuity (10) results in the expression Z Z d Π dx + p(%) div u dx = 0. dt Ω Ω 4 Adding this equality to (7), we get  Z  d 1 %|u|2 + Π(%) dx = 0. dt Ω 2 We arrive to the conservation law for the total mechanical energy:  Z  1 2 E(t) = E(0), E(t) = %|u| + Π(%) dx. 2 Ω (11) (12) The equations (5), (6) and (12) are the basic conservation laws for of the problem (1)–(4). 2.2. Operator–differential formulation For the convenience of consideration, we introduce operators of advective (convective) transport for the system of Euler equations. The advection operator A = A(u) in the divergent form is written as follows: A(u)ϕ = div(u ϕ). (13) Assuming that the boundary condition (3) is satisfied for the velocity u, we obtain (A(u)ϕ, 1) = 0. (14) The continuity equation (1) can be written in the form of an operator– differential equation: d% + A(u)% = 0, dt 0 < t ≤ T, (15) where the notation %(t) = %(x, t) is used. Similarly, equation (2) is written in the form d (%u) + A(u)(%u) + grad p(%) = 0, 0 < t ≤ T. (16) dt For the system of equations (15), (16) with a prescribed dependence p(%), we consider the Cauchy problem, where the initial conditions (see (4)) have the form %(0) = %0 , u(0) = u0 . (17) For the considered problem (15)–(17), the key point is the property (14) for the advection operator written in the divergent form. 3. Implicit two–level scheme To solve numerically the initial–boundary value problem for the Euler equations, we use the fully implicit (backward Euler) scheme for time–stepping with finite element discretizations in space. The problems of fulfilment of the conservation laws at the discrete level are discussed. 5 3.1. Discretization in space To solve numerically the problem (15)–(17) (or (15)–(19)), we employ finite element discretizations in space (see, e.g., [26, 27]). For (13), we define the bilinear form Z a(ϕ, ψ) = div(u ϕ) ψ dx. Ω Define the subspace of finite elements V h ⊂ H 1 (Ω) and the discrete operator A = A(u) as (A(u)ϕ, ψ) = a(ϕ, ψ), ∀ w, u ∈ V h . Similarly to (14), we have (A(u)ϕ, 1) = 0. (18) For two– and three–dimensional vector quantities, the coordinate–wise representation is employed: u = (u1 , ...., ud )T , d = 2, 3. For a simple specification of the boundary conditions (3), assume that separate parts of the boundary of the computational domain are parallel to the coordinate axes. A finite element approximation is used for the individual components of the vector ui ∈ V h , i = 1, ..., d. After constructing discretizations in space, we arrive at the Cauchy problem for the system of semi–discrete operator equations in the corresponding finite–dimensional space, namely, we have the Cauchy problem for the system of ordinary differential equations. For instance, for (15)–(17), we put into the correspondence the problem d% + A(u)% = 0, dt d (%u) + A(u)(%u) + grad p(%) = 0, dt %(0) = %0 , u(0) = u0 . 0 0 (19) 0 < t ≤ T. (20) (21) h Here %0 = P % , u0 = P u with P denoting L2 –projection onto V . The solution of the problem (18)–(21) satisfies the same system of conservation laws as the solution of the problem (14)–(17) (see (5), (6), (12)). 3.2. Discretization in time Let τ be a step of a uniform, for simplicity, grid in time such that ϕn = ϕ(tn ), tn = nτ , n = 0, 1, ..., N, N τ = T . To construct and study time–stepping schemes, the main attention is given to the fulfillment of the corresponding conservation laws (a priori estimates). Such an important problem as the positivity (non–negativity) of the density at each time level requires a more in–depth study and so, it is not considered in the present work. To solve numerically the problem (19)–(21), the fully implicit scheme is applied. In this case, the approximate solution at the new time level is determined from %n+1 − %n + A(un+1 )%n+1 = 0, (22) τ 6 %n+1 un+1 − %n un +A(un+1 )(%n+1 un+1 )+grad p(%n+1 ) = 0, τ n = 0, 1, ..., N −1, (23) using the prescribed (see (21)) value %0 , u0 . The basic properties of the approximate solution are related to the fulfillment of the conservation laws for the mass and total energy. To simplify our investigation, assume that the density is positive. Assumption 1. At each time level %n > 0, n = 0, 1, ..., N . In view of (18), integration of equation (22) over the domain leads to n = 0, 1, ..., N − 1. (%n+1 , 1) = (%n , 1), (24) The equality (24) is a discrete analog the mass conservation law (5). For the momentum conservation law (6), we put into the correspondence the equality Z (%n+1 un+1 , 1) = (%n un , 1) − τ p(%n+1 )ndx, n = 0, 1, ..., N − 1, (25) ∂Ω which has been obtained by integrating equation (23). An estimate for the total mechanical energy can be established, e.g., following the work [9]. Multiplying equation (23) by un+1 and integrating it over Ω, we arrive at   %n+1 un+1 − %n un , un+1 + (A(un+1 )(%n+1 un+1 ), un+1 ) τ (26) + (grad p(%n+1 ), un+1 ) = 0. For the first term, we have %n+1 un+1 − %n un 1 %n+1 |un+1 |2 − %n |un |2 un+1 = τ 2 τ 1 %n+1 |un+1 |2 + %n |un |2 − 2%n un un+1 + 2 τ 1 %n+1 |un+1 |2 − %n |un |2 = 2 τ 1 %n+1 − %n 1 |un+1 − un |2 + |un+1 |2 + %n 2 τ 2 τ 1 %n+1 |un+1 |2 − %n |un |2 1 %n+1 − %n ≤ + |un+1 |2 . 2 τ 2 τ In view of this, from (26), we obtain     1 %n+1 |un+1 |2 − %n |un |2 1 %n+1 − %n 2 ,1 + , |un+1 | 2 τ 2 τ + (A(un+1 )(%n+1 un+1 ), un+1 ) + (grad p(%n+1 ), un+1 ) ≤ 0. 7 (27) From (22) and the definition of the operator A, we have   1 %n+1 − %n , |un+1 |2 + (A(un+1 )(%n+1 un+1 ), un+1 ) 2 τ 1 = (A(un+1 )(%n+1 un+1 ), un+1 ) − (A(un+1 )%n+1 ), |un+1 |2 ) = 0. 2 This makes possible to rewrite the inequality (27) as   1 %n+1 |un+1 |2 − %n |un |2 , 1 − (p(%n+1 ), div un+1 ) ≤ 0. 2 τ (28) To estimate the second term on the left–hand side of the inequality (28), we apply the discrete analogue of the renormalized equation of continuity (10). dΠ (%n+1 ): Multiply the continuity equation (22) by d% %n+1 − %n dΠ dΠ (%n+1 ) + A(un+1 )%n+1 (%n+1 ) = 0. τ d% d% (29) The following equality takes place: Π(%n+1 ) − Π(%n ) = 1 d2 Π n+1 dΠ (%n+1 )(%n+1 − %n ) − (e % )(%n+1 )(%n+1 − %n )2 , d% 2 d%2 where %en+1 ∈ [min(%n , %n+1 ), max(%n , %n+1 )]. Assumption 2. Assume that d2 Π (%) ≥ 0, d%2 (30) Under these natural assumptions, we get dΠ (%n+1 )(%n+1 − %n ) ≥ Π(%n+1 ) − Π(%n ). d% For the second term in (29), taking into account (8), we have A(un+1 )%n+1 dΠ dΠ (%n+1 ) = %n+1 (%n+1 ) div un+1 + un+1 grad Π(%n+1 ) d% d% = div(Π(%n+1 )un+1 ) + p(%n+1 ) div un+1 . In view of this, integration of equation (29) results in   Π(%n+1 ) − Π(%n ) , 1 + (p(%n+1 ), div un+1 ) ≤ 0. τ 8 (31) Combining (28) and (31), we obtain the inequality     1 1 %n+1 |un+1 |2 + Π(%n+1 ), 1 ≤ %n |un |2 + Π(%n ), 1 . 2 2 (32) Comparing (32) with (12), we can conclude that at the discrete level, instead of fulfillment of the conservation law for the total energy, we observe a decrease of the energy. It should be noted that this property has been established under the additional assumption (30). The result of our consideration can be expressed in the following statement. Proposition 1. The fully implicit scheme (22), (23) produces the approximate solution of the problem (19)–(21) that satisfies the mass conservation law in the form ( ref 24) and the momentum conservation law (25). Moreover, if the assumptions 1 and 2 hold, the estimate (32) for the total mechanical energy is also fulfilled. 4. Decoupling schemes A linearized scheme is used, where the solution at a new time level is evaluated by advective transport taken from the previous time level. Using such a linearization, an iterative process is constructed for the numerical implementation of the fully implicit scheme. The approximate solution at the new time level is determined by sequential solving, first, the linear problem of advection for the density and, secondly, the linear problem for the velocity. 4.1. Linearized scheme We focus on the use of such time–stepping techniques that demonstrate the following properties: • the transition to a new time level is implemented by solving linear problems; • splitting with respect to physical processes is employed, namely, the problems for the density and velocity are solved separately (with individual problems for the velocity components). An example of the simplest decoupling scheme for the Euler equations system (19), (20) is the linearized scheme, where the advective transport involves the velocity from the previous time level. Instead of (22), (23), we employ the scheme %n+1 − %n + A(un )%n+1 = 0, τ %n+1 un+1 − %n un + A(un )(%n+1 un+1 ) + grad p(%n+1 ) = 0, τ (33) n = 0, 1, ..., N − 1. (34) First, from the linear transport equation (33), we evaluate the density at the new time level. Next, from the linear decoupled system (34) for the velocity components, we calculate the velocity un+1 . 9 Remark 1. The system of equations (34) with a given density is, in the general case, coupled for individual cartesian velocity components. In the case, where all parts of the boundary of the computational domain ∂Ω are parallel to the axes of the cartesian coordinate system, the system of equations (34) is decoupled and so, we can evaluate independently the individual components of the velocity. For the linearized scheme, the discrete analogs of the mass conservation law (see (24)) and the momentum conservation law (see (25)) hold. 4.2. Iterative decoupling scheme On the basis of the linearized scheme (33), (34), it is possible to construct an iterative algorithm for the numerical implementation of the fully implicit scheme (22), (23). The approximate solution for %n+1 , un+1 at the k–th iteration is denoted by %kn+1 , ukn+1 , with the initial approximation from the previous time level: %0n+1 = %n , u0n+1 = un . (35) Assume that the new approximation at the new time level is calculated, when the previous K iterations have been done. Similarly to (33), (34), we use the system of equations: %k+1 n+1 − %n + A(ukn+1 )%k+1 n+1 = 0, τ k+1 %k+1 n+1 un+1 − %n un k+1 k+1 +A(ukn+1 )(%k+1 n+1 un+1 )+grad p(%n+1 ) = 0, τ (36) k = 0, 1, ..., K−1, (37) where %n+1 = %K n+1 , un+1 = uK n+1 , n = 0, 1, ..., N − 1. (38) Thus, at each iteration, we firstly solve the linear problem for the density and only then calculate the linear problem for the velocity. 5. Numerical results The possibilities of the fully implicit scheme and decoupling schemes are illustrated by numerical results for a model two–dimensional problem with a density perturbation of an initially resting fluid. 5.1. Test problem Here, we present the results of numerical solving a model problem obtained using different time–stepping techniques. The problem (1)–(4) is considered in the square Ω = {x | x = (x1 , x2 ), −5 < x1 < 5, 10 −5 < x2 < 5}. Assume that the dependence of the density on the pressure has the form ((9) with a = 1, γ = 1.4. We simulate the motion of the initially resting fluid (u0 (x) = 0 in (4)) with the initial density (see (4)) specified in the form %0 (x) = 1 + α exp(−β|x|2 ), where α = 2 and β = 20. 5.2. Fully implicit scheme The problem is solved using the standard uniform triangulation Ω on M segments in each direction. The piecewise–linear finite elements P1 are employed for discretization in space. To implement the fully implicit scheme (22), (23) for the nonlinear discrete problem at the new time level, the Newton method with a direct solver is applied for the corresponding system of linear algebraic equations. Time–evolution of the compressible fluid flow is shown in Fig. 1, which presents the density at various time moments. In this calculation, we used the spatial grid with M = 200, the time step was τ = 0.005. Time–histories of the density in the center of the computational domain (%0 ), maximum (%max ) and minimal (%min ) values of the density over the entire domain Ω are given in Fig. 2. Newton’s iterative method for solving the discrete problem at each new time moment converges very quickly (two or three iterations are enough). Table 1 demonstrates convergence of the iterative process for the first step in time. Here, we present the relative error for the first three iterations for the model problem obtained with M = 200 and various time steps. Table 1: Convergence of Newton’s method iteration 1 2 3 τ = 0.01 2.219e-03 5.104e-08 5.566e-15 τ = 0.005 5.602e-04 9.100e-10 9.994e-15 τ = 0.0025 1.404e-04 1.458e-11 1.788e-14 The accuracy of the approximate solution of the test problem will be illustrated by the data on the density in the section x2 = 0. The solution calculated on the grid with M = 50 using various grids in time is shown in Fig. 3. Similar data for M = 100 and M = 200 are shown in Fig. 4, 5, respectively. It is easy to see a good accuracy in the reconstruction of the leading edge of the wave, when the spatial grid is refined. Also, we observe the effect of smoothing, namely, elimination of non–monotonicity with increasing of time step. 5.3. Decoupling scheme In using the decoupling scheme (35)–(38), the greatest interest is related to the convergence rate of the iterative process. The time step in the calculations was equal to τ = 0.005. We present numerical results for the model problem 11 t=0 t=1 t=2 t=3 t=4 t=5 Figure 1: The density at various time moments. 12 Figure 2: Time–histories of the density (central, maximal and minimal values). Figure 3: The solution of the problem at various time moments calculated on the grid M = 50: dotted line — τ = 0.01, dashed — τ = 0.005, solid — τ = 0.0025. 13 Figure 4: The solution of the problem at various time moments calculated on the grid M = 100: dotted line — τ = 0.01, dashed — τ = 0.005, solid — τ = 0.0025. Figure 5: The solution of the problem at various time moments calculated on the grid M = 200: dotted line — τ = 0.01, dashed — τ = 0.005, solid — τ = 0.0025. 14 Figure 6: The solution of the problem at various time moments calculated on the grid M = 50: dashed line — K = 1, dotted — K = 2, solid — K = 5. under consideration obtained on different grids in space. The dependence of the solution on the number of iterations for the grid with M = 50 is shown in Fig. 6. Figure 7 and 8 presents similar data for grids with M = 100 and M = 200, respectively. It is easy to see see that on the finest grid (see Fig. 8) the linearized scheme (34), (34)) (K = 1 in (35)–(38)) yields a substantially non–monotonic solution, which is monotonized on subsequent iterations. The main conclusion of our study is the demonstration of high computational efficiency of the iterative decoupling scheme (35)–(38). Namely, for the problems under consideration it is sufficient to do only two iterations using (35)–(38). For the above time–stepping methods, the key point is a violation of the conservation law for the total energy. For the fully implicit scheme (22), (23), instead of conservation of the energy (see the estimate (32)), decreasing of the total energy is observed. The dynamics of the total mechanical energy using a linearized scheme (33), (34) (K = 1) and iterative decoupling schemes (35)–(38)) for K = 5 on various grids is shown in Fig. 9–11. Here, according to (12), tn is calculated at each time moment  Z  1 2 E(tn ) = %n |un | + Π(%n ) dx, n = 0, 1, ..., N. 2 Ω For K = 5, the solution obtained using the decoupling scheme (35)–(38) practically coincides with the solution derived from the fully implicit scheme (22), (23). The above data indicate that the conservation law for the total energy is satisfied with a good accuracy. Decreasing of the time step results in increasing 15 Figure 7: The solution of the problem at various time moments calculated on the grid M = 100: dashed line — K = 1, dotted — K = 2, solid — K = 5. Figure 8: The solution of the problem at various time moments calculated on the gridM = 200: dashed line — K = 1, dotted — K = 2, solid — K = 5. 16 Figure 9: Time–history of the total mechanical energy for various time steps obtained on the grid with M = 50: dashed line — K = 1, solid — K = 5. of the accuracy of the conservation law fulfillment. Acknowledgements The publication was financially supported by the Ministry of Education and Science of the Russian Federation (the Agreement # 02.a03.21.0008). 17 Figure 10: Time–history of the total mechanical energy for various time steps obtained on the grid with M = 100: dashed line — K = 1, solid — K = 5. Figure 11: Time–history of the total mechanical energy for various time steps obtained on the grid with M = 200: dashed line — K = 1, solid — K = 5. 18 References [1] G. K. Batchelor, An Introduction to Fluid Dynamics, Cambridge University Press, 2000. [2] L. D. Landau, E. Lifshitz, Fluid Mechanics, Butterworth-Heinemann, 1987. [3] S. K. Godunov, E. I. Romenskii, Elements of Continuum Mechanics and Conservation Laws, Springer, 2003. [4] R. J. LeVeque, Finite Volume Methods for Hyperbolic Problems, Cambridge University Press, 2002. [5] J. Anderson, Computational Fluid Dynamics: The Basics with Applications, McGraw-Hill, 1995. [6] P. Wesseling, Principles of Computational Fluid Dynamics, Springer, 2010. [7] P.-L. Lions, Mathematical Topics in Fluid Mechanics: Incompressible models, Oxford University Press, 1996. [8] P.-L. Lions, Mathematical Topics in Fluid Mechanics: Compressible Models, Oxford University Press, 1998. [9] E. Feireisl, T. G. Karper, M. Pokornỳ, Mathematical Theory of Compressible Viscous Fluids: Analysis and Numerics, Springer, 2016. [10] A. G. Kulikovskii, N. V. Pogorelov, A. Y. Semenov, Mathematical Aspects of Numerical Solution of Hyperbolic Systems, Taylor & Francis, 2000. [11] W. H. Hundsdorfer, J. G. Verwer, Numerical Solution of Time-Dependent Advection-Diffusion-Reaction Equations, Springer Verlag, 2003. [12] D. Kuzmin, A Guide to Numerical Methods for Transport Equations, University Erlangen–Nuremberg, 2010. [13] K. W. Morton, R. B. Kellogg, Numerical Solution of Convection-Diffusion Problems, Chapman & Hall London, 1996. [14] A. A. Samarskii, P. N. Vabishchevich, Numerical Methods for Solving Convection-Diffusion Problems, URSS, Moscow, 1999, in Russian. [15] A. A. Samarskii, The Theory of Difference Schemes, Marcel Dekker, New York, 2001. [16] H. Versteeg, W. Malalasekra, An Introduction to Computational Fluid Dynamics: The Finite Volume Method, Prentice Hall, 2007. [17] A. Ern, J.-L. Guermond, Theory and Practice of Finite Elements, Springer, 2004. 19 [18] M. G. Larson, F. Bengzon, The Finite Element Method: Theory, Implementation and Applications, Springer, 2013. [19] J. Donea, A. Huerta, Finite Element Methods for Flow Problems, Wiley, 2003. [20] O. C. Zienkiewicz, R. L. Taylor, N. P., The Finite Element Method for Fluid Dynamics, Butterworth-Heinemann, 2013. [21] U. M. Ascher, Numerical Methods for Evolutionary Differential Equations, Society for Industrial and Applied Mathematics, 2008. [22] R. J. LeVeque, Finite Difference Methods for Ordinary and Partial Differential Equations: Steady-State and Time-Dependent Problems, Society for Industrial and Applied Mathematics, 2007. [23] A. A. Samarskii, P. P. Matus, P. N. Vabishchevich, Difference Schemes with Operator Factors, Kluwer Academic, Dordrecht, 2002. [24] G. I. Marchuk, Splitting and alternating direction methods, in: P. G. Ciarlet, J.-L. Lions (Eds.), Handbook of Numerical Analysis, Vol. I, NorthHolland, 1990, pp. 197–462. [25] P. N. Vabishchevich, Additive Operator-Difference Schemes: Splitting Schemes, de Gruyter, Berlin, 2014. [26] V. Thomée, Galerkin Finite Element Methods for Parabolic Problems, Springer Verlag, Berlin, 2006. [27] S. C. Brenner, L. R. Scott, The Mathematical Theory of Finite Element Methods, Springer, New York, 2008. 20
5cs.CE
On-demand Relational Concept Analysis Alexandre Bazin1 , Jessie Carbonnel2 , Marianne Huchard2 , and Giacomo Kahn3 1 Le2i, Université Bourgogne Franche-Comté, Dijon, France LIRMM, CNRS and Université de Montpellier, Montpellier France 3 LIMOS, Université Clermont Auvergne, Clermont-Ferrand, France contact@alexandrebazin.com,{jcarbonnel,huchard}@lirmm.fr,giacomo.kahn@ isima.fr arXiv:1803.07847v1 [cs.DB] 21 Mar 2018 2 Abstract. Formal Concept Analysis and its associated conceptual structures have been used to support exploratory search through conceptual navigation. Relational Concept Analysis (RCA) is an extension of Formal Concept Analysis to process relational datasets. RCA and its multiple interconnected structures represent good candidates to support exploratory search in relational datasets, as they are enabling navigation within a structure as well as between the connected structures. However, building the entire structures does not present an efficient solution to explore a small localised area of the dataset, for instance to retrieve the closest alternatives to a given query. In these cases, generating only a concept and its neighbour concepts at each navigation step appears as a less costly alternative. In this paper, we propose an algorithm to compute a concept and its neighbourhood in extended concept lattices. The concepts are generated directly from the relational context family, and possess both formal and relational attributes. The algorithm takes into account two RCA scaling operators. We illustrate it on an example. Keywords: Relational Concept Analysis, Formal Concept Analysis, Ondemand Generation 1 Introduction Many datasets in thematic areas like environment or product lines comprise databases complying with a relational data model. Typical applications in which we are currently involved concern issues relative to watercourse quality4 (Fresqueau project), the inventory and use of pesticidal, antibacterial and antifungal plants5 (Knomana project), and the analysis and representation of product lines [4]. In these applications, there is a wide range of question forms, such as classical querying, establishing correlations between descriptions of objects from several categories or case based reasoning. These questions can be addressed by complementary approaches including conceptual classification building, knowledge pattern and rule extraction, or exploratory search [17,20]. In the Knomana project, 4 5 http://engees-fresqueau.unistra.fr/presentation.php?lang=en http://www.cirad.fr/en/news/all-news-items/articles/2017/science/identifyingplants-used-as-natural-pesticides-in-africa-knomana 2 Bazin, Carbonnel, Huchard, Kahn for example, one main purpose will be, after the ongoing inventory, to support farmers, their advisors, local entrepreneurs or researchers in selecting plants of immediate interest for agricultural crop protection and animal health. As such users will face large amounts of data, and mainly will formulate general, potentially imprecise, and potentially inaccurate queries without prior knowledge of the data, exploratory search will be a suitable approach in this context. Previous work [14,5,7,11,8] has shown that Formal Concept Analysis may be a relevant support for data exploration and we expect Relational Concept Analysis (RCA) to be beneficial as well. Considering RCA for relational dataset exploration brings issues relative to the use of the scaling (logical) operators, the iterative process and the presence of several concept lattices connected via relational attributes. Despite this additional complexity, RCA helps the user to concentrate on the classification of objects of several categories, where the object groups (concepts) are described by intrinsic attributes and by their relations to object groups of other categories. Besides, the relational attributes offer a support to navigate between the object groups of the different categories, while the concept lattices offer a (by-specialisation) navigation between object groups of the same category. There are several complementary strategies to explore datasets using RCA. One may consist in exhaustively computing concept lattices (and related artefacts like implication rules) at several steps, using several logical operators and considering only some of the object categories and some of the inter-categories relationships. Another strategy, which is followed here, consists in an on-demand computation of a concept and its neighbourhood comprising its upper, lower and relational covers. The next section presents the main principles of Relational Concept Analysis (Section 2). The on-demand computation of a concept and its neighbourhood is presented in Section 3. Section 4 illustrates the algorithm with the example introduced in Section 2. Related work is exposed in Section 5. We conclude the paper with a few perspectives in Section 6. 2 Relational Concept Analysis Formal Concept Analysis (FCA) [12] allows to structure a set of objects described by attributes in a canonical structure called a concept lattice. It is based on a formal context K = (O, A, I), where O is the set of objects, A the set of attributes, and I an incidence relation stating "which objects possess which attributes". From this context, the application of FCA extracts a finite set CK of formal concepts (X, Y ) such that X = {o ∈ O | ∀a ∈ Y, (o, a) ∈ I} is the concept’s extent, and Y = {a ∈ A | ∀o ∈ X, (o, a) ∈ I} is the concept’s intent. The concept lattice is obtained by ordering the concepts of CK by the set-inclusion order on their extents. We call an object-concept (resp. attributeconcept) the lowest (resp. the greatest) concept in the lattice possessing an object (resp. an attribute). On-demand Relational Concept Analysis 3 Relational Concept Analysis (RCA) [15,16] is an adaptation of FCA to process relational datasets. A relational dataset is composed of several sorts of objects described by both their own attributes and their relationships with other objects. As input, RCA takes a Relational Context Family (RCF), gathering a set of formal contexts and a set of relational contexts defining links between the objects of different formal contexts. Definition 1 (Relational Context Family). A Relational Context Family is a pair (K, R) such that: - K = {Ki = (Oi , Ai , Ii )} is a set of formal contexts (object-attribute relations) - R = {rk }, rk ⊆ Oi × Oj is a set of relational contexts (object-object relations), with Oi and Oj being sets of objects (respectively of Ki and Kj ). Ki is called the source context and Kj the target context. The three contexts of Table 1 present an example of RCF (Ks , Rs ) taken from the software product line domain. Table 1 (top) displays two formal contexts. The one on the left-hand side presents 5 Data Modelling tools (DM_tools) against 7 attributes representing their compatible operating systems (OS:), and the data models (DM:) the tools may manage. The table on the right-hand side describes 4 DataBase Management Systems (DBMS ) according to the data types (DT:) they may handle. Table 1 (bottom) presents a relational context stating which Data Modelling tools support which DataBase Management Systems. DM_tools Astah Erwin DM ER/Studio Magic Draw MySQL Workbench Rs = x x x x x x x x x x x DT:Enum DT:Set DT:Geometry DT:Spatial DT:Audio DT:Image DT:Video DT:XML DT:JSON DT:Period Ks = OS:Windows OS:Mac OS OS:Linux DM:Conceptual DM:Physical DM:Logical DM:ETL Table 1. (top) Two formal contexts: (left-hand side) Data Modelling tools (DM_tools) and (right-hand side) DataBase Management Systems (DBMS). (bottom) Relational context stating which DM_tools support which DBMS DBMS x MySQL x x x x x x Oracle x x x x x x x x x PostgreSQL x x x x x x x Teradata x x x x x x support MySQL Oracle PostgreSQL Teradata Astah x x Erwin DM x x x ER/Studio x x x x Magic Draw x x x MySQL Workbench x Applying RCA on the contexts of K builds, in a first time, one concept lattice per context (i.e., sort/category of objects), without taking links into account. The two concept lattices associated with Table 1 (top) are presented in Fig. 1. In a second time, RCA introduces links between objects of different lattices depending 4 Bazin, Carbonnel, Huchard, Kahn C_DM_tools_9 C_DBMS_7 OS:Windows C_DM_tools_6 OS:Mac OS:Linux C_DM_tools_3 MySQL Workbench C_DBMS_6 C_DM_tools_7 C_DM_tools_8 DM:Physical DM:Conceptual DT:Enum DT:Geometry C_DM_tools_5 C_DBMS_3 DM:Logical DT:Set DT:Json Astah Erwin DM MySQL PostgreSQL C_DM_tools_1 C_DM_tools_2 C_DBMS_1 DM:ETL DT:Period ER/Studio Teradata C_DM_tools_4 C_DBMS_5 DT:XML C_DBMS_4 C_DBMS_2 Magic Draw DT:Spatial DT:Audio DT:Image DT:Video Oracle C_DM_tools_0 C_DBMS_0 Fig. 1. (left) concept lattice of DM_tools, (right) concept lattice of DBMS on the relations expressed in R. These links take the form of relational attributes; they introduce the abstractions (i.e., concepts) from the target context into the source context through a specific relation and a specific scaling operator. In our example, we may introduce the relational attribute ∃ support.(C_DBM S_4) to characterise the DM_tools that support at least one DBMS offering Json and XML. More generally, given two formal contexts Ki , Kj ∈ K and a relational context r ⊆ Oi × Oj , the application of RCA extends the set of attributes Ai with a set of relational attributes representing links to the concepts of Kj . The extended attribute set is denoted A+ i . Then, the incidence relation Ii is extended to take into account these new attributes (denoted Ii+ ), by associating them to each object of Oi depending on the relation r, the concept (denoted C) involved in the relational attribute and a scaling operator ρ. A relational attribute is thus of the form ”ρ r.(C)”. In this paper, we focus on two scaling operators: the existential operator (denoted ∃), associating an object o to the relational attribute ∃r.(C) if o is linked to at least one object of the extent of C by r; the universal strict operator (denoted ∃∀), associating an object o to ∃∀r.(C) if all the objects linked to o by r are included in the extent of C, and r(o) 6= ∅. The concept lattice associated with a formal context K + = (O, A+ , I + ) then structures the objects from O both by their attributes and their relations to other sets of objects through the relational attributes. Fig. 2 presents the extended concept lattice corresponding to the extended formal context DM_tools + , according to the relation support and the existential scaling operator. On-demand Relational Concept Analysis 5 C_DM_tools_9 OS:Windows exists support(C_DBMS_7) exists support(C_DBMS_6) exists support(C_DBMS_3) C_DM_tools_6 OS:Mac OS:Linux C_DM_tools_7 DM:Physical C_DM_tools_3 C_DM_tools_4 MySQL Workbench Astah C_DM_tools_1 Magic Draw C_DM_tools_8 DM:Conceptual exists support(C_DBMS_2) exists support(C_DBMS_5) C_DM_tools_5 DM:Logical exists support(C_DBMS_4) C_DM_tools_10 exists support(C_DBMS_1) Erwin DM C_DM_tools_2 DM:ETL ER/Studio C_DM_tools_0 exists support(C_DBMS_0) Fig. 2. Concept lattice of the extended context DM_tools + In this way, for complex data models including more than one relation, RCA produces a succession of concept lattices, extended at each step by the new abstractions obtained at the previous step. At step 0, the concept lattices in the set L0 are the ones built from the initial formal contexts from K. At step n, the formal contexts in the set Kn are extended depending on the concepts of the concept lattices in Ln−1 and the relations expressed in R. 3 The Exploration Algorithm In this section, we present an algorithm for taking a step in an exploration. It considers an RCF potentially extended at previous steps, a starting concept C from a context Ki of the RCF and an exploration strategy which consists in choosing a set of relations of the RCF (with Ki as a source) provided with scaling operators. The objective of one step is to complete the intent corresponding to the extent of C, as well as compute its upper, lower and relational covers. Meanwhile, the RCF is updated with the relational attributes for a next step. Redefining Derivation Operators The explicit knowledge of all the relational attributes of a context requires the computation of all the concepts of the target contexts. However, we cannot afford what amounts to the exhaustive computation of the relational concepts of multiple contexts. We would prefer to manipulate only a minimal number of relational attributes allowing us to derive, on-the-fly, the other relational attributes. 6 Bazin, Carbonnel, Huchard, Kahn Any object described by an attribute ρ r.(X, Y ) (instead of ρ r.((X, Y )) by abuse of notation) is also necessarily described by all the attributes of the form ρ r.(X2 , Y2 ) where Y2 ⊆ Y . As such, intents can be represented without loss of information by their relational attributes constructed from attributeswise maximal concepts. However, a problem arises with such a representation: the set intersection cannot be used to compute the intent of a set of objects anymore. Similarly, if only maximal relational attributes are explicitly present in the context, the extent of a set of attributes cannot be computed through a simple test of set inclusion. To remedy this, we provide three algorithms to use on sets of attributes (both intrinsic and relational) with only the maximal relational attributes given explicitly. Intersect takes as input two sets of attributes A and B represented by their maximal relational attributes. It outputs the set of maximal relational attributes of their intersection. A relational attribute ∃r.(X, Y ) is in the intersection of A and B if and only if there exists two attributes ∃r.(X2 , Y2 ) ∈ A and ∃r.(X3 , Y3 ) ∈ B such that X ⊆ X2 and X ⊆ X3 . The same holds for the ∃∀ scaling operator. As such, intersecting the intents of the concepts in the attributes of A and B and keeping the maximal ones results in the maximal relational attributes. It uses Ex (Algorithm 3). Algorithm 1: Intersect(Ki , A, B) 1 2 3 4 5 6 7 8 9 10 11 12 Input: Ki = (Oi , Ai , Ii ) a formal context, A ⊆ Ai an attribute set, B ⊆ Ai the intent of an object o Output: The relational intersection of the attribute set A and the intent of o A2 ← A ∩ B F ←∅ foreach a1 ∼ ∃r.(X1 , Y1 ) ∈ B with r ⊆ Oi × Oj and Kj = (Oj , Aj , Ij ) do foreach a2 ∼ ∃r.(X2 , Y2 ) ∈ A do F ← F ∪ {∃r.(Ex(Kj ,Intersect(Kj , Y1 , Y2 )),Intersect(Kj , Y1 , Y2 ))} A2 ← A2 ∪Max(F, ⊆Ai ) F ←∅ foreach a1 ∼ ∃∀r.(X1 , Y1 ) ∈ B with r ⊆ Oi × Oj and Kj = (Oj , Aj , Ij ) do foreach a2 ∼ ∃∀r.(X2 , Y2 ) ∈ A do F ← F ∪ {∃∀r.(Ex(Kj ,Intersect(Kj , Y1 , Y2 )),Intersect(Kj , Y1 , Y2 ))} A2 ← A2 ∪ F return A2 In uses Intersect to compute the intent of a set of objects described by their maximal relational attributes. It starts with the set of all explicitly known attributes and intersects it with the description of each object in the context Ki . Ex computes the extent of a set of maximal relational attributes A. For each object o and attribute ρ r.(X, Y ) ∈ A, it checks whether r(o) and X intersect in the correct way (depending on the scaling operator). On-demand Relational Concept Analysis 7 Algorithm 2: In(Ki , O) 3 Input: Ki = (Oi , Ai , Ii ) a formal context, O ⊆ Oi a set of objects Output: Computes the intent of a set of objects O A ← Ai foreach o ∈ O do A ←Intersect(A, Intent({o})) 4 return A 1 2 Algorithm 3: Ex(Ki , A) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Input: Ki = (Oi , Ai , Ii ) a formal context, A ⊆ Ai a set of attributes Output: Computes the extent of a set of attributes A O ← Oi foreach a ∈ A do if a ∼ ∃∀r.(X, Y ) then foreach o ∈ O do if r(o) 6⊆ X then O ←O\o else if a ∼ ∃r.(X, Y ) then foreach o ∈ O do if r(o) ∩ X = ∅ then O ←O\o else foreach o ∈ O do if (o, a) 6∈ Ii then O ←O\o return O Computing the Closed Neighbourhood Now that we have redefined the derivation operators on implicitly known relational contexts, we are able to compute the upper, lower and relational covers of a concept. The easiest are the relational covers. A concept (X, Y ) is a relational cover of a concept (U, V ) if and only if ρ r.(X, Y ) is a maximal relational attribute in V . Upper covers are easy too. Candidates can be generated by adding an object – the set of which we have perfect knowledge of – to the current extent and computing the corresponding concept. The covers are the candidates that have the smallest extent. Computing the lower covers is more challenging. They could be computed by adding attributes to the intent but the full set of relational attributes is only known implicitly. We chose to, instead, remove objects. The lower covers of (X, Y ) being the concepts with the maximal extents that are contained in X and do not contain any of the minimal generators of X, a simple 8 Bazin, Carbonnel, Huchard, Kahn way to compute them would be to remove minimal transversals of the minimal generators. Algorithm 4 computes the closed neighbourhood of a concept C. It takes as input a set of formal contexts K = (K1 , . . . , Kw ) of a RCF, a strategy S = {(r, ρ)lj , . . . }, l, j ∈ {1, . . . , w} and a starting concept C from a context Ki . The goal is to compute (or complete) the intent corresponding to the extent of C, as well as its upper, lower and relational covers, in the extended context Ki+ . For each (r, ρ)ij ∈ S such that r : Ki 7→ Kj , the first loop (Lines 1 to 4): computes OCj the object-concepts of Kj ; then, each object-concept (X, Y ) ∈ OCj , relation r and scaling operator ρ give rise to a new relational attribute ρ r.(X, Y ) that is added to the context Ki with GrowContext. In Line 5, the intent of concept C is extended with the relational attributes added during the previous loop. The next loop (Lines 6 to 8) computes the relational covers R of concept C. For each relational attribute in the intent of C, the corresponding concept (in the target context) is added to the cover. In Lines 9 to 11, the lower covers L of C are computed by removing from the extent of C a minimal transversal of the set of minimal generators of C’s extent. Finally, the upper covers U of C are computed in Lines 12 to 14. Candidates are created by adding an object o to the extent of C. Only the extent-wise minimal resulting concepts are kept. Algorithm 4: RCA(K, S, C, Ki ) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Input: K = {K1 , . . . , Kw }, S = {(r, ρ)lj , . . . }, l, j ∈ {1, . . . , w} a strategy, C = (O, A) a concept of Ki = (Oi , Ai , Ii ) Output: C, U, R, L the completed concept C and its closed relational neighbourhood foreach (r, ρ)ij ∈ S do OCj ←ObjectPoset(Kj ) foreach o ∈ Oi do GrowContext(Ki , r, ρ, o, OCj ) A ←In(Ki , O) R←∅ foreach a ∼ ρr.(X1 , Y1 ) ∈ A do R ← R ∪ {(X1 , Y1 )} L←∅ foreach T ∈ minT rans(minGen(O)) do L ← L ∪ {(O \ T,In(Ki , O \ T ))} U ←∅ foreach o ∈ Oi \ O do U ← U ∪ {(Ex(Ki ,In(Ki , O ∪ {o})), In(Ki , O ∪ {o}))} U ←Min(U, ⊆Oi ) return C, U, R, L On-demand Relational Concept Analysis 9 Algorithm 5: GrowContext(Ki , r, q, o, OCj ) 1 2 3 4 5 6 7 8 4 Input: Ki = (Oi , Ai , Ii ) a formal context, r ⊆ Oi × Oj a relational context, ρ a scaling operator, o ∈ Oi an object, OCj the set of object-concepts of Kj = (Oj , Aj , Ij ) Output: Extends the context Ki and adds the crosses if ρ == ∃ then foreach (X, Y ) ∈ OCj such that ∃obj ∈ r(o), obj ∈ X do Ai ← Ai ∪ ∃r.(X, Y ) Ii ← Ii ∪ (o, ∃r.(X, Y )) if ρ == ∃∀ then X ←In(Kj , r(o)) Ai ← Ai ∪ ∃∀r.(Ex(Ki , X), X) Ii ← Ii ∪ (o, ∃∀r.(Ex(Ki , X), X)) Example In this section, we illustrate the defined algorithms. We consider the RCF (Ks , Rs ) with Ks = {DM _tools, DBM S} and Rs = {support} as presented in Section 2. We decide to apply the strategy {(support, ∃)}. Let us imagine that a user wants to select a data modelling tool that runs on Windows (OS:Windows) and that handles logical and conceptual data models (DM:Logical and DM:Conceptual ). Traditional FCA may compute the formal concept associated with these 3 attributes (i.e., C_DM_tools_5, left-hand side of Fig. 1), and inform the user that 1) the corresponding tools are Erwin DM, Magic Draw and ER/Studio, and that 2) all these tools also handle DM:Physical. Let us apply our algorithms on this concept to 1) retrieve the supported DBMS (relational cover) and 2) find the closest alternatives to the query (lower and upper covers): RCA(Ks , {(support, ∃)}, C_DM _tools_5, DM _tools). Lines 1 to 4 extend the context of DM_tools with the relational attributes representing the object-concepts of DBMS (support’s target context). In our case, we have only one relation (support, ∃) visited at Line 1. In Line 2, OCj takes the object-concepts of DBMS , i.e., concepts 1, 2, 3 and 4 from the righthand side of Fig. 1. Then, the loop on Lines 3 and 4 considers the 5 objects of DM_tools, on which GrowContext is called. Each object oi of DM_tools is associated to the relational attributes representing the concepts of OCj having in their extents at least one object linked with oj . As support(Astah) = {M ySQL, Oracle}, ∃support(C_DBM S_3) (MySQL object-concept) and ∃support(C_DBM S_2) (Oracle object-concept) are added to DM_tools and associated to Astah. At the end of Line 4, we obtain the extended context presented in Table 2. Line 5 updates the intent of the input concept to take into account the relational attributes: {OS:Windows, DM:Conceptual, DM:Physical, DM:Logical, ∃sup.(C_DBM S_2), ∃sup.(C_DBM S_3), ∃sup.(C_DBM S_4)}). The con- 10 Bazin, Carbonnel, Huchard, Kahn ∃ sup.(C_DBMS_3) ∃ sup.(C_DBMS_1) x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ∃ sup.(C_DBMS_4) OS:Windows OS:Mac OS OS:Linux DM:Conceptual DM:Physical DM:Logical DM:ETL DM_tools+ Astah Erwin DM ER/Studio Magic Draw MySQL Workbench ∃ sup.(C_DBMS_2) Table 2. Formal context DM_tools extended according to the relation support cepts of DBMS corresponding to the relational attributes of C (C_DBM S_2 to 4) form the relational cover of the input concept (lines 6 to 8). Then, (Lines 9 to 11) we compute the minimal generators of the extent of C, which are {Erwin DM, Magic Draw} and {ER/Studio, Magic Draw}. Their minimal transversals are {Magic Draw} and {Erwin DM, ER/Studio}. The two concepts having {Magic Draw} and {Erwin DM,ER/Studio} for extent represent the lower cover (respectively C_DM _tools_1 and C_DM _tools_2 in Fig. 2). Finally, in Lines 12 to 14, we consider the objects of DM_tools that are not in C’s extent, i.e., MySQL Workbench and Astah. For each one of them, we compute the concept corresponding to their union with C’s extent, and we obtain the two concepts C_DM_tools_7 and 8 of Fig. 2. They represent the upper cover of C. 5 Related Work Lattice structures are among the first structures used as a support for exploratory search [14], and this task has later attracted a lot of attention in Formal Concept Analysis theory [6]. Many works focus on conceptual neighbourhood to present both information related to a query and its closest variants [13,7,1]. In this paper, we consider RCA to retrieve the conceptual neighbourhood in interconnected lattices, structuring both intrinsic and relational attributes. The exponential growth of concept lattices is well-known [12]. As a consequence, the main limitation of FCA-based exploratory search lies in the complexity and computation of the structures [5]. Many solutions have been proposed to reduce the complexity of conceptual navigation. Some authors propose to prune the concept lattice to restrict the explorable dataspace, by computing iceberg concept lattices [21], or by applying constraints to bound the final structure [5]. To ease the navigation, the authors of [18] seek to extract more simplified browsable structures; they first extract a tree from the concept lattice, and then reduce the obtained tree using clustering and fault-tolerance methods. The tool SearchSleuth [7] enables FCA-based exploratory search for web queries, a field where the domain cannot be entirely processed using FCA and concept lattices. To tackle this issue, they generate a new formal context specific to a query at On-demand Relational Concept Analysis 11 each navigation step. In a previous work [2], we proposed to compute the conceptual neighbourhood of a query in a sub-order of the concept lattice restricted to the attribute- and object-concepts (attribute-object-concept poset), a condensed alternative to concept lattices. At each step, only the conceptual neighbourhood is computed. In the present work, we also generate the conceptual neighbourhood on-the-fly, but this time in interconnected concept lattices. Mimouni et al. [19] use RCA to structure, query and browse a collection of legal documents. First, they build interconnected lattices representing different types of legal documents referring to each other. Then, their approach allows for the retrieval of the concept corresponding to a user query, and to explore variations of this query by navigation in the neighbour concepts. In their approach, they compute all the lattices during the first step. Ferré and Hermann [9] propose Query-based Faceted Search and an implementation in the tool SEWELIS, that allows to browse relational datasets in the form of RDF files. Also, Ferré et al. [10] propose RLCA, a relational extension of Logical Formal Analysis, an adaptation of FCA to describe objects by formulas of ad-hoc logics instead of binary attributes. While RCA computes connected yet separate concept lattices, one per sort of objects, RLCA gathers the objects, their descriptions and their relations to other objects in one structure. 6 Conclusion In this paper, we proposed algorithms to compute the conceptual neighbourhood of a query in connected concept lattices generated with RCA. First, we redefined the traditional FCA derivation operators to take into account relational attributes. Then, we presented a way to compute the relational, upper and lower covers of a given concept in extended lattices, without computing all the structures. Two RCA scaling operators, i.e., existential and universal strict, may be used. We illustrated how the algorithms work on a running example from the domain of software product line engineering. In the future, we plan to study the properties of the algorithm and to implement it to perform exploratory search in relational datasets. A scalability study on real datasets from the projects Fresqueau and Knomana and from available product descriptions [3] is then envisioned. To this end, we will generate random queries and exploration paths. We also are collecting concrete questions from the Knomana project partners for having real exploration tasks in their domain and qualitatively evaluate the benefits of the approach. References 1. Alam, M., Le, T.N.N., Napoli, A.: LatViz: A New Practical Tool for Performing Interactive Exploration over Concept Lattices. In: Proc. of the 13th Int. Conf. on Concept Lattices and Their Applications (CLA’16). pp. 9–20 (2016) 2. Bazin, A., Carbonnel, J., Kahn, G.: On-Demand Generation of AOC-Posets: Reducing the Complexity of Conceptual Navigation. In: Proc. of the 23rd Int. Symp. on Foundations of Intelligent Systems (ISMIS’17). pp. 611–621 (2017) 12 Bazin, Carbonnel, Huchard, Kahn 3. Ben Nasr, S., Bécan, G., Acher, M., Bosco, J.F.F., Sannier, N., Baudry, B., Davril, J.M.: Automated Extraction of Product Comparison Matrices From Informal Product Descriptions. J. of Systems and Software 124, 82 – 103 (2017) 4. Carbonnel, J., Huchard, M., Nebut, C.: Analyzing Variability in Product Families through Canonical Feature Diagrams. In: Proc. of the 29th Int. Conf. on Software Engineering & Knowledge Engineering (SEKE’17). pp. 185–190 (2017) 5. Carpineto, C., Romano, G.: Exploiting the Potential of Concept Lattices for Information Retrieval with CREDO. J. of Universal Comp. Sci. 10(8), 985–1013 (2004) 6. Codocedo, V., Napoli, A.: Formal Concept Analysis and Information Retrieval - A Survey. In: Proc. of the 13th Int. Conf. on Formal Concept Analysis (ICFCA’15). pp. 61–77 (2015) 7. Ducrou, J., Eklund, P.W.: SearchSleuth: The Conceptual Neighbourhood of an Web Query. In: Proc. of the 5th Int. Conf. on Concept Lattices and Their Applications (CLA’07). pp. 249–259 (2007) 8. Dunaiski, M., Greene, G.J., Fischer, B.: Exploratory search of academic publication and citation data using interactive tag cloud visualizations. Scientometrics 110(3), 1539–1571 (2017) 9. Ferré, S., Hermann, A.: Reconciling faceted search and query languages for the semantic web. Int. J. of Metadata, Semantics and Ontologies 7(1), 37–54 (2012) 10. Ferré, S., Ridoux, O., Sigonneau, B.: Arbitrary relations in formal concept analysis and logical information systems. In: Proc. of the 13th Int. Conf. on Conceptual Structures (ICCS’05). pp. 166–180. Springer (2005) 11. Ferré, S.: Reconciling Expressivity and Usability in Information Access - From Filesystems to the Semantic Web. Habilitation thesis, Matisse, Univ. Rennes 1 (2014), habilitation à Diriger des Recherches (HDR), defended on November 6th 12. Ganter, B., Wille, R.: Formal Concept Analysis - mathematical foundations. Springer (1999) 13. Godin, R., Gecsei, J., Pichet, C.: Design of a Browsing Interface for Information Retrieval. In: Proc. of the 12th Int. Conf. on Research and Development in Information Retrieval (SIGIR’89). pp. 32–39 (1989) 14. Godin, R., Saunders, E., Gecsei, J.: Lattice model of browsable data spaces. Inf. Sci. 40(2), 89–116 (1986) 15. Hacene, M.R., Huchard, M., Napoli, A., Valtchev, P.: A Proposal for Combining Formal Concept Analysis and Description Logics for Mining Relational Data. In: Proc. of the 5th Int. Conf. on Formal Concept Analysis (ICFCA’07). pp. 51–65 (2007) 16. Huchard, M., Hacene, M.R., Roume, C., Valtchev, P.: Relational concept discovery in structured datasets. Ann. Math. Artif. Intell. 49(1-4), 39–76 (2007) 17. Marchionini, G.: Exploratory search: from finding to understanding. Comm. ACM 49(4), 41–46 (2006) 18. Melo, C.A., Grand, B.L., Aufaure, M.: Browsing Large Concept Lattices through Tree Extraction and Reduction Methods. Int. J. of Intelligent Information Technologies 9(4), 16–34 (2013) 19. Mimouni, N., Nazarenko, A., Salotti, S.: A conceptual approach for relational ir: Application to legal collections. In: Proc. of the 13th Int. Conf. on Formal Concept Analysis (ICFCA’15). pp. 303–318 (2015) 20. Palagi, É., Gandon, F.L., Giboin, A., Troncy, R.: A survey of definitions and models of exploratory search. In: ACM Workshop ESIDA@IUI. pp. 3–8 (2017) 21. Stumme, G., Taouil, R., Bastide, Y., Pasquier, N., Lakhal, L.: Computing iceberg concept lattices with Titanic. Data Knowledge Engineering 42(2), 189–222 (2002)
2cs.AI
Probabilistic Integration: A Role in Statistical Computation? François-Xavier Briol1,2 , Chris. J. Oates3,4 , Mark Girolami2,4 , Michael A. Osborne5 and Dino Sejdinovic4,6 1 Department of Statistics, University of Warwick of Mathematics, Imperial College London 3 School of Mathematics, Statistics and Physics, Newcastle University 4 The Alan Turing Institute for Data Science 5 Department of Engineering Science, University of Oxford 6 Department of Statistics. University of Oxford arXiv:1512.00933v6 [stat.ML] 18 Oct 2017 2 Department October 19, 2017 Abstract A research frontier has emerged in scientific computation, wherein discretisation error is regarded as a source of epistemic uncertainty that can be modelled. This raises several statistical challenges, including the design of statistical methods that enable the coherent propagation of probabilities through a (possibly deterministic) computational work-flow, in order to assess the impact of discretisation error on the computer output. This paper examines the case for probabilistic numerical methods in routine statistical computation. Our focus is on numerical integration, where a probabilistic integrator is equipped with a full distribution over its output that reflects the fact that the integrand has been discretised. Our main technical contribution is to establish, for the first time, rates of posterior contraction for one such method. Several substantial applications are provided for illustration and critical evaluation, including examples from statistical modelling, computer graphics and a computer model for an oil reservoir. 1 Introduction This paper presents a statistical perspective on the theoretical and methodological issues pertinent to probabilistic numerical methods. Our aim is to stimulate what we feel is an important discussion about these methods for use in contemporary and emerging scientific and statistical applications. 1.1 Background Numerical methods, for tasks such as approximate solution of a linear system, integration, global optimisation and discretisation schemes to approximate the solution of differential equations, are core building blocks in modern scientific and statistical computation. These are typically considered as computational black-boxes that return a point estimate for a deterministic quantity of interest whose numerical error is then neglected. Numerical methods are thus one part of statistical analysis for which uncertainty is not routinely accounted (although analysis of errors and bounds on these are often available and highly developed). In many situations numerical error will be negligible and no further action is required. However, if numerical errors are propagated through a computational pipeline and allowed to accumulate, then failure to properly 1 account for such errors could potentially have drastic consequences on subsequent statistical inferences (Mosbach and Turner, 2009; Oates et al., 2017c). The study of numerical algorithms from a statistical point of view, where uncertainty is formally due to discretisation, is known as probabilistic numerics. The philosophical foundations of probabilistic numerics were, to the best of our knowledge, first clearly exposed in the work of Larkin (1972); Kadane (1985); Diaconis (1988) and O’Hagan (1992). Theoretical support comes from the field of information-based complexity (Traub et al., 1988), where continuous mathematical operations are approximated by discrete and finite operations to achieve a prescribed accuracy level. Proponents claim that this approach provides three important benefits: Firstly, it provides a principled approach to quantify and propagate numerical uncertainty through computation, allowing for the possibility of errors with complex statistical structure. Secondly, it enables the user to uncover key contributors to numerical error, using established statistical techniques such as analysis of variance, in order to better target computational resources. Thirdly, this dual perspective on numerical analysis as an inference task enables new insights, as well as the potential to critique and refine existing numerical methods. On this final point, recent interest has led to several new and effective numerical algorithms in many areas, including differential equations, linear algebra and optimisation. For an extensive bibliography, the reader is referred to the recent expositions of Hennig et al. (2015) and Cockayne et al. (2017). 1.2 Contributions Our aim is to stimulate a discussion on the suitability of probabilistic numerical methods in statistical computation. A decision was made to focus on numerical integration due to its central role in computational statistics, including frequentist approaches such as bootstrap estimators (Efron and Tibshirani, 1994) and Bayesian approaches, such as computing marginal distributions (Robert and Casella, 2013). In particular we focus on numerical integrals where the cost of evaluating the integrand forms a computational bottleneck. To this end, let π be a distribution on a state space X . The task is to compute (or, rather, to estimate) integrals of the form Z Π[f ] := f dπ, where the integrand f : X → R is a function of interest. Our motivation comes from settings where f does not possess a convenient closed form so that, until the function is actually evaluated at an input x, there is epistemic uncertainty over the actual value attained by f at x. The use of a probabilistic model for this epistemic uncertainty has been advocated as far back as Larkin (1972). The probabilistic integration method that we focus on is known as Bayesian cubature (BC). The method operates by evaluating the integrand at a set of states {xi }ni=1 ⊂ X , socalled discretisation, and returns a distribution over R that expresses belief about the true value of Π[f ]. The computational cost associated with BQ is in general O(n3 ). As the name suggests, this distribution will be based on a prior that captures certain properties of f , and that is updated, via Bayes’ rule, on the basis of evaluations of the integrand. The maximum a posteriori (MAP) value acts as a point estimate of the integral, while the rest of the distribution captures uncertainty due to the fact that we can only evaluate the integrand at a finite number of inputs. However, a theoretical investigation of this posterior1 is, to the best of our knowledge, non-existent. 1 in contrast to the MAP estimator, which has been well-studied. 2 Our first contribution is therefore to investigate the claim that the BC posterior provides a coherent and honest assessment of the uncertainty due to discretisation of the integrand. This claim is shown to be substantiated by rigorous mathematical analysis of BC, building on analogous results from reproducing kernel Hilbert spaces, if the prior is well-specified. In particular, rates of posterior contraction to a point mass centred on the true value Π[f ] are established. However, to check that a prior is well-specified for a given integration problem can be non-trivial. Our second contribution is to explore the potential for the use of probabilistic integrators in the contemporary statistical context. In doing so, we have developed strategies for (i) model evidence evaluation via thermodynamic integration, where a large number of candidate models are to be compared, (ii) inverse problems arising in partial differential equation models for oil reservoirs, (iii) logistic regression models involving high-dimensional latent random effects, and (iv) spherical integration, as used in the rendering of virtual objects in prescribed visual environments. In each case results are presented “as they are” and the relative advantages and disadvantages of the probabilistic approach to integration are presented for critical assessment. 1.3 Outline The paper is structured as follows. Sec. 2 provides background on BC and outlines an analytic framework in which the method can be studied. Sec. 3 describes our novel theoretical results. Sec. 4 is devoted to a discussion of practical issues, including the important issue of prior elicitation. Sec. 5 presents several novel applications of probabilistic integration for critical assessment2 . Sec. 6 concludes with an appraisal of the suitability of probabilistic numerical methods in the applied statistical context. 2 Background First we provide the reader with the relevant background. Sec. 2.1 provides a formal description of BC. Secs. 2.2 and 2.3 explain how the analysis of BC is dual to minimax analysis in nonparametric regression, and Sec. 2.4 relates these ideas to established sampling methods. Set-Up: Let (X , B) be a measurable space, where X will either be a subspace of Rd or a more general manifold (e.g. the sphere Sd ), in each case equipped with the Borel σ-algebra B = B(X ). Let π be a distribution on (X ,RB). Our integrand is assumed to be an integrable function f : X → R whose integral, Π[f ] = f dπ, is the object of interest. R 1/2 Notation: For functional arguments write hf, gi2 = f g dπ, kf k2 = hf, f i2 and for vector arguments denote kuk2 = (u21 + · · · + u2d )1/2 . For vector-valued functions v : X → Rm we write Π[v] for the m × 1 vector whose ith element is Π[vi ]. The notation [u]+ = max{0, u} will be used. The relation al  bl is taken to mean that there exist 0 < C1 , C2 < ∞ such that C1 al ≤ bl ≤ C2 al . 2 computer code to reproduce experiments reported in this paper can be downloaded from http://www. warwick.ac.uk/fxbriol/probabilistic_integration. 3 A cubature rule describes any functional Π̂ of the form Π̂[f ] = n X wi f (xi ), (1) i=1 {xi }ni=1 for some states ⊂ X and weights {wi }ni=1 ⊂ R. The term quadrature rule is sometimes preferred when the domain of integration is one-dimensional (i.e. d = 1). The notation Π̂[f ] is motivated by the fact that this Pexpression can be re-written as the integral of f with respect to an empirical measure π̂ = ni=1 wi δxi , where δxi is an atomic measure (i.e. for all A ∈ B, δxi (A) P = 1 if xi ∈ A, δxi (A) = 0 if xi ∈ / A). The weights wi can be negative and need not satisfy ni=1 wi = 1. 2.1 Bayesian Cubature Probabilistic integration begins by defining a probability space (Ω, F, P) and an associated stochastic process g : X × Ω → R, such that for each ω ∈ Ω, g(·, ω) belongs to a linear topological space L. For BC, Larkin (1972) considered a Gaussian process (GP); this is a stochastic process such that the random variables ω 7→ Lg(·, ω) are Gaussian for all L ∈ L∗ , where L∗ is the topological dual of L (Bogachev, 1998). In this paper, to avoid technical obfuscation, it is assumed that L contains only continuous functions. Let Eω denote expectation taken over ω ∼ P. A GP can be characterised by its mean function m(x) = Eω [g(x, ω)], and its covariance function c(x, x0 ) = Eω [(g(x, ω) − m(x))(g(x0 , ω) − m(x0 ))] and we write g ∼ N (m, c). In this paper we assume without loss of generality that m ≡ 0. Note that other priors could also be used (e.g. a Student-t process affords heavier tails for values assumed by the integrand). The next step is to consider the restriction of P to the set {ω ∈ Ω : g(xi , ω) = f (xi ), 1 ≤ i ≤ n} to induce a posterior measure Pn over L. The fact that L contains only continuous functions ensures that g(xi , ω) is well-defined3 . Moreover the restriction to a P-null set is also well-defined4 . Then, for BC, Pn can be shown to be a GP, denoted N (mn , cn ) (see Chap. 2 of Rasmussen and Williams, 2006). The final step is to produce a distribution on R by projecting the posterior Pn defined on L through the integration operator. A sketch of the procedure is presented in Figure 1 and the relevant formulae are now provided. Denote by En , Vn the expectation and variance taken with respect to Pn . Write f ∈ Rn for the vector of fi = f (xi ) values, X = {xi }ni=1 and c(x, X) = c(X, x)> for the 1 × n vector whose ith entry is c(x, xi ) and C for the matrix with entries Ci,j = c(xi , xj ). Proposition 1. The induced distribution of Π[g] is Gaussian with mean and variance En [Π[g]] = Π[c(·, X)]C −1 f Vn [Π[g]] = ΠΠ[c(·, ·)] − Π[c(·, X)]C (2) −1 Π[c(X, ·)]. (3) Here, ΠΠ[c(·, ·)] denotes the integral of c with respect to each argument. All proofs in this paper are reserved for Supplement A. It can be seen that the computational cost of obtaining this full posterior is much higher than that of obtaining a point estimate for the integral, at O(n3 ). However, certain combinations of point sets and covariance functions can reduce this cost by several orders of magnitude (see e.g. Karvonen and Särkkä (2017)). 3 this would not have been the case if instead L = L2 (π). since the canonical space of continuous processes is a Polish space and all Polish spaces are Borel spaces and thus admit regular conditional laws (c.f. Theorem A1.2 and Theorem 6.3 of Kallenberg, 2002). 4 4 n=3 n=8 Integrand n=0 Posterior distribution x Solution of the integral Figure 1: Sketch of Bayesian cubature. The top row shows the approximation of the integrand f (red) by the posterior mean mn (blue) as the number n of function evaluations is increased. The dashed lines represent point-wise 95% posterior credible intervals. The bottom row shows the Gaussian distribution with mean En [Π[g]] and variance Vn [Π[g]] and the dashed black line gives the true value of the integral Π[f ]. As the number of states n increased, this posterior distribution contracts onto the true value of the integral Π[f ]. BC formally associates the stochastic process g with a prior model for the integrand f . This in turn provides a probabilistic model for epistemic uncertainty over the value of the integral Π[f ]. Without loss of generality we assume m ≡ 0 for the remainder of the paper. Then Eqn. 2 takes the form of a cubature rule En [Π[g]] = Π̂BC [f ] := n X wiBC f (xi ) (4) i=1 where wBC := C −1 Π[c(X, ·)]. Furthermore, Eqn. 3 does not depend on function values {fi }ni=1 , but only on the location of the states {xi }ni=1 and the choice of covariance function c. This is useful as it allows state locations and weights to be pre-computed and re-used. However, it also means that the variance is endogeneous, being driven by the choice of prior. A valid quantification of uncertainty thus relies on a well-specified prior; we consider this issue further in Sec. 4.1. The BC mean (Eqn. 4) coincides with classical cubature rules for specific choices of covariance function c. For example, in one dimension a Brownian covariance function c(x, x0 ) = min(x, x0 ) leads to a posterior mean mn that is a piecewise linear interpolant of f between the states {xi }ni=1 , i.e. the trapezium rule (Suldin, 1959). Similarly, Särkkä et al. (2016) constructed a covariance function c for which Gauss-Hermite cubature is recovered, and Karvonen and Särkkä (2017) showed how other polynomial-based cubature rules can be recovered. Clearly the point estimator in Eqn. 4 is a natural object; it has also received attention in both the kernel quadrature literature (Sommariva and Vianello, 2006) and empirical interpolation literature (Kristoffersen, 2013). Recent work with a computational focus includes Kennedy (1998); 5 Minka (2000); Rasmussen and Ghahramani (2002); Huszar and Duvenaud (2012); Gunter et al. (2014); Briol et al. (2015); Karvonen and Särkkä (2017); Oettershagen (2017). The present paper focuses on the full posterior, as opposed to just the point estimator that these papers studied. 2.2 Cubature Rules in Hilbert Spaces Next we review how analysis of the approximation properties of the cubature rule Π̂BC [f ] can be carried out in terms of reproducing kernel Hilbert spaces (RKHS; Berlinet and Thomas-Agnan, 2004). Consider a Hilbert space H with inner product h·, ·iH and associated norm k · kH . H is said to be an RKHS if there exists a symmetric, positive definite function k : X × X → R, called a kernel, that satisfies two properties: (i) k(·, x) ∈ H for all x ∈ X and; (ii) f (x) = hf, k(·, x)iH for all x ∈ X and f ∈ H (the reproducing property). It can be shown that every kernel defines a RKHS and every RKHS admits a unique reproducing kernel (BerlinetR and Thomas-Agnan, 2004, Sec. 1.3). In this paperR all kernels k are assumed to satisfy R := k(x, x) dπ(x) < ∞. In particular this guarantees f 2 dπ < ∞ for all f ∈ H. Define the kernel mean µ(π) : X → R as µ(π)(x) := Π[k(·, x)]. This exists in H as a consequence of R < ∞ (Smola et al., 2007). The name is justified by the fact5 that Z Z ∀f ∈ H : Π[f ] = f dπ = f, k(·, x) H dπ(x) Z D E = f, k(·, x) dπ(x) = hf, µ(π)iH . H The reproducing property permits an elegant theoretical analysis, with many quantities of interest tractable in H. In the language of kernel means, cubature rules of the form in Eqn. 1 can be written as Π̂[f ] = hf, µ(π̂)iH where µ(π̂) is the approximation to the kernel mean given by µ(π̂)(x) = Π̂[k(·, x)]. For fixed f ∈ H, the integration error associated with Π̂ can then be expressed as Π̂[f ] − Π[f ] = hf, µ(π̂)iH − hf, µ(π)iH = hf, µ(π̂) − µ(π)iH . A tight upper bound for the error is obtained by Cauchy-Schwarz: |Π̂[f ] − Π[f ]| ≤ kf kH kµ(π̂) − µ(π)kH . (5) The expression above6 decouples the magnitude (in H) of the integrand f from the kernel mean approximation error. The following sections discuss how cubature rules can be tailored to target the second term in this upper bound. 2.3 Optimality of Cubature Weights Denote the dual space of H as H∗ and denote its corresponding norm k · kH∗ . The performance of a cubature rule can be quantified by its worst-case error (WCE) in the RKHS: kΠ̂ − ΠkH∗ = sup |Π̂[f ] − Π[f ]| kf kH ≤1 The WCE is characterised as the error in estimating the kernel mean: 5 the integral and inner product commute due to the existence of µ(π) as a Bochner integral (Steinwart and Christmann, 2008, p510). 6 sometimes called the Koksma-Hlawka inequality (Hickernell, 1998). 6 Fact 1. kΠ̂ − ΠkH∗ = kµ(π̂) − µ(π)kH . Minimisation of the WCE is natural and corresponds to solving a least-squares problem in the feature space induced by the kernel: Let w ∈ Rn denote the vector of weights {wi }ni=1 , z ∈ Rn be a vector such that zi = µ(π)(xi ), and K ∈ Rn×n be the matrix with entries Ki,j = k(xi , xj ). Then we obtain the following: Fact 2. kΠ̂ − Πk2H∗ = w> Kw − 2w> z + Π[µ(π)]. Several optimality properties for integration in RKHS were collated in Sec. 4.2 of Novak and Woźniakowski (2008). Relevant to this work is that an optimal estimate Π̂ can, without loss of generality, take the form of a cubature rule (i.e. of the form Π̂ in Eqn. 1). To be more precise, any non-linear and/or adaptive estimator can be matched7 in terms of asymptotic WCE by a cubature rule as we have defined. To relate these ideas to BC, consider the challenge of deriving an optimal cubature rule, conditional on fixed states {xi }ni=1 , that minimises the WCE (in the RKHS Hk ) over weights w ∈ Rn . From Fact 2, the solution to this convex problem is w = K −1 z. This shows that if the reproducing kernel k is equal to the covariance function c of the GP, then the MAP from BC is identical to the optimal cubature rule in the RKHS (Kadane and Wasilkowski, 1985). Furthermore, with k = c, the expression for the WCE in Fact 2 shows that Vn [Π[g]] = kΠ̂BC − Πk2H∗ ≤ kΠ̂ − Πk2H∗ where Π̂ is any other cubature rule Π̂ based on the same states {xi }ni=1 . Regarding optimality, the problem is thus reduced to selection of states {xi }ni=1 . 2.4 Selection of States In earlier work, O’Hagan (1991) considered states {xi }ni=1 that are employed in Gaussian cubature methods. Rasmussen and Ghahramani (2002) generated states using Monte Carlo (MC), calling the approach Bayesian MC (BMC). Recent work by Gunter et al. (2014); Briol et al. (2015) selected states using experimental design to target the variance Vn [Π[g]]. These approaches are now briefly recalled. 2.4.1 Monte Carlo Methods An MC method is a cubature rule based on uniform weights wiMC := 1/n and random states n {xi }ni=1 . The simplest of those methods consists of sampling states {xMC i }i=1 independently from π. For un-normalised densities, Markov chain Monte Carlo (MCMC) methods proceed similarly but induce a dependence structure among the {xMCMC }ni=1 . We denote these (rani MCMC ). Uniformly dom) estimators by Π̂MC (when xi = xMC i ) and Π̂MCMC (when xi = xi weighted estimators are well-suited to many challenging integration problems since they provide a dimension-independent convergence rate for the WCE of OP (n−1/2 ). They are widely applicable and straight-forward to analyse; for instance the central limit theorem (CLT) gives √ that n(Π̂MC [f ] − Π[f ]) → N (0, τf−1 ) where τf−1 = Π[f 2 ] − Π[f ]2 and the convergence is in distribution. However, the CLT may not be well-suited as a measure of epistemic uncertainty (i.e. as an explicit model for numerical error) since (i) it is only valid asymptotically, and (ii) τf is unknown, depending on the integral Π[f ] being estimated. Quasi Monte Carlo (QMC) methods exploit knowledge of the RKHS H to spread the states in an efficient, deterministic way over the domain X (Hickernell, 1998). QMC also approximates 7 of course, adaptive cubature may provide superior performance for a single fixed function f , and the minimax result is not true in general outside the RKHS framework. 7 integrals using a cubature rule Π̂QMC [f ] that has uniform weights wiQMC := 1/n. The (in some cases) optimal convergence rates, as well as sound statistical properties, of QMC have recently led to interest within statistics (e.g. Gerber and Chopin, 2015; Buchholz and Chopin, 2017). A related method with non-uniform weights was explored in Stein (1995a,b). 2.4.2 Experimental Design Methods An Optimal BC (OBC) rule selects states {xi }ni=1 to globally minimise the variance Vn [Π[f ]]. OBC corresponds to classical cubature rules (e.g. Gauss-Hermite) for specific choices of kernels (Karvonen and Särkkä, 2017). However OBC cannot in general be implemented; the problem of optimising states is in general NP-hard (Schölkopf and Smola, 2002, Sec. 10.2.3). A more pragmatic approach to select states is to use experimental design methods, such as the greedy algorithm that sequentially minimises Vn [Π[g]]. This method, called sequential BC (SBC), is straightforward to implement, e.g. using general-purpose numerical optimisation, and is a probabilistic integration method that is often used (Osborne et al., 2012; Gunter et al., 2014). More sophisticated optimisation algorithms have also been used: For example, in the empirical interpolation literature, Eftang and Stamm (2012) proposed adaptive procedures to iteratively divide the domain of integration into sub-domains. In the BC literature, Briol et al. (2015) used conditional gradient algorithms for this task. A similar approach was recently considered in Oettershagen (2017). At present, experimental design schemes do not possess the computational efficiency that we have come to expect from MCMC and QMC. Moreover, they do not scale well to highdimensional settings due to the need to repeatedly solve high-dimensional optimisation problems and have few established theoretical guarantees. For these reasons we will focus next on MC, MCMC and QMC. 3 Methods This section presents novel theoretical results on probabilistic integration methods in which the states {xi }ni=1 are generated with MCMC and QMC. Sec. 3.1 provides formal definitions, while Sec. 3.2 establishes theoretical results. 3.1 Probabilistic Integration The sampling methods of MCMC and, to a lesser extent, QMC are widely used in statistical computation. Here we pursue the idea of using MCMC and QMC to generate states for BC, with the aim to exploit BC to account for the possible impact of numerical integration error on inferences made in statistical applications. In MCMC it is possible that two states xi = xj are identical. To prevent the kernel matrix KPfrom becoming singular, duplicate states be discarded8 . Pn should n BC MCMC BC Then we define Π̂BMCMC [f ] := i=1 wi f (xi ) and Π̂BQMC [f ] := i=1 wi f (xQMC ). This i two-step procedure requires no modification to existing MCMC or QMC sampling methods. Each estimator is associated with a full posterior distribution, described in Sec. 2.1. A moment is taken to emphasise that the apparently simple act of re-weighting MCMC samples can have a dramatic improvement on convergence rates for integration of a sufficiently smooth integrand. Whilst our main interest is in the suitability of BC as a statistical model 8 this is justified since the information contained in function evaluations fi = fj is not lost. This does not introduce additional bias into BC methods, in contrast to MC methods. 8 for discretisation of an integral, we highlight the efficient point estimation which comes out as a by-product. To date we are not aware of any previous use of BMCMC, presumably due to analytic intractability of the kernel mean when π is un-normalised. BQMC has been described by Hickernell et al. (2005); Marques et al. (2013); Särkkä et al. (2016). To the best of our knowledge there has been no theoretical analysis of the posterior distributions associated with either method. The goal of the next section is to establish these fundamental results. 3.2 Theoretical Properties In this section we present novel theoretical results for BMC, BMCMC and BQMC. The setting we consider assumes that the true integrand f belongs to a RKHS H and that the GP prior is based on a covariance function c which is identical to the kernel k of H. That the GP is not supported on H, but rather on a Hilbert scaleR of H, is viewed as a technical detail: Indeed, a GP can be constructed on H via c(x, x0 ) = k(x, y)k(y, x0 )dπ(y) and a theoretical analysis similar to ours could be carried out (Lemma 2.2 of Cialenco et al., 2012). 3.2.1 Bayesian Markov Chain Monte Carlo As a baseline, we begin by noting a general result for MC estimation. This requires a slight strengthening of the assumption on the kernel: kmax := supx∈X k(x, x) < ∞. This implies that all f ∈ H are bounded on X . For MC estimators, Lemma 33 of Song (2008) show that, when kmax < ∞, the WCE converges in probability at the classical rate kΠ̂MC − ΠkH∗ = OP (n−1/2 ). Turning now to BMCMC (and BMC as a special case), we consider the compact manifold X = [0, 1]d . Below the distribution π will be assumed to admit a density with respect to Lebesgue measure, denoted byP π(·). Define the Sobolev space Hα to consist of all measurable 2 functions such that kf kH,α := i1 +···+id ≤α k∂xi11 . . . ∂xidd f k22 < ∞. Here α is the order of Hα and (Hα , k·kH,α ) is a RKHS. Derivative counting can hence be a principled approach for practitioners to choose a suitable RKHS. All results below apply to RKHS H that are norm-equivalent9 to Hα , permitting flexibility in the choice of kernel. Specific examples of kernels are provided in Sec. 4.2. Our analysis below is based on the scattered data approximation literature (Wendland, 2005). A minor technical assumption, that enables us to simplify the presentation of results below, is that the set X = {xi }ni=1 may be augmented with a finite, pre-determined set Y = {yi }m i=1 where m does not increase with n. Clearly this has no bearing on asymptotics. For measurable A we write Pn [A] = En [1A ] where 1A is the indicator function of the event A. Theorem 1 (BMCMC in Hα ). Suppose π is bounded away from zero on X = [0, 1]d . Let H be norm-equivalent to Hα where α > d/2, α ∈ N. Suppose states are generated by a reversible, uniformly ergodic Markov chain that targets π. Then kΠ̂BMCMC − ΠkH∗ = OP (n−α/d+ ) and moreover, if f ∈ H and δ > 0, Pn {Π[f ] − δ < Π[g] < Π[f ] + δ} = 1 − OP (exp(−Cδ n 2α − d )), where Cδ > 0 depends on δ and  > 0 can be arbitrarily small. two norms k · k, k · k0 on a vector space H are equivalent when there exists constants 0 < C1 , C2 < ∞ such that for all h ∈ H we have C1 khk ≤ khk0 ≤ C2 khk. 9 9 This result shows the posterior distribution is well-behaved; the posterior distribution of Π[g] concentrates in any open neighbourhood of the true integral Π[f ]. This result does not address the frequentist coverage of the posterior, which is assessed empirically in Sec. 5. Although we do not focus on point estimation, a brief comment is warranted: A lower bound on the WCE that can be attained by randomised algorithms in this setting is OP (n−α/d−1/2 ) (Novak and Woźniakowski, 2010). Thus our result shows that the point estimate is at most one MC rate away from being optimal10 . Bach (2015) obtained a similar result for fixed n and a specific importance sampling distribution; his analysis does not directly imply our asymptotic results and vice versa. After completion of this work, similar results on point estimation appeared in Oettershagen (2017); Bauer et al. (2017). Thm. 1 can be generalised in several directions. Firstly, we can consider more general domains X . Specifically, the scattered data approximation bounds that are used in our proof apply to any compact domain X ⊂ Rd that satisfies an interior cone condition (Wendland, 2005, p.28). Technical results in this direction were established in Oates et al. (2016a). Second, we can consider other spaces H. For example, a slight extension of Thm. 1 shows that certain infinitely differentiable kernels lead to exponential rates for the WCE and super-exponential rates for posterior contraction. For brevity, details are omitted. 3.2.2 Bayesian Quasi Monte Carlo The previous section focused on BMCMC in the Sobolev space Hα . To avoid repetition, here we consider more interesting spaces of functions whose mixed partial derivatives exist, for which even faster convergence rates can be obtained using BQMC. To formulate BQMC we must posit an RKHS a priori and consider collections of states {xQMC }ni=1 that constitute a QMC point i set tailored to the RKHS. Consider X = [0, 1]d with π uniform on X . Define thePSobolev space of dominating mixed smoothness Sα to consist of functions for which kf k2S,α := ∀j:ij ≤α k∂xi11 . . . ∂xidd f k22 < ∞. Here α is the order of the space and (Sα , k · kS,α ) is a RKHS. To build intuition, note that Sα is normequivalent to the RKHS generated by a tensor product of Matérn kernels (Sickel and Ullrich, 2009), or indeed a tensor product of any other univariate Sobolev space -generating kernel. For a specific space such as Sα , we seek an appropriate QMC point set. The higher-order digital (t, α, 1, αm × m, d)−net construction is an example of a QMC point set for Sα ; for details we refer the reader to Dick and Pillichshammer (2010) for details. Theorem 2 (BQMC in Sα ). Let H be norm-equivalent to Sα , where α ≥ 2, α ∈ N. Suppose states are chosen according to a higher-order digital (t, α, 1, αm × m, d) net over Zb for some prime b where n = bm . Then kΠ̂BQMC − ΠkH∗ = O(n−α+ ) and , if f ∈ Sα and δ > 0, Pn {Π[f ] − δ < Π[g] < Π[f ] + δ} = 1 − O(exp(−Cδ n2α− )), where Cδ > 0 depends on δ and  > 0 can be arbitrarily small. This result shows that the posterior is again well-behaved. Indeed, the rate of contraction is much faster in Sα compared to Hα . In terms of point estimation, this is the optimal rate for any deterministic algorithm for integration of functions in Sα (Novak and Woźniakowski, 2010). These results should be understood to hold on the sub-sequence n = bm , as QMC methods do 10 the control variate trick of Bakhvalov (1959) can be used to achieve the optimal randomised WCE, but this steps outside of the Bayesian framework. 10 not in general give guarantees for all n ∈ N. It is not clear how far this result can be generalised, in terms of π and X , compared to the result for BMCMC, since this would require the use of different QMC point sets. 3.2.3 Summary In this section we established rates of posterior contraction for BMC, BMCMC and BQMC in a general Sobolev space context. These results are essential since they establish the sound properties of the posterior, which is shown to contract to the truth as more evaluations are made of the integrand. Of course, the higher computational cost of up to O(n3 ) may restrict the applicability of the method in large-n regimes. However, we emphasise that the motivation is to quantify the uncertainty induced from numerical integration, an important task which often justifies the higher computational cost. 4 Implementation So far we have established sound theoretical properties for BMCMC and BQMC under the assumption that the prior is well-specified. Unfortunately, prior specification complicates the situation in practice since, given a test function f , there are an infinitude of RKHS to which f belongs and the specific choice of this space will impact upon the performance of the method. In particular, the scale of the posterior is driven by the scale of the prior, so that the uncertainty quantification being provided is endogenous and, if the prior is not well-specified, this could mitigate the advantages of the probabilistic numerical framework. This important point is now discussed. It is important to highlight a distinction between B(MC)MC and BQMC; for the former the choice of states does not depend on the RKHS. For B(MC)MC this allows for the possibility of off-line specification of the kernel after evaluations of the integrand have been obtained, whereas for alternative methods the kernel must be stated up-front. Our discussion below therefore centres on prior specification in relation to B(MC)MC, where several statistical techniques can be applied. 4.1 Prior Specification The above theoretical results do not address the important issue of whether the scale of the posterior uncertainty provides an accurate reflection of the actual numerical error. This is closely related to the well-studied problem of prior specification in the kriging literature (Stein, 1991; Xu and Stein, 2017). Consider a parametric kernel k(x, x0 ; θl , θs ), with a distinction drawn here between scale parameters θl and smoothness parameters θs . The former are defined as parametrising the norm on H, whereas the latter affect the set H itself. Selection of θl , θs based on data can only be successful in the absence of acute sensitivity to these parameters. For scale parameters, a wide body of evidence demonstrates that this is usually not a concern (Stein, 1991). However, selection of smoothness parameters is an active area of theoretical research (e.g. Szabó et al., 2015). In some cases it is possible to elicit a smoothness parameter from physical or mathematical considerations, such as a known number of derivatives of the integrand. Our attention below is instead restricted to scale parameters, where several approaches are discussed in relation to their suitability for BC: 11 4.1.1 Marginalisation A natural approach, from a Bayesian perspective, is to set a prior p(θl ) on parameters θl and then to marginalise over θl to obtain a posterior over Π[f ]. Recent results for a certain infinitely differentiable kernel establish minimax optimal rates for this approach, including in the practically relevant setting where π is supported on a low-dimensional sub-mainfold of the ambient space X (Yang and Dunson, 2016). However, the act of marginalisation itself involves an intractable integral. While the computational cost of evaluating this integral will often be dwarfed by that of the integral Π[f ] of interest, marginalisation nevertheless introduces an additional undesirable computational challenge that might require several approximations (e.g. Osborne, 2010). It is however possible to analytically marginalise certain types of scale parameters, such as amplitude parameters: Proposition 2. Suppose our covariance function takes the form c(x, y; λ) = λc0 (x, y) where c0 : X × X → R is itself a reproducing kernel and λ > 0 is an amplitude parameter. Consider the improper prior p(λ) ∝ λ1 . Then the posterior marginal for Π[g] is a Student-t distribution with mean and variance Π [c0 (·, X)] C0−1 f , f > C0−1 f {ΠΠ[c0 (·, ·)] − Π[c0 (·, X)]C0−1 Π[c0 (X, ·)]} n and n degrees of freedom. Here [C0 ]i,j = c0 (xi , xj ), [c0 (·, X)]i = c0 (·, xi ), c0 (·, X) = c0 (X, ·)> . 4.1.2 Cross-Validation Another approach to kernel choice is cross-validation. However, this can perform poorly when the number n of data is small, since the data needs to be further reduced into training and test sets. The performance estimates are also known to have large variance in those cases (Chap. 5 of Rasmussen and Williams, 2006). Since the small n scenario is one of our primary settings of interest for BC, we felt that cross-validation was unsuitable for use in applications below. 4.1.3 Empirical Bayes An alternative to the above approaches is empirical Bayes (EB) selection of scale parameters, choosing θl to maximise the log-marginal likelihood of the data f (xi ), i = 1, . . . , n (Sec. 5.4.1 of Rasmussen and Williams, 2006). EB has the advantage of providing an objective function that is easier to optimise relative to cross-validation. However, we also note that EB can lead to over-confidence when n is very small, since the full irregularity of the integrand has yet to be uncovered (Szabó et al., 2015). In addition, it can be shown that EB estimates need not converge as n → ∞ when the GP is supported on infinitely differentiable functions (Xu and Stein, 2017). For the remainder, we chose to focus on a combination of the marginalisation approach for amplitude parameters and the EB approach for remaining scale parameters. Empirical results support the use of this approach, though we do not claim that this strategy is optimal. 4.2 Tractable and Intractable Kernel Means BC requires that the kernel mean µ(π)(x) = Π[k(·, x)] is available in closed-form. This is the case for several kernel-distribution pairs (k, π) and a subset of these pairs are recorded in Table 12 X [0, 1]d [0, 1]d [0, 1]d Rd Sd Arbitrary Arbitrary Arbitrary Arbitrary π Unif(X ) Unif(X ) Unif(X ) Mixt. of Gaussians Unif(X ) Unif(X ) / Mixt. of Gauss. Unif(X ) Known moments Known ∂ log π(x) k Wendland TP Matérn Weighted TP Exponentiated Quadratic Exponentiated Quadratic Gegenbauer Trigonometric Splines Polynomial TP Gradient-based Kernel Reference Oates et al. (2016b) Sec. 5.4 Use of error function Kennedy (1998) Sec. 5.5 Integration by parts Wahba (1990) Briol et al. (2015) Oates et al. (2016a, 2017a) Table 1: A non-exhaustive list of distribution π and kernel k pairs that provide a closed-form expression for both the kernel mean µ(π)(x) = Π[k(·, x)] and the initial error Π[µ(π)]. Here TP refers to the tensor product of one-dimensional kernels. 1. In the event that the kernel-distribution pair (k, π) of interest does not lead to a closed-form kernel mean, it is sometimes possible to determine another kernel-density pair (k 0 , π 0 ) for which Π0 [k 0 (·, x)] is available and such that (i) π is absolutely continuous with respect to π 0 , so that the Radon-Nikodym derivative dπ/dπ 0 exists, and (ii) f dπ/dπ 0 ∈ H(k 0 ). Then one can construct an importance sampling estimator   Z Z dπ dπ 0 0 Π[f ] = f dπ = f dπ = Π f 0 (6) dπ 0 dπ and proceed as above (O’Hagan, 1991). One side contribution of this research was a novel and generic approach to accommodate intractability of the kernel mean in BC. This is described in detail in Supplement B and used in case studies #1 and #2 presented in Sec. 5. 5 Results The aims of the following section are two-fold; (i) to validate the preceding theoretical analysis and (ii) to explore the use of probabilistic integrators in a range of problems arising in contemporary statistical applications. 5.1 Assessment of Uncertainty Quantification Our focus below is on the uncertainty quantification provided by BC and, in particular, the performance of the hybrid marginalisation/EB approach to kernel parameters. To be clear, we are not concerned with accurate point estimation at low computational cost. This is a wellstudied problem that reaches far beyond the methods of this paper. Rather, we are aiming to assess the suitability of the probabilistic description for integration error that is provided by BC. Our motivation is expensive integrands, but to perform assessment in a controlled environment we considered inexpensive test functions of varying degrees of irregularity, whose integrals can be accurately approximated. These included a non-isotropic test function fj (x) = exp(sin(Cj x1 )2 − kxk22 ) with an “easy” setting C1 = 5 and a “hard” setting C2 = 20. The hard test function is more variable and will hence be more difficult to approximate (see Fig. 2). One realisation of states {xi }ni=1 , generated independently and uniformly over X = [−5, 5]d (initially 13 Estimated Integrals 0.75 0.50 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.25 0.00 −0.25 0 38 75 112 150 Length−scale n ● 1.60 ● ● 0.82 0.05 ● ● ● 0 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 40 80 110 150 Estimated Integrals n 0.75 0.50 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.25 0.00 −0.25 0 75 150 225 300 Length−scale n 1.00 ● ● 0.50 0.01 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 10 80 160 230 300 n Figure 2: Evaluation of uncertainty quantification provided by BC. Here we used empirical Bayes (EB) for σ with λ marginalised. Left: The test functions f1 (top), f2 (bottom) in d = 1 dimension. Right: Solutions provided by Monte Carlo (MC; black) and Bayesian MC (BMC; red), for one typical realisation. 95% credible regions are shown for BMC and the green horizontal line gives the true value of the integral. The blue curve gives the corresponding lengthscale parameter selected by EB. d = 1), was used to estimate the Π[fi ]. We work in an RKHS characterised by tensor products of Matérn kernels !α ! √ √ d 1−α 0| 0| Y 2 2α|x − x 2α|x − x i i i i kα (x, x0 ) = λ Kα , Γ(α) σi 2 σi 2 i=1 where Kα is the modified Bessel function of the second kind. Closed-form kernel means exist in this case for α = p + 1/2 whenever p ∈ N. In this set-up, EB was used to select the lengthscale parameters σ = (σ1 , . . . , σd ) ∈ (0, ∞)d of the kernel, while the amplitude parameter λ was marginalised as in Prop. 2. The smoothness parameter was fixed at α = 7/2. Note that all test functions will be in the space Hα for any α > 0 and there is a degree of arbitrariness in this choice of prior. Results are shown in Fig. 2. Error-bars are used to denote the 95% posterior credible regions for the value of the integral and we also display the values σ̂i of the length scale σi selected by EB11 . The σ̂i appear to converge rapidly as n → ∞; this is encouraging but we emphasise that we 11 the term “credible” is used loosely since the σ̂i are estimated rather than marginalised. 14 Figure 3: Evaluation of uncertainty quantification provided by BC. Here we used empirical Bayes for σ with λ marginalised in dimensions d = 1 (top) and d = 3 (bottom). Coverage frequencies (computed from 500 (top) or 150 (bottom) realisations) were compared against notional 100(1 − γ)% Bayesian credible regions for varying level γ and number of observations n. The upper-left quadrant represents conservative credible intervals whilst the lower-right quadrant represents over-confident intervals. Left: “Easy” test function f1 . Right: “Hard” test function f2 . do not provide theoretical guarantees for EB in this work. On the negative side, over-confidence is possible at small values of n. Indeed, the BC posterior is liable to be over-confident under EB, since in the absence of evidence to the contrary, EB selects large values for σ that correspond to more regular functions; this is most evident in the “hard” case. Next we computed coverage frequencies for 100(1 − γ)% credible regions. For each sample size n, the process was repeated over many realisations of the states {xi }ni=1 , shown in Fig. 3. It may be seen that (for n large enough) the uncertainty quantification provided by EB is 15 over-cautious for the easier function f1 , whilst being well-calibrated for the more complicated functions such as f2 . As expected, we observed that the coverage was over-confident for small values of n. Performance was subsequently investigated with λ selected by EB. In general this performed worse than when λ was marginalised; results are contained in Supplement C. Finally, to understand whether theoretical results on asymptotic behaviour are realised in practice, we note (in the absence of EB) that the variance Vn [Π[g]] is independent of the integrand and may be plotted as a function of n. Results in Supplement C demonstrate that theoretical rates are observed in practice for d = 1 for BQMC; however, at large values of d, more data are required to achieve accurate estimation and increased numerical instability was observed. The results on test functions provided in this section illustrate the extent to which uncertainty quantification in possible using BC. In particular, for our examples, we observed reasonable frequentist coverage if the number n of samples was not too small. For the remainder we explore possible roles for BMCMC and BQMC in statistical applications. Four case studies, carefully chosen to highlight both the strengths and the weaknesses of BC are presented. Brief critiques of each study are contained below, the full details of which can be found in Supplement D. 5.2 Case Study #1: Model Selection via Thermodynamic Integration Consider the problem of selecting a single best model among a set {M1 , . . . , MM }, based on data y assumed to arise from a true model in this set. The Bayesian solution, assuming a uniform prior over models, is to select the MAP model. We focus on the case with uniform prior on models p(Mi ) = 1/M , and this problem hence reduces to finding the largest marginal likelihood pi = p(y|Mi ). The pi are usually intractable integrals over the parameters θi associated with model Mi . One widely-used approach to model selection is to estimate each pi in turn, say by p̂i , then to take the maximum of the p̂i over i ∈ {1, . . . , M }. In particular, thermodynamic integration is one approach to approximation of marginal likelihoods pi for individual models (Gelman and Meng, 1998; Friel and Pettitt, 2008). In many contemporary applications the MAP model is not well-identified, for example in variable selection where there are very many candidate models. Then, the MAP becomes sensitive to numerical error in the p̂i , since an incorrect model Mi , i 6= k can be assigned an overly large value of p̂i due to numerical error, in which case it could be selected in place of the true MAP model. Below we explore the potential to exploit probabilistic integration to surmount this problem. 5.2.1 Thermodynamic Integration To simplify notation below we consider computation of a single pi and suppress dependence on the index i corresponding to model Mi . Denote the parameter space by Θ. For t ∈ [0, 1] (an inverse temperature) define the power posterior πt , a distribution over Θ with density πt (θ) ∝ p(y|θ)t p(θ). The thermodynamic identity is formulated as a double integral: Z 1 Z log p(y) = dt log p(y|θ)dπt (θ). 0 Θ R1 R The thermodynamic integral can be re-expressed as log p(y) = 0 g(t)dt, g(t) = Θ f (θ)dπt (θ), where f (θ) = log p(y|θ). Standard practice is to discretise the outer integral and estimate the 16 inner integral using MCMC: Letting 0 = t1 < · · · < tm = 1 denote a fixed temperature schedule, we thus have (e.g. using the trapezium rule) log p(y) ≈ m X ĝi + ĝi−1 , (ti − ti−1 ) 2 n ĝi = i=2 1X log p(y|θi,j ), n (7) j=1 where {θi,j }nj=1 are MCMC samples from πti . Several improvements have been proposed, including the use of higher-order numerical quadrature for the outer integral (Friel et al., 2014; Hug et al., 2016) and the use of control variates for the inner integral (Oates et al., 2017a, 2016b). To date, probabilistic integration has not been explored in this context. 5.2.2 Probabilistic Thermodynamic Integration Our proposal is to apply BC to both the inner and outer integrals. This is instructive, since nested integrals are prone to propagation and accumulation of numerical error. Several features of the method are highlighted: Transfer Learning: In the probabilistic approach, the two integrands f and g are each assigned prior probability models. For the inner integral we assign a prior f ∼ N (0, kf ). Our data here are the nm × 1 vector f where f(i−1)n+j = f (θi,j ). For estimating gi with BC we have m times as much data as for the MC estimator ĝi , in Eqn. 7, which makes use of only n function evaluations. Here, information transfer across temperatures is made possible by the explicit model for f underpinning BC. In the posterior, g = [g(t1 ), . . . , g(tT )] is a Gaussian random vector with g|f ∼ N (µ, Σ) where the mean and covariance are defined, in the obvious notation, by µa = Πta [kf (·, X)]Kf−1 f , Σa,b = Πta Πtb [kf (·, ·)]] − Πta [kf (·, X)]Kf−1 Πtb [kf (X, ·)], where X = {θi,j }nj=1 and Kf is an nm × nm kernel matrix defined by kf . Inclusion of Prior Information: For the outer integral, it is known that discretisation error can be substantial; Friel et al. (2014) proposed a second-order correction to the trapezium rule to mitigate this bias, while Hug et al. (2016) pursued the use of Simpson’s rule. Attacking this problem from the probabilistic perspective, we do not want to place a stationary prior on g(t), since it is known from extensive empirical work that g(t) will vary more at smaller values of t. Indeed the rule-of-thumb ti = (i/m)5 is commonly used (Calderhead and Girolami, 2009). We would like to encode this information into R1 R 1 our prior. To do this, we proceed with an importance sampling step log p(y) = 0 g(t)dt = 0 h(t)π(t)dt. The rule-of-thumb implies an importance distribution π(t) ∝ 1/( + 5t4/5 ) for some small  > 0, which renders the function h = g/π approximately stationary (made precise in Supplement D.1). A stationary GP prior h ∼ N (0, kh ) on the transformed integrand h provides the encoding of this prior knowledge that was used. Propagation of Uncertainty: Under this construction, in the posterior log p(y) is Gaussian with 17 Post. Prob. Std. Thermo. Int. Prob. Thermo. Int. 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 10 30 40 50 60 0 Std. Thermo. Int. Candidate Models 0.6 Post. Prob. 20 10 0.5 0.5 0.4 0.4 0.3 0.3 0.2 0.2 0.1 0.1 0 20 30 40 50 60 50 60 Prob. Thermo. Int. Candidate Models 0.6 0 0 10 20 30 40 50 60 0 10 Candidate Models 20 30 40 Candidate Models Figure 4: Probabilistic thermodynamic integration; illustration on variable selection for logistic regression (the true model was M1 ). Standard and probabilistic thermodynamic integration were used to approximate marginal likelihoods and, hence, the posterior over models. Each row represents an independent realisation of MCMC, while the data y were fixed. Left: Standard Monte Carlo, where point estimates for marginal likelihood were assumed to have no associated numerical error. Right: Probabilistic integration, where a model for numerical error on each integral was propagated through into the posterior over models. The probabilistic approach produces a “probability distribution over a probability distribution”, where the numerical uncertainty is modelled on top of the usual uncertainty associated with model selection. mean and covariance defined as En [log p(y)] = Π[kh (·, T )]Kh−1 µ Vn [log p(y)] = ΠΠ[kh (·, ·)]] − Π[kh (·, T )]Kh−1 Π[kh (T, ·)] | {z } (∗) + Π[kh (·, T )]Kh−1 ΣKh−1 Π[kh (T, ·)], | {z } (∗∗) where T = {ti }m i=1 and Kh is an m × m kernel matrix defined by kh . The term (∗) arises from BC on the outer integral, while the term (∗∗) arises from propagating numerical uncertainty from the inner integral through to the outer integral. 5.2.3 Simulation Study An experiment was conducted to elicit the MAP model from a collection of 56 candidate logistic regression models in a variable selection setting. This could be achieved in many ways; our aim 18 was not to compare accuracy of point estimates, but rather to explore the probability model that, unlike in standard methods, is provided by BC. Full details are in Supplement D.1. Results are shown in Fig. 4. Here we compared approximations to the model posterior obtained using the standard method versus the probabilistic method, over two realisations of the MCMC (the data y were fixed). We make some observations: (i) The probabilistic approach models numerical uncertainty on top of the usual statistical uncertainty. (ii) The computation associated with BC required less time, in total, than the time taken afforded to MCMC. (iii) The same model was not always selected as the MAP when numerical error was ignored and depended on the MCMC random seed. In contrast, under the probabilistic approach, either M1 or M2 could feasibly be the MAP under any of the MCMC realisations, up to numerical uncertainty. (iv) The top row of Fig. 4 shows a large posterior uncertainty over the marginal likelihood for M27 . This could be used as an indicator that more computational effort should be expended on this particular integral. (v) The posterior variance was dominated by uncertainty due to discretisation error in the outer integral, rather than the inner integral. This suggests that numerical uncertainty could be reduced by allocating more computational resources to the outer integral rather than the inner integral. 5.3 Case Study #2: Uncertainty Quantification for Computer Experiments Here we consider an industrial scale computer model for the Teal South oil field, New Orleans (Hajizadeh et al., 2011). Conditional on field data, posterior inference was facilitated using state-of-the-art MCMC (Lan et al., 2016). Oil reservoir models are generally challenging for MCMC: First, simulating from those models can be time-consuming, making the cost of individual MCMC samples a few minutes to several hours. Second, the posterior distribution will often exhibit strongly non-linear concentration of measure. Here we computed statistics of interest using BMCMC, where the uncertainty quantification afforded by BC aims to enable valid inferences in the presence of relatively few MCMC samples. Full details are provided in Supplement D.2. Quantification of the uncertainty associated with predictions is a major topic of ongoing research in this field (Mohamed et al., 2010; Hajizadeh et al., 2011; Park et al., 2013) due to the economic consequences associated with inaccurate predictions of quantities such as future oil production rate. A probabilistic model for numerical error in integrals associated with prediction could provide a more complete uncertainty assessment. The particular integrals that we considered are posterior means for each model parameter, and we compared against an empirical benchmark obtained with brute force MCMC. BMCMC was employed with a Matérn α = 3/2 kernel whose lengthscale-parameter was selected using EB. Estimates for posterior means were obtained using both standard MCMC and BMCMC, shown in Fig. 5. For this example the posterior distribution provides sensible uncertainty quantification for integrals 1, 3, 6-9, but was over-confident for integrals 2, 4, 5. The point accuracy of the BMCMC estimator matched that of the standard MCMC estimator. The lack of faster convergence for BMCMC appears to be due to inaccurate estimation of the kernel mean and we conjecture that alternative exact approaches, such as Oates et al. (2017a), may provide improved performance in this context. However, standard confidence intervals obtained from the CLT for MCMC with a plug-in estimate for the asymptotic variance were over-confident for parameters 2-9. 19 Parameter 1 Parameter 2 Parameter 3 0.0 −0.4 Estimated Integrals 0.4 Estimated Integrals Estimated Integrals 1.0 0.5 0.0 −0.5 −0.8 375 750 1125 1500 0.0 −0.5 375 n Parameter 4 0.5 750 1125 1500 375 750 1125 n n Parameter 5 Parameter 6 1500 1.0 0.5 0.0 Estimated Integrals Estimated Integrals Estimated Integrals 1.0 0.5 0.0 0.4 0.0 −0.4 −0.8 375 750 1125 1500 375 750 1125 n n Parameter 7 Parameter 8 1500 375 750 1125 1500 n Parameter 9 0.0 −0.5 −1.0 375 750 1125 1500 n Estimated Integrals Estimated Integrals Estimated Integrals 0.5 0.4 0.0 −0.4 375 750 1125 0.0 −0.5 1500 n 375 750 1125 1500 n Figure 5: Numerical estimation of parameter posterior means for the Teal South oil field model (centered around the true values). The green line gives the exact value of the integral. The MCMC (black line) and BMCMC point estimates (red line) provided similar performance. The MCMC 95% confidence intervals, based on estimated asymptotic variance (black dotted lines), are poorly calibrated whereas with the BMCMC 95% credible intervals (red dotted lines) provide a more honest uncertainty assessment. 5.4 Case Study #3: High-Dimensional Random Effects Our aim here was to explore whether more flexible representations afforded by weighted combinations of Hilbert spaces enable probabilistic integration when X is high-dimensional. The focus was BQMC, but the methodology could be applied to other probabilistic integrators. 5.4.1 Weighted Spaces The formulation of high (and infinite) -dimensional QMC can be achieved with a construction known as a weighted Hilbert space. These spaces, defined below, are motivated by the observa20 tion that many integrands encountered in applications seem to vary more in lower dimensional projections compared to higher dimensional projections. Our presentation below follows Sec. 2.5.4 and 12.2 of Dick and Pillichshammer (2010), but the idea goes back at least to Wahba (1990, Chap. 10). As usual with QMC, we work in X = [0, 1]d and π uniform over X . Let I = {1, 2, . . . , d}. For each subset u ⊆ I, define a weight γu ∈ (0, ∞) and denote the collection of all weights P by γ = {γu }u⊆I . Consider the space Hγ of functions of the form f (x) = u⊆I fu (xu ), where fu belongs to an RKHS Hu with kernel ku and xu denotes the components of x that are indexed by u ⊆ I. This is not restrictive, since any function can be written in this form by considering P only u = I. We turn Hγ into a Hilbert space by defining an inner product hf, giγ := u⊆I γu−1 hfu ,P gu iu where γ = {γu : u ⊆ I}. Constructed in this way, Hγ is an RKHS with kernel kγ (x, x0 ) = u⊆I γu ku (x, x0 ). Intuitively, the weights γu can be taken to be small whenever the function f does not depend heavily on the |u|-way interaction of the states xu . Thus, most of the γu will be small for a function f thatPis effectively low-dimensional. A measure of the effective dimension of the function is given by u⊆I γu ; in an extreme case d could even be infinite provided that this sum remains bounded (Dick et al., 2013). The (canonical) weighted Sobolev space of dominating mixed smoothness Sα,γ is defined by taking each of the component spaces to be Sα . In finite dimensions d < ∞, BQMC rules based on a higher-order digital net attain optimal WCE rates O(n−α+ ) for this RKHS; see Supplement D.3 for full details. 5.4.2 Semi-Parametric Random Effects Regression For illustration we considered generalised linear models, and focus on a Poisson semi-parametric random effects regression model studied by Kuo et al. (2008, Example 2). The context is inference for the parameters β of the following model Yj |λj ∼ Po(λj ) log(λj ) = β0 + β1 z1,j + β2 z2,j + u1 φ1 (z2,j ) + · · · + ud φd (z2,j ) uj ∼ N (0, τ −1 ) independent. Here z1,j ∈ {0, 1}, z2,j ∈ (0, 1) and φj (z) = [z − κj ]+ where κj ∈ (0, 1) are pre-determined knots. We took d = 50 equally spaced knots in [min z2 , maxRz2 ]. Inference for β requires multiple evaluations of the observed data likelihood p(y|β) = Rd p(y|β, u)p(u)du and therefore is a candidate for probabilistic integration methods, in order to model the cumulative uncertainty of estimating multiple numerical integrals. In order to transform this integration problem to the unit cube the change of R we perform −1 −1 variables xj = Φ (uj ) so that we wish to evaluate p(y|β) = [0,1]d p(y|β, Φ (x))dx. Here Φ−1 (x) denotes the standard Gaussian inverse CDF applied to each component of x. Probabilistic integration here proceeds under the hypothesis that the integrand f (x) = p(y|β, Φ−1 (x)) belongs to (or at least can be well approximated by functions in) Sα,γ for some smoothness parameter α and some weights γ. Intuitively, the integrand f (x) is such that an increase in the value of xj at the knot κj can be compensated for by a decrease in the value of xj+1 at a neighbouring knot κj+1 , but not by changing values of x at more remote knots. Therefore we expect f (x) to exhibit strong individual and pairwise dependence on the xj , but expect higher-order dependency to be weaker. This motivates the weighted space assumption. Sinescu et al. (2012) provides theoretical analysis for the choice of weights γ. Here, weights γ of order two were used; 21 QMC BQMC (2-way) BQMC (d-way) True Integral Estimate 10 -39 10 -40 10 -41 10 -42 0 2 4 6 8 10 12 m Figure 6: Application to semi-parametric random effects regression in d = 50 dimensions, based on n = 2m samples from a higher-order digital net. [Error bars show 95% credible regions. To improve visibility results are shown on the log-scale; error bars are symmetric on the linear scale. A brute-force QMC estimate was used to approximate the true value of the integral p(y|β) where β = (0, 1, 1) was the data-generating value of the parameter.] γu = 1 for |u| ≤ dmax , dmax = 2, γu = 0 otherwise, which corresponds to an assumption of low-order interaction terms (though f can still depend on all d of its arguments). Full details are provided in Supplement D.3. Results in Fig. 6 showed that the 95% posterior credible regions more-or-less cover the truth for this problem, suggesting that the uncertainty estimates are appropriate. On the negative side, the BQMC method does not encode non-negativity of the integrand and, consequently, some posterior mass is placed on negative values for the integral, which is not meaningful. To understand the effect of the weighted space construction here, we compared against the BQMC point estimate with d-way interactions (u ∈ {∅, I}). An interesting observation was that these point estimates closely followed those produced by QMC. 5.5 Case Study #4: Spherical Integration for Computer Graphics Probabilistic integration methods can be defined on arbitrary manifolds, with formulations on non-Euclidean spaces suggested as far back as Diaconis (1988) and recently exploited in the context of computer graphics (Brouillat et al., 2009; Marques et al., 2015). This forms the setting for our final case study. 5.5.1 Global Illumination Integrals Below we analyse BQMC on the d-sphereR Sd = {x = (x1 , . . . , xd+1 ) ∈ Rd+1 : kxk2 = 1} in order to estimate integrals of the form Π[f ] = Sd f dπ, where π is the spherical measure (i.e. uniform R d over S with Sd dπ = 1). Probabilistic integration is applied to compute global illumination integrals used in the rendering of surfaces (Pharr and Humphreys, 2004), and we therefore focus on the case where d = 2. Uncertainty quantification is motivated by inverse global illumination (e.g. Yu et al., 22 Integral Estimate Integral Estimate Red Channel 0.025 5 0.02 0 0.015 10 2 10 3 2 0.018 0 10 3 Blue Channel 0.02 0.015 -5 10 2 0.02 0.016 10 2 Green Channel ×10 -3 ×10 10 3 0.01 10 2 10 3 -3 0.018 0.016 -2 10 2 10 3 Number of States (n) 0.014 10 2 Number of States (n) 10 3 Number of States (n) Figure 7: Probabilistic integration over the sphere was employed to estimate the RGB colour intensities for the California lake environment. [Error bars for BMC (blue) and BQMC (green) represent 95% credible intervals. MC estimates (black) and QMC estimates (red) are shown for reference.] 1999), where the task is to make inferences from noisy observation of an object via computerbased image synthesis; a measure of numerical uncertainty could naturally be propagated in this context. Below, to limit scope, we restrict attention to uncertainty quantification in the forward problem. The models involved in global illumination are based on three main factors: a geometric model for the objects present in the scene, a model for the reflectivity of the surface of each object and a description of the light sources provided by an environment map. The light emitted from the environment will interact with objects in the scene through reflection. This can be formulated as an illumination integral: Z Li (ωi )ρ(ωi , ωo )[ωi · n]+ dπ(ωi ). Lo (ωo ) = Le (ωo ) + S2 Here Lo (ωo ) is the outgoing radiance, i.e. the outgoing light in the direction ωo . Le (ωo ) represents the amount of light emitted by the object itself (which we will assume to be known) and Li (ωi ) is the light hitting the object from direction ωi . The term ρ(ωi , ωo ) is the bidirectional reflectance distribution function (BRDF), which models the fraction of light arriving at the surface point from direction ωi and being reflected towards direction ωo . Here n is a unit vector normal to the surface of the object. Our investigation is motivated by strong empirical results for BQMC in this context obtained by Marques et al. (2015). To assess the performance of BQMC we consider a typical illumination integration problem based on a California lake environment. The goal here is to compute intensities for each of the three RGB colour channels corresponding to observing a virtual object from a fixed direction ωo . We consider the case of an object directly facing the camera (wo = n). For the BRDF we took ρ(ωi , ωo ) = (2π)−1 exp(ωi · ωo − 1). The integrand f (ωi ) = Li (ωi )ρ(ωi , ωo )[ωi · ωo ]+ was modelled in a Sobolev space of low smoothness. The specific function space that we consider is the Sobolev space Hα (Sd ) for α = 3/2, formally defined in Supplement D.4. 23 5.5.2 Results Both BMC and BQMC were tested on this example. To ensure fair comparison, identical kernels were taken as the basis for both methods. BQMC was employed using a spherical tdesign (Bondarenko et al., 2013). It can be shown that for BQMC kΠ̂BQMC − ΠkH∗ = O(n−3/4 ) when this point set is used (see Supplement D.4). Fig. 7 shows performance in RGB-space. For this particular test function, the BQMC point estimate was almost identical to the QMC estimate at all values of n. Overall, both BMC and BQMC provided sensible quantification of uncertainty for the value of the integral at all values of n that were considered. 6 Conclusion The increasing sophistication of computational models, of which numerical integration is one component, demands an improved understanding of how numerical error accumulates and propagates through computation. In (now common) settings where integrands are computationally intensive, or very many numerical integrals are required, effective methods are required that make full use of information available about the problem at hand. This is evidenced by the recent success of QMC, which leverages the smoothness properties of integrands. Probabilistic numerics puts the statistician in centre stage and aims to model the integrand. This approach was eloquently summarised by Kadane (1985), who proposed the following vision for the future of computation: “Statistics can be thought of as a set of tools used in making decisions and inferences in the face of uncertainty. Algorithms typically operate in such an environment. Perhaps then, statisticians might join the teams of scholars addressing algorithmic issues.” This paper explored probabilistic integration from the perspective of the statistician. Our results highlight both the advantages and disadvantages of such an approach. On the positive side, the general methodology described a unified framework in which existing MCMC and QMC methods can be associated with a probability distribution that models discretisation error. Posterior contraction rates were, for the first time, established. On the negative side, there remain many substantial open questions, in terms of philosophical foundations, theoretical analysis and practical application. These are discussed below: Philosophy: There are several issues concerning interpretation. First, whose epistemic uncertainty is being modelled? In Hennig et al. (2015) it was argued that the uncertainty being modelled is that of a hypothetical agent “that we get to design”. That is, the statistician selects priors and loss functions for the agent so that it best achieves the statistician’s own goals. These goals typically involve a combination of relatively black-box behaviour, to perform well on a diverse range of problems, and a low computational overhead. Interpretation of the posterior is then more subtle than for subjective inference and many of the points of contention for objective inference also appear in this framework. Methodology: There are options as to which part of the numerical method should be modelled. In this paper, the integrand f was considered to be uncertain while the distribution π 24 was considered to be known. However, one could alternatively suppose that both f and π are unknown, pursued in Oates et al. (2017b). Regardless, the endogenous nature of the uncertainty quantification means that in practice one is reliant on effective methods for data-driven estimation of kernel parameters. The interaction of standard methods, such as empirical Bayes, with the task of numerical uncertainty quantification demands further theoretical research (e.g. Xu and Stein, 2017). Theory: For probabilistic integration, further theoretical work is required. Our results did not address coverage at finite sample size, nor the interaction of coverage with methods for kernel parameter estimation. A particularly important question, recently addressed in Kanagawa et al. (2016, 2017), is the behaviour of BC when the integrand does not belong to the posited RKHS. Prior Specification: A broad discussion is required on what prior information should be included, and what information should be ignored. Indeed, practical considerations essentially always demand that some aspects of prior information are ignored. Competing computational, statistical and philosophical considerations are all in play and must be balanced. For example, the RKHS framework that we studied in this paper has the advantage of providing a flexible way to encode prior knowledge about the integrand, allowing to specify properties such as smoothness, periodicity, non-stationarity and effective low-dimension. On the other hand, several important properties, including boundedness, are less easily encoded. For BC, the possibility for importance sampling (Eqn. 6) has an element of arbitrariness that appears to preclude the pursuit of a default prior. Even within the RKHS framework, there is the issue that integrands f will usually belong to an infinitude of RKHS. Selecting an appropriate kernel is arguably the central open challenge for QMC research at present. From a practical perspective, elicitation of priors over infinitedimensional spaces in a hard problem. An adequate choice of prior can be very informative for the numerical scheme and can significantly improve the convergence rates of the method. Methods for choosing the kernel automatically could be useful here (e.g. Duvenaud, 2014), but would need to be considered against their suitability for providing uncertainty quantification for the integral. The list above is not meant to be exhaustive, but highlights the many areas of research that are yet to be explored. Acknowledgements The authors are grateful for the expert feedback received from the Associate Editor and Reviewers, as well as from A. Barp, J. Cockayne, J. Dick, D. Duvenaud, A. Gelman, P. Hennig, M. Kanagawa, J. Kronander, X-L. Meng, A. Owen, C. Robert, S. Särkkä, C. Schwab, D. Simpson, J. Skilling, T. Sullivan, Z. Tan, A. Teckentrup and H. Zhu. The authors thank S. Lan and R. Marques for providing code used in case studies 2 and 4. FXB was supported by the EPSRC grant [EP/L016710/1]. CJO was supported by the ARC Centre of Excellence for Mathematical and Statistical Frontiers (ACEMS). MG was supported by the EPSRC grant [EP/J016934/1, EP/K034154/1], an EPSRC Established Career Fellowship, the EU grant [EU/259348] and a Royal Society Wolfson Research Merit Award. This work was also supported by The Alan Turing Institute under the EPSRC grant [EP/N510129/1] and the Lloyds-Turing Programme on Data-Centric Engineering. Finally, this material was also based upon work partially supported 25 by the National Science Foundation (NSF) under Grant DMS-1127914 to the Statistical and Applied Mathematical Sciences Institute. 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 the NSF. References Bach, F. (2017). On the equivalence between quadrature rules and random features. J. Mach. Learn. Res., 18:1–38. Bakhvalov, N. S. (1959). On the approximate calculation of multiple integrals (in Russian). Vestnik MGU, Ser. Math. Mech. Astron. Phys. Chem., 4:3–18. Bauer, B., Devroye, L., Kohler, M., Krzyzak, A. and Walk, H. (2017). Nonparametric estimation of a function from noiseless observations at random points. J. Multivariate Anal., 160:93–104. Berlinet, A. and Thomas-Agnan, C. (2004). Reproducing kernel Hilbert spaces in probability and statistics. Springer Science & Business Media, New York. Bogachev, V. I. (1998). Gaussian Measures. Mathematical Surveys and Monographs, 62, American Mathematical Society. Bondarenko, A., Radchenko, D. and Viazovska, M. (2013). Optimal asymptotic bounds for spherical designs. Ann. Math., 178(2):443–452. Briol, F.-X., Oates, C. J., Girolami, M. and Osborne, M. A. (2015). Frank-Wolfe Bayesian quadrature: Probabilistic integration with theoretical guarantees. In Proc. Adv. Neur. In. (NIPS), 1162–1170. Brouillat, J., Bouville, C., Loos, B., Hansen, C. and Bouatouch, K. (2009). A Bayesian Monte Carlo approach to global illumination. Comp. Graph. Forum, 28(8):2315–2329. Buchholz, A. and Chopin, N. (2017). Improving approximate Bayesian computation via quasi Monte Carlo. arXiv:1710:01057. Calderhead, B. and Girolami, M. (2009). Estimating Bayes factors via thermodynamic integration and population MCMC. Comput. Statist. Data Anal., 53(12):4028–4045. Cialenco, I., Fasshauer, G. E., Ye, Q. (2012). Approximation of stochastic partial differential equations by a kernel-based collocation method. Int. J. Comput. Math., 89(18):2543–2561. Cockayne, J., Oates, C. J., Sullivan, T. and Girolami, M. (2017). Bayesian Probabilistic Numerical Methods. arXiv:1702.03673. Diaconis, P. (1988). Bayesian numerical analysis. Statist. Decis. Theory Rel. Top. IV, 163–175. Dick, J. and Pillichshammer, F. (2010). Digital nets and sequences - discrepancy theory and quasi-Monte Carlo integration. Cambridge University Press. Dick, J., Kuo, F. Y. and Sloan, I. H. (2013). High-dimensional integration: The quasi-Monte Carlo way. Acta Numer., 22:133–288. 26 Duvenaud, D. (2014). Automatic model construction with Gaussian processes. PhD thesis, University of Cambridge. Efron, B. and Tibshirani, R. J. (1994). An introduction to the bootstrap. CRC press. Eftang, J. L. and Stamm, B. (2012). Parameter multi-domain “hp” empirical interpolation. Int. J. Numer. Methods Eng., 90(4):412–428. Friel, N. and Pettitt, A. (2008). Marginal likelihood estimation via power posteriors. J. R. Stat. Soc. Ser. B. Stat. Methodol., 70(3):589–607. Friel, N. Hurn, M. and Wyse, J. 2014. Improving power posterior estimation of statistical evidence. Stat. Comput., 24(5):709–723. Gelman, A. and Meng, X.-L. (1998). Simulating normalizing constants: From importance sampling to bridge sampling to path sampling. Statist. Sci., 13(2):163–185. Gerber, M. and Chopin, N. (2015). Sequential quasi-Monte Carlo. J. R. Stat. Soc. Ser. B. Stat. Methodol., 77(3):509–579. Girolami, M. and Calderhead, B. (2011). Riemann manifold Langevin and Hamiltonian Monte Carlo methods. J. R. Stat. Soc. Ser. B. Stat. Methodol., 73(2):123–214. Gunter, T., Garnett, R., Osborne, M., Hennig, P. and Roberts, S. (2014). Sampling for inference in probabilistic models with fast Bayesian quadrature. In Proc. Adv. Neur. In., 2789–2797. Hajizadeh, Y., Christie, M., and Demyanov, V. (2011). Ant colony optimization for history matching and uncertainty quantification of reservoir models. J. Petrol. Sci. Eng., 77(1):78– 92. Hennig, P., Osborne, M. A. and Girolami, M. (2015). Probabilistic numerics and uncertainty in computations. J. Roy. Soc. A, 471(2179). Hickernell, F. J. (1998). A generalized discrepancy and quadrature error bound. Math. Comp., 67(221):299–322. Hickernell, F. J., Lemieux, C., and Owen, A. B. (2005). Control variates for quasi-Monte Carlo. Statist. Sci., 20(1):1–31. Hug, S., Schwarzfischer, M., Hasenauer, J., Marr, C., and Theis, F. J. (2016). An adaptive scheduling scheme for calculating Bayes factors with thermodynamic integration using Simpson’s rule. Stat. Comp., 26(3):663–677. Huszar, F. and Duvenaud, D. (2012). Optimally-weighted herding is Bayesian quadrature. In Proc. Uncertainty in Artificial Intelligence (UAI), 377–385. Kadane, J. B. (1985). Parallel and sequential computation: A statistician’s view. J. Complexity, 1:256–263. Kadane, J. B. and Wasilkowski, G. W. (1985). Average case -complexity in computer science: A Bayesian view. In Bayesian Statist., 2:361–374. 27 Kallenberg, O. (2002). Foundations of Modern Probability. Second Edition. Probability and its Applications, Springer. Kanagawa, M., Sriperumbudur, B. K. and Fukumizu, K. (2016). Convergence guarantees for kernel-based quadrature rules in misspecified settings. In Proc. Adv. Neur. In. (NIPS), 2016. Kanagawa, M., Sriperumbudur, B. K. and Fukumizu, K. (2017). Convergence analysis of deterministic kernel-based quadrature rules in misspecified settings. arXiv:1709.00147 Karvonen, T. and Särkkä, S. (2017). Fully symmetric kernel quadrature. arXiv:1703.06359. Karvonen, T. and Särkkä, S. (2017). Classical quadrature rules via Gaussian processes. IEEE International Workshop on Machine Learning for Signal Processing, to appear. Kennedy, M. (1998). Bayesian quadrature with non-normal approximating functions. Stat. Comput., 8(4):365–375. Kristoffersen, S. (2013). The empirical interpolation method. Master’s thesis, Department of Mathematical Sciences, Norwegian University of Science and Technology. Kuo, F. Y., Dunsmuir, W. T. M., Sloan, I. H., Wand, M. P. and Womersley, R. S. (2008). Quasi-Monte Carlo for highly structured generalised response models. Methodol. Comput. Appl. Probab., 10(2):239–275. Lan, S., Bui-Thanh, T., Christie, M., and Girolami, M. (2016). Emulation of higher-order tensors in manifold Monte Carlo methods for Bayesian inverse problems. J. Comput. Phys., 308:81–101. Larkin, F. M. (1972). Gaussian measure in Hilbert space and applications in numerical analysis. Rocky Mountain J. Math., 2:(3) 379–421. Marques, R., Bouville, C., Ribardiere, M., Santos, L. P. and Bouatouch, K. (2013). A spherical Gaussian framework for Bayesian Monte Carlo rendering of glossy surfaces. In IEEE Trans. Vis. and Comp. Graph., 19(10):1619–1632. Marques, R., Bouville, C., Santos, L. and Bouatouch, K. (2015). Efficient quadrature rules for illumination integrals: from quasi Monte Carlo to Bayesian Monte Carlo. Synth. Lect. Comput. Graph. Animation, 7(2):1–92. Minka, T. (2000). Deriving quadrature rules from Gaussian processes. Technical report, Statistics Department, Carnegie Mellon University. Mohamed, L., Christie, M. and Demyanov, V. (2010). Comparison of stochastic sampling algorithms for uncertainty quantification. SPE Journal, 15:31–38. Mosbach, S. and Turner, A. G. (2009). A quantitative probabilistic investigation into the accumulation of rounding errors in numerical ODE solution. Comput. Math. Appl., 57(7):1157– 1167. Novak, E. and Woźniakowski, H. (2008). Tractability of multivariate problems, volume I: Linear information. EMS Publishing House, EMS Tracts in Mathematics 6. 28 Novak, E. and Woźniakowski, H. (2010). Tractability of multivariate problems, volume II : Standard information for functionals. EMS Publishing House, EMS Tracts in Mathematics 12. O’Hagan, A. (1991). Bayes–Hermite quadrature. J. Statist. Plann. Inference, 29:245–260. O’Hagan, A. (1992). Some Bayesian numerical analysis. Bayesian Statist., 4:345–363. Oates, C. J., Cockayne, J., Briol, F.-X. and Girolami, M. (2016a). Convergence rates for a class of estimators based on Stein’s identity. arXiv:1603.03220. Oates, C. J., Papamarkou, T., and Girolami, M. (2016b). The controlled thermodynamic integral for Bayesian model comparison. J. Amer. Statist. Assoc., 111(514):634–645 Oates, C. J., Girolami, M., and Chopin, N. (2017a). Control functionals for Monte Carlo integration. J. R. Stat. Soc. Ser. B. Stat. Methodol., 79(3):695–718. Oates, C. J., Niederer, S., Lee, A., Briol, F. X., and Girolami, M. (2017b). Probabilistic models for integration error in assessment of functional cardiac models. In Proc. Adv. Neur. In. (NIPS), to appear. Oates, C. J., Cockayne, J. and Aykroyd, R. G. (2017c). Bayesian probabilistic numerical methods for industrial process monitoring. arXiv:1707.06107. Oettershagen, J. Construction of optimal cubature algorithms with applications to econometrics and uncertainty quantification. PhD Thesis, University of Bonn, 2017. Osborne, M. A. (2010). Bayesian Gaussian processes for sequential prediction, optimisation and quadrature. PhD thesis, University of Oxford. Osborne, M. A., Duvenaud, D., Garnett, R., Rasmussen, C. E., Roberts, S. and Ghahramani, Z. (2012). Active learning of model evidence using Bayesian quadrature. In Proc. Adv. Neur. In. (NIPS), 46–54. Park, H., Scheidt, C., Fenwick, D., Boucher, A., and Caers, J. (2013). History matching and uncertainty quantification of facies models with multiple geological interpretations. Comput. Geosci., 17(4):609–621. Pharr, M. and Humphreys, G. (2004). Physically based rendering: From theory to implementation. Morgan Kaufmann Publishers Inc. Rasmussen, C. and Williams, C. (2006). Gaussian Processes for Machine Learning. MIT Press. Rasmussen, C. E. and Ghahramani, Z. (2002). Bayesian Monte Carlo. In Proc. Adv. Neur. Inf. (NIPS), 489–496. Ritter, K. (2000). Average-case analysis of numerical problems. Springer-Verlag Berlin Heidelberg. Robert, C. and Casella, G. (2013). Monte Carlo statistical methods. Springer Science & Business Media. 29 Särkka, S., Hartikainen, J., Svensson, L., and Sandblom, F. (2016). On the relation between Gaussian process quadratures and sigma-point methods. J. Adv. Inf. Fusion, 11(1):31–46. Schölkopf, B. and Smola, A. (2002). Learning with Kernels: Support Vector Machines, Regularization, Optimization and Beyond. MIT Press. Sickel, W. and Ullrich, T. (2009). Tensor products of Sobolev–Besov spaces and applications to approximation from the hyperbolic cross. J. Approx. Theory, 161(2):748–786. Sinescu, V., Kuo, F. Y. and Sloan, I. H. (2012). On the choice of weights in a function space for quasi-Monte Carlo methods for a class of generalised response models in statistics. In Proc. Monte Carlo and Quasi-Monte Carlo Methods, 2012. Smola, A., Gretton, A., Song, L., and Schölkopf, B. (2007). A Hilbert space embedding for distributions. In Proc. 18th I. Conf. Algorithmic Learn. Theory, 13–31. Sommariva, A. and Vianello, M. (2006). Numerical cubature on scattered data by radial basis functions. Computing, 76(3-4):295–310. Song, L. (2008). Learning via Hilbert space embedding of distributions. PhD thesis, School of Information Technologies, University of Sydney. Stein, M. (1991). Interpolation of Spatial Data - Some Theory for Kriging. Springer Science & Business Media. Stein, M. (1995a). Predicting integrals of random fields using observations on a lattice. Ann. Statist., 23(6):1975–1990. Stein, M. (1995b). Locally lattice sampling designs for isotropic random fields. Ann. Statist., 23(6):1991–2012. Steinwart, I. and Christmann, A. (2008). Support vector machines. Springer Science & Business Media. Suldin, A. B. (1959). Wiener measure and its applications to approximation methods. I. Izvestiya Vysshikh Uchebnykh Zavedenii. Matematika, 6145–158. Szabó, B., van der Vaart, A. and van Zanten, J. (2015). Frequentist coverage of adaptive nonparametric Bayesian credible sets. Ann. Statist., 43(4):1391–1428. Traub, J. F., Woźniakowski, H. and Wasilkowski, G. W. (1988). Information-based complexity. Academic Press. Wahba, G. (1990). Spline models for observational data. CBMS-NSF Regional Conference Series in Applied Mathematics, 59. Wendland, H. (2005). Scattered data approximation. Cambridge University Press. Zu, W. and Stein, M. L. (2011). Maximum likelihood estimation for a smooth Gaussian random field model. SIAM J. Uncertainty Quantification, 5(1):138–175. Yang, Y. and Dunson, D. B. (2016). Bayesian manifold regression. Ann. Stat., 44(2):876–905. 30 Yu, Y. Debevec, P. Malik, J. and Hawkins, T. (1999). Inverse global illumination: Recovering reflectance models of real scenes from photographs. In Proc. Ann. Conf. Comput. Graph. Int. Tech., 215–224. 31 Supplement This supplement provides complete proofs for theoretical results, extended numerics and full details to reproduce the experiments presented in the paper. A Proof of Theoretical Results Proof of Fact 1. For a prior N (m, c) and data {(xi , fi )}ni=1 , standard conjugacy results for GPs lead to the posterior Pn = N (mn , cn ) over L, with mean mn (x) = m(x) + c(x, X)C −1 (f − m) and covariance cn (x, x0 ) = c(x, x0 ) − c(x, X)C −1 c(X, x0 ), see Chap. 2 of Rasmussen and Williams (2006). Then repeated application of Fubini’s theorem produces Z  Z En [Π[g]] = En g dπ = mn dπ Z Z g dπ − Vn [Π[g]] = ZZZ = ZZ = 2 Z mn dπ dPn (g) [g(x) − mn (x)][g(x0 ) − mn (x0 )] dPn (g)dπ(x)dπ(x0 ) cn (x, x0 ) dπ(x)dπ(x0 ). The proof is completed by substituting the expressions for mn and cn into these two equations. (The result in the main text additionally sets m ≡ 0.) Proof of Fact 1. From Eqn. 5 in the main text kΠ̂ − ΠkH∗ ≤ kµ(π̂) − µ(π)kH . For the converse inequality, consider the specific integrand f = µ(π̂) − µ(π). Then, from the supremum definition of the dual norm, kΠ̂ − ΠkH∗ ≥ |Π̂[f ] − Π[f ]|/kf kH . Now we use the reproducing property: |Π̂[f ] − Π[f ]| kf kH = = |hf, µ(π̂) − µ(π)iH | kf kH kµ(π̂) − µ(π)k2H = kµ(π̂) − µ(π)kH . kµ(π̂) − µ(π)kH This completes the proof. Proof of Fact 2. Combining Fact 1 with direct calculation gives that kΠ̂ − Πk2H∗ = kµ(π̂) − µ(π)k2H Z ZZ n n X X = wi wj k(xi , xj ) − 2 wi k(x, xi ) dπ(x) + k(x, x0 ) dπ(x)dπ(x0 ) i,j=1 > i=1 > = w Kw − 2w Π[k(X, ·)] + ΠΠ[k(·, ·)] as required. The following lemma shows that probabilistic integrators provide a point estimate that is at least as good as their non-probabilistic counterparts: 1 P Lemma 1 (Bayesian re-weighting). Let f ∈ H. Consider the cubature rule Π̂[f ] = ni=1 wi f (xi ) P and the corresponding BC rule Π̂BC [f ] = ni=1 wiBC f (xi ). Then kΠ̂BC − ΠkH∗ ≤ kΠ̂ − ΠkH∗ . Proof. This is immediate from Fact 2, which shows that the BC weights wiBC are an optimal choice for the space H. The convergence of Π̂BC is controlled by quality of the approximation mn : Lemma 2 (Regression bound). Let f ∈ H and fix states {xi }ni=1 ∈ X . Then we have |Π[f ] − Π̂BC [f ]| ≤ kf − mn k2 . R of Jensen’s inequality: |Π[f ] − Π̂BC [f ]|2 = ( f − mn dπ)2 ≤ RProof. This2 is an application (f − mn ) dπ = kf − mn k22 , as required. Note that this regression bound is not sharp in general (Ritter, 2000, Prop. II.4) and, as a consequence, Thm. 1 below is not quite optimal. Lemmas 1 and 2 refer to the point estimators provided by BC. However, we aim to quantify the change in probability mass as the number of samples increases: Lemma 3 (BC contraction). Assume f ∈ H. Suppose that kΠ̂BC − ΠkH∗ ≤ γn where γn → 0 as n → ∞. Define Iδ = [Π[f ] − δ, Π[f ] + δ] to be an interval of radius δ > 0 centred on the true value of the integral. Then Pn {Π[g] ∈ / Iδ } vanishes at the rate O(exp(−(δ 2 /2)γn−2 )). Proof. Assume without loss of generality that δ < ∞. The posterior distribution over Π[g] is Gaussian with mean mn and variance vn . Since vn = kΠ̂BC − Πk2H∗ we have vn ≤ γn2 . Now the R c posterior probability mass on Iδ is given by I c φ(r|mn , vn )dr, where φ(r|mn , vn ) is the p.d.f. of δ the N (mn , vn ) distribution. From the definition of δ we get the upper bound Z Π[f ]−δ Z ∞ Pn {Π[g] ∈ / Iδ } ≤ φ(r|mn , vn )dr + φ(r|mn , vn )dr −∞ = Π[f ]+δ  Π[f ] − m  Π[f ] − m δ  δ  n n 1+Φ −Φ . −√ +√ √ √ vn vn vn vn | {z } | {z } (∗) (∗) From the definition of the WCE we have that the terms (∗) are bounded by kf kH < ∞, so that asymptotically as γn → 0 we have √  √  Pn {Π[g] ∈ / Iδ } . 1 + Φ − δ/ vn − Φ δ/ vn   . 1 + Φ − δ/γn − Φ δ/γn √  . erfc δ/ 2γn . The result follows from the fact that erfc(x) . exp(−x2 /2) for x sufficiently small. This result demonstrates that the posterior distribution is well-behaved; probability mass concentrates in a neighbourhood Iδ of Π[f ]. Hence, if our prior is well calibrated (see Sec. 4.1), the posterior provides uncertainty quantification over the solution of the integral as a result of performing a finite number n of integrand evaluations. Define the fill distance of the set X = {xi }ni=1 as hX = sup min kx − xi k2 . x∈X i=1,...,n 2 As n → ∞ the scaling of the fill distance is described by the following special case of Lemma 2, Oates et al. (2016a): Lemma 4. Let v : [0, ∞) → [0, ∞) be continuous, monotone increasing, and satisfy v(0) = 0 and limx↓0 v(x) exp(x−3d ) = ∞. Suppose further X = [0, 1]d , π is bounded away from zero on X , and X = {xi }ni=1 are samples from an uniformly ergodic Markov chain targeting π. Then  we have EX [v(hX )] = O v(n−1/d+ ) where  > 0 can be arbitrarily small. Proof of Thm. 1. Initially consider fixed states X = {xi }ni=1 (i.e. fixing the random seed) and H = Hα . From a standard result in functional approximation due to Wu and Schaback (1993), see also Wendland (2005, Thm. 11.13), there exists C > 0 and h0 > 0 such that, for all x ∈ X and hX < h0 , |f (x) − mn (x)| ≤ ChαX kf kH . (For other kernels, alternative bounds are well-known; Wendland, 2005, Table 11.1). We augment X with a finite number of states Y = {yi }m i=1 to ensure that hX∪Y < h0 always holds. Then from the regression bound (Lemma 2), Z Π̂BMCMC [f ] − Π[f ] ≤ kf − mn k2 = Z ≤ 1/2 (f (x) − mn (x)) dπ(x) (ChαX∪Y kf kH )2 2 1/2 dπ(x) = ChαX∪Y kf kH . It follows that kΠ̂BMCMC − ΠkHα∗ ≤ ChαX∪Y . Now, taking an expectation EX over the sample path X = {xi }ni=1 of the Markov chain, we have that EX kΠ̂BMCMC − ΠkHα∗ ≤ CEX hαX∪Y ≤ CEX hαX . (8) From Lemma 4 above, we have a scaling relationship such that, for hX∪Y < h0 , we have EX hαX = O(n−α/d+ ) for  > 0 arbitrarily small. From Markov’s inequality, convergence in mean implies convergence in probability and thus, using Eqn. 8, we have kΠ̂BMCMC − ΠkHα∗ = OP (n−α/d+ ). This completes the proof for H = Hα . More generally, if H is norm-equivalent to Hα then the result follows from the fact that kΠ̂BMCMC − ΠkH∗ ≤ λkΠ̂BMCMC − ΠkHα∗ for some λ > 0. Proof of Thm. 2. From Theorem 15.21 of Dick and Pillichshammer (2010), which assumes α ≥ 2, α ∈ N, the QMC rule Π̂QMC based on a higher-order digital (t, α, 1, αm × m, d) net over Zb for some prime b satisfies kΠ̂BQMC − ΠkH∗ ≤ Cd,α (log n)dα n−α = O(n−α+ ) for Sα the Sobolev space of dominating mixed smoothness order α, where Cd,α > 0 is a constant that depends only on d and α (but not on n). The result follows immediately from norm equivalence and Lemma 1. The contraction rate follows from Lemma 3. Proof of Prop. 2. Denote by Pn,λ the posterior distribution on the integral conditional on a value of λ. Following Prop. 1, this is a Gaussian distribution with mean and variance given by: En,λ [Π[g]] = Π[c0 (·, X)]C0−1 f Vn,λ [Π[g]] = λ{ΠΠ[c0 (·, ·)] − Π[c0 (·, X)]C0−1 Π[c0 (X, ·)]} 3 Furthermore, the posterior on the amplitude parameter satisfies p(λ|f ) ∝ p(f |λ)p(λ)   1 > −1 1 − f C0 f = 1 exp n 2λ (2π)n/2 λ 2 +1 |C0 | 2 which corresponds to an inverse-gamma distribution with parameters α = n2 and β = 12 f > C0−1 f . We therefore have that (Π[g], λ) is distributed as normal-inverse-gamma and the marginal distribution for Π[g] is a Student-t distribution, as claimed. B Kernel Means In this section we propose approximate Bayesian cubature, a Π̂BC , where the weights a wBC = K −1 a Π[k(X, ·)] are an approximation to the optimal BC weights based on an approximation a Π[k(X, ·)] of the kernel mean (see also Prop. 1 in Sommariva and Vianello, 2006). The following lemma demonstrates that we can bound the contribution of this error and inflate our posterior Pn 7→ a Pn to reflect the additional uncertainty due to the approximation, so that uncertainty quantification is still provided. Lemma 5 (Approximate kernel mean). Consider an approximation a π to π of the form a π = Pm w j=1 a j δa xj . Then BC can be performed analytically with respect to a π; denote this estimator √ by a Π̂BC . Moreover, ka Π̂BC − Πk2H∗ ≤ kΠ̂BC − Πk2H∗ + nka Π − Πk2H∗ . Proof. Define z = Π[k(X, ·)] and a z = a Π[k(X, ·)]. Let  = a z − z, write a Π̂BC = and consider Pn BC i=1 a wi δxi ka Π̂BC − Πk2H∗ = kµ(a π̂BC ) − µ(π)k2H * n + Z Z n X X BC BC = k(·, x)dπ(x), k(·, x)dπ(x) a wi k(·, xi ) − a wi k(·, xi ) − i=1 i=1 = H > > a wBC K a wBC − 2a wBC z + Π[µ(π)] = (K −1 a z)> K(K −1 a z) − 2(K −1 a z)> z + Π[µ(π)] = (z + )> K −1 (z + ) − 2(z + )> K −1 z + Π[µ(π)] = kΠ̂BC − Πk2H∗ + > K −1 . Use ⊗ to denote the tensor product of RKHS. Now, since i = a zi − zi = µ(a π̂)(xi ) − µ(π)(xi ) = hµ(a π̂) − µ(π), k(·, xi )iH , we have: > K −1  = X [K −1 ]i,i0 µ(a π̂) − µ(π), k(·, xi ) H µ(a π̂) − µ(π), k(·, xi0 ) H i,i0 = D E   X −1 µ(a π̂) − µ(π) ⊗ µ(a π̂) − µ(π) , [K ]i,i0 k(·, xi ) ⊗ k(·, xi0 ) H⊗H i,i0 ≤ kµ(a π̂) − µ(π)k2H X [K −1 ]i,i0 k(·, xi ) ⊗ k(·, xi0 ) i,i0 4 H⊗H . From Fact 1 we have kµ(a π̂) − µ(π)kH = ka Π̂ − ΠkH so it remains to show that the second term √ is equal to n. Indeed, X [K −1 ]i,i0 k(·, xi ) ⊗ k(·, xi0 ) i,i0 = X 2 H [K −1 ]i,i0 [K −1 ]l,l0 k(·, xi ) ⊗ k(·, xi0 ), k(·, xl ) ⊗ k(·, xl0 ) H i,i0 ,l,l0 = X [K −1 ]i,i0 [K −1 ]l,l0 [K]il [K]i0 ,l0 = tr[KK −1 KK −1 ] = n. i,i0 ,l,l0 This completes the proof. Under this method, the posterior variance a Vn [Π[g]] := ka Π̂BC − Πk2H∗ cannot be computed in closed-form, but computable upper-bounds can be obtained and these can then be used to propagate numerical uncertainty through the remainder of our statistical task. The idea here is to make use of the triangle inequality: ka Π̂BC − ΠkH∗ ≤ ka Π̂BC − a ΠkH∗ + ka Π − ΠkH∗ . (9) The first term on the RHS is now available analytically; from Fact 1 its square is a Πa Π[k(·, ·)] − −1 Π[k(X, ·)]. For the second term, explicit upper bounds exist in the case where a Π[k(·, X)]K a states a xi are independent random samples from π. For instance, from (Song, 2008, Thm. 27) we have, for a radial kernel k, uniform a wj = m−1 and independent a xi ∼ π, r p log(2/δ) 2 (10) ka Π − ΠkH∗ ≤ √ sup k(x, x) + 2m m x∈X with probability at least 1 − δ. (For dependent a xj , the m in Eqn. 10 can be replaced with an estimate for the effective sample size.) Write Cn,γ,δ for a 100(1 − γ)% credible interval for Π[f ] defined by the conservative upper bound described in Eqns. 9 and 10. Then we conclude that Cn,γ,δ is 100(1 − γ)% credible interval with probability at least 1 − δ. Note that, even though the credible region has been inflated, it still contracts to the truth, since the first term on the RHS in Lemma 5 can be bounded by the sum of ka Π̂BC − ΠkH∗ and ka Π − ΠkH∗ , both of which vanish as n, m → ∞. The resulting (conservative) posterior a Pn can be viewed as a updating of beliefs based on an approximation to the likelihood function; the statistical foundations of such an approach are made clear in the recent work of Bissiri et al. (2016). C Additional Numerics This section presents additional numerical results concerning the calibration of uncertainty for multiple parameters and in higher dimensions. Calibration in d = 1: In Fig. 8 (top row) we study the quantification of uncertainty provided by EB in the same setup as in the main text, but optimising over both length-scale parameter σ1 and magnitude parameter λ. For both “easy” and “hard” test functions, we notice that EB led to over-confident inferences in the “low n” regime, but attains approximately correct frequentist coverage for larger n. 5 Calibration in d = 5: The experiments of Sec. 5.1, based on BMC, were repeated in dimension d = 5. Results are shown in Fig. 8 (bottom row). Clearly more integrand evaluations are required for EB to attain a good frequentist coverage of the credible intervals, due to the curse of dimension. However, the frequentist coverage was reasonable for large n in this task. Empirical convergence assessment: The convergence of BQMC was studied based on higher-order digital nets. The theoretical rates provided in Sec. 3.2.2 for this method are O(n−α+ ) for any α > 1/2. Figure 9 gives the results obtained for d = 1 (left) and d = 5 (right). In the one dimensional case, the O(n−α+ ) theoretical convergence rate is attained by the method in all cases p = α + 1/2 ∈ {3/2, 5/2, 7/2} considered. However, in the d = 5 case, the rates are not observed for the number n of evaluations considered. This helps us demonstrate the important point that (in addition to numerical conditioning) the rates we provide are asymptotic, and may require large values of n before being observed. 6 Figure 8: Evaluation of uncertainty quantification provided by EB for both σ and λ. Results are shown for d = 1 (top) and d = 5 (bottom). Coverage frequencies Cn,γ (computed from 100 (top) or 50 (bottom) realisations) were compared against notional 100(1−γ)% Bayesian credible regions for varying level γ. Left: “Easy” test function f1 . Right: “Hard” test function f2 . 7 Posterior Standard Deviation Posterior Standard Deviation 1e+01 1e+00 1e−01 1e−02 1e−03 1e−04 1e−05 1e−06 2 8 32 128 512 2048 1e+00 1e−01 1e−02 1e−03 1e−04 1e−05 2 n 8 32 128 512 2048 n Figure 9: Empirical investigation of BQMC in d = 1 (left) and d = 5 (right) dimensions and a Sobolev space of mixed dominating smoothness Sα . The results are obtained using tensor product Matérn kernels of smoothness α = 3/2 (red), α = 5/2 (green) and α = 7/2 (blue). Dotted lines represent the theoretical convergence rates established for each kernel. The black line represents standard QMC. Kernel parameters were fixed to (σi , λ) = (0.005, 1) (left) and (σi , λ) = (1, 0.5) (right). 8 D D.1 Supplemental Information for Case Studies Case Study #1 MCMC: In this paper we used the manifold Metropolis-adjusted Langevin algorithm (Girolami and Calderhead, 2011) in combination with population MCMC. Population MCMC shares information across temperatures during sampling, yet previous work has not leveraged evaluation of the log-likelihood f from one sub-chain ti to inform estimates derived from other sub-chains ti0 , i0 6= i. In contrast, this occurs naturally in the probabilistic integration framework, as described in the main text. Here MCMC was used to generate a small number, n = 200, of samples on a per-model basis, in order to simulate a scenario where numerical error in computation of marginal likelihood will be non-negligible. A temperature ladder with m = 10 rungs was employed, for the same reason, according to the recommendation of Calderhead and Girolami (2009). No convergence issues were experienced; the same MCMC set-up has previously been successfully used in Oates et al. (2016b). Prior elicitation: Here we motivate a prior for the unknown function g based on the work of i−1 5 Calderhead and Girolami (2009), who advocated the use of a power-law schedule ti = ( m−1 ) , i = 1, . . . , m, based on an extensive empirical comparison of possible schedules. A “good” temperature schedule approximately satisfies the criterion |g(ti )(ti+1 − ti )| ≈ m−1 , on the basis that this allocates equal area to the portions of the curve g that lie between ti and ti+1 , controlling i−1 5 bias for the trapezium rule. Substituting ti = ( m−1 ) into this optimality criterion produces 5 5 4 |g(ti )|((i + 1) − i ) ≈ m . Now, letting i = θm, we obtain |g(θ5 )|(5θ4 m4 + o(m4 )) ≈ m4 . Formally treating θ as continuous and taking the m → ∞ limit produces |g(θ5 )| ≈ 0.2θ−4 and so |g(t)| ≈ 0.2t−4/5 . From this we conclude that the transformed function h(t) = 5t4/5 g(t) is approximately stationary and can reasonably be assigned a stationary GP prior. However, in an importance sampling transformation we require that π(t) has support over [0, 1]. For this reason we took π(t) = 1.306/(0.01 + 5t4/5 ) in our experiment. Variance computation: The covariance matrix Σ cannot be obtained in closed-form due to intractability of the kernel mean Πti [kf (·, θ)]. We therefore explored an approximation a Σ such that plugging in a Σ in place of Σ provides an approximation to the posterior variance Vn [log p(y)] for the log-marginal likelihood. This took the form a Σi,j := a Πti a Πtj [kf (·, ·)] − a Πti [kf (·, X)]Kf−1 a Πtj [kf (X, ·)] 1 P100 where an empirical distribution a π = 100 i=1 δxi was employed based on the first m = 100 samples, while the remaining samples X = {xi }200 i=101 were reserved for the kernel computation. This heuristic approach becomes exact as m → ∞, in the sense that a Σi,j → Σi,j , but underestimates covariance at finite m. Kernel choice: In experiments below, both kf and kh were taken to be Gaussian covariance  0 0 2 2 functions; for example: kf (x, x ) = λf exp − kx − x k2 /2σf parametrised by λf and σf . This choice was made to capture smoothness of both integrands f and h involved. For this application we found that, while the σ parameters were possible to learn from data using EB, the λ parameters required a large number of data to pin down. Therefore, for these experiments 9 we fixed λf = 0.1 × mean(fi,j ) and λh = 0.01 × mean(hi ). In both cases the remaining kernel parameters σ were selected using EB. Data generation: As a test-bed that captures the salient properties of model selection discussed in the main text, we considered variable selection for logistic regression: p(y|β) = N Y pi (β)yi [1 − pi (β)]1−yi i=1 logit(pi (β)) = γ1 β1 xi,1 + . . . γd βd xi,d , γ1 , . . . , γd ∈ {0, 1} where the model Mk specifies the active variables via the binary vector γ = (γ1 , . . . , γd ). A model prior p(γ) ∝ d−kγk1 was employed. Given a model Mk , the active parameters βj were endowed with independent priors βj ∼ N (0, τ −1 ), where here τ = 0.01. A single dataset of size N = 200 were generated from model M1 with parameter β = (1, 0, . . . , 0); as such the problem is under-determined (there are in principle 210 = 1024 different models) and the true model is not well-identified. The selected model is thus sensitive to numerical error in the computation of Pmarginal likelihood. In practice we limited the model space to consider only models with γi ≤ 2; this speeds up the computation and, in this particular case, only rules out models that have much lower posterior probability than the actual MAP model. There were thus 56 models being compared. D.2 Case Study #2 Background on the model: The Teal South model is a PDE computer model for an oil reservoir. The model studied is on an 11×11 grid with 5 layers. It has 9 parameters representing physical quantities of interest. These include horizontal permeabilities for each of the 5 layers, the vertical to horizontal permeability ratio, aquifer strength, rock compressibility and porosity. For our experiments, we used an emulator of the likelihood model documented in Lan et al. (2016) in order to speed up MCMC; however this might be undesirable in general due to the additional uncertainty associated with the approximation in the results obtained. Kernel choice: The numerical in Sec. 5.3 √ results √   were obtained using a Matérn α = 3/2 2 kernel given by k(r) = λ 1 + 3r/σ exp − 3r/σ where r = kx − yk2 , which corresponds to the Sobolev space H3/2 . We note that f ∈ H3/2 is satisfied. We used EB over the length-scale parameter σ, but fixed the amplitude parameter to λ = 1. Variance computation: Due to intractability of the posterior distribution, the kernel mean µ(π) is unavailable in closed form. To overcome this, the methodology in Supplement B was employed to obtain an empirical estimate of the kernel mean (half of the MCMC samples were used with BC weights to approximate the integral and the other half with MC weights to approximate the kernel mean). Eqn. 9 was used to upper bound the intractable BC posterior variance. For the upper bound to hold, states a xj must be independent samples from π, whereas here they were obtained using MCMC and were therefore not independent. In order to ensure that MCMC samples were “as independent as possible” we employed sophisticated MCMC methodology developed by Lan et al. (2016). Nevertheless, we emphasise that there is a gap between theory and practice here that we hope to fill in future research. For the results in this 10 paper we fixed δ = 0.05 in Eqn. 10, so that Cn,γ = Cn,γ,0.05 is essentially a 95(1 − γ)% credible interval. A formal investigation into the theoretical properties of the uncertainty quantification studied by these methods is not provided in this paper. D.3 Case Study #3 Kernel choice: The (canonical) weighted Sobolev space Sα,γ is defined by taking each of the component spaces Hu to be Sobolev spaces of dominating mixed smoothness Sα . i.e. the space Hu is norm-equivalent to a tensor product of |u| one-dimensional Sobolev spaces, each with smoothness parameter α. Constructed in this way, Sα,γ is an RKHS with kernel kα,γ (x, x0 ) = X u⊆I α 0 Y X Bk (xi )Bk (x0i ) α B2α (|xi − xi |) γu − (−1) (k!)2 (2α)! i∈u ! , k=1 where the Bk are Bernoulli polynomials. Theoretical results: In finite dimensions d < ∞, we can construct a higher-order digital net that attains optimal QMC rates for weighted Sobolev spaces: Theorem 3. Let H be an RKHS that is norm-equivalent to Sα,γ . Then BQMC based on a digital (t, α, 1, αm × m, d)-net over Zb attains the optimal rate kΠ̂BQMC − ΠkH∗ = O(n−α+ ) for any  > 0, where n = bm . Proof. This follows by combining Thm. 15.21 of Dick and Pillichshammer (2010) with Lemma 1. The QMC rules in Theorem 3 do not explicitly take into account the values of the weights γ. An algorithm that tailors QMC states to specific weights γ is known as the component by component (CBC) algorithm; further details can be found in (Kuo, 2003). In principle the CBC algorithm can lead to improved rate constants in high dimensions, because effort is not wasted in directions where f varies little, but the computational overheads are also greater. We did not consider CBC algorithms for BQMC in this paper. Note that the weighted Hilbert space framework allows us to bound the WCE independently P of dimension providing that u∈I γu < ∞ (Sloan and Woźniakowski, 1998). This justifies the use of “high-dimensional” in this context. Further details are provided in Sec. 4.1 of Dick et al. (2013). D.4 Case Study #4 Kernel choice: The function spaces that we consider are Sobolev spaces Hα (Sd ) for α > d/2, P (d) > 0 0 d obtained using the reproducing kernel k(x, x0 ) = ∞ l=0 λl Pl (x x ), x, x ∈ S , where λl  (1+ (d) l)−2α and Pl are normalised Gegenbauer polynomials (Brauchart et al., 2014). A particularly simple expression for the kernel in d = 2 and Sobolev space α = 3/2 can be obtained by taking λ0 = 4/3 along with λl = −λ0 ×(−1/2)l /(3/2)l where (a)l = a(a+1) . . . (x+l−1) = Γ(a+l)/Γ(a) 0 k , x, x0 ∈ is the Pochhammer symbol. Specifically, these choices produce k(x, x0 ) = 2 R 8/3−kx−x 2 0 0 ) = 4/3 S . This kernel is associated with a tractable kernel mean µ(π)(x) = k(x, x )dπ(x S2 R and hence the initial error is also available Π[µ(π)] = S2 µ(π)(x)dπ(x0 ) = 4/3. 11 MMD 10 0 10 -2 10 -4 MC BMC QMC BQMC 10 -6 10 2 10 3 Number of States (n) Figure 10: Application to global illumination integrals in computer graphics. Left: A spherical t-design over S2 . Right The WCE, or worst-case-error, for Monte Carlo (MC), Bayesian MC (BMC), Quasi MC (QMC) and Bayesian QMC (BQMC). Theoretical results: The states {xi }ni=1 could be generated with MC. In that case, analogous results to those obtained in Sec. 3.2.1 can be obtained. Specifically, from Thm. 7 of Brauchart et al. (2014) and Bayesian re-weighting (Lemma 1), classical MC leads to slow convergence kΠ̂MC − ΠkH∗ = OP (n−1/2 ). The regression bound argument (Lemma 2) together with a functional approximation result in Le Gia et al. (2012, Thm. 3.2), gives a faster rate for BMC of kΠ̂BMC − ΠkH∗ = OP (n−3/4 ) in dimension d = 2. Rather than focus on MC methods, we present results based on spherical QMC point sets. We briefly introduce the conceptR of a spherical t-design (Bondarenko et al., 2013) which is define 1 Pn n d as a set {xi }i=1 ⊂ S satisfying Sd f dπ = n i=1 f (xi ) for all polynomials f : Sd → R of degree at most t. (i.e. f is the restriction to Sd of a polynomial in the usual Euclidean sense Rd+1 → R). Theorem 4. For all d ≥ 2 there exists Cd such that for all n ≥ Cd td there exists a spherical t-design on Sd with n states. Moreover, for α = 3/2 and d = 2, the use of a spherical t-designs leads to a rate kΠ̂BQMC − ΠkH∗ = O(n−3/4 ). Proof. This property of spherical t-designs follows from combining Hesse and Sloan (2005); Bondarenko et al. (2013) and Lemma 1. The rate in Thm. 4 is best-possible for a deterministic method in H3/2 (S2 ) (Brauchart et al., 2014). Although explicit spherical t-designs are not currently known in closed-form, approximately optimal point sets have been computed12 numerically to high accuracy. Additional theoretical results on point estimates can be found in Fuselier et al. (2014). In particular they consider the conditioning of the associated linear systems that must be solved to obtain BC weights. Numerical results: In Fig. 10, the value of the WCE is plotted13 for each of the four methods considered (MC, QMC, BMC, BQMC) as the number of states increases. Both BMC and BQMC appear to attain the same rate for H3/2 (S2 ), although BQMC provides a constant 12 our experiments were based on such point sets provided by R. Womersley on his website http://web.maths. unsw.edu.au/~rsw/Sphere/EffSphDes/sf.html [Accessed 24 Nov. 2015]. 13 the environment map used in this example is freely available at: http://www.hdrlabs.com/sibl/archive. html [Accessed 23 May 2017]. 12 factor improvement over BMC. Note that O(n−3/4 ) was shown by Brauchart et al. (2014) to be best-possible for a deterministic method in the space H3/2 (S2 ). References Bissiri, P., Holmes, C. and Walker, S. (2016). A general framework for updating belief distributions. J. R. Stat. Soc. Ser. B. Stat. Methodol., 78(5):1103–1130. Brauchart, J., Saff, E., Sloan, I. H. and Womersley, R. (2014). QMC designs: Optimal order quasi Monte Carlo integration schemes on the sphere. Math. Comp., 83:2821–2851. Fuselier, E., Hangelbroek, T., Narcowich, F. J., Ward, J. D. and Wright, G. B. (2014). Kernel based quadrature on spheres and other homogeneous spaces. Numer. Math., 127(1):57–92. Hesse, K. and Sloan, I. A. (2005). Worst-case errors in a Sobolev space setting for cubature over the sphere S2. Bull. Aust. Math. Soc., 71(1):81–105. Kuo, F. Y. (2003). Component-by-component constructions achieve the optimal rate of convergence for multivariate integration in weighted Korobov and Sobolev spaces. J. Complexity, 19(3):301–320. Le Gia, Q. T., Sloan, I. H. and Wendland, H. (2012). Multiscale approximation for functions in arbitrary Sobolev spaces by scaled radial basis functions on the unit sphere. Appl. Comput. Harmon. Anal., 32:401–412. Sloan, I. H. and Woźniakowski, H. (1998). When are quasi-Monte Carlo algorithms efficient for high dimensional integrals? J. Complexity, 14(1):1–33. Wu, Z. and Schaback, R. (1993). Local error estimates for radial basis function interpolation of scattered data. IMA J. Numer. Anal., 13(1):13–27. 13
10math.ST
COINTEGRATION OF THE DAILY ELECTRIC POWER SYSTEM LOAD AND THE WEATHER S. Z. Stefanov ESO EAD, 5, Veslets Str., 1040 Sofia, Bulgaria szstefanov@ndc.bg This paper makes a thermal predictive analysis of the electric power system security for a day ahead. This predictive analysis is set as a thermal computation of the expected security.This computation is obtained by cointegrating the daily electric power system load and the weather, by finding the daily electric power system thermodynamics and by introducing tests for this thermodynamics. The predictive analysis made shows the electricity consumers' wisdom. Keywords: predictive analysis, security, thermodynamics, cointegration, wisdom 1. Introduction The electric power system (ЕPS) is affected by weather changes and by the exchanges with other EPS's. The EPS load is unpredictable. The load of a network-modelled EPS is dynamically unpredictable. Under this model, the load and the weather are cointegrated, according to Ref.1. Fezzi and Bunn2 have made a cointegration of the daily load and the wholesale price of electricity. Therefore, there is cointegration of the daily EPS load and the weather. The load of a field-modelled EPS is thermodynamically unpredictable. Modelling the EPS as a field is possible under the internal model principle from system theory. Under this model the EPS is viewed as an open system. Under this model there is evolution of the EPS behaviour. The thermodynamic unpredictability diminishes when predicting rare events, cooperative and competitive phenomena in the EPS. It is such type of events and phenomena that are predicted by the EPS dispatchers. An intelligent system can be viewed as a dissipative model of the brain dynamics from Ref.3. This intelligent system has a field computation and a field realization in the sense of Ref.4. That is why it is able to make a predictive analysis of the EPS. Wehenkel and Pavella,5 Abed and al.6 have made a predictive analysis of the security of a networkmodelled EPS from the data about the latter. These analyses are incomplete. They do not predict the change in the EPS security, caused by the evolution in the EPS behaviour. The aim of this paper is a thermal predictive analysis of the EPS security for a day ahead. This analysis is sought by means of cointegration of the daily EPS load and the weather. 2. Cointegration The daily EPS load is modelled by one descriptive and two rescriptive models. These models are constructed for a time, whose moments are the calendar days. The descriptive load model is a regression with indicators for the two load peaks, a distributed lag which represents the load variability, and a flow integrator in the load. The regression with indicators is Pat = a0 + a1Pt-1 + a2Pt-3/2 + a3Pt-7 +a4δ9 + a5δ10 + a6δ19 + a7δ20 + a8δ11 + a9δ21 (1) In (1), δi denotes a single-amplitude impulse at the i-th hour of the day. Here Pt-3/2 is the load which, in the morning, is equal to the day-before-yesterday afternoon load, and in the afternoon - to the yesterday morning load. The distributed lag is for the last two regressors in (1). The flow integrator leads to substitution, in (1), of the regressors Pt-2 and Pt-3 by Pt-3/2. The rescriptive load models are regressions with cointegration links, a distributed lag which represents the load variability, and a flow integrator in the load. These regressions are Pbt = b0 + b1Pt-1 + b2Pt-3/2 + b3Pt-7 + b4(Pt-1 – Pt-3/2)Tt-2 + b5(Pt-3/2 – Pt-7)Tt-8 (2) Pct = c0 + c1Pt-1 + c2Pt-3/2 + c3Pt-7 + c4Tt-2 + c5Tt-8 + c6(Pt-1 – Pt-3/2)T2t-2 + c7(Pt-1 – Pt-3/2)Tt-2 + c8(Pt-3/2 – Pt-7)Tt-8 (3) The distributed lag is for the last two regressors in (2), respectively – in (3). The flow integrator leads to substitution, in (2) and (3), of the regressors Pt-2 and Pt-3 by Pt-3/2. Here the regressor Pt-3/2 has the same meaning as in (1). Model (1) is descriptive, and models (2) and (3) – rescriptive, in the sense of Ref.7. The regression (2) models the normal load behaviour, and the regressions (1) and (3) – the evolution load behaviour. Predicting the daily load by these three models is predicting by an ensemble of models, according to Ref.8. Under each of these three models, the data are treated sequentially, and not in parallel. The data are treated in this way because the sequential models of daily load forecast give9 a better forecast than the parallel ones. The flow integration reduces the data noise.10 That is why the regressions (1), (2) and (3) give a more accurate load forecast. The flow in the data presents the EPS exchanges in the load models. The daily EPS load is econometrically modelled by the regressions (1), (2) and (3). This is modelling of the changes in the load and in the environment. These regressions are models of the dynamic unpredictability of the load. 3. Daily EPS Thermodynamics The cointegration distance between the regressions Pat and Pbt, respectively Pct and Pbt, is set11 by the angle θ1, respectively – the angle θ2, θ1 = 0.5 arctan( 2 <pat pbt >/ (<pat pat > - <pbt pbt >) (4) θ2 = 0.5 arctan( 2 <pct pbt >/ (<pct pct > - <pbt pbt >) Here <·> denotes the mean for the time τ=1,...,24, and the time series pat, pbt, pct, τ=1,…,24, are obtained from the time series Pat, Pbt, Pct, τ=1,…,24, by subtracting the mean. The EPS entropy S and the environment entropy S΄ are12 S (χ) = - ((1-cosχ)/2)ln((1-cosχ)/2) – ((1+cosχ)/2)ln((1+cosχ)/2) (5) S΄(χ) = - ((1-sinχ)/2)ln((1-sinχ)/2) - ((1+sinχ)/2)ln((1+sinχ)/2) χ = arcos(exp(-(π/2)θ1)), arcos(exp(-(π/2)θ2) The EPS recoherence is ∆S = S(θ1) – S(θ2) (6) 12 The recoherence is a positive quantity, because the entropy S is monotonically increasing. The environment decoherence is ∆S΄ = S΄(θ1) - S΄(θ2) (7) The decoherence is a negative quantity, because the entropy S΄ is12 monotonically decreasing. The decoherence and recoherence are related by the inverse temperature β β = - ∆S΄ / ∆S (8) 13 Viewing the decoherence and recoherence as a forward and a reverse process gives (8). Let the quantities P1am, P2am, P1pm, P2pm be set as follows P1am = min { maxτ (Pat(τ)), maxτ (Pbt(τ)), maxτ (Pct(τ)) : τ = 1,…,12 } (9) P2am = max{ maxт (Pat(т)), maxτ (Pbt(τ)), maxτ (Pct(τ)) : τ = 1,…,12 } P1pm = min { maxτ (Pat(τ)), maxτ (Pbt(τ)), maxτ (Pct(τ)) : τ = 13,…,24 } P2pm = max{ maxт (Pat(т)), maxτ (Pbt(τ)), maxτ (Pct(τ)) : τ = 13,…,24 } The EPS work for a day is W1 = 11.608 + ( ln(P1pm ) – ln(P1am)) / β (10) W2 = 11.608 + ( ln(P2pm ) - ln(P2am)) / β This work is obtained from the transient fluctuation relation.14 Here β is the inverse temperature from (8). 4. Testing the Daily Thermodynamics The time test of the daily EPS thermodynamics are the maximum likelihood seasonal cointegration tests for daily data.15 Let T6,1, T6,2, T16, T24 be the following times Т6,1 = 2i W1(π/2)θ1tanh((π/2)θ1) (11) T6,2 = 2k W2(π/2)θ2tanh((π/2)θ2) T16 = 2m W2(π/2)θ2tan((π/2)θ2) T24 = 1.5n W1(π/2)θ1tan((π/2)θ1) In (11), i is an integer, such that T6,1 ∈ (0,9), k is an integer, such that Т6,2 ∈ (0,9), m is an integer, such that Т16 ∈ (10, 20), and n is an integer, such that Т24 ∈ (20, 30). In (11), W1 and W2 are from (10), and θ1 and θ2 are from (4). The times Т6, Т16 and Т24 are obtained for the EPS evolution. They are set by the parity violation under evolution.16 Here the EPS evolution follows a spiral, equivalent to the spiral obtained by Imel’baev and Chernysh17 under coarsening of a system with loops. The time 2Т6 is a maximum likelihood statistic for cointegration. Its critical value is the critical value of Darné,15 at 5% acceptance region, at the first level of seasonal cointegration, at 260 sample size and under a basic regression model with a constant, seasonal dummies and no trend. Then, the critical value of the time 2T6 is that value, from among the values 8.11, 11.10 and 11.30, compared to which the time 2T6 is smaller. The time Т16≥16 is a maximum likelihood statistic for cointegration. Its critical value is the critical value of Darné,15 at 5% acceptance region, at the second level of seasonal cointegration, at 260 sample size and under a basic regression model with a constant, seasonal dummies and no trend. Then, the critical value of the time Т16 is that value, from among the values 15.11, 18.01 и 18.18, compared to which the time Т16 is smaller. The time Т16<16 is a maximum likelihood statistic for cointegration. Its critical value is the critical value of Darné,15 at 10% acceptance region, at the first level of seasonal cointegration, at 260 sample size and under a basic regression model with a constant, seasonal dummies and no trend. Then, the critical value of the time Т16 is that value, from among the values 11.95, 15.05 и 15.36, compared to which the time Т16 is smaller. The time Т24≥24 is a maximum likelihood statistic for cointegration. Its critical value is the critical value of Darné,15 at 5% acceptance region, at the third level of seasonal cointegration, at 260 sample size and under a basic regression model with a constant, seasonal dummies and no trend. Then, the critical value of the time Т24 is that value, from among the values 21.82, 24.64 и 24.73, compared to which the time Т24 is smaller. The time Т24<24 is a maximum likelihood statistic for cointegration. Its critical value is the critical value of Darné,15 at 10% acceptance region, at the second level of seasonal cointegration, at 260 sample size and under a basic regression model with a constant, seasonal dummies and no trend. Then, the critical value of the time Т24 is that value, from among the values 19.40, 22.64 и 22.77, compared to which the time Т24 is smaller. The time test of the daily EPS thermodynamics consists in a critical value check of each of the times Т6, Т16, Т24. The energy test of the daily EPS thermodynamics is a test for an energy reserve R R1 = exp(W0,1β) – (2/(1 + W0,1½))½ (12) R2 = exp(W0,2β) – (2/(1 + W0,2½))½ W0,1 = W1 – 11.608, W0,2 = W2 – 11.608 This test follows from the hypergeometric function inequalities,18 from the presentation of energy as a hypergeometric function19 and from the time-independent relations in non-equilibrium systems.20 The energy test of the daily EPS thermodynamics consists in checking the positiveness of the reserve R. 5. Thermal Computation The evolution behaviour can be presented as a statistical submanifold evolution surface, using the reversible entropic dynamics.21 The mean and the standard deviation of the EPS evolution behaviour, by Cafaro and al.,21 are µ = (1/W1½)( cosh((π/2)θ1) – sinh((π/2)θ1)) (13) σ = (1/W2½)(cosh((π/2)θ2)-sinh((π/2)θ2))/(cosh(πθ2)-sinh(πθ2)+1/(8W2((π/2)θ2)2)) Here θ1,θ2 are angles from (4), and W1,W2 is work from (10). The diffusion of the EPS evolution behaviour gives the following expected daily prices of electricity c1 = 10βσ1 (14) c2 = 10R1σ1 (15) c3 = 10R2σ1 (16) In (14), β is the inverse temperature from (8). In (15),(16), R1, R2 is the reserve from (12). In (14),(15),(16), σ1=σ, if σ>1, and σ1=2-σ, if σ<1. Here σ is from (13). These daily prices of electricity have been found as prices on a market in uncertainty by Pennock and al.22 The multiplication by ten in (14) is photographic enlargement, made by Grenander,23 of the price on the market in uncertainty to a price on the electricity market for a day ahead. These three prices set the following prices: cа = 2c1/3 (17) cm = min(c2, c3) cs = max(c2, c3) The expected EPS reliability, with respect to a rare event and a competitive phenomenon, is pr = ca / cs, if ca < cs (18) pr = cs / ca, if ca > cs This reliability is found as a Jordan curve descriptor introduced by Zuliani and al.24 The expected EPS reliability, with respect to a cooperative phenomenon, is pv = 2(1 – pw) (19) pw = 1 – 0.5(cm / ca)½ , if ca < cs pw = 0.5(ca / cm)½ , if ca > cs This reliability is found as a non-stationary realization descriptor introduced by Daneev and al.25 The expected EPS droop is kc = 1.261060863 β (20) Here kc is set by the inverse temperature β from (8) for the EPS scheme, viewed as a Euclidean 4design by Bannai and Bannai.26 The expected daily price of electricity, with respect to the EPS reliability, is cH = 1000pw/(50pr - 2πkc) (21) This daily price of electricity minimizes the EPS lifetime variance, in accordance with Ref.27. The computation by thermalisation reduces the daily mean error, relative to the daily peak load, of the load forecast, by δ δ = 10(W1μ/1.78617 - ∆S) (22) Here δ is in %, W1 is from (10), μ is from (13), ∆S is from (6), and the normalization of μ is from the Euclidean 4-designs by Bannai and Bannai.26 The quantity δ is determined by the computational potential introduced by Anders and al.28 The multiplication by ten in (22) is photographic enlargement, made by Grenander23, of the computational potential to an EPS potential. 6. Daily Artificial Dispatcher The "Daily Artificial Dispatcher" (DAD) is a field intelligent system which makes the thermal predictive analysis set out above. This thermal predictive analysis is a predictive analysis of the EPS security because it gives the expected EPS load from (1), (2) and (3), the expected electricity price from (14) and (21), the expected reserve from (12), the expected droop by (20) and the expected EPS reliability from (18), (19). Predicting the times (11) is predicting the synchronization in the EPS. Predicting the energy reserve (12) is predicting the stability in the EPS. DAD's predicting the synchronization in the EPS shows that DAD perceives the cointegration. DAD's predicting the stability in the EPS shows that DAD interprets the cointegration. DAD is then an intelligent system in the sense of Ref.29. This intelligence is wisdom because it consists in evasion and prediction. Indeed, falling out of synchronization is evasion, and stability is prediction. The thermalisation in finding the EPS security is a field computation according to Ref.28 and Ref.4. Therefore, DAD is indeed a field intelligent system. DAD's resource is heat. That is why DAD's logic is the logic of resources, i.e. Girard's linear logic. This conclusion is natural because of the connection30 between evasion/prediction and linear logic. DAD has the wisdom of electricity consumers. DAD presents the average belief of these consumers about the evolution in the EPS behaviour based on an expected warming of the weather. The consumers' average belief is that the EPS reliability, with respect to a cooperative phenomenon, is pv from (19). The consumers' average belief is that the EPS reliability, with respect to a rare event and a competitive phenomenon, is pr from (18). DAD stakes the following part of its resources on the EPS reliability pr with respect to a rare event and a competitive phenomenon sr = pv – prpv*/pr*, if pvpr* > prpv* (23) sr = 0, if pvpr* ≤ prpv* DAD stakes the following part of its resources on the EPS reliability pv with respect to a cooperative phenomenon sv = 0, if pvpr* > prpv* (24) sv = pr – pvpr*/pv*, if pvpr* ≤ prpv* Thus DAD acts31 as a rational forecast gambler. In (23),(24), pr* and pv* are set by the sufficient conditions given by Wolfers and Zitzewitz,32 under which prediction market prices coincide with the average beliefs among traders. The quantity pr* is obtained from the following equation (σ – 1)x3 + (2 – σ)x2 – σx + 2(σ – 1)pv = 0 (25) In (25), σ is the standard deviation from (13). This quantity is set by the greatest positive root pro of the equation (25) pr* = pro, if pro ≤ 1 (26) pr* = 2 – pro, if pro > 1 The quantity pv* is obtained from the following equation (σ – 1)x3 + (2 – σ)x2 – σx + (σ - 1)pr = 0 (27) In (27), σ is the standard deviation from (13). This quantity is set by the greatest positive root pvo of the equation (27) pv* = 1 – pvo/2, if pvo ≤ 1 (28) pv* = pvo/2, if pvo > 1 DAD checks the expected EPS synchronization by the time test of the daily EPS thermodynamics. DAD checks the expected EPS stability by the energy test of the daily EPS thermodynamics. Thus DAD verifies its forecasts. 7. The Results of DAD DAD operates to help the dispatchers of the Bulgarian EPS. The regressions (1), (2) and (3) are estimated from the hourly sampled values of the daily load and the dry bulb temperature for the preceding nine days, as well as from an hourly sampled daily forecast of the dry bulb temperature.To estimate these regressions, use is made of the load data, supplied by the Bulgarian electric power system operator ESO EAD and AccuWeather’s weather forecast, used by ESO EAD. An estimate of the three regressions is obtained by the exact maximum likelihood method for dynamic regression estimation given by Pesaran and Slater.33 This estimate is correct because the sample is non-stationary and of small size. The mean error, relative to the daily peak load, of the daily load forecast of the Bulgarian EPS, obtained by dynamic regression, is 5%. DAD reduces this error by 1.5% down to 3.5%. Table 1 gives the monthly average daily mean error, relative to the daily peak load, of the Bulgarian EPS load forecast made by DAD. This error is given for two months of the year, choosing those months where the error is maximal. Table 1. The monthly average daily mean error, relative to the daily peak load, of the Bulgarian EPS load forecast made by DAD, in percent. Year Month MMRE 2000 04 10 2001 2002 04 04 10 10 2003 04 09 2004 05 10 2005 04 10 2006 04 10 3.07 3.24 3.90 2.62 3.23 3.33 3.83 2.90 3.14 3.09 2.83 2.86 3.39 2.87 DAD reduces the mean error, relative to the daily peak load, of the Bulgarian EPS daily load forecast by 1.5%. This reduction corresponds to a hypothetic increase in the average daily temperature by 0.7ºС. Here it is assumed that a 2ºС increase in the average daily temperature leads to a 4.6% change, in accordance with the results of Crowley and Joutz.34 A hypothetic warming of the weather by 0.7ºС for a day ahead results in a correct prediction of the expected EPS security by DAD. For example, the expected zero reliability for a cooperative phenomenon gives a true prediction for an EPS decoupling. 8. Conclusion The aim of this paper is a thermal predictive analysis of the EPS security for a day ahead. This aim has been achieved as follows: 1/ one descriptive and two rescriptive dynamic models for prediction of the daily load have been constructed. These models have been obtained by cointegration of the daily EPS load and the weather; 2/ the daily EPS thermodynamics has been found through the EPS inverse temperature and through the EPS work; 3/ a time test and an energy test of the daily EPS thermodynamics have been obtained; 4/ thermal computation of the expected EPS security for a day ahead has been made; 5/ the predictive analysis of the EPS security for a day ahead has been presented as a field intelligent system that shows to the EPS dispatchers what the electricity consumers' wisdom is; 6/ it has been shown that the proposed predictive analysis enhances the EPS security by more accurate prediction of the EPS load and by the prediction of critical phenomena. References 1. D. F. Hendry, Unpredictability and the foundations of economic forecasting, Econometric Society 2004, Australasian Meetings 27 (2004). 2. C. Fezzi and D. Bunn, Structural Analysis of High Frequency Electricity Demand and Supply Interactions (London Business School, Working Paper, 2006). 3. W. J. Freeman and G. Vitiello, Brain dynamics, dissipation and spontaneous breakdown of symmetry, arXiv:q- bio.NC/0701053 (2007). 4. B. MacLennan, Field Computation in Natural and Artificial Intelligence (Technical Report CS-98-398, 1998). 5. L. Wehenkel and M. Pavella, Preventive vs. emergency control of power systems, Proc. IEEE PCSE Conf. (2004). 6. E. H. Abed, N. S. Namachchivaya, T. J. Overbye, M. A. Pai, P. W. Sauer and A. Sussman, Data-driven power system operations, Proc. Int. Conf. Comput. Sci., Part III (2006), pp.448-455. 7. P. Gurfil, Gauge theory for finite-dimensional dynamical systems, arXiv:nlin.SI/0606022 (2006). 8. E. A. Feinberg and D. Genethliou, Load forecasting, in Applied Mathematics for Restructured Electric Power Systems: Optimization, Control and Computational Intelligence, eds. J. H. Chow, F. F. Wu and J. J. Momoh (Springer, New York, 2005), pp.269-285. 9. D. Fay, J. V. Ringwood, M. Condon and M. Kelly, 24-hour electrical load data – a sequential or partitioned time series?, J. Neurocomputing 55(4) (2003) 469-498. 10. K. Urbanowicz and J. A. Hołyst, Noise reduction for flows using nonlinear constraints, arXiv:condmat/0411324 (2004). 11. R. Vincente, C. d. B. Pereira, V. B. P. Leite and N. Caticha, Visualizing long term ecomonic relationships with cointegration maps, arXiv: physics/0701062 (2007). 12. S. Başkal and Y. S. Kim, de Sitter group as a symmetry for optical decoherence, J. Phys. A: Math. Gen. 39 (2006) 7775-7788. 13. C. Jarzynski, Rare events and the convergence of exponentially averaged work values, arXiv:condmat/0603185 (2006). 14. J. Kurchan, Non-equilibrium work relations, arXiv:cond-mat/0511073 (2005). 15. O. Darné, Maximum likelihood seasonal cointegration tests for daily data, Economics Bulletin 3(18) (2003) 18. 16. V. V. Asadov and O. V. Kechkin, Parity violation and arrow of time in generalized quantum dynamics, arXiv:hep-th/0612123 (2006). 17. Sh. S. Imel’baev and K. V. Chernysh, Coarsening of systems with loops, in Organizational Control and Artificial Intelligence / Proc. ISA RAN, eds. V. L. Arlazarov and N. E. Emil’ianov (Editorial URSS, Moskva, 2003), pp.421-426, in Russian. 18. G. D. Anderson, M. K. Vamanamurthy and M. Vuorinen, Generalized convexity and inequalities, arXiv:math.CA/0701262 (2007). 19. E. D. Belokolos, J. C. Eilbeck, V. Z. Enolskii and M. Salerno, Exact energy bands and Fermi surfaces of separables Abelian potentials, J. Phys. A: Math. Gen. 34 (2001) 943-954. 20. M. H. Vainstein and J. M. Rubi, Gaussian noise and time-reversal symmetry in non-equilibrium Langevin models, arXiv:cond-mat/0702358 (2007). 21. C. Cafaro, S. A. Ali and A. Guffin, An application of reversible entropic dynamics on curved statistical manifolds, arXiv:physics/0702011 (2007). 22. D. M. Pennock, S. Lawrence, C. L. Giles and F. Å Nielsen, The Power of Play: Efficiency and Forecast Accuracy in Web Market Games (NEC Research Institute Technical Report 2000-168, 2000). 23. U. Grenander, Pattern Synthesis: Lectures in Pattern Theory, Vol.I (Springer, New York, 1976). 24. M. Zuliani, C. S. Kenney, S. Bhagavathy and B. S. Manjunath, Drums and curve descriptors, British Machine Vision Conf. UK (2004). 25. A. V. Daneev, V. A. Rusanov and D. Yu. Sharpinski, Kalman-Masarovic nonstationary realization in terms of the Rayleigh-Ritz operator, Kibernetika i Sistemny Analiz 43 (2007) 82-90, in Rurssian. 26. E. Bannai and E. Bannai, On Euclidian tight 4-designs, J. Math. Soc. Japan 58(3) (2006) 775-803. 27. E. Łobos and M. Momot, Reliability design of complex systems by minimizing the lifetime variance, Int. J. Appl. Math. Comput. Sci. 12 (2002) 553-557. 28. J. Anders, D. Markham, V. Vedral and M. Hajdušek, How much of one-way computation is just thermodynamics?, arXiv:quant-ph/0702020 (2007). 29. S. Z. Stefanov, General theory of intelligent systems, Cybernetics and Systems 23 (1992) 517-530. 30. A. Blass, Propositional connectives and the set theory of the continuum, CWI Quarterly 9 (1996) 25-30. 31. E. W. Piotrowski and J. Luczka, The relativistic velocity addition law optimizes a forecast gambler’s profit, arXiv:physics.data-an/0709.4137 (2007). 32. J. Wolfers and E. Zitzewitz, Prediction Markets in Theory and Practice (IZA Discussion Paper No.1991, 2006). 33. M. H. Pesaran and L. J. Slater, Dynamic Regression: Theory and Algorithms (Ellis Horwood, Chichester, 1980). 34. C. Crowley and F. L. Joutz, Weather Effects on Electricity Loads: Modeling and Forecasting (Final report for US EPA on Weather Effects on Electricity Loads, 2005).
5cs.CE
Published as a conference paper at ICLR 2018 T RAINING WIDE RESIDUAL NETWORKS FOR DEPLOYMENT USING A SINGLE BIT FOR EACH WEIGHT arXiv:1802.08530v1 [cs.LG] 23 Feb 2018 Mark D. McDonnell ∗ Computational Learning Systems Laboratory (cls-lab.org) School of Information Technology and Mathematical Sciences University of South Australia Mawson Lakes, SA 5095, AUSTRALIA mark.mcdonnell@unisa.edu.au A BSTRACT For fast and energy-efficient deployment of trained deep neural networks on resource-constrained embedded hardware, each learned weight parameter should ideally be represented and stored using a single bit. Error-rates usually increase when this requirement is imposed. Here, we report large improvements in error rates on multiple datasets, for deep convolutional neural networks deployed with 1-bit-per-weight. Using wide residual networks as our main baseline, our approach simplifies existing methods that binarize weights by applying the sign function in training; we apply scaling factors for each layer with constant unlearned values equal to the layer-specific standard deviations used for initialization. For CIFAR-10, CIFAR-100 and ImageNet, and models with 1-bitper-weight requiring less than 10 MB of parameter memory, we achieve error rates of 3.9%, 18.5% and 26.0% / 8.5% (Top-1 / Top-5) respectively. We also considered MNIST, SVHN and ImageNet32, achieving 1-bit-per-weight test results of 0.27%, 1.9%, and 41.3% / 19.1% respectively. For CIFAR, our error rates halve previously reported values, and are within about 1% of our errorrates for the same network with full-precision weights. For networks that overfit, we also show significant improvements in error rate by not learning batch normalization scale and offset parameters. This applies to both full precision and 1-bit-per-weight networks. Using a warm-restart learning-rate schedule, we found that training for 1-bit-per-weight is just as fast as full-precision networks, with better accuracy than standard schedules, and achieved about 98%99% of peak performance in just 62 training epochs for CIFAR-10/100. For full training code and trained models in MATLAB, Keras and PyTorch see https://github.com/McDonnell-Lab/1-bit-per-weight/. 1 I NTRODUCTION Fast parallel computing resources, namely GPUs, have been integral to the resurgence of deep neural networks, and their ascendancy to becoming state-of-the-art methodologies for many computer vision tasks. However, GPUs are both expensive and wasteful in terms of their energy requirements. They typically compute using single-precision floating point (32 bits), which has now been recognized as providing far more precision than needed for deep neural networks. Moreover, training and deployment can require the availability of large amounts of memory, both for storage of trained models, and for operational RAM. If deep-learning methods are to become embedded in resourceconstrained sensors, devices and intelligent systems, ranging from robotics to the internet-of-things to self-driving cars, reliance on high-end computing resources will need to be reduced. To this end, there has been increasing interest in finding methods that drive down the resource burden of modern deep neural networks. Existing methods typically exhibit good performance but for the ∗ This work was conducted, in part, during a hosted visit at the Institute for Neural Computation, University of California, San Diego, and in part, during a sabbatical period at Consilium Technology, Adelaide, Australia. 1 Published as a conference paper at ICLR 2018 ideal case of single-bit parameters and/or processing, still fall well-short of state-of-the-art error rates on important benchmarks. In this paper, we report a significant reduction in the gap (see Figure 1 and Results) between Convolutional Neural Networks (CNNs) deployed using weights stored and applied using standard precision (32-bit floating point) and networks deployed using weights represented by a single-bit each. In the process of developing our methods, we also obtained significant improvements in error-rates obtained by full-precision versions of the CNNs we used. In addition to having application in custom hardware deploying deep networks, networks deployed using 1-bit-per-weight have previously been shown (Pedersoli et al., 2017) to enable significant speedups on regular GPUs, although doing so is not yet possible using standard popular libraries. Aspects of this work was first communicated as a subset of the material in a workshop abstract and talk (McDonnell et al., 2017). 10 ImageNet32 4x ImageNet32 10x ImageNet32 15x CIFAR-100 4x CIFAR-100 10x CIFAR-10 SVHN MNIST ImageNet single crop ImageNet multi-crop BWN on ImageNet 9 Test error rate gap 8 7 6 5 4 3 2 1 0 0 10 20 30 40 50 Test error rate (Top-1) % Figure 1: Our error-rate gaps between using full-precision and 1-bit-per-weight. All points except black crosses are data from some of our best results reported in this paper for each dataset. Black points are results on the full ImageNet dataset, in comparison with results of Rastegari et al. (2016) (black crosses). The notation 4x, 10x and 15x corresponds to network width (see Section 4). 1.1 1.1.1 R ELATED W ORK R ES N ETS In 2015, a new form of CNN called a “deep residual network,” or “ResNet” (He et al., 2015b) was developed and used to set many new accuracy records on computer-vision benchmarks. In comparison with older CNNs such as Alexnet (Krizhevsky et al., 2012) and VGGNet (Simonyan & Zisserman, 2014), ResNets achieve higher accuracy with far fewer learned parameters and FLOPs (FLoating-point OPerations) per image processed. The key to reducing the number of parameters in ResNets was to replace “all-to-all layers” in VGG-like nets with “global-average-pooling” layers that have no learned parameters (Lin et al., 2013; Springenberg et al., 2014), while simultaneously training a much deeper network than previously. The key new idea that enabled a deeper network to be trained effectively was the introduction of so-called “skip-connections” (He et al., 2015b). Many variations of ResNets have since been proposed. ResNets offer the virtue of simplicity, and given the motivation for deployment in custom hardware, we have chosen them as our primary focus. Despite the increased efficiency in parameter usage, similar to other CNNs the accuracy of ResNets still tends to increase with the total number of parameters; unlike other CNNs, increased accuracy can result either from deeper (He et al., 2016) or wider networks (Zagoruyko & Komodakis, 2016). 2 Published as a conference paper at ICLR 2018 In this paper, we use Wide Residual Networks (Zagoruyko & Komodakis, 2016), as they have been demonstrated to produce better accuracy in less training time than deeper networks. 1.1.2 R EDUCING THE MEMORY BURDEN OF TRAINED NEURAL NETWORKS Achieving the best accuracy and speed possible when deploying ResNets or similar networks on hardware-constrained mobile devices will require minimising the total number of bits transferred between memory and processors for a given number of parameters. Motivated by such considerations, a lot of recent attention has been directed towards compressing the learned parameters (model compression) and reducing the precision of computations carried out by neural networks—see Hubara et al. (2016) for a more detailed literature review. Recently published strategies for model compression include reducing the precision (number of bits used for numerical representation) of weights in deployed networks by doing the same during training (Courbariaux et al., 2015; Hubara et al., 2016; Merolla et al., 2016; Rastegari et al., 2016), reducing the number of weights in trained neural networks by pruning (Han et al., 2015; Iandola et al., 2016), quantizing or compressing weights following training (Han et al., 2015; Zhou et al., 2017), reducing the precision of computations performed in forward-propagation during inference (Courbariaux et al., 2015; Hubara et al., 2016; Merolla et al., 2016; Rastegari et al., 2016), and modifying neural network architectures (Howard et al., 2017). A theoretical analysis of various methods proved results on the convergence of a variety of weight-binarization methods (Li et al., 2017). From this range of strategies, we are focused on an approach that simultaneously contributes two desirable attributes: (1) simplicity, in the sense that deployment of trained models immediately follows training without extra processing; (2) implementation of convolution operations can be achieved without multipliers, as demonstrated by Rastegari et al. (2016). 1.2 OVERALL APPROACH AND SUMMARY OF CONTRIBUTIONS Our strategy for improving methods that enable inference with 1-bit-per-weight was threefold: 1. State-of-the-art baseline. We sought to begin with a baseline full-precision deep CNN variant with close to state-of-the-art error rates. At the time of commencement in 2016, the state-of-the-art on CIFAR-10 and CIFAR-100 was held by Wide Residual Networks (Zagoruyko & Komodakis, 2016), so this was our starting point. While subsequent approaches have exceeded their accuracy, ResNets offer superior simplicity, which conforms with our third strategy in this list. 2. Make minimal changes when training for 1-bit-per-weight. We aimed to ensure that training for 1-bit-per-weight could be achieved with minimal changes to baseline training. 3. Simplicity is desirable in custom hardware. With custom hardware implementations in mind, we sought to simplify the design of the baseline network (and hence the version with 1-bit weights) as much as possible without sacrificing accuracy. 1.2.1 C ONTRIBUTIONS TO F ULL -P RECISION W IDE R ES N ETS Although this paper is chiefly about 1-bit-per-weight, we exceeded our objectives for the fullprecision baseline network, and surpassed reported error rates for CIFAR-10 and CIFAR-100 using Wide ResNets (Zagoruyko & Komodakis, 2016). This was achieved using just 20 convolutional layers; most prior work has demonstrated best wide ResNet performance using 28 layers. Our innovation that achieves a significant error-rate drop for CIFAR-10 and CIFAR-100 in Wide ResNets is to simply not learn the per-channel scale and offset factors in the batch-normalization layers, while retaining the remaining attributes of these layers. It is important that this is done in conjunction with exchanging the ordering of the final weight layer and the global average pooling layer (see Figure 3). We observed this effect to be most pronounced for CIFAR-100, gaining around 3% in test-error rate. But the method is advantageous only for networks that overfit; when overfitting is not an issue, such as for ImageNet, removing learning of batch-norm parameters is only detrimental. 3 Published as a conference paper at ICLR 2018 1.2.2 C ONTRIBUTIONS TO DEEP CNN S WITH SINGLE - BIT WEIGHTS FOR INFERENCE Ours is the first study we are aware of to consider how the gap in error-rate for 1-bit-per-weight compared to full-precision weights changes with full-precision accuracy across a diverse range of image classification datasets (Figure 1). Our approach surpasses by a large margin all previously reported error rates for CIFAR-10/100 (error rates halved), for networks constrained to run with 1-bit-per-weight at inference time. One reason we have achieved lower error rates for the 1-bit case than previously is to start with a superior baseline network than in previous studies, namely Wide ResNets. However, our approach also results in smaller error rate increases relative to full-precision error rates than previously, while training requires the same number of epochs as for the case of full-precision weights. Our main innovation is to introduce a simple fixed scaling method for each convolutional layer, that permits activations and gradients to flow through the network with minimum change in standard deviation, in accordance with the principle underlying popular initialization methods (He et al., 2015a). We combine this with the use of a warm-restart learning-rate method (Loshchilov & Hutter, 2016) that enables us to report close-to-baseline results for the 1-bit case in far fewer epochs of training than reported previously. 2 L EARNING A MODEL WITH CONVOLUTION WEIGHTS ±1 2.1 T HE SIGN OF WEIGHTS PROPAGATE , BUT FULL - PRECISION WEIGHTS ARE UPDATED We follow the approach of Courbariaux et al. (2015); Rastegari et al. (2016); Merolla et al. (2016), in that we find good results when using 1-bit-per-weight at inference time if during training we apply the sign function to real-valued weights for the purpose of forward and backward propagation, but update full-precision weights using SGD with gradients calculated using full-precision. However, previously reported methods for training using the sign of weights either need to train for many hundreds of epochs (Courbariaux et al., 2015; Merolla et al., 2016), or use computationallycostly normalization scaling for each channel in each layer that changes for each minibatch during training, i.e. the BWN method of Rastegari et al. (2016). We obtained our results using a simple alternative approach, as we now describe. 2.1.1 W E SCALE THE OUTPUT OF CONV LAYERS USING A CONSTANT FOR EACH LAYER We begin by noting that the standard deviation of the sign of the weights in a convolutional layer with kernels of size F × F will be close to 1, assuming a mean of zero. In contrast, the standard deviation of layer i in full-precision networks is initialized in the method of He et al. (2015a) to p 2/(F 2 Ci−1 ), where Ci−1 is the number of input channels to convolutional layer i, and i = 1, .., L, where L is the number of convolutional layers and C0 = 3 for RGB inputs. When applying the sign function alone, there is a mismatch with the principled approach to controlling gradient and activation scaling through a deep network (He et al., 2015a). Although the use of batch-normalization can still enable learning, convergence is empirically slow and less effective. To address this problem, for training using the sign of weights, we use the initialization method of He et al. (2015a) for the full-precision weights that are updated, but also introduce a layer-dependent scaling applied to the sign of the p weights. This scaling has a constant unlearned value equal to the initial standard deviation of 2/(F 2 Ci−1 ) from the method of He et al. (2015a). This enables the standard deviation of forward-propagating information to be equal to the value it would have initially in full-precision networks. In implementation, during training we multiply the sign of the weights in each layer by this value. For inference, we do this multiplication using a scaling layer following the weight layer, so that all weights in the network are stored using 0 and 1, and deployed using ±1 (see https://github.com/McDonnell-Lab/1-bit-per-weight/). Hence, custom hardware implementations would be able to perform the model’s convolutions without multipliers (Rastegari et al., 2016), and significant GPU speedups are also possible (Pedersoli et al., 2017). 4 Published as a conference paper at ICLR 2018 The fact that we scale the weights explicitly during training is important. Although for forward and backward propagation it is equivalent to scale the input or output feature maps of a convolutional layer, doing so also scales the calculated gradients with respect to weights, since these are calculated by convolving input and output feature maps. As a consequence, learning is dramatically slower unless layer-dependent learning rates are introduced to cancel out the scaling. Our approach to this is similar to the BWN method of Rastegari et al. (2016), but our constant scaling method is faster and less complex. In summary, the only differences we make in comparison with full-precision training are as follows. Let Wi be the tensor for the convolutional weights in the i–th convolutional layer. These weights are processed in the following way only for forward propagation and backward propagation, not for weight updates: s Ŵi = 2 sign (Wi ) , Fi2 Ci−1 i = 1, . . . , L, (1) where Fi is the spatial size of the convolutional kernel in layer i; see Figure 2. Full precision: 1-bit weights: BN, ReLU, conv BN, ReLU, 1 bit conv, scale Figure 2: Difference between our full-precision and 1-bit-per-weight networks. The “1 bit conv” and “scale” layers are equivalent to the operations shown in Eqn. (1). 3 M ETHODS COMMON TO BASELINE AND SINGLE - BIT NETWORKS 3.1 N ETWORK A RCHITECTURE Our ResNets use the ‘post-activation’ and identity mapping approach of He et al. (2016) for residual connections. For ImageNet, we use an 18-layer design, as in He et al. (2015b). For all other datasets we mainly use a 20-layer network, but also report some results for 26 layers. Each residual block includes two convolutional layers, each preceded by batch normalization (BN) and Rectified Linear Unit (ReLU) layers. Rather than train very deep ResNets, we use wide residual networks (Wide ResNets) (Zagoruyko & Komodakis, 2016). Although Zagoruyko & Komodakis (2016) and others reported that 28/26-layer networks result in better test accuracy than 22/20-layer1 networks, we found for CIFAR-10/100 that just 20 layers typically produces best results, which is possibly due to our approach of not learning the batch-norm scale and offset parameters. Our baseline ResNet design used in most of our experiments (see Figures 3 and 4) has several differences in comparison to those of He et al. (2016); Zagoruyko & Komodakis (2016). These details are articulated in Appendix A, and are mostly for simplicity, with little impact on accuracy. The exception is our approach of not learning batch-norm parameters. 3.2 T RAINING We trained our models following, for most aspects, the standard stochastic gradient descent methods used by Zagoruyko & Komodakis (2016) for Wide ResNets. Specifically, we use cross-entropy loss, minibatches of size 125, and momentum of 0.9 (both for learning weights, and in situations where we learn batch-norm scales and offsets). For CIFAR-10/100, SVHN and MNIST, where overfitting is evident in Wide ResNets, we use a larger weight decay of 0.0005. For ImageNet32 and full ImageNet we use a weight decay of 0.0001. Apart from one set of experiments where we added a simple extra approach called cutout, we use standard ‘light’ data augmentation, including randomly flipping each image horizontally with probability 0.5 for CIFAR-10/100 and ImageNet32. For the 1 Two extra layers are counted when downsampling residual paths learn 1×1 convolutional projections. 5 Published as a conference paper at ICLR 2018 Post-activation Residual Block: Repeat 9 times input BN, ReLU, conv BN, ReLU, conv BN, ReLU, conv BN, ReLU, conv + BN, GAP, SM Figure 3: Wide ResNet architecture. The design is mostly a standard pre-activation ResNet (He et al., 2016; Zagoruyko & Komodakis, 2016). The first (stand-alone) convolutional layer (“conv”) and first 2 or 3 residual blocks have 64k (ImageNet) or 16k (other datasets) output channels. The next 2 or 3 blocks have 128k or 32k output channels and so on, where k is the widening parameter. The final (stand-alone) convolutional layer is a 1 × 1 convolutional layer that gives N output channels, where N is the number of classes. Importantly, this final convolutional layer is followed by batch-normalization (“BN”) prior to global-average-pooling (“GAP”) and softmax (“SM”). The blocks where the number of channels double are downsampling blocks (details are depicted in Figure 4) that reduce each spatial dimension in the feature map by a factor of two. The rectified-linearunit (“RELU”) layer closest to the input is optional, but when included, it is best to learn the BN scale and offset in the subsequent layer. Downsampling Residual Blocks 3x3 avg pool double channels stride 2 using zero padding BN, ReLU, stride − 2 conv BN, ReLU, conv double channels + Figure 4: Downsampling blocks in Wide ResNet architecture. As in a standard pre-activation ResNet (He et al., 2016; Zagoruyko & Komodakis, 2016), downsampling (stride-2 convolution) is used in the convolutional layers where the number of output channels increases. The corresponding downsampling for skip connections is done in the same residual block. Unlike standard pre-activation ResNets we use an average pooling layer (“avg pool” ) in the residual path when downsampling. same 3 datasets plus SVHN, we pad by 4 pixels on all sides (using random values between 0 and 255) and crop a 32 × 32 patch from a random location in the resulting 40 × 40 image. For full ImageNet, we scale, crop and flip, as in He et al. (2015b). We did not use any image-preprocessing, i.e. we did not subtract the mean, as the initial BN layer in our network performs this role, and we did not use whitening or augment using color or brightness. We use the initialization method of He et al. (2015a). We now describe important differences in our training approach compared to those usually reported. 3.2.1 BATCH - NORM SCALES & OFFSETS ARE NOT LEARNED FOR CIFAR-10/100, SVHN When training on CIFAR-10/100 and SVHN, in all batch-norm layers (except the first one at the input when a ReLU is used there), we do not learn the scale and offset factor, instead initializating these to 1 and 0 in all channels, and keeping those values through training. Note that we also do not learn any biases for convolutional layers. The usual approach to setting the moments for use in batch-norm layers in inference mode is to keep a running average through training. When not learning batch-normalization parameters, we found a small benefit in calculating the batch-normalization moments used in inference only after training had finished. We simply form as many minibatches as possible from the full training-set, each with the same data augmentation as used during training applied, and pass these through the trained network, averaging the returned moments for each batch. 6 Published as a conference paper at ICLR 2018 For best results when using this method using matconvnet, we found it necessary to ensure the  parameter that is used to avoid divisions by zero is set to 1 × 10−5 ; this  is different to the way it is used in keras and other libraries. O UR NETWORK ’ S FINAL WEIGHT LAYER IS A 1 × 1 CONVOLUTIONAL LAYER 3.3 A significant difference to the ResNets of He et al. (2016); Zagoruyko & Komodakis (2016) is that we exchange the ordering of the global average pooling layer and the final weight layer, so that our final weight layer becomes a 1 × 1 convolutional layer with as many channels as there are classes in the training set. This design is not new, but it does seem to be new to ResNets: it corresponds to the architecture of Lin et al. (2013), which originated the global average pooling concept, and also to that used by Springenberg et al. (2014). As with all other convolutional layers, we follow this final layer with a batch-normalization layer; the benefits of this in conjunction with not learning the batch-normalization scale and offset are described in the Discussion section. 3.3.1 W E USE A WARM - RESTART LEARNING - RATE SCHEDULE We use a ‘warm restarts’ learning rate schedule that has reported state-of-the-art Wide ResNet results (Loshchilov & Hutter, 2016) whilst also speeding up convergence. The method constantly reduces the learning rate from 0.1 to 1 × 10−4 according to a cosine decay, across a certain number of epochs, and then repeats across twice as many epochs. We restricted our attention to a maximum of 254 epochs (often just 62 epochs, and no more than 30 for ImageNet32) using this method, which is the total number of epochs after reducing the learning rate from maximum to minimum through 2 epochs, then 4, 8, 16, 32, 64 and 128 epochs. For CIFAR-10/100, we typically found that we could achieve test error rates after 32 epochs within 1-2% of the error rates achievable after 126 or 254 epochs. 3.3.2 E XPERIMENTS WITH CUTOUT FOR CIFAR-10/100 In the literature, most experiments with CIFAR-10 and CIFAR-100 use simple “standard” data augmentation, consisting of randomly flipping each training image left-right with probability 0.5, and padding each image on all sides by 4 pixels, and then cropping a 32 × 32 version of the image from a random location. We use this augmentation, although with the minor modification that we pad with uniform random integers between 0 and 255, rather than zero-padding. Additionally, we experimented with “cutout” (Devries & Taylor, 2017). This involves randomly selecting a patch of each raw training image to remove. The method was shown to combine with other state-of-the-art methods to set the latest state-of-the-art results on CIFAR-10/100 (see Table 1). We found better results using larger cutout patches for CIFAR-100 than those reported by Devries & Taylor (2017); hence for both CIFAR-10 and CIFAR-100 we choose patches of size 18 × 18. Following the method of Devries & Taylor (2017), we ensured that all pixels are chosen for being included in a patch equally frequently throughout training by ensuring that if the chosen patch location is near the image border, the patch impacts on the image only for the part of the patch inside the image. Differently to Devries & Taylor (2017), as for our padding, we use uniform random integers to replace the image pixel values in the location of the patches. We did not apply cutout to other datasets. 4 R ESULTS We conducted experiments on six databases: four databases of 32×32 RGB images—CIFAR10, CIFAR-100, SVHN and ImageNet32—and the full ILSVRC ImageNet database (Russakovsky et al., 2015), as well as MNIST (LeCun et al., 1998). Details of the first three 32×32 datasets can be found in many papers, e.g. (Zagoruyko & Komodakis, 2016). ImageNet32 is a downsampled version of ImageNet, where the training and validation images are cropped using their annotated bounding boxes, and then downsampled to 32 × 32 (Chrabaszcz et al., 2017); see 7 Published as a conference paper at ICLR 2018 http://image-net.org/download-images. All experiments were carried out on a single using MATLAB with GPU acceleration from MatConvNet and cuDNN. We report results for Wide ResNets, which (except when applied to ImageNet) are 4× and 10× wider than baseline ResNets, to use the terminology of Zagoruyko & Komodakis (2016), where the baseline has 16 channels in the layers at the first spatial scale. We use notation of the form 20-10 to denote Wide ResNets with 20 convolutional layers and 160 channels in the first spatial scale, and hence width 10×. For the full ImageNet dataset, we use 18-layer Wide ResNets with 160 channels in the first spatial scale, but given the standard ResNet baseline is width 64, this corresponds to width 2.5× on this dataset (Zagoruyko & Komodakis, 2016). We denote these networks as 18-2.5. Table 1 lists our top-1 error rates for CIFAR-10/100; C10 indicates CIFAR-10, C100 indicates CIFAR-100; the superscript + indicates standard crop and flip augmentation; and ++ indicates the use of cutout. Table 2 lists error rates for SVHN, ImageNet32 (I32) and full ImageNet; we did not use cutout on these datasets. Both top-1 and top-5 results are tabulated for I32 and ImageNet. For ImageNet, we provide results for single-center-crop testing, and also for multi-crop testing. In the latter, the decision for each test image is obtained by averaging the softmax output after passing through the network 25 times, corresponding to crops obtained by rescaling to 5 scales as described by He et al. (2015b), and from 5 random positions at each scale. Our full-precision ImageNet error rates are slightly lower than expected for a wide ResNet according to the results of Zagoruyko & Komodakis (2016), probably due to the fact we did not use color augmentation. Table 1: Test-set error-rates for our approach applied to CIFAR-10 and CIFAR-100. Weights 32-bits 32-bits 32-bits 32-bits 1-bit 1-bit 1-bit 1-bit ResNet 20-4 20-10 26-10 20-20 20-4 20-10 26-10 20-20 Epochs 126 254 254 126 126 254 254 126 C10+ 5.02 4.22 4.23 6.13 4.72 4.46 - Params 4.3M 26.8M 35.6M 107.0M 4.3M 26.8M 35.6M 107.0M C100+ 21.53 18.76 18.63 18.14 23.87 19.35 18.94 18.81 C10++ 4.39 3.46 3.54 5.34 3.92 3.41 - C100++ 20.48 17.19 17.22 23.74 18.51 18.50 - Table 2: Test-set error-rates for our approach applied to SVHN, ImageNet32, and ImageNet. Weights 32-bits 32-bits 32-bits 32-bits ResNet 20-4 20-10 20-15 18-2.5 Epochs 30 30 30 62 Params 4.5M 27.4M 61.1M 70.0M SVHN 1.75 - I32 46.61 / 22.91 39.96 / 17.89 38.90 / 17.03 - 1-bit 1-bit 1-bit 1-bit 1-bit 20-4 20-10 26-10 20-15 18-2.5 30 30 62 30 62 4.5M 27.4M ∼ 36M 61.1M 70.0M 1.93 - 56.08 / 30.88 44.27 / 21.09 41.36 / 18.93 41.26 / 19.08 - ImageNet Single crop: 26.92 / 9.20 Multi-crop: 22.99 / 6.91 Single crop: 31.03 / 11.51 Multi-crop: 26.04 / 8.48 Table 3 shows comparison results from the original work on Wide ResNets, and subsequent papers that have reduced error rates on the CIFAR-10 and CIFAR-100 datasets. We also show the only results, to our knowledge, for ImageNet32. The current state-of-the-art for SVHN without augmentation is 1.59% (Huang et al., 2016), and with cutout augmentation is 1.30% (Devries & Taylor, 2017). Our full-precision result for SVHN (1.75%) is only a little short of these even though we used only a 4× ResNet, with less than 5 million parameters, and only 30 training epochs. Table 4 shows comparison results for previous work that trains models by using the sign of weights during training. Additional results appear in Hubara et al. (2016), where activations are quantized, and so the error rates are much larger. 8 Published as a conference paper at ICLR 2018 Table 3: Test error rates for networks with less than 40M parameters, sorted by CIFAR-100. Method WRN 22-10 (Zagoruyko & Komodakis, 2016) 1-bit weights WRN 20-10 (This Paper) WRN 28-10 (Chrabaszcz et al., 2017) Full precision WRN 20-10 (This Paper) 1-bit weights WRN 20-10 + cutout (This Paper) WRN 28-10 + cutout (Devries & Taylor, 2017) WRN 28-10 + dropout (Zagoruyko & Komodakis, 2016) ResNeXt-29, 8×64d Xie et al. (2016) Full precision WRN 20-10 + cutout (This Paper) DenseNets (Huang et al., 2016) Shake-shake regularization (Gastaldi, 2017) Shake-shake + cutout (Devries & Taylor, 2017) # params 27M 27M 37M 27M 27M 34M 37M 36M 27M 26M 26M 26M C10 4.44 4.72 4.22 3.92 3.08 3.80 3.65 3.46 3.46 2.86 2.56 C100 20.75 19.35 18.76 18.51 18.41 18.30 17.77 17.19 17.18 15.97 15.20 I32 Top-1 / Top-5 44.27 / 21.09 40.97 / 18.87 39.96 / 17.89 - Table 4: Test error rates using 1-bit-per-weight at test time and propagation during training. Method BC (Courbariaux et al., 2015) Weight binarization (Merolla et al., 2016) BWN - Googlenet (Rastegari et al., 2016) VGG+HWGQ (Cai et al., 2017) BC with ResNet + ADAM (Li et al., 2017) BW with VGG (Cai et al., 2017) This Paper: single center crop C10 8.27 8.25 9.88 7.49 7.17 3.41 C100 35.34 18.50 SVHN 2.30 1.93 This Paper: 5 scales, 5 random crops - - - ImageNet 34.5 / 13.9 (full ImageNet) 52.11 (full ImageNet) 34.5 (full ImageNet) 41.26 / 19.08 (ImageNet32) 31.03 / 11.51 (full ImageNet) 26.04 / 8.48 (full ImageNet) Inspection of Tables 1 to 4 reveals that our baseline full-precision 10× networks, when trained with cutout, surpass the performance of deeper Wide ResNets trained with dropout. Even without the use of cutout, our 20-10 network surpasses by over 2% the CIFAR-100 error rate reported for essentially the same network by Zagoruyko & Komodakis (2016) and is also better than previous Wide ResNet results on CIFAR-10 and ImageNet32. As elaborated on in Section 5.3, this improved accuracy is due to our approach of not learning the batch-norm scale and offset parameters. For our 1-bit networks, we observe that there is always an accuracy gap compared to full precision networks. This is discussed in Section 5.1. Using cutout for CIFAR-10/100 reduces error rates as expected. In comparison with training very wide 20× ResNets on CIFAR-100, as shown in Table 1, it is more effective to use cutout augmentation in the 10× network to reduce the error rate, while using only a quarter of the weights. Figure 5 illustrates convergence and overfitting trends for CIFAR-10/100 for 20-4 Wide ResNets, and a comparison of the use of cutout in 20-10 Wide ResNets. Clearly, even for width-4 ResNets, the gap in error rate between full precision weights and 1-bit-per-weight is small. Also noticeable is that the warm-restart method enables convergence to very good solutions after just 30 epochs; training longer to 126 epochs reduces test error rates further by between 2% and 5%. It can also be observed that the 20-4 network is powerful enough to model the CIFAR-10/100 training sets to well over 99% accuracy, but the modelling power is reduced in the 1-bit version, particularly for CIFAR100. The reduced modelling capacity for single-bit weights is consistent with the gap in test-error rate performance between the 32-bit and 1-bit cases. When using cutout, training for longer gives improved error rates, but when not using cutout, 126 epochs suffices for peak performance. Finally, for MNIST and a 4× wide ResNet without any data augmentation, our full-precision method achieved 0.71% after just 1 epoch of training, and 0.28% after 6 epochs, whereas our 1-bit method achieved 0.81%, 0.36% and 0.27% after 1, 6 and 14 epochs. In comparison, 1.29% was reported for the 1-bit-per-weight case by Courbariaux et al. (2015), and 0.96% by Hubara et al. (2016). 9 Published as a conference paper at ICLR 2018 50 50 10 Error rate (%) Error rate (%) 20 5 C100-32-bits, test C100-1-bit, test C10-32-bits, test C10-1-bit, test C100-32-bits, train C100-1-bit, train C10-32-bits, train C10-1-bit, train 1 0.1 2 6 20 10 5 14 30 Training epoch 62 126 C100-1-bit C100-1-bit-Cutout C100-32-bits C100-32-bits-Cutout C10-1-bit C10-1-bit-Cutout C10-32-bits C10-32-bits-Cutout 2 6 14 30 Training epoch 62 126 254 Figure 5: Convergence through training. Left: Each marker shows the error rates on the test set and the training set at the end of each cycle of the warm-restart training method, for 20-4 ResNets (less than 5 million parameters). Right: each marker shows the test error rate for 20-10 ResNets, with and without cutout. C10 indicates CIFAR-10, and C100 indicates CIFAR-100. 4.1 A BLATION STUDIES For CIFAR-10/100, both our full-precision Wide ResNets and our 1-bit-per-weight versions benefit from our method of not learning batch-norm scale and offset parameters. Accuracy in the 1-bit-perweight case also benefits from our use of a warm-restart training schedule (Loshchilov & Hutter, 2016). To demonstrate the influence of these two aspects, in Figure 6 we show, for CIFAR-100, how the test error rate changes through training when either or both of these methods are not used. We did not use cutout for the purpose of this figure. The comparison learning-rate-schedule drops the learning rate from 0.1 to 0.01 to 0.001 after 85 and 170 epochs. It is clear that our methods lower the final error rate by around 3% absolute by not learning the batch-norm parameters. The warm-restart method enables faster convergence for the full-precision case, but is not significant in reducing the error rate. However, for the 1-bit-per-weight case, it is clear that for best results it is best to both use warm-restart, and to not learn batch-norm parameters. 60 Warm restart, no learn BN (Our paper) Warm restart, learn BN No warm restart, no learn BN No warm restart, learn BN 50 Test error rate (%) Test error rate (%) 60 40 30 20 Warm restart, no learn BN (Our paper) Warm restart, learn BN No warm restart, no learn BN No warm restart, learn BN 50 40 30 20 0 50 100 150 200 250 Training epoch 0 50 100 150 200 250 Training epoch Figure 6: Influence of warm-restart and not learning BN gain and offset. Left: full-precision case. Right: 1-bit-per-weight case. 10 Published as a conference paper at ICLR 2018 5 5.1 D ISCUSSION T HE ACCURACY GAP FOR 1- BIT VS 32- BIT WEIGHTS It is to be expected that a smaller error rate gap will result between the same network using fullprecision and 1-bit-per-weight when the test error rate on the full precision network gets smaller. Indeed, Tables 1 and 2 quantify how the gap in error rate between the full-precision and 1-bit-perweight cases tends to grow as the error-rate in the full-precision network grows. To further illustrate this trend for our approach, we have plotted in Figure 1 the gap in Top-1 error rates vs the Top-1 error rate for the full precision case, for some of the best performing networks for the six datasets we used. Strong conclusions from this data can only be made relative to alternative methods, but ours is the first study to our knowledge to consider more than two datasets. Nevertheless, we have also plotted in Figure 1 the error rate and the gap reported by Rastegari et al. (2016) for two different networks using their BWN 1-bit weight method. The reasons for the larger gaps for those points is unclear, but what is clear is that better full-precision accuracy results in a smaller gap in all cases. A challenge for further work is to derive theoretical bounds that predict the gap. How the magnitude of the gap changes with full precision error rate is dependent on many factors, including the method used to generate models with 1-bit-per-weight. For high-error rate cases, the loss function throughout training is much higher for the 1-bit case than the 32-bit case, and hence, the 1-bit-per-weight network is not able to fit the training set as well as the 32-bit one. Whether this is because of the loss of precision in weights, or due to the mismatch in gradients inherent is propagating with 1-bit weights and updating full-precision weights during training is an open question. If it is the latter case, then it is possible that principled refinements to the weight update method we used will further reduce the gap. However, it is also interesting that for our 26-layer networks applied to CIFAR10/100, that the gap is much smaller, despite no benefits in the full precision case from extra depth, and this also warrants further investigation. 5.2 C OMPARISON WITH THE BWN METHOD Our approach differs from the BWN method of Rastegari et al. (2016) for two reasons. First, we do not need to calculate mean absolute weight values of the underlying full precision weights for each output channel in each layer following each minibatch, and this enables faster training. Second, we do not need to adjust for a gradient term corresponding to the appearance of each weight in the mean absolute value. We found overall that the two methods work equally effectively, but ours has two advantages: faster training, and fewer overall parameters. As a note we found that the method of Rastegari et al. (2016) also works equally effectively on a per-layer basis, rather than per-channel. We also note that the focus of Rastegari et al. (2016) was much more on the case that combines single-bit activations and 1-bit-per-weight than solely 1-bit-per-weight. It remains to be tested how our scaling method compares in that case. It is also interesting to understand whether the use of batch-norm renders scaling of the sign of weights robust to different scalings, and whether networks that do not use batch-norm might be more sensitive to the precise method used. 5.3 T HE INFLUENCE OF NOT LEARNING BATCH - NORMALIZATION PARAMETERS The unusual design choice of not learning the batch normalization parameters was made for CIFAR10/100, SVHN and MNIST because for Wide ResNets, overfitting is very evident on these datasets (see Figure 5); by the end of training, typically the loss function becomes very close to zero, corresponding to severe overfitting. Inspired by label-smoothing regularization (Szegedy et al., 2015) that aims to reduce overconfidence following the softmax layer, we hypothesized that imposing more control over the standard deviation of inputs to the softmax might have a similar regularizing effect. This is why we removed the final all-to-all layer of our ResNets and replaced it with a 1×1 convolutional layer followed by a batch-normalization layer prior to the global average pooling layer. In turn, not learning a scale and offset for this batch-normalization layer ensures that batches flowing into the softmax layer have standard deviations that do not grow throughout training, which tends to increase the entropy of predictions following the softmax, which is equivalent to lower confidence (Guo et al., 2017). 11 Published as a conference paper at ICLR 2018 After observing success with these methods in 10× Wide ResNets, we then observed that learning the batch-norm parameters in other layers also led to increased overfitting, and increased test error rates, and so removed that learning in all layers (except the first one applied to the input, when ReLU is used there). As shown in Figure 6, there are significant benefits from this approach, for both full-precision and 1bit-per-weight networks. It is why, in Table 3, our results surpass those of Zagoruyko & Komodakis (2016) on effectively the same Wide ResNet (our 20-10 network is essentially the same as the 22-10 comparison network, where the extra 2 layers appear due to the use of learned 1×1 convolutional projections in downsampling residual paths, whereas we use average pooling instead). As expected from the motivation, we found our method is not appropriate for datasets such as ImageNet32 where overfitting is not as evident, in which case learning the batch normalization parameters significantly reduces test error rates. 5.4 C OMPARISON WITH S QUEEZE N ET Here we compare our approach with SqueezeNet (Iandola et al., 2016), which reported significant memory savings for a trained model relative to an AlexNet. The SqueezeNet approach uses two strategies to achieve this: (1) replacing many 3x3 kernels with 1x1 kernels; (2) deep compression (Han et al., 2015). Regarding SqueezeNet strategy (1), we note that SqueezeNet is an all-convolutional network that closely resembles the ResNets used here. We experimented briefly with our 1-bit-per-weight approach in many all-convolutional variants—e.g. plain all-convolutional (Springenberg et al., 2014), SqueezeNet (Iandola et al., 2016), MobileNet (Howard et al., 2017), ResNexT (Xie et al., 2016)— and found its effectiveness relative to full-precision baselines to be comparable for all variants. We also observed in many experiments that the total number of learned parameters correlates very well with classification accuracy. When we applied a SqueezeNet variant to CIFAR-100, we found that to obtain the same accuracy as our ResNets for about the same depth, we had to increase the width until the SqueezeNet had approximately the same number of learned parameters as the ResNet. We conclude that our method therefore reduces the model size of the baseline SqueezeNet architecture (i.e. when no deep compression is used) by a factor of 32, albeit with an accuracy gap. Regarding SqueezeNet strategy (2), the SqueezeNet paper reports deep compression (Han et al., 2015) was able to reduce the model size by approximately a factor of 10 with no accuracy loss. Our method reduces the same model size by a factor of 32, but with a small accuracy loss that gets larger as the full-precision accuracy gets smaller. It would be interesting to explore whether deep compression might be applied to our 1-bit-per-weight models, but our own focus is on methods that minimally alter training, and we leave investigation of more complex methods for future work. Regarding SqueezeNet performance, the best accuracy reported in the SqueezeNet paper for ImageNet is 39.6% top-1 error, requiring 4.8MB for the model’s weights. Our single-bit-weight models achieve better than 33% top-1 error, and require 8.3 MB for the model’s weights. 5.5 L IMITATIONS AND F URTHER W ORK In this paper we focus only on reducing the precision of weights to a single-bit, with benefits for model compression, and enabling of inference with very few multiplications. It is also interesting and desirable to reduce the computational load of inference using a trained model, by carrying out layer computations in very few numbers of bits (Hubara et al., 2016; Rastegari et al., 2016; Cai et al., 2017). Facilitating this requires modifying non-linear activations in a network from ReLUs to quantized ReLUs, or in the extreme case, binary step functions. Here we use only full-precision calculations. It can be expected that combining our methods with reduced precision processing will inevitably increase error rates. We have addressed this extension in a forthcoming submission. ACKNOWLEDGMENTS This work was supported by a Discovery Project funded by the Australian Research Council (project number DP170104600). Discussions and visit hosting by Gert Cauwenberghs and Hesham Mostafa, of UCSD, and André van Schaik and Runchun Wang of Western Sydney University are gratefully 12 Published as a conference paper at ICLR 2018 acknowledged, as are discussions with Dr Victor Stamatescu and Dr Muhammad Abul Hasan of University of South Australia. R EFERENCES Z. Cai, X. He, J. Sun, and N. Vasconcelos. Deep learning with low precision by half-wave Gaussian quantization. CoRR, abs/1702.00953, 2017. URL http://arxiv.org/abs/1702.00953. P. Chrabaszcz, I. Loshchilov, and F. Hutter. A downsampled variant of imagenet as an alternative to the CIFAR datasets. CoRR, abs/1707.08819, 2017. URL http://arxiv.org/abs/1707. 08819. M. Courbariaux, Y. Bengio, and J.-P. David. BinaryConnect: Training Deep Neural Networks with binary weights during propagations. CoRR, abs/1511.00363, 2015. URL http://arxiv. org/abs/1511.00363. T. Devries and G. W. Taylor. Improved regularization of convolutional neural networks with cutout. CoRR, abs/1708.04552, 2017. URL http://arxiv.org/abs/1708.04552. X. Gastaldi. Shake-shake regularization. CoRR, abs/1705.07485, 2017. URL http://arxiv. org/abs/1705.07485. C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger. On calibration of modern neural networks. CoRR, abs/1706.04599, 2017. URL http://arxiv.org/abs/1706.04599. S. Han, H. Mao, and W. J. Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and Huffman coding. CoRR, abs/1510.00149, 2015. URL http: //arxiv.org/abs/1510.00149. K. He, X. Zhang, S. Ren, and J. Sun. Delving deep into rectifiers: Surpassing human-level performance on ImageNet classification. In Proc. IEEE International Conference on Computer Vision (ICCV) (see arXiv:1502.01852), 2015a. K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. Technical report, Microsoft Research, 2015b. Arxiv.1512.03385. K. He, X. Zhang, S. Ren, and J. Sun. Identity mappings in deep residual networks. Technical report, Microsoft Research, 2016. Arxiv.1603.05027. A. G. Howard, M. Zhu, B. Chen, D. Kalenichenko, W. Wang, T. Weyand, M. Andreetto, and H. Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. CoRR, abs/1704.04861, 2017. URL http://arxiv.org/abs/1704.04861. G. Huang, Z. Liu, K. Q. Weinberger, and L. van der Maaten. Densely connected convolutional networks. CoRR, abs/1608.06993, 2016. URL http://arxiv.org/abs/1608.06993. I. Hubara, M. Courbariaux, D. Soudry, R. El-Yaniv, and Y. Bengio. Quantized neural networks: Training neural networks with low precision weights and activations. CoRR, abs/1609.07061, 2016. URL http://arxiv.org/abs/1609.07061. F. N. Iandola, M. W. Moskewicz, K. Ashraf, S. Han, W. J. Dally, and K. Keutzer. Squeezenet: Alexnet-level accuracy with 50x fewer parameters and <1MB model size. CoRR, abs/1602.07360, 2016. URL http://arxiv.org/abs/1602.07360. A. Krizhevsky, I. Sutskever, and G. E. Hinton. ImageNet classification with deep convolutional neural networks. In NIPS 2012: Neural Information Processing Systems, Lake Tahoe, Nevada, 2012. Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86:2278–2324, 1998. H. Li, S. De, Z. Xu, C. Studer, H. Samet, and T. Goldstein. Training quantized nets: A deeper understanding. CoRR, abs/1706.02379, 2017. URL http://arxiv.org/abs/1706.02379. 13 Published as a conference paper at ICLR 2018 M. Lin, Q. Chen, and S. Yan. Network in network. CoRR, abs/1312.4400, 2013. URL http: //arxiv.org/abs/1312.4400. I. Loshchilov and F. Hutter. SGDR: stochastic gradient descent with restarts. CoRR, abs/1608.03983, 2016. URL http://arxiv.org/abs/1608.03983. M. D. McDonnell, R. Wang, and A. van Schaik. Reduced-memory training and deployment of deep residual networks by stochastic binary quantization. Abstract and talk at the 5th Neuro Inspired Computational Elements Workshop (NICE 2017), held at IBM Almaden, March 6-8, 2017 (https://www.src.org/calendar/e006125/mcdonnell-abstract/), 2017. P. Merolla, R. Appuswamy, J. V. Arthur, S. K. Esser, and D. S. Modha. Deep neural networks are robust to weight binarization and other non-linear distortions. CoRR, abs/1606.01981, 2016. URL http://arxiv.org/abs/1606.01981. F. Pedersoli, G. Tzanetakis, and A. Tagliasacchi. Espresso: Efficient forward propagation for bcnns. CoRR, abs/1705.07175, 2017. URL http://arxiv.org/abs/1705.07175. M. Rastegari, V. Ordonez, J. Redmon, and A. Farhadi. XNOR-Net: Imagenet classification using binary convolutional neural networks. CoRR, abs/1603.05279, 2016. URL http://arxiv. org/abs/1603.05279. O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. doi: 10.1007/ s11263-015-0816-y. K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014. URL http://arxiv.org/abs/1409.1556. J. T. Springenberg, A. Dosovitskiy, T. Brox, and M. A. Riedmiller. Striving for simplicity: The all convolutional net. CoRR, abs/1412.6806, 2014. URL http://arxiv.org/abs/1412. 6806. C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna. Rethinking the inception architecture for computer vision. CoRR, abs/1512.00567, 2015. URL http://arxiv.org/abs/1512. 00567. S. Xie, R. B. Girshick, P. Dollár, Z. Tu, and K. He. Aggregated residual transformations for deep neural networks. CoRR, abs/1611.05431, 2016. URL http://arxiv.org/abs/1611. 05431. S. Zagoruyko and N. Komodakis. Wide residual networks. Arxiv.1605.07146, 2016. A. Zhou, A. Yao, Y. Guo, L. Xu, and Y. Chen. Incremental network quantization: Towards lossless CNNs with low-precision weights. CoRR, abs/1702.03044, 2017. URL http://arxiv.org/ abs/1702.03044. A A.1 D IFFERENCES FROM S TANDARD R ES N ETS IN OUR BASELINE O UR NETWORK DOWNSAMPLES THE RESIDUAL PATH USING AVERAGE POOLING For skip connections between feature maps of different sizes, we use zero-padding for increasing the number of channels as per option 1 of He et al. (2015b). However, for the residual pathway, we use average pooling using a kernel of size 3 × 3 with stride 2 for downsampling, instead of typical lossy downsampling that discards all pixel values in between samples. 14 Published as a conference paper at ICLR 2018 A.2 W E USE BATCH NORMALIZATION APPLIED TO THE INPUT LAYER The literature has reported various options for the optimal ordering, usage and placement of BN and ReLU layers in residual networks. Following He et al. (2016); Zagoruyko & Komodakis (2016), we precede convolutional layers with the combination of BN followed by ReLU. However, different to He et al. (2016); Zagoruyko & Komodakis (2016), we also insert BN (and optional ReLU) immediately after the input layer and before the first convolutional layer. When the optional ReLU is used, unlike all other batch-normalization layers, we enable learning of the scale and offset factors. This first BN layer enables us to avoid doing any pre-processing on the inputs to the network, since the BN layer provides necessary normalization. When the optional ReLU is included, we found that the learned offset ensures the input to the first ReLU is never negative. In accordance with our strategy of simplicity, all weight layers can be thought of as a block of three operations in the same sequence, as indicated in Figure 3. Conceptually, batch-norm followed by ReLU can be thought of as a single layer consisting of a ReLU that adaptively changes its centre point and positive slope for each channel and relative to each mini-batch. We also precede the global average pooling layer by a BN layer, but do not use a ReLU at this point, since nonlinear activation is provided by the softmax layer. We found including the ReLU leads to differences early in training but not by the completion of training. A.3 O UR FIRST CONV LAYER HAS AS MANY CHANNELS AS THE FIRST RESIDUAL BLOCK The Wide ResNet of Zagoruyko & Komodakis (2016) is specified as having a first convolutional layer that always has a constant number of output channels, even when the number of output channels for other layers increases. We found there is no need to impose this constraint, and instead always allow the first layer to share the same number of output channels as all blocks at the first spatial scale. The increase in the total number of parameters from doing this is small relative to the total number of parameters, since the number of input channels to the first layer is just 3. The benefit of this change is increased simplicity in the network definition, by ensuring one fewer change in the dimensionality of the residual pathway. B C OMPARISON OF R ESIDUAL N ETWORKS AND P LAIN CNN S We were interested in understanding whether the good results we achieved for single-bit weights were a consequence of the skip connections in residual networks. We therefore applied our method to plain all-convolutional networks identical to our 4× residual networks, except with the skip connections removed. Initially, training indicated a much slower convergence,√but we found that altering the initial weights standard deviations to be proportional to 2 instead of 2 helped, so this was the only other change made. The change was also applied in Equation (1). As summarized in Figure 7, we found that convergence remained slower than our ResNets, but there was only a small accuracy penalty in comparison with ResNets after 126 epochs of training. This is consistent with the findings of He et al. (2015b) where only ResNets deeper than about 20 layers showed a significant advantage over plain all-convolutional networks. This experiment, and others we have done, support our view that our method is not particular to ResNets. 15 Published as a conference paper at ICLR 2018 Classification error rate (%) 50 20 10 C100-32-bits-ResNet C100-1-bit-ResNet C10-32-bits-ResNet C10-1-bit-ResNet C100-32-bits-Plain C100-1-bit-Plain C10-32-bits-Plain C10-1-bit-Plain 5 2 6 14 30 62 126 Epochs Figure 7: Residual networks compared with all-convolutional networks. The data in this figure is for networks with width 4×, i.e. with about 4.3 million learned parameters. 16
9cs.NE
Transaction-based Sandboxing for JavaScript Technical Report Matthias Keil and Peter Thiemann University of Freiburg Freiburg, Germany {keilr,thiemann}@informatik.uni-freiburg.de arXiv:1612.00669v2 [cs.PL] 17 Jan 2017 Abstract Today’s JavaScript applications are composed of scripts from different origins that are loaded at run time. As not all of these origins are equally trusted, the execution of these scripts should be isolated from one another. However, some scripts must access the application state and some may be allowed to change it, while preserving the confidentiality and integrity constraints of the application. This paper presents design and implementation of DecentJS, a language-embedded sandbox for full JavaScript. It enables scripts to run in a configurable degree of isolation with fine-grained access control. It provides a transactional scope in which effects are logged for review by the access control policy. After inspection of the log, effects can be committed to the application state or rolled back. The implementation relies on JavaScript proxies to guarantee full interposition for the full language and for all code, including dynamically loaded scripts and code injected via eval. Its only restriction is that scripts must be compliant with JavaScript’s strict mode. 1998 ACM Subject Classification D.4.6 Security and Protection Keywords and phrases JavaScript, Sandbox, Proxy 1 Introduction JavaScript is used by 93.1%1 of all the websites. Most of them rely on third-party libraries for connecting to social networks, feature extensions, or advertisement. Some of these libraries are packaged with the application, but others are loaded at run time from origins of different trustworthiness, sometimes depending on user input. To compensate for different levels of trust, the execution of dynamically loaded code should be isolated from the application state. Today’s state of the art in securing JavaScript applications that include code from different origins is an all-or-nothing choice. Browsers apply protection mechanisms, such as the same-origin policy [33] or the signed script policy [36], so that scripts either run in isolation or gain full access. While script isolation guarantees noninterference with the working of the application as well as preservation of data integrity and confidentiality, there are scripts that must have access to part of the application state to function meaningfully. As all included scripts run with the same authority, the application script cannot exert fine-grained control over the use of data by an included script. Thus, managing untrusted JavaScript code has become one of the key challenges of present research on JavaScript [2, 15, 5, 6, 32, 25, 30, 24, 23, 12]. Existing approaches are either based on restricting JavaScript code to a statically verifiable language subset (e.g., 1 according to http://w3techs.com/, status as of March 2016 © Matthias Keil and Peter Thiemann; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany 2 Transaction-based Sandboxing for JavaScript Facebook’s FBJS [8] or Yahoo’s ADsafe [1]), on enforcing an execution model that only forwards selected resources into an otherwise isolated compartment by filtering and rewriting like Google’s Caja project [11], or on implementing monitoring facilities inside the JavaScript engine [32]. However, these approaches have known deficiencies: the first two need to restrict usage of JavaScript’s dynamic features, they do not apply to code generated at run time, and they require extra maintenance efforts because their analysis and transformation needs to be kept in sync with the evolution of the language. Implementing monitoring in the JavaScript engine is fragile and incomplete: while efficient, such a solution only works for one engine and it is hard to maintain due to the high activity in engine development and optimization. Contributions We present the design and implementation of DecentJS, a sandbox for JavaScript which enforces noninterference (integrity and confidentiality) by run-time monitoring. Its design is inspired by revocable references [39, 26] and SpiderMonkey’s compartment concept [41]. Compartments create a separate memory heap for each website, a technique initially introduced to optimize garbage collection. All objects created by a website are only allowed to touch objects in the same compartment. Proxies are the only objects that can cross the compartment boundaries. They are used as cross compartment wrappers to make objects accessible in other compartments. DecentJS adapts SpiderMonkey’s compartment concept. Each sandbox implements a fresh scope to run code in isolation to the application state. Proxies implement a membrane [39, 26] to guarantee full interposition and to make objects accessible inside of a sandbox. Outline of this Paper The paper is organized as follows: Section 2 introduces DecentJS’s facilities from a programmer’s point of view. Section 3 recalls proxies and membranes from related work and explains the principles underlying the implementation. Section 4 discusses DecentJS’s limitations and Section 5 reports our experiences from applying sandboxing to a set of benchmark programs. Finally, Section 6 concludes. Appendix A presents an example demonstrating the sandbox hosting a third-party library. Appendix B shows some example scenarios that already use the implemented system. Appendix C shows the operational semantics of a core calculus with sandboxing. Appendix D states some technical results. Appendix E discusses related work and Appendix ?? reports our experiences from applying sandboxing to a set of benchmark programs. 2 Transaction-based Sandboxing: A Primer This section introduces transaction-based sandboxing and shows a series of examples that explains how sandboxing works. Transactional sandboxing is inspired by the idea of transaction processing in database systems [43] and transactional memory [35]. Each sandbox implements a transactional scope the content of which can be examined, committed, or rolled back. Central to our sandbox is the implementation of a membrane on values that cross the sandbox boundary. The membrane supplies effect monitoring and guarantees noninterference. Moreover, it features identity preservation and handles shadow objects. Shadow objects allow sandbox-internal modifications of objects without effecting there origins. The modified version M. Keil and P. Thiemann function Node (value, left, right) { this.value = value; this.left = left; this.right = right; } Node.prototype.toString = function () { return (this.left?this.left + ", ":"") + this.value +(this.right?", "+this.right:""); } function heightOf (node) { return Math.max(((node.left)?heightOf(node.left)+1:0), ((node.right)?heightOf(node. right)+1:0)); } function setValue (node) { if (node) { node.value=heightOf(node); setValue(node.left); setValue(node.right); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Figure 1 Implementation of Node. Each node object consists of a value field, a left node, and a right node. Its prototype provides a toString method that returns a string representation. Function heightOf computes the height of a node and function setValue replaces the value field of a node by its height, recursively. is only visible inside of the sandbox and different sandbox environments may manipulate the same object. Sandboxing provides transactions, a unit of effects that represent the set of modifications (write effects) on its membrane. Effects enable to check for conflicts and differences, to rollback particular modifications, or to commit a modification to its origin. The implementation of the system is available on the web2 . 2.1 Cross-Sandbox Access We consider operations on binary trees as defined by Node in Figure 1 along with some auxiliary functions. As an example, we perform operations on a tree consisting of one node and two leaves. All value fields are initially 0. 19 var root = new Node(0, new Node(0), new Node(0)); Next, we create a new empty sandbox by calling the constructor Sandbox. Its first parameter acts as the global object of the sandbox environment. It is wrapped in a proxy to mediate all accesses and it is placed on top of the scope chain for code executing inside the sandbox. The second parameter is a configuration object. A sandbox is a first class value that can be used for several executions. 20 var sbx = new Sandbox(this, {/∗ some parameters ∗/}); 2 https://github.com/keil/DecentJS 3 4 Transaction-based Sandboxing for JavaScript One use of a sandbox is to wrap invocations of function objects. To this end, the sandbox API provides methods call, apply, and bind analogous to methods from Function.prototype. For example, we may call setValue on root inside of sbx. 21 sbx.call(setValue, this, root); The first argument of call is a function object that is decompiled and redefined inside the sandbox. This step erases the function’s free variable bindings and builds a new closure relative to the sandbox’s global object. The second argument, the receiver object of the call, as well as the actual arguments of the call are wrapped in proxies to make these objects accessible inside of the sandbox. The wrapper proxies mediate access to their target objects outside the sandbox. Reads are forwarded to the target unless there are local modifications. The return values are wrapped in proxies, again. Writes produce a shadow value (cf. Section 3.2) that represents the sandbox-internal modification of an object. Initially, this modification is only visible to reads inside the sandbox. Native objects, like the Math object in line 10, are also wrapped in a proxy, but their methods cannot be decompiled because there exists no string representation. Thus, native methods must either be trusted or forbidden. Fortunately, most native methods do not have side effects, so we chose to trust them. Given all the wrapping and sandboxing, the call in line 21 did not modify the root object: 22 root.toString(); // returns 0, 0, 0 But calling toString inside the sandbox shows the effect. 23 sbx.call(root.toString, root); // return 0, 1, 0 2.2 Effect Monitoring During execution, each sandbox records the effects on objects that cross the sandbox membrane. The resulting lists of effect objects are accessible through sbx.effects, sbx.readeffects, and sbx.writeeffects which contain all effects, read effects, and write effects, respectively. All three lists offer query methods to select the effects of a particular object. 24 25 26 27 sbx.call(heightOf, this, root); var rects = sbx.effectsOf(this); print(";;; Effects of this"); rects.foreach(function(i, e) {print(e)}); The code snippet above prints a list of all effects performed on this, the global object, by executing the heightOf function on root. The output shows the resulting accesses to heightOf and Math. 28 29 30 31 32 33 ;;; Effects of this (1425301383541) (1425301383541) (1425301383543) (1425301383543) ... has [name=heightOf] get [name=heightOf] has [name=Math] get [name=Math] The first column shows a timestamp, the second shows the name of the effect, and the last column shows the name of the requested parameter. The list does not contain write accesses to this. But there are write effects to value from the previous invocation of setValue. M. Keil and P. Thiemann 34 35 36 37 38 var wectso = sbx.writeeffectsOf(root); print(";;; Write Effects of root"); wectso.foreach(function(i, e) {print(e)}); ;;; Write Effects of root (1425301634992) set [name=value] 2.3 Inspecting a Sandbox The state inside and outside of a sandbox may diverge for different reasons. We distinguish changes, differences, and conflicts. A change indicates if the sandbox-internal value has been changed with respect to the outside value. A difference indicates if the outside value has been modified after the sandbox has concluded. For example, a difference to the previous execution of setValue arises if we replace the left leaf element by a new subtree of height 1 outside of the sandbox. 39 root.left = new Node(new Node(0), new Node(0)); Changes and differences can be examined using an API that is very similar to the effect API. There are flags to check whether a sandbox has changes or differences as well as iterators over them. A conflict arises in the comparison between different sandboxes. Two sandbox environments are in conflict if at least one sandbox modifies a value that is accessed by the other sandbox later on. We consider only Read-After-Write and Write-After-Write conflicts. To demonstrate conflicts, we define a function appendRight, which adds a new subtree on the right. 40 41 42 function appendRight (node) { node.right = Node(’a’, Node(’b’), Node(’c’)); } To recapitulate, the global root is still unmodified and prints 0,0,0,0,0, whereas the root in sbx prints 0,0,0,1,0. Now, let’s execute appendRight in a new sandbox sbx2. 43 44 var sbx2 = new Sandbox(this, {/∗ some parameters ∗/}); sbx2.call(appendRight, this, root); Calling toString in sbx2 prints 0,0,0,0,b,a,c. However, the sandboxes are not in conflict, as the following command show. 45 sbx.inConflictWith(sbx2); // returns false While both sandboxes manipulate root, they manipulate different fields. sbx recalculates the field value, whereas sbx2 replaces the field right. Neither reads data that has previously been written by the other sandbox. However, this situation changes if we call setValue again, which also modifies right. 46 47 48 sbx.call(setValue, this, root); var cofts = sbx.conflictsWith(sbx2); // returns a list of conflicts cofts.foreach(function(i, e) {print(e)}); It documents a read-after-write conflict: 1 Confict: (1425303937853) get [name=right]@SBX001 − (1425303937855) set [name= right]@SBX002 5 6 Transaction-based Sandboxing for JavaScript 2.4 Transaction Processing The commit operation applies select effects from a sandbox to its target. Effects may be committed one at a time by calling commit on each effect object or all at once by calling commit on the sandbox object. 49 50 sbx.commit(); root.toString(); // returns 0, 1, 0, 2, 0 The rollback operation undoes an existing manipulation and returns to its previous configuration before the effect. Again, rollbacks can be done on a per-effect basis or for the sandbox as a whole. However, a rollback did not remove the shadow object. Thus, after rolling back, the values are still shadow values in sbx. 51 52 53 sbx.rollback(); root.toString(); // returns 0, 1, 0, 2, 0 sbx.call(toString, this, root); // returns 0, 0, 0, 0, 0 The revert operation resets the shadow object of a wrapped value. The following code snippet reverts the root object in sbx. 54 sbx.revertOf(root); Now, root’s shadow object is removed and the origin is visible again in the sandbox. Calling toString inside of sbx returns 0,1,0,2,0. 3 Sandbox encapsulation The implementation of DecentJS builds on two foundations: memory safety and reachability. In a memory safe programming language, a program cannot access uninitialized memory or memory outside the range allocated to a datastructure. An object reference serves as the right to access the resources managed by the object along with the memory allocated to it. In JavaScript, all resources are accessible via property read and write operations on objects. Thus, controlling reads and writes is sufficient to control the resources. DecentJS ensures isolation of the actual program code by intercepting each operation that attempts to modify data visible outside the sandbox. To achieve this behavior, all functions and objects crossing the sandbox boundary are wrapped in a membrane to ensure that the sandboxed code cannot modify them in any way. This membrane is implemented using JavaScript proxies [39]. More precisely, our implementation of sandboxing is inspired by Revocable Membranes [39, 37] and access control based on object capabilities [28]. Identity preserving membranes keep the sandbox apart from the normal program execution: We encapsulate objects passed through the membrane and redirect write operations to shadow objects (Section 3.2), we encapsulate code (Section 3.3), and we withhold external bindings from a function (Section 3.4). No unprotected value is passed inside the sandbox. 3.1 Proxies and membranes A proxy is an object intended to be used in place of a target object. The proxy’s behavior is controlled by a handler object that typically mediates access to the target object. Both, target and handler, may be proxy objects themselves. The handler object contains trap functions that are called when a trapped operation is performed on the proxy. Operations like property read, property write, and function M. Keil and P. Thiemann 7 Handler Handler.get(Target,’x’,Proxy); Handler.set(Target,’x’,1,Proxy); Meta-Level Base-Level Proxy Target Proxy.x; Proxy.x=1; Target[’x’]; Target[’x’]=1; Figure 2 Proxy operations. The operation Proxy.x invokes the trap Handler.get(Target,’x’,Proxy) (property get) and the property set operation Proxy.x=1 invokes Handler.set(Target,’x’,1,Proxy). ProxyA x ProxyB y TargetA x TargetB z ProxyC y z TargetC Figure 3 Property access through an identity preserving membrane (dashed line around target objects). The property access through the wrapper ProxyA.x returns a wrapper for TargetA.x. The property access ProxyA.y returns the same wrapper as ProxyB.z. application are forwarded to their corresponding trap. The trap function may implement the operation arbitrarily, for example, by forwarding the operation to the target object. The latter is the default behavior if the trap is not specified. Figure 2 illustrates this situation with a handler that forwards all operations to the target. A membrane is a regulated communication channel between an object and the rest of the program. A membrane is implemented by a proxy that guards all operations on its target. If the result of an operation is another object, then it is recursively wrapped in a membrane before it is returned. This way, all objects accessed through an object behind the membrane are also behind the membrane. Common use cases of membranes are revoking all references to an object network at once or enforcing write protection on the objects behind the membrane [39, 26]. Figure 3 shows a membrane for TargetA implemented by wrapper ProxyA. Each property access through a wrapper (e.g., ProxyA.x) returns a wrapped object. After installing the membrane, no new direct references to target objects behind the membrane become available. An identity preserving membrane guarantees that no target object has more than one proxy. Thus, proxy identity outside the membrane reflects target object identity inside. For example, if TargetA.x.z and TargetA.y refer to the same object (TargetA.x.z===TargetA.y), 8 Transaction-based Sandboxing for JavaScript Handler Handler.get(Target,’x’,Proxy); Handler.set(Target,’y’,1,Proxy); Handler.get(Target,’y’,Proxy); Meta-Level Base-Level Proxy Target Shadow Proxy.x; Proxy.y=1; Proxy.y; Target[’x’]; Shadow[’y’]=1; Shadow[’y’]; Figure 4 Operations on a sandbox. The property get operation Proxy.x invokes the trap Handler. get(Target,’x’,Proxy), which forwards the operation to the proxy’s target. The property set operation Proxy.y=1 invokes the trap Handler.set(Target,’y’,1,Proxy), which forwards the operation to a local shadow object. The final property get operation Proxy.y is than also forwarded to the shadow object. then ProxyA.x.z and ProxyA.y refer to the same wrapper object (ProxyA.x.z===ProxyA.y). 3.2 Shadow objects Our sandbox redefines the semantics of proxies to implement expanders [42], an idea that allows a client side extension of properties without modifying the proxy’s target. A sandbox handler manages two objects: a target object and a local shadow object. The target object acts as a parent object for its proxy whereas the shadow object gathers local modifications. Write operations always take place on the shadow object. A read operation first attempts to obtain the property from the shadow object. If that fails, the read gets forwarded to the target object. Figure 4 illustrates this behavior, which is very similar to JavaScript’s prototype chain: the sandboxed version of an object inherits everything from its outside cousin, whereas modifications only appear inside the sandbox3 . As sandbox encapsulation extends the functionality of a membrane, each object visible inside the sandbox is either an object that was created inside or it is a wrapper for some outside object. A special proxy wraps sandbox internal values whenever committing a value to the outside, as shown in the last example. This step mediates uses of a sandbox internal value in the outside. This is form example required to wrap arguments values passed to committed sandbox function. The wrapping guarantees that the sandbox never gets access to unprotected references to the outside. 3.3 Sandbox scope Apart from access restrictions, protecting the global state from modification through the membrane is fundamental to guarantee noninterference. To execute program code, DecentJS relies on an eval, which is nested in a statement with (sbxglobal) {/∗ body ∗/}. The with 3 Getter and setter functions require special treatment. Like other functions, they are decompiled and then applied to the shadow object. See Section 3.4. M. Keil and P. Thiemann var node = new Node(/∗ some sub−nodes ∗/); var sbx = new Sandbox(this, /∗ some parameters ∗/); with(sbxglobal){ (function(){ ‘‘use strict’’; function setValue(){ if(node){ node.value=heightOf(node); setValue(node.left); setValue(node.right); } } })(); } Figure 5 Scope chain installed by the sandbox when loading setValue. The dark box represents the global scope. The dashed line indicates the sandbox boundary and the inner box shows the program code nested inside. statement places the sandbox global on top of the current environment’s scope chain while executing body. This setup exploits that eval dynamically rebinds the free variables of its argument to whatever is in scope at its call site. In this construction, which is related to dynamic binding [14], any property defined in sbxglobal shadows a variable deeper down in the scope chain. We employ a proxy object in place of sbxglobal to control all non-local variable accesses in the sandboxed code by trapping the sandbox global object’s hasOwnProperty method. When JavaScript traverses the scope chain to resolve a variable access, it calls the method hasOwnProperty on the objects of the scope chain starting from the top. Inside the with statement, the first object that is checked on this traversal is the proxied sandbox global. If its hasOwnProperty method always returns true, then the traversal stops here and the JavaScript engine sends all read and write operations for free variables to the sandbox global. This way, we obtain full interposition and the handler of the proxied sandbox global has complete control over the free variables in body. Figure 5 visualizes the nested scopes created during the execution of setValue as in the example from Section 2. The sandbox global sbxglobal is a wrapper for the actual global object, which is used to access heightOf and Math.abs. The library code is nested in an empty closure which provides a fresh scope for local functions and variables. This step is required because JavaScript did not have standalone block scopes such as blocks in C or 9 10 Transaction-based Sandboxing for JavaScript Global Scope Sandbox1 Sandbox2 Sandbox3 JSCode JSCode JSCode Figure 6 Nested sandboxes in an application. The outer box represents the global application state containing JavaScript’s global scope. Each sandbox has its own global object and the nested JavaScript code is defined w.r.t. to the sandbox global. Java. Variables and named functions 4 created by the sandboxed code end up in this fresh scope. This extra scope guarantees noninterference for dynamically loaded scripts that define global variables and functions. The "use strict"5 declaration in front of the closure puts JavaScript in strict mode, which ensures that the code cannot obtain unprotected references to the global object. Figure 6 shows the situation when instantiating different sandboxes during program execution. Every sandbox installs its own scope with a sandbox global on top of the scope chain. Scripts nested inside are defined with respect to the sandbox global. The sandbox global mediates the access to JavaScript’s global object. Its default implementation is empty to guarantee isolation. However, DecentJS can grant fine-grained access by making resources available in the sandbox global. 3.4 Function recompilation In JavaScript, functions have access to the variables and functions in the lexical scope in which the function was defined. The Mozilla documentation6 says: “It remembers the environment in which it was created.”. Calls to wrapped functions may still cause side effects through their free variables (e.g., by modifying a variable or by calling another side-effecting function). Thus, sandboxing either has to erase external bindings of functions or it has to verify that a function is free of side effects. The former alternative is the default in DecentJS. To remove bindings from functions passed through the membrane our protection mechanism decompiles the function and recompiles it inside the sandbox environment. Decompilation relies on the standard implementation of the toString method of a JavaScript function that returns a string containing the source code of the function. Each use of an external function in a sandbox first decompiles it by calling its toString method. To bypass potential tampering, we use a private copy of Function.prototype.toString for this call. Next, we apply eval to the resulting string to create a fresh variant of the function. As explained in Section 3.3, this application of eval is nested in a with statement that supplies the desired environment. Decompilation also places a "use strict" statement in front. To avoid a frequent decompilation and call of eval with respect to the same code, our implementation caches the compiled function where applicable. 4 5 6 Function created with function name() {/∗ body ∗/}. Strict mode requires that a use of this inside a function is only valid if either the function was called as a method or a receiver object was specified explicitly using apply or call. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures M. Keil and P. Thiemann Instead of recompiling a function, we may use the string representation of a function to verify that a function is free of side effects, for example, by checking if the function’s body is SES-compliant7 [34]. However, it turns out that recompiling a function has a lower impact on the execution time than analyzing the function body. Functions without a string representation (e.g., native functions like Object or Array) cannot be verified or sanitized before passing them through the membrane. We can either trust these functions or rule them out. To this end, DecentJS may be provided with a white list of trusted function objects. In any case, functions remain wrapped in a sandbox proxy to mediate property access. In addition to normal function and method calls, the access to a property that is bound to a getter or setter function needs to decompile or verify the getter or setter before its execution. 3.5 DOM updates The Document Object Model (DOM) is an API for manipulating HTML and XML documents that underlie the rendering of a web page. DOM provides a representation of the document’s content and it offers methods for changing its structure, style, content, etc. In JavaScript, this API is implemented using special objects, reachable from the document object. Unfortunately, the document tree itself is not an object in the programming language. Thus, it cannot be wrapped for use inside of a sandbox. The only possibility is to wrap the interfaces, in particular, the document object. We grant access to the DOM by binding the DOM interfaces to the sandbox global when instantiating a new sandbox. As all interfaces are wrapped in a sandbox proxy to mediate access, there are a number of limitations: By default, DOM nodes are accessed by calling query methods like getElementById on the document object. Effect logging recognizes these accesses as method calls, rather than as operations on the DOM. All query functions are special native functions that do not have a string representation. Decompilation is not possible so that using a query function must be permitted explicitly through the white list. A query function must be called as a method of an actual DOM object implementing the corresponding interface. Thus, DOM objects cannot be wrapped like other objects, but they require a special wrapping that calls the method on the correct receiver object. While read operations can be managed in this way, write operations must either be forbidden or they affect the original DOM. Thus, guest code can modify the original DOM unless the DOM interface is restricted to read-only operations. With unrestricted operations it would be possible to insert new <script> elements in the document, which loads scripts from the internet and executes them in the normal application state without further sandboxing. However, prohibiting write operation means that the majority of guest codes cannot be executed in the sandbox. To overcome this limitation, DecentJS provides guest code access to an emulated DOM instead of the real one. We rely on dom.js 8 , a JavaScript library emulating a full browser DOM, to implement a DOM interface for scripts running in the sandbox. This emulated DOM is merged into the global sandbox object when executing scripts. 7 8 In SES, a function can only cause side effects on values passed as an argument. https://github.com/andreasgal/dom.js/ 11 12 Transaction-based Sandboxing for JavaScript As this pseudo DOM is constructed inside the sandbox, it can be accessed and modified at will. No special treatment is required. However, the pseudo DOM is wrapped in a special membrane mediating all operations and performing effect logging on all DOM elements. As each sandbox owns a direct reference to the sandbox internal DOM it provides the following features to the user: The sandbox provides an interface to the sandbox internal DOM and enables the host program to access all aspects of the DOM. This interface can control the data visible to the guest program. A host can load a page template before evaluating guest code. This template can be an arbitrary HTML document, like the host’s page or a blank web page. As most libraries operate on non-blank page documents (e.g., by reading or writing to a particular element) this template can be used to create an environment. Guest code runs without restrictions. For example, guest code can introduce new < script> elements to load library code from the internet. These libraries are loaded and executed inside the sandbox as well. All operations on the interface objects are recorded, for example, the access to window .location when loading a document. Effects can examined using a suitable API (cf. Section 2.2). The host program can perform a fine-grained inspection of the document tree (e.g., it can search for changes and differences). The host recognizes newly created DOM elements and it can transfer content from the sandbox DOM to the DOM of the host program. 3.6 Policies A policy is a guideline that prescribes whether an operation is allowed. Most existing sandbox systems come with a facility to define policies. For example, a policy may grant access to a certain resource, it may grant the right to perform an operation or to cause a side effect. Our system does not provide access control policies in the manner known from other systems. DecentJS only provides the mechanism to implement an empty scope and to pass selected resources to this scope. When a reference to a certain resource is made available inside the sandbox, then it should be wrapped in another proxy membrane that enforces a suitable policy. For example, one may use this work’s transactional membranes to shadow write operations, Access Permission Contracts [18] to restrict the access on objects, or Revocable References [39, 40] to revoke access to the outside world. 4 Discussion Strict Mode DecentJS runs guest code in JavaScript’s strict mode to rule out uncontrolled accesses to the global object. This restriction may lead to dysfunctional guest code because strict-mode semantics is subtly different from non-strict mode JavaScript. However, assuming strict mode is less restrictive than the restrictions imposed by other techniques that restrict JavaScript’s dynamic features. Alternatively, one could also provide a program transformation that guards uses of this that may access the global object. M. Keil and P. Thiemann Scopes DecentJS places every load in its own scope. Hence, variables and functions declared in one script are not visible to the execution of another script in the same sandbox. Indeed, we deliberately keep scopes apart to avoid interference. To enable communication DecentJS offers a facility to load mutually dependant scripts into the same scope. Otherwise, scripts may exchange data by writing to fields in the sandbox global object. Function Decompilation If a top level closure is wrapped in a sandbox, then its free valriables have to be declared to the sandbox or their bindings are removed. Decompilation may change the meaning of a function, because it rebinds its free variables. Only “pure functions”9 can be decompiled without changing their meaning. However, decompiling preserves the semantics of a function if its free variables are imported in the sandbox. The new closure formed within the sandbox may be closed over variables defined in that sandbox. This task is rightfully manual as the availability of global bindings is part of a policy. In conclusion, decompilation is unavoidable to guarantee noninterference of a function defined in another scope as every property read operation may be the call of a side-effecting getter function. Native Functions Decompilation requires a string that contains the source code of that function, but calling the standard toString method from Function.prototype does not work for all functions. A native function does not have a string representation. Trust in a native function is regulated with a white list of trusted functions. The Function.prototype.bind() method creates a new function with the same body, but the first couple of arguments bound to the arguments of bind(). JavaScript does not provide a string representation for the newly created function. Object, Array, and Function Initializer In JavaScript, some objects can be initialized using a literal notation (initializer notation). Examples are object literals (using {}), array objects (using []), and function objects (using the named or unnamed function expression, e.g. function (){}). Using the literal notation circumvents all restrictions and wrappings that we may have imposed on the Object, Array, and Function constructors. As we are not able to intercept the construction using the literal notation enables unprotected read access to the prototype objects Object.prototype, Array.prototype, and Function.prototype. The newly created object always inherits from the corresponding prototype. However, we will never get access to the prototype object itself and we are not able to modify the prototype. Writes to the created objects always effect the object itself and are never forwarded to the prototype object. 9 A pure function is a function that only maps its input into an output without causing any observable side effect. 13 14 Transaction-based Sandboxing for JavaScript Even though all the elements contained in the native prototype objects are uncritical by default, a global (not sandboxed) script could add sensitive data or a side effecting function to one of the prototype objects and thus bypass access to unprotected data. Function Constructor The function constructor Function creates a new function object based on the definition given as arguments. In contrast to function statements and function expressions, the function constructor ignores the surrounding scope. The new function is always created in the global scope and calling it enables access to all global variables. To prevent this leakage, the sandbox never grants unwrapped access to JavaScipt’s global Function constructor even if the constructor is white-listed as a safe native function. A special wrapping intercepts the operations and uses a safe way to construct a new function with respect to the sandbox. Noninterference The execution of sandboxed code should not interfere with the execution of application code. That is, the application should run as if no sandboxes were present. This property is called noninterference (NI) [10] by the security community. The intuition is that sandboxed code runs at a lower level of security than application code and that the low-security sandbox code must not be able to observe the results of the high-security computation in the global scope. DecentJS guarantees integrity and confidentiality. The default “empty” sandbox guarantees to run code in full isolation from the rest of the application, whereas the sandbox global can provide protected references to the sandbox. In summary, the sandboxed code may try to write to an object that is visible to the application, it may throw an exception, or it may not terminate. Our membrane redirects all write operations in sandboxed code to local replicas and it captures all exceptions. A timeout could be used to transform non-terminating executions into an exception, alas such a timeout cannot be implemented in JavaScript.10 5 Evaluation To evaluate our implementation, we applied it to JavaScript benchmark programs from the Google Octane 2.0 Benchmark Suite11 . These benchmarks measure a JavaScript engine’s performance by running a selection of complex and demanding programs (benchmark programs run between 5 and 8200 times). Google claims that Octane “measure[s] the performance of JavaScript code found in large, real-world web applications, running on modern mobile and desktop browsers. Each benchmark is complex and demanding . As expected, the run time increases when executing a benchmark in a sandbox. While some programs like EarleyBoyer, NavierStrokes, pdf.js, Mandreel, and Box2DWeb are heavily affected, others are only slightly affected: Richards, Crypto, RegExp, and Code loading, for instance. The observed run time impact entirely depends on the number of values that cross the membrane. The JavaScript timeout function only schedules a function to run when the currently running JavaScript code—presumably some event handler—stops. It cannot interrupt a running function. 11 https://developers.google.com/octane 10 M. Keil and P. Thiemann From the running times we find that the sandbox itself causes an average slowdown of 8.01 (over all benchmarks). This is more than acceptable compared to other language-embedded systems. The numbers also show that sandboxing with fine-grained effect logging enabled causes an average slowdown of 32.60, an additional factor of 4.07 on top of pure sandboxing. Because the execution of program code inside of a sandbox is nothing else than a normal program execution inside of a with statement and with one additional call to eval (when instantiating the execution) the run-time impact is influenced by (i) the number of wrap operations of values that cross the membrane, (ii) the number of decompile operations on functions, and (iii) the number of effects on wrapped objects. Readouts from internal counters indicate that the heavily affected benchmarks (RayTrace, pdf.js, Mandreel, and Box2DWeb) perform a very large number of effects. The RayTrace benchmark, for example, performs 51 million effects. Overall, an average slowdown of 8.01 is more than acceptable compared to other languageembedded systems. As Octane is intended to measure the engine’s performance (benchmark programs run between 5 and 8200 times) we claim that it is the heaviest kind of benchmark. Every real-world library (e.g. jQuery) is less demanding and runs without an measurable runtime impact. Appendix F also contains the score values obtained from running the benchmark suite and lists the readouts of some internal counters. 6 Conclusion DecentJS runs JavaScript code in a configurable degree of isolation with fine-grained access control rather than disallowing all access to the application state. It provides full browser compatibility (i.e. all browsers work without modifications as long as the proxy API is supported) and it has a better performance than other language-embedded systems. Additionally, DecentJS comes with the following features: 1. Language-embedded sandbox. DecentJS is a JavaScript library and all aspects are accessible through a sandbox API. The library can be deployed as a language extension and requires no changes in the JavaScript run-time system. 2. Full interposition. DecentJS is implemented using JavaScript proxies [39]. The proxybased implementation guarantees full interposition for the full JavaScript language including all dynamic features (e.g., with, eval). DecentJS works for all code regardless of its origin, including dynamically loaded code and code injected via eval. No source code transformation or avoidance of JavaScript’s dynamic features is required. 3. Transaction-based sandboxing. A DecentJS sandbox provides a transactional scope that logs all effects. Wrapper proxies make external objects accessible inside of the sandbox and enable sandbox internal modifications of the object. Hence, sandboxed code runs as usual without noticing the sandbox. Effects reveal conflicts, differences, and changes with respect to another sandbox or the global state. After inspection of the log, effects can be committed to the application state or rolled back. Acknowledgments This work benefited from discussions with participants of the Dagstuhl Seminar “Scripting Languages and Frameworks: Analysis and Verification” in 2014. In particular, Tom Van Cutsem provided helpful advice on the internals of JavaScript proxies. 15 16 Transaction-based Sandboxing for JavaScript References 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Adsafe: Making JavaScript safe for advertising. http://www.adsafe.org/, 2015. P. Agten, S. V. Acker, Y. Brondsema, P. H. Phung, L. Desmet, and F. Piessens. JSand: complete client-side sandboxing of third-party JavaScript without browser modifications. In R. H. Zakon, editor, 28th Annual Computer Security Applications Conference, ACSAC 2012, Orlando, FL, USA, 3-7 December 2012, pages 1–10. ACM, 2012. J. Arnaud, M. Denker, S. Ducasse, D. Pollet, A. Bergel, and M. Suen. Read-only execution for dynamic languages. In J. Vitek, editor, Objects, Models, Components, Patterns, 48th International Conference, TOOLS 2010, Málaga, Spain, June 28 - July 2, 2010. Proceedings, volume 6141 of Lecture Notes in Computer Science, pages 117–136, Málaga, Spain, June 2010. Springer. A. Charguéraud. Pretty-big-step semantics. In M. Felleisen and P. Gardner, editors, ESOP, volume 7792 of Lecture Notes in Computer Science, pages 41–60, Rome, Italy, Mar. 2013. Springer. A. Dewald, T. Holz, and F. C. Freiling. ADSandbox: sandboxing JavaScript to fight malicious websites. In S. Y. Shin, S. Ossowski, M. Schumacher, M. J. Palakal, and C.-C. Hung, editors, Proceedings of the 2010 ACM Symposium on Applied Computing (SAC), Sierre, Switzerland, March 22-26, 2010, pages 1859–1864, Sierre, Switzerland, 2010. ACM. M. Dhawan and V. Ganapathy. Analyzing information flow in JavaScript-based browser extensions. In Twenty-Fifth Annual Computer Security Applications Conference, ACSAC 2009, Honolulu, Hawaii, 7-11 December 2009, pages 382–391. IEEE Computer Society, 2009. M. Dhawan, C. Shan, and V. Ganapathy. Enhancing JavaScript with transactions. In J. Noble, editor, ECOOP 2012 - Object-Oriented Programming - 26th European Conference, Beijing, China, June 11-16, 2012. Proceedings, volume 7313 of Lecture Notes in Computer Science, pages 383–408. Springer, 2012. Facebook SDK for JavaScript. https://developers.facebook.com/docs/javascript/, 2015. A. Felt, P. Hooimeijer, D. Evans, and W. Weimer. Talking to strangers without taking their candy: isolating proxied content. In L. Stein and A. Mislove, editors, Proceedings of the 1st Workshop on Social Network Systems, SNS 2008, Glasgow, Scotland, UK, April 1, 2008, pages 25–30. ACM, 2008. J. A. Goguen and J. Meseguer. Security policies and security models. In IEEE Symposium on Security and Privacy, pages 11–20, 1982. google-caja: A source-to-source translator for securing JavaScript-based web content. http: //code.google.com/p/google-caja/, (as of 2011). S. Guarnieri and V. B. Livshits. GATEKEEPER: mostly static enforcement of security and reliability policies for JavaScript code. In F. Monrose, editor, 18th USENIX Security Symposium, Montreal, Canada, August 10-14, 2009, Proceedings, pages 151–168. USENIX Association, 2009. A. Guha, C. Saftoiu, and S. Krishnamurthi. The essence of JavaScript. In T. D’Hondt, editor, ECOOP, volume 6183 of Lecture Notes in Computer Science, pages 126–150, Maribor, Slovenia, June 2010. Springer. D. R. Hanson and T. A. Proebsting. Dynamic variables. In Proceedings of the 2001 Conference on Programming Language Design and Implementation, pages 264–273, Snowbird, UT, USA, June 2001. ACM Press, New York, USA. D. Hedin et al. JSFlow: Tracking information flow in JavaScript and its APIs. In ACM Symposium on Applied Computing (SAC’14), Gyeongju, Korea, Mar. 2014. P. Heidegger, A. Bieniusa, and P. Thiemann. Access permission contracts for scripting languages. In J. Field and M. Hicks, editors, Proceedings 39th Annual ACM Symposium on M. Keil and P. Thiemann 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Principles of Programming Languages, pages 111–122, Philadelphia, USA, Jan. 2012. ACM Press. P. Heidegger and P. Thiemann. A heuristic approach for computing effects. In J. Bishop and A. Vallecillo, editors, Proceedings of the 49th International Conference on Objects, Models, Components and Patterns, volume 6705 of Lecture Notes in Computer Science, pages 147–162, Zurich, Switzerland, June 2011. Springer. M. Keil and P. Thiemann. Efficient dynamic access analysis using JavaScript proxies. In Proceedings of the 9th Symposium on Dynamic Languages, DLS ’13, pages 49–60, New York, NY, USA, 2013. ACM. M. Keil and P. Thiemann. Efficient dynamic access analysis using JavaScript proxies. In Proceedings of the 9th Symposium on Dynamic Languages, DLS ’13, pages 49–60, Indianapolis, Indiana, USA, 2013. ACM. M. Keil and P. Thiemann. Treatjs: Higher-order contracts for JavaScript. In J. Boyland, editor, 29th European Conference on Object-Oriented Programming, ECOOP 2015, July 5-10, 2015, Prague, Czech Republic, volume 37 of LIPICS, pages 28–51, Prague, Czech Repulic, July 2015. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik. M. Keil and P. Thiemann. TreatJS: Higher-order contracts for JavaScript. Technical report, Institute for Computer Science, University of Freiburg, 2015. M. Keil and P. Thiemann. TreatJS Online. http://www2.informatik.uni-freiburg.de/ ~keilr/treatjs/, 2015. S. Maffeis and A. Taly. Language-based isolation of untrusted JavaScript. In Proceedings of the 22nd IEEE Computer Security Foundations Symposium, CSF 2009, Port Jefferson, New York, USA, July 8-10, 2009, pages 77–91. IEEE Computer Society, 2009. J. Magazinius, P. H. Phung, and D. Sands. Safe wrappers and sane policies for self protecting JavaScript. In T. Aura, editor, The 15th Nordic Conference in Secure IT Systems, Lecture Notes in Computer Science. Springer Verlag, Oct. 2010. L. A. Meyerovich and V. B. Livshits. ConScript: Specifying and enforcing fine-grained security policies for JavaScript in the browser. In IEEE Symposium on Security and Privacy, pages 481–496, Berkeley/Oakland, California, USA, May 2010. IEEE Computer Society. M. S. Miller. Robust Composition: Towards a Unified Approach to Access Control and Concurrency Control. PhD thesis, Johns Hopkins University, Baltimore, MD, USA, 2006. AAI3245526. M. S. Miller, M. Samuel, B. Laurie, I. Awad, and M. Stay. Caja: Safe active content in sanitized JavaScript. http://google-caja.googlecode.com, 2008. Google White Paper. M. S. Miller and J. S. Shapiro. Paradigm regained: Abstraction mechanisms for access control. In V. A. Saraswat, editor, Advances in Computing Science - ASIAN 2003 Programming Languages and Distributed Computation, 8th Asian Computing Science Conference, Mumbai, India, December 10-14, 2003, Proceedings, volume 2896 of Lecture Notes in Computer Science, pages 224–242. Springer, 2003. K. Patil, X. Dong, X. Li, Z. Liang, and X. Jiang. Towards fine-grained access control in JavaScript contexts. In 2011 International Conference on Distributed Computing Systems, ICDCS 2011, Minneapolis, Minnesota, USA, June 20-24, 2011, pages 720–729. IEEE Computer Society, 2011. P. H. Phung, D. Sands, and A. Chudnov. Lightweight self-protecting JavaScript. In W. Li, W. Susilo, U. K. Tupakula, R. Safavi-Naini, and V. Varadharajan, editors, ASIACCS, pages 47–60, Sydney, Australia, Mar. 2009. ACM. J. G. Politz, S. A. Eliopoulos, A. Guha, and S. Krishnamurthi. ADsafety: Type-based verification of JavaScript sandboxing. In 20th USENIX Security Symposium, San Francisco, CA, USA, August 8-12, 2011, Proceedings. USENIX Association, 2011. 17 18 Transaction-based Sandboxing for JavaScript 32 33 34 35 36 37 38 39 40 41 42 43 G. Richards, C. Hammer, F. Z. Nardelli, S. Jagannathan, and J. Vitek. Flexible access control for JavaScript. In A. L. Hosking, P. T. Eugster, and C. V. Lopes, editors, Proceedings of the 2013 ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages & Applications, OOPSLA 2013, part of SPLASH 2013, Indianapolis, IN, USA, October 26-31, 2013, pages 305–322. ACM, 2013. Same-origin policy. https://developer.mozilla.org/en-US/docs/Web/Security/ Same-origin_policy/, 2008. SecureEcmaScript (ses). https://code.google.com/p/es-lab/wiki/SecureEcmaScript, 2015. N. Shavit and D. Touitou. Software transactional memory. In Proceedings of the 14th ACM SIGPLAN Symposium on Principles of Distributed Computing, pages 204–213, Ottowa, Ontario, Canada, 1995. ACM Press, New York, NY, USA. Signed scripts in Mozilla. http://www-archive.mozilla.org/projects/security/ components/signed-scripts.html/, 2015. T. S. Strickland, S. Tobin-Hochstadt, R. B. Findler, and M. Flatt. Chaperones and impersonators: Run-time support for reasonable interposition. In G. T. Leavens and M. B. Dwyer, editors, OOPSLA, pages 943–962. ACM, 2012. J. Terrace, S. R. Beard, and N. P. K. Katta. JavaScript in JavaScript (js.js): Sandboxing third-party scripts. In E. M. Maximilien, editor, 3rd USENIX Conference on Web Application Development, WebApps’12, Boston, MA, USA, June 13, 2012, pages 95–100. USENIX Association, 2012. T. Van Cutsem and M. S. Miller. Proxies: Design principles for robust object-oriented intercession APIs. In W. D. Clinger, editor, DLS, pages 59–72. ACM, 2010. T. Van Cutsem and M. S. Miller. Trustworthy proxies - virtualizing objects with invariants. In G. Castagna, editor, ECOOP, volume 7920 of Lecture Notes in Computer Science, pages 154–178, Montpellier, France, July 2013. Springer. G. Wagner, A. Gal, C. Wimmer, B. Eich, and M. Franz. Compartmental memory management in a modern web browser. In H. Boehm and D. F. Bacon, editors, Proceedings of the 10th International Symposium on Memory Management, ISMM 2011, San Jose, CA, USA, June 04 - 05, 2011, pages 119–128. ACM, 2011. A. Warth, M. Stanojevic, and T. Millstein. Statically scoped object adaptation with expanders. In Proceedings of the 21th ACM SIGPLAN Conference on Object Oriented Programming, Systems, Languages, and Applications, pages 37–56, Portland, OR, USA, 2006. ACM Press, New York. G. Weikum and G. Vossen. Transactional information systems: theory, algorithms, and the practice of concurrency control and recovery. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 2001. M. Keil and P. Thiemann 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 <!DOCTYPE html> <html lang="en"> <head> <!−− third−party libraries −−> <script src="date.js"></script> <script src="jquery.js"></script> <script src="jquery.formatDateTime.js"></script> </head> <body> <!−− Body of the page −−> <h1 id="headline">Headline</h1> <script type="text/javascript"> window.$("#headline").text("Changed Headline"); </script> </body> </html> Figure 7 Motivating Example. The listing shows a snippet of an index.html file. The <script> tags load third-party libraries to the application state before executing the body. Within the <body> tag it uses jQuery to modify the DOM. A Motivation JavaScript is the most important client side language for web pages. JavaScript developers rely heavily on third-party libraries for calenders, maps, social networking, feature extensions, and so on. Thus, the client-side code of a web page is usually composed of dynamically loaded fragments from different origins. However, the JavaScript language has no provision for namespaces or encapsulation management: there is a global scope for variables and functions, and every loaded script has the same authority. On the one hand, JavaScript developers benefit from JavaScript’s flexibility as it enables to extend the application state easily. On the other hand, once included, a script has the ability to access and manipulate every value reachable from the global object. That makes it difficult to enforce any security policy in JavaScript. As a consequence, program understanding and maintenance becomes very difficult because side effects may cause unexpected behavior. There is also a number of security concerns as the library code may access sensitive data, for example, it may read user input from the browser’s DOM. Browsers normally provide build-in isolation mechanisms. However, as isolation is not always possible for all scrips, the key challenges of a JavaScript developer is to manage untrusted third-party code, to control the use of data by included scrips, and to reason about effects of included code. 19 20 Transaction-based Sandboxing for JavaScript 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 <!DOCTYPE html> <html lang="en"> <head> <!−− DecentJS code−−> <script src="decent.js"></script> <!−− Runs Datejs in a fresh sandbox. −−> <script type="text/javascript"> var sbx = new Sandbox(this, Sandbox.DEFAULT); sbx.request("datejs.js"); sbx.applyRule( new Rule.CommitOn(Date, function(sbx, effect) { return (effect instanceof Effect.Set) && !(effect.name in Date); })); </script> <!−− ... −−> </head> <body> <!−− ... −−> </body> </html> Figure 8 Execution of library code in a sandbox. The first <script> tag loads the sandbox implementation. The body of the second <script> tag instantiates a new sandbox and loads and executes Datejs inside the sandbox. Later it commits intended effects to the native Date object. A.1 JavaScript issues As an example, we consider a web application that relies on third-party scripts from various sources. Figure 7 shows an extract of such a page. It first includes Datejs 12 , a library extending JavaScript’s native Date object with additional methods for parsing, formatting, and processing of dates. Next, it loads jQuery 13 and a jQuery plugin jquery.formatDateTime.js 14 that also simplifies formatting of JavaScript date objects. At this point, we want to ensure that loading the third-party code (Datejs and jQuery) does not influence the application state in an unintended way. Encapsulating the library code in a sandbox enables us to scrutinize modifications that the foreign code may attempt and only commit acceptable modifications. A.2 Isolating third-party JavaScript Transactional sandboxing is inspired by the idea of transaction processing in database systems [43] and software transactional memory [35]. Each sandbox implements a transactional scope the content of which can be examined, committed, or rolled back. 1. Isolation of code. A DecentJS sandbox can run JavaScript code in isolation to the 12 https://github.com/datejs/Datejs https://jquery.com/ 14 https://github.com/agschwender/jquery.formatDateTime 13 M. Keil and P. Thiemann application state. Proxies make external values visible inside of the sandbox and handle sandbox internal write operations. An internal DOM simulates the browser DOM as needed. This setup guarantees that the isolated code runs without noticing the sandbox. 2. Providing transactional features. A DecentJS sandbox provides a transactional scope in which effects are logged for inspection. Policy rules can be specified so that only effects that adhere to the rules are committed to the application state and others are rolled back. Appendix 2 gives a detailed introduction to DecentJS’s API and provides a series of examples explaining its facilities. Figure 8 shows how to modify the index.html from Figure 7 to load the third-party code into a sandbox. We first focus on Datejs and consider jQuery later in Section A.4. The <!−− ... −−> comment is a placeholder for unmodified code not considered in this example15 . Initially, we create a fresh sandbox (line 24). The first parameter is the sandboxinternal global object for scripts running in the sandbox whereas the second parameter is a configuration object16 . The sandbox global object acts as a mediator between the sandbox contents and the external world (cf. Section 3.3). It is placed on top of the scope chain for code executing inside the sandbox and it can be used to make outside values available inside the sandbox. It is wrapped in a proxy membrane to mediate all accesses to the host program. Next, we instruct the sandbox to load and execute the Datejs library (line 25) inside the sandbox. Afterwards, the sandbox-internal proxy for JavaScript’s native Date object is modified in several ways. Among others, the library adds new methods to the Date object and extends Date.prototype with additional properties. Write operations on a proxy wrapper produce a shadow value (cf. Section 3.2) that represents the sandbox-internal modification of an object. Initially, this modification is only visible to reads inside the sandbox. Reads are forwarded to the target unless there are local modifications, in which case the shadow value is returned. The return values are wrapped in proxies, again. A.3 Committing intended modifications During execution, each sandbox records the effects on all objects that cross the sandbox membrane17 . The sandbox API offers access to the resulting lists for inspection and provides query methods to select the effects of a particular object. After loading Datejs, the effect log reports 16 reads and 142 writes on three different objects18 . However, as the manual inspection of effects is impractical and requires a lot of effort, DecentJS allows us to register rules with a sandbox and apply them automatically. A rule combines a sandbox operation with a predicate specifying the state under which the operation is allowed to be performed. For example, as we consider an extension to the Date object as intended, non-critical modification, we install a rule that automatically commits new properties to the Date object in Line 26. In general, a rule CommitOn takes a target object (Date) and a predicate. The predicate function gets invoked with the sandbox object (sbx) and an effect object describing an effect on the target object. In our example, the predicate checks if the effect is a property 15 Appendix A.6 shows the full HTML code. Sandbox.DEFAULT is a predefined configuration object for the standard use of the sandbox. It consists of simple key-value pairs, e.g. verbose:false. 17 The lists do not contain effects on values that were created inside of the sandbox. 18 Appendix A.7 shows a readout of the effect lists. 16 21 22 Transaction-based Sandboxing for JavaScript write operation extending JavaScript’s native Date object and that the property name is not already present. If we construct a function inside of a sandbox and this function is written and committed to an outside object, then the free variables of the function contain objects inside the sandbox and arguments of a call to this function are also wrapped. That is, calling this function on the outside only causes effects inside the sandbox. Furthermore, committing an object in this way wraps the object in a proxy before writing it to its (outside) target. Both measures are required to guarantee that the sandbox never gets access to unwrapped references from the outside world. At this point we have to mention that the data structure of the committed functions is constructed inside of sbx. All bound references of those functions still point to objects inside of the sandbox and thus using them only causes effect inside of the sandbox. Furthermore, committing an object wraps the object in a proxy before writing it to its target. This intercepts the use of the committed object, e.g. to wrap the arguments of a committed function before invoking the function. This is As an illustration, Figure 9 shows an extract of the membrane arising from JavaScript’s native Date object in Appendix ??. Executing Datejs in sbx (shown on the left in the first box) creates a proxy for each element accessed on Date: Date and Date.prototype. Only Date and Date.prototype are wrapped because proxies are created on demand. As proxies forward each read to the target the structure visible inside of the sandbox is identical to the structure visible outside. Extending the native Date object in sbx yields the state shown in the second box. All modifications are only visible inside of the sandbox. The new elements are not wrapped because they only exist inside of the sandbox. However, a special proxy wraps sandbox internal values whenever committing a value to the outside, as shown in the last box. This step mediates further uses of the sandbox internal value, for example, wrapping the this value and all arguments when calling a function defined in the sandbox. The wrapping guarantees that the sandbox never gets access to unprotected references to the outside. A.4 Shadowing DOM operations The example in Figure 8 omits the inclusion of jQuery for simplification purposes. However, our initial objective is to sandbox all third-party code to i reason about the modifications done by loading the third-party code ii prevent the application state from unintended modifications . Isolating a library like jQuery is more challenging as it needs access to the browser’s DOM. Calls to the native DOM interface expose a mixture of public and confidential information, so the access can neither be fully trusted nor completely forbidden. To address this issue, DecentJS provides an internal DOM 19 that serves as a shadow for the actual DOM when running a web library in the sandbox. Figure 10 demonstrates loading the jQuery library in a web sandbox. As we extend the first example, we create a new empty sandbox (line 46) and initialize the sandbox internal DOM by loading an HTML template (line 47). Using the Sandbox.WEB configuration activates the shadow DOM by instructing the sandbox to create a DOM interface and to merge this interface with the sandbox-internal global object. The shadow DOM initially 19 See Section 3.5 for a more detailed discussion. M. Keil and P. Thiemann contains an empty document. It can be instantiated with the actual HTML body or with an HTML template, as shown in Line 47. Figure 11 shows the template, which is an extract of the original index.html containing only the <script> tags for the jQuery library and selected parts of the HTML body. Loading the template also loads and executes the third-party code inside the sandbox. Afterwards, the internal effect log reports two write operations to the fields $ and jQuery of the global window object, and one write operation to the HTMLBodyElement interface, a child of Node, both of which are part of the DOM interface. To automatically commit intended modifications to the global window object, we install a suitable rule in Lines 48 and 49. As jQuery has been instantiated w.r.t. the sandbox internal DOM, using it modifies the sandbox internal DOM instead of the browser’s DOM. These modifications must be committed to the browser’s DOM to become visible (line 57). Alternatively, DecentJS allows us to grant access to the browser’s DOM by white listing the window and document objects. However, white listing can only expose entire objects and cannot restrict access to certain parts of the document model. A.5 Using transactions For wrapped objects, DecentJS supports a commit/rollback mechanism. In the first examples (Figure 8), we prevent the application state from unintended modification when loading untrusted code and commit only intended ones. However, Datejs and jquery.formatDateTime.js might both modify JavaScript’s native Date object. To avoid undesired overwrites, DecentJS allows us to inspect the effects of both libraries and to check for conflicts before committing to Date. The predicate in Line 81 checks for conflicts, which arise in the comparison between different sandboxes. A conflict is flagged if at least one sandbox modifies a value that is accessed by the other sandbox later on20 . Furthermore, we prescribe that in case of conflicts the methods from Datejs should be used. To this end, a second rule discards the modifications on Date from the second sandbox when detecting conflicts. The rollback operation undoes an existing manipulation and returns to its previous configuration. Such a partial rollback does not result in an inconsistent state as we do not delete objects and the references inside the sandbox remain unchanged. A.6 Full HTML Example Figure 13 shows the full html code from the example in Section A. A.7 Effects Lists This sections shows the resulting effect logs recorded by the sandboxes in Section A. See Appendix ?? for a detailed explanation of the output. A.8 A.8.1 20 Effects of sbx All Read Effects on this We consider only Read-After-Write and Write-After-Write conflicts. Write-after-Read conflicts are not handled because the hazard represents a problem that only occurs in concurrent executions. 23 24 Transaction-based Sandboxing for JavaScript 131 132 133 134 135 136 137 138 139 140 141 sbx.readeffectOn(this).forEach(function(e) { print(e); }); (#0) (#0) (#0) (#0) (#0) (#0) (#0) (#0) has [name=Date] get [name=Date] has [name=Number] get [name=Number] has [name=RegExp] get [name=RegExp] has [name=Array] get [name=Array] A.8.2 142 143 144 145 sbx.writeeffectOn(this).forEach(function(e) { print(e); }); none A.8.3 146 147 148 149 150 151 152 153 154 156 157 158 159 160 161 162 163 164 165 166 167 168 All Read Effects on Date sbx.readeffectOn(Date).forEach(function(e) { print(e); }); (#1) (#1) (#1) (#1) (#1) (#1) get get get get get get A.8.4 155 All Write Effects on this [name=prototype] [name=Parsing] [name=Grammar] [name=Translator] [name=CultureInfo] [name=parse] All Write Effects on Date sbx.writeeffectOn(Date).forEach(function(e) { print(e); }); (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) set set set set set set set set set set set [name=CultureInfo] [name=getMonthNumberFromName] [name=getDayNumberFromName] [name=isLeapYear] [name=getDaysInMonth] [name=getTimezoneOffset] [name=getTimezoneAbbreviation] [name=_validate] [name=validateMillisecond] [name=validateSecond] [name=validateMinute] M. Keil and P. Thiemann 169 170 171 172 173 174 175 176 177 178 179 180 181 (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) set set set set set set set set set set set set set A.8.5 182 183 184 185 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 All Read Effects on Date.prototype sbx.readeffectOn(Date.prototype).forEach(function(e) { print(e); }); (#2) get [name=toString] A.8.6 186 [name=validateHour] [name=validateDay] [name=validateMonth] [name=validateYear] [name=now] [name=today] [name=Parsing] [name=Grammar] [name=Translator] [name=_parse] [name=parse] [name=getParseFunction] [name=parseExact] All Write Effects on Date.prototype sbx.writeeffectOn(Date.prototype).forEach(function(e) { print(e); }); (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) set set set set set set set set set set set set set set set set set set set set set set [name=clone] [name=compareTo] [name=equals] [name=between] [name=addMilliseconds] [name=addSeconds] [name=addMinutes] [name=addHours] [name=addDays] [name=addWeeks] [name=addMonths] [name=addYears] [name=add] [name=set] [name=clearTime] [name=isLeapYear] [name=isWeekday] [name=getDaysInMonth] [name=moveToFirstDayOfMonth] [name=moveToLastDayOfMonth] [name=moveToDayOfWeek] [name=moveToMonth] 25 26 Transaction-based Sandboxing for JavaScript 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set set [name=getDayOfYear] [name=getWeekOfYear] [name=isDST] [name=getTimezone] [name=setTimezoneOffset] [name=setTimezone] [name=getUTCOffset] [name=getDayName] [name=getMonthName] [name=_toString] [name=toString] [name=_orient] [name=next] [name=previous] [name=prev] [name=last] [name=_is] [name=is] [name=sun] [name=sunday] [name=mon] [name=monday] [name=tue] [name=tuesday] [name=wed] [name=wednesday] [name=thu] [name=thursday] [name=fri] [name=friday] [name=sat] [name=saturday] [name=jan] [name=january] [name=feb] [name=february] [name=mar] [name=march] [name=apr] [name=april] [name=may] [name=jun] [name=june] [name=jul] [name=july] [name=aug] [name=august] [name=sep] M. Keil and P. Thiemann 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) (#2) set set set set set set set set set set set set set set set set set set set set set set set set set set set set set A.9 Effects of sbx2 A.9.1 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 [name=september] [name=oct] [name=october] [name=nov] [name=november] [name=dec] [name=december] [name=milliseconds] [name=millisecond] [name=seconds] [name=second] [name=minutes] [name=minute] [name=hours] [name=hour] [name=days] [name=day] [name=weeks] [name=week] [name=months] [name=month] [name=years] [name=year] [name=toJSONString] [name=toShortDateString] [name=toLongDateString] [name=toShortTimeString] [name=toLongTimeString] [name=getOrdinal] All Read Effects on this sbx2.readeffectOn(this).forEach(function(e) { print(e); }); (#0) (#0) (#0) (#0) (#0) (#0) (#0) (#0) (#0) (#0) (#0) (#0) has [name=window] get [name=window] has [name=module] get [name=module] has [name=Math] get [name=Math] has [name=Array] get [name=Array] has [name=Date] get [name=Date] has [name=undefined] get [name=undefined] 27 28 Transaction-based Sandboxing for JavaScript 303 304 305 306 307 308 309 310 (#0) (#0) (#0) (#0) (#0) (#0) (#0) (#0) has [name=Symbol] get [name=Symbol] has [name=RegExp] get [name=RegExp] has [name=String] get [name=String] has [name=define] get [name=define] A.9.2 311 312 313 314 sbxs.writeeffectOn(this).forEach(function(e) { print(e); }); none A.9.3 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 338 339 340 341 All Read Effects on window sbx2.readeffectOn(window).forEach(function(e) { print(e); }); (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) (#1) get [name=window] getOwnPropertyDescriptor [name=window] getOwnPropertyDescriptor [name=module] get [name=document] getOwnPropertyDescriptor [name=Math] getOwnPropertyDescriptor [name=Array] getOwnPropertyDescriptor [name=Date] getOwnPropertyDescriptor [name=undefined] getOwnPropertyDescriptor [name=Symbol] getOwnPropertyDescriptor [name=RegExp] get [name=top] get [name=setTimeout] has [name=onfocusin] get [name=location] getOwnPropertyDescriptor [name=String] get [name=XMLHttpRequest] getOwnPropertyDescriptor [name=define] get [name=jQuery] get [name=$] A.9.4 337 All Write Effects on this All Write Effects on window sbx.writeeffectOn(window).forEach(function(e) { print(e); }); (#1) set [name=$] (#1) set [name=jQuery] M. Keil and P. Thiemann 29 Date ··· now() Date prototype toString() ··· Date ··· now() prototype ··· Date now() prototype toString() isWeekday() Date toString() ··· now() now() prototype toString() isWeekday() Date prototype toString() ··· now() prototype toString() isWeekday() Figure 9 Shadow objects in the sandbox when loading Datejs (cf. Section ??). The structure of JavaScrip’s native Date object is shown in solid lines on the left. The shadow values are enclosed by a dashed line. Solid lines are direct references to non-proxy objects, whereas dashed lines are indirect references and proxy objects. Dotted lines connect to the target object. The first box shows the sandbox after reading Date.prototype whereas the second box shows the sandbox after modifying the structure of Date. The third box shows the situation after committing the modifications on Date. 30 Transaction-based Sandboxing for JavaScript 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 <!DOCTYPE html> <html lang="en"> <head> <!−− DecentJS code−−> <script src="decent.js"></script> <!−− ... −−> <!−− Runs jQuery in a fresh sandbox. −−> <script type="text/javascript"> var sbx2 = new Sandbox(this, Sandbox.WEB); sbx2.initialize("template.html"); sbx2.applyRule(new Rule.Commit(this, "jQuery")); sbx2.applyRule(new Rule.Commit(this, "$")); </script> </head> <body> <!−− Body of the page −−> <h1 id="headline">Headline</h1> <script type="text/javascript"> window.$("#headline").text("Changed Headline"); document.getElementById("headline").innerHTML=sbx2.dom.document. getElementById("headline").innerHTML; </script> </body> </html> Figure 10 Execution of a web library in a sandbox. The first <script> tag loads the sandbox implementation. The body of the second <script> tag instantiates a new sandbox and initializes the sandbox with a predefined HTML template (see Figure 11). Later it commits intended effects to the application state and copies data from the sandbox internal DOM. 61 62 63 64 65 66 67 68 69 70 71 <!DOCTYPE html> <html lang="en"> <head> <script src="jquery.js"></script> <script src="jquery.formatDateTime.js"></script> </head> <body> <!−− Body of the page −−> <h1 id="headline">Headline</h1> </body> </html> Figure 11 File template.html contains the <script> tags for loading the jQuery code from index.html in Figure 7. M. Keil and P. Thiemann 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 <!DOCTYPE html> <html lang="en"> <head> <!−− ... −−> <!−− Checks for conflicts with Datejs −−> <script type="text/javascript"> sbx2.applyRule( new Rule.Commit(Date, function(sbx, effect) { return !sbx.inConflictWith(sbx2, Date); }); sbx2.applyRule( new Rule.RollbackOn(Date, function(sbx, effect) { return sbx.inConflictWith(sbx2, Date); }); </script> </head> <body"> <!−− ... −−> </body> </html> Figure 12 Checking for conflicts. The HTML code first checks for conflicts between Datejs and jQuery before it commits the modification of the library or rolls back. 31 32 Transaction-based Sandboxing for JavaScript 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 <!DOCTYPE html> <html lang="en"> <head> <!−− DecentJS code−−> <script src="decent.js"></script> <!−− Runs Datejs in a fresh sandbox. −−> <script type="text/javascript"> var sbx = new Sandbox(this, Sandbox.DEFAULT); sbx.request("datejs.js"); sbx.applyRule(new Rule.CommitOn(Date, function(sbx, effect) { return (effect instanceof Effect.Set) && !(effect.name in Date); })); </script> <!−− Runs jQuery in a fresh sandbox. −−> <script type="text/javascript"> var sbx2 = new Sandbox(this, Sandbox.WEB); sbx2.initialize("template.html"); sbx2.applyRule(new Rule.Commit(this, "jQuery")); sbx2.applyRule(new Rule.Commit(this, "$")); </script> <!−− Checks for conflicts with Datejs −−> <script type="text/javascript"> sbx2.applyRule(new Rule.Commit(Date, function(sbx, effect) { return !sbx.inConflictWith(sbx2, Date); }); sbx2.applyRule(new Rule.RollbackOn(Date, function(sbx, effect) { return sbx.inConflictWith(sbx2, Date); }); </script> </head> <body> <!−− Body of the page −−> <h1 id="headline">Headline</h1> <script type="text/javascript"> window.$("#headline").text("Changed Headline"); document.getElementById("headline").innerHTML=sbx2.dom.document. getElementById("headline").innerHTML; </script> </body> </html> Figure 13 Execution of library code in a sandbox (cf. Section A in the paper). The first <script> tag loads the sandbox implementation. The second <script> tag instantiates a new sandbox sbx and loads and executes Datejs inside the sandbox. Later it commits intended effects to the native Date object. The third <script> tag instantiates sandbox sbx2 and initializes the sandbox with a predefined HTML template (see Figure 11 in the paper). Later it commits intended modifications to the application state. The last <script> tag checks for conflicts between Datejs and jQuery before it commits further modification on Date or rolls back. The <script> tag included in the body performs a modification of the sandbox internal DOM and copies the changes to the global DOM, M. Keil and P. Thiemann B Application Scenarios This section considers some example scenarios that use the implemented system. All examples are drawn from other projects and use this work’s sandboxing mechanism to guarantee noninterference. B.1 TreatJS TreatJS [20] is a higher-order contract system for JavaScript which enforces contracts by run-time monitoring. TreatJS is implemented as a library so that all aspects of a contract can be specified using the full JavaScript language. For example, the base contract typeNumber checks its argument to be a number. 1 2 3 var typeNumber = Contract.Base(function (arg) { return (typeof arg) === ’number’; }); Asserting a base contracts to a value causes the predicate to be checked by applying the predicate to the value. In JavaScript, any function can be used as any return value can be converted to boolean21 . 4 Contract.assert(1, typeNumber); // accepted TreatJS relies on the sandbox presented in this work to guarantee that the execution of contract code does not interfere with the contract abiding execution of the host program. As read-only access to objects and functions is safe and useful in many contracts, TreatJS facilitates making external references visible inside of the sandbox. For example, the isArray contract below references the global object Array. 5 6 7 var isArray = Contract.With({Array:Array}, Contract.Base(function (arg) { return (arg instanceof Array); })); However, TreatJS forbids all write accesses and traps the unintended write to the global variable type in the following code. 8 9 10 11 var typeNumberBroken = Contract.Base(function(arg) { type = (typeof arg); return type === ’number’; }); B.2 TreatJS Online TreatJS-Online22 [22] is a web frontend for experimentation with the TreatJS contract system [20]. It enables the user to enter code fragments that run in combination with the TreatJS code. All aspects of TreatJS are accessible to the user code. However, the user code should neither be able to compromise the contract system nor the website’s functioning by writing to the browser’s document or window objects. Without any precaution, a code snippet like 21 22 JavaScript programmers speak of truthy or falsy about values that convert to true or false. http://www2.informatik.uni-freiburg.de/~keilr/treatjs/ 33 34 Transaction-based Sandboxing for JavaScript function Observer(target, handler) { var sbx = new Sandbox({}, {/∗ parameters omitted ∗/}); var controller = { get: function(target, name, receiver) { var trap = handler.get; var result = trap && sbx.call(trap, target, name, receiver); var raw = target[name]; return observerOf(raw, result) ? result : raw; }}; return new Proxy(target, controller); } 1 2 3 4 5 6 7 8 9 10 11 Figure 14 Implementation of an observer proxy (excerpt). The get trap evaluates the user specific trap in a sandbox to guarantee noninterference. Afterwards it performs the usual operation and compares the outcomes of both executions. Other traps can be implemented in the same way. 1 2 3 Contract.assert = function(arg) { return arg; } could change the Contract objects to influence subsequent executions, To avoid these issues, the website creates a fresh sandbox environment, builds a function closure with the user’s input, and executes the user code in the sandbox. The sandbox grants read-only access to the TreatJS API and to JavaScript’s built-in objects like Object, Function, Array, and so on, but it does not provide access to browser objects like document and window. Further, each new invocation reverts the sandbox to its initial state. B.3 Observer Proxies An observer proxy23 is a restricted version of a JavaScript proxy that cannot change the behavior of the proxy’s target arbitrarily. It implements a projection in that it either implements the same behavior as the target object or it raises an exception. A similar feature is provided by Racket’s chaperones [37]. Such an observer can cause a program to fail more often, but in case it does not fail it would behave in the same way as if not observer were present. Figure 14 contains the getter part of the JavaScript implementation of Observer, the constructor of an observer proxy. It accepts the same arguments as the constructor of a normal proxy object. It returns a proxy, but interposes a different handler, controller, that wraps the execution of all user provided traps in a sandbox. The controller’s get trap evaluates the user’s get trap (if one exists) in a sandbox. Next, it performs a normal property access on the target value to produce the same side effects and to obtain a baseline value to compare the results. observerOf checks whether the sandboxed result is suitably related to the baseline value. 23 This observer proxy in this Subsection should not be confused with the observer proxy mention in the paper. The observer mentions in Section 3.5 is a normal proxy implementing a membrane. M. Keil and P. Thiemann 35 Constant 3c Variable 3 x, y Expression 3 e, f, g ::= c | x | op(e, f ) | λx.e | e(f ) | new e | e[f ] | e[f ] = g Figure 15 Syntax of λJ . Value 3 u, v, w ::= c | l Closure Dictionary Object 3f 3d 3o ::= − | (ρ, λx.e) ::= ∅ | d[c 7→ v] ::= (d, f, v) Environment 3 ρ Store 3σ ::= ∅ | ρ[x 7→ v] ::= ∅ | σ[l 7→ o] Figure 16 Semantic domains of λJ . C Semantics of Sandboxing This section first introduces λJ , an untyped call-by-value lambda calculus with objects and object proxies that serves as a core calculus for JavaScript, inspired by previous work [13, 21]. It defines its syntax and describes its semantics informally. Later on we extends λJ to a new calculus λSBX , which adds a sandbox to the core calculus. J C.1 Core Syntax of λJ Figure 15 defines the syntax of λJ . A λJ expression is either a constant, a variable, an operation on primitive values, a lambds abstraction, an application, a creation of an empty object, a property read, or a property assignment. Variables x, y are drawn from denumerable sets of symbols and constants c include JavaScript’s primitive values like numbers, strings, booleans, as well as undefined and null. The syntax do not make proxies available to the user, but offers an internal method to wrap objects. Sandbox 3S ::= Λx.e Expression 3 e, f, g ::= · · · | S | fresh e Term 3t ::= · · · | fresh S | wrap(v) Object Values 3o ::= · · · | (l, b l, ρb) 3 u, v, w ::= · · · | (b ρ, S) Figure 17 Extensions of λSBX . J 36 Transaction-based Sandboxing for JavaScript Term 3 t ::= e | op(v, f ) | op(v, w) | l(f ) | l(v) | new v | l[f ] | l[c] | l[f ] = g | l[c] = g | l[c] = w Figure 18 Intermediate terms of λJ . C.2 Semantic Domains Figure 16 defines the semantic domains of λJ . Its main component is a store that maps a location l to an object o, which is a native object (non-proxy object) represented by a triple consisting of a dictionary d, a potential function closure f , and a value v acting as prototype. A dictionary d models the properties of an object. It maps a constant c to a value v. An object may be a function in which case its closure consists of a lambda expression λx.e and an environment ρ that binds the free variables. It maps a variable x to a value v. A non-function object is indicated by − in this place. A value v is either a constant c or a location l. C.3 Evaluation of λJ A pretty-big-step semantics [4] introduces intermediate terms to model partially evaluated expressions (Figure 18). An intermediate term is thus an expression where zero or more top-level subexpressions are replaced by their outcomes. The evaluation judgment is similar to a standard big-step evaluation judgment except that its input ranges over intermediate terms: It states that evaluation of term t with initial store σ, and environment ρ results in a final store σ 0 and value v. ρ ` hσ, ti ⇓ hσ 0 , vi Figure 19 defines the standard evaluation rules for expressions e in λJ . The inference rules for expressions e are mostly standard. Each rule for a composite expression evaluates exactly one subexpression and then recursively invokes the evaluation judgment to continue. Once all subexpressions are evaluated, the respective rule performs the desired operation. C.4 Sandboxing of λJ This section extends the base calculus λJ to a calculus λSBX which adds sandboxing of J function expressions. The calculus describes only the core features that illustrates the principles of our sandbox. Further features of the application level can be implemented in top of the calculus. Figure 17 defines the syntax and semantics of λSBX as an extension of λJ . Expressions J now contain a sandbox abstraction S and a sandbox construction fresh e that instantiates a fresh sandbox. Terms are extended with a fresh S term. A new internal wrap(v) term, which did not occour in source programs, wraps a value in a sandbox environment. Objects now contain object proxies. A proxy object is a single location controlled by a proxy handler that mediates the access to the target location. For simplification, we represent handler objects by there meta-data. So, each handler is an sandbox handler that enforces write-protection (viz. by an secure location b l that acts as an shadow object for the proxies target object l and a single secure environment ρb). M. Keil and P. Thiemann 37 Op-E Const Var ρ ` σ, c ⇓ σ, c ρ ` σ, x ⇓ σ, ρ(x) ρ ` σ, e ⇓ σ 0 , v ρ ` σ 0 , op(v, f ) ⇓ σ 00 , w ρ ` σ, op(e, f ) ⇓ σ 00 , w Op-F ρ ` σ, f ⇓ σ 0 , u ρ ` σ 0 , op(v, u) ⇓ σ 00 , w Op ρ ` σ, op(v, f ) ⇓ σ , w ρ ` σ, op(v, u) ⇓ σ, w 00 w = op(v, u) App-E Abs l∈ / dom(σ) ρ ` σ, e ⇓ σ 0 , l ρ ` σ 0 , l(f ) ⇓ σ 00 , w σ = σ[l 7→ (∅, (ρ, λx.e), null)] 0 ρ ` σ, λx.e ⇓ σ 0 , l ρ ` σ, e(f ) ⇓ σ 00 , w App-F ρ ` σ, f ⇓ σ 0 , v ρ ` σ 0 , l(v) ⇓ σ 00 , w App (d, (ρ0 , λx.e), u) = σ(l) ρ ` σ, l(f ) ⇓ σ 00 , w ρ0 [x 7→ v] ` σ, e ⇓ σ 0 , w ρ ` σ, l(v) ⇓ σ 0 , w New-E ρ ` σ, e ⇓ σ 0 , v ρ ` σ 0 , new v ⇓ σ 00 , w Get-E New l∈ / dom(σ) ρ ` σ, new e ⇓ σ , w 0 σ = σ[l 7→ (∅, −, v)] ρ ` σ, new v ⇓ σ 0 , l 00 Get-F ρ ` σ, f ⇓ σ 0 , c ρ ` σ 0 , l[c] ⇓ σ 00 , w ρ ` σ, e[f ] ⇓ σ 00 , w Get-Proto Get (d, f, v) = σ(l) 00 ρ ` σ, l[f ] ⇓ σ , w c ∈ dom(d) (d, f, l0 ) = σ(l) c∈ / dom(d) ρ ` σ, l0 [c] ⇓ σ, v ρ ` σ, l[c] ⇓ σ, d(c) ρ ` σ, l[c] ⇓ σ, v Put-E Get-Undef 0 (d, f, c ) = σ(l) ρ ` σ, e ⇓ σ 0 , l ρ ` σ 0 , l[f ] ⇓ σ 00 , w c∈ / dom(d) ρ ` σ, l[c] ⇓ σ, undefined ρ ` σ, e ⇓ σ 0 , l ρ ` σ 0 , l[f ] = g ⇓ σ 00 , w ρ ` σ, e[f ] = g ⇓ σ 00 , w Put-F ρ ` σ, f ⇓ σ 0 , c ρ ` σ 0 , l[c] = g ⇓ σ 00 , w ρ ` σ, l[f ] = g ⇓ σ 00 , w Put-G ρ ` σ, g ⇓ σ 0 , v ρ ` σ 0 , l[c] = v ⇓ σ 00 , w ρ ` σ, l[c] = g ⇓ σ 00 , w Put (d, f, u) = σ(l) σ 0 = σ[l 7→ (d[c 7→ v], f, u)] ρ ` σ, l[c] = v ⇓ σ 0 , v Figure 19 Inference rules for intermediate terms of λJ . 38 Transaction-based Sandboxing for JavaScript Sandbox-Fresh-E ρ ` σ, e ⇓ σ 0 , Λx.f ρ ` σ 0 , fresh Λx.f ⇓ σ 00 , v ρ ` σ, fresh e ⇓ σ , v 00 Sandbox-Fresh ∅ ` σ, Λx.e ⇓ σ, (b ρ, Λx.e) ρ ` σ, fresh Λx.e ⇓ σ, (b ρ, Λx.e) Sandbox-Application Sandbox-Abstraction ρb ` σ, Λx.e ⇓ σ, (b ρ, Λx.e) ρb ` σ, wrap(v) ⇓ σ 0 , vb ρb[x 7→ vb] ` σ 0 , e ⇓ σ 00 , w b ρ ` σ, (b ρ, Λx.e)(v) ⇓ σ 00 , w b Figure 20 Sandbox abstraction and application rules of λSBX . J For clarity, we write vb, u b, w b for wrapped values that are imported into a sandbox, ρb for a sandbox environment that only contains wrapped values, and b l for locations of proxies and shadow objects. Consequently, values are extended with sandboxes which represents an sandbox expression wrapped in a sandbox environment that is to be executed when the value is used in an application. C.4.1 Evaluation of λSBX J Figure 20 contains its inference rules for sandbox abstraction and sandbox application of λSBX . The formalization employs pretty-big-step semantics [4] to model side effects while J keeping the number of evaluation rules manageable. The rule for expression fresh e (Rule Sandbox-Fresh-E) evaluates the subexpression and invokes the evaluation judgment to continue. The other rules show the last step in a pretty big step evaluation. Once all subexpressions are evaluated, the respective rule performs the desired operation. Sandbox execution happens in the context of a secure sandbox environment to preserve noninterference. So a sandbox definition (abstraction) will evaluate to a sandbox closure containing the sandbox expression (the abstraction) together with an empty environment (Rule Sandbox-Fresh). Each sandbox executions starts from a fresh environment. This guarantees that not unwrapped values are reachable by the sandbox. Sandbox abstraction (Rule Sandbox-Abstraction) proceeds only on secure environments, which is either an empty set or an environment that contains only secure (wrapped) values. Sandbox execution (Rule Sandbox-Application) applies after the first expression evaluates to a sandbox closure and the second expression evaluates to a value. It wraps the given value and triggers the evaluation of expressions e in the sandbox environment ρb after binding the wrapped value vb. Value vb acts as the global object of the sandbox. It can be used to make values visible inside ob the sandbox. C.4.2 Sandbox Encapsulation The sandbox encapsulation (Figure 21) distinguishes several cases. A primitive value and a sandbox closure is not wrapped. To wrap a location that points to a non-proxy object, the location is packed in a fresh proxy along with a fresh shadow object and the current sandbox environment. This packaging ensures that each further access to the wrapped location has to use the current environment. M. Keil and P. Thiemann 39 Wrap-Const Wrap-Sandbox ρb ` σ, wrap(c) ⇓ σ, c ρb ` σ, wrap((b ρ0 , S)) ⇓ σ, (b ρ0 , S) Wrap-NonProxyObject 6 ∃l0 ∈ dom(σ) : (l, b l, ρb) = σ(l0 ) ρb ` σ, compile(l) ⇓ σ 0 , b l 0 b l 6∈ dom(σ 0 ) σ 00 = σ 0 [b l0 7→ (l, b l, ρb)] 00 b0 ρb ` σ, wrap(l) ⇓ σ , l Wrap-Existing ρb ` σ[b l 7→ (l, b l0 , ρb)], wrap(l) ⇓ σ, b l Wrap-ProxyObject ρb ` σ[b l 7→ (l, b l0 , ρb)], wrap(b l) ⇓ σ, b l Figure 21 Inference rules for sandbox encapsulation. Recompile-FunctionObject Recompile-NonFunctionObject l 7→ (∅, −, null)] σ = σ[b ρb ` σ[l 7→ (d, −, v)], compile(l) ⇓ σ, b l b l 6∈ dom(σ) 0 6 ∃b l ∈ dom(σ) : (d, (b ρ, λx.e), v) = σ(b l) 0 b b l 6∈ dom(σ) σ = σ[l 7→ (∅, (b ρ, λx.e), null)] ρb ` σ[l 7→ (d, (ρ, λx.e), v)], compile(l) ⇓ σ, b l Recompile-Existing ρb ` σ[b l 7→ (d, (b ρ, λx.e), v)], compile(b l) ⇓ σ, b l Recompile-ProxyObject ρb ` σ[l 7→ (l0 , b l, ρb)], compile(l0 ) ⇓ σ, b l 0 b ρb ` σ[l 7→ (l , l, ρb)], compile(l) ⇓ σ, b l Figure 22 Inference rules for object re-compilation. In case the location is already wrapped by a sandbox proxy or the location of a sandbox proxy gets wrapped then the location to the existing proxy is returned. This rule ensures that an object is wrapped at most once and thus preserves object identity inside the sandbox. The shadow object is build from recompiling (Figure 22) the target object. A shadow objects is a new empty object that may carry a sandboxed replication of its closure part. For a non-function object, recompiling returns an empty object that later on acts as a sink for property assignments on the wrapped objects. For a function object, recompiling extracts the function body from the closure and redefines the body with respect to the current sandbox environment. The new closure is put into a new empty object. This step erases all external bindings of function closure and ensures that the application of a wrapped function happens in the context of the secure sandbox environment. In case the function is already recompiled, function recompilation returns the existing replication. C.4.3 Application, Read, and Assignment Function application, property read, and property assignment distinguish two cases: either the operation applies directly to a non-proxy object or it applies to a proxy. If the target of the operation is not a proxy object, then the usual rules apply. Figure 23 contains the inference rules for function application and property access for the 40 Transaction-based Sandboxing for JavaScript App-Sandbox ρb ` σ, wrap(v) ⇓ σ 0 , vb ρ ` σ0 , b l(b v ) ⇓ σ 00 , w b 0 b ρ ` σ[l 7→ (l , l, ρb)], l(v) ⇓ σ 00 , w b Get-Shadow c ∈ dom(b l) ρ ` σ[l 7→ (l0 , b l, ρb)], b l[c] ⇓ σ 0 , vb ρ ` σ[l 7→ (l0 , b l, ρb)], l[c] ⇓ σ 0 , vb Get-Sandbox c 6∈ dom(b l) ρ ` σ[l 7→ (l0 , b l, ρb)], l0 [c] ⇓ σ 0 , v 0 ρb ` σ , wrap(v) ⇓ σ 00 , vb ρ ` σ[l 7→ (l0 , b l, ρb)], l[c] ⇓ σ 00 , vb Put-Sandbox ρ ` σ[l 7→ (l0 , b l, ρb)], b l[c] = v ⇓ σ 0 , v ρ ` σ[l 7→ (l0 , b l, ρb)], l[c] = v ⇓ σ 0 , v Figure 23 Inference rules for function application, property read, and property assignment. non-standard cases. The application of a wrapped function proceeds by unwrapping the function and evaluating it in the sandbox environment contained in the proxy. The function argument and its result are known to be wrapped in this case. A property read on a wrapped object has two cases depending on if the accessed property has been written in the sandbox before, or not. The notation c ∈ dom(l) is defined as an shortcut of a dictionary lookup c ∈ dom(d) with σ(l) = (d, f, v). A property read of an affected field reads the property from the shadow location. Otherwise, it continues the operation on the target and wraps the resulting value. An assignment to a wrapped object is continues with the operation on the shadow location b l. In JavaScript, write operations do only change properties of the object’s dictionary. They do not affect the object’s prototype. Therefor, the shadow object did not contain any prototype informations. It acts only a shadow that absorbs write operations. M. Keil and P. Thiemann D 41 Technical Results As JavaScript is a memory safe programming language, a reference can be seen as the right ti modify the underlying object. If an expressions body can be shown not to contain unprotected references to objects, then it cannot modify this data. To prove soundness of our sandbox we show termination insensitive noninterference. It requires to show that the initial store σ of a sandbox application is observational equivalent to the final store σ 0 , that remains after the application. In detail, the sandbox application may introduce new objects or even write to shadow objects (only reachable inside of the sandbox) but every value reachable from the outside remains unmodified. As the calculus in Appendix C did not support variable updates on environments ρ the only way to make changes persistent is to modify objects. Thus, proving noninterference relates different stores and looks for differences in the store with respect to all reachable values. D.1 Observational Equivalence on Stores First, we introduce an equivalence relation on stores with respect to other semantic elements. I Definition 1. Two stores σ, σ 0 are equivalent w.r.t constants c, c0 if the constants are equal. (σ, c) ' (σ 0 , c0 ) ⇔ c = c I Definition 2. Two stores σ, σ 0 are equivalent w.r.t locations l, l0 if they are equivalent on the location’s target. (σ, l) ' (σ 0 , l0 ) ⇔ (σ, σ(l)) ' (σ 0 , σ 0 (l0 )) I Definition 3. Two stores σ, σ 0 are equivalent w.r.t non-proxy objects (d, f, v), (d0 , f 0 , v 0 ) if they are equivalent on the objects’s constituents. (σ, (d, f, v)) ' (σ 0 , (d0 , f 0 , v 0 )) ⇔ (σ, d) ' (σ 0 , d0 ) ∧ (σ, f ) ' (σ 0 , f 0 ) ∧ (σ, v) ' (σ 0 , v 0 ) I Definition 4. Two stores σ, σ 0 are equivalent w.r.t dictionaries d, d0 if they are equivalent on the dictionary’s content. (σ, d) ' (σ 0 , d0 ) ⇔ dom(d) = dom(d0 ) ∧ ∀c ∈ dom(d).(σ, d(c)) ' (σ 0 , d0 (c)) I Definition 5. Two stores σ, σ 0 are equivalent w.r.t closures (ρ, λx.e), (ρ0 , λx.f ) if the are equivalent on the closure’s environment and both abstractions are equal. (σ, (ρ, λx.e)) ' (σ 0 , (ρ0 , λx.f )) ⇔ (σ, ρ) ' (σ 0 , ρ0 ) ∧ λx.e = λx.f I Definition 6. Two stores σ, σ 0 are equivalent w.r.t environments ρ, ρ0 if the are equivalent on the environment’s content. (σ, ρ) ' (σ 0 , ρ0 ) ⇔ dom(ρ) = dom(ρ0 ) ∧ ∀x ∈ dom(ρ).(σ, ρ(x)) ' (σ 0 , ρ(x)) 42 Transaction-based Sandboxing for JavaScript I Definition 7. Two stores σ, σ 0 are equivalent w.r.t proxy objects (l, b l, ρb), (l0 , b l0 , ρb0 ) if they are equivalent on the objects’s constituents. (σ, (l, b l, ρb)) ' (σ 0 , (l0 , b l0 , ρb0 )) ⇔ (σ, l) ' (σ 0 , l0 ) ∧ (σ, b l) ' (σ 0 , b l0 ) ∧ (σ, ρb) ' (σ 0 , ρb0 ) I Definition 8. Two stores σ, σ 0 are equivalent w.r.t sandbox closures (b ρ, Λx.e), (b ρ0 , Λx.f ) if the are equivalent on the sandbox’s environment and both abstractions are equal. (σ, (b ρ, Λx.e)) ' (σ 0 , (b ρ0 , Λx.f )) ⇔ (σ, ρb) ' (σ 0 , ρb0 ) ∧ Λx.e = Λx.f Now, the observational equivalence for stores can be states as follows. I Definition 9. Two stores σ, σ 0 are observational equivalent under environment ρ if they are equivalent on all values v ∈ {ρ(x) | x ∈ dom(ρ)} σ 'ρ σ 0 ⇔ ∀x ∈ dom(ρ).(σ, ρ(x)) ' (σ 0 , ρ(x)) I Lemma 10. Suppose that ρi ` hσi , ei ⇓ hσi0 , vi i then for all σj , ρj with (σi , ρi ) ' (σj , ρj ) . ρj ` hσj , ei ⇓ hσj0 , vj i with (σi0 , ρi ) ' (σj0 , ρj ) and (σi0 , v) ' (σj0 , w). Proof. Proof by induction on the derivation of e. D.2 J Noninterference I Theorem 11. For each ρ and σ with ρ ` hσ, (fresh Λx.e)(f )i ⇓ hσ 0 , vi it holds that σ 'ρ σ 0 . Proof. Proof by induction on the derivation of e. J M. Keil and P. Thiemann E Related work There is a plethora of literature on securing JavaScript, so we focus on the distinguishing features of our sandbox and on related work not already discussed in the body of the paper. Sandboxing JavaScript The most closely related work to our sandbox mechanism is the design of access control wrappers for revocable references and membranes [39, 26]. In a memory-safe language, a function can only cause effects to objects reachable from references in parameters and global variables. A revocable reference can be instructed to detach from the objects, so that they are no longer reachable and safe from effects. However, as membranes by themselves do not handle side effects (every property access can be the call of a side-effecting getter) they do not implement a sandbox in the way we did. Agten et al. [2] implement a JavaScript sandbox using proxies and membranes. As in our work, they place wrappers around sensitive data (e.g., DOM elements) to enforce policies and to prevent the application state from unprotected script inclusion. However, instead of encapsulating untrusted code they require that scripts are compliant with SES [34], a subset of JavaScript’s “strict mode” that prohibits features that are either unsafe or that grant uncontrolled access, and use an SES-library to execute those scripts. A language-embedded JavaScript parser transforms non-compliant scripts at run time, but doing so restricts the handling of dynamic code compared to our approach. TreatJS, a JavaScript contract system [20], uses a sandboxing mechanism similar to the sandbox presented in this work to guarantee that the execution of a predicate does not interfere with the execution of a contract abiding host program. As in our work, they use JavaScript’s dynamic facilities to traverse the scope chain when evaluating predicates and they use JavaScript proxies to make external references visible when evaluating predicates. Arnaud et al. [3] provide features similar to the sandboxing mechanism of TreatJS [20]. Both approaches focus on access restriction to guarantee side-effect free contract assertion. However, neither of them implements a full-blown sandbox, because writing is completely forbidden and always leads to an exception. Our sandbox works in a similar way and guarantees read-only access to target objects, but redirects write operations to shadow objects such that local modifications are only visible inside the sandbox. However, access restrictions in all tree approaches affect only values that cross the border between two execution environments. Values that are defined and used inside, e.g. local values, were not restricted. Write access to those values is fine. Patil et al. [29] present JCShadow, a reference monitor implemented as a Firefox extension. Their tool provides fine-grained access control to JavaScript resources. Similar to DecentJS, they implement shadow scopes that isolate scripts from each other and which regulate the granularity of object access. Unlike DecentJS, JCShadow achieves a better runtime performance. While more efficient, their approach is platform-dependent as it is tied to a specific engine and requires active maintenance to keep up with the development of the enigine. DecentJS, in contrast, is a JavaScript library based on the reflection API, which is part of the standard. Most other approaches (e.g., [11, 27, 8, 1]) implement restrictions by filtering and rewriting untrusted code or by removing features that are either unsafe of that grant uncontrolled access. For exampe, Caja [11, 27] compiles JavaScript code in a sanitized JavaScript subset that can safely be executed on normal engines. Because static guarantees do not apply to code created at run time using eval or other mechanisms, Caja restricts dynamic features 43 44 Transaction-based Sandboxing for JavaScript and rewrites the code to a “cajoled” version with additional run-time checks that prevent access to unsafe function and objects. Static approaches come with a number of drawbacks, as shown by a number of papers [23, 9, 31]. First, they either restrict the dynamic features of JavaScript or their guarantees simply do not apply to code generated at run time. Second, maintenance requires a lot of effort because the implementation becomes obsolete as the language evolves. Thus, dynamic effect monitoring and dynamic access restriction plays an important role in the context of JavaScript security, as shown by a number of authors [3, 39, 26, 19]. Effect Monitoring Richards et al. [32] provide a WebKit implementation to monitor JavaScript programs at run time. Rather than performing syntactic checks, they look at effects for history-based access control and revoke effects that violate policies implemented in C++. Transcript, a Firefox extension by Dhawan et al. [7], extends JavaScript with support for transactions and speculative DOM updates. Similar to DecentJS, it builds a transactional scope and permits the execution of unrestricted guest code. Effects within a transaction are logged for inspection by the host program. They also provide features to commit updates and to recover from effects of malicious guest code. JSConTest [16] is a framework that helps to investigate the effects of unfamiliar JavaScript code by monitoring the execution and by summarizing the observed access traces to access permission contracts. It comes with an algorithm [17] that infers a concise effect description from a set of access paths and it enables the programmer to specify the effects of a function using access permission contracts. JSConTest is implemented by an offline source code transformation. Because of JavaScrip’s flexibility it requires a lot of effort to construct an offline transformation that guarantees full interposition and that covers the full JavaScript language. This, the implementation of JSConTest has known omissions: no support for with and prototypes, and it does not apply to code created at run time using eval or other mechanisms. JSConTest2 is a redesign and a reimplementation of JSConTest using JavaScript proxies. The new implementation addresses shortcomings of the previous version: it guarantees full interposition for the full language and for all code regardless of its origin, including dynamically loaded code and code injected via eval. JSConTest2 [18] monitors read and write operations on objects through access permission contracts that specify allowed effects. A contract restricts effects by defining a set of permitted access paths starting from some anchor object. However, the approach works differently. JSConTest2 has to encapsulate sensitive data instead of encapsulating dubious functions. Language-embedded Systems JSFlow [15] is a full language-embedded JavaScript interpreter that enforces information flow policies at run time. Like DecentJS, JSFlow itself is implemented in JavaScript. Compared to DecentJS, the JSFlow interpreter causes a significantly higher run-time impact than the our sandbox, which only reimplements the JavaScript semantics on the membrane. A similar slowdown is reported for js.js [38], another language-embedded JavaScript interpreter conceived to execute untrusted JavaScript code. Its implementation provides a wealth of powerful features similar to DecentJS: fine-grained access control, support for the full JavaScript language, and full browser compatibility. However, its average slowdown in the range of 100 to 200 is significantly higher than DecentJS’s. M. Keil and P. Thiemann F Evaluation Results This section reports on our experience with applying the sandbox to select programs. We focus on the influence of sandboxing on the execution time. We use the Google Octane Benchmark Suite24 to measure the performance of the sandbox implementation. Octane measures a JavaScript engine’s performance by running a selection of complex and demanding programs (benchmark programs run between 5 and 8200 times). Google claims that Octane “measure[s] the performance of JavaScript code found in large, real-world web applications, running on modern mobile and desktop browsers. Each benchmark is complex and demanding . We use Octane as it is intended to measure the engine’s performance (benchmark programs run between 5 and 8200 times). we claim that it is the heaviest kind of benchmark. Every real-world library (e.g. jQuery) is less demanding and runs without an measurable runtime impact. Octane 2.0 consists of 17 programs25 that range from performance tests to real-world web applications (Figure ??), from an OS kernel simulation to a portable PDF viewer. Each program focuses on a special purpose, for example, function and method calls, arithmetic and bit operations, array manipulation, JavaScript parsing and compilation, etc. F.1 Testing Procedure All benchmarks were run on a machine with two AMD Opteron processors with 2.20 GHz and 64 GB memory. All example runs and measurements reported in this paper were obtained with the SpiderMonkey JavaScript engine. For benchmarking, we wrote a new start script that loads and executes each benchmark program in a fresh sandbox. By setting the sandbox global to the standard global object, we ensure that each benchmark program can refer to properties of the global object as needed. As sandboxing wraps the global object in a membrane it mediates the interaction of the benchmark program with the global application state. All run time measurements were taken from a deterministic run, which requires a predefined number of iterations26 , and by using a warm-up run. F.2 Results Figure 24 and Figure 25 contains the run-time statistics for all benchmark programs in two different configurations, which are explained in the figure’s caption, and lists the readouts of some internal counters. Multiple read effects to the same field of an object are counted as one effect. As expected, the run time increases when executing a benchmark in a sandbox. While some programs like EarleyBoyer, NavierStrokes, pdf.js, Mandreel, and Box2DWeb are heavily affected, others are only slightly affected: Richards, Crypto, RegExp, and Code loading, for instance. Unfortunately, DeltaBlue and zlib do not run in our sandbox. DeltaBlue attempts to add a new property to the global Object.prototype object. As our sandbox prevents unintended modifications to Object.prototype the new property is only visible inside of the 24 https://developers.google.com/octane https://developers.google.com/octane/benchmark 26 Programs run either for one second or for a predefined number of iterations. If there are too few iterations in one second, it runs for another second. 25 45 46 Transaction-based Sandboxing for JavaScript Benchmark Richards DeltaBlue Crypto RayTrace EarleyBoyer RegExp Splay SplayLatency NavierStokes pdf.js Mandreel MandreelLatency Gameboy Emulator Code loading Box2DWeb zlib TypeScript Total Baseline time (sec) 9 9 18 9 19 6 3 3 3 7 8 8 4 8 4 7 26 Sandbox w/o Effects time (sec) slowdown Sandbox w Effects time (sec) slowdown sec sec sec sec sec sec sec sec sec sec sec sec sec sec sec sec sec 12 sec 42 sec 74 sec 202 sec 9 sec 19 sec 19 sec 56 sec 113 sec 151 sec 151 sec 17 sec 11 sec 145 sec 61 sec 1.33 2.33 8.22 10.63 1.5 6.33 6.33 18.67 16.14 18.88 18.88 4.25 1.38 36.25 2.35 15 sec 88 sec 498 sec 249 sec 12 sec 33 sec 33 sec 61 sec 778 sec 483 sec 483 sec 26 sec 12 sec 1,302 sec 328 sec 1.67 4.89 55.33 13.11 2 11 11 20.33 111.14 60.38 60.38 6.50 1.50 325.50 12.62 135 sec 1.082 sec 8.01 4,401 sec 32.60 Figure 24 Timings from running the Google Octane 2.0 Benchmark Suite. The first column Baseline gives the baseline execution times without sandboxing. The column Sandbox w/o Effects shows the time required to complete a sandbox run without effect logging and the relative slowdown (Sandbox time/Baseline time). The column Sandbox w Effects shows the time and slowdown (w.r.t. Baseline) of a run with fine-grained effect logging. current sandbox and only to objects created with new Object() and Object.create(), but not to those created using object literals. The zlib benchmark uses an indirect call27 to eval to write objects to the global scope, which is not allowed by the ECMAScript 6 (ECMA-262) specification. Another benchmark, Code loading, also uses an indirect call to eval. A small modification makes the program compatible with the normal eval, which can safely be used in our sandbox. In the first experiment we turn off effect logging, whereas in the second one it remains enabled. Doing so separates the performance impact of the sandbox system (proxies and shadow objects) from the impact caused by the effect system. From the running times we find that the sandbox itself causes an average slowdown of 8.01 (over all benchmarks). Our experimental setup wraps the global object in a membrane and mediates the interaction between the benchmark program and the global application state. As each benchmark program contains every source required to run the benchmark in separation, except global objects and global functions, the only thing that influences the execution time is read/write access to global elements. In absolute times, raw sandboxing causes a run time deterioration of 0.003ms per sandbox operation (effects) (0.011ms with effect logging enabled). For example, the Box2DWeb benchmark requires 145 seconds to complete and performs 132,722,198 effects on its membrane. Its baseline requires 4 seconds. Thus, sandboxing takes an additional 141 seconds. Hence, there is an overhead of 0.001ms per operation (0.010ms with effect logging enabled). 27 An indirect call invokes the eval function by using a name other than eval. M. Keil and P. Thiemann Benchmark 47 Objects Effects Size of Effect List Reads Writes Calls Richards DeltaBlue Crypto RayTrace EarleyBoyer RegExp Splay SplayLatency NavierStokes pdf.js Mandreel MandreelLatency Gameboy Emulator Code loading Box2DWeb zlib TypeScript 14 21 18 33 16 16 16 15 36 31 31 28 12417 28 23 492073 4964248 51043282 4740377 296995 1635732 1635732 4089 77665629 39948598 39948598 1225935 107481 132722198 27518481 20 29 26 42 23 23 23 21 59 50 50 42 50 38 34 2 2 3 8 2 2 2 2 8 2 2 2 2 2 2 5 11 8 6 6 8 8 6 21 21 21 16 13 14 9 Total 12743 383949448 530 43 173 Figure 25 Numbers from internal counters. Column Objects shows the numbers of wrap objects and column Effects gives the total numbers of effects. Column Size of Effect List lists the numbers of different effects after running the benchmark. Column Reads shows the number of read effects distinguished from there number of write effects (Column Writes) and distinguished from there number of call effects (Column Calls). Multiple effects to the same field of an object are counted as one effect. The results from the tests also indicate that the garbage collector runs more frequently, but there is no significant increase in the memory consumption. For the effect-heaviest benchmark Box2D we find that the virtual memory size increases from 157MByte (raw run) to 197MB (full run with effect logging). However, when looking at all benchmarks, the difference in the virtual memory size compared with the baseline run ranges from -126MByte to +40MByte for a raw sandbox run without effect logging and from -311MByte to +158MByte for a full run with fine grained effect logging. Appendix F.4 shows the memory usage of the different benchmark programs and their difference compared with the baseline. F.3 Google Octane Scores Values Octane reports its result in terms of a score. The Octane FAQ28 explains the score as follows: “In a nutshell: bigger is better. Octane measures the time a test takes to complete and then assigns a score that is inversely proportional to the run time.” The constants in this computation are chosen so that the current overall score (i.e., the geometric mean of the individual scores) matches the overall score from earlier releases of Octane and new benchmarks are integrated by choosing the constants so that the geometric mean remains the same. The rationale is to maintain comparability. 28 https://developers.google.com/octane/faq 48 Transaction-based Sandboxing for JavaScript Benchmark Richards DeltaBlue Crypto RayTrace EarleyBoyer RegExp Splay SplayLatency NavierStokes pdf.js Mandreel MandreelLatency Gameboy Emulator Code loading Box2DWeb zlib TypeScript Isolation Effects Baseline 4825 2418 1387 954 911 1268 3630 989 434 346 2518 6572 7348 453 4554 4135 1131 179 767 1139 713 1818 890 63 106 526 4780 6000 50.1 792 6552 6982 5669 9692 10345 1535 8676 12788 15713 8182 9102 12526 31865 9136 18799 42543 12588 Figure 26 Scores for the Google Octane 2.0 Benchmark Suite (bigger is better). Block Isolation contains the score values of a raw sandbox run without effect logging, whereas block Effects contains the score values of a full run with fine-grained effect logging. The last column Baseline gives the baseline scores without sandboxing. Figure 26 contains the scores of all benchmark programs in different configurations, which are explained in the figure’s caption. All scores were taken from a deterministic run, which requires a predefined number of iterations29 , and by using a warm-up run. As expected, all scores drop when executing the benchmark in a sandbox. In the first experiment, we turn off effect logging, whereas the second run is with effect logging. This splits the performance impact into the impact caused by the sandbox system (proxies and shadow objects) and the impact caused by effect system. F.4 Memory Consumption Figure 27, Figure 28, and Figure 29 shows the memory consumption recorded when running the Google Octane 2.0 Benchmark Suite. The numbers indicate that there is no significant increase in the memory consumed. For example, the difference of the virtual memory size ranges from -126 to 40 for a raw sandbox run and from -311 to +158 for a full run with fine grained effect logging. 29 Programs run either for one second or for a predefined number of iterations. If there are to few iterations in one second, it runs for another second. M. Keil and P. Thiemann 49 Benchmark Virtual size Richards DeltaBlue Crypto RayTrace EarleyBoyer RegExp Splay SplayLatency NavierStokes pdf.js Mandreel MandreelLatency Gameboy Emulator Code loading Box2DWeb zlib TypeScript Baseline Resident Text/Data size size 134 225 148 500 226 535 535 141 316 305 305 194 268 157 473 19 105 31 363 108 416 416 24 169 182 182 62 142 53 369 Shared size 109 201 124 476 202 511 511 116 292 280 280 170 243 132 448 5 6 5 6 6 6 6 5 6 6 6 6 6 5 6 Figure 27 Memory usage when running the Google Octane 2.0 Benchmark Suite without sandboxing. Column Virtual shows the virtual memory size, column Resident shows the resident set size, column Text/Data shows the Text/Data segment size, and column Text/Data shows the Text/Data segment size. All values are in MByte. Benchmark Richards DeltaBlue Crypto RayTrace EarleyBoyer RegExp Splay SplayLatency NavierStokes pdf.js Mandreel MandreelLatency Gameboy Emulator Code loading Box2DWeb zlib TypeScript Virtual size diff. Sandbox w/o Effects Resident Text/Data size diff. size diff. 135 232 148 374 224 466 466 134 274 263 263 188 259 197 424 20 106 31 272 107 352 352 18 123 133 133 60 138 97 325 1 +7 +0 -126 -2 -69 -69 -7 -42 -42 -42 -6 -9 +40 -49 1 +1 +0 -91 -1 -64 -64 -6 -46 -49 -49 -2 -4 +44 -44 110 208 124 350 200 422 422 109 250 239 239 163 234 172 428 1 +7 +0 -126 -2 -89 -89 -7 -42 -41 -41 -7 -9 +40 -20 Shared size diff. 5 6 6 6 6 6 6 5 6 5 5 6 6 6 6 0 0 +1 0 0 0 0 0 0 -1 -1 0 0 +1 0 Figure 28 Memory usage of a raw sandbox run without effect logging. Column Virtual shows the virtual memory size, column Resident shows the resident set size, column Text/Data shows the Text/Data segment size, and column Text/Data shows the Text/Data segment size. Sub-column size shows the size in MByte and sub-column diff. shows the difference to the baseline (Sandbox size - Baseline size) in MByte. 50 Transaction-based Sandboxing for JavaScript Benchmark Richards DeltaBlue Crypto RayTrace EarleyBoyer RegExp Splay SplayLatency NavierStokes pdf.js Mandreel MandreelLatency Gameboy Emulator Code loading Box2DWeb zlib TypeScript Virtual size diff. Sandbox w Effects Resident Text/Data size diff. size diff. 167 209 181 189 224 424 424 134 272 347 347 214 262 191 631 54 93 63 86 104 321 321 19 116 160 160 84 139 72 493 33 -16 +33 -311 -2 -111 -111 -7 -44 +42 +42 +20 -6 +34 +158 35 -12 +32 -277 -4 -95 -95 -5 -53 -22 -22 +22 -3 +19 +124 142 184 157 195 200 399 399 109 248 323 323 190 238 166 607 33 -17 +33 -281 -2 -112 -112 -7 -44 +43 +43 +20 -5 +34 +159 Shared size diff. 6 6 6 6 6 6 6 5 6 6 6 6 6 6 6 1 0 +1 0 0 0 0 0 0 0 0 0 0 +1 0 Figure 29 Memory usage of a full run with fine-grained effect logging. Column Virtual shows the virtual memory size, column Resident shows the resident set size, column Text/Data shows the Text/Data segment size, and column Text/Data shows the Text/Data segment size. Sub-column size shows the size in MByte and sub-column diff. shows the difference to the baseline (Sandbox size - Baseline size) in MByte.
6cs.PL
Enumeration of groups whose order factorises in at most 4 primes arXiv:1702.02616v1 [math.GR] 8 Feb 2017 Bettina Eick February 10, 2017 Abstract Let N (n) denote the number of isomorphism types of groups of order n. We consider the integers n that are products of at most 4 not necessarily distinct primes and exhibit formulas for N (n) for such n. 1 Introduction The construction up to isomorphism of all groups of a given order n is an old and fundamental problem in group theory. It has been initiated by Cayley [6] who determined the groups of order at most 6. Many publications have followed Cayley’s work; A history of the problem can be found in [4]. The enumeration of the isomorphism types of groups of order n is a related problem. The number N (n) of isomorphism types of groups of order n is known for all n at most 2 000, see [4], and for almost all n at most 20 000, see [9]. Asymptotic estimates for N (n) have been determined in [21]. However, there is no closed formula known for N (n) as a function in n. Many details on the group enumeration problem can be found in [7] and [5]. Higman [12] considered prime-powers pm . His PORC conjecture suggests that N (pm ) as a function in p is PORC (polynomial on residue classes). This has been proved for all m ≤ 7, see Hölder [13] for m ≤ 4, Bagnera [1] or Girnat [10] for m = 5, Newman, O’Brien & Vaughan-Lee [19] for m = 6 and O’Brien & Vaughan-Lee [20] for m = 7. To exhibit the flavour of the results, we recall the explicit PORC polynomials for N (pm ) for m ≤ 5 as follows. 1 Theorem: (Hölder [13], Bagnera [1]) • • • • • N (p1 ) = 1 for all primes p. N (p2 ) = 2 for all primes p. N (p3 ) = 5 for all primes p. N (24 ) = 14 and N (p4 ) = 15 for all primes p ≥ 3. N (25 ) = 51, N (35 ) = 71 and N (p5 ) = 2p + 61 + 2 gcd(p − 1, 3) + gcd(p − 1, 4) for all primes p ≥ 5. Hölder [14] determined a formula for N (n) for all square-free n. For m ∈ N let π(m) denote the number of different primes dividing m. For m ∈ N and a prime p let cm (p) denote the number of prime divisors q of m with q ≡ 1 mod p. The following is also proved in [5, Prop. 21.5]. 1 2 Theorem: (Hölder [14]) Let n ∈ N be square free. Then N (n) = X Y n m|n p∈π( m ) pcm (p) − 1 . p−1 The aim here is to determine formulas for N (n) if n is a product of at most 4 primes. If n is a prime-power or is square-free, then such formulas follow from the results cited above. Hence it remains to consider the numbers n that factorise as p2 q, p3 q, p2 q 2 or p2 qr for different primes p, q and r. For each of these cases we determine an explicit formula for N (n), see Theorems 14, 15, 16 and 17. Each of these formulas is a polynomial on residue classes; that is, there are finitely many sets of number-theoretic conditions on the involved primes so that N (n) is a polynomial in the involved primes for each of the condition-sets. We summarise this in the following theorem. 3 Theorem: (See Theorems 14, 15, 16, 17 below) Let p, q and r be different primes and n ∈ {p2 q, p3 q, p2 q 2 , p2 qr}. Then N (n) is a polynomial on residue classes. The enumerations obtained in this paper overlap with various known results. For example, Hölder [13] considered the groups of order p2 q, Western [24] those of order p3 q, Le Vavasseur [16, 17] and Lin [18] those of order p2 q 2 and Glenn [11] those of order p2 qr. Moreover, Laue [15] considered all orders of the form pa q b with a + b ≤ 6 and a < 5 and b < 5 as well as the orders dividing p2 q 2 r 2 . So why are these notes written? There are two reasons. First, they provide a uniform and reasonably compact proof for the considered group numbers and they exhibit the resulting group numbers as a closed formula with few case distinctions. Laue’s work [15] also contains a unified approach towards the determination of its considered groups and this approach is similar to ours, but it is not easy to read and to extract the results. Our second aim with these notes is to provide a uniform and reliable source for the considered group enumerations. The reliability of our results is based on its proofs as well as on a detailed comparision with the Small Groups library [3]. Acknowledgements We give more details on the results available in the literature that overlap with the results here in the discussions before the Theorems 14, 15, 16 and 17. Most of these details have been provided by Mike Newman. The author thanks Mike Newman for this and also for various discussions on these notes. 2 Divisibility For r, s ∈ N we define the function wr (s) via wr (s) = 1 if s | r and wr (s) = 0 otherwise. The following remark exhibits the relation of wr (s) and the underlying gcd’s. 2 4 Remark: For r, s ∈ N it follows that Y gcd(r, s) − d . s−d wr (s) = d|s,d6=s 3 Counting subgroups of linear groups For r ∈ N and a group G we denote with sr (G) the number of conjugacy classes of subgroups of order r in G. We recall the following well-known result. 5 Remark: Let n ∈ N and p prime. Then GL(n, p) has an irreducible cyclic subgroup of order m if and only if m | (pn − 1) and m ∤ (pd − 1) for each d < n. Further, if there exists an irreducible cyclic subgroup of order m in GL(n, p), then it is unique up to conjugacy. The next theorem counts the conjugacy classes of subgroups of certain orders in GL(2, p). With Crs we denote the s-fold direct product of cyclic groups of order r. 6 Theorem: Let p, q and r be different primes and let G = GL(2, p). (a) s2 (G) = 2 and for q > 2 it follows that sq (G) = q+3 wp−1 (q) + wp+1 (q). 2 (b) s4 (G) = 2 + 3wp−1 (4) and for q > 2 it follows that sq2 (G) = wp−1 (q) + (c) s2r (G) = 3r+7 2 wp−1 (r) + sqr (G) = q2 + q + 2 wp−1 (q 2 ) + wp+1 (q 2 ). 2 2wp+1 (r) and for r > q > 2 it follows that qr + q + r + 5 wp−1 (qr) + wp2 −1 (qr)(1 − wp−1 (qr)). 2 Proof: Let m ∈ N with p ∤ m. As a preliminary step in this proof, we investigate the number of conjugacy classes of cyclic subgroups of order m in GL(2, p). By Remark 5, an irreducible subgroup of this form exists if and only if m | (p2 − 1) and m ∤ (p − 1) and its conjugacy class is unique in this case. A reducible cyclic subgroup of order m in GL(2, p) 2 and thus GL(2, p) embeds into the group of diagonal matrices D. Note that D ∼ = Cp−1 has a reducible cyclic subgroup of order m if and only if m divides the exponent p − 1 of 2 in D. This subgroup U D. If m | (p − 1), then there exists a unique subgroup U ∼ = Cm contains every cyclic subgroup of order m in D. The group GL(2, p) acts on D and on U by permutation of the diagonal entries of an element of D. (a) Each group of prime order q is cyclic. An irreducible subgroup of order q exists if and only if q 6= 2 and q | (p + 1), since p2 − 1 = (p − 1)(p + 1) and gcd(p − 1, p + 1) | 2. A reducible subgroup of order q exists if and only q | (p − 1). In this case, the number of conjugacy classes of reducible cyclic subgroups of order q in GL(2, p) can be enumerated as 2 if q = 2 and (q + 3)/2 otherwise, as there are (q + 1) subgroups of order q in Cq2 and all but the subgroups with diagonals of the form (a, a) or (a, a−1 ) for a ∈ F∗p have orbits of length two under the action of GL(2, p) by permutation of diagonal entries. 3 (b) We first consider the cyclic subgroups of order q 2 in GL(2, p). For the irreducible case, note that if q 2 | (p2 − 1) and q 2 ∤ (p − 1), then either q = 2 and 4 ∤ (p − 1) or q > 2 and q 2 | (p + 1). For the reducible case we note that if q 2 | (p − 1), then there are (q 2 + q + 2)/2 conjugacy classes of reducible cyclic subgroups of order q 2 in GL(2, p), as there are (q 2 + q) subgroups and all but those with diagonal of the form (a, a) and (a, a−1 ) for a ∈ F∗p have orbits of length two. Thus the number of conjugacy classes of cyclic subgroups of order q 2 in GL(2, p) is 1 + 3wp−1 (4) if q = 2 and (q 2 + q + 2)/2 · wp−1 (q 2 ) + wp+1 (q 2 ) if q > 2. It remains to consider the subgroups of type Cq2 . Such a subgroup is reducible and exist if q | (p − 1). In this case there exists a unique conjugacy class of such subgroups. (c) We first consider the cyclic subgroups of order qr in GL(2, p). If q = 2, then p 6= 2. Thus 2r | (p2 − 1) and 2r ∤ (p − 1) if and only if r | (p + 1). As in the previous cases, this yields that there are (3r + 5)/2 · wp−1 (r) + wp+1 (r) cyclic subgroups of order 2r in GL(2, p). If q > 2, then r > 2. The number of cyclic subgroups of order qr in GL(2, r) in this case is (qr + r + q + 5)/2 · wp−1 (qr) + wp2 −1 (qr)(1 − wp−1 (qr) using the same arguments as above. It remains to consider the case of non-cyclic subgroups. Such a subgroup H is irreducible and satisfies q = 2. If H is imprimitive, then Cr is diagonalisable; there is one such possibility if r | (p − 1). If H is primitive, then Cr is irreducible; there is one such possibility if r | (p + 1). • We extend Theorem 6 with the following. 7 Remark: Let p and q be different primes and let G = GL(2, p). If H is a subgroup of order q in G, then [NG (H) : CG (H)] | 2. The number of groups H of order q in G satisfying [NG (H) : CG (H)] = 2 is 0 for q = 2 and wp−1 (q) + wp+1 (q) for q > 2. Proof: Consider the groups H of order q in GL(2, p). If H is irreducible, then H is a subgroup of a Singer cycle and this satisfies [NG (H) : CG (H)] = 2. If H is reducible, then H is a subgroup of the group of diagonal matrices D. The group D satisfies [NG (D) : CG (D)] = 2, where the normalizer acts by permutation of the diagonal entries. As in the proof of Theorem 6 (a), only the group H with diagonal of the form (a, a) for a ∈ F∗p satisfies [NG (H) : CG (H)] = 2. • 8 Theorem: Let p be a prime, let G = GL(3, p) and let q 6= p. Then s2 (G) = 3 and for q > 2 it follows that sq (G) = q 2 + 4q + 9 + 4wq−1 (3) wp−1 (q) + w(p+1)(p2 +p+1) (q)(1 − wp−1 (q)). 6 Proof: We first consider the diagonalisable subgroups of order q in GL(3, p). These exist if q | (p − 1). If this is the case, then the group D of diagonal matrices has a subgroup of the form Cq3 and this contains all subgroups of order q in D. The group D has q 2 + q + 1 subgroups of order q and these fall under the permutation action of diagonal entries into 3 orbits if q = 2, into (q 2 + 4q + 9)/6 orbits if q > 2 and 3 ∤ (q − 1) and into (q 2 + 4q + 13)/6 orbits if q > 2 and 3 | (q − 1). Next, we consider the groups that are not diagonalisable. These can arise from irreducible subgroups in GL(2, p) or in GL(3, p). In the first case, there exists one such class if q > 2 and q | (p + 1) as in Theorem 6. In the second case, by Remark 5 there exists one such class if q | (p3 − 1) and q ∤ (p2 − 1) and q ∤ (p − 1). 4 Note that the two cases are mutually exclusive. In summary, there exists an irreducible subgroup of order q in GL(3, p) if q > 2 and q | (p + 1)(p2 + p + 1) and q ∤ (p − 1). • We note that gcd((p + 1)(p2 + p + 1), p − 1) | 6 for each prime p. Thus for q ≥ 5 it follows that w(p+1)(p2 +p+1) (q) = w(p+1)(p2 +p+1) (q)(1 − wp−1 (q)) which simplifies the formula in Theorem 8. 4 Counting split extensions For two groups N and U let Π(U, N ) denote the set of all group homomorphisms ϕ : U → Aut(N ). The direct product Aut(U ) × Aut(N ) acts on the set Π(U, N ) via ϕ(α,β) (g) = β −1 (ϕ(α−1 (g)))β for (α, β) ∈ Aut(U ) × Aut(N ), ϕ ∈ Π(U, N ) and g ∈ N . If β is the conjugation by β in Aut(N ), then this action can be written in short form as ϕ(α,β) = β ◦ ϕ ◦ α−1 . Given ϕ ∈ Π(U, N ), the stabilizer of ϕ in Aut(U )×Aut(N ) is called the group of compatible pairs and is denoted by Comp(ϕ). If N is abelian, then N is an U -module via ϕ for each ϕ ∈ Π(U, N ). In this case Comp(ϕ) acts on Hϕ2 (U, N ) induced by its action on Zϕ2 (U, N ) via γ (α,β) (g, h) = β −1 (γ(α−1 (g), α−1 (h))) for γ ∈ Zϕ2 (U, N ), (α, β) ∈ Comp(ϕ) and g, h ∈ U . These constructions can be used to solve the isomorphism problem for extensions in two different settings. We recall this in the following. 4.1 Extensions with abelian kernel Suppose that N is abelian and that N is fully invariant in each extension of N by U ; this is, for example, the case if N and U are coprime or if N maps onto the Fitting subgroup in each extension of N by U . The following theorem seems to be folklore. 9 Theorem: Let N be finite abelian and U be a finite group so that N is fully invariant in each extension of N by U . Let O be a complete set of representatives of the Aut(U ) × Aut(N ) orbits in Π(U, N ) and for each ϕ ∈ O let oϕ denote the number of orbits of Comp(ϕ) on Hϕ2 (U, N ). Then the number of isomorphism types of extensions of N by U is X oϕ . ϕ∈O The following theorem proved in [8, Th. 14] exploits the situation further in a special case. Again, Cl denotes the cyclic group of order l. 10 Theorem: (Dietrich & Eick [8]) Let p be a prime, let N ∼ = Cp , and let U be finite with Sylow p-subgroup P so that P ∼ = Cp . Then there are either one or two isomorphism types of extensions of N by U . There are two isomorphism types of extensions if and only if N and P are isomorphic as NU (P )-modules. 5 4.2 A special type of split extensions In this section we recall a variation of a theorem by Taunt [23]. As a preliminary step we introduce some notation. Let N and U be finite solvable groups of coprime order. Let S denote a set of representatives for the conjugacy classes of subgroups in Aut(N ), let K denote the set of representatives for the Aut(U )-classes of normal subgroups in U and let O = {(S, K) | S ∈ S, K ∈ K with S ∼ = U/K}. For (S, K) ∈ O let ι : U/K → S denote a fixed isomorphism, let AK denote the subgroup of Aut(U/K) induced by the action of StabAut(U ) (K) on U/K, and denote with AS the subgroup of Aut(U/K) induced by the action of NAut(N ) (S) on S and thus, via ι, on U/K. Then the double cosets of the subgroups AK and AS in Aut(U/K) are denoted by DC(S, K) := AK \ Aut(U/K) / AS . 11 Theorem: Let N and U be finite solvable groups of coprime order. Then the number of isomorphism types of split extensions N ⋊ U is X |DC(S, K)|. (S,K)∈O Proof: Taunt’s theorem [23] claims that the number of isomorphism types of split extensions N ⋊ U correspond to the orbits of Aut(U ) × Aut(N ) on Π(U, N ). In turn, these orbits correspond to the union of orbits of AK × NAut(N ) (S) on the set of isomorphisms U/K → S. The latter translate to the double cosets DC(S, K). • We apply Theorem 11 in two special cases in the following. Again, let Cl denote the cyclic group of order l. 12 Theorem: Let q k be a prime-power, let N = Cqk and let U be a finite group of order coprime to q. Denote π = gcd(|U |, q k−1 (q − 1)). For l | π, let Kl be a set of representatives of the Aut(U )-classes of normal subgroups K in U with U/K ∼ = Cl . For K ∈ Kl let indK = [Aut(U/K) : AK ]. If k ≤ 2 or q is odd, then the number of isomorphism types of split extensions N ⋊ U is X X indK . l|π K∈Kl Proof: We apply Theorem 11. The group Aut(N ) is cyclic of order pk−1 (p − 1). Hence for each l | π there exists a unique subgroup S of order l in Aut(N ) and this subgroup is cyclic. Next, as Aut(N ) is abelian, it follows that NAut(N ) (S) = Aut(N ) and Aut(N ) acts trivially on S by conjugation. Hence AS is the trivial group and |DC(S, K)| = indK for each K. • 13 Theorem: Let q k be a prime-power, let U = Cqk and let N be a finite group of order coprime to q. Let S be a set of conjugacy class representatives of cyclic subgroups of order dividing q k in Aut(N ). Then the number of isomorphism types of split extensions N ⋊ U equals |S|. Proof: Again we use Theorem 11. For each divisor pl of pk there exists a unique normal subgroup K in U with |K| = pl and U/K is cyclic of order pk−l . Note that AK = Aut(U/K) for each such K. Hence |DC(S, K)| = 1 in all cases. • 6 5 Groups of order p2 q The groups of order p2 q have been considered by Hölder [13], by Lin [18], by Laue [15] and in various other places. The results by Hölder, Lin and Laue agree with ours. (Lin’s results have some harmless typos). We also refer to [5, Prop. 21.17] for an alternative description and proof of the following result. 14 Theorem: Let p and q be different primes. (a) If q = 2, then N (p2 q) = 5. (b) If q > 2, then N (p2 q) = 2 + (q + 5)/2 · wp−1 (q) + wp+1 (q) + 2wq−1 (p) + wq−1 (p2 ). Proof: The classification of groups of order p2 yields that there are two nilpotent groups of order p2 q: the groups Cp2 × Cq and Cp2 × Cq . It remains to consider the non-nilpotent groups of the desired order. Note that every group of order p2 q is solvable by Burnside’s theorem. Non-nilpotent groups with normal p-Sylow subgroup. These groups have the form N ⋊ U with |N | = p2 and U = Cq . We use Theorem 13 to count the number of such split extensions. Thus we count the number of conjugacy classes of subgroups of order q in Aut(N ). • N∼ = C 2 . Then Aut(N ) ∼ = GL(2, p) and the number of conjugacy classes of subgroups p of order q in Aut(N ) is exhibited in Theorem 6 (a). • N ∼ = Cp2 . Then Aut(N ) ∼ = Cp(p−1) is cyclic. Thus there is at most one subgroup of order q in Aut(N ) and this exists if and only if q | (p − 1). Non-nilpotent groups with normal q-Sylow subgroup. These groups have the form N ⋊ U with N = Cq and |U | = p2 . We use Theorem 12 to count the number of such split extensions. For this purpose we have to consider the Aut(U )-classes of proper normal subgroups K in U with U/K cyclic. • U ∼ = Cp2 . Then U has a two proper normal subgroups K with cyclic quotient. The case K = 1 arises if and only if p2 | (q − 1) and the case K = Cp arises if and only if p | (q − 1). In both cases indK = 1. • U ∼ = Cp2 . Then there exists one Aut(U )-class of normal subgroups K with cyclic quotient in U and this has the form K = Cp and yields indK = 1. This case arises if p | (q − 1). Groups without normal Sylow subgroup. Let G be such a group and let F be the Fitting subgroup of G. As G is solvable and non-nilpotent, it follows that 1 < F < G. As G has no normal Sylow subgroup, we obtain that pq | [G : F ]. Thus |F | = p and |G/F | = pq is the only option. Next, G/F acts on faithfully on F by conjugation, since F is the Fitting subgroup. Hence pq | |Aut(F )| = (p − 1) and this is a contradiction. Thus this case cannot arise. • 7 6 Groups of order p3 q The groups of order p3 q have been determined by Western [24] and Laue [15]. Western’s paper is essentially correct, but the final summary table of groups has a group missing in the case that q ≡ 1 mod p; the missing group appears in Western’s analysis in Section 13. There are further minor issues in Section 32 of Western’s paper. There are disagreements between our results and the results of Laue [15, p. 224-6] for the case p = 2 and the case q = 3. We have not tried to track the origin of these in Laue’s work. 15 Theorem: Let p and q be different primes. (a) (b) (c) (d) There are two special cases N (3 · 23 ) = 15 and N (7 · 23 ) = 13. If q = 2, then N (p3 q) = 15 for all p > 2. If p = 2, then N (p3 q) = 12 + 2wq−1 (4) + wq−1 (8) for all q 6= 3, 7. If p and q are both odd, then N (p3 q) = 5 + (q 2 + 13q + 36)/6 · wp−1 (q) +(p + 5) · wq−1 (p) +2/3 · wq−1 (3)wp−1 (q) + w(p+1)(p2 +p+1) (q)(1 − wp−1 (q)) +wp+1 (q) + 2wq−1 (p2 ) + wq−1 (p3 ). Before we embark on the proof of Theorem 15, we note that the formula of Theorem 15 d) can be simplified by distinguishing the cases q = 3 and q 6= 3. For q = 3 and p odd it follows that w(p+1)(p2 +p+1) (q)(1 − wp−1 (q)) = wp+1 (3). Thus Theorem 15 d) for q = 3 and p odd reads N (3p3 ) = 5 + 14wp−1 (3) + 2wp+1 (3). If q > 3 and p is odd, then w(p+1)(p2 +p+1) (q)(1 − wp−1 (q)) = w(p+1)(p2 +p+1) (q) holds. Again, this can be used to simplify the formula of Theorem 15 d). Proof: The proof follows the same strategy as the proof of Theorem 14. Burnside’s theorem asserts that every group of order p3 q is solvable. It is easy to see that there are five nilpotent groups of order p3 q: the groups G × Cq with |G| = p3 . It remains to consider the non-nilpotent groups of the desired order. Non-nilpotent groups with normal p-Sylow subgroup. These groups have the form N ⋊ U with |N | = p3 and U = Cq . Using Theorem 13, they correspond to the conjugacy classes of subgroups of order q in Aut(N ). There are five isomorphism types of groups N of order p3 . For p = 2, the groups Aut(Q8 ) and Aut(C23 ) = GL(3, 2) have subgroups of order coprime to 2; that is, Aut(Q8 ) has one conjugacy class of subgroups of order 3 and GL(3, 2) has one conjugacy class of subgroups of order 3 and 7. This leads to the special cases in a) and shows that in all other cases on q this type of group does not exist for p = 2. It remains to consider the case p > 2. • N ∼ = Cp3 : Then Aut(N ) is cyclic of order p2 (p − 1). Thus Aut(N ) has at most one subgroup of order q and this exists if and only if q | (p − 1). This adds c1 := wp−1 (q). • N ∼ = Cp2 × Cp : In this case Aut(N ) is solvable and has a normal Sylow p-subgroup 2 . Thus Aut(N ) contains a subgroup of order q if with p-complement of the form Cp−1 8 and only if q | (p − 1). In this case there are q + 1 such subgroups in Cq2 and these translate to conjugacy classes of such subgroups in Aut(N ). This adds c2 := (q + 1)wp−1 (q). • N is extraspecial of exponent p: Then Aut(N ) → Aut(N/φ(N )) ∼ = GL(2, p) is surjective. Thus the conjugacy classes of subgroups of order q in Aut(N ) correspond to the conjugacy classes of subgroups of order q in GL(2, p). These are counted in Theorem 6 (a). Hence this adds q+3 wp−1 (q) + wp+1 (q) if q > 2, 2 := 2 if q = 2. c3 := c3 • N is extraspecial of exponent p2 : Then Aut(N ) is solvable and has a normal Sylow p-subgroup with p-complement of the form Cp−1 . Thus there is at most one subgroup of order q in Aut(N ) and this exists if and only if q | (p − 1). This adds c4 := wp−1 (q). • N ∼ = GL(3, p). The conjugacy classes of subgroups of order q in = Cp3 : Then Aut(N ) ∼ GL(3, p) are counted in Theorem 8. Hence this adds 1 2 (q + 4q + 9 + 4wq−1 (3))wp−1 (q) + w(p+1)(p2 +p+1) (q)(1 − wp−1 (q)) if q > 2, 6 := 3 if q = 2. c5 := c5 Non-nilpotent groups with normal q-Sylow subgroup. These groups have the form N ⋊ U with N = Cq and |U | = p3 . Using Theorem 12, we have to determine the Aut(U )-orbits of proper normal subgroups K in U with U/K cyclic of order dividing q − 1 and then for each such K determine indK . • U ∼ = Cp3 : In this case there are the options K ∈ {1, Cp , Cp2 } and all of these have indK = 1. Hence this adds c6 := wq−1 (p) + wq−1 (p2 ) + wq−1 (p3 ). • U ∼ = Cp2 × Cp : In this case there are two normal subgroups K with U/K ∼ = Cp and up to Aut(U )-orbits. All of these there is one normal subgroup K with U/K ∼ C 2 = p have indK = 1. Thus this adds c7 := 2wq−1 (p) + wq−1 (p2 ). • U extraspecial of exponent p (or Q8 ): In this case there is one Aut(U )-orbit of normal subgroups K with U/K ∼ = Cp and this has indK = 1. Hence this adds c8 := wq−1 (p). • U extraspecial of exponent p2 (or D8 ): Then there are two Aut(U )-orbits of normal subgroups K with U/K ∼ = Cp ; one has indK = 1 and the other has indK = p − 1. Thus this case adds c9 := pwq−1 (p). 9 • U∼ = Cp3 : In this case there is one Aut(U )-orbit of normal subgroups K with U/K ∼ = Cp and this has indk = 1. Thus this adds c10 := wq−1 (p). Groups without normal Sylow subgroup. Let G be such a group and let F be the Fittingsubgroup of G. Since G is solvable, it follows that F is not trivial. Further, pq | [G : F ] by construction. Thus |F | = p or |F | = p2 are the only options. Recall that G/F acts faithfully on F/φ(F ). If F is cyclic of order p or p2 , then a group of order pq cannot act faithfully on F/φ(F ). Hence F ∼ = Cp2 is the only remaining possibility. In this case G/F has order pq and embeds into Aut(F ) ∼ = GL(2, p); thus q | (p + 1)(p − 1). As F is the Fitting subgroup of G of order p2 , it follows that G/F cannot have a normal subgroup of order p. Hence G/F ∼ = Cq ⋊ Cp and p | (q − 1). This is only possible for p = 2 and q = 3 and thus is covered by the special case for groups of order 3 · 23 . P10 Except for P10the special cases, it now remains to sum up the values 5 + i=6 ci for p = 2 and 5 + i=1 ci for p > 2. This yields the formulas exhibited in the theorem. • 7 Groups of order p2 q 2 The groups of order p2 q 2 have been determined by Lin [18], Le Vavasseur [17] and Laue [15]. Lin’s work is essentially correct (it only has minor mistakes) and it agrees with the work by Laue [15, p. 214-43] and our results. Lin seems unaware of the work by Le Vavasseur [17]. We have not compared our results with those of Le Vavasseur. 16 Theorem: Let p and q be different primes with p < q. (a) There is one special case N (22 · 32 ) = 14. (b) If p = 2, then N (p2 q 2 ) = 12 + 4wq−1 (4). (c) If p > 2, then N (p2 q 2 ) = 4 + (p2 + p + 4)/2 · wq−1 (p2 ) + (p + 6)wq−1 (p) + 2wq+1 (p) + wq+1 (p2 ). Proof: First, all groups of this order are solvable by Burnside’s theorem and it is obvious that there are 4 isomorphism types of nilpotent groups of this order. Next, we consider Sylow’s theorems. Let mq denote the number of Sylow q-subgroups in a group of order p2 q 2 and recall that p < q. Then mq ≡ 1 mod q and mq | p2 . Thus mq ∈ {1, p, p2 }. If mq = p, then q | (p − 1) and this is impossible. If mq = p2 , then q | p2 − 1 = (p − 1)(p + 1). Thus either q | p − 1 or q | p + 1. Again, this is impossible unless p = 2 and q = 3. Thus if (p, q) 6= (2, 3), then mq = 1 and G has a normal Sylow q-subgroup. Non-nilpotent groups with normal Sylow q-subgroup. These groups have the form N ⋊ U with |N | = q 2 and |U | = p2 . We consider the arising cases. • N ∼ = Cq2 and U ∼ = Cp2 : Then Aut(N ) ∼ = Cq(q−1) and thus there are at most one subgroup of order p or p2 in Aut(N ). We use Theorem 13 to determine that this case adds c1 := wq−1 (p2 ) + wq−1 (p). 10 • N∼ = Cq2 and U ∼ = Cp2 : This case is similar to the first case and adds c2 := wq−1 (p). • N ∼ = Cq2 : Let ϕ : U → Aut(N ) = GL(2, q) and denote K = ker(ϕ). If |K| = p, then U/K ∼ = Cp . In both cases on the isomorphims type of U there is one Aut(U )-orbit of normal subgroups of order p and this satisfies AK = Aut(U/K). Hence in this case it remains to count the number c3 of conjugacy classes of subgroups of order p in GL(2, q), see Theorem 6 (a). Thus this adds c3 = 2 if p = 2, p+3 c3 = wq−1 (p) + wq+1 (p) if p > 2. 2 If |K| = 1, then U/K ∼ = U . Clearly, there is one Aut(U )-orbit of such normal subgroups and it satisfies AK = Aut(U/K). Hence in this case it remains to count the number c4 of conjugacy classes of subgroups of order p2 in GL(2, q), see Theorem 6 (b). Thus this adds c4 = 2 + 3wq−1 (4) if p = 2, p(p + 1) c4 = wq−1 (p) + ( + 1)wq−1 (p2 ) + wq+1 (p2 ) if p > 2. 2 The number of groups of order p2 q 2 can now be read off as 4 + c1 + c2 + 2c3 + c4 and this yields the above formulae. • 8 Groups of order p2 qr The groups of order p2 qr have been considered by Glenn [11] and Laue [15]. Glenn’s work has several problems. There are groups missing from the summary tables, there are duplications and some of the invariants are not correct; this affects in particular the summary Table 3. Laue [15, p. 244-62] does not agree with Glenn. We have not compared our results with those of Laue. 17 Theorem: Let p, q and r be different primes with q < r. (a) There is one special case N (22 · 3 · 5) = 13. (b) If q = 2, then N (p2 qr) = 10 + (2r + 7)wp−1 (r) + 3wp+1 (r) + 6wr−1 (p) + 2wr−1 (p2 ). (c) If q > 2, then N (p2 qr) is equal to 2 + (p2 − p)wq−1 (p2 )wr−1 (p2 ) +(p − 1)(wq−1 (p2 )wr−1 (p) + wr−1 (p2 )wq−1 (p) + 2wr−1 (p)wq−1 (p)) +(q − 1)(q + 4)/2 · wp−1 (q)wr−1 (q) +(q − 1)/2 · (wp+1 (q)wr−1 (q) + wp−1 (q) + wp−1 (qr) + 2wr−1 (pq)wp−1 (q)) 11 +(qr + 1)/2 · wp−1 (qr) +(r + 5)/2 · wp−1 (r)(1 + wp−1 (q)) +wp2 −1 (qr) + 2wr−1 (pq) + wr−1 (p)wp−1 (q) + wr−1 (p2 q) +wr−1 (p)wq−1 (p) + 2wq−1 (p) + 3wp−1 (q) + 2wr−1 (p) +2wr−1 (q) + wr−1 (p2 ) + wq−1 (p2 ) + wp+1 (r) + wp+1 (q). Proof: The exists one non-solvable group of order p2 qr and this is the group A5 of order 60. Further, there are two nilpotent groups of order p2 qr. In the following we consider the solvable, non-nilpotent groups G of order p2 qr. Let F be the Fitting subgroup of G. Then F and G/F are both non-trivial and G/F acts faithfully on F := F/φ(F ) so that no non-trivial normal subgroup of G/F stabilizes a series through F . This yields the following cases. • Case |F | = p: In this case F = F and Aut(F ) = Cp−1 . Hence G/F is abelian and has a normal subgroup isomorphic to Cp . This is a non-trivial normal subgroup which stabilizes a series through F . As this cannot occur, this case adds 0. • Case |F | = q: In this case F = F and Aut(F ) = Cq−1 and |G/F | = p2 r. Thus p2 r | (q − 1) and this is impossible, since r > q. Thus this case adds 0. • Case |F | = r: In this case F = F and Aut(F ) = Cr−1 and |G/F | = p2 q. Hence G = Cr ⋊ Cp2 q . Since Aut(Cr ) is cyclic, it has at most one subgroup of order p2 q and this exists if and only if p2 q | (r − 1). By Theorem 11, this case adds c1 := wr−1 (p2 q). • Case |F | = p2 and F ∼ = Cp2 . Then G = Cp2 ⋊ Cqr and Cqr acts faithfully on Cp2 . Note that Aut(Cp2 ) is cyclic of order p(p − 1). Thus this case arises if and only if qr | (p − 1) and in this case there is a unique subgroup of Aut(F ) of order qr. Again by Theorem 11, this case adds c2 := wp−1 (qr). • Case |F | = p2 and F ∼ = Cp2 . Then G = Cp2 ⋊ H with H of order qr and H embeds 2 into Aut(Cp ) = GL(2, p). By Theorem 11, the number of groups G corresponds to the number of conjugacy classes of subgroups of order qr in GL(2, p). By Theorem 6 (c), this adds c3 := c3 := 3r + 7 wp−1 (r) + 2wp+1 (r) if q = 2, 2 qr + q + r + 5 wp−1 (qr) + wp2 −1 (qr)(1 − wp−1 (qr)) if q > 2. 2 • Case |F | = pq: In this case φ(F ) = 1 and Aut(F ) = Cp−1 ×Cq−1 . Thus G/F is abelian and hence G/F ∼ = Cp × Cr . Note that r > q and thus G/F acts on F in such a form that Cp acts as subgroup of Cq−1 and Cr acts as subgroup of Cp−1 . This implies that r | (p − 1) and p | (q − 1). This is a contradiction to r > q and hence this case adds 0. • Case |F | = pr: In this case φ(F ) = 1 and Aut(F ) = Cp−1 × Cr−1 . Thus G/F is abelian and hence G/F ∼ = Cp × Cq . It follows that p | (r − 1) and q | (p − 1)(r − 1). There are two cases to distinguish. First, suppose that the Sylow q-subgroup of G/F acts non-trivially on the Sylow p-subgroup of F . Then q | (p − 1) and G splits over 12 F by [8, Th. 14]. Thus the group G has the form F ⋊ϕ G/F for a monomomorphism ϕ : G/F → Aut(F ). As in Theorem 11, the number of such groups G is given by the number of subgroups of order pq in Aut(F ). As the image of the Sylow p-subgroup of G/F under ϕ is uniquely determined, it remains to evaluate the number of subgroups of order q in Aut(F ) that act non-trivally on the Sylow p-subgroup of F . This number is 1 + (q − 1)wr−1 (q). As second case suppose that Cq acts trivially on Cp . Then q | (r − 1) and the action of G/F on F is uniquely determined. It remains to determine the number of extensions of G/F by F . By [8, Th. 14] there exist two isomorphism types of extensions in this case. In summary, this case adds c4 := wr−1 (p)(wp−1 (q)(1 + (q − 1)wr−1 (q)) + 2wr−1 (q)). • Case |F | = qr: In this case G has the form G ∼ = N ⋊ϕ U with N ∼ = Cq × Cr and 2 |U | = p and ϕ : U → Aut(N ) a monomorphism. By Theorem 11, we have to count the number of subgroups of order p2 in Aut(N ). Note that Aut(N ) ∼ = Cq−1 × Cr−1 . Thus the number of subgroups of the form Cp2 in Aut(N ) is c5a := wq−1 (p)wr−1 (p). It remains to consider the number of cyclic subgroups of order p2 in Aut(N ). This number depends on gcd(q − 1, p2 ) = pa and gcd(r − 1, p2 ) = pb . If a, b ≤ 1, then this case does not arise. Thus suppose that a = 2. If b = 0, then this yields 1 group. If b = 1, then this yields p groups. If b = 2, then this yields p(p + 1) groups. A similar results holds for the dual case b = 2. We obtain that this adds c5b := wq−1 (p2 )(1 − wr−1 (p)) + pwq−1 (p2 )wr−1 (p)(1 − wr−1 (p2 )) + p(p + 1)wq−1 (p2 )wr−1 (p2 ) + wr−1 (p2 )(1 − wq−1 (p)) + pwr−1 (p2 )wq−1 (p)(1 − wq−1 (p2 )). In summary, this case adds c5 = c5a + c5b = (p2 − p)wq−1 (p2 )wr−1 (p2 ) +(p − 1)(wq−1 (p2 )wr−1 (p) + wr−1 (p2 )wq−1 (p)) +wq−1 (p2 ) + wr−1 (p2 ) + wq−1 (p)wr−1 (p). ∼ N ⋊ϕ U with N ∼ • Case |F | = pqr: In this case G has the form G = = Cq × Cr and 2 |U | = p and ϕ has a kernel K of order p. Again, we use Theorem 11 to count the number of arising cases. The group U is either cyclic or U ∼ = Cp2 . In both cases, there is one Aut(U )-class of normal subgroups K of order p in U and this satsifies that AutK (U ) maps surjectively on Aut(U/K). Thus it remains to count the number of subgroups of order p in Aut(N ). As Aut(N ) = Cq−1 × Cr−1 , this case adds c6 := 2(wq−1 (p) + wr−1 (p) + (p − 1)wq−1 (p)wr−1 (p)). 13 • Case |F | = p2 q: Then G ∼ = F ⋊ϕ U with F = N × Cq and |N | = p2 and U ∼ = Cr . By Theorem 13 we have to count the number of conjugacy class representatives of subgroups of order r in Aut(F ). Recall that r > q and Aut(F ) = Aut(N ) × Cq−1 . Thus it remains to count the number of conjugacy classes of subgroups of order r in Aut(N ). If N is cyclic, then Aut(N ) ∼ = Cp(p−1) and this number is wp−1 (r). If 2 ∼ ∼ N = Cp , then Aut(N ) = GL(2, p) and this number is determined in Theorem 6 (a). In summary, this case adds c7 := r+5 wp−1 (r) + wp+1 (r). 2 • Case |F | = p2 r: This case is dual to the previous case with the exception that now the bigger prime r is contained in |F |. A group of this type has the form N ⋊ϕ U with N nilpotent of order p2 r and U ∼ = Cq . We consider the two cases on N . If N is cyclic, then N = Cp2 × Cr and Aut(N ) = Cp(p−1) × Cr−1 . In this case we can use Theorem 13 to count the desired subgroups as c8a := wp−1 (q) + wr−1 (q) + (q − 1)wp−1 (q)wr−1 (q). Now we consider the case that N = Cp2 × Cr . In this case we use a slightly different approach and note that all groups in this case have the form M ⋊ϕ V with M = Cp2 and |V | = qr. If V is cyclic, then ϕ : V → Aut(M ) has a kernel K of order r. The other option is that V is non-abelian and thus of the form V = Cr ⋊ Cq . In this case the kernel K of ϕ has order r or qr. We use Theorem 11 to count the number of arising cases. If V is cyclic, then it is sufficient to count the conjugacy classes of subgroups of order q in Aut(M ). By Theorem 6 this adds c8b := sq (GL(2, p)). If V is non-abelian, then q | (r − 1). We consider Theorem 11 in more detail. First, suppose that |K| = qr. Then ϕ is trivial and uniquely defined. Thus it remains to consider the case that |K| = r. Then the subgroup AK ≤ Aut(V /K) induced by StabAut(V ) (K) is the trivial group. Let S be a set of conjugacy class representatives of subgroups of order q in GL(2, p) and for S ∈ S let AS denote the subgroup of Aut(V /K) induced by the normalizer of S in GL(2, p). Then Theorem 11 yields that the number of groups arising in this case is X c8c := wr−1 (q)(1 + Aut(V /K)/AS . S∈S Next, note that AS can be determined via Remark 7. As Aut(V /K) = Cq−1 , it follows that c8c = 3 if q = 2, c8c = wr−1 (q)(1 + q−1 (q − 1)(q + 2) wp−1 (q) + wp+1 (q)) otherwise. 2 2 In summary, this case adds c8 = c8a + c8b + c8c and this can be evaluated to c8 = 8 if q = 2 and if q > 2 then c8 = (q − 1)(q + 4) wp−1 (q)wr−1 (q) 2 14 q−1 wp+1 (q)wr−1 (q) 2 q+5 wp−1 (q) + 2 +2wr−1 (q) + wp+1 (q). + It now remains to sum up the values for the different cases to determine the final result. • 9 Final comments The enumerations of this paper all translate to group constructions. It would be interesting to make this more explicit and thus to obtain a complete and irredundant list of isomorphism types of groups of all orders considered here. References [1] G. Bagnera. Works. Rend. Circ. Mat. Palermo (2) Suppl., 60:xxviii+381, 1999. With a preface by Pasquale Vetro, Edited by Guido Zappa and Giovanni Zacher. [2] H. U. Besche and B. Eick. Construction of finite groups. J. Symb. Comput., 27:387 – 404, 1999. [3] H. U. Besche, B. Eick, and E. O’Brien. SmallGroups - a library of groups of small order, 2016. A GAP 4 package; Webpage available at www.icm.tubs.de/ag algebra/software/small/small.html. [4] H. U. Besche, B. Eick, and E. A. O’Brien. A millenium project: constructing small groups. Internat. J. Algebra Comput., 12:623 – 644, 2002. [5] S. Blackburn, P. Neumann, and G. Venkataraman. Enumeration of finite groups. Cambridge University Press, 2007. [6] A. Cayley. On the theory of groups, as depending on the symbolic equation θ n = 1. Philos. Mag., 4(7):40 – 47, 1854. [7] J. Conway, H. Dietrich, and E. O’Brien. Counting groups: gnus, moas and other exotica. Math. Intelligencer, 30:6–15, 2008. [8] H. Dietrich and B. Eick. Groups of cube-free order. J. Algebra, 292:122 – 137, 2005. [9] B. Eick, M. Horn, and A. Hulpke. Constructing groups of small order: Recent results and open problems. Submitted to DFG Proceedings, 2016. [10] B. Girnat. Klassifikation der Gruppen bis zur Ordnung p5 . Staatsexamensarbeit, TU Braunschweig, 2003. [11] O. E. Glenn. Determination of the abstract groups of order p2 qr; p, q, r being distinct primes. Trans. Amer. Math. Soc., 7:137–151, 1906. 15 [12] G. Higman. Enumerating p-groups. II: Problems whose solution is porc. Proc. London Math. Soc., 10:566 – 582, 1960. [13] O. Hölder. Die Gruppen der Ordnungen p3 , pq 2 , pqr, p4 . Math. Ann., 43:301 – 412, 1893. [14] O. Hölder. Die Gruppen mit quadratfreier Ordnungzahl. Göttingen, Math.-Phys. Kl, pages 211 – 229, 1895. Nachr. Ges. Wiss. [15] R. Laue. Zur Konstruktion und Klassifikation endlicher auflösbarer Gruppen, 1982. [16] R. Le Vavasseur. Les groupes d’ordre p2 q 2 , p étant un nombre premier plus grand que le nombre premier q. C. R. Acad. Sci. Paris Vie Académique, 128:1152–1153, 1899. [17] R. Le Vavasseur. Les groupes d’ordre p2 q 2 , p étant un nombre premier plus grand que le nombre premier q. Ann. de l’Éc. Norm. (3), 19:335–355, 1902. [18] H.-L. Lin. On groups of order p2 q, p2 q 2 . Tamkang J. Math., 5:167–190, 1974. [19] M. F. Newman, E. A. O’Brien, and M. R. Vaughan-Lee. Groups and nilpotent Lie rings whose order is the sixth power of a prime. J. Alg., 278:383 – 401, 2003. [20] E. A. O’Brien and M. R. Vaughan-Lee. The groups with order p7 for odd prime p. J. Algebra, 292(1):243–258, 2005. [21] L. Pyber. Group enumeration and where it leads us. In European Congress of Mathematics, Vol. II (Budapest, 1996), volume 169 of Progr. Math., pages 187–199. Birkhäuser, Basel, 1998. [22] D. J. S. Robinson. Applications of cohomology to the theory of groups. In C. M. Campbell and E. F. Robertson, editors, Groups - St. Andrews 1981, number 71 in LMS Lecture Note Series, pages 46 – 80. Cambridge University Press, 1981. [23] D. Taunt. Remarks on the isomorphism problem in theories of construction of finite groups. Proc. Cambridge Philos. Soc., 51:16 – 24, 1955. [24] A. Western. Groups of order p3 q. Proc. London Mat. Soc., 30:209–263, 1899. 16
4math.GR
Asymmetric dynamics of outer automorphisms arXiv:1608.01550v1 [math.GR] 4 Aug 2016 Mark C. Bell University of Illinois mcbell@illinois.edu March 29, 2018 Abstract We consider the action of an irreducible outer automorphism φ on the closure of Culler–Vogtmann Outer space. This action has north-south dynamics and so, under iteration, points converge exponentially to [T+φ ]. For each N ≥ 3, we give a family of outer automorphisms φk ∈ Out(FN ) such that as, k goes to infinity, the rate of convergence of φk goes to infinity while the rate of convergence of φ−1 goes to one. Even k if we only require the rate of convergence of φk to remain bounded away from one, no such family can be constructed when N < 3. This family also provides an explicit example of a property described by Handel and Mosher: that there is no uniform upper bound on the distance between the axes of an automorphism and its inverse. keywords. Outer automorphism, rate of convergence, asymmetric. Mathematics Subject Classification 2010: 37E25, 20E05, 37D20 An irreducible outer automorphism φ ∈ Out(FN ) acts on CV N , the closure of Culler–Vogtmann Outer space [11, Section 1.4], with north-south dynamics [8, Theorem 1.1]. Therefore its action has a pair of fixed points [T+φ ], [T−φ ] ∈ ∂CV N and under iteration points in CV N (other than [T−φ ]) converge to [T+φ ]. There is a natural embedding of CV N into RPC , where C is the set of conjugacy classes of the free group FN . In this embedding, the w ∈ C coordinate of a marked graph (G, g) ∈ CV N is given by the length of the shortest loop in G which is freely homotopic to g(w) [11, Page 5]. In this coordinate system the convergence to [T+φ ] is exponential. To measure the rate of this convergence we recall two definitions from [1]. Definition 1 ([1, Definition 1.2]). Suppose that f ∈ Z[x] is a polynomial with roots λ1 , . . . , λm , ordered such that |λ1 | ≥ |λ2 | ≥ · · · ≥ |λm |. The spectral ratio of f is ω(f ) := |λ1 /λ2 |. Definition 2. Suppose that φ ∈ Out(FN ) is an irreducible outer automorphism. Let µλ(φ) ∈ Z[x] denote the minimal polynomial of its stretch factor λ(φ). The spectral ratio of φ is ω(φ) := ω(µλ(φ) ). 1 As described in [1], the rate of convergence of [T ·φn ] to [T+φ ] is determined by ω(φ). Thus we state the main result of this paper, a complete characterisation of when it is possible to build outer automorphisms which converge rapidly in one direct but slowly in the other, in terms of the spectral ratio: Theorem 3. There is a family of fully irreducible outer automorphisms φk ∈ Out(FN ) such that ω(φk ) → ∞ but ω(φ−1 k ) → 1 if and only if N ≥ 3. This gives another difference between irreducible outer automorphisms and pseudo-Anosov mapping classes of surfaces. A pseudo-Anosov mapping class h ∈ Mod+ (S) has its spectral ratio ω(h) defined in terms of its dilatation [1, Definition 1.3]. However, h and h−1 have the same dilatation [3, Proposition 11.3] and so ω(h) = ω(h−1 ) automatically. It is straightforward to prove the forward direction of Theorem 3 by considering its contrapositive: • When N = 1 there is nothing to check as all automorphisms of F1 are finite order. • When N = 2, any irreducible outer automorphism φ ∈ Out(F2 ) is geometric. Hence there is a pseudo-Anosov mapping class on S1,1 , the oncepunctured torus, which induces φ on π1 (S1,1 ). However, the spectral ratio of any pseudo-Anosov mapping class of the once-punctured torus is at least ϕ4 = 6.854101 · · · , where ϕ is the golden ratio [1, Section 3.3]. Therefore ω(φ) = ω(φ−1 ) ≥ ϕ4 and so these are both bounded away from one. Thus we devote the remainder of this paper to constructing an explicit family of outer automorphisms of FN = ha1 , a2 , . . . , aN i, for fixed N ≥ 3. To do this, we start by considering the polynomials f (x, y) := xN − yxN −1 − 1 and g(x, y) := xN − yxN −2 − 1 in Q[x, y]. Since these are linear polynomials in y, they are irreducible over Q. Therefore, by Hilbert’s irreducibility theorem [7, Chapter 9], there are infinitely many integers k ≥ 3 such that pk (x) := f (x, k) and qk (x) := g(x, k) are both irreducible. Lemma 4. Suppose that k ≥ 3. The polynomial pk has N − 1 roots inside of the unit circle and one root in [k, k + 1]. Similarly, the √ polynomial qk has N − 2 √ k + 1, − k − 1] and one root in roots inside of the unit circle, one root in [− √ √ [ k − 1, k + 1]. For example, see Figure 1. Proof. Let h(z) := −kz N −1 . Then when |z| = 1 we have that |(pk − h)(z)| = |z N − 1| ≤ 2 < |pk (z)| + |h(z)|. Therefore, by Rouché’s theorem, pk must have the same number of roots inside of the unit circle as h does. Hence pk has N − 1 roots inside of the unit circle. Furthermore, since deg(pk ) = N , there is only one more root to locate. The intermediate value theorem now shows it must lie in [k, k + 1]. Applying the same argument with h(z) := −kz N −2 to qk shows it must have N − 2 roots inside of the Again, we √ unit circle. √ √ verify that the other two roots √ of qk lie in [− k + 1, − k − 1] and [ k − 1, k + 1] by using the intermediate value theorem. 2 400 200 −10 −5 5 10 −200 −400 g100 (x) −600 −800 f10 (x) Figure 1: The polynomials p10 and q100 when N = 3. In fact knowing the positions of the roots allows us to show many of these polynomials are irreducible directly. Lemma 5. Whenever k ≥ 3, the polynomial pk is irreducible over Z. Proof. First assume that there is a z such that |z| = 1 and pk (z) = 0 and so 1 = |z N − kz N −1 | = |z − k|. However this would mean that |k| ≤ |k − z| + |z| = 2 which contradicts the fact that k ≥ 3. Hence pk cannot have a root on the unit circle. Now assume that pk is reducible. Then one of its factors, q ∈ Z[x], must have all of its roots inside of the unit circle. Therefore the constant term of q, which is the product of its roots, must have modulus less than one. However this means that the constant term of q must be zero and so zero is a root of pk , which is false. Similarly, by taking into account the symmetry of the roots, the same argument also shows that qk is irreducible whenever k ≥ 3 and N is even. Furthermore, for many of the low, odd values of N we can find a prime p and k 0 ∈ Z/pZ such that the image of qk0 in (Z/pZ)[x] is irreducible. It then follows that qk is irreducible whenever k ≡ k 0 (mod p). Some of these values are shown in Table 1. N p k0 3 2 1 5 2 1 7 3 1 9 3 0 11 2 1 13 7 4 15 3 1 17 7 4 19 3 1 21 2 1 23 5 4 25 5 0 27 3 0 29 2 1 Table 1: qk is irreducible whenever k ≡ k 0 (mod p). Now, following [4, Page 3154], let φk ∈ Out(FN ) be the outer automorphism given by: aN 7→ aN −1 7→ aN −2 7→ · · · 7→ a2 7→ a1 7→ ak1 aN . We use this family to conclude the remaining direction of Theorem 3: 3 Theorem 6. Suppose that k ≥ 3 is such that pk and qk are both irreducible. The outer automorphisms φk and φ−1 and fully irreducible. k are non-geometric √ −1 Furthermore, ω(φk ) ≥ k while ω(φk ) < 1 + 1/ k. Proof. We interpret φk as a piecewise-linear homotopy equivalence f of the N – petalled rose. Since this is a positive automorphism, this is a train track map [2]. The transition matrix of this map is:   k 0 0 ... 0 1  1 0 0 ... 0 0     0 1 0 ... 0 0    A :=  0 0 1 . . . 0 0     .. .. .. . . . .   . . . . .. ..  0 0 0 ... 1 0 and, up to a sign, the characteristic polynomial of A is xN − kxN −1 − 1 = pk (x). We chose k so that this polynomial is irreducible and so ω(φk ) = ω(pk ). Now by Lemma 4 this polynomial has N − 1 roots that lie in the interior of the unit circle and one root in [k, k + 1]. Hence λ(φk ) ≈ k and ω(φk ) = ω(pk ) ≥ k. On the other hand, φ−1 k is given by: a1 7→ a2 7→ a3 7→ · · · 7→ aN −1 7→ aN 7→ a−k N −1 a1 . Again, we consider this as a piecewise-linear homotopy equivalence g of the N – petalled rose. Direct calculation of the turns involved shows that this is again a train track map and that its transition matrix is:   0 1 0 ... 0 0  0 0 1 ... 0 0     0 0 0 ... 0 0    B :=  . . . . . . ... ...    .. .. ..    0 0 0 ... 0 1  1 0 0 ... k 0 Up to a sign, the characteristic polynomial of B is xN − kxN −2 − 1 = qk (x). Again, we chose k so that this polynomial is irreducible and so ω(φk ) = ω(qk ). Thus by Lemma 4 this polynomial has √ √ N − 2 roots that lie in the √ interior √ of the unit circle, one√root in [− k + 1, − k − 1] and one root in [ k − 1, k + 1]. Thus, λ(φk ) ≈ k and so √ k+1 1 √ ω(φ−1 ) = ω(q ) ≤ ≤1+ √ k k k−1 k as required. It also follows from this computation that λ(φk ) 6= λ(φ−1 k ) and so φk is a non-geometric automorphism. 4 Now suppose that f has no periodic Nielsen paths [10, Page 25]. Note that the local Whitehead graph of f is connected [10, Page 25] and A is a Perron– Frobenious matrix. Thus by the Full Irreducibility Criterion [10, Lemma 9.9] we have that φk is fully irreducible. On the other hand, if f has a periodic Nielsen path then φk must be parageometric [4, Page 3155]. Thus φ−1 k is not parageometric [5, Corollary 2] and so g has no periodic Nielsen paths. Again, the local Whitehead graph of g is connected and B is a Perron–Frobenious matrix, hence φ−1 k is fully irreducible. In either case, φk and φ−1 are both fully irreducible. k Handel and Mosher described how there is no uniform upper bound, depending only on N , on the distance between the axes of φ and φ−1 [6, Section 7.1]. We finish by noting that φk is an explicit family of such outer automorphisms. Theorem 7. Suppose that k ≥ 5 is such that pk and qk are both irreducible. 5 There are axes for φk and φ−1 k which are separated by at least N − 2 log(k)−6. Proof. For ease of notation let λk := λ(φk ) and λ̄k := λ(φ−1 k ). Begin by noting that the Perron–Frobenious eigenvectors of the matrices A and B in the proof of Theorem 6 are    N −1  1 λk  λ̄k   λN −2      k ..     . ..   and     N.−2     λ̄  λk  k N −1 1 λ̄k respectively. Let X0 and Y0 be the metric graphs in Outer space corresponding to N –petalled roses with these lengths assigned. Then X0 and its images Xi := X0 · φik lie on an axis of φk . Similarly, Y0 and its images Yi := Y0 · φ−i k lie on an axis of φ−1 . k We note that d(Xi , Xi+1 ) = log(λk ) and d(Yi , Yi+1 ) = log(λ̄k ). Furthermore, direct calculation of the lengths of candidate loops shows that d(Xi , Yi ) ≤ d(Xi , Yj ) for every i and j and that ! N N −1 − λ̄ λ̄ λN − 1 k k k ≥ (N − 1) log(k) − 4. d(Xi , Yi ) = log · λk − 1 λ̄N k −1 Therefore suppose that the distance between these two axes is realised by points X and Y . Without loss of generality we may assume that X lies in the segment [Xi , Xi+1 ] and that Y lies in the segment [Yj−1 , Yj ]. However, as shown in Figure 2, d(X, Y ) ≥ d(Xi , Yj ) − d(Xi , X) − d(Y, Yj ). √ As λk ≤ k +1 and λ̄k ≤ k + 1, the right hand side of this inequality is bounded below by   3 5 (N − 1) log(k) − 4 − log(k + 1) ≥ N − log(k) − 6 2 2 as required. 5 φk log(k) Xi X Xi+1 (N − 1) log(k) − 4 Y Yj φ−1 k 1 2 Yj−1 log(k) Figure 2: Axes of φk and φ−1 k . We note that for each φk the turns {ai , aj } are all illegal. Hence these are never lone axis automorphisms [9, Theorem 3.9]. Similarly, for each φ−1 the k := := turns {a−1 , a } (where the indices wrap over so a a and a a2 ) i+2 N +1 1 N +2 i are all illegal and so these are also never lone axis automorphisms. Question 8. Are there axes of φk and φ−1 that remain within a uniformly k bounded distance of each other? Remark 9. From the eigenvectors above, we also see that as k goes to infinity these axes enter thinner and thinner parts of Outer space. Acknowledgements. The author wishes to thank Yael Algom-Kfir and Christopher J. Leininger for many helpful discussions regarding this result. References [1] Mark C. Bell and S. Schleimer. Slow north-south dynamics on PML. ArXiv e-prints, December 2015. [1, 2] [2] Mladen Bestvina and Michael Handel. Train tracks and automorphisms of free groups. Ann. of Math. (2), 135(1):1–51, 1992. [4] [3] Benson Farb and Dan Margalit. A primer on mapping class groups, volume 49 of Princeton Mathematical Series. Princeton University Press, Princeton, NJ, 2012. [2] [4] Michael Handel and Lee Mosher. Parageometric outer automorphisms of free groups. Trans. Amer. Math. Soc., 359(7):3153–3183 (electronic), 2007. [3, 5] [5] Michael Handel and Lee Mosher. Parageometric outer automorphisms of free groups. Trans. Amer. Math. Soc., 359(7):3153–3183 (electronic), 2007. [5] [6] Michael Handel and Lee Mosher. Axes in outer space. Mem. Amer. Math. Soc., 213(1004):vi+104, 2011. [5] 6 [7] Serge Lang. Fundamentals of Diophantine geometry. Springer-Verlag, New York, 1983. [2] [8] Gilbert Levitt and Martin Lustig. Irreducible automorphisms of Fn have north-south dynamics on compactified outer space. J. Inst. Math. Jussieu, 2(1):59–72, 2003. [1] [9] L. Mosher and C. Pfaff. Lone Axes in Outer Space. ArXiv e-prints, November 2013. [6] [10] C. Pfaff. Constructing and Classifying Fully Irreducible Outer Automorphisms of Free Groups. ArXiv e-prints, May 2012. [5] [11] Karen Vogtmann. Automorphisms of free groups and outer space. In Proceedings of the Conference on Geometric and Combinatorial Group Theory, Part I (Haifa, 2000), volume 94, pages 1–31, 2002. [1] 7
4math.GR
1 Topology Estimation using Graphical Models in Multi-Phase Power Distribution Grids arXiv:1803.06531v1 [cs.SY] 17 Mar 2018 Deepjyoti Deka*, Michael Chertkov*†, and Scott Backhaus* * Los Alamos National Laboratory, New Mexico, USA †Skolkovo Institute of Science and Technology, Moscow, Russia Abstract—Distribution grid is the medium and low voltage part of a large power system. Structurally, the majority of distribution networks operate radially, such that energized lines form a collection of trees, i.e. forest, with a substation being at the root of any tree. The operational topology/forest may change from time to time, however tracking these changes, even though important for the distribution grid operation and control, is hindered by limited real-time monitoring. This paper develops a learning framework to reconstruct radial operational structure of the distribution grid from synchronized voltage measurements in the grid subject to the exogenous fluctuations in nodal power consumption. To detect operational lines our learning algorithm uses conditional independence tests for continuous random variables that is applicable to a wide class of probability distributions of the nodal consumption and Gaussian injections in particular. Moreover, our algorithm applies to the practical case of unbalanced three-phase power flow. Algorithm performance is validated on AC power flow simulations over IEEE distribution grid test cases. Keywords—Distribution networks, Power flow, Unbalanced threephase, Graphical models, Conditional independence, Computational complexity I. I NTRODUCTION The operation of a large power grid is separated into different tiers/levels: transmission grid that consists of high voltage lines connecting the generators to the distribution substations, and distribution grid consisting of the medium and low voltage lines that connect distribution substations to loads. The structure of the transmission grid is made loopy to reliable delivery of electricity to substations via multiple, redundant paths. On the other hand, typical distribution grids are operationally radial (tree-like) with the substation at the root and loads positioned along the non-root nodes of the tree. The radial topology is selected from a subset of power distribution lines, which overall i.e. structurally form a loopy graph, by switching on/off breakers [1]. An illustration of the radial operational topology is presented in Fig. 1. Topology estimation in the distribution grid thus refers to the problem of determining the current set of operational lines which are energized, i.e. with respective switch statuses ‘on’. These Deepjyoti Deka and Scott Backhaus are with Los Alamos National Laboratory, Los Alamos, NM 87544. Email: deepjyoti@lanl.gov (corresponding author), backhaus@lanl.gov M. Chertkov is with Los Alamos National Laboratory, Los Alamos, NM and Skolkovo Institute of Science and Technology, Russia. Email: chertkov@lanl.gov This work was supported by U.S. Department of Energys Office of Electricity as part of the DOE Grid Modernization Initiative. changes may conducted in an ad-hoc way without proper and timely reporting to the distribution system operator. Accurate topology estimation in the distribution grid is necessary for checking system status/integrity, e.g. failure detection, and also for taking consecutive optimization and control decisions. Real-time topology estimation is hindered by the limited presence of real-time line-based measurements (flow and/or breaker statuses) in the distribution grid [2]. This reduced monitoring ability is often a legacy: in the past, and still today, distribution grids have received much less attention as compared to the backbone/transmission system. However these practices are under review - there has been an emerging effort in providing better observability at the distribution level through deployment of advanced nodal measurement devices like Phasor Measurement Units (PMUs) [3], micro-PMUs [4], Frequency Monitoring Network (FNET) [5] systems and alike. Similarly, smart devices like air-conditioners, thermostats and plug-in electric vehicles have built-in voltage/frequency monitors for their performance regulation, e.g. through participation in demand response programs. Such devices and smart meters are capable of providing real time measurements of voltages and frequency, though often limited to the grid nodes. The goal of this paper is to utilize nodal measurements of voltages, captured e.g. by smart meters, to efficiently estimate the operational radial topology of the distribution grids. It is worth mentioning that given a loopy set of permissible edges, one can construct a large set of candidate radial topologies. Thus brute force search of the current operating topology is computationally prohibitive. In this work, we overcome this combinatorial difficulty by utilizing the framework of graphical models to characterize nodal voltages in the operationally radial grid and design a topology learning algorithm based on it. Our learning framework is very general, in particular applicable to both single-phase and multi-phase systems characterized by possibly unbalanced power flows. Furthermore our learning algorithm does not require explicit information on the individual nodes’ injections or the value of line impedances. This reconstruction with limited information is of practical significance as line parameters in the distribution grids while changing/evolving are seldom calibrated and may not be known with the precision sufficient for topology estimation. A. Prior Work Topology learning, in power grids in general and in distribution grids in particular, is a fast growing area of research. Past research efforts in this area differ by the methodology for edge 2 detection, available measurements and the types of the flow model used. In the case of loopy transmission grids [6] uses a maximum likelihood estimator with low-rank and sparsityenforcing regularizers to estimate the grid structure from the information availaible via electricity prices. [7] uses a Markov random field model for bus phase angles to build a dependency graph to detect faults in grids. For linearized power flow models in radial grids with constant R/X (resistance to reactance) ratio, [8] presents a topology identification algorithm using the sign of inverse covariance matrix. [1], [9], [10], [11] present greedy structure learning algorithm using trends in second order moments of nodal voltage magnitudes for linearized power flow models, where observations are known only at a subset of the grid nodes. Sets of line flow measurements have been used for topology estimation using maximum likelihood tests in [12]. Further, there have been data-driven efforts to identify topology and phase in distribution grids. [13], [14], [15] include machine learning schemes that compare available time-series observations from smart meters with database of permissible signatures to identify topology changes, phase recovery and parameter estimation. The mentioned literature considers measurements from static power flow models. For measurements arising from system dynamics (swing equations), a graphical model based reconstruction scheme has been proposed to identify the operational topology in radial grids [16], loopy grids [17], [18]. In the broader category of multi-variate random distribution, graphical models [19] provide an important graphical tool to model the dependence/interaction structure between different variables. It has been used in learning, estimation and prediction problems in diverse fields like natural languages, genetic networks, social interactions, decoding in communication schemes etc. A group lasso and graph lasso based approximate scheme for topology identification in loopy grids is discussed in [20], [21]. In contrast to prior work, a majority of distribution grids are unbalanced [22] and have three-phase voltages and injections at different nodes. The overarching goal of this work is to present an efficient algorithm for topology estimation using multi-phase nodal voltages from a radial distribution grid using the graphical model framework. well as additional edges relating two-hop neighbors in the gridgraph. Based on this factorization of the voltage distribution, we present our learning algorithm that uses conditional independence based tests (4 nodes per test, which we also call “quartet”) to identify the operational edges. In the special case where nodal injection fluctuations are modelled by Gaussian probability distributions, the conditional independence quartet test reduces to a test of voltage covariances at the nodes of the quartet. Our learning framework has several computational and practical advantages. First, the framework is independent of the exact probability distribution for each individual node’s power usage and voltage profile, and hence applicable to general distributions. Second, it does not require knowledge of line impedances and similar network parameters that are calibrated infrequently and hence may not be known accurately. Third, the computational complexity of each edge detection test does not grow with the network size - that is the test is local. Each test considers only a set of four nodes. Furthermore, the tests can be conducted in a distributed fashion. These results extend what was reported earlier in a conference version [25] where a single-phase version of this paper’s results were presented with limited simulations. To the best of our knowledge, this is the first work claiming a provable topology learning algorithm for three-phase distribution grids. The material in the manuscript is organized as follows. The next, technical introduction, section provides a brief discussion of the distribution grid topology, power flow models and associated nomenclature. The linearized three-phase power flow model and its single-phase counterpart are described in Section III. Section IV analyzes the graphical model of power grid voltage measurements (we emphasize that the induced graphical model is built from but different from the grid-graph itself). Conditional independence properties of the voltage distribution are introduced and utilized in Section V to develop our main learning algorithm. Section VI is devoted to discussion of the details of the conditional independence quartet test. Experimental results on the algorithm’s IEEE radial networks test are presented in Section VIII. The last section is reserved for conclusions. B. Contribution In this paper, we consider multi-phase power flows in a distribution grid and aim to estimate the radial operational topology using measurements of nodal voltages. The first contribution of this work is the development of a linearized coupled three-phase power flow model that generalizes our prior work in single-phase power flow model [1] and also relates to similar linearized models specific to radial grids [23], [24]. We analyze the probability distribution of the three-phase complex nodal voltages in the grid through the framework of graphical models. The second contribution of this work consists of proving that under standard assumptions about fluctuations of power consumption the distribution of nodal voltages can be described by a specific chordal graphical model. We show that the edges in the graphical model include both the actual operational lines/edges of the grid-graph as II. D ISTRIBUTION G RID : S TRUCTURE & P OWER F LOWS A. Structure Radial Structure: The distribution grid is represented by a radial graph G = (V , E ), where V is the set of buses/nodes of the graph and E is the set of undirected lines/edges. The operational edge set E is realized by closing switches in an over-complete set of functional lines/edges E f ull (see Fig. (1)). The operational grid (note a difference with the functional gridgraph) is a collection of K disjoint trees, ∪k=1,··· ,K Tk , where each tree Tk spans a subset of the nodes VTk with a substation at the root node and connected by the set of operational edges ETk . We denote nodes by letters i, j and so on. The undirected ledge (line) connecting nodes i and j is denoted by (i j). The non-substation terminal nodes with degree one are called ‘leaf’ nodes. Node connected to a leaf node is called its ‘parent’ node. Nodes with degree greater than 1 are called ‘non-leaf’ 3 Fig. 1. Schematic of a radial distribution grid with substations represented by large red nodes. The operational grid is formed by solid lines (black). Load nodes within each tree are marked with the same color. nodes. Path Pi j : i − π1 − π2 − ..πn − j denotes the unique set of nodes such that edges (iπ1 ), (π1 π2 ), ..(πn j) connect i and j. To circumvent notational complications we limit in the remainder of the manuscript our topology learning problem to grids containing only one operational tree T = G = (V , E ). (Extension to the case of an operational forest layout is straightforward.) However, prior to discussing the learning, we will first review in the next subsection AC power flow models on a general graph-grid (which is not necessarily a tree). B. Power Flow models Notations: Real-/complex- valued quantities are represented in lower/upper case. We use hat- notation for a vector variable with components in multiple phases. The per phase component is described without the hat, with a particular phase as a superscript. The value of a variable at a specific grid location (bus or line) is marked by a subscript. If no subscript is mentioned, it refers to the vector of values for the variable at all permissible locations. For example, Ŵi (ŵi ) represents a multi-phase complex (real) variable at location i, while Wia (wai ) represents its value at the node i and phase a. W a (wa ) represents the vector with complex (real) values at all locations, for phase a. Single-Phase Power Flow (AC-PF): Here the voltages, currents and injections in the entire grid are defined over a single-phase (say phase a) that is skipped from notation in this paragraph notations for convenience. According to the Kirchhoff’s laws, the complex valued AC-PF equations governing power flow leaving node i of the grid-graph G = (V , E ) is given by: ∀i ∈ V : Pi = pi + ĩqi = v2i − vi v j eĩθi −ĩθ j Zi∗j j:(i j)∈E ∑ (1) where the real valued scalars, vi , θi , pi and qi denote, respectively, the voltage magnitude, phase, active and reactive power injection at node i. Vi (= vi exp(ĩθi )) and Pi mark, respectively, the nodal complex voltage and injection (ĩ2 = −1). Zi j = ri j + ĩxi j is the impedance of the line (i j). ri j (xi j ) stands for the line resistance (reactance). The unbalanced power flow equations over three phases are described next. Three-Phase Unbalanced Power Flow (AC-PF3) 1 : In a real-world setting, AC power systems have three unbalanced 1 Note that even though we discuss solely a three-phase system, our analysis extends to a general m phase system. phases that operate over four wires (one for each phase and a common ground). Consequently, the active and reactive power injections at each bus are not scalars but have 3 components each. Similarly, the complex voltage (magnitude and phase) at each bus and the power flows on each line are of sizes 3 × 1, with a component for each phase. Using the notation described earlier, the three-phase complex power injections (P̂) and complex voltages (V̂ ) in the grid are  a   a  a  a   a ĩθa  vi e i Pi pi qi Vi b ∀i ∈ V : P̂i = Pib  =  pbi  + ĩ qbi  , V̂i = Vib  = vbi eĩθi  c c c c c Pi pi qi Vi vbi eĩθi Here, [θai θbi θci ]T stands for the voltage phase angles at node i. Reference phase angles in the three phase system (all defined modulo 2π) are θ̂re f = [0 2π/3 − 2π/3]T (2) Impedance on line (i j) is represented by a 3 × 3 symmetric matrix Ẑ which relates the three phase current Iˆi j over line (i j) to the voltage difference according to (3) Ẑi j Iˆi j = Ẑi j [Iiaj Iibj Iicj ]T = (V̂i − V̂ j )  aa ab ac   aa ab ac  ri j ri j ri j xi j xi j xi j bc  bb where Ẑi j = r̂i j + ĩx̂i j = ribaj ribbj ribcj  + ĩ xba i j xi j xi j cc cb ca cc cb ca xi j xi j xi j ri j ri j ri j Note that the diagonal values in Ẑi j denote the in-phase impedances, while the off-diagonal values denote the interphase impedances of the line. The real-valued resistance (r̂i j ) and reactances (x̂i j ) have a similar structure. The Kirchoff laws in three phases (AC-PF3) for the configuration F are then given by:   ∀i ∈ V : P̂i = ∑ diag V̂i IˆiHj = ∑ diag V̂i (V̂iH − V̂ jH )Ŷi j (4) j:(i j)∈E j:(i j)∈E where Ŷi j , the inverse of ẐiHj , is the three phase admittance matrix with in and out of phase components as described for Z. Note that Eq. (4) is the generalization of the Eq. (1) from one to three phases. In the next section, we introduce linear approximation to power flows. It is done first for the single-phase case and then extended to the case of the three phase unbalanced grids. The approximation is derived under assumptions that fluctuations in voltage magnitudes and phases between connected nodes are small. The assumptions are realistic for distribution grids functioning in the operationally stable regime. III. L INEAR P OWER FLOW M ODELS In this section we discuss a linear coupled approximate model (LC-PF3) for three phase unbalanced power flow. We show that it generalizes the linear power flow model (LCPF) that was discussed in our previous work [1] for the case of the single-phase network. In terms of functionality, LCPF3 model is geared more towards medium and low voltage distribution grids rather than high voltage transmission grids. We first describe the linear coupled power flow model in the 4 single-phase format [1], [8] as it helps to transition to the case of the three phase model. Linear Coupled Power Flow (LC-PF) model [1]: In this model, the single-phase PF Eq. (1) is linearized jointly over the phase angle difference between neighboring buses (θi −θ j ) and deviations of the voltage magnitude (vi − 1) from the reference voltage of 1 p.u., both of which are considered to be small. We arrive at the following set of Linear-Coupled (LC) equations:  (5) pi = ∑ (ri j (vi − v j ) + xi j (θi − θ j )) / x2i j + ri2j , j:(i j)∈E qi = (xi j (vi − v j ) − ri j (θi − θ j )) / x2i j + ri2j ∑ j:(i j)∈E  (6) One can conveniently express the linear equations of the LCPF model in the matrix form P = p + ĩq = M T [Z ∗ ]−1 M(v − ĩθ), (7) where [Z ∗ ] is a diagonal matrix where the nonzero elements are complex conjugates of the respective line impedances and M is the edge to node incidence matrix for G : every edge (i j) ∈ E is represented by a row Mi j = (eTi − eTj ), where ei is the standard basis vector associated with the vertex i. Note that in deriving Eq. (7) we ignore losses of both active and reactive powers in lines thus getting conservation of the net active and reactive powers. To make Eq. (7) invertible one fixes the voltage magnitude to unity and phase to zero at the reference/slack/sub-station bus. Then injections at the reference bus are equal to the negative sum of injections at all other buses. With these (standard) manipulations we effectively remove the reference bus from the system and without a loss of generality, measure voltage magnitudes and phases at other buses relative to that at the reference bus. Removing entries corresponding to the reference bus from matrix M and vectors p, q, v, θ, we arrive at an invertible full-rank system resulting in T V 1 = v − ĩθ = M −1 [Z ∗ ]M −1 (p + ĩq) (8) where V 1 = v − ĩθ. Next, we describe linear approximations of the three phase power flow. Linear Coupled Three Phase Power Flow (LC-PF3): Consider the three phase PF described in Eq. (4) with reference phase angle θ̂re f in Eq. (2). Here, we consider small deviations in voltage magnitude and phase angle from nominal at each bus and small angle difference between neighboring buses. In three phases, our assumption can be stated as follows β αβ β ∀(i j) ∈ E : kθ̂i − θ̂ j k ≪ 1   β αβ β ĩ(θα −θβj ) β ĩ(θα α i −θi ) − v e i Yi j e v v ∑i i j Piα = ∑ j:(i, j)∈E β∈{a,b,c} αβ ⇒ Piα = ∑ eĩθre f (9) (10) Eq. (9) states that for each node, the angles at different phases are roughly separated by the same amount as the reference phase angles (i.e., by 2π/3). Under these small deviation assumptions, we approximate PF Eq. (4) at each phase for ∑   αβ β β β β (vi − v j ) − ĩ(θi − θ j ) Yi j (11) β∈{a,b,c} j:(i, j)∈E where Eq. (11) is derived similar to Eqs. (5,6) by ignoring second order terms in voltage magnitude and phase angle differences. The Linear Coupled Power Flow model in three phases (LC-PF3) is given by Eq. (11). Note that LC-PF3 equations reduce to the LC-PF Eqs. (5,6) if the number of phases is limited to one. This linearization provides several important attributes. First, the contributions of voltage magnitudes and angles in LC-PF3 are additive. Second, either quantity’s contribution is expressed in terms of differences in values at neighboring nodes for the same phase only. Third, the LC-PF3 is lossless in all phases individually, i.e., sum of injections at all nodes for a given phase is zero. We collect nodal voltage magnitudes and angles for each phase into vectors, and line admittances for each pair of phases into diagonal matrices to express LC-PF3 as a linear equation, similar to the single-phase LC-PF case in Eq. (7) Pα = pα + ĩqα = ∑ e αβ ĩθre f M T [Y αβ ]M(vβ − ĩθβ ). (12) β∈{a,b,c} Combining the expressions for power injections in all three phases, we arrive at   T  aa Pa Y M00 e−ĩ2π/3 Pb  = 0 M 0 Y ab 00M Y ac eĩ2π/3 Pc     va − ĩθa Y ac M00 − ĩ2π/3 b b bc     0 M 0 e (v − ĩθ ) Y 00M Y cc eĩ2π/3 (vc − ĩθc ) Y ab Y bb Y bc T (13a) ⇒ P† = M † Y † M † V †     Pa va − ĩθa where P† = e−ĩ2π/3 Pb  ,V † = e−ĩ2π/3 (vb − ĩθb ) ,M † = diag(M,M,M). eĩ2π/3 Pc eĩ2π/3 (vc − ĩθc ) Here Y † is a square block matrix where every block, Y αβ , is a diagonal matrix constructed from admittances of the respective pairs (α, β). Due to this specific structure, inverse of Y † has a similar block sparse pattern as Y † . In fact, the following holds. Theorem 1. Let Ŷi j and Ẑi j be the three phase admittance and impedance matrices"respectively for # edge (i j) ∈ E , where † H Ŷi−1 j = Ẑi j . Define Y = Y aa Y ab Y ac Y ab Y bb Y bc Y ac Y bc Y cc where each block is a diagonal matrix with " admittances#on all lines in E for a phase pair. Define Z † = ∀i ∈ V : kv̂i − 1k = k[(vai − 1) (vbi − 1) (vci − 1)]T k ≪ 1 θαi − θi ≈ θre f = θαre f − θre f ∀α, β ∈ {a, b, c} node i ∈ V as follows: Z aa Z ab Z ac Z ab Z bb Z bc Z ac Z bc Z cc of Y † takes the following form  Y† −1 H = Z† =  similarly. Then, the inverse aa ZH ab ZH ac ZH ab ZH bb ZH bc ZH ac  ZH bc ZH  . cc ZH The proof is omitted. (It reduces to showing that Y † Z † equal to an identity matrix.) (14) H is 5 Our next step consists in inverting Eq. (13a) and thus deriving expression for P via V . Since each M is blockdiagonal M † is rank deficient by 1. To resolve this apparent difficulty we follow the logic for single phase calculations of the pseudo-inverse. Specifically, we reduce the LC-PF3 system by considering a reference bus with reference voltage magnitudes and angles for all three phases. Furthermore, as LC-PF3 is lossless, injections at the reference bus are given by the negative sum of injections at all other nodes. Therefore, removing entries corresponding to the reference bus for each phase in M † , p† , q† , v† and θ†, we invert Eq. (13a) and express the three phase voltages in terms of the three phase injections in the reduced system as follows: V † = M† −1 † H Z T M †−1 P† (15) Note that both reduced LC-PF Eq. (8) and LC-PF3 Eq. (15) are defined over general grids (possibly loopy). [1] proves that for distribution grids, LC-PF is equivalent to a first order approximation of the DistFlow Model [26], [27], [28]. On the other hand, by ignoring line resistances and voltage magnitude deviations one reduces the LC-PF model to the DC model [29]. Similarly, the LC-PF3 model over a radial grid appears equivalent to the lossless approximation of the three phase DistFlow Model. [23] shows a different derivation of the LCPF3 which ignores components corresponding to line losses in the power flow equations. We will see in the following that the learning algorithms naturally extend to other linear models, including the DC-PF model. Aside from being lossless, another characteristic of the aforementioned models (LC-PF, LC-PF3) is that they represent nodal complex voltages as an invertible function of nodal injections at the non-reference buses. This property is fundamental to determining the graphical model of nodal voltages discussed in the following section. IV. G RAPHICAL M ODEL FROM P OWER F LOWS We now describe the probability distribution of nodal voltages in the distribution tree-grid T (see Fig. 2(a)) considered under LC-PF model or LC-PF3 model. First we make the following assumptions regarding statistics of the power injections in the distribution tree-grid: Assumption 1: Loads/injections at all non-substations nodes are modeled as PQ nodes, i.e. for any instance P and Q at a node is kept constant. Loads at the nodes are assumed generated from a probability distribution modeling an exogenous process. Loads at different nodes are statistically independent. Note that the latter, most important, part of the Assumption 1 concerning the independence is a formalization of the observation that consumers/producers act, e.g. switching on/off their devices, independently at short intervals. Similar assumptions of independence are reported in the literature [1], [30]. Note that Assumption 1 does not require that P and Q components at the same node are uncorrelated. In particular, active and reactive injections at the same node are allowed to be dependent. If each individual load/injection is by itself an accumulation/aggregation of many random processes one would expect, according to the law of large numbers, that fluctuations of the load is well modeled by a Gaussian process [31], [32]. Under Assumption 1, the continuous random vector of injections at the non-substation nodes within the tree-grap T , P (under LC-PF Eq. (7)) and P† (under LC-PF3 Eq. (13a)) are described by the following Probability Distribution Functions (PDF): P (P) = ∏ Pi (Pi ) P (P† ) = ∏ Pi (P̂i ) i∈V (16) i∈V where Pi (Pi ) and Pi (P̂i ) are the p.d.f.s for injection at node i in single phase and three phases respectively. Note that P† and P̂ contain the exact information as the relation between them is governed by a phase specific constant rotation. Using the invertible relations between voltages and injections in the LC-PF and LC-PF3 models, one arrives at the following PDF of the complex voltage vector V 1 , V † for the non-substation nodes 1 P (P), (P,V 1 ) satisfy Eq. (8) |JP (V 1 )| 1 P (P† ), (P† ,V † ) satisfy Eq. (15), P (V † ) = |JP (V † )| P (V 1 ) = (17) (18) where |JP (V 1 )| and |JP (V † )| represent the determinants of the Jacobian matrices for the invertible linear transformation from injections to voltages in the LC-PF and LC-PF3 models respectively. Note that as the transformation is linear, i.e. the Jacobian determinants are constant. We now describe the Graphical Model (GM) representation of the probability distribution for nodal voltages that we use below (in the following section) for topology estimation. Graphical Model: A n dimensional random vector X = [X1 , X2 , ..Xn ]T is described by an undirected graphical model GM [19] with node set VGM = {1, · · · , n} and edge set EGM representing conditional dependence: edge (i j) ∈ EGM if and only if ∀C ⊂ VGM − {i, j}, P (Xi |X j , XC ) 6= P (Xi |XC ). Here XC represents random variables corresponding to nodes in the set C. Stated differently, the set of neighbors of node i is represented by random variables that are conditionally dependent. It follows from this definition [19] that if deletion of a set of nodes C separates the graphical model GM into two disjoint sets A and B, then each node in A is conditionally independent of a node in B given all nodes in C. We now discuss the LC-PF and LC-PF3 models over the distribution tree-graph T and analyze the structure of the respective GMs of nodal voltages. Note that each node in the GM for single phase voltages represents two scalar variables, the voltage magnitude and phase at the corresponding node. Similarly, each node in the three phase GM corresponds to the complex voltage at each node in three phases (six scalar variables). Consider LC-PF model. For tree T = {V , E }, PDF of the single phase voltages is given by Eq. (17). Using 6 Eq. (7,16), one derives P (V 1 ) = 1 ∏ Pi (Pi ) |JP (V 1 )| i∈ V 1 = ∏ Pi |JP (V 1 )| i∈ V (Va1 − Vb1 )/Zi∗j j:(i j)∈E ∑ ! (19) where the Jacobian/determinant is constant. Note that each term under the product sign at the right hand side of Eq. (19) includes voltages corresponding to a node and all its neighbors in T . Consider two nodes i and j in V . If i and j are neighbors then terms Pi (Pi ), P j (Pj ) include voltages at both i and j. Similarly, if i and j are two hops away and share a common neighbor k, voltages at i and j appear in Pk (Pk ). However for i and j that are three or more hops away, no term includes voltages at i and voltages at j. Thus the PDF P (V 1 ) can be product separated into terms containing only i or j, but not both. This implies that voltages at two nodes i and j are conditionally independent given voltages at all other nodes if and only if the distance between them in T is greater than 2 hops. Next consider the GM 3 for the PDF of the three phase voltages (Eq. (18)). Using LC-PF3 Eq. (13a) with Eq. (16), the PDF of nodal voltages can be expanded as 1 ∏ Pi (P̂i) |JP (V † )| i∈ V    aβ β aβ ĩθ e re f (Via − V j )Yi j ∑   β∈{a,b,c}       bβ  β bβ  ĩθre f b 1   e (Vi − V j )Yi j  . ∑ = P   i ∑ ∏  |JP (V † )| i∈V  j:(i j)∈E β∈{a,b,c}    cβ   β cβ  ∑ eĩθre f (Vic − V j )Yi j P (V † ) = β∈{a,b,c} Using the same analysis as that for the single phase case, one observes that the PDF of nodal voltages in LC-PF3 has a similar feature with voltages at nodes greater than two hops being conditionally independent. Using the aforementioned definition of conditional independence and GM structure, we arrive at the following lemma. Lemma 1. Graphical models GM 1 for the PDF of single phase voltages (Eq. (17)) and GM 3 for the PDF of three phase voltages (Eq. (18)) contains edges between single and two hops nodes in tree-graph T . Fig. 2(b) shows an example construction of a GM correspondent to either of the aforementioned power flow models. Each node in GM represents the single or three phase voltage at its corresponding node in T . A few properties of the GM of voltages are worth mentioning. First the GM, unlike the tree-graph T itself, is loopy due to edges between nodes separated by two hops in T . Note that each node and its immediate neighbors in T form a clique set in the GM, as shown in Fig. 2(b). It can be shown that GM 1 , GM 3 are chordal (every cycle of size greater than 3 has a chord) and have Junction-Tree based factorizations with edges between non-leaf nodes as separators [19]. As we do not use the properties of chordal graphs in this paper, we omit further discussion on these properties. Finally, note that the structure of the GM requires independence of nodal injections but it is agnostic to the exact distribution of each nodal injection. l l j u  v t j u k (a)  v t k (b) Fig. 2. (a) Load nodes and edges in distribution tree T . (b) GM for LC-PF or LC-PF3 in T . Dotted lines represent two hop neighbors. A. The Gaussian Case In prior work [1], [30], [31], [33], [32] loads have been modeled as independent Gaussian random variables. As linear functions of Gaussian random variables are Gaussian random variables too, the distribution of nodal voltages in LC-PF or LC-PF3 under the Gaussian assumption is a multivariate Gaussian. For multi-variate Gaussian distribution, two properties are particularly useful [19]: • The structure of the GM is given by the non-zero offdiagonal terms in the inverse covariance matrix of the random vector. • Variables i and j are conditionally independent given variables in set C if the conditional covariance of i and j, given set C, is zero. The first property can be used to validate Lemma 1 for the Gaussian GM as shown in the supplementary material. In the next section, we use the specific structure of the GM described in this section to develop our topology learning algorithm for voltage measurements, in particular arising from the Gaussian distributions. V. T OPOLOGY L EARNING USING VOLTAGE C ONDITIONAL I NDEPENDENCE Consider the tree-grid T with PDFs of nodal voltages P (V 1 ) and P (V † ) correspondent, respectively, to LC-PF and LCPF3. Let the corresponding GM for voltages be GM 1 (single phase) and GM 3 (three phase). As described in the previous section, the GM includes edges between true neighbors and two hop neighbors in T . Our topology learning algorithm is based on ‘separability’ properties of the GMs that are only satisfied for edges corresponding to true neighbors in T . To learn the topology without ambiguity, we make the following mild assumption on the structure of the operational tree-grid T. Assumption 2: The depth (length of the longest path) of the tree-grid T (excluding the substation node) is greater than three. 7 |= |= Theorem 2. (i j) is an operational edge between non-leaf nodes i and j in T if and only if there exists distinct nodes k and l such that Vk1 Vl1 |(Vi1 ,V j1 ) (for single phase) and Vk† Vl† |(Vi† ,V j† ) (for three phase). The proof is given in the supplementary material. Theorem 2 enables detection of edges between all non-leaf nodes using their voltage measurements. Let Tnl (see Fig. 3(a)) comprise of connections between all non-leaf nodes Vnl in grid T (estimated using Theorem 2). Let Vnl1 be the set of nodes of degree 1 in Tnl (Eg. node i). Note that Vnl1 consists of non-leaf nodes in grid T that are neighbors of only one non-leaf node. Then the next theorem provides results helping to determine true parent of each leaf node in T . |= 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: |= The proof is presented in the supplementary material. Let us emphasize that the first result in Theorem 3 identifies connections between leaves and parents that have a single nonleaf neighbor (Eg. parent i in Fig. 2). The remaining leaves are children of nodes with two or more non-leaf neighbors (Eg. non-leaf node j in Fig. 2). Such connections are identified by the second result in the theorem. Theorems 2 and 3 imply the topology learning steps in Algorithm 1. In the remainder of this section we discuss execution and complexity of Algorithm 1. Execution: Our topology learning algorithm proceeds in three steps. First, edges between non-leaf nodes are identified based on Theorem 2 in Steps (2-6) and radial network of nonleaf nodes Tnl is constructed in Step (7). Next, leaves in T connected to nodes of degree 1 (set Vnl1 ) in Tnl are identified using Theorem 3(1) in Steps (9-16). Finally edges between leaves and non-leaf nodes connected to two or more non-leaf nodes (set Vnl2 ) are identified using Theorem 3(2) in Steps (17-23). It is worth mentioning that the learning algorithm does not require any other information other than the voltage measurements at the grid nodes. It does not require information E , Vnl ← 0/ for all (i j) ∈ E f ull do if ∃k, l ∈ V − {i, j} s.t. Vkin Vlin |(Viin ,V jin ) then E ← E ∪ {(i j)}, Vnl ← Vnl ∪ {i, j} end if end for Tnl = {Vnl , E } Vnl1 ← {nodes of degree 1 in Tnl }, Vnl2 = Vnl − Vnl1 for all k ∈ V − Vnl do for all i ∈ Vnl1 , (ki)inE f ull do Pick j, l ∈ Vnl with (i j), ( jl) ∈ E if Vkin Vlin |(Viin ,V jin ) then E ← E ∪ {(ik)}, Vnl ← Vnl ∪ {k} end if end for end for for all k ∈ V − Vnl do for all i ∈ Vnl2 , (ki) ∈ E f ull do if Vkin Vlin |(Viin ,V jin )∀ j, l ∈ Vnl , (i j), ( jl) ∈ E then E ← E ∪ {(ik)}, Vnl ← Vnl ∪ {k} end if end for end for T ← {Vnl , E } |= 1: 2: 3: l |= |= Theorem 3. Let Tnl be sub-graph of T with non-leaf nodes and respective edges removed. Let Vnl1 be the set of nodes of degree 1 in Tnl . Then the following statement holds: 1) Node i ∈ Vnl1 is the parent of leaf node k in T if and only if for any nodes j, l ∈ Vnl with edges (i j), ( jl), Vk1 Vl1 |(Vi1 ,V j1 ) (for single phase) and Vk† Vl† |(Vi† ,V j† ) (for three phase). 2) Let leaf node k’s parent be in set Vnl − Vnl1 . Then i is the parent of k if and only if for all nodes j, l ∈ T − {i, k} with edges (i j), ( jl), Vk1 Vl1 |(Vi1 ,V j1 ) (for single phase) and Vk† Vl† |(Vi† ,V j† ) (for three phase). Input: Complex voltage observations V jin = V j1 (single phase) or V j† (three phase) at all non-substation nodes j ∈ V , Permissible edge set E f ull Output: Operational edge set E |= Y |(A, B) ≡ P (X,Y |A, B) = P (X|A, B)P (Y |A, B) (20) |= X Algorithm 1 Topology Learning for Grid Tree T |= Note that Assumption 2 is satisfied when T includes at least two non-leaf nodes that are two or more hops away. This is thus not restrictive for the majority of distribution grids (real world and test cases) that have long paths. Under Assumption 2, the next theorem lists conditional independence properties in voltage distributions that distinguish true edges. We use the following notation for conditional independence of random variables X,Y given variables A, B: l j u t j u  v k l  v t j u k  v t k (a) (b) (c) Fig. 3. Learning steps in Algorithm 1 for radial grid in Fig. 2(a) (a) Learning edges between non-leaf nodes (b) Determining children of nodes that are neighbors of one non-leaf node (c) Determining children of nodes that have more than one non-leaf neighbors. of line impedances or statistics of nodal injections. If the set of permissible lines is not available, all node pairs are considered as permissible edges in set E f ull . As an example, the steps in reconstruction for the radial grid in Fig. 2(a) are shown in Fig. 3. Complexity: The worst case computational complexity is O(N 4 ) where N is the number of nodes in the grid. The derivation is included in the supplementary material. Next, we describe the conditional independence test in Algorithm 1, and discuss specifically the effect of the Gaussianity of loads. 8 A. Gaussian Voltage Distribution We discuss the special case for Gaussian nodal voltages in detail as they are used in our numerical simulations. Voltages are Gaussian distributed if the loads/injections are Gaussian and relations between loads and voltages are linearwithin LC-PF and LC-PF3. As noted in Section IV-A, conditional independence of the Gaussian random variables is equivalent to vanishing conditional covariance. Consider the following real covariance matrices for LC-PF and LC-PF3. h ih iT in in in in , where Σin kl,i j = E Xkl,i j − E[Xkl,i j ] Xkl,i j − E[Xkl,i j ] ( T [vk vl vi θi v j θ j ] in LC-PF, in Xkl,i j= [vak val Re(Vi† ) Im(Vi† ) Re(Vi† ) Im(V j† )]T in LC-PF3 Re(Vi† ) and Im(Vi† ) refer to the real and imaginary parts vector Vi† . Thus, voltages at k, l are conditionally where of complex independent given voltages at i, j if the following hold for the (1, 2)th entry in the inverse i−1 h =0 (21) Σin kl,i j (1,2) Σin kl,i j Note that in LC-PF, and its inverse are of size 6 × 6, while Σin in LC-PF3 is of size 14 × 14. Such conditional kl,i j independence test (per edge) requires inversion of the matrix which is the task of O(63 ) (single phase) or O(143 ) (three phase) complexity. As mentioned already in the previous section, an important feature of the test is its independence from the size of the network. Thresholding: Note that due to numerical errors, empirical estimates of true covariances may not be zero. Thus, we use the Fig. 4. Layout of 20-bus radial distribution grid. Red circle marks the substation/reference bus. Black lines mark operational edges. The additional permissible edges available to Algorithm 1 are represented by dotted green lines. |= following thresholding in the test of the empirical conditional covariance to make decision on conditional independence of voltages in Algorithm 1: i−1 h Σin Vkin Vlin |(Viin ,V jin ) if < τabs . (22) kl,i j (1,2) |= We call this condabs -test with positive threshold τabs . However voltages at nodes k, l that are far apart may have low correlation and appear uncorrelated given even non-neighbor pair i, j. Thus we consider a relative test termed condrel -test with threshold τrel : i i−1  h h Vkin Vlin |(Viin ,V jin ) if Σin Σin < τrel (23) kl,i j kl,i j (1,2) (1,2) From the graphical model it is clear that removing a single node i or j does not make k, l conditionally independent even if one of them exists in the path from k to l. Empirically, however, covariance between k and l after conditioning on one of the two nodes i, j may be significantly reduced despite i, j not being an edge. We thus consider a hybrid test for conditional covariance termed condmod -test, where we also look at the effect of conditioning on both i, j relative to only one of i or j: Vkin Vlin |(Viin ,V jin ) if  h i−1 h i−1 in in Σ Σ kl,i j kl,i j  (1,2) (1,2) min  i−1 , h i−1  h in in Σkl,i Σkl, j |= VI. C ONDITIONAL I NDEPENDENCE T EST Algorithm 1 performs the edge detection test for each edge by verifying if the complex voltages at nodes k, l are conditionally independent given voltages at two other nodes i, j. To reduce complexity, we check for conditional independence of voltage magnitudes in one phase at k, l given complex voltages at i, j. Note that complex voltage at a node in the single phase, LC-PF case consists of two scalars (voltage magnitude and phase angle), and correspondingly of 6 scalars in three phase, LC-PF3, case. The total number of scalar variables per conditional independence test is 6(= 2 + 2 × 2) in the LC-PF case and 14(= 2 + 6 × 2) in the LC-PF3 case. General Voltage Distributions: As voltage measurements are continuous random variables, testing their conditional independence for general distributions is a non-trivial task. Among non-parametric tests for conditional independence, distances between estimated conditional densities [34] or between characteristic functions [35] have been proposed. One can also bin the domain of continuous values and use discrete valued conditional independence test [36]. Another line of work [37], [38], [39] focuses on kernel-based conditional independence tests. In these schemes, conditional independence is characterized using vanishing Hilbert-Schmidt norm of covariance operators in Reproducing Kernel Hilbert Spaces (RKHS). (1,2) (1,2)    < τmod  (24) An advantage of the relative tests (Eq. (23,24)) over the absolute test (Eq. (22)) is through the feature that the thresholds used are less affected by network parameters, nodal injection covariances and other features that can vary within the network. VII. S IMULATIONS R ESULTS We test Algorithm 1 by extracting the operational edge set E of tree grid T from a loopy original edge set E f ull . If E f ull is not available, all node pairs are considered as potential edges. We first discuss the choice of conditional independence test to be used in the Algorithm 1. We consider a tree distribution network [40], [41] with 19 load nodes and one substation as shown in Fig. 4. We simulate active and reactive load profiles to follow Gaussian random variables uncorrelated across nodes with covariance values around 10% of the load/injections means. We generate nodal complex voltage samples from 9 0.6 Relative Errors in Topology Estimation Relative Errors in Topology Estimation 0.3 0.25 0.2 0.15 LC-PF, thres 0.1 LC-PF, thres LC-PF, thres rel abs mod 0.05 600 800 1000 Number of samples (x102) LC-PF, thres LC-PF, thres rel mod 0.5 (b) 0.4 0.3 (a) 0.2 500 1000 1500 2000 2500 3000 3500 2 Number of samples (x 10 ) (a) 0.7 Relative Errors in Topology Estimation Fig. 7. Layouts of the modified IEEE test distribution grids. The red circles represent substations. (a) Single-phase 33-bus network [42] (b) Three phase 10-bus network [43] (c) Three phase 35-bus network [43] (b) Fig. 5. Accuracy of topology learning algorithm with different conditional independence tests and increasing number of LC-PF voltage samples for 20 bus test case in Fig. 4. (a) E f ull has 33 edges. (b) E f ull has 171 edges (i.e. all non-substation node pairs are considered legitimate). LC-PF, cov = 1e-5 AC-PF, cov = 1e-5 LC-PF, cov = 1e-4 AC-PF, cov = 1e-4 0.6 0.5 0.4 0.3 0.2 0.1 0 100 4000 (c) 200 300 400 500 600 700 800 900 1000 3 Number of samples (x 10 ) Fig. 6. Accuracy of topology learning algorithm with increasing number of voltage samples generated by LC-PF and AC-PF for 33 bus test case in Fig. 7(a). Injection covariances are taken to be 10− 4 and 10− 5. Permissible edge set E f ull has 76 edges . the Gaussian indepenedent loads/injections through the LCPF model. The voltage measurements are provided as input together with permissible edge set E f ull of 33 edges (18 true edges and 15 additional edges as shown in Fig. 4). We test the Algorithm 1 with three threshold-based conditional independence/covariance tests, described above in Eqs (22, 23, 24), for sample data set of varying size. The average estimation errors (relative to the number of operational edges) generated by Algorithm 1 are presented in Fig. 5(a). Note that while increasing the number of samples leads to lesser number of errors for all three tests, the performance of condmod -test (Eq. (24)) is the best at higher sample sizes. This is further demonstrated in Fig. 5(b) where Algorithm 1 inputs all the non-substation node pairs (171 in total) as a permissible set of edges. Observe that the performance of condmod -test is better than that of condrel -test. The tolerance values used in the three tests are manually optimized by trial and error. In practice, they can be selected from experiments conducted with historical data. In the remainder of this section, we use condmod -test for the conditional covariance estimation and edge detection. Next, we discuss topology estimation using voltage samples generated by single phase non-linear (lossy) AC-PF equations. We consider a radial modification of the 33-bus system [42] shown in Fig. 7(a). The input set E f ull comprises of 76 edges (32 true and 44 additional edges selected randomly). As before, we consider Gaussian load fluctuations and generate AC-PF samples using Matpower [42]. We show performance of the Algorithm 1 for different sample sizes and two distinct injection covariance tests in Fig. 6. For comparison, we also present the performance of Algorithm 1 over LC-PF voltage samples generated from the same injection samples as in the AC-PF model. Observe that the performance over AC-PF voltage samples is similar to the one observed in LC-PF and it improves with sample size increase, thus confirming that Algorithm 1, even though built on the linearization principles, performance empirically well over the data generated from the non-linear AC power flow models. Finally, we discuss performance of the three phase power flow models. First, we compare three phase voltages generated by linearized model LC-PF3 with that of non-linear three phase power flow model (AC-PF3). We consider three phase 10 and 35 bus test cases [44] that have been modified from IEEE 13 and 37 test cases [43]. We modify all nodal loads to be three phase, remove shunts and make all line impedances to be Y -connected with three phases. The networks are depicted in Figs. 7(b) and 7(c). Fig. 8(a) and 8(b) show relative errors in bus voltage magnitudes in each phase for LC-PF3 with respect to the true AC − PF3 values generated by a conventional back-forward sweep method. The results for each test network include two choices of the reference bus (bus 2 or bus 1). Note that the maximum relative error is less than 1% for both networks and any choice of the reference bus. This motivates us to evaluate the performance of topology identification using true three phase voltages generated by AC-PF3 and compare it with LCPF3. We consider bus 1 as reference node in both three phase test networks for our topology learning algorithm as it has degree 1. We consider two different Gaussian nodal injection covariances (10−5 and 10−4 ) in both networks and generate input voltage samples (using LC-PF3 and AC-PF3). For the three phase 10-bus network, we include all node pairs as permissible edges in E f ull . The performance of Algorithm 1 for different samples sizes for this case is depicted in Fig. 9(a). 10 0.01 Phase a, Ref. Bus 2 Phase b, Ref. Bus 2 Phase c, Ref. Bus 2 Phase a, Ref. Bus 1 Phase b, Ref. Bus 1 Phase c, Ref. Bus 1 8 7 6 Relative error in LC-PF3 bus volt. mag Relative error in LC-PF3 bus volt. mag ×10-3 5 4 3 2 1 0 1 Relative Errors in Topology Estimation 1 9 2 3 4 5 6 7 8 9 10 0.009 0.008 0.007 Phase a, Ref Bus 2 Phase b, Ref Bus 2 Phase c, Ref Bus 2 Phase a, Ref Bus 1 Phase b, Ref Bus 1 Phase c, Ref Bus 1 0.006 0.005 0.004 0.003 0.002 0.001 0 5 10 15 20 25 30 (a) 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 50 35 bus number bus number LC-PF3, cov = 1e-5 AC-PF3, cov = 1e-5 LC-PF3, cov = 1e-4 AC-PF3, cov = 1e-4 0.9 100 150 200 250 300 350 400 450 500 550 600 3 Number of samples (x 10 ) (b) (a) For the 35 bus network, we pick at random 50 additional edges added to the true edges and input a permissible edge set E f ull of size 84 to Algorithm 1 along with the three phase voltage samples. The relative errors in topology estimation for different input sample sizes for this network are shown in Fig. 9(b). Note that for either of three phase networks, the errors for non-linear AC power flows are less or comparable to errors observed in linerized power flow model LC-PF3. Furthermore, the errors decrease with increase in the sample size. As before, we optimize values of the thresholds for condmod -test used in Algorithm 1 using trial and error search that, in practice, can be determined from historical or simulated data. VIII. C ONCLUSION In this paper, we develop algorithm which allows to estimate the radial topology of distribution grids. In particular, we derive linearized power flow model in single and unbalanced three phase cases and develop a Graphical Model based learning algorithm that is able to estimate operational topology of the networks from samples of nodal voltages. Our learning algorithm is very general as it does not require information on nodal injection statistics or line parameters. To the best of our knowledge this is the first approach which develops algorithm with guarantees for topology estimation in both balanced (effectively single phase) and unbalanced (three phase) networks. The learning algorithm uses conditional independence results for voltages at the quartets of nodes which reduces to a conditional covariance test over grids with Gaussian statistics of loads/injections. Computational complexity of the algorithm scales polynomially with the size of the networkprimarily due to the fact that complexity of each conditional independence test is independent of the network size. We demonstrate empirical efficacy of our algorithm on a number of AC-nonlinear IEEE test cases. This work has a number of promising future extensions. First, realistic networks may have portions where the three phase layout is split into three single-phase lines of different lengths. Extension of our algorithm to this case is straightforward. Second, the linear flow model based topology learning 0.7 Relative Errors in Topology Estimation Fig. 8. Accuracy of voltages generated by linear LC-PF3 relative to voltages from non-linear AC-PF3 model for test systems in Fig. 7(b) and 7(c) with base load and selection of reference buses (1 or 2). LC-PF3, cov = 1e-5 AC-PF3, cov = 1e-5 LC-PF3, cov = 1e-4 AC-PF3, cov = 1e-4 0.6 0.5 0.4 0.3 0.2 0.1 0 50 100 150 200 250 300 350 400 Number of samples (x 103) (b) Fig. 9. Accuracy of topology learning algorithm with increasing number of three phase voltage samples generated by LC-PF3 and AC-PF3 with injection covariances 10−4 and 10−5 . (a) 10 bus test case in Fig. 7(b). All non-substation node pairs are considered as permissible edges. (b) 35 bus test case in Fig. 7(c). Permissible edge set E f ull has 84 edges. can be used jointly with phase identification and impendance estimation (see [45] for an example of the latter in the single phase case). Topology estimation in the presence of missing nodes in three phase layout is another important research direction that we plan to pursue in the near future. Finally, we plan to extend our empirical AC (nonlinear) approach towards establishing rigorous bounds on the errors between linearized and non-liner flow models. This shall enable us to extend theoretcial guarantees for our reconstruction algorithm from the linearized versions of the power flow models to the full/AC/nonlinear formulations. R EFERENCES [1] D. Deka, M. Chertkov, and S. Backhaus, “Structure learning in power distribution networks,” IEEE Transactions on Control of Network Systems, 2017. [2] R. Hoffman, “Practical state estimation for electric distribution networks,” in Power Systems Conference and Exposition, 2006. PSCE’06. 2006 IEEE PES. IEEE, 2006, pp. 510–517. [3] A. Phadke, “Synchronized phasor measurements in power systems,” Computer, 1993. 11 [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] A. von Meier, D. Culler, A. McEachern, and R. Arghandeh, “Microsynchrophasors for distribution systems,” pp. 1–5, 2014. Z. Zhong, C. Xu, B. J. Billian, L. Zhang, S.-J. S. Tsai, R. W. Conners, V. A. Centeno, A. G. Phadke, and Y. Liu, “Power system frequency monitoring network (fnet) implementation,” Power Systems, IEEE Transactions on, vol. 20, no. 4, pp. 1914–1921, 2005. V. Kekatos, G. B. Giannakis, and R. Baldick, “Grid topology identification using electricity prices,” arXiv preprint arXiv:1312.0516, 2013. M. He and J. Zhang, “A dependency graph approach for fault detection and localization towards secure smart grid,” Smart Grid, IEEE Transactions on, vol. 2, no. 2, pp. 342–351, 2011. S. Bolognani, N. Bof, D. Michelotti, R. Muraro, and L. Schenato, “Identification of power distribution network topology via voltage correlation analysis,” in Decision and Control (CDC), 2013 IEEE 52nd Annual Conference on. IEEE, 2013, pp. 1659–1664. D. Deka, S. Backhaus, and M. Chertkov, “Learning topology of the power distribution grid with and without missing data,” in Control Conference (ECC), 2016 European. IEEE, 2016, pp. 313–320. ——, “Tractable structure learning in radial physical flow networks,” in Decision and Control (CDC), 2016 IEEE 55th Conference on. IEEE, 2016, pp. 6631–6638. ——, “Learning topology of distribution grids using only terminal node measurements,” in IEEE Smartgridcomm, 2016. R. Sevlian and R. Rajagopal, “Feeder topology identification,” arXiv preprint arXiv:1503.07224, 2015. G. Cavraro, R. Arghandeh, A. von Meier, and K. Poolla, “Data-driven approach for distribution network topology detection,” arXiv preprint arXiv:1504.00724, 2015. J. Peppanen, M. J. Reno, M. Thakkar, S. Grijalva, and R. G. Harley, “Leveraging ami data for distribution system model calibration and situational awareness,” IEEE Transactions on Smart Grid, vol. 6, no. 4, pp. 2050–2059, 2015. V. Arya, T. Jayram, S. Pal, and S. Kalyanaraman, “Inferring connectivity model from meter measurements in distribution networks,” in Proceedings of the fourth international conference on Future energy systems. ACM, 2013, pp. 173–182. S. Talukdar, D. Deka, D. Materassi, and M. V. Salapaka, “Exact topology reconstruction of radial dynamical systems with applications to distribution system of the power grid,” in accepted in the American Control Conference (ACC), 2017. S. Talukdar, D. Deka, B. Lundstrom, M. Chertkov, and M. V. Salapaka, “Learning exact topology of a loopy power grid from ambient dynamics,” in Proceedings of the Eighth International Conference on Future Energy Systems. ACM, 2017, pp. 222–227. A. Y. Lokhov, M. Vuffray, D. Shemetov, D. Deka, and M. Chertkov, “Online learning of power transmission dynamics.” IEEE, 2018. M. J. Wainwright and M. I. Jordan, “Graphical models, exponential families, and variational inference,” Foundations and Trends R in Machine Learning, vol. 1, no. 1-2, pp. 1–305, 2008. Y. Liao, Y. Weng, G. Liu, and R. Rajagopal, “Urban distribution grid topology estimation via group lasso,” arXiv preprint arXiv:1611.01845, 2016. D. Deka, M.Chertkov, S. Talukdar, and M. V. Salapaka, “Topology estimation in bulk power grids: Theoretical guarantees and limits,” in accepted in the Bulk Power Systems Dynamics and Control SymposiumIREP, 2017. W. H. Kersting, “Distribution system modeling and analysis,” in Electric Power Generation, Transmission, and Distribution, Third Edition. CRC press, 2012, pp. 1–58. L. Gan and S. H. Low, “Convex relaxations and linear approximation for optimal power flow in multiphase radial networks,” in Power Systems Computation Conference (PSCC), 2014. IEEE, 2014, pp. 1–9. T.-H. Chen, M.-S. Chen, K.-J. Hwang, P. Kotas, and E. A. Chebli, “Distribution system power flow analysis-a rigid approach,” IEEE Transactions on Power Delivery, vol. 6, no. 3, pp. 1146–1152, 1991. [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] D. Deka, S. Backhaus, and M. Chertkov, “Estimating distribution grid topologies: A graphical learning based approach,” in Power Systems Computation Conference (PSCC), 2016. IEEE, 2016, pp. 1–7. M. Baran and F. Wu, “Optimal sizing of capacitors placed on a radial distribution system,” Power Delivery, IEEE Transactions on, vol. 4, no. 1, pp. 735–743, Jan 1989. ——, “Optimal capacitor placement on radial distribution systems,” Power Delivery, IEEE Transactions on, vol. 4, no. 1, pp. 725–734, Jan 1989. ——, “Network reconfiguration in distribution systems for loss reduction and load balancing,” Power Delivery, IEEE Transactions on, vol. 4, no. 2, pp. 1401–1407, Apr 1989. A. Abur and A. G. Exposito, Power system state estimation: theory and implementation. CRC Press, 2004. S. Bolognani, N. Bof, D. Michelotti, R. Muraro, and L. Schenato, “Identification of power distribution network topology via voltage correlation analysis,” in IEEE Decision and Control (CDC). IEEE, 2013, pp. 1659–1664. D. Lee and R. Baldick, “Short-term wind power ensemble prediction based on gaussian processes and neural networks,” IEEE Transactions on Smart Grid, vol. 5, no. 1, pp. 501–510, 2014. Y. Dvorkin, M. Lubin, S. Backhaus, and M. Chertkov, “Uncertainty sets for wind power generation,” IEEE Transactions on Power Systems, vol. 31, no. 4, pp. 3326–3327, 2016. H. Zhu and G. B. Giannakis, “Sparse overcomplete representations for efficient identification of power line outages,” IEEE Transactions on Power Systems, vol. 27, no. 4, pp. 2215–2224, 2012. L. Su and H. White, “A nonparametric hellinger metric test for conditional independence,” Econometric Theory, vol. 24, no. 04, pp. 829–864, 2008. ——, “A consistent characteristic-function-based test for conditional independence,” 2003. D. Margaritis, “Distribution-free learning of bayesian network structure in continuous domains,” 2005. K. Fukumizu, F. R. Bach, and M. I. Jordan, “Dimensionality reduction for supervised learning with reproducing kernel hilbert spaces,” The Journal of Machine Learning Research, vol. 5, pp. 73–99, 2004. A. Gretton, K. Fukumizu, C. H. Teo, L. Song, B. Schölkopf, and A. J. Smola, “A kernel statistical test of independence,” in Advances in Neural Information Processing Systems, 2007, pp. 585–592. K. Zhang, J. Peters, D. Janzing, and B. Schölkopf, “Kernel-based conditional independence test and application in causal discovery,” arXiv preprint arXiv:1202.3775, 2012. U. Eminoglu and M. H. Hocaoglu, “A new power flow method for radial distribution systems including voltage dependent load models,” Electric Power Systems Research, vol. 76, no. 13, pp. 106 – 114, 2005. [Online]. Available: http://www.dejazzer.com/reds.html “IEEE 1547 Standard for Interconnecting Distributed Resources with Electric Power Systems.” [Online]. Available: http://grouper.ieee.org/groups/scc21/1547/1547 index.html W. H. Kersting, “Radial distribution test feeders,” in Power Engineering Society Winter Meeting, 2001. IEEE, vol. 2. IEEE, 2001, pp. 908–912. A. Garces, “A linear three-phase load flow for power distribution systems,” IEEE Transactions on Power Systems, vol. 31, no. 1, pp. 827–828, 2016. S. Park, D. Deka, and M. Chertkov, “Exact topology and parameter estimation in distribution grids with minimal observability,” in Power Systems Computation Conference (PSCC). IEEE, 2018. IX. S UPPLEMENTARY M ATERIAL A. Validation of Lemma 1 under Gaussian Injections As mentioned in Section IV-A, structure of Gaussian GM is given by the non-zero off-diagonal entries in the inverse 12 the steps in the proof of Theorem 2, voltages at k, l are conditionally independent given voltages at i, j. For the converse let i∗ 6= i be the true parent of k. Then, path Pkl from k to l in T does not include node i as i is connected to only one non-leaf node. If Pkl does not include j then k, l are not disconnected in GM 1 or GM 3 after removing nodes i, j. Otherwise, if Pkl : k − i∗ − .. − j − l, there exists a path from k to l in the GM containing the two hop −1 −1 ΩV 1 (i, j) = ∑ H1/Z neighbors of j after removing i, j. Therefore, the relation ∗ (i, k)(Ω p (k, k) + Ωq (k, k))H1/Z (k, j) k does not hold if i is not the parent of k. 2) Let non-leaf node i∗ ∈ Vnl − Vnl1 be the true parent of leaf T ∗ −1 where H1/Z ∗ = M [Z ] M is the reduced weighted Laplacian node k. If edges (i∗ j), ( jl) exist then using similar argument matrix for tree T , with weight for each edge (i j) given by as Theorem 2, the conditional independence relation holds. 1/Zi∗j . One arrives at For the converse, consider i ∈ Vnl − Vnl1 , i 6= i∗ . Consider  −1 path Pik : i − π1 − π2 − ..i∗ − k in T . If k, i are separated by H (i, j)H1/Z ∗ ( j, j)(Ω p ( j, j) + Ωq ( j, j)) +   1/Z −1 more than two hops, voltages at k, π2 are not conditionally H1/Z (i,i)H1/Z ∗ (i, j)(Ω p (i,i) + Ωq (i,i)) if (i j) ∈ E , ΩV−11 (i, j) = independent given voltages at nodes i, π1 . Next consider H1/Z (i,k)H1/Z ∗ ( j,k)(Ω p (k,k) + Ωq (k,k))−1 if (ik),( jk) ∈ E ,   Pik : i − i∗ − k has exactly two hops. As i∗ ∈ Vnl − Vnl1 , 0 otherwise i∗ has a non-leaf neighbor r 6∈ Pik . The assumption about We observe that the GM contains edges between nodes that k, r violates the relation as edge (kr) belongs to the GM. are separated by less than three hops in T , as proposed above. Therefore the conditional independence relation is satisfied The inverse covariance matrix for voltages in LC-PF3 model only by the true parent of k in Vnl − Vnl1 . under Gaussian injections can be derived in a similar way. covariance matrix. Consider the LC-PF Eq.( 7) where the vector of injection profiles follows an uncorrelated multivariate Gaussian distribution with diagonal covariance matrices Ω p , Ωq , Ω pq denoting the variance of active, reactive injections and covariance of active and reactive injections respectively. The covariance matrix of complex voltages ΩV 1 =   T ∗ E V 1 − E[V 1 ] V 1 − E[V 1 ] satisfies B. Proof of Theorem 2 Note: GM 1 (single phase) and GM 3 (three phase) includes edges between node pairs in T that are one or two hops away (see Lemma 1). Below we present the proof for GM 1 only as its extension to GM 3 is straightforward. For the if part, consider nodes i, j such that voltages at k, l are conditionally independent given voltages at i, j. This means that removing nodes i, j from GM 1 separates nodes k, l into disjoint groups. We prove that (i j) is an edge between nonleaf nodes i, j by contradiction. Let Pkl be the unique path in T between nodes k, l. For separability of k, l, at least one of nodes i, j is included in Pkl . Let node j be excluded and Pkl : k − πi−1 − i − πi+1 − .. − l. Edge (πi−1 πi+1 ) exists in the GM as they are two hop neighbors. Thus removing i, j does not disconnect k, l when only one of i, j is included in Pkl . Finally, consider Pkl : k − πi−1 − i − πi+1 − π j−1 − j − π j+1 − .. − l, such that there is at least one node between i and j. Due to edges between two hop neighbors in the GM, removing i, j does not disconnect k, l. Note that as leaf nodes are not part of any path between two other distinct nodes, i, j are both nonleaf nodes. Hence (i j) has to be an edge between non-leaf nodes in T , by contradiction. For the only if part, consider non-leaf neighbors i, j in T . There exits neighbor k of i and neighbor l of j in T as shown in Fig. 2(b) with corresponding edges (ki), (k j), (il), (l j), (i j) in graphical model GM 1 . Every path from k to l in GM 1 includes an edge in {(ki), (k j)} and {(il), ( jl)}. Removing nodes i, j thus disconnects nodes k, l in GM 1 and makes voltages at k, l conditionally independent. C. Proof of Theorem 3 1) i ∈ Vnl1 is connected to one other non-leaf node. By Assumption 2, there exist non-leaf nodes j, l such that (i j), ( jl) are edges in T . If k is connected to i, using D. Computational Complexity of Algorithm 1 Edge detection in Algorithm 1 depends on the conditional independence tests. Each test is conducted over voltages at four nodes only (thus quartet). Unlike in the case of a general GM, the computational complexity C in each test is thus independent of the size of the network N. Identifying the edge between a pair of non-leaf nodes i, j requires O(N 2 ) tests in the worst case as all combinations of k, l in Step (3) are considered. Therefore, total complexity of identifying the network of non-leaf nodes is O(N 4 ). Determining the nodes of degree 1 in Tnl has complexity O(N). Edge between leaf k and degree one node i in Tnl can be verified by conditional independent test with a single neighbor and two hop neighbor of i. Therefore, complexity of the edge detection of nodes (in Tnl ) of degree one and leaves has complexity O(N 2 ) as number of leaves in T and Tnl can be O(N). Finally, all combinations of neighbors and two hop neighbors are needed to verify leaves in Vnl2 = Vnl − Vnl1 . Steps (17-23) thus have complexity O(N 4 ). The overall worst-case complexity of the algorithm is O(N 4C) where C is independent of the network size N. Note that we do not assume any prior information of the number of edges or max-degree of a node. For example, if a set of permissible edges E f ull is given, then edge detection tests can be restricted to that set. The complexity will then reduce to O(N 2 |E f ull |C)
3cs.SY
arXiv:1707.02977v1 [math.GR] 10 Jul 2017 SEMI-SIMPLE GROUPS THAT ARE QUASI-SPLIT OVER A TAMELY-RAMIFIED EXTENSION PHILIPPE GILLE Abstract. Let K be a discretly henselian field whose residue field is separably closed. Answering a question raised by G. Prasad, we show that a semisimple K– group G is quasi-split if and only if it quasi–splits after a finite tamely ramified extension of K. Keywords: Linear algebraic groups, Galois cohomology, Bruhat-Tits theory. MSC: 20G10, 20G25. 1. Introduction Let K be a discretly valued henselian field with valuation ring O and residue field k. We denote by Knr the maximal unramified extension of K and by Kt its maximal tamely ramified extension. If G/K is a semisimple simply connected groups, Bruhat-Tits theory is available in the sense of [13, 14] and the Galois cohomology set H 1 (Knr /K, G) can be computed in terms of the Galois cohomology of special fibers of Bruhat-Tits group schemes [6]. This permits to compute H 1(K, G) when the residue field k is perfect. On the other hand, if k is not perfect, “wild cohomology classes” occur, that is 1 H (Kt , G) is non-trivial. Such examples appear for example in the study of bad unipotent elements of semisimple algebraic groups [10]. Under some restrictions on G, we would like to show that H 1 (Kt /Knr , G) vanishes (see Corollary 3.3). This is related to the following quasi-splitness result. Theorem 1.1. Let G be a semisimple simply connected K–group which is quasi-split over Kt . (1) If the residue field k is separably closed, then G is quasi-split. (2) G ×K Knr is quasi-split. Date: July 12, 2017. The author is supported by the project ANR Geolie, ANR-15-CE40-0012, (The French National Research Agency). 1 2 P. GILLE This theorem answers a question raised by Gopal Prasad who found another proof by reduction to the inner case of type A [14, th. 4.4]. Our first observation is that the result is quite simple to establish under the following additional hypothesis: (∗) If the variety of Borel subgroups of G carries a 0-cycle of degree one, then it has a K-rational point. Property (∗) holds away of E8 (section 2). It is an open question if (∗) holds for groups of type E8 . For the E8 case (and actually for a strongly inner K–group G) of Theorem 1.1, our proof is a Galois cohomology argument using Bruhat-Tits buildings (section 3). We can make at this stage some remarks about the statement. Since Knr is a discretly valued henselian field with residue field ks , we observe that (1) implies (2). Also a weak approximation argument [7, prop. 3.5.2] reduces to the complete case. If the residue field k is separably closed of characteristic zero, we have then cd(K) = 1, so that the result follows from Steinberg’s theorem [16, §4.2, cor. 1]. In other words, the main case to address is that of characteristic exponent p > 1. Acknowledgements. We are grateful to G. Prasad for raising this interesting question and also for fruitful discussions. 2. The variety of Borel subgroups and 0–cycle of degree one Let k be a field, let ks be a separable closure and let Gal(ks /k) be the absolute Galois group of k. Let q be a nonsingular quadratic form. A celebrated result of Springer states that the Witt index of q is insensitive to odd degree field extensions. In particular the property to have a maximal Witt index is insensible to odd degree extensions and this can be rephrased by saying that the algebraic group SO(q) is quasi-split iff it is quasi-split over an odd degree field extension of k. This fact generalizes for all semisimple groups without type E8 . Theorem 2.1. Let G be a semisimple algebraic k-group without quotient of type E8 . Let k1 , . . . , kr be finite field extensions of k with coprime degrees. Then G is quasi-split if and only if Gki is quasi-split for i = 1, ..., r. The proof is far to be uniform hence gathers several contributions [1, 8]. Note that the split version (in the absolutely almost simple case) is [9, th. C]. We remind the reader that a semisimple k-group G is isomorphic to an inner twist of a quasi-split group Gq and that such a Gq is unique up to isomorphism. Denoting by Gqad the adjoint quotient of Gq , this means that there exists a Galois cocycle z : Gal(ks /k) → Gqad (ks ) such that G is isomorphic to z Gq . We denote by π : Gsc,q → Gqad the simply connected cover of Gq . Then z Gsc,q is the simply connected cover of z Gq ∼ = G. TAMELY-RAMIFIED EXTENSION 3 Lemma 2.2. The following are equivalent: (i) G is quasi-split; (ii) [z] = 1 ∈ H 1 (k, Gqad ); If furthermore [z] = π∗ [z sc ] for a 1-cocycle z sc : Gal(ks /k) → Gsc,q (ks ), (i) and (ii) also equivalent to (iii) [z sc ] = 1 ∈ H 1 (k, Gsc,q ). Proof. The isomorphism class of G is encoded by the image of [z] under the map H 1 (k, Gqad ) → H 1 (k, Aut(Gq )). The right handside map has trivial kernel since the exact sequence 1 → Gqad → Aut(Gq ) → Out(Gq ) → 1 is split ([15, XXIV.3.10] or [12, 31.4]), whence the implication (ii) =⇒ (i). The reverse inclusion (i) =⇒ (ii) is obvious. Now we assume that z lifts to a 1-cocycle z sc . The implication (iii) =⇒ (ii) is then obvious. The point is that the map H 1 (k, Gsc,q ) → H 1 (k, Gq ) has trivial kernel [9, III.2.6] whence the implication (ii) =⇒ (iii).  We proceed to the proof of Theorem 2.1. Proof. Let X be the variety of Borel subgroups of G [15, XXII.5.8.3], a projective k–variety. The k–group G is quasi-split iff X has a k-rational point. Thus we have to prove that if X has a 0-cycle of degree one, then X has a k-point. Without loss of generality, we can assume that G is simply connected. According Q ∼ to [15, XXIV.5] we have that G −→ j=1,..,s Rlj /k (Gj ) where Gj is an absolutely almost simple simply connected group defined over a finite separable field extension lj of k (the notation Rlj /k (Gj ) stands as usual for the WeilQrestriction to kk to k). The variety of Borel subgroup X of G is then isomorphic to j=1,..,s Rlj /k (Xj ) where Xj is the lj -variety of Borel subgroups of Gj . Reduction to the absolutely almost simple case. Our assumption is that X(ki ) 6= ∅ for i = 1, .., r hence Xj (ki ⊗ lj ) 6= ∅ for i = 1, .., r and j = 1, .., s. Since lj /k is separable, ki ⊗ lj is an étale lj -algebra for i = 1, .., r and it follows that Xj carries a 0-cycle of degree one. If we know to prove the case of each Xj , we have Xj (kj ) 6= ∅ hence X(k) 6= ∅. From now on, we assume that G is absolutely almost simple. We denote by G0 the Chevalley group over Z such that G is a twisted form of G0 ×Z k. Reduction to the characteristic zero case. If k is of characteristic p > 0, let O be a Cohen ring for the residue field k, that is a complete discrete valuation ring such that its fraction field K is of characteristic zero and for which p is an uniformizing parameter [3, IX.41]. The isomorphism class of G is encoded by a Galois cohomology class in H 1 (k, Aut(G0 )). Since Aut(G0 ) is a smooth affine Z-group scheme [15, XXIV.1.3], ∼ 1 we can use Hensel’s lemma Hétale (O, Aut(G0 )) −→ H 1 (k, Aut(G0 )) [15, XXIV.8.1] so that G lifts in a semisimple simply connected group scheme G over O. Let X be the O–scheme of Borel subgroups of G [15, XXII.5.8.3]. It is smooth and projective. For i = 1, .., r, let Ki be an unramified field extension of K of degree [ki : k] and of residue 4 P. GILLE field ki . Denoting by Oi its valuation ring, we consider the maps X(Ki ) = X(Oi ) → → X(ki ). The left equality come from the projectivity and the right surjectivity is Hensel’s lemma. It follows that X(Ki ) 6= ∅ for i = 1, ..., r so that XK has a 0-cycle of degree one. Assuming the result in the characteristic zero case, it follows that X(K) = X(O) 6= ∅ whence X(k) 6= ∅. We may assume from now that k is of characteristic zero. We denote by µ the center of G and by tG ∈ H 2 (k, µ) the Tits class of G [12, §31]. Since the Tits class of the quasi-split form Gq of G is zero, the classical restrictioncorestriction argument yields that tG = 0. In other words G is a strong inner form of its quasi-split form Gq . It means that there exists a Galois cocycle z with value in Gq (ks ) such that G ∼ = z Gq , that is the twist by inner conjugation of G by z. Lemma 2.2 shows that our problem is rephrased in Serre’s question [17, §2.4] on the triviality of the kernel of the map Y H 1 (k, Gq ) → H 1 (ki , Gq ) i=1,...,r That kernel is indeed trivial in our case [2, Th. 0.4], whence the result.  We remind the reader that one can associate to a semisimple k-group G its set S(G) of torsion primes which depends only of its Cartan-Killing type [17, §2.2]. Since an algebraic group splits after an extension of degree whose primary factors belong to S(G) [18], we get the following refinement. Corollary 2.3. Let G be a semisimple algebraic k-group without quotient of type E8 . Let k1 , . . . , kr be finite field extensions of k such that g.c.d.([k1 : k], . . . , [kr : k]) is prime to S(G). Then G is quasi-split if and only if Gki is quasi-split for i = 1, ..., r. Lemma 2.2 together with the Corollary implies the following statement. Corollary 2.4. Let G be a semisimple simply connected quasi-split algebraic k-group without factors of type E8 . Let k1 , . . . , kr be finite field extensions of k such that g.c.d.([k1 : k], . . . , [kr : k]) is prime to S(G). Then the maps Y H 1 (k, G) → H 1 (ki , G) and i=1,...,r H 1 (k, Gad ) → Y H 1 (ki , Gad ) i=1,...,r have trivial kernels.  We can proceed now on the proof of Theorem 1.1.(1) away of E8 since Theorem 2.1 shows that the condition (∗) is fullfilled in that case. Proof of Theorem 1.1.(1) under assumption (∗). Here K is a discretly valued henselian field. We are given a semisimple K–group G satisfying assumption (∗), and such that TAMELY-RAMIFIED EXTENSION 5 G becomes quasi-split after a finite tamely ramified extension L/K. Note that [L : K] is prime to p. We denote by X the K–variety of Borel subgroups of G. We want to show that X(K) 6= ∅. We are then reduced to the following cases: (i) K is perfect and the absolute Galois group Gal(Ks /K) is a pro-l-group for a prime l 6= p. (ii) Gal(Ks /K) is a pro-p-group. By weak approximation [7, prop. 3.5.2], we may assume that K is complete. Note that this operation does not change the absolute Galois group (ibid, 3.5.1). Case (i): We have that cdl (K) ≤ cdl (k) + 1 = 1 [16, §II.4.3] so that cd(K) ≤ 1. Since K is perfect, Steinberg’s theorem [16, §4.2, cor. 1] yields that G is quasi-split. Case (ii): The extension K has no proper tamely ramified extension hence our assumption implies that G is quasi-split.  Remarks 2.5. a) In case (i) of the proof, there is no need to assume that K is perfect and l can be any prime different from p. The point is that if Gal(Ks /K) is a pro-l-group, then the separable cohomological dimension of K is less than or equal to 1, and then any semi-simple K-group is quasi-split, see [13, §1.7] b) It an open question whether a k–group of type E8 is split if it is split after coprime degree extensions ki /k. A positive answer to this question would imply Serre’s vanishing conjecture II for groups of type E8 [11, §9.2]. c) Serre’s injectivity question has a positive answer for an arbitrary classical group (simply connected or adjoint) and holds for certain exceptional cases [2]. 3. Cohomology and buildings The field K is as in the introduction. Proposition 3.1. Assume that k is separably closed. Let G be a split semisimple connected K-group. Then H 1 (Kt /K, G) = 1. Proof. We can reason at finite level and shall prove that H 1 (L/K, G) = 1 for a given finite tamely ramified extension of L/K. We put Γ = Gal(L/K), it is a cyclic group whose order n is prime to the characteristic exponent p of k. Let B(GL ) be the Bruhat-Tits building of GL . It comes equipped with an action of G(L)⋊Γ [5, §4.2.12]. Let (B, T ) be a Killing couple for G. The split K–torus T defines an apartment A(TL ) of B(GL ) which is preserved by the action of NG (T )(L) ⋊ Γ. We are given a Galois cocycle z : Γ → G(L); it defines a section uz : Γ → G(L) ⋊ Γ, σ 7→ zσ σ of the projection map G(L) ⋊ Γ → Γ. This provides an action of Γ on B(GL ) called the twisted action with respect to the cocycle z. The Bruhat-Tits fixed point theorem [4, §3.2] provides a point y ∈ B(GL ) which is fixed by the twisted action. This point belongs to an apartment and since G(L) acts transitively on the set of apartments of B(GL ) there exists a suitable g ∈ G(L) such that g −1 .y = x ∈ A(TL ). 6 P. GILLE We observe that A(TL ) is fixed pointwise by Γ (for the standard action), so that x is fixed under Γ. We consider the equivalent cocycle zσ′ = g −1 zσ σ(g) and compute zσ′ . x = zσ′ . σ(x) = (g −1 zσ σ(g))(σ(g −1).σ(y))  = g −1 . (zσ σ).y = g −1 . y = x. [y is fixed under the twisted action] Without loss of generality, we may assume that zσ .x = x for each σ ∈ Γ. We put Px = StabG(L) (x); since x is fixed by Γ, the group Px is preserved by the action of Γ. Let Px the Bruhat-Tits OL -group scheme attached to x. We have Px (OL ) = Px and we know that its special fiber Px ×OL k is smooth connected, that its quotient Mx = (Px ×OL k)/Ux by its split unipotent radical Ux is split reductive. An important point is that the action of Γ on Px (OL ) arises from a semilinear action of Γ on the OL –scheme Px as explained in the beginning of §2 of [14]. It induces then a k–action of the group Γ on Px ×OL k, on Ux and on Mx . Since x belongs to A(TL ), Px carries a natural maximal split OL –torus Tx and Tx = Tx ×OL k is a maximal k–split torus of Px ×OL k and its image in Mx still denoted by Tx is a maximal k-split torus of Mx . We observe that Γ acts trivially on the k-torus Tx . But Tx /C(Mx ) = Aut(Mx , idTx ) [15, XXIV.2.11], it follows that Γ acts on Mx by means of a group homomorphism φ : Γ → Tx,ad (k) where Tx,ad = Tx /C(Mx ) ⊆ Mx /C(Mx ) = Mx,ad . For each m ∈ Mx (k), we have σ(m) = int(φ(σ)).m. Now we take a generator σ of Γ and denote by aσ the image in Mx (k) of zσ ∈ Px and by aσ its image in (Mx /C(Mx ))(k). The cocycle relation yields aσ2 = aσ σ(aσ ) = aσ φ(σ)aσ φ(σ)−1 and more generally (observe that φ(σ) is fixed by Γ) j aσj = aσ φ(σ)aσ φ(σ)−1 . . . . . . φ(σ)j−1aσ φ(σ)1−j φ(σ)j aσ φ(σ)−j = aσ φ(σ) φ(σ)−j for j = 2, .., n. Since φ(σ)n = 1, we get the relation 1 = (aσ φ(σ))n . Then aσ φ(σ) is an element of order n of Mx,ad (k) so is semisimple. But k is separably closed so that aσ φ(σ) belongs to a maximal k-split torus m Tx,ad with m ∈ Mx (k). It follows that m−1 aσ φ(σ)m ∈ Tad,x (k). Since φ(σ) belongs to Tad,x (k), we have that m−1 aσ φ(σ)mφ(σ)−1 ∈ Tad,x (k) hence m−1 aσ σ(m) ∈ Tad,x (k). It follows that m−1 aσ σ(m) ∈ Tx (k). Since the map Px (OL ) → Mx (k) is surjective we can then assume that aσ ∈ Tx (k) without loss of generality so that the cocycle a takes value in Tx (k). But Tx (k) is a trivial Γ-module so that a is given by a homomorphism fa : Γ → Tx (k). This homomorphism lifts (uniquely) to a homomorphism fea : Γ → Tx (OL )Γ . The main technical step is  Claim 3.2. The fiber of H 1 (Γ, Px ) → H 1(Γ, Mx (k)) at [fa ] is [fea ] . TAMELY-RAMIFIED EXTENSION 7 Using the Claim, we have [z] = [fea ] ∈ H 1 (Γ, Px ). Its image in H 1 (Γ, G(L)) belongs to the image of the map H 1 (Γ, Tx (L)) → H 1 (Γ, G(L)). But 0 = H 1 (Γ, Tx (L)) (Hilbert 90 theorem) thus [z] = 1 ∈ H 1(Γ, G(L)) as desired. It remains to establish the Claim. We put Px⋆ = ker(Px → Mx (k)) and this group can be filtered by a Γ-stable decreasing filtration by normal subgroups U (i) i≥0 such that for each i ≤ j there is a split unipotent k-group U (i,j) equipped with an action of Γ such that U (i) /U (j) = U (i,j) (k) [14, page 6]. We denote by fea Px ⋆ the Γ–group Px ⋆ twisted by the cocycle fea ; there is a surjection H 1 (Γ, e Px ⋆ ) on the fiber at [fa ] of the fa map H 1 (Γ, Px ) → H 1 (Γ, Mx (k)) [16, I.5.5, cor. 2]. It is then enough to show that H 1 (Γ, fea Px ⋆ ) = 1. It happens fortunately that the filtration is stable under the adjoint action of the image of fea . By using the pro-unipotent k-group U = ←− lim U (0,j) and  Lemma 4.1 in the next subsection, we have that H 1 (Γ, fea Px ⋆ ) = H 1 Γ, (fea U)(k) = 1.  Since H 1 Γ, (fea U )(k) maps onto the kernel of fiber of H 1 (Γ, Px ) → H 1 (Γ, Mx (k)) at [fea ] [16, §I.5.5, cor. 2], we conclude that the Claim is established.  This permits to complete the proof of Theorem 1.1. Proof of Theorem 1.1.(1). By the usual reductions, the question boils down to the semisimple simply connected case and even the absolutely almost K–simple semisimple simply connected case. Taking into account the cases established in section 2, it remains to deal with the case of type E8 . Denote by G0 the split group of type E8 , we have G0 = Aut(G0 ). It follows that G ∼ = z G0 with [z] ∈ H 1 (K, G0 ). Our assumption is that GKt is quasi-split so that [z] ∈ H 1 (Kt /K, G0 ). Proposition 3.1 states that H 1 (Kt /K, G0) = 1, whence G is split.  We record the following cohomological application. Corollary 3.3. Let G be a semisimple algebraic K–group which is quasi-split over Kt . We assume that G is simply connected or adjoint. Then H 1 (Kt /Knr , G) = 1. Proof. Theorem 1.1 permits to assume that G is quasi-split. We denote by π : G → Gad the adjoint quotient of G. Since the map H 1 (K, G) → H 1 (K, Gad ) has trivial kernel [9, lemme III.2.6], we can assume that G is adjoint. Let [z] ∈ H 1 (Kt /Knr , G). We consider the twisted Knr –form G′ = z G of G. Since G′Kt is isomorphic to GKt , G′Kt is quasi-split and Theorem 1.1 shows that G′ is quasi-split hence isomorphic to G. It means that z belongs to the kernel of the map int∗ : H 1 (K, G) → H 1 (K, Aut(G)). int But the exact sequence of K–groups 1 → G −→ Aut(G) → Out(G) → 1 splits [15, XXIV.3.10] so that the above kernel is trivial. Thus [z] = 1 ∈ H 1 (Knr , G).  4. Appendix: Galois cohomology of pro-unipotent groups Let k be a separably closed field. Let U be a pro-unipotent algebraic k-group equipped with an action of a finite group Γ, that is U admits a decreasing filtration 8 P. GILLE U = U0 ⊃ U1 ⊃ U2 ⊃ · · · by normal pro unipotent k–groups which are stabilized by Γ and such that Ui /Ui+1 is an unipotent algebraic k-group for i = 1, ..., n. Lemma 4.1. We assume that ♯Γ is invertible in k and that the Ui /Ui+1 ’s are smooth and connected. Then H 1 (Γ, U(k)) = 1. Proof. We start with the algebraic case, that is of a smooth connected unipotent k–group. According to [15, XVII.4.11], U admits a central characteristic filtration U = U0 ⊃ U1 ⊃ · · · ⊃ Un = 1 such that Ui /Ui+1 is a twisted form of a k–group Gna i . Since Ui+1 is smooth and k is separably closed, we have the following exact sequence of Γ–groups 1 → Ui+1 (k) → Ui (k) → (Ui /Ui+1 )(k) → 1. The multiplication by ♯Γ on the abelian group (Ui /Ui+1 )(k) is an isomorphism so that H 1 (Γ, (Ui /Ui+1 )(k)) = 0. The exact sequence above shows that the map H 1 (Γ, Ui+1 (k)) → H 1 (Γ, Ui (k)) is onto. By induction it follows that 1 = H 1 (Γ, Un (k)) maps onto H 1 (Γ, U(k)) whence H 1 (Γ, U(k)) = 1. We consider now the pro-unipotent case. Since the U/Ui ’s are smooth, we have that U(k) = ←− lim(U/Ui )(k). Therefore by successive approximations the kernel of the map  H 1 (Γ, U(k)) → ←− lim H 1 Γ, (U/Ui )(k) is trivial. But according to the first case, the right handside is trivial thus H 1 (Γ, U(k)) = 1.  References [1] E. Bayer-Fluckiger, H.W. Lenstra Jr., Forms in odd degree extensions and self-dual normal bases, Amer. J. Math. 112 (1990), 359–373. [2] J. Black, Zero cycles of degree one on principal homogeneous spaces, J. Algebra 334 (2011), 232-246. [3] N. Bourbaki, Algèbre commutative (Ch. 7–8), Springer–Verlag, Berlin, 2006. [4] F. Bruhat, J. Tits, Groupes réductifs sur un corps local. I, Inst. Hautes Etudes Sci. Publ. Math. 41 (1972), 5–251. [5] F. Bruhat, J. Tits, Groupes algébriques sur un corps local II. Existence d’une donnée radicielle valuée, Pub. Math. IHES 60 (1984), 5–184. [6] F. Bruhat, J. Tits, Groupes algébriques sur un corps local III. Compléments et application à la cohomologie galoisienne, J. Fac. Sci. Univ. Tokyo 34 (1987), 671–698. [7] O. Gabber, P. Gille, L. Moret-Bailly, Fibrés principaux sur les corps henséliens, Algebraic Geometry 5 (2014), 573-612. [8] S. Garibaldi, The Rost invariant has trivial kernel for quasi-split groups of low rank, Comment. Math. Helv. 76 (2001), 684–711. [9] P. Gille, La R-équivalence sur les groupes algébriques réductifs définis sur un corps global, Publications Mathématiques de l’I.H.É.S. 86 (1997), 199-235. [10] P. Gille, Unipotent subgroups of reductive groups of characteristic p>0, Duke Math. J. 114 (2002), 307-328. [11] P. Gille, Groupes algébriques semi-simples sur un corps de dimension cohomologique séparable ≤ 2, monograph in preparation. TAMELY-RAMIFIED EXTENSION 9 [12] M-A. Knus, A. Merkurjev, M. Rost, J-P. Tignol, The book of involutions, AMS Colloq. Publ. 44, Providence, 1998. [13] G. Prasad, A new approach to unramified descent in Bruhat-Tits theory, preprint (2016), arXiv:1611.07430. [14] G. Prasad, Finite group actions on reductive groups and tamely-ramified descent in BruhatTits theory, preprint (2017), arXiv:1705.02906. [15] Séminaire de Géométrie algébrique de l’I.H.E.S., 1963-1964, schémas en groupes, dirigé par M. Demazure et A. Grothendieck, Lecture Notes in Math. 151-153. Springer (1970). [16] J-P. Serre, Cohomologie galoisienne, cinquième édition, Springer-Verlag, New York, 1997. [17] J-P. Serre, Cohomologie galoisienne: Progrès et problèmes, Séminaire Bourbaki, exposé 783 (1993-94), Astérisque 227 (1995). [18] J. Tits, Sur les degrés des extensions de corps déployant les groupes algébriques simples, C. R. Acad. Sci. Paris Sér. I Math. 315 (1992), 1131–1138. Univ Lyon, Université Claude Bernard Lyon 1, CNRS UMR 5208, Institut Camille Jordan, 43 blvd. du 11 novembre 1918, F-69622 Villeurbanne cedex, France.
4math.GR
Submitted to Artificial Life March 8, 2000 A Simple Model of Unbounded Evolutionary Versatility as a Largest-Scale Trend in Organismal Evolution Peter D. Turney Institute for Information Technology National Research Council of Canada Ottawa, Ontario, Canada, K1A 0R6 peter.turney@iit.nrc.ca Phone: 613-993-8564 Fax: 613-952-7151 Abstract The idea that there are any large-scale trends in the evolution of biological organisms is highly controversial. It is commonly believed, for example, that there is a large-scale trend in evolution towards increasing complexity, but empirical and theoretical arguments undermine this belief. Natural selection results in organisms that are well adapted to their local environments, but it is not clear how local adaptation can produce a global trend. In this paper, I present a simple computational model, in which local adaptation to a randomly changing environment results in a global trend towards increasing evolutionary versatility. In this model, for evolutionary versatility to increase without bound, the environment must be highly dynamic. The model also shows that unbounded evolutionary versatility implies an accelerating evolutionary pace. I believe that unbounded increase in evolutionary versatility is a large-scale trend in evolution. I discuss some of the testable predictions about organismal evolution that are suggested by the model. Keywords: evolutionary trends, evolutionary progress, large-scale trends, evolutionary versatility, evolvability, Baldwin effect. Running head: Unbounded Evolutionary Versatility. © 2000 National Research Council Canada Turney A Simple Model of Unbounded Evolutionary Versatility as a Largest-Scale Trend in Organismal Evolution 1. Introduction Ruse argues that almost all evolutionary theorists (before, after, and including Darwin) believe that there is progress in evolution [26]. Progress implies that there is a large-scale trend and that the trend is good [4, 5]. For example, it is commonly believed by the layperson that there is a large-scale trend in evolution towards increasing intelligence, and that this trend is good. Several scientists have suggested that we should focus on the (scientific) question of whether there are any large-scale trends, without regard to the (non-scientific) question of whether such trends are good [4, 5, 21, 22]. McShea presents an excellent survey of eight serious candidates (“live hypotheses”) for large-scale trends in evolution: entropy, energy intensiveness, evolutionary versatility, developmental depth, structural depth, adaptedness, size, and complexity [21]. Complexity appears to be the most popular candidate. The standard objection to large-scale trends in evolution is that natural selection is a local process that results in organisms that are well adapted to their local environments, and there is no way for this local mechanism to yield a global trend. On the other hand, it does seem that complexity (for example) has increased steadily since life on earth began. This seems to suggest that natural selection favours increasing complexity. However, many evolutionary theorists deny that there is any driving force, such as natural selection, behind any of the apparent large-scale trends in evolution. Gould has presented the most extensive arguments against a driving force [16, 17]. Gould admits that there may be large-scale trends in evolution, but he argues that any such trends are, in essence, statistical artifacts. For example, if we consider the evolution of life since the first appearance of prokaryotes, the mean level of complexity would necessarily increase with time, because any organism with significantly less complexity than a prokaryote would not be able to live [16, 17]. According to Gould, the apparent trend towards increasing com2 Unbounded Evolutionary Versatility plexity is due to random variation in complexity plus the existence of a minimum level of complexity required to sustain life; there is no selective pressure that drives life towards increasing complexity. I discuss Gould’s arguments in more detail in Section 2. Of the eight live hypotheses for large-scale trends in evolution, this paper focuses on evolutionary versatility. I believe that there is indeed a selective advantage to increasing evolutionary versatility. Evolutionary versatility is the number of independent dimensions along which variation can occur in evolution [21, 25, 34, 35, 36, 37]. It is possible that increasing evolutionary versatility may be the driving force behind other apparent evolutionary trends, such as increasing complexity. I discuss the concept of evolutionary versatility in Section 3. In Section 4, I introduce a simple computational model of unbounded evolutionary versatility. As far as I know, this is the first computational model of an evolutionary mechanism for one of the eight live hypotheses for large-scale trends in evolution. In this model, the population evolves in a series of eras. During each era, the fitness landscape is constant, but it randomly changes from one era to the next era. The model shows that there is a long-term trend towards increasing evolutionary versatility, in spite of the random drift of the fitness landscape. In fact, when the fitness landscape is constant, evolutionary versatility is bounded. In this model, unbounded evolutionary versatility requires a dynamic fitness landscape. The point of this model is to show that it is possible, in principle, for natural selection to drive evolution towards globally increasing evolutionary versatility, without bound, even though natural selection is a purely local process. I discuss some related work in Section 5. My simple computational model of evolutionary versatility is related to Bedau and Seymour’s model of the adaptation of mutation rates [8]. The primary focus of Bedau and Seymour was the adaptation of mutation rates, but the primary focus of this paper is evolutionary versatility. Bedau and Seymour’s model does not address evolutionary versatility. The core of this paper is the experimental evaluation of the model, in Section 6. In the 3 Turney first two experiments, I show that there are parameter settings for which evolutionary versatility can increase indefinitely. In the third experiment, I show that evolutionary versatility is bounded when the fitness landscape is static. In the remaining experiments, I examine a wide range of settings for the parameters in the model. These experiments show that the behaviour of the model is primarily determined by the parameters that control the amount of change in the fitness landscape. In Section 7, I discuss the implications of the model. One of the most interesting implications of the model is that increasing evolutionary versatility implies an accelerating evolutionary pace. This leads to testable predictions about organismal evolution. I discuss limitations and future work in Section 8 and I conclude in Section 9. 2. Arguments Against Large-Scale Trends in Evolution Natural selection produces organisms that are well adapted to their local environments. The major objection to large-scale trends in evolution is that there is no way for local adaptation to cause a large-scale trend [16, 17, 22]. For example, although the environments of primates may favour increasing complexity, the environments of most parasites favour streamlining and simplification [17]. There is no generally accepted theoretical explanation of how natural selection could cause a large-scale trend. Van Valen’s Red Queen hypothesis [33] attempts to explain how natural selection could cause a trend towards increasing complexity (based on coevolution), although Van Valen’s hypothesis has been criticized [19, 23]. In this paper, I propose an explanation of how natural selection could cause a trend towards increasing evolutionary versatility. Attractive features of my proposal are that it can easily be simulated on a computer and that it leads to testable (in principle) predictions. If there were some constant property, shared by all environments, then it would be easy to see how there could be a large-scale trend, due to long-term adaptation to this constant property. However, the computational model in Section 4 shows that there can be a largescale trend even when the fitness landscape changes completely randomly over time. 4 Unbounded Evolutionary Versatility Aside from theoretical difficulties with large-scale trends, there is the question of whether there is empirical evidence for any large-scale trend. McShea’s survey of candidates for large-scale trends does not address the issue of evidence for the candidates [21], but, in another paper, he finds that there is no solid evidence for a trend in most kinds of complexity [20]. Gould argues that, even if there were empirical evidence for a large-scale trend, that does not imply that there is a driving force behind the trend [16, 17]. Gould argues that evolution is performing a random walk in complexity space, but there is a constraint on the minimum level of complexity. When the complexity of an organism drops below a certain level (e.g., the level of prokaryotes), it can no longer live. Gould’s metaphor is that evolution is a drunkard’s random walk, but with a wall in the way (i.e., a bounded diffusion process). This wall of minimum complexity causes random drift towards higher complexity. This random drift does not involve any active selection for complexity; there is no push or drive towards increased complexity. In summary, (1) it is not clear how local selection can produce a global trend and (2) observation of a global trend does not imply that there is a driving force behind the trend. However, (1) my model shows one way in which local selection can produce a global trend and (2) the model makes testable (in principle) predictions. 3. Evolutionary Versatility Evolutionary versatility is the number of independent dimensions along which variation can occur in evolution [21, 25, 34, 35, 36, 37]. A species with high evolutionary versatility has a wide range of ways in which it can adapt to its environment. Vermeij has argued that there should be selection for increased evolutionary versatility, because it can lead to organisms that are more efficient and better at exploiting their environments [34, 35, 36, 37]. An important point is that evolutionary versatility requires not merely many dimensions along which variation can occur, but also that the dimensions should be independent. Pleiot5 Turney ropy is the condition in which a single gene affects two or more distinct traits that appear to be unrelated. When N traits, which appear to vary on N dimensions, are linked by pleiotropy, there is effectively only one dimension along which variation can occur. Several authors have suggested that it would be beneficial for the genotype-phenotype map to be modular, since increasing modularity implies increasing independence of traits [2, 27, 30, 38]. McShea points out the close connection between evolutionary versatility and modularity [21]. Evolutionary versatility seems to be connected to several of the seven other “live hypotheses” [21]. Increasing evolutionary versatility implies increasing complexity, since the organisms must have some new physical structures to support each new dimension of variation. The dimensions are supposed to be independent, so the new physical structures must also be (at least partially) independent. The increasing accumulation of many independent new physical structures implies increasingly complex organisms. Among the other live hypotheses, developmental depth, structural depth, adaptedness, and perhaps energy intensiveness may be connected to evolutionary versatility [21]. Evolutionary versatility also seems to be related to evolvability [1, 2, 12, 13, 32, 38]. Evolvability is the capacity to evolve [12, 13]. An increasing number of independent dimensions along which variation can occur in evolution implies an increasing capacity to evolve, so it would seem that any increase in evolutionary versatility must also be an increase in evolvability. On the other hand, some properties that increase evolvability may decrease evolutionary versatility. For example, selection can be expected to favour a constraint that produces symmetrical left-right development [12, 13]. For humans, if a sixth finger were a useful mutation, then it would likely be best if the new fingers appeared simultaneously on both hands, instead of requiring two separate mutations, one for the left hand and another for the right hand. In general, selection should favour any constraint that produces adaptive covariation [24]. Such constraints increase evolvability, but they appear to decrease evolutionary versatility [21]. 6 Unbounded Evolutionary Versatility Increasing evolutionary versatility suggests an increasing number of independent dimensions, but adaptive covariation suggests a decreasing number of independent dimensions. Vermeij reconciles these forces by proposing that increasing evolutionary versatility adds more dimensions, which are then integrated by adaptive covariation, so that new dimensions are added and integrated in an ongoing cycle [21, 37]. Evolutionary versatility also appears to be related to the Baldwin effect [3, 18, 31]. The Baldwin effect is based on phenotypic plasticity, the ability of an organism (the phenotype) to adapt to its local environment, during its lifetime. Examples of phenotypic plasticity include the ability of humans to tan on exposure to sunlight and the ability of many animals to learn from experience. Phenotypic plasticity can facilitate evolution by enabling an organism to benefit from (or at least survive) a partially successful mutation, which otherwise (in the absence of phenotypic plasticity) might be detrimental. This gives evolution the opportunity to complete the partially successful mutation in future generations. Evolution is not really free to vary along a given dimension if all variation along that dimension leads to death without children. Thus phenotypic plasticity increases the effective number of dimensions along which variation can occur in evolution. The Baldwin effect can therefore be seen as a mechanism for increasing evolutionary versatility. 4. A Simple Computational Model of Evolutionary Versatility The following simple model of unbounded evolutionary versatility has three important features: (1) The fitness function is based on a shifting target, to demonstrate that a large-scale trend is possible, even when the optimal phenotype varies with time. In fact, in this model, the target must shift, if the model is to display unbounded evolutionary versatility. (2) The length of the genome can change. There is no upper limit on the possible length of the genome. This is necessary, because if the length were bounded, then there would be a finite number of possible genotypes, and thus there would be a bound on the evolutionary versatility. (3) The mutation rate is encoded in the genome, so that the mutation rate can adapt to the 7 Turney environment. This allows the model to address the claim that mutation becomes increasingly harmful as the length of the genome increases. Some authors have argued that natural selection should tend to drive mutation rates to zero [42]. Of course, if the mutation rate goes to zero, this sets a bound on evolutionary versatility. Table 1 shows the parameters of the model and their baseline values. In the experiments that follow, I manipulate these parameters to determine their effects on the behaviour of the model. The meaning of the parameters in Table 1 should become clear as I describe the model. Table 1: The parameters of the model with their baseline values. Parameter Name Description 1 2 POP _ SIZE 3 4 5 ERA _ LENGTH 6 MUTATION _CODE _ LENGTH number of individuals in population number of children born in one run of the model number of children born in one era fraction of target that changes between eras number of individuals sampled when selecting parents number of bits in genome for encoding the mutation rate RUN _ LENGTH TARGET_ CHANGE _ RATE TOURNAMENT _SIZE Baseline Value 2000 1000 100 0.2 400 10 Figure 1 is a pseudo-code description of the model of evolutionary versatility. In this model, a genome is a string of bits. The model is a steady-state genetic algorithm (as opposed to a generational genetic algorithm), in which children are born one-at-a-time [28, 29, 39, 40]. (In a generational genetic algorithm, the whole population is updated simultaneously, resulting in a sequence of distinct generations.) Parents are selected using tournament selection [9, 10]. In tournament selection, the population is randomly sampled and the two fittest individuals in the sample are chosen to be parents (see lines 15 to 17 in Figure 1). The selective pressure can be controlled by varying the size of the sample (TOURNAMENT_SIZE). A new child is created by applying single-point crossover to the parents (lines 18 to 21). The new child then undergoes mutation, based on a mutation rate that is 8 Unbounded Evolutionary Versatility encoded in the child’s genome (lines 22 to 28). Mutation can flip a bit (from 0 to 1 or from 1 to 0) in the genome or it can add or delete a bit, making the bit string longer or shorter. The initial section of a genome (the first MUTATION_CODE_LENGTH bits) encodes the mutation rate for that genome. The remainder of the genome (which may be null) encodes the phenotype. The phenotype is a bit string, created from the genome by simply copying the bits from the genotype, beginning with the MUTATION_CODE_LENGTH plus one bit of the genotype and continuing to the end of the genotype. If the length of the genome is exactly MUTATION _ CODE _ LENGTH (as it is when the simulation first starts running), then the pheno- type is the null string. The fitness of the phenotype is determined by comparing it to a target. The target is a random string of bits. The fitness of the phenotype is the number of matching bits between the phenotype and the target (lines 31 to 33). If the phenotype is null, the fitness is zero. The length of the target grows, so that the target is always at least as long as the longest phenotype in the population (lines 29 to 30). When a new child is born, if it is fitter than the least fit individual in the population, then it replaces the least fit individual (lines 34 to 36). The target is held constant for an interval of time called an era. At the end of an era, the target is randomly changed. Each time the target changes, it is necessary to re-evaluate the fitness of every individual (lines 37 to 40). Instead of dividing a run into a series of eras, the model could have been designed to have a small, continuous change of the target for each new child that is born. (This is a special case of the current model, where TARGET _ CHANGE _ RATE is small and ERA _LENGTH is one.) The main motivation for dividing the run into a series of eras is to increase the computational efficiency of the model, since it is computationally expensive to re-evaluate the fitness of every individual each time a new child is born. (Actually, it would only really be necessary to re-evaluate TOURNAMENT_SIZE individuals each time a new child is born.) It could also be argued that organismal evolution is characterized by periods of stasis followed by rapid change (e.g., punctuated equilibria), 9 Turney 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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 set the parameter values: POP_SIZE — number of individuals in population RUN_LENGTH — number of children born in one run ERA_LENGTH — number of children born in one era TARGET_CHANGE_RATE — fraction of target that changes between eras TOURNAMENT_SIZE — number of individuals sampled when selecting parents MUTATION_CODE_LENGTH — number of bits in genome for encoding mutation rate let Pop be an array of POP_SIZE bit strings; — the population let each bit string Pop[i] be a string of MUTATION_CODE_LENGTH randomly generated bits, where 0 and 1 are generated with equal probability; — Pop[i] is the i-th individual in Pop let Target be an empty string; — the goal string for determining fitness let Fit be an array of POP_SIZE integers; — the fitness of Pop let each Fit[i] be 0; — Fit[i] is the initial fitness for Pop[i] for ChildNum = 1 to RUN_LENGTH do: — main loop randomly sample TOURNAMENT_SIZE individuals (bit strings) from Pop (sampling with replacement) and take the two fittest individuals to be parents; randomly let Mom be one of the two parents and let Dad be the other; randomly pick a crossover point Cross that falls inside the bit strings of both Mom and Dad; — the parents may have different lengths let Child be the left side of Mom’s bit string, up to Cross, followed by the right side of Dad’s bit string, after Cross; — thus length(Child) equals length(Dad) let Mutate be set to the Child’s mutation rate (a fraction between 0 and 1) by interpreting the first MUTATION_CODE_LENGTH bits of Child as an encoded fraction; — example: ‘00’ = 0, ‘01’ = 1/3, ‘10’ = 2/3, ‘11’ = 1 randomly flip bits in Child, where the probability of flipping any bit is Mutate; randomly add (remove) a bit to (from) the end of Child, with a probability of Mutate, where adding and removing have equal probability, but do not remove a bit if length(Child) = MUTATION_CODE_LENGTH; — minimum required length if length(Child) – MUTATION_CODE_LENGTH > length(Target), then randomly add a bit to Target; — 0 or 1 with equal probability let ChildFit be the number of bits in Child that match the bits in Target, where the first bit in Target is aligned with the MUTATION_CODE_LENGTH + 1 bit of Child; — if Child is too short, ChildFit is 0 let Worst be the oldest individual among the least fit individuals in Pop; let WorstFit be the fitness of Worst; if ChildFit > WorstFit, then replace Worst with Child and replace WorstFit with ChildFit; if ERA_LENGTH divides into ChildNum with no remainder, then do: randomly flip bits in Target, where the probability of flipping any bit is TARGET_CHANGE_RATE; re-evaluate the fitness Fit[i] of every individual Pop[i]; end if; end for; Figure 1: A pseudo-code description of the model of evolutionary versatility. The model is a steady-state genetic algorithm with crossover and mutation. Mutation can flip a bit in the genome or increase or decrease the genome length by one bit. The mutation rate is encoded in the genome. Parents are chosen by tournament selection. 10 Unbounded Evolutionary Versatility so this feature of the model makes it more realistic. Recall that evolutionary versatility is the number of independent dimensions along which variation can occur in evolution. In this model, the evolutionary versatility of a genome is the length of the genome minus MUTATION_CODE_LENGTH. This is the length of the part of the genome that encodes the phenotype. The first MUTATION _CODE_LENGTH bits are not independent and they do not directly affect the phenotype, so I shall ignore them when counting the number of independent dimensions along which variation can occur. Each remaining bit in the genome is an independent dimension along which variation can occur. The dimensions are independent because the fitness of the organism is defined as the number of matches between the phenotype and the target; that is, the fitness is the sum of the fitnesses for each dimension. Fitness on one dimension (a match on one bit) has no impact on fitness on another dimension (a match on another bit). Note that increasing evolutionary versatility (i.e., increasing genome length) does not necessarily imply increasing fitness, because (1) the additional bits do not necessarily match the target and (2) a mutation rate that enables evolutionary versatility (genome length) to increase also makes the genome vulnerable to disruptive (fitness reducing) mutations. However, the design of the model implies that increasing genome length will tend to be correlated with increasing fitness. 5. Related Models The most closely related work is the model of Bedau and Seymour [8]. In Bedau and Seymour’s model, mutation rates are allowed to adapt to the demands of the environment. They find that mutation rates adapt to an optimal level, which depends on the evolutionary demands of the environment for novelty. My model is similar, in that mutation rates are also allowed to adapt. Other work with adaptive mutation rates includes [6, 11, 14, 41]. Bedau and Seymour’s model and my model are distinct from this other work in that we share an interest in the relationship between the adaptive mutation rates and the evolutionary demands 11 Turney of the environment for novelty. The main difference between this paper and previous work is the different objective. None of the previous papers were concerned with large-scale trends in evolution. As far as I know, this is the first model to show how it is possible for evolutionary versatility to increase without bound. 6. Results of Experiments with the Model This section presents eight experiments with the model of evolutionary versatility. The first experiment examines the behaviour of the model with the baseline parameter settings. The second experiment runs the model for ten million births, but is otherwise the same as the baseline case. This experiment gives a lower resolution view of the behaviour of the model, but over a much longer time scale. These two experiments support the claim that the model can display unbounded evolutionary versatility, given suitable parameter settings. The third experiment uses the baseline parameter settings, except that the target is held constant. With a constant target, the mutation rate eventually goes to zero and the population becomes static. The results show that, in this model, unbounded evolutionary versatility requires a dynamically varying target. The remaining experiments vary the parameters of the model, one at a time. These experiments show that the model is most sensitive to the parameters that determine the pace of change in the target. In comparison, the parameters that do not affect the target have relatively little influence on the large-scale behaviour of the model. 6.1 Experiment 1: Baseline Parameter Values Figure 2 shows the results with the baseline parameter settings (see Table 1). Since the model is stochastic, each run is different (assuming the random number seed is different), but the general behaviour is the same for all runs (assuming the parameters are the same). In this experiment, I ran the model 100 times and averaged the results across the 100 runs. For this experiment, the length of an era is 100 children. At the start of each new era, the 12 Unbounded Evolutionary Versatility Figure 2: Experiment 1: Baseline parameter values. These four plots show the fitness, genome length, mutation rate, and fitness increase as functions of the number of children that have been born. The target for the fitness function changes each time one hundred children are born. The fitness increase is the increase in fitness since the most recent change in the target. All values are averages over the whole population, for one hundred separate runs of the baseline configuration (2,000 individuals times 100 runs yields 200,000 samples per value). fitness drops. However, the overall trend is towards increasing fitness (see the first plot in Figure 2). Although the probability that a mutation will increase the genome length is equal to the probability that a mutation will decrease the genome length, there is a steady trend towards increasing genome length (the second plot in Figure 2). The mutation rate decreases steadily (third plot). Although the length of an era is fixed, in each era, the increase in fitness 13 Turney since the start of the era is greater than the corresponding increase for the previous era (fourth plot). This shows that the pace of evolution is accelerating. Evolutionary versatility MUTATION _ CODE _ LENGTH ). is given by the genome length (minus The steady growth in the genome length (in the second plot in Figure 2) shows that evolutionary versatility is increasing, at least over the relatively short time span of this experiment. 6.2 Experiment 2: Longer Run Length The steady decrease in the mutation rate in the first experiment suggests that the mutation rate might go to zero. If the mutation rate is zero, then the fitness can no longer increase without bound. The fitness would vary randomly up and down as the target changed each era, but the fitness would always be less than the genome length, which would become a constant value. In the second experiment, I ran the model until 10,000,000 children were born (RUN_LENGTH = 10,000,000), in order to see whether the trends in Figure 2 would continue over a longer time scale. I ran the model 10 times and averaged the results across the 10 runs. In the first experiment, the population averages (for fitness, genome length, mutation rate, and fitness increase) were calculated each time a new child was born. In the second experiment, to increase the speed of the model, the population averages were only calculated each time 10,000 children were born. Figure 3 shows the results for the second experiment. Figure 3 shows that the trends in Figure 2 continue, in spite of the much longer time scale. The only exception is the mutation rate, which quickly falls from its initial value of 0.5 to hover between 0.03 and 0.05. There is no indication that the mutation rate will go to zero. However, since the model is stochastic, there is always a very small (but non-zero) probability that the mutation rate could go to zero. In Figure 3, the fitness increase is calculated as the average fitness of the population at the end of an era minus the average fitness of the population at the start of the same era. The 14 Unbounded Evolutionary Versatility Figure 3: Experiment 2: Longer run length. These four plots show the fitness, genome length, mutation rate, and fitness increase as functions of the number of children that have been born. As in the first experiment, the target for the fitness function changes each time one hundred children are born. All values are averages over the whole population, for ten separate runs of the baseline configuration. The values are calculated once for each ten thousand children that are born. fitness increase is calculated each era and then the average fitness increase is calculated for each 10,000 births. Since there are 100 births in an era, there are 100 eras in each sample of 10,000 births, so each value in the plot of the fitness increase is the average of 100 eras and 10 runs. The values in the other three plots (fitness, genome length, and mutation rate) are averages over 10 runs. 15 Turney 6.3 Experiment 3: Static Target This experiment investigated the behaviour of the model when the target was static. As in the second experiment, the population averages for fitness, genome length, and mutation rate were calculated once every 10,000 births. I ran the model 10 times and averaged the results across the 10 runs. I used the baseline parameter settings, except for RUN_LENGTH , ERA_ LENGTH , and TARGET_CHANGE_RATE. I set both RUN_ LENGTH and ERA_LENGTH to 10,000,000 and I set TARGET_CHANGE_RATE to zero. Figure 4 shows the results of the runs. In all 10 runs, the mutation rate was zero, for every member of the population, long before 10,000,000 children were born. The longest run lasted for 349,000 births, the shortest run lasted for 37,100 births, and the average run lasted for 165,300 births. In comparison, in the second experiment, all 10 runs ran for 10,000,000 children, with no sign that the mutation rate would ever reach zero. These experiments support the claim that (in this model) unbounded evolutionary versatility requires a dynamic target. The following two experiments investigate the amount of change in the target that is needed to ensure unbounded evolutionary versatility. 6.4 Experiment 4: Varying Rate of Change of Target In the fourth experiment, the rate of change of the target was varied from 0.0 to 0.2. The RUN _ LENGTH was constant at 1,000,000. The remaining parameters were set to their baseline values. Figure 5 shows the behaviour of the model, averaged over ten separate runs. The time of the birth of the last novel child (i.e., the time at which the mutation rate becomes zero for every member of the population) was around the birth of the 100,000th child when TARGET _ CHANGE _ RATE was 0.0, but it quickly rose to around the 1,000,000th child as TARGET _ CHANGE _ RATE approached 0.1 (see the first plot in Figure 5). It could not go past 1,000,000, because RUN_LENGTH was 1,000,000. I conjecture that there is a threshold for TARGET _ CHANGE _ RATE at approximately 0.1, where the average time of birth of the last novel child approaches infinity as RUN_LENGTH approaches infinity. 16 Unbounded Evolutionary Versatility Figure 4: Experiment 3: Static target. These three plots show the fitness, genome length, and mutation rate as functions of the number of children that have been born. Since the target is static, the fitness increase is undefined. All values are averages over the whole population, for ten separate runs of the model. The values are calculated once for each ten thousand children that are born. When TARGET_CHANGE_RATE was 0.08, 40% of the ten runs made it all the way to the 1,000,000th birth with a mutation rate above zero. When the TARGET_CHANGE_RATE was 0.1, this went to 90% (second plot in Figure 5). The average fitness of the population at the time of the birth of the 1,000,000th child (the final fitness) rose steadily as TARGET _ CHANGE _ RATE increased from 0.0 to 0.1 (third plot). Above 0.1, it could not rise significantly, because of the limit set by RUN_ LENGTH. I conjecture that it would rise to infin- 17 Turney Figure 5: Experiment 4: Varying rate of change of target. In this experiment, TARGET _ CHANGE _RATE varies from 0.0 (its value in Experiment 3) to 0.2 (its value in Experiments 1 and 2). The RUN_LENGTH is 1,000,000. When TARGET _ CHANGE _RATE is about 0.1, there is a qualitative change in the behaviour of the model. This threshold appears to separate bounded evolutionary versatility (as in Experiment 3; left of the vertical dotted line) from unbounded evolutionary versatility (as in Experiment 2; right of the vertical dotted line). All values in the plots are based on ten separate runs of the model. ity as RUN_LENGTH rises to infinity. The average mutation rate of the population at the time of the birth of the 1,000,000th child (the final mutation rate) increased steadily as TARGET _ CHANGE _ RATE increased, even past the 0.1 threshold. This experiment suggests that a relatively high amount of change is required to ensure 18 Unbounded Evolutionary Versatility that evolutionary versatility will increase without bound. When the target is changed once every hundred children (ERA _LENGTH = 100), the target must change by at least 10% (TARGET_CHANGE_RATE = 0.1). If there is less environmental change than this, the mutation rate eventually drops to zero. 6.5 Experiment 5: Varying Length of Era In the fifth experiment, the length of an era was varied from 100 to 1000. The RUN_LENGTH was constant at 1,000,000. The remaining parameters were set to their baseline values. Figure 6 shows the behaviour of the model, averaged over ten separate runs. Like Experiment 4, this experiment supports the hypothesis that a relatively high amount of change is required to ensure that evolutionary versatility will increase without bound. When the target changes by 20% each era (TARGET_CHANGE_RATE = 0.2), the length of an era cannot be more than 200 children (ERA_LENGTH = 200), if the mutation rate is to stay above zero. 6.6 Experiment 6: Varying Tournament Size In the sixth experiment, the tournament size was varied from 100 to 1000. The baseline value for TOURNAMENT_SIZE was 400. Larger tournaments mean that there is more competition to become a parent, so there is higher selective pressure. The RUN_LENGTH was constant at 1,000,000 and the remaining parameters were set to their baseline values. Figure 7 shows the behaviour of the model, averaged over ten separate runs. The results suggest that the model will display unbounded evolutionary versatility as long as TOURNAMENT _SIZE is more than about 200. Compared to ERA _LENGTH and TARGET _ CHANGE _ RATE , TOURNAMENT _ SIZE . the behaviour of the model is relatively robust with respect to The model displays unbounded evolutionary versatility for a relatively wide range of values of TOURNAMENT_SIZE. 19 Turney Figure 6: Experiment 5: Varying length of era. In this experiment, ERA _ LENGTH varies from 100 (its value in Experiments 1 and 2) to 1000 (its length in Experiment 3 was 10,000,000). The RUN_ LENGTH is 1,000,000. When ERA_ LENGTH is about 200, there is a qualitative change in the behaviour of the model. This threshold appears to separate unbounded evolutionary versatility (as in Experiment 2; left of the vertical dotted line) from bounded evolutionary versatility (as in Experiment 3; right of the vertical dotted line). All values in the plots are based on ten separate runs of the model. 6.7 Experiment 7: Varying Population Size In the seventh experiment, the size of the population was varied from 1000 to 3000. The baseline value of POPULATION _SIZE was 2000. The RUN _LENGTH was constant at 1,000,000 and the remaining parameters were set to their baseline values. Figure 8 shows the behaviour 20 Unbounded Evolutionary Versatility Figure 7: Experiment 6: Varying tournament size. In this experiment, varies from 100 to 1000. The RUN _ LENGTH TOURNAMENT _ SIZE is 1,000,000. Larger tournaments mean greater selective pressure. The results suggest that there is unbounded evolutionary versatility as long as TOURNAMENT_ SIZE is greater than about 200 (see the first two plots). In the third plot, the final fitness (the average fitness of the population at the time of the birth of the 1,000,000th child) continues to rise even when TOURNAMENT _SIZE is greater than 200 and 100% of the runs reach the 1,000,000th child with a non-zero mutation rate (see the second plot). This suggests that there is an advantage to higher selective pressure, beyond what is needed to obtain unbounded evolutionary versatility. of the model, averaged over ten separate runs. When the population is small, the model is more susceptible to random variations. With a 21 Turney Figure 8: Experiment 7: Varying population size. In this experiment, varied from 1000 to 3000. The baseline value of POPULATION _ SIZE POPULATION _ SIZE is is 2000. These plots suggest that, in most runs, we will have unbounded evolutionary versatility, even when the population size is only 1000 individuals. However, it appears that the model becomes less stable when the population size is below about 2000. With smaller populations, there is more risk that the mutation rate could fall to zero by random chance. large population, the model will tend to behave the same way, every time it runs. Figure 8 suggests that the model becomes unstable when the population size is less than about 2000, although there is no sharp boundary at 2000. This is unlike Experiment 4, where there is a sharp boundary when TARGET_CHANGE_RATE is 0.1, and Experiment 5, where there is a sharp boundary when ERA_LENGTH is 200. 22 Unbounded Evolutionary Versatility 6.8 Experiment 8: Varying Number of Bits for Encoding Mutation Rate In the final experiment, the number of bits in the genome used to encode the mutation rate was varied from 5 to 15. The baseline value of MUTATION_CODE_LENGTH was 10. The RUN _ LENGTH was constant at 1,000,000 and the remaining parameters were set to their base- line values. Figure 9 shows the behaviour of the model, averaged over ten separate runs. Figure 9: Experiment 8: Varying number of bits for encoding mutation rate. In this experiment, the number of bits in the genome used to encode the mutation rate is varied from 5 to 15. The model displays unbounded evolutionary versatility when the number of bits was more than about 8. When MUTATION _CODE _ LENGTH is less than 8, it seems that quantization effects make the model unstable. When the encoding is too short, the ideal mutation rate may lie between zero and the smallest value that can be encoded, so the genetic algorithm is forced to set the mutation rate to zero, even though this is less than ideal. 23 Turney The results suggest that the model will display unbounded evolutionary versatility when the MUTATION_CODE_LENGTH is greater than about 8. If the code length is less than 8 bits, the model becomes susceptible to quantization errors. For example, 6 bits can only encode 6 6 2 = 64 values. If the ideal mutation rate is between 0 and 1 ⁄ ( 2 – 1 ) = 0.015873 , then the genome may be forced to set the mutation rate to zero, although a non-zero value (but less than 0.015873) would be better. 7. Implications of the Model I do not claim that the model shows that there is a large-scale trend towards increasing evolutionary versatility in organismal evolution; I claim that the model supports the idea that, under certain conditions, it is possible for evolutionary versatility to increase without bound. In this model, there is active selection for increased evolutionary versatility; there is a selective force that drives the increase; it is not merely a statistical artifact, due to a bounded diffusion process. The model shows how a purely local selection process can yield a global trend. The model also shows that the environment must be highly dynamic (the target for the fitness function must change significantly and repeatedly) to sustain increasing evolutionary versatility. If the environment is not sufficiently dynamic, the disruptive effects of mutation will outweigh the beneficial effects, and selection will drive the mutation rates to zero. When the mutation rate is zero throughout the population, the genome length can no longer increase, so the evolutionary versatility is bounded by the length of the longest genome in the population. I believe that, in fact, there is a large-scale trend towards increasing evolutionary versatility in organismal evolution. Although the model does not (and cannot) prove this belief, the model suggests a way to test the belief, because the model predicts that, where there is increasing evolutionary versatility, there should be an accelerating pace of evolution (see the fourth plots in Figures 2 and 3). Therefore, I predict that we will find evidence for an accel24 Unbounded Evolutionary Versatility erating pace in the evolution of biological organisms. It is difficult to objectively verify the claim that the pace of evolution is accelerating. The natural measure of the pace of evolution is the historical frequency of innovations, but the analysis is complicated by several factors. One confounding factor is that the record of the recent past is superior to the record of the distant past, which may give the illusion that there are more innovations in the recent past than the distant past. Another confounding factor is population growth. We may expect more innovations in recent history simply because there are more innovators. A third factor is difficulty of counting innovations. There is a need for an objective threshold on the importance of the innovations, so that the vast number of trivial innovations can be ignored. I suggest some tests that avoid these objections. I predict that the fossil record will show a decreasing recovery time from major catastrophes, such as mass extinction events, ice ages, meteorite impacts, and volcanic eruptions. Also, I predict a decrease in the average lifetimes of species, as they are out-competed by more recent species at an accelerating rate [15]. These two tests do not involve counting the frequency of innovations, which makes them relatively objective. 8. Limitations and Future Work There are several limitations to this work. One limitation is that we cannot run the model to infinity, so we cannot prove empirically that evolutionary versatility will grow to infinity. I conjecture that, with the baseline settings of the parameters (Table 1), the expected (i.e., mean, average) evolutionary versatility of the model will rise to infinity as RUN_LENGTH rises to infinity. This conjecture can be supported by empirical evidence (Figure 3), but it can only be proven by theoretical argument. I have not yet developed this theoretical argument. Another limitation of the model is its abstractness. A more sophisticated model would include (1) a non-trivial genotype-phenotype mapping, (2) an internal, implicit fitness function, instead of the current, external, explicit fitness function, (3) a genotype-phenotype map25 Turney ping and fitness function that allow varying degrees of dependence and independence among the dimensions (i.e., traits, characteristics) along which variation can occur in evolution, (4) the possibility of covariation, (5) coevolution, (6) multiple species, (7) predator-prey relationships, and so on. However, the point of this exercise was to make the model as abstract as possible, in order to identify the minimum elements that are needed to display unbounded evolutionary versatility. The abstractness of the model was intended to make it more clear and susceptible to analysis. There might seem to be some conflict between this model and the “no free lunch” theorems [43]. Informally, the “no free lunch” theorems show that there is no universal optimization algorithm that is optimal for all fitness landscapes. For example, one “no free lunch” theorem (Theorem 1 in [43]) shows that, for any two optimization algorithms a 1 and a 2 , the average fitness obtained by a 1 equals the average fitness obtained by a 2 , when the average is calculated over all possible fitness landscapes, sampled with uniform probability. If my model can reach infinite fitness levels, for some fitness landscapes, does this violate a “no free lunch” theorem, since then the average fitness must also be infinite? There is no problem here, because the “no free lunch” theorems are concerned with the fitness after a finite number of iterations, not with the fitness after an infinite number of iterations (in my case, an infinite number of children). The model that is presented here is not intended to be a new, superior form of optimization algorithm. The intent of the model is to show that it is possible, under certain conditions, for evolutionary versatility to increase without bound. Furthermore, the model is intended to show that local selection (in this case, local to a certain period of time) can drive a global trend (global across all periods of time) towards increasing evolutionary versatility. The model is not universal; it will only display unbounded increase in evolutionary versatility for certain parameter settings and for certain fitness landscapes. The fitness landscape is defined by the parameters TARGET_CHANGE_RATE and ERA_LENGTH and by the general design of the 26 Unbounded Evolutionary Versatility model (Figure 1). Experiments 1 and 2 show that the model appears to display unbounded evolutionary versatility for the baseline fitness landscape (the fitness landscape that is defined by the parameter settings in Table 1), but experiments 4 and 5 show that there are neighbouring fitness landscapes for which evolutionary versatility is bounded. The experiments here have only explored a few of the infinitely many possible fitness landscapes. Of the fitness landscapes that were explored here, only a few appeared to display unbounded evolutionary versatility. 9. Conclusions This paper introduces a simple model of unbounded evolutionary versatility. The model is primarily intended to address the claim that natural selection cannot produce a large-scale trend, because it is a purely local process. The model shows that local selection can produce a global trend towards increasing evolutionary versatility. The model suggests that this trend can continue without bound, if there is sufficient ongoing change in the environment. For evolutionary versatility to increase without bound, it must be possible for the lengths of genomes to increase. If there is a bound on the length of the genomes, then there must be a bound on the evolutionary versatility. A model of unbounded evolutionary versatility must therefore allow mutations that occasionally change the length of a genome. It seems possible that, once genomes reach a certain length, the benefit that might be obtained from greater length would be countered by the damage that mutation can do to the useful genes that have been found so far. At this point, evolutionary versatility might stop increasing. To address this issue, the model allows the mutation rate to adapt. The experiments show that, indeed, if there is little change in the environment, then the damage of mutation is greater than the benefit of mutation, so the mutation rate goes to zero and evolutionary versatility stops increasing. However, if there is sufficient change in the environment, it appears that the mutation rate reaches a stable non-zero value and evolutionary versatility continues to increase indefinitely. 27 Turney Perhaps the most interesting observation is that the fitness increase during an era grows over time (see the fourth plots in Figures 2 and 3). That is, increasing evolutionary versatility leads to an accelerating pace of evolution. One of the most interesting questions about this model is whether it plausible as a highly abstract model of the evolution of life on earth. One test of its plausibility is to look for signs that the pace of organismal evolution is accelerating. For example, does the fossil record show a decreasing recovery time from major catastrophes? Is there a decrease in the average lifetimes of species? If there is evidence that the pace of evolution is accelerating, evolutionary versatility may be better able to account for this than the other seven live hypotheses [21]. It is not clear how any of the other hypotheses could be used to explain the acceleration, although it seems to be a natural consequence of increasing evolutionary versatility. Acknowledgments Thanks to the reviewers for their very helpful comments on an earlier version of this paper. Thanks to Dan McShea for many constructive criticisms and general encouragement. References 1. Aboitiz, F. (1991). Lineage selection and the capacity to evolve. Medical Hypotheses, 36, 155-156. 2. Altenberg, L. (1994). The evolution of evolvability in genetic programming. In: Advances in Genetic Programming, K. E. Kinnear Jr., (ed.). MIT Press. 3. Anderson, R.W. (1995). Learning and evolution: A quantitative genetics approach. Journal of Theoretical Biology, 175, 89-101. 4. Ayala F.J. (1974). The concept of biological progress. In Studies in the Philosophy of Biology, ed. F.J. Ayala, T. Dobzhansky,19:339-55. New York: Macmillan. 5. Ayala F.J. (1988). Can “progress” be defined as a biological concept? In Evolutionary Progress, ed. M Nitecki, pp. 75-96. Chicago: University of Chicago Press. 28 Unbounded Evolutionary Versatility 6. Bäch, T. (1992). Self-adaptation in genetic algorithms. In F.J. Varela and P. Bourgine (eds.), Towards a Practice of Autonomous Systems. MIT Press, pp. 263-271. 7. Baldwin, J.M. (1896). A new factor in evolution. American Naturalist, 30, 441-451. 8. Bedau, M.A., and Seymour, R. (1995). Adaptation of mutation rates in a simple model of evolution. Complexity International, 2. 9. Blickle, T., and Thiele, L. (1995). A Comparison of Selection Schemes used in Genetic Algorithms. Technical Report No. 11. Gloriastrasse 35, CH-8092 Zurich: Swiss Federal Institute of Technology (ETH) Zurich, Computer Engineering and Communications Networks Lab (TIK). 10. Blickle, T., and Thiele, L. (1995). A mathematical analysis of tournament selection, In Proceedings of the Sixth International Conference on Genetic Algorithms, ICGA-95, L.J. Eshelman, Ed., Morgan Kaufmann, San Mateo, CA, pp. 9-16. 11. Davis, L. (1989). Adapting operator probabilities in genetic search. Proceedings of the Third International Conference on Genetic Algorithms, ICGA-89, Morgan Kaufmann, San Mateo, CA, pp. 61-69. 12. Dawkins, R. (1989). The evolution of evolvability. In: Artificial Life, C. Langton, (ed.). Addison-Wesley. 13. Dawkins, R. (1996). Climbing Mount Improbable. New York: W.W. Norton and Co. 14. Fogel, D.B., Fogel, L.J., and Atmar, J.W. (1991). Meta-evolutionary programming. In R.R. Chen (Ed.), Proceedings of the Twenty-fifth Asilomar Conference on Signals, Systems, and Computers, pp. 540-545, California: Maple Press. 15. Gilinsky, N.L., and Good, I.J. (1991). Probabilities of origination, persistence, and extinction of families of marine invertebrate life. Paleobiology, 17, 145-166. 16. Gould S.J. (1988). Trends as changes in variance: A new slant on progress and directionality in evolution. Journal of Paleontology, 62, 319-29. 17. Gould S.J. (1997). Full House: The Spread of Excellence from Plato to Darwin. New 29 Turney York: Harmony. 18. Hinton, G.E., and Nowlan, S.J. (1987). How learning can guide evolution. Complex Systems, 1, 495-502. 19. Lewin, R. (1985). Red Queen runs into trouble? Science, 227, 399-400. 20. McShea, D.W. (1996). Metazoan complexity and evolution: Is there a trend? Evolution, 50, 477-492. 21. McShea, D.W. (1998). Possible largest-scale trends in organismal evolution: Eight “Live Hypotheses”. Annual Review of Ecology and Systematics, 29, 293-318. 22. Nitecki, M.H. (1988). Evolutionary Progress. Edited collection. Chicago: University of Chicago Press. 23. Raup, D.M. (1975). Taxonomic survivorship curves and Van Valen's Law. Paleobiology, 1, 82-86. 24. Riedl, R. (1977). A systems-analytical approach to macro-evolutionary phenomena. Quarterly Review of Biology, 52, 351-370. 25. Riedl, R. (1978). Order in Living Organisms: A Systems Analysis of Evolution. Translated by R.P.S. Jefferies. Translation of Die Ordnung Des Lebendigen. New York: Wiley. 26. Ruse, M. (1996). Monad to Man: The Concept of Progress in Evolutionary Biology. Massachusetts: Harvard University Press. 27. Simon, H.A. (1962). The architecture of complexity. Proceedings of the American Philosophical Society, 106, 467-482. 28. Syswerda, G. (1989). Uniform crossover in genetic algorithms. Proceedings of the Third International Conference on Genetic Algorithms (ICGA-89), pp. 2-9. California: Morgan Kaufmann. 29. Syswerda, G. (1991). A study of reproduction in generational and steady-state genetic algorithms. Foundations of Genetic Algorithms. G. Rawlins, editor. Morgan Kaufmann. pp. 94-101. 30 Unbounded Evolutionary Versatility 30. Turney, P.D. (1989). The architecture of complexity: A new blueprint. Synthese, 79, 515-542. 31. Turney, P.D. (1996). How to shift bias: Lessons from the Baldwin effect. Evolutionary Computation, 4, 271-295. 32. Turney, P.D. (1999). Increasing evolvability considered as a large-scale trend in evolution. In A. Wu, ed., Proceedings of 1999 Genetic and Evolutionary Computation Conference Workshop Program (GECCO-99 Workshop on Evolvability), pp. 43-46. 33. Van Valen, L. (1973). A new evolutionary law. Evolutionary Theory, 1, 1-30. 34. Vermeij, G.J. (1970). Adaptive versatility and skeleton construction. American Naturalist, 104, 253-260. 35. Vermeij, G.J. (1971). Gastropod evolution and morphological diversity in relation to shell geometry. Journal of Zoology, 163, 15-23. 36. Vermeij, G.J. (1973). Biological versatility and earth history. Proceedings of the National Academy of Sciences of the United States of America, 70, 1936-1938. 37. Vermeij, G.J. (1974). Adaptation, versatility, and evolution. Systematic Zoology, 22, 466-477. 38. Wagner, G.P. and Altenberg, L. (1996). Complex adaptations and the evolution of evolvability. Evolution, 50, 967-976. 39. Whitley, D., and Kauth, J. (1988). GENITOR: A different genetic algorithm. Proceedings of the Rocky Mountain Conference on Artificial Intelligence, Denver, CO. pp. 118130. 40. Whitley, D. (1989). The GENITOR algorithm and selective pressure. Proceedings of the Third International Conference on Genetic Algorithms (ICGA-89), pp. 116-121. California: Morgan Kaufmann. 41. Whitley, D., Dominic, S., Das, R., and Anderson, C.W. (1993). Genetic reinforcement learning for neurocontrol problems. Machine Learning, 13, 259-284. 31 Turney 42. Williams, G.C. (1966). Adaptation and Natural Selection. New Jersey: Princeton University Press. 43. Wolpert, D.H., and Macready, W.G. (1997). No free lunch theorems for optimization. IEEE Transactions on Evolutionary Computation, 1, 67-82. 32
5cs.CE
arXiv:1604.08275v1 [cs.CR] 28 Apr 2016 Crafting Adversarial Input Sequences for Recurrent Neural Networks Nicolas Papernot and Patrick McDaniel Ananthram Swami and Richard Harang The Pennsylvania State University University Park, PA {ngp5056,mcdaniel}@cse.psu.edu United States Army Research Laboratory Adelphi, MD {ananthram.swami,richard.e.harang}.civ@mail.mil Abstract—Machine learning models are frequently used to solve complex security problems, as well as to make decisions in sensitive situations like guiding autonomous vehicles or predicting financial market behaviors. Previous efforts have shown that numerous machine learning models were vulnerable to adversarial manipulations of their inputs taking the form of adversarial samples. Such inputs are crafted by adding carefully selected perturbations to legitimate inputs so as to force the machine learning model to misbehave, for instance by outputting a wrong class if the machine learning task of interest is classification. In fact, to the best of our knowledge, all previous work on adversarial samples crafting for neural network considered models used to solve classification tasks, most frequently in computer vision applications. In this paper, we contribute to the field of adversarial machine learning by investigating adversarial input sequences for recurrent neural networks processing sequential data. We show that the classes of algorithms introduced previously to craft adversarial samples misclassified by feed-forward neural networks can be adapted to recurrent neural networks. In a experiment, we show that adversaries can craft adversarial sequences misleading both categorical and sequential recurrent neural networks. I. I NTRODUCTION Efforts in the machine learning [1], [2] and security [3], [4] communities have uncovered the vulnerability of machine learning models to adversarial manipulations of their inputs. Specifically, approximations made by training algorithms as well as the underlying linearity of numerous machine learning models, including neural networks, allow adversaries to compromise the integrity of their output using crafted perturbations. Such perturbations are carefully selected to be small— they are often indistinguishable to humans—but at the same time yield important changes of the output of the machine learning model. Solutions making models more robust to adversarial perturbations have been proposed in the literature [1], [2], [5], [6], but models remain largely vulnerable. The existence of this threat vector puts machine learning models at risk when deployed in potentially adversarial settings [7]. A taxonomy of attacks against deep learning classifiers is introduced in [3]. To select perturbations changing the class (e.g., label) assigned by a neural network classifier to any class different from the legitimate class [2] or a specific target class chosen by the adversary [1], [3], two approaches can be followed: the fast gradient sign method [2] and the forward derivative method [3]. Both approaches estimate the model’s sensitivity by differentiating functions defined over its architecture and parameters. The approaches differ in perturbation selection. These techniques were primarily evaluated on models trained to solve image classification tasks. Such tasks simplify adversarial sample crafting because model inputs use linear and differentiable pre-processing: images encoded as numerical vectors. Thus, perturbations found for the model’s input are easily transposed in the corresponding raw image. On the contrary, we study adversarial samples for models mapping sequential inputs pre-processed in a non-linear and nondifferentiable manner with categorical or sequential outputs. Recurrent Neural Networks (RNNs) are machine learning models adapted from feed-forward neural networks to be suitable for learning mappings between sequential inputs and outputs [8]. They are, for instance, powerful models for sentiment analysis, which can serve the intelligence community in performing analysis of communications in terrorist networks. Furthermore, RNNs can be used for malware classification [9]. Predicting sequential data also finds applications in stock analysis for financial market trend prediction. Unlike feed-forward neural networks, RNNs are capable of handling sequential data of large—and often variable—length. RNNs introduce cycles in their computational graph to efficiently model the influence of time [10]. The presence of cyclical computations potentially presents challenges to the applicability of existing adversarial sample algorithms based on model differentiation, as cycles prevent computing gradients directly by applying the chain rule. This issue was left as future work by previous work [3]. This is precisely the question we investigate in this paper. We study a particular instance of adversarial examples—which we refer to as adversarial sequences—intended to mislead RNNs into producing erroneous outputs. We show that the forward derivative [3] can be adapted to neural networks with cyclical computational graphs, using a technique named computational graph unfolding. In an experiment, we demonstrate how using this forward derivative, i.e. model Jacobian, an adversary can produce adversarial input sequences manipulating both the sequences output by a sequential RNN and classification predictions made by a categorical RNN. Such manipulations do not require the adversary to alter any part of the model’s training process or data. In fact, perturbations instantly manipulate the model’s output at test time, after it is trained and deployed to make predictions on new inputs. The contributions of this paper are the following: • We formalize the adversarial sample optimization problem in the context of sequential data. We adapt crafting algorithms using the forward derivative to the specificities of RNNs. This includes showing how to compute the forward derivative for cyclical computational graphs. • We investigate transposing adversarial perturbations from the model’s pre-processed inputs to the raw inputs. • We evaluate the performance of our technique using RNNs making categorical and sequential predictions. On average, changing 9 words in a 71 word movie review is sufficient for our categorical RNN to make 100% wrong class predictions when performing sentiment analysis on reviews. We also show that sequences crafted using the Jacobian perturb the sequential outputs of a second RNN. This paper is intended as a presentation of our initial efforts in an on-going line of research. We include a discussion of future work relevant to the advancement of this research topic. II. A BOUT R ECURRENT N EURAL N ETWORKS To facilitate our discussion of adversarial sample crafting techniques in Section III, we provide here an overview of neural networks and more specifically of recurrent neural networks, along with examples of machine learning applications and tasks that can be solved using such models. Machine Learning - Machine learning provides automated methods for the analysis of large sets of data [11]. Tasks solved by machine learning are generally divided in three broad types: supervised learning, unsupervised learning, and reinforcement learning. When the method is designed to learn a mapping (i.e. association) between inputs and outputs, it is an instantiation of supervised learning. In such settings, the output data nature characterizes varying problems like classification [12], [13], [14], pattern recognition [15], or regression [16]. When the method is only given unlabeled inputs, the machine learning task falls under unsupervised learning. Common applications include dimensionality reduction or network pre-training. Finally, reinforcement learning considers agents maximizing a reward by taking actions in an environment. Interested readers are referred to the presentation of machine learning in [11]. Neural Networks - Neural Networks are a class of machine learning models that are useful across all tasks of supervised, unsupervised and reinforcement learning. They are made up of neurons—elementary computing units—applying activation functions φ to their inputs ~x in order to produce outputs typically processed by other neurons. The computation performed by a neuron thus takes the following formal form: h(~x) = φ(~x, w) ~ (1) where w ~ is a parameter, referred to as the weight vector, whose role is detailed below. In a neural network f , neurons are typically grouped in inter-connected layers fk . A network always has at least two layers corresponding to the input and output of the model. One or more intermediate hidden layers can be inserted between these input and output layers. If the Neuron Link y (t) by w ~ out w ~ h(t) bh w ~ in x (t) Fig. 1. Recurrent Neural Network: the sequential input ~ x is processed by time step value x(t) . The hidden neuron evaluates its state h(t) at time step t by adding (1) the result of multiplying the current input value x(t) with weight w ~ in , with (2) the result of multiplying its previous state with weight w, ~ and (3) the bias bh , and finally applying the hyperbolic tangent. (t) The output y multiplies the hidden neuron state by weight w ~ out and adds bias by . network possesses one or no hidden layer, it is referred to as a shallow neural network. Otherwise, the network is said to be deep and the common interpretation of the hidden layers is that they extract successive and hierarchical representations of the input required to produce the output [10]. Neural networks are principally parameterized by the weights placed on links between neurons. Such weight parameters θ hold the model’s knowledge and their values are learned during training by considering collections of inputs ~x (with their corresponding labels y in the context of supervised learning). Recurrent Neural Networks - Recurrent Neural Networks (RNNs) are a variant of the vanilla networks described above that is adapted to the modeling of sequential data [8]. Without such sequence-based specificities, vanilla neural networks do not offer the scalability required for the modeling of large sequential data [10]. The specificities of recurrent neural networks include most importantly the introduction of cycles in the model’s computational graph, which results in a form of parameter sharing responsible for the scalability to large sequences. In other words, in addition to the links between neurons in different layers, recurrent neural networks allow for links between neurons co-located in the same layer, which results in the presence of cycles in the network’s architecture. Cycles allow the model to share the weights—which are parameters of the links connecting neuron outputs and inputs— throughout successive values of a given input value at different time steps. In the case of RNNs, Equation (1) thus becomes:   h(t) (~x) = φ h(t−1) (~x), ~x, w ~ (2) following the notation introduced in [10] where h(t) (~x) is the neuron output—also named state—at time step t of the input sequence. Note that the cycle allows for the activation function to take into account the state of the neuron at the previous time step t − 1. Thus, the state can be used to transfer some aspects of the previous sequence time steps to upcoming time steps. An example recurrent neural network architecture—used throughout Sections III and IV—is illustrated in Figure 1. Neuron III. C RAFTING A DVERSARIAL S EQUENCES In the following, we formalize adversarial sequences. We then build on techniques designed to craft adversarial samples for neural network classifiers and adapt them to the problem of crafting adversarial sequences for recurrent neural networks. h A. Adversarial Samples and Sequences Adversarial Samples - In the context of a machine learning classifier f , an adversarial samples x~∗ is crafted from a legitimate sample ~x by selecting the smallest—according to a norm appropriate for the input domain—perturbation δ~x which results in the altered sample x~∗ being misclassified in a class different from its legitimate class f (~x). The adversarial target class can be a chosen class [1], [3] or any class different from the legitimate class [2]. Thus, an adversarial sample solves the following optimization problem, first formalized in [1]: x~∗ = ~x + δ~x = ~x + min k~zk s.t. f (~x + ~z) 6= f (~x) (3) in the case where the adversary is interested in any target class different from the legitimate class. Finding an exact solution to this problem is not always possible, especially in the case of deep neural networks, due to their non-convexity and nonlinearity. Thus, previous efforts introduced methods—two are discussed below—to find approximative solutions [1], [2], [3]. Adversarial Sequences - Consider RNNs processing sequential data. When both the input and output data are sequences, as is the case in one of our experiments, Equation (3) does not hold as the output data is not categorical. Thus, the adversarial sample optimization problems needs to be generalized to specify an adversarial target vector y~∗ , which is to be matched as closely as possible by model f when processing the adversarial input x~∗ . This can be stated as: x~∗ = ~x + δ~x = ~x + min k~zk s.t. kf (~x + ~z) − y~∗ k < ∆ (4) where y~∗ is the output sequence desired by the adversary, k · k a norm appropriate to compare vectors in the RNN’s input or output domain, and ∆ the acceptable error between the model output f (~x + ~z) on the adversarial sequence and the adversarial target y~∗ . An example norm to compare input sequences is the number of sequence steps perturbed. We detail how approximative solutions—adversarial sequences— to this problem can be found by computing the model’s Jacobian. B. Using the Fast Gradient Sign Method w ~ out ~ (1) w w ~ in x(1) y (2) h y (t w ~ out ~ (2) w … w ~ (5) h(t w ~ in x(2) 1) w ~ out w ~ 1) w ~ in x(t 1) y (t) w ~ out h(t) w ~ in x(t) Fig. 2. Unfolded Recurrent Neural Network: this neural network is identical to the one depicted in Figure 1, with the exception of its recurrence cycle, which is now unfolded. Biases are omitted for clarity of the illustration. where c is the cost function associated with model f and ε a parameter controlling the perturbation’s magnitude. Increasing the input variation parameter ε increases the likeliness of x~∗ being misclassified but albeit simultaneously increases the perturbation’s magnitude and therefore its distinguishability. As long as the model is differentiable, the fast gradient sign method still applies—even if one inserts recurrent connections in the computational graph of the model. In fact, Goodfellow et al. used the method in [2] to craft adversarial samples on a multi-prediction deep Boltzmann machine [17], which uses recurrent connections to classify inputs of fixed size. The adversarial sample crafting method described in Equation (5) can thus be used with recurrent neural networks, as long as their loss is differentiable and their inputs continuous-valued. We are however also interested in solving Equation (4) for a model f processing non-continuous input sequence steps. C. Using the Forward Derivative The forward derivative, introduced in [3], is an alternative means to craft adversarial samples. The method’s design considers the threat model of adversaries interested in misclassifying samples in chosen adversarial targets. Nevertheless, the technique can also be used to achieve the weaker goal of misclassification in any target class different from the original sample’s class. The forward derivative is defined as the model’s Jacobian: Jf [i, j] = The fast gradient sign method approximates the problem in Equation (3) by linearizing the model’s cost function around its input and selecting a perturbation using the gradient of the cost function with respect to the input itself [2]. This gradient can be computed by following the steps typically used for back-propagation during training, but instead of computing gradients with respect to the model parameters (with the intent of reducing the prediction error) as is normally the case during training, the gradients are computed with respect to the input. This yields the following formulation of adversarial samples: x~∗ = ~x + δ~x = ~x + ε sgn(∇~x c(f, ~x, ~y )) y (1) Link ∂fj ∂xi (6) where xi is the ith component of the input and fj the j th component of the output. It precisely evaluates the sensitivity of output component fj to the input component xi , i.e. it gives a quantified understanding of how input variations modify the output’s value by input-output component pair. We leverage the technique known as computational graph unfolding [18], [19] to compute the forward derivative in the presence of cycles, as is the case with RNNs. Looking back at Equation (2), one can observe that to compute the neuronal state at time step t, we can recursively apply the formula while decrementing the time step. This yields the following:       h(t) (~x) = φ φ ... φ h(1) (~x), ~x, w ~ , ... ~x, w ~ , ~x, w ~ (7) which is the unfolded version of Equation (2). Thus, by unfolding its recurrent components, the computational graph of a recurrent neural network can be made acyclic. For instance, Figure 2 draws the unfolded neural network corresponding to the RNN originally depicted in Figure 1. Using, this unfolded version of the graph, we can compute the recurrent neural network’s Jacobian. It can be defined as the following matrix: ∂y (j) (8) Jf [i, j] = ∂x(i) where x(i) is the step i of input sequence ~x, y (j) is the step j of output sequence ~y , and (i, j) ∈ [1..t]2 for input and output sequences of length t. Using the definition of y (j) , we have: = = ∂φ(w ~ out ·h(j) +by ) ∂y (j) = ∂x(i) ∂x(i) ∂φ(w ~ out ·φ(w·h ~ (j−1) +w ~ in ·x(j) +bh )+by ) ∂x(i) ∂φ(w ~ out ·φ(w·φ ~ (w·h ~ (j−2) +w ~ in ·x(j−1) +bh )+w ~ in ·x(j−1) +bh )+by ) ∂x(i) By unfolding recursively each time step of the hidden neuron’s state until we reach j − (j − 1) = 1, we can write: ∂y (j) ∂x(i) = ∂φ(w ~ out ·φ(... φ(w·h ~ (1) +w ~ in ·x(1) +bh )... ∂x(i) )+by ) (9) which can be evaluated using the chain-rule, as demonstrated by [3] in the context of feed-forward neural networks. We can craft adversarial sequences for two types of RNN models—categorical and sequential—with the forward derivative. Previous work introduced adversarial saliency maps to select perturbations using the forward derivative in the context of multi-class classification neural networks [3]. Due to space constraints, we do not include an overview of saliency maps because we study a binary classifier in Section IV, thus simplifying perturbation selection. Indeed perturbing an input to reduce one class probability necessarily increases the probability given to the second class. Thus, adversarial sequences are crafted by solely considering the Jacobian Jf [:, j] column corresponding to one of the output components j. We now consider crafting adversarial sequences for models outputting sequences. To craft an adversarial sequence x~∗ from a legitimate input sequence ~x, we need to select a perturbation δ~x such that f (x~∗ ) is within an acceptable margin of the desired adversarial output y~∗ , hence approximatively solving Equation (4). Consider the output sequence step-bystep: each Jacobian’s column corresponds to a step j of the output sequence. We identify a subset of input components i with high absolute values in this column and comparably small absolute values in the other columns of the Jacobian matrix. These components will have a large impact on the RNN’s output at step j and a limited impact on its output at other steps. Thus, if we modify components i in the direction indicated by sgn(Jf [i, j])×sgn(y~j∗ ), the output sequence’s step j will approach the desired adversarial output’s component j. This method is evaluated in the second part of Section IV. IV. E VALUATION We craft adversarial sequences for categorical and sequential RNNs. The categorical RNN performs a sentiment analysis to classify movie reviews (in lieu of intelligence reports) as positive or negative. We mislead this classifier by altering words of the review. The second RNN is trained to learn a mapping between synthetic input and output sequences. The Jacobian-based attack alters the model’s output by identifying the contribution of each input sequence step. A. Recurrent Neural Networks with Categorical Output This RNN is a movie review classifier. It takes as an input a sequence of words—the review—and performs a sentiment analysis to classify it as negative (outputs 0) or positive (outputs 1). We were able to achieve an error rate of 100% on the training set by changing on average 9.18 words in each of the 2, 000 reviews, which are on average 71.06 word long. Experimental Setup - We experiment with the Long Short Term Memory (LSTM) RNN architecture [20]. LSTMs prevent exploding and vanishing gradients at training by introducing a memory cell, which gives more flexibility to the selfrecurrent connections compared to a vanilla RNN, allowing it to remember or forget previous states. Our RNN is composed of four layers—input, LSTM, mean pooling, and softmax— as shown in Figure 3. The mean pooling layer averages representations extracted by memory cells of the LSTM layer while the softmax formats the output as probability vectors. Softmax Layer p0 p1 Mean Pooling Layer h0 h1 … LST M x(3) … x(t 3567 8 … 543 65 movie is … terrific ! LSTM Layer LST M LST M LST M Embeddings x(1) x(2) Integers 34 Words this Fig. 3. 1) LST M x(t) LSTM-based RNN: this recurrent model classifies movie reviews. The RNN f is implemented in Python with Theano [21] to facilitate symbolic gradient computations. We train using a little over 2, 000 training and 500 testing reviews [22]. Reviews are sequences of words from a dictionary D that includes 10, 000 words frequently used in the reviews and a special keyword for all other words. The dictionary maps words to integer keys. We convert these integer sequences to matrices, where each row encodes a word as a set of 128 coordinates—known as word embeddings [23], [24]. The matrices are used as the input to the RNN described above. Once trained, the architecture achieves accuracies of 100% and 78.21% respectively on the training and testing tests. 1 The Jacobian is a tensor and not a matrix because each word embedding is a vector itself, so Jf (~ x)[i, j] is also a vector and Jf has three dimensions. 2 As indicated in [3], we consider the logits—input values—of the softmax layer instead of its output probabilities to compute the Jacobian because the gradient computations are more stable and the results are the same: the maximum logit index corresponds to the class assigned to the sentence. Experimental Setup - The sequential RNN is described in Figure 1. We train on a set of 100 synthetically generated input and output sequence pairs. Inputs have 5 values per step and outputs 3 values per step. Both sequences are 10 steps long. These values are randomly sampled from a standard normal distribution (µ = 0 and σ 2 = 1 for inputs, µ = 0 and σ 2 = 10−4 for outputs). The random samples are then altered to introduce a strong correlation between a given step of the output sequence and the previous (or last to previous) step of the input sequence. The model is trained for 400 epochs at a learning rate of 10−3 . The cost is the mean squared error between model predictions and targets. Figure 4 shows an example input sequence and the output sequence predicted. Input Variable Values Adversarial Sequences - We now demonstrate how adversaries can craft adversarial sequences, i.e. sentences misclassified by the model. Thus, we need to identify dictionary words that we can use to modify the sentence ~x in a way that switches its predicted class from positive to negative (or vice-versa). We turn to the attack described in Section III based on computing the model’s Jacobian. We evaluate the Jacobian tensor1 with ∂hj . This respect to the embedding inputs: Jf (~x)[i, j] = ∂x(i) gives us a precise mapping between changes made to the word embeddings and variations of the output of the pooling layer.2 For each word i of the input sequence, sgn(Jf (~x)[i, f (~x)]) where f (~x) = arg max0,1 (pj ) gives us the direction in which we have to perturb each of the word embedding components in order to reduce the probability assigned to the current class, and thus change the class assigned to the sentence. Unlike previous efforts describing adversarial samples in the context of computer vision [1], [2], [3], we face a difficulty: the set of legitimate word embeddings is finite. Thus, we cannot set the word embedding coordinates to any real value in an adversarial sequence x~∗ . To overcome this difficulty, we follow the procedure detailed in Algorithm 1. We find the word ~z in dictionary D such that the sign of the difference between the embeddings of ~z and the original input word is closest to sgn(Jf (~x)[i, f (~x)]). This embedding takes the direction closest to the one indicated by the Jacobian as most impactful on the model’s prediction. By iteratively applying this heuristic to sequence words, we eventually find an adversarial input sequence misclassified by the model. We achieved an error rate of 100% on the training set by changing on average 9.18 words in each of the 2, 000 training reviews. Reviews are on average 71.06 word long. For instance, we change the review “I wouldn’t rent this one even on dollar rental night.” into the following misclassified adversarial sequence “Excellent wouldn’t rent this one even on dollar rental night.”. The algorithm is inserting words with highly positive connotations in the input sequence to mislead the RNN model. B. Recurrent Neural Networks with Sequential Output This RNN predicts output sequences from input sequences. Although we use symthetic data, sequence-to-sequence models can for instance be applied to forecast financial market trends. Output Variable Values Algorithm 1 Adversarial Sequence Crafting for the LSTM model: the algorithm iteratively modifies words i in the input sentence ~x to produce an adversarial sequence x~∗ misclassified by the LSTM architecture f illustrated in Figure 3. Require: f , ~x, D 1: y ← f (~ x) 2: x~∗ ← ~ x 3: while f (x~∗ ) == y do 4: Select a word i in the sequence x~∗ 5: w ~ = k arg min~z∈D sgn x~∗ [i] − ~z −sgn(Jf (~x)[i, y])k 6: x~∗ [i] ← w ~ 7: end while 8: return x~∗ 3 2 1 0 1 2 3 0 3 2 1 0 1 2 3 0 Input Sequence 1 2 3 Output Sequence 4 5 6 7 8 9 1 2 3 4 5 Time Step 6 7 8 9 Fig. 4. Example input and output sequences of our experimental setup In the input graph, the solid lines indicate the legitimate input sequence while the dashed lines indicate the crafted adversarial sequence. In the output, solid lines indicate the training target output, dotted lines indicated the model predictions and dashed lines the prediction the model made on the adversarial sequence. Adversarial Sequences - We compute the model’s Jacobian matrix—which quantifies contributions of each input sequence step to each output sequence step—to craft adversarial sequences. For instance, if we are interested in altering a subset of output steps {j}, we simply alter the subset of input steps {i} with high Jacobian values Jf [i, j] and low Jacobian values Jf [i, k] for k 6= j. Figure 4 shows example inputs and outputs. Solid lines correspond to the legitimate input sequence and its target output sequence, while (small) dotted lines in the output show model predictions (which closely matches the target). The adversarial sequence—dashed—was crafted to modify value 0 (red) of step 5 and value 2 (blue) of step 8. It does so by only making important changes in the input sequence at value 3 (black) of step 4 and value 0 (red) of step 6. Due to space constraints, completing these qualitative results with a detailed quantitative evaluation is left as future work. V. D ISCUSSION AND R ELATED W ORK This work is part of an active line of research—adversarial learning–which studies the behavior of machine learning models trained or deployed in adversarial settings [25]. The theoretical approach described in Section III is applicable to any neural network model with recurrent components, independent of its output data type. Our experiments were performed on a LSTM architecture with categorical outputs and a low-dimensional vanilla RNN model with sequential outputs as a preliminary validation of the approach, albeit necessitating additional validation with other RNN model variants, as well as datasets. Future work should also address the grammar of adversarial sequences to improve their semantic meaning and make sure that they are indistinguishable to humans. In this paper, we considered a threat model describing adversaries with the capability of accessing the model’s architecture—its computational graph—including the values of parameters learned during training. In realistic environments, it is not always possible for adversaries without some type of access to the system hosting the machine learning model to acquire knowledge of these parameters. This limitation has been addressed in the context of deep neural network classifiers by [4]. The authors introduced a black-box attack for adversaries targeting classifier oracles: the targeted model can be queried for labels with inputs of the adversary’s choice. They used a substitute model to approximate the decision boundaries of the unknown targeted model and then crafted adversarial samples using this substitute. These samples are also frequently misclassified by the targeted model due to a property known as adversarial sample transferability: samples crafted to be misclassified by a given model are often also misclassified by different models. However, adapting such a black-box attack method to RNNs requires additional research efforts, and is left as future work. VI. C ONCLUSIONS Models learned using RNNs are not immune from vulnerabilities exploited by adversary carefully selecting perturbations to model inputs, which were uncovered in the context of feed-forward—acyclical—neural networks used for computer vision classification [1], [2], [3]. In this paper, we formalized the problem of crafting adversarial sequences manipulating the output of RNN models. We demonstrated how techniques previously introduced to craft adversarial samples misclassified by neural network classifiers can be adapted to produce sequential adversarial inputs, notably by using computational graph unfolding. In an experiment, we validated our approach by crafting adversarial samples evading models making classification predictions and sequence-to-sequence predictions. Future work should investigate adversarial sequences of different data types. As shown by our experiments, switching from computer vision to natural language processing applications introduced difficulties. Unlike previous work, we had to consider the pre-processing of data in our attack. Performing attacks under weaker threat models will also contribute to the better understanding of vulnerabilities and lead to defenses. ACKNOWLEDGMENTS Research was sponsored by the Army Research Laboratory (ARL) and was accomplished under Cooperative Agreement Number W911NF-13-2-0045 (ARL Cyber Security CRA). The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of the ARL or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation. R EFERENCES [1] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus, “Intriguing properties of neural networks,” in Proceedings of the 2014 International Conference on Learning Representations. Computational and Biological Learning Society, 2014. [2] I. J. Goodfellow et al., “Explaining and harnessing adversarial examples,” in Proceedings of the 2015 International Conference on Learning Representations. Computational and Biological Learning Society, 2015. [3] N. Papernot et al., “The limitations of deep learning in adversarial settings,” in Proceedings of the 1st IEEE European Symposium on Security and Privacy. IEEE, 2016. [4] N. Papernot, P. McDaniel, I. Goodfellow, S. Jha, and al., “Practical black-box attacks against deep learning systems using adversarial examples,” arXiv preprint arXiv:1602.02697, 2016. [5] N. Papernot et al., “Distillation as a defense to adversarial perturbations against deep neural networks,” in Proceedings of the 37th IEEE Symposium on Security and Privacy. IEEE, 2016. [6] D. Warde-Farley and I. Goodfellow, “Adversarial perturbations of deep neural networks,” in Advanced Structured Prediction, T. Hazan, G. Papandreou, and D. Tarlow, Eds., 2016. [7] P. McDaniel et al., “Machine Learning in Adversarial Settings,” IEEE Security & Privacy, vol. 14, no. 3, May/June 2016. [8] D. E. Rumelhart, G. E. Hinton, and R. J. Williams, “Learning representations by back-propagating errors,” Cognitive modeling, vol. 5, 1988. [9] R. Pascanu et al., “Malware classification with recurrent networks,” in IEEE ICASSP. IEEE, 2015, pp. 1916–1920. [10] I. Goodfellow, Y. Bengio, and A. Courville, “Deep learning,” 2016, book in preparation for MIT Press. [11] K. P. Murphy, Machine learning: a probabilistic perspective. MIT press, 2012. [12] A. Krizhevsky, I. Sutskever, and G. E. Hinton, “Imagenet classification with deep convolutional neural networks,” in Advances in neural information processing systems, 2012, pp. 1097–1105. [13] G. E. Dahl, J. W. Stokes, L. Deng, and D. Yu, “Large-scale malware classification using random projections and neural networks,” in IEEE ICASSP. IEEE, 2013, pp. 3422–3426. [14] D. Cireşan et al., “Multi-column deep neural network for traffic sign classification,” Neural Networks, vol. 32, pp. 333–338, 2012. [15] C. M. Bishop, “Pattern recognition,” Machine Learning, 2006. [16] D. A. Freedman, Statistical models: theory and practice. Cambridge University Press, 2009. [17] I. Goodfellow et al., “Multi-prediction deep Boltzmann machines,” in Advances in Neural Information Processing Systems, 2013, pp. 548–556. [18] M. C. Mozer, “A focused back-propagation algorithm for temporal pattern recognition,” Complex systems, vol. 3, no. 4, pp. 349–381, 1989. [19] P. J. Werbos, “Generalization of backpropagation with application to a recurrent gas market model,” Neural Networks, vol. 1(4), pp. 339–356, 1988. [20] S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural computation, vol. 9, no. 8, pp. 1735–1780, 1997. [21] J. Bergstra, O. Breuleux, F. Bastien, P. Lamblin, and al., “Theano: a cpu and gpu math expression compiler,” in Proceedings of the Python for scientific computing conference (SciPy), vol. 4. Austin, TX, 2010, p. 3. [22] A. L. Maas et al., “Learning word vectors for sentiment analysis,” in Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, Portland, Oregon, USA, 2011, pp. 142–150. [23] G. E. Hinton, “Learning distributed representations of concepts,” in Proceedings of the eighth annual conference of the cognitive science society, vol. 1. Amherst, MA, 1986, p. 12. [24] G. Mesnil, X. He, L. Deng, and Y. Bengio, “Investigation of recurrentneural-network architectures and learning methods for spoken language understanding.” in INTERSPEECH, 2013, pp. 3771–3775. [25] M. Barreno, B. Nelson et al., “Can machine learning be secure?” in Proceedings of the 2006 ACM Symposium on Information, computer and communications security. ACM, 2006, pp. 16–25.
9cs.NE
A CHARACTERIZATION FOR ASYMPTOTIC DIMENSION GROWTH arXiv:1612.06638v2 [math.MG] 6 Jan 2017 GOULNARA ARZHANTSEVA, GRAHAM A. NIBLO, NICK WRIGHT, AND JIAWEN ZHANG Abstract. We give a characterization for asymptotic dimension growth. We apply it to CAT(0) cube complexes of finite dimension, giving an alternative proof of N. Wright’s result on their finite asymptotic dimension. We also apply our new characterization to geodesic coarse median spaces of finite rank and establish that they have subexponential asymptotic dimension growth. This strengthens a recent result of J. S̆pakula and N. Wright. 1. Introduction The concept of asymptotic dimension was first introduced by Gromov [15] in 1992 as a coarse analogue of the classical topological covering dimension. It started to attract much attention in 1998 when Yu proved that the Novikov higher signature conjecture holds for groups with finite asymptotic dimension (FAD) [30]. A lot of groups and spaces are known to have finite asymptotic dimension. Among those are, for instance, finitely generated abelian groups, free groups of finite rank, Gromov hyperbolic groups [14, 24], mapping class groups [5], CAT(0) cube complexes of finite dimension [29], see [3] for an excellent survey of these and other results. Recently Behrstock, Hagen and Sisto introduced the powerful new notion of hierarchically hyperbolic spaces and showed that these have finite asymptotic dimension [1], recovering a number of the above results, including notably mapping class groups and a number of CAT(0) cube complexes. On the other hand, there are many groups and spaces with infinite asymptotic dimension. Examples are the wreath product Z≀Z, the Grigorchuk group [27], the Thompson groups, etc. Generalizing FAD, Dranishnikov defined the asymptotic dimension growth for a space [13]; if the asymptotic dimension growth function is eventually constant then the space has FAD. Dranishnikov showed that the wreath product of a finitely generated nilpotent group with a finitely generated FAD group has polynomial asymptotic dimension growth. He also showed that polynomial asymptotic dimension growth implies Yu’s Property A, and, hence, the coarse Baum-Connes Conjecture, provided the space has bounded geometry [31]. Later, Ozawa [22] extended this result to spaces with subexponential growth; see also [21]. Bell analyzed how the asymptotic dimension function is affected by various group-theoretical constructions [4]. 2010 Mathematics Subject Classification. 20F65, 20F67, 20F69, 51F99. Key words and phrases. Asymptotic dimension growth, CAT(0) cube complex, coarse median space, mapping class group. Partially supported by the European Research Council (ERC) grant of Goulnara ARZHANTSEVA, no. 259527 and the Sino-British Fellowship Trust by Royal Society. 1 2 GOULNARA ARZHANTSEVA, GRAHAM A. NIBLO, NICK WRIGHT, AND JIAWEN ZHANG In this paper, we give an alternative characterization for the asymptotic dimension growth function which is inspired by Brown and Ozawa’s proof of Property A for Gromov’s hyperbolic groups, [9, Theorem 5.3.15], which is in turn inspired by [17]. We use this to study two notable examples: CAT(0) cube complexes of finite dimension and coarse median spaces of finite rank. The techniques used to study these examples are developments of those used by S̆pakula and Wright [28] to establish Property A for uniformly locally finite coarse median spaces of finite rank. As a byproduct, we obtain a new proof of finite asymptotic dimension for CAT(0) cube complexes which allows one to explicitly construct the required controlled covers. This compares with Wright’s original proof, [29], which is discussed below. CAT(0) cube complexes are a nice class of non-positively curved spaces, first studied by Gromov who gave a purely combinatorial condition for recognizing the non-positive curvature of cube complexes [14]. Many well-known groups act properly on CAT(0) cube complexes. For instance, right-angled Artin groups, many small cancellation groups, and Thompson’s groups admit such actions. This makes it possible to deduce properties of these groups from the corresponding properties of the CAT(0) cube complexes. In 2010, Wright [29] proved that the asymptotic dimension of a CAT(0) cube complex X is bounded by its dimension. He proved this by constructing a family of ε−Lipschitz cobounded maps to CAT(0) cube complexes of (at most) the same dimension indexed by ε > 0. We use our characterization for finite asymptotic dimension to give a direct proof of this result. Namely, we construct uniformly bounded covers with suitable properties. Being more explicit, this proof loses, however, the sharp bound on the asymptotic dimension. Thus, we give an alternative proof of the following non-quantitative variant of Wright’s theorem: Theorem 1.1. Let X be a CAT(0) cube complex of finite dimension, then X has finite asymptotic dimension. The key point in our approach is to analyse the normal cube path distance on the cube complex, introduced by Niblo and Reeves [18]. We consider the ball with respect to the normal cube path distance rather than to the ordinary edgepath distance. We decompose such a ball into intervals and use induction on the dimension in order to construct some “separated” net satisfying a suitable consistency property. In the process, we give a detailed analysis of normal balls and normal spheres (i.e. balls and spheres with respect to the normal cube path distance). See Section 4 for all details. Our second application is to coarse median spaces. They were introduced by Bowditch as a coarse variant of classical median spaces [6]. The notion of a coarse median group leads to a unified viewpoint on several interesting classes of groups, including Gromov’s hyperbolic groups, mapping class groups, and CAT(0) cubical groups. Bowditch showed that hyperbolic spaces are exactly coarse median spaces of rank 1, and mapping class groups are examples of coarse A CHARACTERIZATION FOR ASYMPTOTIC DIMENSION GROWTH 3 median spaces of finite rank [6]. He also established interesting properties for coarse median spaces such as Rapid Decay, the property of having quadratic Dehn function, etc. Intuitively, a coarse median space is a metric space equipped with a ternary operator (called the coarse median), in which every finite subset can be approximated by a finite median algebra. In these approximations the coarse median is approximated by an actual median with the distortion being controlled by the metric. This extends Gromov’s observation that in a δ-hyperbolic space finite subsets can be well approximated by finite trees. Recently, S̆pakula and Wright proved that a coarse median space with finite rank and at most exponential volume growth has Property A [28]. Following their proof and using our characterization for asymptotic dimension growth, we obtain the following result: Theorem 1.2. Let X be a geodesic coarse median space with finite rank and at most exponential volume growth, then X has subexponential asymptotic dimension growth. Hierarchically hyperbolic spaces are examples of coarse median spaces, see [2], hence our theorem is broader in scope, though with a weaker conclusion, than the finite asymptotic dimension result proven in [1]. We expect the following general result. Conjecture 1.3. Every geodesic coarse median space with finite rank has finite asymptotic dimension. By a result of Ozawa [22], subexponential asymptotic dimension growth implies Property A, thus, our theorem strengthens the result of [28]. The paper is organized as follows. In Section 2, we give some preliminaries on asymptotic dimension growth, CAT(0) cube complexes, and coarse median spaces. In Section 3, we provide a characterization of the asymptotic dimension growth function, and, as a special case, give a characterization of finite asymptotic dimension. Sections 4 and 5 deal with CAT(0) cube complexes: in Section 4, we study normal balls and spheres which are essential in our approach to prove Theorem 1.1 in Section 5. Section 6 deals with the coarse median case, and we prove Theorem 1.2 there. 2. Preliminaries 2.1. Asymptotic Dimension. The notion of asymptotic dimension was first introduced by Gromov in 1993 [15] as a coarse analogue of the classical Lebesgue topological covering dimension. See also [3]. Let (X, d) be a metric space and r > 0. We call a family U = {Ui } of subsets in X r−disjoint, if for any U , U′ in U, d(U, U′) > r, where d(U, U′) = inf {d(x, x′) : x ∈ U, x′ ∈ U′ }. We write G Ui r−dis joint 4 GOULNARA ARZHANTSEVA, GRAHAM A. NIBLO, NICK WRIGHT, AND JIAWEN ZHANG for the union of {Ui }. A family V is said to be uniformly bounded, if mesh(V) = sup {diam(V) : V ∈ V} is finite. Let U = {Ui } be a cover of X and r > 0. We define the r−multiplicity of U, denoted by mr (U), to be the minimal integer n such that for any x ∈ X, the ball B(x, r) intersects at most n elements of U. As usual, m(U) denotes the multiplicity of a cover U, that is the maximal number of elements of U with a non-empty intersection. A number λ > 0 is called a Lebesgue number of U, if for every subset A ⊆ X with diameter 6 λ, there exists an element U ∈ U such that A ⊆ U. The Lebesgue number L(U) of the cover U is defined to be the infimum of all Lebesgue numbers of U. Definition 2.1 ([15]). We say that the asymptotic dimension of a metric space X does not exceed n and we write asdim X 6 n, if for every r > 0, the space X can be covered by n + 1 subspaces X0 , X1 , . . . , Xn , and each Xi can be further decomposed into some r−disjoint uniformly bounded subspaces: X= n [ Xi , i=0 Xi = G r − disjoint j∈N Xij , and sup diam Xij < ∞. i, j We say asdim X = n, if asdim X 6 n and asdim X is not less than n. Here are basic examples of spaces and groups with finite asymptotic dimension. Example 2.2 ([20], [24]). 1) asdim Zn = n for all n ∈ N, where Z is the group of integers; 2) Gromov’s δ-hyperbolic spaces, e.g., word hyperbolic groups, have finite asymptotic dimension. From the definition, it is easy to see that the asymptotic dimension of a subspace is at most that of the ambient space. There are other equivalent definitions of asymptotic dimension. We list one here for a later use, and guide the reader to [3] for others. Proposition 2.3 ([3]). Let X be a metric space, then asdim X 6 n if and only if for any r > 0, there exists a uniformly bounded cover U of X, such that mr (U) 6 n + 1. 2.2. Asymptotic Dimension Growth. LLet us consider the direct sum of infinitely many copies of the integers: G = Z. Since for any n ∈ N, the group Zn ∞ is contained in G, by the above mentioned results, G has infinite asymptotic dimension. In order to deal with such groups/spaces, Dranishnikov studied the following concept as a generalization of the property of having a finite asymptotic dimension. Definition 2.4 ([13]). Let (X, d) be a metric space. Define a function adX (λ) = min{m(U) : U is a cover of X, L(U) > λ} − 1, which is called the asymptotic dimension function of X. A CHARACTERIZATION FOR ASYMPTOTIC DIMENSION GROWTH 5 Note that adX is monotonic and lim adX (λ) = asdim (X). λ→∞ Like in the case of the volume function, the growth type of the asymptotic dimension function is more essential than the function itself. Recall that for f, g : R+ → R+ , we write f  g, if there exists k ∈ N, such that for any x > k, f (x) 6 kg(kx + k) + k. We write f ≈ g if both f  g and g  f . It is clear that “ ≈ ” is an equivalence relation. We define the growth type of f to be the ≈-equivalence class of f . Define the asymptotic dimension growth of X to be the growth type of adX . By a result of Bell and Dranishnikov, the growth type of the asymptotic dimension function is a quasi-isometric invariant. Proposition 2.5 ([4, 13]). Let X and Y be two discrete metric spaces with bounded geometry. If X and Y are quasi-isometric, then adX ≈ adY . In particular, the asymptotic dimension growth is well-defined for finitely generated groups. We give an alternative (equivalent) definition of the asymptotic dimension growth that is used in our characterization. Lemma 2.6. Let X be a metric space, and define f X ≈ adX . Then ad f X (λ) = min{ mλ (U) : U is a cover of X} − 1. ad Proof. Given λ > 0, suppose U is a cover of X with L(U) > λ. For any U ∈ U, define the inner λ−neighborhood of U to be N−λ (U) = X \ Nλ (X \ U), where Nλ denotes the usual λ-neighborhood of the set, and we define N−λ (U) = {N−λ (U) : U ∈ U}. Since L(U) > λ, N−λ (U) is still a cover of X. By definition, it is obvious that f X  adX . mλ(N−λ (U)) 6 m(U), which yields ad Conversely suppose U is a cover of X. Consider Nλ (U), which has Lebesgue number not less than λ. It is easy to show m(Nλ(U)) 6 mλ(U), which implies fX . adX  ad  f X as the definition for the By the preceding lemma, we can use either adX or ad asymptotic dimension function. Recall that if there exists a polynomial (subexponential) function f such that adX  f , then X is said to have polynomial (subexponential) asymptotic dimension growth. Dranishnikov has shown that polynomial asymptotic dimension growth implies Yu’s Property A, and he gave a class of groups having such property. Proposition 2.7 ([13]). Let N be a finitely generated nilpotent group and G be a finitely generated group with finite asymptotic dimension. Then the wreath product N ≀ G has 6 GOULNARA ARZHANTSEVA, GRAHAM A. NIBLO, NICK WRIGHT, AND JIAWEN ZHANG polynomial asymptotic dimension growth. In particular, Z ≀ Z has polynomial asymptotic dimension growth. 2.3. CAT(0) Cube Complexes. We recall basic notions and results on the structure of CAT(0) cube complexes. We omit some details and most of the proofs but direct the readers to [8, 12, 14, 18, 26] for more information. A cube complex is a polyhedral complex in which each cell is isometric to a Euclidean cube and the gluing maps are isometries. The dimension of the complex is the maximum of the dimensions of the cubes. For a cube complex X, we can associate it with the intrinsic pseudo-metric dint , which is the minimal pseudo-metric on X such that each cube embeds isometrically. When X has finite dimension, dint is a complete geodesic metric on X. See [8] for a general discussion on polyhedral complex and the associated intrinsic metric. There is also another metric associated with X. Let X(1) be the 1-skeleton of X, that is a graph with the vertex set V = X(0) . We equip V with the edge-path metric d, which is the minimal number of edges in a path connecting two given vertices. Clearly, when X(1) is connected, d is a geodesic metric on V. For x, y ∈ V, the interval is defined by [x, y] = {z ∈ V : d(x, y) = d(x, z) + d(x, y)}, that is it consists of all points on any geodesic between x and y. A geodesic metric space (X, d) is CAT(0) if all geodesic triangles in X are slimmer than the comparative triangle in the Euclidean space. For a cube complex (X, dint ), Gromov has given a combinatorial characterization of the CAT(0) condition [14]: X is CAT(0) if and only if it is simply connected and the link of each vertex is a flag complex (see also [8]). Another characterization of the CAT(0) condition was obtained by Chepoi [12] (see also [25]): a cube complex X is CAT(0) if and only if for any x, y, z ∈ V, the intersection [x, y] ∩ [y, z] ∩ [z, x] consists of a single point µ(x, y, z), which is called the median of x, y, z. In this case, we call the graph X(1) a median graph; and V equipped with the ternary operator m is indeed a median algebra [16]. In particular, the following equations hold: ∀x, y, z, u, v ∈ V, M1. µ(x, x, y) = x; M2. µ(σ(x), σ(y), σ(z)) = µ(x, y, z), where σ is any permutation of {x, y, z}; M3. µ(µ(x, y, z), u, v) = µ(µ(x, u, v), µ(y, u, v), z). Obviously, µ(x, y, z) ∈ [x, y], and [x, y] = {z ∈ V : µ(x, y, z) = z}. Lemma 2.8. Let x, y, z, w ∈ V such that z, w ∈ [x, y]. Then z ∈ [x, w] implies w ∈ [z, y]. Proof. Since z ∈ [x, w] and w ∈ [x, y], we have µ(z, x, w) = z and µ(x, w, y) = w. So, µ(z, w, y) = µ(µ(z, x, w), w, y) = µ(µ(z, w, y), µ(x, w, y), w) = µ(µ(z, w, y), w, w) = w, which implies w ∈ [z, y].  Lemma 2.9. For x, y, z ∈ V and d(z, y) = 1, [x, z] ⊆ [x, y] or [x, y] ⊆ [x, z]. Proof. By Chepoi’s result [12], X(1) is a median graph, hence it is weakly modular (see [12]). So d(x, y) , d(x, z), which implies d(x, y) = d(x, z)+1 or d(x, z) = d(x, y)+1, i.e. [x, z] ⊆ [x, y] or [x, y] ⊆ [x, z].  A CHARACTERIZATION FOR ASYMPTOTIC DIMENSION GROWTH 7 A CAT(0) cubical complex X can be equipped with a set of hyperplanes [11, 18, 19, 26]. Each hyperplane does not intersect itself, and divides the space into two halfspaces. Given two hyperplanes h, k, if the four possible intersections of halfspaces are all nonempty, then we say h crosses k, denoted by h ⋔ k. This occurs if and only if h and k cross a common cube C (also denoted by h ⋔ C). Furthermore [26], given a maximal collection of pairwise intersecting hyperplanes, there exists a unique cube which all of them cross. Thus, the dimension of X is the maximal number of pairwise intersecting hyperplanes. We can also define intervals in the language of hyperplanes: [x, y] consists of points which lie in all halfspaces containing x and y. We call a subset Y ⊆ V convex, if for any x, y ∈ Y, [x, y] ⊆ Y. Obviously, halfspaces are convex since any geodesic crosses a hyperplane at most once [18, 26]. This also implies d(x, y) = ♯{ hyperplane h : h separates x from y}. 2.4. Coarse Median Spaces. According to Gromov, hyperbolic spaces can be considered locally as a coarse version of trees, in the sense that every finite subset can be approximated by a finite tree in a controlled way [14]. If one wants to approximate a space locally by finite median algebras (graphs), this would turn to the definition of coarse median spaces introduced by Bowditch. See [6, 7, 32] for details. Definition 2.10 ([6]). Let (X, ρ) be a metric space, and µ : X3 → X be a ternary operation. We say that (X, ρ, µ) is a coarse median space and µ is a coarse median on X, if the following conditions hold: C1. There exist constants K, H(0) > 0 such that ∀a, b, c, a′, b′ , c′ ∈ X, ρ(µ(a, b, c), µ(a′ , b′ , c′ )) 6 K(ρ(a, a′ ) + ρ(b, b′ ) + ρ(c, c′)) + H(0). C2. There exists a function H : N → [0, +∞) with the following property. For a finite subset A ⊆ X with 1 6 |A| 6 p, there exists a finite median algebra (Π, ρΠ , µΠ ), and maps π : A → Π, λ : Π → X such that ∀x, y, z ∈ Π, a ∈ A, ρ(λµΠ (x, y, z), µ(λx, λy, λz)) 6 h(p), and ρ(a, λπa) 6 h(p). We refer to K, H as the parameters of (X, ρ, µ). Furthermore, if there exists d ∈ N, such that we can always choose the median algebra Π in condition (C2) above of rank at most η, then we say X has (coarse) rank at most η. A finitely generated group is said to be coarse median if some Cayley graph has a coarse median. Note that, by definition, a coarse median on a group is not required to be equivariant under the group action. Remark 2.11. According to Bowditch, without loss of generality, we may always assume that µ satisfies the median axioms M1 and M2: for all a, b, c ∈ X, 8 GOULNARA ARZHANTSEVA, GRAHAM A. NIBLO, NICK WRIGHT, AND JIAWEN ZHANG M1. µ(a, a, b) = a; M2. µ(a, b, c) = µ(b, c, a) = µ(b, a, c). A large class of groups and spaces have been shown to be coarse median, including Gromov’s hyperbolic groups, right-angled Artin groups, mapping class groups, CAT(0) cube complexes, etc. [6]. Bowditch has proved that coarse median groups have Property of Rapid Decay [7], quadratic Dehn’s function [6], etc. This yielded a unified way to prove these properties for the above-listed groups. Recently, S̆pakula and Wright have proved that coarse median spaces of finite rank and of at most exponential volume growth have Yu’s Property A [28]. 3. Characterization for asymptotic dimension growth In this section, we establish a characterization for asymptotic dimension growth and obtain several interesting consequences of this main result. For instance, we get a characterization for a group to have finite asymptotic dimension. Theorem 3.1. Let (X, d) be a discrete metric space, and f : R+ → R+ be a function. Then the following are equivalent. (1) adX  f ; (2) There exists a function g : R+ → R+ which has the same growth type as f , such that ∀l ∈ N, ∀k = 1, 2, . . . , 3l, ∀x ∈ X, we can assign a subset S(x, k, l) ⊆ X, satisfying: i) ∀l ∈ N, ∃Sl > 0, such that S(x, k, l) ⊆ B(x, Sl ) for all k = 1, . . . , 3l; ii) ∀l ∈ N, ∀k, k′ with 1 6 k 6 k′ 6 3l, ∀x ∈ X, we have S(x, k, l) ⊆ S(x, k′ , l); iii) ∀x, y ∈ X with d(x, y) 6 l, we have: • S(x, k − d(x, y), l) ⊂ S(x, k, l) ∩ S(y, k, l), for k = d(x, y) + 1, . . . , 3l; • S(x, k + d(x, y), l) ⊃ S(x, k, l) ∩ S(y, k, l), for k = 1, . . . , 3l − d(x, y); iv) ∀l ∈ N, ∀k = 1, 2, . . . , 3l, ∀x ∈ X, we have ♯S(x, k, l) 6 g(l). Proof. • 1 ⇒ 2: By Lemma 2.6, we can assume that there exists a function g : R+ → R+ with g ≈ f such that ∀l ∈ N, there exists a uniformly bounded cover U of X with m3l (U) 6 g(l). Suppose U = {Ui : i ∈ I}, and choose xi ∈ Ui . For k = 1, 2, . . . , 3l and x ∈ X, we define S(x, k, l) = {xi : B(x, k) ∩ Ui , ∅}. Now let us check the four properties in Condition 2. i) If B(x, k) ∩ Ui , ∅, we can assume y ∈ B(x, k) ∩ Ui . Now d(y, xi ) 6 mesh(U), so d(x, xi) 6 k + mesh(U) 6 3l + mesh(U). In other words, S(x, k, l) ⊆ B(x, 3l + mesh(U)). ii) It is immediate, by our definition of sets S(x, k, l). iii) ∀x, y ∈ X with d(x, y) 6 l, ∀k = d(x, y) + 1, . . . , 3l, we have: S(x, k − d(x, y), l) = {xi : B(x, k − d(x, y)) ∩ Ui , ∅}. A CHARACTERIZATION FOR ASYMPTOTIC DIMENSION GROWTH 9 Now if B(x, k − d(x, y)) ∩ Ui , ∅, we can assume z ∈ B(x, k − d(x, y)) ∩ Ui, i.e. z ∈ Ui and d(z, x) 6 k − d(x, y). So d(z, y) 6 k, i.e. z ∈ B(y, k) ∩ Ui . So B(y, k) ∩ Ui , ∅, which implies S(x, k − d(x, y), l) ⊂ S(x, k, l) ∩ S(y, k, l). On the other hand, ∀k′ = 1, . . . , 3l − d(x, y), suppose x j ∈ S(x, k′ , l) ∪ S(y, k′ , l). We can assume that x j ∈ S(y, k′ , l), i.e. B(y, k′ ) ∩ U j , ∅, which implies B(x, k′ + d(x, y)) ∩ U j , ∅. So we have: S(x, k′ + d(x, y), l) ⊃ S(x, k′ , l) ∩ S(y, k′ , l). iv) ∀l ∈ N, ∀k = 1, 2, . . . , 3l, ∀x ∈ X, we have ♯S(x, k, l) = ♯{xi : B(x, k) ∩ Ui , ∅} 6 m3l (U) 6 g(l). S S(x, l, l). Also, ∀h ∈ H, we define Ah = {y : h ∈ • 2 ⇒ 1: ∀l ∈ N, let H = x∈X S(y, l, l)}. We define Ul = {Ah : h ∈ H}. Since ∀x ∈ X, if we take h ∈ S(x, l, l), then x ∈ Ah . So Ul is a cover of X. Since ∃Sl > 0 such that S(x, l, l) ⊆ B(x, Sl ), we know that d(h, y) 6 Sl for all y ∈ Ah , which implies mesh(Ul ) 6 Sl . Finally, let us analyse ml (Ul ). ∀x ∈ X, consider h ∈ H with B(x, l) ∩ Ah , ∅. Take y ∈ B(x, l) ∩ Ah , i.e. d(y, x) 6 l and h ∈ S(y, l, l). Now by assumptions in Condition 2, we have S(y, l, l) ⊆ S(x, l + d(x, y), l) ⊆ S(x, 2l, l). So ml (Ul ) 6 ♯S(x, 2l, l) 6 g(l). Finally by Lemma 2.6, we have f X 6 g ≈ f. adX ≈ ad  Taking in the preceding theorem a constant function f , we obtain a characterization for finite asymptotic dimension. Corollary 3.2. Let (X, d) be a discrete metric space, n ∈ N. Then the following are equivalent: (1) asdim X 6 n; (2) ∀l ∈ N, ∀k = 1, 2, . . . , 3l, ∀x ∈ X, we can assign a subset S(x, k, l) ⊆ X, satisfying: i) ∀l ∈ N, ∃Sl > 0, such that S(x, k, l) ⊆ B(x, Sl ) for all k = 1, . . . , 3l; ii) ∀l ∈ N, ∀k, k′ with 1 6 k 6 k′ 6 3l, ∀x ∈ X, we have S(x, k, l) ⊆ S(x, k′ , l); iii) ∀x, y ∈ X with d(x, y) 6 l, we have: • S(x, k − d(x, y), l) ⊂ S(x, k, l) ∩ S(y, k, l), for k = d(x, y) + 1, . . . , 3l; • S(x, k + d(x, y), l) ⊃ S(x, k, l) ∩ S(y, k, l), for k = 1, . . . , 3l − d(x, y); iv) ∀l ∈ N, ∀k = 1, 2, . . . , 3l, ∀x ∈ X, we have ♯S(x, k, l) 6 n + 1. Now we turn to the case when X is a graph, and obtain a characterization for finite asymptotic dimension which is easier to check. Corollary 3.3. Given a graph X = (V, E) with vertices V and edges E, and equipped with the edge-path length metric d, then the following are equivalent: (1) asdim X 6 n; 10 GOULNARA ARZHANTSEVA, GRAHAM A. NIBLO, NICK WRIGHT, AND JIAWEN ZHANG (2) ∀l ∈ N, ∀k = 1, 2, . . . , 3l, ∀x ∈ X, we can assign a subset S(x, k, l) ⊆ X, satisfying: i) ∀l ∈ N, ∃Sl > 0, such that S(x, k, l) ⊆ B(x, Sl ) for all k = 1, . . . , 3l; ii) ∀l ∈ N, ∀k, k′ with 1 6 k 6 k′ 6 3l, ∀x ∈ X, we have S(x, k, l) ⊆ S(x, k′ , l); iii) ∀x, y ∈ X with d(x, y) = 1 (i.e. with x and y connected by an edge), we have: S(y, k, l) ⊆ S(x, k + 1, l) for all k = 1, 2, . . . , 3l − 1; iv) ∀l ∈ N, ♯S(x, 2l, l) 6 n + 1. Remark 3.4. The only distinction between the above two corollaries is that in Corollary 3.3, assumption 2/iii) is required only for endpoints of an edge rather than for an arbitrary pair of points as in Corollary 3.2. We point out that the preceding corollaries can be generalized to the case of arbitrary asymptotic dimension growth. We will not use such a generalization, so we omit it. Proof of Corollary 3.3. 1 ⇒ 2 is implied directly by Corollary 3.2, so we focus on 2 ⇒ 1. S S(x, l, l). Following the proof of 2 ⇒ 3 in Proposition 3.1, ∀l ∈ N, let H = x∈X And ∀h ∈ H, define Ah = {y : h ∈ S(y, l, l)}. Define Ul = {Ah : h ∈ H}. Since ∀x ∈ X, if we take h ∈ S(x, l, l), then x ∈ Ah . So Ul is a cover of X. Since ∃Sl > 0 such that S(x, l, l) ⊆ B(x, Sl ), we know d(h, y) 6 Sl for all y ∈ Ah , which implies mesh(Ul ) 6 Sl . Finally, let us analyse ml (Ul ). ∀x ∈ X, consider h ∈ H with B(x, l) ∩ Ah , ∅. Take y ∈ B(x, l) ∩ Ah , i.e. d(y, x) 6 l and h ∈ S(y, l, l). By the definition of the edge-path length metric d, we know that there exists a sequence of vertices y = y0 , y1 , . . . , yk = x such that yi ∈ V for all i = 0, 1, . . . , k, d(yi , yi+1 ) = 1 for all i = 0, 1, . . . , k − 1, and k 6 l. Now by the hypothesis, we know: S(y, l, l) ⊆ S(y1 , l + 1, l) ⊆ S(y2 , l + 2, l) ⊆ . . . ⊆ S(yk , l + k, l) = S(x, k + l, l) ⊆ S(x, 2l, l). So {h ∈ H : B(x, l) ∩ Ah , ∅} ⊆ S(x, 2l, l), which implies ml (Ul ) 6 ♯S(x, 2l, l) 6 n + 1.  4. Normal cube path and normal distance In the next two sections, we focus on CAT(0) cube complexes, and prove Theorem 1.1. We prove it by constructing a uniformly bounded cover with suitable properties. Such a construction relies deeply on the analysis of normal balls and spheres, which we give in this section. Normal cube paths, which were introduced by Niblo and Reeves in [18] play a key role in the construction of the cover. They determine a distance function on the vertices and the balls and spheres defined in terms of this distance are essential in our proof of Theorem 1.1. Throughout this section we fix a CAT(0) cube complex X with a fixed vertex x0 . The 1-skeleton X(1) of X is a graph with vertex set V = X(0) , and edge set E, which give us the edge metric d on V. This is the restriction of the ℓ1 metric to the 0-skeleton. 4.1. Normal cube paths. Given a cube C ∈ X, we denote by St(C) the union of all cubes which contain C as a subface. A CHARACTERIZATION FOR ASYMPTOTIC DIMENSION GROWTH 11 Definition 4.1 ([18]). Let {Ci }ni=0 be a sequence of cubes such that each cube has dimension at least 1, and Ci−1 ∩ Ci consists of a single point, denoted by vi . • Call {Ci }ni=0 a cube path, if Ci is the (unique) cube of minimal dimension containing vi and vi+1 , i.e. vi and vi+1 are diagonally opposite vertices of Ci . Define v0 to be the vertex of C0 diagonally opposite to v1 , and vn+1 to be the vertex of Cn diagonally opposite to vn . The so-defined vertices {vi }n+1 are i=0 called the vertices of the cube path, and we say the cube path is from v0 to vn+1 . • The length of a cube path is the number of the cubes in the sequence. • A cube path is called normal if Ci ∩ St(Ci−1 ) = vi . Normal cube paths in CAT(0) cube complexes behave like geodesics in trees. More precisely, in [18], the existence and uniqueness of normal cube paths connecting any pair of vertices is established. See also [23]. Proposition 4.2 ([18]). For any two vertices x, y ∈ V, there exists a unique normal cube path from x to y. (Note that the order is important here since in general normal cube paths are not reversible). Proposition 4.3 ([18]). The intersection of a normal cube path and a hyperplane is connected. In other words, a normal cube path crosses a hyperplane at most once. Proposition 4.4 ([18], [10]). Let {Ci }ni=0 and {D j }mj=0 be two normal cube paths in X, and let {vi }n+1 and {w j }m+1 be the vertices of these normal cube paths. If d(v0 , w0 ) 6 1 and i=0 j=0 d(vn+1 , wm+1 ) 6 1, then for all k, we have d(vk , wk ) 6 1. We omit the proofs for the above three propositions, the readers can find them in the original paper. However, let us recall the construction of the normal cube path from x to y as follows: consider all the hyperplanes separating x from y and adjacent to x. The key fact is that these hyperplanes all cross a unique cube adjacent to x lying in the interval from x to y. This cube is defined to be the first cube on the normal cube path; then one proceeds inductively to construct the required normal cube path. We will also need the following lemma, abstracted from [18]. Lemma 4.5. Let {Ci }ni=0 be the normal cube path, and h be a hyperplane. If h ⋔ Ci , then ∃ a hyperplane k, such that k ⋔ Ci−1 and h does not intersect with k. Proof. Otherwise, ∀k ⋔ Ci−1 , we have h ⋔ k. Now by Lemma 2.15 in [18], we know that there exists a cube C ∈ X, such that all such k ⋔ C and h ⋔ C, and Ci−1 is a face of C. Moreover, C contains an edge e of Ci since h ⋔ C. So St(Ci−1 ) ∩ Ci contains e, which is a contradiction to the definition of normal cube path.  Now for any two vertices of X, we consider all the hyperplanes separating them, with a partial order by inclusion. More explicitly, for any x, y ∈ V, let H(x, y) be the set of hyperplanes separating x and y. For any h ∈ H(x, y), let h− be the halfspace containing x. Define h 6 k if h− ⊆ k− . Note that the definition depends 12 GOULNARA ARZHANTSEVA, GRAHAM A. NIBLO, NICK WRIGHT, AND JIAWEN ZHANG on the vertices we choose, and we may change them under some circumstances, but still write h− for abbreviation. To avoid ambiguity, we point out the vertices if necessary. We write h < k to mean a strict containment h− ( k− . Lemma 4.6. For any h, k ∈ H(x, y), h and k do not intersect if and only if h 6 k or k 6 h. Proof. We only need to show the necessity. Let {Ci }ni=0 be the normal cube path from x to y, and assume h ⋔ Ci , k ⋔ C j . Since h and k do not intersect, i , j. Assume i < j. Obviously, x ∈ h− ∩ k− , and y ∈ h+ ∩ k+ . Since h ⋔ Ci and k ⋔ C j , by Proposition 4.3, vi+1 ∈ h+ ∩ k− . Since h does not intersect with k, we have h− ∩ k+ = ∅, which implies h− ⊆ k− .  Combining the above two lemmas, we have the following result on the existence of chains in H(x, y). Proposition 4.7. Let {Ci }ni=0 be the normal cube path from x to y, and h be a hyperplane such that h ⋔ Cl . Then there exists a chain of hyperplanes h0 < h1 < · · · < hl−1 , hl = h such that hi ⋔ Ci . Proof. By Lemma 4.5, there exists a hyperplane k, such that k ⋔ Cl−1 and h does not intersect with k. Define hl−1 = k. Inductively, we can define a sequence of hyperplanes as required. Then the conclusion follows by Lemma 4.6.  Finally, we give a lemma used in the proof of the consistency part of our main theorem. Lemma 4.8. Let x0 , x, y ∈ V with [x0 , y] ⊆ [x0 , x], and let x′ , y′ be the n−th vertex on the normal cube path from x0 to x, and to y. If x′ , y′ , then x′ < [x0 , y]. Proof. Otherwise, x′ ∈ [x0 , y]. By the construction of the normal cube path, we know x′ is also the n−th vertex on the normal cube path from x0 to y, since y ∈ [x0 , x]. In other words, x′ = y′ , which is a contradiction to the assumption.  4.2. Normal metric. We define a new metric on V = X(0) using normal cube paths [18, 23]. Definition 4.9. For any x, y ∈ V, define dnor (x, y) to be the length of the normal cube path from x to y. We call dnor the normal metric on V. One needs to verify that dnor is indeed a metric. It is easy to see that dnor (x, y) > 0, and dnor (x, y) = 0 if and only if x = y. Note that the normal cube path from x to y is not the one from y to x in general, so the symmetric relation is not that obvious. In order to show the symmetric relation and the triangle inequality, we give the following characterization. Lemma 4.10. For x, y ∈ V, let < be the relation defined as above. Then dnor (x, y) = sup{m + 1 : h0 < h1 < · · · < hm , hi ∈ H(x, y)}. A CHARACTERIZATION FOR ASYMPTOTIC DIMENSION GROWTH 13 Proof. Suppose {Ci }ni=0 is the normal cube path from x to y, so dnor (x, y) = n + 1. Denote the right hand side of the equality in the lemma by n′ . Now for any chain h0 < h1 < · · · < hm in H(x, y), by Proposition 4.3, hi intersects with just one cube, denoted by Ck(i) . Obviously, if h, k ⋔ Ci , then h ⋔ k. So k(i) , k(j) if i , j, which implies m 6 n, so n′ 6 n. On the other hand, for any h ⋔ Cn , by Proposition 4.7, we have a chain of hyperplanes h0 < h1 < · · · < hn−1 < hn = h, such that hi ⋔ Ci , which implies n 6 n′ .  Proposition 4.11. dnor is indeed a metric on V. Proof. By Lemma 4.10, H(x, y) = H(y, x), and as posets they carry opposite orders. One can thus deduce dnor (x, y) = dnor (y, x). For x, y, z ∈ V, H(x, y)△H(y, z) = H(x, z), where △ is the symmetric difference operation. The inclusions of H(x, y) ∩ H(x, z) into H(x, y) and H(y, z) ∩ H(x, z) into H(y, z) are both order preserving, and therefore, by Lemma 4.10, we have dnor (x, z) 6 dnor (x, y) + dnor (y, z).  4.3. Normal balls and normal spheres. Recall that for any two points x, y in V = X(0) , the interval between them is [x, y] = {z ∈ V : d(x, y) = d(x, z) + d(z, y)}. In other words, [x, y] is the set of vertices on the union of all the edge geodesics from x to y. A subset Y ⊆ V is called convex, if for any x, y ∈ Y, [x, y] ⊆ Y. Now let B(x, n) be the closed ball in the edge metric with centre x ∈ V and radius n. Generally, B(x, n) is not convex (for example, take X = Z2 ). However, as we will see, for the normal metric balls are convex. More precisely, we define the normal ball with centre x ∈ V and radius n to be Bnor (x, n) = {y ∈ V : dnor (x, y) 6 n} and the normal sphere with centre x ∈ V and radius n to be Snor (x, n) = {y ∈ V : dnor (x, y) = n}. Lemma 4.12. Bnor (x, n) is convex for all x ∈ V and n ∈ N. Proof. Given z, w ∈ Bnor (x, n), and a geodesic γ from z to w, if γ * Bnor (x, n), we can assume u is the first vertex on γ which is not in Bnor (x, n), which implies dnor (x0 , u) = n + 1. Let z′ be the vertex preceding u on γ, so dnor (x0 , z′ ) = n (since dnor (z′ , u) = 1). Since d(z′ , u) = 1, there exists a unique hyperplane h separating z′ from u, so H(x0 , u) = H(x0 , z′ ) ⊔ {h}. Now according to Lemma 4.10, there exists a chain h0 < · · · < hn−1 < h in H(x0 , u) with hi ∈ H(x0 , z′ ). Since every geodesic intersects with any hyperplane at most once (see for example [26]), w ∈ h+ , which implies h0 < · · · < hn−1 < h is also a chain in H(x0 , w). This is a contradiction to dnor (x0 , w) 6 n, by Lemma 4.10.  Since the intersection of two convex sets is still convex, we have the following corollary. Corollary 4.13. For any x ∈ V and n ∈ N, the set [x0 , x] ∩ Bnor (x0 , n) is convex. 14 GOULNARA ARZHANTSEVA, GRAHAM A. NIBLO, NICK WRIGHT, AND JIAWEN ZHANG It is well known that for a convex subset Y in a CAT(0) cube complex and a point v < Y, there is a unique point in Y which is closest to v (see, for example, [8]). This statement is true both for the intrinsic CAT(0) metric on the cube complex and the edge metric on the vertex set, and we have a similar statement for the normal distance: Proposition 4.14. There exists a unique point v ∈ [x0 , x] ∩ Bnor (x0 , n) such that [x0 , x] ∩ Bnor (x0 , n) ⊆ [x0 , v]. The point v is characterized by: d(x0 , v) = max{d(x0 , v′) : v′ ∈ [x0 , x] ∩ Bnor (x0 , n)}. Furthermore, if dnor (x0 , x) > n, then v ∈ [x0 , x] ∩ Snor (x0 , n), which implies that v is also the unique point in [x0 , x] ∩ Snor (x0 , n) such that d(x0 , v) = max{d(x0 , v′ ) : v′ ∈ [x0 , x] ∩ Snor (x0 , n)}. Proof. If there exist z , w ∈ [x0 , x] ∩ Bnor (x0 , n) such that d(x0 , z) = d(x0 , w) attains the maximum, consider the median m = µ(z, w, x). By Corollary 4.13, m ∈ [z, w] ⊆ [x0 , x] ∩ Bnor (x0 , n), so d(m, x0) = d(z, x0 ) = d(w, x0). While m ∈ [z, x] ∩ [w, x], so m = z = w, which is a contradiction. By Corollary 4.13 [x0 , v] ⊆ [x0 , x] ∩ Bnor (x0 , n). Conversely, for any u ∈ [x0 , x] ∩ Bnor (x0 , n), let m = µ(u, v, x) ∈ [u, v]. By Corollary 4.13, m ∈ [x0 , x] ∩ Bnor (x0 , n). While m ∈ [v, x], so d(m, x0) > d(v, x0), which implies m = v by the choice of v, i.e. µ(u, v, x) = v, so v ∈ [u, x]. Now by Lemma 2.8, u ∈ [x0 , v]. Now for x, n satisfying dnor (x0 , x) > n, if v ∈ [x0 , x] ∩ Bnor (x0 , n − 1), take a geodesic γ from v to x, and let v = y0 , y1 , . . . , yk = x be the vertices on γ. Since dnor (x0 , x) > n, x , v, which implies k > 0. Now for y1 , since y1 ∈ [v, x], d(x0 , v) < d(x0 , y1). By the definition of v, we know y1 < [x0 , x] ∩ Bnor(x0 , n), so y1 < Bnor (x0 , n). However, since d(v, y1) = dnor (v, y1) = 1, we have dnor (x0 , y1 ) 6 dnor (x0 , v) + dnor (v, y1 ) 6 n, which is a contradiction.  To use the above proposition more flexibly, we give another characterization of v, which can also be viewed as an alternative definition of v. In the rest of this subsection, we fix x ∈ V and n ∈ N with dnor (x0 , x) > n. be the normal cube path from x0 to x, and ṽ = vn be the Proposition 4.15. Let {Ci }N i=0 n-th vertex on this normal cube path. Then ṽ = v, which is provided by Proposition 4.14. To prove this result, let us focus on subsets in H(x0 , x). Recall that H(x0 , x) is endowed with the relation 6, as defined prior to Lemma 4.6. Definition 4.16. A subset A ⊆ H(x0 , x) is called closed (under <), if ∀h ∈ A and k < h, k ∈ A. A CHARACTERIZATION FOR ASYMPTOTIC DIMENSION GROWTH 15 Lemma 4.17. Let ṽ be the n-th vertex on the normal cube path from x0 to x, then H(x0 , ṽ) is maximal in the following sense: for any closed A ⊆ H(x0 , x) which contains chains only with lengths at most n, A ⊆ H(x0 , ṽ). Proof. We proceed by induction on n. Suppose that the lemma holds for n − 1, and let v′ be the (n − 1)−th vertex on the normal cube path from x0 to x. Given a closed A ⊆ H(x0 , x) containing chains only with lengths at most n, and a maximal chain h0 < h1 < · · · < hm in A. If m 6 n − 2, then the closed set {h ∈ A : h 6 hm } contains chains only with lengths at most n − 1; by induction, it is contained in H(x0 , v′) ⊆ H(x0 , ṽ). Now for m = n − 1: similarly, {h ∈ A : h 6 hn−2 } ⊆ H(x0 , v′ ), which implies hi ⋔ Ci for i = 0, 1, . . . , n − 2. So hn−1 ⋔ Ck for some k > n − 1. If k , n− 1, by Proposition 4.7 and the closeness of A, we get a chain in A with length greater than n, which is a contradiction. So hn−1 ⋔ Cn−1 , i.e. hn−1 ∈ H(x0 , ṽ).  Proof of Proposition 4.15. By Proposition 4.14, ṽ ∈ [x0 , x] ∩ Bnor (x0 , n) ⊆ [x0 , v], which implies H(x0 , ṽ) ⊆ H(x0 , v). However, H(x0 , v) is closed and contains chains only with lengths at most n according to Lemma 4.10, so H(x0 , v) ⊆ H(x0 , ṽ) by Lemma 4.17, which implies H(x0 , v) = H(x0 , ṽ). So H(v, ṽ) = H(x0 , v)△H(x0 , ṽ) = ∅, which implies v = ṽ.  Finally, we characterize those points in [x0 , x] which lie in the intersection [x0 , x]∩ Snor (x0 , n). This will be used in the next subsection to decompose [x0 , x] ∩ Snor (x0 , n) into a union of intervals. Let Cn−1 be the n-th cube on the normal cube path from x0 to x, and v = ṽ is the n-th vertex on the cube path as above. Let Hn be the set of all hyperplanes intersecting with Cn−1 . Proposition 4.18. For w ∈ [x0 , x], the following are equivalent: 1) w ∈ [x0 , x] ∩ Snor (x0 , n); 2) ∃h ∈ Hn , such that h crosses the last cube on the normal cube path from x0 to w; 3) ∃h ∈ Hn , such that h separates w from x0 and w ∈ [x0 , v]. Proof. • 1) ⇒ 3): By Proposition 4.14, w ∈ [x0 , v]. Since dnor (x0 , w) = n, by Lemma 4.10, the maximum length of chains in H(x0 , w) is n. Take such a chain h0 < h1 < · · · < hn−1 in H(x0 , w) ⊆ H(x0 , v). Obviously, hi intersects with different cubes, which implies hi ⋔ Ci . So hn−1 ∈ Hn , and it separates w from x0 . • 3) ⇒ 2): Since h separates w from x0 , h must cross some cube C on the normal cube path from x0 to w. Since h ∈ Hn , we know there is a chain h0 < h1 < · · · < hn−1 = h in H(x0 , v), which is also a chain in H(x0 , w). So h cannot cross the first n − 1 cubes of the normal cube path from x0 to w. If h does not cross the last cube, then dnor (x0 , w) > n. However, w ∈ [x0 , v] implies H(x0 , w) ⊆ H(x0 , v), by Lemma 4.10, dnor (x0 , v) > n, which is a contradiction. • 2) ⇒ 1): This is immediate, by Lemma 4.10. 16 GOULNARA ARZHANTSEVA, GRAHAM A. NIBLO, NICK WRIGHT, AND JIAWEN ZHANG  We have another description for Hn , which is implied by Proposition 4.7 directly. Lemma 4.19. For h ∈ H(x0 , x), h ∈ Hn if and only if the maximal length of chains in {k ∈ H(x0 , x) : k 6 h} is n. 4.4. Decomposition of [x0 , x] ∩ Snor (x0 , n). We want to decompose the set [x0 , x] ∩ Snor (x0 , n) so that we can proceed by the induction on dimension in the proof of Theorem 1.1. Throughout this subsection, we fix x ∈ V and n ∈ N with dnor (x0 , x) > n, and let v be as defined in Proposition 4.14. At the end of the preceding subsection, we have defined Hn to be the set of all hyperplanes intersecting with Cn−1 , where {Ci } is the normal cube path from x0 to x. Now we decompose [x0 , x]∩Snor (x0 , n) into a union of intervals with dimensions lower than [x0 , x], and the number of these intervals can be controlled by the dimension of [x0 , x]. This will make it possible to do induction on the dimension. Definition 4.20. For h ∈ Hn , we define Fh = {w ∈ [x0 , x] ∩ Snor (x0 , n) : h separates w from x0 }. By Proposition 4.18, we immediately obtain the following two lemmas. Lemma 4.21. Fh = {w ∈ [x0 , x] : h crosses the last cube on the normal cube path from x0 to w} = {w ∈ [x0 , v] : h separates w from x0 }. S Lemma 4.22. [x0 , x] ∩ Snor (x0 , n) = h∈Hn Fh . By definition, we know Fh = [x0 , x] ∩ Bnor (x0 , n) ∩ {v′ : h separates v′ from x0 }, which implies that Fh is convex. Moreover, we will show that Fh is actually an interval. Lemma 4.23. Let xh ∈ Fh be the point minimising d(x0 , xh ). Then Fh = [xh , v]. Proof. Since Fh is convex and xh , v ∈ Fh , so [xh , v] ⊆ Fh . On the other hand, ∀z ∈ Fh , let m = µ(x0 , z, xh ). So, m ∈ Fh and d(x0 , m) 6 d(x0 , xh ). By the choice of xh , we know that d(x0 , m) = d(x0 , xh ), which implies m = xh , so xh ∈ [x0 , z]. By Proposition 4.14, xh , z ∈ [x0 , v]. Thus, by Lemma 2.8, z ∈ [xh , v].  S Proposition 4.24. [x0 , x] ∩ Snor (x0 , n) = h∈Hn [xh , v], and dim[xh , v] < dim[x0 , x]. Proof. We only need to show dim[xh , v] < dim[x0 , x]. For any hyperplane k crossing [xh , v], by Proposition 4.18, k ⋔ h. So dim[xh , v] < dim[x0 , x].  Now we give another characterization for xh , which is useful in the proof of the consistency condition of Theorem 1.1. A CHARACTERIZATION FOR ASYMPTOTIC DIMENSION GROWTH 17 Lemma 4.25. Let xh be the closest point to x0 on Fh , then xh is the unique point in Bnor (x0 , n) such that h separates x0 from xh , and for any hyperplane k ⋔ h, k does not separate xh from x0 . Proof. Since xh ∈ Fh , we have xh ∈ [x0 , x] ∩ Bnor (x0 , n) and h separates x0 from xh . Now for any hyperplane k ⋔ h, if k separates xh from x0 , we have xh ∈ h+ ∩ k+ and x0 ∈ h− ∩ k− . Choose x̃h ∈ [x0 , xh ] such that x̃h ∈ h+ ∩ k− . Since k does not separate x̃h from x0 , so d(x0 , x̃h) < d(x0 , xh). However, by Lemma 4.21, x̃h ∈ Fh , which is a contradiction. It remains to show that xh is the unique point satisfying these conditions. Otherwise, let x̂h be another point satisfying the hypothesis in the lemma and x̂h , xh . Let k be a hyperplane separating x̂h from xh , and assume xh ∈ k− . Obviously, k , h. If k ⋔ h, by hypothesis, k does not separate xh from x0 , as well as x̂h from x0 , which is a contradiction since k separates x̂h from xh . So k does not cross h, which implies h− ( k− by Lemma 4.6. However, x̂h ∈ k+ , so by Lemma 4.10, dnor (x0 , xh ) < dnor (x0 , x̂h ). This is a contradiction since dnor (x0 , xh ) > n as h separates x0 from xh .  4.5. S̆pakula and Wright’s Construction. We conclude this section with a recent application of normal cube paths, which were invoked by S̆pakula and Wright, [28], in order to provide a new proof that finite dimensional CAT(0) cube complexes have Yu’s Property A. The key to their proof was the construction of a family of maps hl with the property that for any interval and any neighbourhood of an endpoint of the interval the maps push that neighbourhood into the interval itself. These maps were defined in terms of the normal cube paths as follows: Definition 4.26 (The h maps). Given l ∈ N, we define hl : X → X as follows. For x ∈ X, let hl (x) be the 3l−th vertex on the normal cube path from x to x0 if dnor (x, x0 ) > 3l; and let it be x0 if dnor (x, x0 ) < 3l. Lemma 4.27 ([28]). Let hl be defined as above and y ∈ B(x, 3l). Then hl (y) ∈ [x0 , x]. Proof. We only need to show that every halfspace containing x and x0 contains also z = hl (y). For any hyperplane h such that one of the associated halfspaces, say h+ , contains x and x0 , either y ∈ h+ or y ∈ h− . In the former case, z ∈ h+ , so we only need to check the case that h separates x, x0 from y. Denote by C0 , C1 , . . . , Cm the normal cube path from y to x0 , and denote by y = v0 , v1, . . . , vm = x0 the vertices on this cube path. We shall argue that any hyperplane separating y from x, x0 is “used” within the first d(x, y) steps on the cube path. Suppose that the cube Ci does not cross any hyperplane h with h separating y from x, x0. Hence every hyperplane k ⋔ Ci separates y, x from x0 , vi+1 . If there was a hyperplane l separating y from x, x0 before Ci , then necessarily l separates y, vi+1 from x, x0 , hence l crosses all the hyperplanes k crossing Ci . This contradicts the maximality of this step on the normal cube path. Thus, there is no such l, and so all the hyperplanes h separating y from x, x0 must be crossed within the first d(x, y) steps. 18 GOULNARA ARZHANTSEVA, GRAHAM A. NIBLO, NICK WRIGHT, AND JIAWEN ZHANG Since z is the 3l−th vertex on the cube path and d(x, y) 6 3l, all the hyperplanes h separating y from x, x0 must have been crossed before z. Thus, any such h actually also separates y from x, x0, z.  We will use the remarkable properties of the h maps to construct the S sets defined in our characterization of finite asymptotic dimension in the next section. 5. Finite dimensional CAT(0) cube complexes Throughout this section, we fix a CAT(0) cube complex X of finite dimension η and equipped with a basepoint x0 ∈ X. We will make use of the characterization obtained in Corollary 3.3 in order to prove Theorem 1.1. 5.1. Constructing the sets S(x, k, l). By Corollary 3.3, in order to prove X has finite asymptotic dimension, we need to find a constant N ∈ N such that ∀l ∈ N, ∀k = 1, 2, . . . , 3l, ∀x ∈ X, we can assign a subset S(x, k, l) ⊆ X, satisfying: i) ii) iii) iv) ∀l ∈ N, ∃Sl > 0, such that S(x, k, l) ⊆ B(x, Sl ) for all k = 1, . . . , 3l; ∀l ∈ N, ∀k, k′ with 1 6 k 6 k′ 6 3l, ∀x ∈ X, S(x, k, l) ⊆ S(x, k′ , l); ∀x, y ∈ X with d(x, y) = 1, S(y, k, l) ⊆ S(x, k + 1, l) for all k = 1, 2, . . . , 3l − 1; ∀l ∈ N, ♯S(x, 2l, l) 6 N + 1. Now for l ∈ N, k = 1, 2, . . . , 3l, and x ∈ X, we define e S(x, k, l) = hl (B(x, k)). It is easy to show that {e S(x, k, l)} satisfies i) to iii), but it does not satisfy iv) above, so we need some modification. Intuitively, we construct S(x, k, l) as a uniformly separated net in e S(x, k, l). To be more precise, we require the following lemma. Lemma 5.1. There exist two constants N, K only depending on the dimension η, such that ∀l ∈ N, ∀x ∈ V, there are subsets Cx ⊆ [x0 , x], and maps px : [x0 , x] → P(Cx ), where P(Cx ) denotes the power set of Cx , satisfying: • If d(x, y) = 1 and y ∈ [x0 , x], then Cx ∩ [x0 , y] = Cy , and px |[x0 ,y] = p y ; • For z ∈ [x0 , x]and w ∈ px (z), we have d(z, w) 6 Kl; • ∀z ∈ [x0 , x], ♯ B(z, Ml) ∩ Cx 6 N, where M = 3η + 3 + K. We postpone the proof of the above lemma and first show how to use it to construct S(x, k, l) (and, hence, to conclude the proof of Theorem 1.1). Proof of Theorem 1.1. Let N, K be the constants in Lemma 5.1. ∀l ∈ N, ∀k = 1, 2, . . . , 3l, ∀x ∈ X, let e S(x, k, l) = hl (B(x, k)) be as above, and by Lemma 4.27, e we know S(x, k, l) ⊆ [x0 , x]. Now we define [ S(x, k, l) = px (e S(x, k, l)), and the only thing left to complete the proof is to verify the conditions in Corollary 3.3. A CHARACTERIZATION FOR ASYMPTOTIC DIMENSION GROWTH 19 i) By the definition of hl , we know ∀y ∈ B(x, k), d(y, hl (y)) 6 3ηl. So for any z∈e S(x, k, l), d(z, x) 6 (3η + 3)l. For such z and any w ∈ px (z), by Lemma 5.1, we know d(z, w) 6 Kl, which implies: S(x, k, l) ⊆ B(x, (3η + 3 + K)l) = B(x, Ml). ii) ∀l ∈ N, ∀k, k′ with 1 6 k 6 k′ 6 3l, ∀x ∈ X, we have e S(x, k, l) ⊆ e S(x, k′ , l). Now immediately by the definition, S(x, k, l) ⊆ S(x, k′ , l). iii) ∀x, y ∈ X with d(x, y) = 1, by Lemma 2.9, y ∈ [x0 , x] or x ∈ [x0 , y]. Assume the former. Let k = 1, 2, . . . , 3l − 1. Obviously, e S(y, k, l) ⊆ e S(x, k + 1, l), so we have [ [ [ e e S(y, k, l) = p y (S(y, k, l)) = px |[x0 ,y] (S(y, k, l)) = px (e S(y, k, l)) [ ⊆ px (e S(x, k + 1, l)) = S(x, k + 1, l). Here we use the first part of Lemma 5.1 in the second equation. On the other hand, e S(x, k, l) ⊆ e S(y, k + 1, l), so we have [ [ S(x, k, l) = px (e S(x, k, l)) ⊆ px (e S(y, k + 1, l)) [ [ e = px |[x0 ,y] (S(y, k + 1, l)) = p y (e S(y, k + 1, l)) = S(y, k + 1, l). Here we use the first part of Lemma 5.1 in the fourth equality. iv) By i), we know that S(x, k, l) ⊆ B(x, Ml) for all k = 1, 2, . . . , 3l. Hence, by definition, S(x, k, l) ⊆ B(x, Ml) ∩ Cx . Now by the third part of Lemma 5.1, we have ♯S(x, k, l) 6 N.  The last thing is to prove Lemma 5.1. We use the analysis in Section 4 to construct Cx and px inductively. Recall that in Section 4 (Proposition 4.24), for any l, n ∈ N, and any x ∈ X, we have [ [x0 , x] ∩ Snor (x0 , nl) = [xh , v], h∈Hnl with ♯Hnl 6 η and dim[xh , v] < dim[x0 , x]. In order to carry out induction on the dimension of [x0 , x], we require a stronger version of Lemma 5.1, which is more flexible on the choice of endpoints of intervals. More explicitly, we have Lemma 5.2. There exist two constants N, K only depending on the dimension η, such that ∀l ∈ N, ∀x̄, x ∈ V, ∃Cx̄,x ⊆ [x̄, x], and a map px̄,x : [x̄, x] → P(Cx̄,x ) satisfying: • If d(x, y) = 1 and y ∈ [x̄, x], then Cx̄,x ∩ [x̄, y] = Cx̄,y , and px̄,x |[x̄,y] = px̄,y ; • For z ∈ [x̄, x]and w ∈ px̄,x (z), we have d(z, w) 6 Kl; • ∀z ∈ [x̄, x], ♯ B(z, Ml) ∩ Cx̄,x 6 N, where M = 3η + 3 + K. It is obvious that Lemma 5.1 is implied by Lemma 5.2 (one just needs to take x̄ = x0 ). Now we prove Lemma 5.2. Proof of Lemma 5.2. Fix an l ∈ N. We will carry out induction on dim[x̄, x]. Given any x̄, x ∈ V with dim[x̄, x] = 1, we define Cx̄,x = {y ∈ [x̄, x] : dnor (x̄, y) ∈ lN}, 20 GOULNARA ARZHANTSEVA, GRAHAM A. NIBLO, NICK WRIGHT, AND JIAWEN ZHANG where lN = {0, l, 2l, 3l, . . .}. Since dim[x̄, x] = 1, [x̄, x] is indeed isometric to an interval in R. We define px̄,x : [x̄, x] → P(Cx̄,x ) as follows: for any y ∈ [x̄, x], px̄,x (y) consists of a single point which is at distance l⌊dnor (x̄, y)/l⌋ from x̄ in [x̄, y], where ⌊·⌋ is the function of taking integer part. Now it is obvious that • If d(x, y) = 1 and y ∈ [x̄, x], then Cx̄,x ∩ [x̄, y] = Cx̄,y , and px̄,x |[x̄,y] = px̄,y ; • For any z ∈ [x̄, x] and w ∈ px̄,x (z), we have d(z, w) 6 l; • ∀z ∈ [x̄, x], ♯ B(z, Ml) ∩ Cx̄,x 6 3M. Suppose for any x̄, x ∈ V with dim[x̄, x] 6 η − 1, we have defined Cx̄,x ⊆ [x̄, x] and a map px̄,x : [x̄, x] → P(Cx̄,x ) satisfying: • If d(x, y) = 1 and y ∈ [x̄, x], then Cx̄,x ∩ [x̄, y] = Cx̄,y , and px̄,x |[x̄,y] = px̄,y ; (η−1)η • For z ∈ [x̄, x] and w ∈ px̄,x (z),  we have d(z, w) 6 2 l; • ∀z ∈ [x̄, x], ♯ B(z, Ml) ∩ Cx̄,x 6 (3M)η−1 (η − 1)!. Now we focus on x̄, x ∈ V with dim[x̄, x] = η. For any n ∈ N with nl 6 dnor (x̄, x), by Proposition 4.24, [ [ [xh , vxnl ], Fxh = [x̄, x] ∩ Snor (x̄, nl) = x h∈Hnl x h∈Hnl x where vxnl is the farthest point from x̄ in [x̄, x]∩Snor (x̄, nl), Hnl is the set of hyperplanes crossing the nl-th cube of the normal cube path from x̄ to x, and we also have dim[xh , vxnl ] < dim[x̄, x]. By induction, Cxh ,vxnl and pxh ,vxnl have already been defined. Now we define [ Cnx̄,x = Cxh ,vxnl , x h∈Hnl and Cx̄,x = ⌊dnor[ (x̄,x)/l⌋ Cnx̄,x . n=0 For any z ∈ [x̄, x], let z̃ be the nl-th vertex on the normal cube path from x̄ to z, where n = ⌊dnor (x̄, z)/l⌋, so dnor (z̃, z) 6 l, which implies d(z̃, z) 6 ηl, and [ [xh , vxnl ]. z̃ ∈ [x̄, x] ∩ Snor (x̄, nl) = x h∈Hnl Now define [n o x px̄,x (z) = pxh ,vxnl (z̃) : h ∈ Hnl and z̃ ∈ [xh , vxnl] , and we need to verify the requirements hold for Cx̄,x and px̄,x . First, suppose d(x, y) = 1 and y ∈ [x̄, x], and let h′ be the hyperplane separating x from y. Given n ∈ N such that [x̄, y] ∩ Snor (x̄, nl) , ∅, by Proposition 4.15, y vxnl is the nl-th vertex on the normal cube path from x̄ to x, and vnl is the nl-th vertex on the normal cube path from x̄ to y. Due to the fellow-traveller property, y Proposition 4.4, d(vxnl , vnl ) 6 1. By Proposition 4.14, we have y vnl ∈ Snor (x̄, nl) ∩ [x̄, y] ⊆ Snor (x̄, nl) ∩ [x̄, x] ⊆ [x̄, vxnl ]. A CHARACTERIZATION FOR ASYMPTOTIC DIMENSION GROWTH 21 Recall that H(z, w) denotes the set of all hyperplanes separating z from w. Obviously, H(x̄, x) = H(x̄, y) ∪ {h′ }, y y x which implies Hnl ⊆ Hnl ⊆ Hnl ∪ {h′ }, by Lemma 4.10 and Lemma 4.19. y x If h′ ∈ Hnl then Fxh′ ∩ [x̄, y] = ∅ by Proposition 4.18. On the other hand, ∀h ∈ Hnl by Lemma 4.25, yh is the unique point in Bnor (x̄, nl) such that h separates x̄ from yh , and for any hyperplane k ⋔ h, k does not separate y from x̄. This implies yh = xh y x since Hnl ⊆ Hnl , so we can do induction for the new “base” point yh = xh and y y y x vnl , vnl , since d(vxnl , vnl ) 6 1 and vnl ∈ [xh , vxnl ]. This implies y Cxh ,vxnl ∩ [xh , vnl ] = Cxh ,vy . nl Since Cxh ,vxnl ⊆ [xh , vxnl], we have Cxh ,vxnl ∩ [x̄, y] = Cxh ,vxnl ∩ [xh , vxnl ] ∩ [x̄, y] = Cxh ,vxnl ∩ [xh , µ(xh , vxnl, y)]. y y y Claim: µ(xh , vxnl , y) = vnl . Indeed, if vxnl = vnl , then it holds naturally; If vxnl , vnl , y y y then by Lemma 4.8, vxnl < [x̄, y]. Since d(vxnl , vnl ) = 1, so vxnl ∈ [vnl , y] or vnl ∈ [vxnl , y]. y y While the former cannot hold since [vnl , y] ⊆ [x̄, y], so vnl ∈ [vxnl , y], which implies y vnl ∈ [xh , y] ∩ [xh , vxnl ] ∩ [vxnl , y], y i.e. vnl = µ(xh , vxnl, y). By the claim, y Cxh ,vxnl ∩ [x̄, y] = Cxh ,vxnl ∩ [xh , vnl ] = Cxh ,vy . nl Now for the above n, we have [  [  Cxh ,vxnl ∩ [x̄, y] = Cnx̄,x ∩ [x̄, y] = Cxh ,vxnl ∩ [x̄, y] y x h∈Hnl [ = Cxh ,vy = y nl [ h∈Hnl Cyh ,vy = Cnx̄,y . nl y h∈Hnl h∈Hnl Since Cnx̄,x ⊆ [x̄, x] ∩ Snor (x̄, nl), we have Cx̄,x ∩ [x̄, y] = ⌊dnor[ (x̄,x)/l⌋ n=0 = [ Cnx̄,x ∩ [x̄, y] = [ Cnx̄,x ∩ [x̄, y] n:[x̄,x]∩Snor (x̄,nl),∅ Cnx̄,x ∩ [x̄, y] = n:[x̄,y]∩Snor (x̄,nl),∅ [ Cnx̄,y = Cx̄,y . n:[x̄,y]∩Snor (x̄,nl),∅ ∀z ∈ [x̄, y], one need to show that px̄,x (z) = px̄,y (z). Let z̃ be the nl-th vertex on the normal cube path from x̄ to z, where n = ⌊dnor (x̄, z)/l⌋. By the analysis above, we know y y y y x ⊆ Hnl ∪ {h′ }. d(vxnl , vnl ) 6 1, vnl ∈ [vxnl , y], xh = yh , Hnl ⊆ Hnl y x For h ∈ Hnl with z̃ ∈ [xh , vxnl ], then h ∈ Hnl , i.e. h , h′ since z̃ ∈ [x̄, y]. Now for such h, y y z̃ ∈ [x̄, y] ∩ [xh , vxnl ] = [xh , vnl ] = [yh , vnl ], 22 GOULNARA ARZHANTSEVA, GRAHAM A. NIBLO, NICK WRIGHT, AND JIAWEN ZHANG where the first equation comes from the claim above. Inductively, we know for such h, pxh ,vxnl (z̃) = p yh ,vy (z̃). nl Now by definition, [n o x pxh ,vxnl (z̃) : h ∈ Hnl and z̃ ∈ [xh , vxnl ] [n o y = pxh ,vxnl (z̃) : h ∈ Hnl and z̃ ∈ [xh , vxnl ] [n o y y = p yh ,vy (z̃) : h ∈ Hnl and z̃ ∈ [yh , vnl ] px̄,x (z) = nl = px̄,y (z). Second, for any z ∈ [x̄, x] and w ∈ px̄,x (z), assume that w ∈ pxh ,vxnl (z̃) for some x h ∈ Hnl and z̃ ∈ [xh , vxnl ] as in the definition. By induction, we know d(z̃, w) 6 since dim[xh , vxnl ] 6 η − 1. So (η−1)η l 2 (η − 1)η η(η + 1) l= l. 2 2 Third, for any z ∈ [x̄, x], consider B(z, Ml) ∩ Cx̄,x . Suppose  n ∈ N satisfying S x B(z, Ml) ∩ Cx̄,x ∩ Snor (x̄, nl) , ∅, so B(z, Ml) ∩ x [xh , v ] , ∅, which means h∈Hnl nl x x there exists some h ∈ Hnl such that B(z, Ml) ∩ [xh , vnl ] , ∅. For such n and h, let z′ = µ(z, xh , vxnl ) ∈ [xh , vxnl ]. Obviously, d(z, w) 6 d(z, z̃) + d(z̃, w) 6 ηl + B(z, Ml) ∩ [xh , vxnl] ⊆ B(z′ , Ml) ∩ [xh , vxnl ]. By induction, we have     ♯ B(z, Ml) ∩ Cxh ,vxnl 6 ♯ B(z′ , Ml) ∩ Cxh ,vxnl 6 (3M)η−1 (η − 1)!. Now for the above z, there exist at most 3M values of n such that B(z, Ml) ∩ [x̄, x] ∩ x Snor (x̄, nl) , ∅; and for such n, since ♯Hnl 6 η, there exist at most η hyperplanes h x such that B(z, Ml) ∩ [x̄, x] ∩ [xh , vnl ] , ∅. So we have X     ♯ B(z, Ml) ∩ Cx̄,x 6 ♯ B(z, Ml) ∩ Cnx̄,x n:B(z,Ml)∩[x̄,x]∩Snor (x̄,nl),∅ 6 X X   ♯ B(z, Ml) ∩ Cxh ,vxnl x n:as above h∈Hnl 6 3M · η · (3M)η−1 (η − 1)! = (3M)η η!. (η−1)η Now we take K = 2 , and N = (3M)η η! = (3K + 9η + 9)η η!, then the lemma holds for these constants.  6. Coarse median spaces In this section, we discuss the coarse median case, and prove Theorem 1.2. We fix a coarse median space X with geodesic metric ρ and coarse median µ with parameters K, H and finite rank η. The definitions and notations are the same as in Section 2.4. According to Remark 2.11, we also assume that the coarse median µ satisfies M1 and M2. We recall: A CHARACTERIZATION FOR ASYMPTOTIC DIMENSION GROWTH 23 Theorem 6.1 ([28]). Any geodesic uniformly locally finite coarse median space of finite rank and at most exponential growth has Property A. Our result, Theorem 1.2, says that any coarse median space as above has subexponential asymptotic dimension growth. Thus, combining with Ozawa’s result [22], our theorem yields a strengthening of Theorem 6.1. To prove Theorem 1.2, we use several notations and lemmas from [28]. We use the notation x ∼s y for ρ(x, y) 6 s. Given r > 0 and a, b ∈ X, the coarse interval [a, b]r is defined to be: [a, b]r = {z ∈ X : µ(a, b, z) ∼r z}. By a result of Bowditch [7], there exists a constant λ > 0 depending only on the parameter K, H, such that for all x, y, z ∈ X, µ(x, y, z) ∈ [x, y]λ . Also recall that the median axiom M3 holds in the coarse median case up to a constant γ > 0 depending only on the parameters K, H: for all x, y, z, u, v ∈ X, we have µ(µ(x, y, z), u, v) ∼γ µ(µ(x, u, v), µ(y, u, v), z). Actually we can take γ = 3K(3K + 2)H(5) + (3K + 2)H(0). Given r, t, κ > 0, denote L1 (r) = (K + 1)r + Kλ + γ + 2H(0), L2 (r, κ) = (K + 1)r + κ + H(0), and L3 (r, t) = 3η Kη rt + r. We need the following lemmas from [28]. Lemma 6.2 ([28]). Let X be a coarse median space, r > 0, and let a, b ∈ X, x ∈ [a, b]λ . Then [a, x]r ⊂ [a, b]L1 (r) . Lemma 6.3 ([28]). Let X be a geodesic coarse median space of rank at most η. For every κ > 0 and t > 0, there exists rt > 0, such that for all r > rt , a, b ∈ X, there exists h ∈ [a, b]L1 (r) , such that • ρ(a, h) 6 L3 (r, t), and • B(a, rt) ∩ [a, b]κ ⊂ [a, h]L2 (r,κ) . Lemma 6.4 ([28]). Let X be a coarse median space. Fix κ > 0. There exist constants α, β > 0 depending only on the parameters of the coarse median structure and κ, such that the following holds: let a, b, h, m ∈ X and r > 0 satisfy m ∈ [a, h]L2 (r,κ) , h ∈ [a, b]L1 (r) . Then p = µ(m, b, h) satisfies ρ(h, p) 6 αr + β. Proof of Theorem 1.2. The proof is based on the construction used in [28] to prove property A, and for the readers’ convenience, we give a sketch of their proof. In fact we will verify the stronger conditions on the S sets required to apply Theorem 3.1. Fix a base point x0 ∈ X, and let α, β be the constants from Lemma 6.4. First apply Lemma 6.3 for κ = λ and all t ∈ N to obtain a sequence rt ∈ N, such that the conclusion of the lemma holds. Furthermore, we can choose the rt tr −H(0) inductively to arrange the sequence N ∋ t 7→ lt = t 3K is increasing. 24 GOULNARA ARZHANTSEVA, GRAHAM A. NIBLO, NICK WRIGHT, AND JIAWEN ZHANG Now fix x ∈ X, t ∈ N, and k ∈ {1, 2, . . . , 3lt}. For any y ∈ B(x, k), Lemma 6.3 applied for a = y, b = x0 and r = rt , produces a point h y ∈ [y, x0 ]L1 (rt ) . We define S(x, k, lt ) = {h y ∈ X : y ∈ B(x, k)}. We need to verify these sets satisfy Condition 2 in the statement of Proposition 3.1, i.e. we need to show there exists a subexponential function f : R → R, satisfying: i) ∀t ∈ N, ∃St > 0, such that S(x, k, lt ) ⊆ B(x, St ) for all k = 1, . . . , 3lt; ii) ∀t ∈ N, ∀k, k′ with 1 6 k 6 k′ 6 3lt, ∀x ∈ X, we have S(x, k, lt ) ⊆ S(x, k′ , lt); iii) ∀x, y ∈ X with ρ(x, y) 6 lt , we have: • S(x, k − ρ(x, y), lt) ⊂ S(x, k, lt ) ∩ S(y, k, lt ), for k = ρ(x, y) + 1, . . . , 3lt; • S(x, k + ρ(x, y), lt) ⊃ S(x, k, lt ) ∩ S(y, k, lt ), for k = 1, . . . , 3lt − ρ(x, y); iv) ∀t ∈ N, ∀k = 1, 2, . . . , 3lt, ∀x ∈ X, we have ♯S(x, k, lt ) 6 f (lt ). By the construction, ii) and iii) hold naturally. For i), by Lemma 6.3, we know S(x, k, lt ) ⊆ B(x, lt + L3 (rt , t)). The only thing left is to find a subexponential function f such that condition iv) holds. The following argument follows totally from the proof in [28], and we omit some calculation. The readers can turn to their original paper for more details. Take y ∈ B(x, k), with the notation as above. Denote m y = µ(x, y, x0). Then by Lemma 6.3, one can deduce that m y ∈ [y, h y ]L2 (rt ,λ) . Now since h y ∈ [y, x0 ]L1 (rt ) , Lemma 6.4 implies the point p y = µ(m y , x0 , h y ) ∈ [m y , x0 ]λ satisfies ρ(h y , p y ) 6 αrt + β. As m y = µ(x, y, x0) ∈ [x, x0 ]λ , Lemma 6.2 now implies p y ∈ [x, x0]L1 (λ) . Consequently, we have ρ(x, p y ) 6 3lt + 3η Kη trt + rt + αrt + β, which depends linearly on lt . Now by Proposition 9.8 in [7], the number of possible points p y is bounded by P(lt ) for some polynomial P depending only on H, K, η and uniform local finiteness of X. Since X has at most exponential growth, it follows that ♯S(x, k, lt ) is at most P(lt )c′ crt for some constants c, c′ > 1. Take f (lt ) = P(lt )c′ crt and recall that in the limit rt /lt → 0. We extend f to a function on R+ by setting f (r) := f (lt ) for r ∈ (lt−1 , lt ]. This completes the proof.  References [1] J. Behrstock, M.F. Hagen, and A. Sisto. Asymptotic dimension and small-cancellation for hierarchically hyperbolic spaces and groups. arXiv:1512.06071, 2015. [2] J. Behrstock, M.F. Hagen, and A. Sisto. Hierarchically hyperbolic spaces ii: combination theorems and the distance formula. arXiv:1509.00632, 2015. [3] G. Bell and A. N. Dranishnikov. Asymptotic dimension in Bȩdlewo. Topology Proc, 38:209–236, 2011. [4] G. C. Bell. Growth of the asymptotic dimension function for groups. arXiv:math/0504577, 2005. [5] M. Bestvina, K. Bromberg, and K. Fujiwara. The asymptotic dimension of mapping class groups is finite. arXiv:1006.1939, 2010. [6] B. H. Bowditch. Coarse median spaces and groups. Pacific Journal of Mathematics, 261(1):53–93, 2013. [7] B. H. Bowditch. Embedding median algebras in products of trees. Geometriae Dedicata, 170(1):157–176, 2014. A CHARACTERIZATION FOR ASYMPTOTIC DIMENSION GROWTH 25 [8] M. R. Bridson and A. Häfliger. Metric spaces of non-positive curvature, volume 319 of Grundlehren der Mathematischen Wissenschaften [Fundamental Principles of Mathematical Sciences]. SpringerVerlag, Berlin, 1999. [9] N. P. Brown and N. Ozawa. C∗ -algebras and finite-dimensional approximations, volume 88 of Graduate Studies in Mathematics. American Mathematical Society, Providence, RI, 2008. [10] S. Campbell and G. A. Niblo. Hilbert space compression and exactness of discrete groups. Journal of functional analysis, 222(2):292–305, 2005. [11] I. Chatterji and G. A. Niblo. From wall spaces to CAT(0) cube complexes. International Journal of Algebra and Computation, 15(05n06):875–885, 2005. [12] V. Chepoi. Graphs of some CAT(0) complexes. Advances in Applied Mathematics, 24(2):125–179, 2000. [13] A. N. Dranishnikov. Groups with a polynomial dimension growth. Geometriae Dedicata, 119(1):1–15, 2006. [14] M. Gromov. Hyperbolic groups. In Essays in group theory, pages 75–263. Springer, 1987. [15] M. Gromov. Asymptotic invariants of infinite groups. Geometric group theory, Vol.2, volume 182 of London Math. Soc. Lecture Note Ser., pages 1–295, 1993. [16] J. R. Isbell. Median algebra. Transactions of the American Mathematical Society, 260(2):319–362, 1980. [17] V. A. Kaimanovich. Boundary amenability of hyperbolic spaces. In Discrete geometric analysis, volume 347 of Contemp. Math., pages 83–111. Amer. Math. Soc., Providence, RI, 2004. [18] G. A. Niblo and L. D. Reeves. The geometry of cube complexes and the complexity of their fundamental groups. Topology, 37(3):621–633, 1998. [19] B. Nica. Cubulating spaces with walls. Algebr. Geom. Topol, 4:297–309, 2004. [20] P. W. Nowak and G. Yu. Large scale geometry. 2012. [21] I. Oppenheim. An intermediate quasi-isometric invariant between subexponential asymptotic dimension growth and Yu’s property A. Internat. J. Algebra Comput., 24(6):909–922, 2014. [22] N. Ozawa. Metric spaces with subexponential asymptotic dimension growth. International Journal of Algebra and Computation, 22(02):1250011, 2012. [23] L. D. Reeves. Biautomatic structures and combinatorics for cube complexes. PhD thesis, University of Melbourne, 1995. [24] J. Roe. Hyperbolic groups have finite asymptotic dimension. Proceedings of the American Mathematical Society, 133(9):2489–2490, 2005. [25] M. Roller. Poc sets, median algebras and group actions. an extended study of Dunwoody’s construction and Sageev’s theorem. Southampton Preprint Archive, 1998. [26] M. Sageev. Ends of group pairs and non-positively curved cube complexes. Proceedings of the London Mathematical Society, 3(3):585–617, 1995. [27] J. Smith. The asymptotic dimension of the first Grigorchuk group is infinity. Revista Matemática Complutense, 20(1):119–121, 2007. [28] J. S̆pakula and N. J. Wright. Coarse medians and property A. arXiv:1602.06084, 2016. [29] N. J. Wright. Finite asymptotic dimension for CAT(0) cube complexes. Geometry & Topology, 16(1):527–554, 2012. [30] G. Yu. The Novikov conjecture for groups with finite asymptotic dimension. The Annals of Mathematics, 147(2):325–355, 1998. [31] G. Yu. The coarse Baum-Connes conjecture for spaces which admit a uniform embedding into Hilbert space. Inventiones Mathematicae, 139(1):201–240, 2000. [32] R. Zeidler. Coarse median structures on groups. Master’s thesis, University of Vienna, Vienna, Austria, 2013. Universität Wien, Fakultät für Mathematik, Oskar-Morgenstern-Platz 1, 1090 Wien, Austria. E-mail address: goulnara.arzhantseva@univie.ac.at School of Mathematics, University of Southampton, Highfield, SO17 1BJ, United Kingdom. E-mail address: g.a.niblo@soton.ac.uk,wright@soton.ac.uk,jiawen.zhang@soton.ac.uk
4math.GR
Normalizing Flows on Riemannian Manifolds arXiv:1611.02304v2 [stat.ML] 9 Nov 2016 Mevlana C. Gemici Google DeepMind mevlana@google.com Danilo J. Rezende Google DeepMind danilor@google.com Shakir Mohamed Google DeepMind shakir@google.com Abstract We consider the problem of density estimation on Riemannian manifolds. Density estimation on manifolds has many applications in fluid-mechanics, optics and plasma physics and it appears often when dealing with angular variables (such as used in protein folding, robot limbs, gene-expression) and in general directional statistics. In spite of the multitude of algorithms available for density estimation in the Euclidean spaces Rn that scale to large n (e.g. normalizing flows, kernel methods and variational approximations), most of these methods are not immediately suitable for density estimation in more general Riemannian manifolds. We revisit techniques related to homeomorphisms from differential geometry for projecting densities to sub-manifolds and use it to generalize the idea of normalizing flows to more general Riemannian manifolds. The resulting algorithm is scalable, simple to implement and suitable for use with automatic differentiation. We demonstrate concrete examples of this method on the n-sphere Sn . In recent years, there has been much interest in applying variational inference techniques to learning large scale probabilistic models in various domains, such as images and text [1, 2, 3, 4, 5, 6]. One of the main issues in variational inference is finding the best approximation to an intractable posterior distribution of interest by searching through a class of known probability distributions. The class of approximations used is often limited, e.g., mean-field approximations, implying that no solution is ever able to resemble the true posterior distribution. This is a widely raised objection to variational methods, in that unlike MCMC, the true posterior distribution may not be recovered even in the asymptotic regime. To address this problem, recent work on Normalizing Flows [7], Inverse Autoregressive Flows [8], and others [9, 10] (referred collectively as normalizing flows), focused on developing scalable methods of constructing arbitrarily complex and flexible approximate posteriors from simple distributions using transformations parameterized by neural networks, which gives these models universal approximation capability in the asymptotic regime. In all of these works, the distributions of interest are restricted to be defined over high dimensional Euclidean spaces. There are many other distributions defined over special homeomorphisms of Euclidean spaces that are of interest in statistics, such as Beta and Dirichlet (n-Simplex); Norm-Truncated Gaussian (n-Ball); Wrapped Cauchy and Von-Misses Fisher (n-Sphere), which find little applicability in variational inference with large scale probabilistic models due to the limitations related to density complexity and gradient computation [11, 12, 13, 14]. Many such distributions are unimodal and generating complicated distributions from them would require creating mixture densities or using auxiliary random variables. Mixture methods require further knowledge or tuning, e.g. number of mixture components necessary, and a heavy computational burden on the gradient computation in general, e.g. with quantile functions [15]. Further, mode complexity increases only linearly with mixtures as opposed to exponential increase with normalizing flows. Conditioning on auxiliary variables [16] on the other hand constrains the use of the created distribution, due to the need for integrating out the auxiliary factors in certain scenarios. In all of these methods, computation of low-variance gradients is difficult due to the fact that simulation of random variables cannot be in general reparameterized (e.g. rejection sampling [17]). In this work, we present methods that generalizes previous work on improving variational inference in Rn using normalizing flows to Riemannian manifolds of interest such as spheres Sn , tori Tn and their product topologies with Rn , like infinite cylinders. Figure 1: Left: Construction of a complex density on Sn by first projecting the manifold to Rn , transforming the density and projecting it back to Sn . Right: Illustration of transformed (S2 → R2 ) densities corresponding to an uniform density on the sphere. Blue: empirical density (obtained by Monte Carlo); Red: Analytical density from equation (4); Green: Density computed ignoring the intrinsic dimensionality of Sn . These special manifolds M ⊂ Rm are homeomorphic to the Euclidean space Rn where n corresponds to the dimensionality of the tangent space of M at each point. A homeomorphism is a continuous function between topological spaces with a continuous inverse (bijective and bicontinuous). It maps point in one space to the other in a unique and continuous manner. An example manifold is the unit 2-sphere, the surface of a unit ball, which is embedded in R3 and homeomorphic to R2 (see Figure 1). In normalizing flows, the main result of differential geometry that is used for computing the density updates is given by, d~x = |det Jφ | d~u and represents the relationship between differentials (infinitesimal volumes) between two equidimensional Euclidean spaces using the Jacobian of the function φ : Rn → Rn that transforms one space to the other. This result only applies to transforms that preserve the dimensionality. However, transforms that map an embedded manifold to its intrinsic Euclidean space, do not preserve the dimensionality of the points and the result above become obsolete. Jacobian of such transforms φ : Rn → Rm with m > n are rectangular and an infinitesimal cube on Rn maps to an infinitesimal parallelepiped on the manifold. The relation between these √ volumes is given by d~x = det G d~u, where G = JφT Jφ is the metric induced by the embedding φ on the tangent space Tx M, [18, 19, 20]. The correct formula for computing the density over M now becomes : Z Z (f ◦ φ)(~u) f (~x)d~x = M⊂Rm √ Z (f ◦ φ)(~u) det G d~u = Rn Rn q det JφT Jφ  d~u (1) The density update going from the manifold to the Euclidian space, ~x ∈ Sn → ~u ∈ Rn , is then given by: q q p(~u) = (f ◦ φ)(~u) det JφT Jφ (~u) = f (~x) det JφT Jφ (φ−1 (~x)) (2) As an application of this method on the n-sphere Sn , we introduce Inverse Stereographic Transform and define it as: φ(u) : Rn → Sn ⊂ Rn+1 ,   2u/(uT u + 1) ~x = φ(~u) = (3) 1 − 2/(uT u + 1) which maps Rn to Sn in a bijective and bicontinuous manner. The determinant of the metric G(x) associated with this transformation is given by:  2n 2 T (4) det G = det Jφ (x) Jφ (x) = xT x + 1 Using these formulae, on the left side of Figure 1, we map a uniform density on S2 to R2 , enrich this density, using e.g. normalizing flows, and then map it back onto S2 to obtain a multi-modal (or arbitrarily complex) density on the original sphere. On qthe right side of Figure 1, we show that the density update based on the Riemannian metric, i.e. det JφT Jφ (red), is correct and closely follows the kernel density estimate based on 500k samples (blue). We also show that using the generic volume transformation formulation for dimensionality preserving transforms, i.e. |det Jφ | (green), leads to an erroneous density and do not resemble the empirical distributions of samples after the transformation. 2 References [1] D. J. Rezende, S. Mohamed, and D. Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In ICML, 2014. [2] D. P. Kingma and M. Welling. Auto-encoding variational Bayes. In ICLR, 2014. [3] Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Jimenez Rezende, and Daan Wierstra. Draw: A recurrent neural network for image generation. In ICML, 2015. [4] SM Eslami, Nicolas Heess, Theophane Weber, Yuval Tassa, Koray Kavukcuoglu, and Geoffrey E Hinton. Attend, infer, repeat: Fast scene understanding with generative models. arXiv preprint arXiv:1603.08575, 2016. [5] Danilo Jimenez Rezende, Shakir Mohamed, Ivo Danihelka, Karol Gregor, and Daan Wierstra. One-shot generalization in deep generative models. In ICML, 2016. [6] Matthew D. Hoffman, David M. Blei, Chong Wang, and John Paisley. Stochastic variational inference. Journal of Machine Learning Research, 14:1303–1347, 2013. [7] Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. arXiv preprint arXiv:1505.05770, 2015. [8] Diederik P. Kingma, Tim Salimans, and Max Welling. Improving variational inference with inverse autoregressive flow. CoRR, abs/1606.04934, 2016. [9] Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. 2016. [10] Tim Salimans, Diederik P. Kingma, and Max Welling. Markov chain monte carlo and variational inference: Bridging the gap. In Francis R. Bach and David M. Blei, editors, ICML, volume 37 of JMLR Workshop and Conference Proceedings, pages 1218–1226. JMLR.org, 2015. [11] Arindam Banerjee, Inderjit S. Dhillon, Joydeep Ghosh, and Suvrit Sra. Clustering on the unit hypersphere using von mises-fisher distributions. J. Mach. Learn. Res., 6:1345–1382, December 2005. [12] Siddharth Gopal and Yiming Yang. Von mises-fisher clustering models. In Tony Jebara and Eric P. Xing, editors, Proceedings of the 31st International Conference on Machine Learning (ICML-14), pages 154–162. JMLR Workshop and Conference Proceedings, 2014. [13] Marco Fraccaro, Ulrich Paquet, and Ole Winther. Indexable probabilistic matrix factorization for maximum inner product search. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, February 12-17, 2016, Phoenix, Arizona, USA., pages 1554–1560, 2016. [14] Arindam Banerjee, Inderjit Dhillon, Joydeep Ghosh, and Suvrit Sra. Generative model-based clustering of directional data. In Proceedings of the Ninth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’03, pages 19–28, New York, NY, USA, 2003. ACM. [15] Alex Graves. Stochastic backpropagation through mixture density distributions. CoRR, abs/1607.05690, 2016. [16] Lars Maaloe, Casper Kaae Sonderby, Soren Kaae Sonderby, and Ole Winther. Auxiliary deep generative models. CoRR, abs/1602.05473, 2016. [17] Scott W. Linderman David M. Blei Christian A. Naesseth, Francisco J. R. Ruiz. Rejection sampling variational inference. 2016. [18] Adi Ben-Israel. The change-of-variables formula using matrix volume. SIAM Journal on Matrix Analysis and Applications, 21(1):300–312, 1999. [19] Adi Ben-Israel. An application of the matrix volume in probability. Linear Algebra and its Applications, 321(1):9–25, 2000. [20] Marcel Berger and Bernard Gostiaux. Differential Geometry: Manifolds, Curves, and Surfaces: Manifolds, Curves, and Surfaces, volume 115. Springer Science & Business Media, 2012. 3
10math.ST
arXiv:1609.04237v1 [math.ST] 14 Sep 2016 The Annals of Statistics 2016, Vol. 44, No. 5, 1957–1987 DOI: 10.1214/15-AOS1379 c Institute of Mathematical Statistics, 2016 ESTIMATION IN NONLINEAR REGRESSION WITH HARRIS RECURRENT MARKOV CHAINS1 By Degui Li2 , Dag Tjøstheim and Jiti Gao3 University of York, University of Bergen and Monash University In this paper, we study parametric nonlinear regression under the Harris recurrent Markov chain framework. We first consider the nonlinear least squares estimators of the parameters in the homoskedastic case, and establish asymptotic theory for the proposed estimators. Our results show that the convergence rates for the estimators rely not only on the properties of the nonlinear regression function, but also on the number of regenerations for the Harris recurrent Markov chain. Furthermore, we discuss the estimation of the parameter vector in a conditional volatility function, and apply our results to the nonlinear regression with I(1) processes and derive an asymptotic distribution theory which is comparable to that obtained by Park and Tribute: While this paper was in the process of being published, we heard that Professor Peter Hall, one of the most significant contributors to the areas of nonlinear regression and time series analysis, sadly passed away. The fundamental work done by Professor Peter Hall in the area of martingale theory, represented by the book (with Christopher C. Heyde): Hall, P. and Heyde, C. [Martingale Limit Theory and Its Applications (1980) Academic Press], enables the authors of this paper in using martingale theory as an important tool in dealing with all different types of estimation and testing issues in econometrics and statistics. In a related Annals paper by Gao, King, Lu and Tjøstheim [Ann. Statist. 37 (2009) 3893–3928], Theorem 3.4 of Hall and Heyde (1980) plays an essential role in the establishment of an important theorem. In short, we would like to thank the Co-Editors for including our paper in this dedicated issue in honour of Professor Peter Hall’s fundamental contributions to statistics and theoretical econometrics. Received January 2014; revised August 2015. 1 Supported by the Norwegian Research Council. 2 Supported in part by an Australian Research Council Discovery Early Career Researcher Award (DE120101130). 3 Supported by two Australian Research Council Discovery Grants under Grant Numbers: DP130104229 and DP150101012. AMS 2000 subject classifications. Primary 62F12; secondary 62M05. Key words and phrases. Asymptotic distribution, asymptotically homogeneous function, β-null recurrent Markov chain, Harris recurrence, integrable function, least squares estimation, nonlinear regression. This is an electronic reprint of the original article published by the Institute of Mathematical Statistics in The Annals of Statistics, 2016, Vol. 44, No. 5, 1957–1987. This reprint differs from the original in pagination and typographic detail. 1 2 D. LI, D. TJØSTHEIM AND J. GAO Phillips [Econometrica 69 (2001) 117–161]. Some numerical studies including simulation and empirical application are provided to examine the finite sample performance of the proposed approaches and results. 1. Introduction. In this paper, we consider a parametric nonlinear regression model defined by (1.1) Yt = g(Xt , θ01 , θ02 , . . . , θ0d ) + et =: g(Xt , θ 0 ) + et , t = 1, 2, . . . , n, where θ 0 is the true value of the d-dimensional parameter vector such that θ 0 = (θ01 , θ02 , . . . , θ0d )τ ∈ Θ ⊂ Rd and g(·, ·) : Rd+1 → R is assumed to be known. Throughout this paper, we assume that Θ is a compact set and θ 0 lies in the interior of Θ, which is a standard assumption in the literature. How to construct a consistent estimator for the parameter vector θ 0 and derive an asymptotic theory are important issues in modern statistics and econometrics. When the observations (Yt , Xt ) satisfy stationarity and weak dependence conditions, there is an extensive literature on the theoretical analysis and empirical application of the above parametric nonlinear model and its extension; see, for example, Jennrich (1969), Malinvaud (1970) and Wu (1981) for some early references, and Severini and Wong (1992), Lai (1994), Skouras (2000) and Li and Nie (2008) for recent relevant works. As pointed out in the literature, assuming stationarity is too restrictive and unrealistic in many practical applications. When tackling economic and financial issues from a time perspective, we often deal with nonstationary components. For instance, neither the consumer price index nor the share price index, nor the exchange rates constitute a stationary process. A traditional method to handle such data is to take the first-order difference to eliminate possible stochastic or deterministic trends involved in the data, and then do the estimation for a stationary model. However, such differencing may lead to loss of useful information. Thus, the development of a modeling technique that takes both nonstationary and nonlinear phenomena into account in time series analysis is crucial. Without taking differences, Park and Phillips (2001) (hereafter PP) study the nonlinear regression (1.1) with the regressor {Xt } satisfying a unit root [or I(1)] structure, and prove that the rates of convergence of the nonlinear least squares (NLS) estimator of θ 0 depend on the properties of g(·, ·). For an integrable g(·, ·), the rate of convergence is as slow as n1/4 , and for an asymptotically homogeneous √ g(·, ·), the rate of convergence can achieve the n-rate and even n-rate of convergence. More recently, Chan and Wang (2012) consider the same model NONLINEAR AND NONSTATIONARY REGRESSION 3 structure as proposed in the PP paper and then establish some corresponding results under certain technical conditions which are weaker than those used in the PP paper. As also pointed out in a recent paper by Myklebust, Karlsen and Tjøstheim (2012), the null recurrent Markov process is a nonlinear generalization of the linear unit root process, and thus provides a more flexible framework in data analysis. For example, Gao, Tjøstheim and Yin (2013) show that the exchange rates between British pound and US dollar over the time period between January 1988 and February 2011 are nonstationary but do not necessarily follow a linear unit root process [see also Bec, Rahbek and Shephard (2008) for a similar discussion of the exchange rates between French franc and German mark over the time period between December 1972 and April 1988]. Hence, Gao, Tjøstheim and Yin (2013) suggest using the nonlinear threshold autoregressive (TAR) with stationary and unit root regimes, which can be proved as a 1/2-null recurrent Markov process; see, for example, Example 2.1 in Section 2.2 and Example 6.1 in the empirical application (Section 6). Under the framework of null recurrent Markov chains, there has been an extensive literature on nonparametric and semiparametric estimation [Karlsen and Tjøstheim (2001), Karlsen, Myklebust and Tjøstheim (2007, 2010), Lin, Li and Chen (2009), Schienle (2011), Chen, Gao and Li (2012), Gao et al. (2015)], by using the technique of the split chain [Nummelin (1984), Meyn and Tweedie (2009)], and the generalized ergodic theorem and functional limit theorem developed in Karlsen and Tjøstheim (2001). As far as we know, however, there is virtually no work on the parametric estimation of the nonlinear regression model (1.1) when the regressor {Xt } is generated by a class of Harris recurrent Markov processes that includes both stationary and nonstationary cases. This paper aims to fill this gap. If the function g(·, ·) is integrable, we can directly use some existing results for functions of Harris recurrent Markov processes to develop an asymptotic theory for the estimator of θ 0 . The case that g(·, ·) belongs to a class of asymptotically homogeneous functions is much more challenging, as in this case the function g(·, ·) is no longer bounded. In nonparametric or semiparametric estimation theory, we do not have such problems because the kernel function is usually assumed to be bounded and has a compact support. Unfortunately, most of the existing results for the asymptotic theory of the null recurrent Markov process focus on the case where g(·, ·) is bounded and integrable [c.f., Chen (1999, 2000)]. Hence, in this paper, we first modify the conventional NLS estimator for the asymptotically homogeneous g(·, ·), and then use a novel method to establish asymptotic distribution as well as rates of convergence for the modified parametric estimator. Our results show that the rates of convergence for the parameter vector in nonlinear cointegrating 4 D. LI, D. TJØSTHEIM AND J. GAO models rely not only on the properties of the function g(·, ·), but also on the magnitude of the regeneration number for the null recurrent Markov chain. In addition, we also study two important issues, which are closely related to nonlinear mean regression with Harris recurrent Markov chains. The first one is to study the estimation of the parameter vector in a conditional volatility function and its asymptotic theory. As the estimation method is based on the log-transformation, the rates of convergence for the proposed estimator would depend on the property of the log-transformed volatility function and its derivatives. Meanwhile, we also discuss the nonlinear regression with I(1) processes when g(·, ·) is asymptotically homogeneous. By using Theorem 3.2 in Section 3, we obtain asymptotic normality for the parametric estimator with a stochastic normalized rate, which is comparable to Theorem 5.2 in PP. However, our derivation is done under Markov perspective, which carries with it the potential of extending the theory to nonlinear and nonstationary autoregressive processes, which seems to be hard to do with the approach of PP. The rest of this paper is organized as follows. Some preliminary results about Markov theory (especially Harris recurrent Markov chain) and function classes are introduced in Section 2. The main results of this paper and their extensions are given in Sections 3 and 4, respectively. Some simulation studies are carried out in Section 5 and the empirical application is given in Section 6. Section 7 concludes the paper. The outline of the proofs of the main results is given in an Appendix. The supplemental document [Li, Tjøstheim and Gao (2015)] includes some additional simulated examples, the detailed proofs of the main results and the proofs of some auxiliary results. 2. Preliminary results. To make the paper self-contained, in this section, we first provide some basic definitions and preliminary results for a Harris recurrent Markov process {Xt }, and then define function classes in a way similar to those introduced in PP. 2.1. Markov theory. Let {Xt , t ≥ 0} be a φ-irreducible Markov chain on the state space (E, E) with transition P. This means that for any Pprobability t (x, A) > 0 for x ∈ E. We further set A ∈ E with φ(A) > 0, we have ∞ P t=1 assume that the φ-irreducible Markov chain {Xt } is Harris recurrent. Definition 2.1. A Markov chain {Xt } is Harris recurrent if, for any set B ∈ ε+ and given X0 = x for all x ∈ E, {Xt } returns to B infinitely often with probability one, where ε+ is defined as in Karlsen and Tjøstheim (2001). NONLINEAR AND NONSTATIONARY REGRESSION 5 The Harris recurrence allows one to construct a split chain, which decomposes the partial sum of functions of {Xt } into blocks of independent and identically distributed (i.i.d.) parts and two asymptotically negligible remaining parts. Let τk be the regeneration times, n the number of observations and N (n) the number of regenerations as in Karlsen and Tjøstheim (2001), where they use the notation T (n) instead of N (n). For the process {G(Xt ) : t ≥ 0}, defining  τ 0 X    G(Xt ), k = 0,     t=0    τk   X G(Xt ), 1 ≤ k ≤ N (n), Zk =  t=τ +1  k−1    n  X    G(Xt ), k = N (n) + 1,    t=τN(n) +1 where G(·) is a real function defined on R, then we have (2.1) Sn (G) = n X t=0 N (n) G(Xt ) = Z0 + X Zk + ZN (n)+1 . k=1 From Nummelin (1984), we know that {Zk , k ≥ 1} is a sequence of i.i.d. random variables, and Z0 and ZN (n)+1 converge to zero almost surely (a.s.) when they are divided by the number of regenerations N (n) [using Lemma 3.2 in Karlsen and Tjøstheim (2001)]. The general Harris recurrence only yields stochastic rates of convergence in asymptotic theory of the parametric and nonparametric estimators (see, e.g., Theorems 3.1 and 3.2 below), where distribution and size of the number of regenerations N (n) have no a priori known structure but fully depend on the underlying process {Xt }. To obtain a specific rate of N (n) in our asymptotic theory for the null recurrent process, we next impose some restrictions on the tail behavior of the distribution of the recurrence times of the Markov chain. Definition 2.2. A Markov chain {Xt } is β-null recurrent if there exist a small nonnegative function f , an initial measure λ, a constant β ∈ (0, 1), and a slowly varying function Lf (·) such that ! n X 1 f (Xt ) ∼ Eλ (2.2) nβ Lf (n), Γ(1 + β) t=1 where Eλ stands for the expectation with initial distribution λ and Γ(1 + β) is the Gamma function with parameter 1 + β. 6 D. LI, D. TJØSTHEIM AND J. GAO The definition of a small function f in the above definition can be found in some existing literature [c.f., page 15 in Nummelin (1984)]. Assuming β-null recurrence restricts the tail behavior of the recurrence time of the process to be a regularly varying function. In fact, for all small functions f , by Lemma 3.1 in Karlsen and Tjøstheim (2001), we can find an Ls (·) such that (2.2) holds for the β-null recurrent Markov chain with Lf (·) = πs (f )Ls (·), R where πs (·) is an invariant measure of the Markov chain {Xt }, πs (f ) = f (x)πs (dx) and s is the small function in the minorization inequality (3.4) of Karlsen and Tjøstheim (2001). Letting Ls (n) = Lf (n)/(πs (f )) and following the argument in Karlsen and Tjøstheim (2001), we may show that the regeneration number N (n) of the β-null recurrent Markov chain {Xt } has the following asymptotic distribution: (2.3) N (n) d −→ Mβ (1), nβ Ls (n) where Mβ (t), t ≥ 0 is the Mittag–Leffler process with parameter β [c.f., Kasahara (1984)]. Since N (n) < n a.s. for the null recurrent case by (2.3), the rates of convergence for the nonparametric kernel estimators are slower than those for the stationary time series case [c.f., Karlsen, Myklebust and Tjøstheim (2007), Gao et al. (2015)]. However, this is not necessarily the case for the parametric estimator in our model (1.1). In Section 3 below, we will show that our rate of convergence in the null recurrent case is slower than that for the stationary time series for integrable g(·, ·) and may be faster than that for the stationary time series case for asymptotically homogeneous g(·, ·). In addition, our rates of convergence also depend on the magnitude of β, which measures the recurrence times of the Markov chain {Xt }. 2.2. Examples of β-null recurrent Markov chains. For a stationary or positive recurrent process, β = 1. We next give several examples of β-null recurrent Markov chains with 0 < β < 1. Example 2.1 (1/2-null recurrent Markov chain). process be defined as (2.4) Xt = Xt−1 + xt , (i) Let a random walk t = 1, 2, . . . , X0 = 0, where {xt } is a sequence of i.i.d. random variables with E[x1 ] = 0, 0 < E[x21 ] < ∞ and E[|x1 |4 ] < ∞, and the distribution of xt is absolutely continuous (with respect to the Lebesgue measure) with the density function f0 (·) satisfying inf x∈C0 f0 (x) > 0 for all compact sets C0 . Some existing papers including Kallianpur and Robbins (1954) have shown that {Xt } defined by (2.4) is a 1/2-null recurrent Markov chain. (ii) Consider a parametric TAR model of the form: (2.5) Xt = α1 Xt−1 I(Xt−1 ∈ S) + α2 Xt−1 I(Xt−1 ∈ Sc ) + xt , X0 = 0, NONLINEAR AND NONSTATIONARY REGRESSION 7 where S is a compact subset of R, Sc is the complement of S, α2 = 1, −∞ < α1 < ∞, {xt } satisfies the corresponding conditions in Example 2.1(i) above. Recently, Gao, Tjøstheim and Yin (2013) have shown that such a TAR process {Xt } is a 1/2-null recurrent Markov chain. Furthermore, we may generalize the TAR model (2.5) to Xt = H(Xt−1 , ζ)I(Xt−1 ∈ S) + Xt−1 I(Xt−1 ∈ Sc ) + xt , where X0 = 0, supx∈S |H(x, ζ)| < ∞ and ζ is a parameter vector. According to Teräsvirta, Tjøstheim and Granger (2010), the above autoregressive process is also a 1/2-null recurrent Markov chain. Example 2.2 (β-null recurrent Markov chain with β 6= 1/2). Let {xt } be a sequence of i.i.d. random variables taking positive values, and {Xt } be defined as  Xt−1 − 1, Xt−1 > 1, Xt = xt , Xt−1 ∈ [0, 1], for t ≥ 1, and X0 = C0 for some positive constant C0 . Myklebust, Karlsen and Tjøstheim (2012) prove that {Xt } is β-null recurrent if and only if P([x1 ] > n) ∼ n−β l−1 (n), 0 < β < 1, where [·] is the integer function and l(·) is a slowly varying positive function. From the above examples, the β-null recurrent Markov chain framework is not restricted to linear processes [see Example 2.1(ii)]. Furthermore, such a null recurrent class has the invariance property that if {Xt } is β-null recurrent, then for a one-to-one transformation T (·), {T (Xt )} is also β-null recurrent [c.f., Teräsvirta, Tjøstheim and Granger (2010)]. Such invariance property does not hold for the I(1) processes. For other examples of the β-null recurrent Markov chain, we refer to Example 1 in Schienle (2011). For some general conditions on diffusion processes to ensure the Harris recurrence is satisfied, we refer to Höpfner and Löcherbach (2003) and Bandi and Phillips (2009). 2.3. Function classes. Similar to Park and Phillips (1999, 2001), we consider two classes of parametric nonlinear functions: integrable functions and asymptotically homogeneous functions, which q include many commonlyPq Pq 2 used functions in nonlinear regression. Let kAk = i=1 j=1 aij for A = (aij )q×q , and kak be the Euclidean norm of vector a. A function h(x) : R → Rd is πs -integrable if Z kh(x)kπs (dx) < ∞, R 8 D. LI, D. TJØSTHEIM AND J. GAO where πs (·) is the invariant measure of the Harris recurrent Markov chain {Xt }. When πs (·) is differentiable such that πs (dx) = ps (x) dx, h(x) is πs integrable if and only if h(x)ps (x) is integrable, where ps (·) is the invariant density function for {Xt }. For the random walk case as in Example 2.1(i), the πs -integrability reduces to the conventional integrability as πs (dx) = dx. Definition 2.3. A d-dimensional vector function h(x, θ) is said to be integrable on Θ if for each θ ∈ Θ, h(x, θ) is πs -integrable and there exist a neighborhood Bθ of θ and M : R → R bounded and πs -integrable such that kh(x, θ ′ ) − h(x, θ)k ≤ kθ ′ − θkM (x) for any θ ′ ∈ Bθ . The above definition is comparable to Definition 3.3 in PP. However, in our definition, we do not need condition (b) in Definition 3.3 of their paper, which makes the integrable function family in this paper slightly more general. We next introduce a class of asymptotically homogeneous functions. Definition 2.4. For a d-dimensional vector function h(x, θ), let h(λx, θ) = κ(λ, θ)H(x, θ) + R(x, λ, θ), where κ(·, ·) is nonzero. h(λx, θ) is said to be asymptotically homogeneous on Θ if the following two conditions are satisfied: (i) H(·, θ) is locally bounded uniformly for any θ ∈ Θ and continuous with respect to θ; (ii) the remainder term R(x, λ, θ) is of order smaller than κ(λ, θ) as λ → ∞ for any θ ∈ Θ. As in PP, κ(·, ·) is the asymptotic order of h(·, ·) and H(·, ·) is the limit homogeneous function. The above definition is quite similar to that of an H-regular function in PP except that the regularity condition (a) in Definition 3.5 of PP is replaced by the local boundness condition (i) in Definition 2.4. Following Definition 3.4 in PP, as R(x, λ, θ) is of order smaller than κ(·, ·), we have either (2.6) R(x, λ, θ) = a(λ, θ)AR (x, θ) or (2.7) R(x, λ, θ) = b(λ, θ)AR (x, θ)BR (λx, θ), where a(λ, θ) = o(κ(λ, θ)), b(λ, θ) = O(κ(λ, θ)) as λ → ∞, supθ∈Θ AR (·, θ) is locally bounded, and supθ∈Θ BR (·, θ) is bounded and vanishes at infinity. Note that the above two definitions can be similarly generalized to the case that h(·, ·) is a d × d matrix of functions. Details are omitted here to save space. Furthermore, when the process {Xt } is positive recurrent, an asymptotically homogeneous function h(x, θ) might be also integrable on Θ as long as the density function of the process ps (x) is integrable and decreases to zero sufficiently fast when x diverges to infinity. 9 NONLINEAR AND NONSTATIONARY REGRESSION 3. Main results. In this section, we establish some asymptotic results for the parametric estimators of θ 0 when g(·, ·) and its derivatives belong to the two classes of functions introduced in Section 2.3. 3.1. Integrable function on Θ. We first consider estimating model (1.1) by the NLS approach, which is also used by PP in the unit root framework. Define the loss function by (3.1) n X (Yt − g(Xt , θ))2 . Ln,g (θ) = t=1 bn by minimizing Ln,g (θ) over θ ∈ Θ, We can obtain the resulting estimator θ that is, (3.2) bn = arg min Ln,g (θ). θ θ∈Θ For θ = (θ1 , . . . , θd )τ , let   ∂g(x, θ) ġ(x, θ) = , ∂θj d×1 g̈(x, θ) =  ∂ 2 g(x, θ) ∂θi ∂θj  . d×d bn when g(·, ·) and its derivaBefore deriving the asymptotic properties of θ tives are integrable on Θ, we give some regularity conditions. Assumption 3.1. (i) {Xt } is a Harris recurrent Markov chain with invariant measure πs (·). (ii) {et } is a sequence of i.i.d. random variables with mean zero and finite variance σ 2 , and is independent of {Xt }. (i) g(x, θ) is integrable on Θ, and for all θ 6= θ 0 , R Assumption 3.2. [g(x, θ) − g(x, θ 0 )]2 πs (dx) > 0. (ii) Both ġ(x, θ) and g̈(x, θ) are integrable on Θ, and the matrix Z L̈(θ) := ġ(x, θ)ġ τ (x, θ)πs (dx) is positive definite when θ is in a neighborhood of θ 0 . Remark 3.1. In Assumption 3.1(i), {Xt } is assumed to be Harris recurrent, which includes both the positive and null recurrent Markov chains. The i.i.d. restriction on {et } in Assumption 3.1(ii) may be replaced by the condition that {et } is an irreducible, ergodic and strongly mixing process with mean zero and certain restriction on the mixing coefficient and moment conditions [c.f., Theorem 3.4 in Karlsen, Myklebust and Tjøstheim (2007)]. Hence, under some mild conditions, {et } can include the well-known AR and 10 D. LI, D. TJØSTHEIM AND J. GAO ARCH processes as special examples. However, for this case, the techniques used in the proofs of Theorems 3.1 and 3.2 below need to be modified by noting that the compound process {Xt , et } is Harris recurrent. Furthermore, the homoskedasticity on the error term can also be relaxed, and we may allow the existence of certain heteroskedasticity structure, that is, et = σ(Xt )ηt , where σ 2 (·) is the conditional variance function and {ηt } satisfies Assumption 3.1(ii) with a unit variance. However, the property of the function σ 2 (·) would affect the convergence rates given in the following asymptotic results. For example, to ensure the validity of Theorem 3.1, we need to further assume that σ 2 (·) is πs -integrable, which indicates that kġ(x, θ)k2 σ 2 (x) is integrable on Θ. As in the literature [c.f., Karlsen, Myklebust and Tjøstheim (2007)], we need to assume the independence between {Xt } and {ηt }. Assumption 3.2 is quite standard and similar to the corresponding conditions in PP. In particular, Assumption 3.2(i) is a key condition to derive bn . the global consistency of the NLS estimator θ bn . The following theorem is We next give the asymptotic properties of θ applicable for both stationary (positive recurrent) and nonstationary (null recurrent) time series. Theorem 3.1. Let Assumptions 3.1 and 3.2 hold. bn which minimizes the loss function Ln,g (θ) over Θ is (a) The solution θ consistent, that is, (3.3) bn − θ 0 = oP (1). θ bn has an asymptotically normal distribution of the (b) The estimator θ form: p d bn − θ 0 ) −→ (3.4) N(0d , σ 2 L̈−1 (θ 0 )), N (n)(θ where 0d is a d-dimensional null vector. bn is asymptotically normal with Remark 3.2. Theorem 3.1p shows that θ a stochastic convergence rate N (n) for both the stationary and nonstationary cases. However, N (n) is usually unobservable and its specific rate depends on β and Ls (·) if {Xt } is β-null recurrent (see Corollary 3.2 below). We next discuss how to link N (n) with a directly observable hitting time. Indeed, if C ∈ E and IC has a φ-positive support, the number P of times that the process visits C up to the time n is defined by NC (n) = nt=1 IC (Xt ). By Lemma 3.2 in Karlsen and Tjøstheim (2001), we have (3.5) NC (n) −→ πs (C) N (n) a.s., NONLINEAR AND NONSTATIONARY REGRESSION if πs (C) = πs IC = R C πs (dx) < ∞. 11 A possible estimator of β is ln NC (n) , βb = ln n which is strongly consistent as shown by Karlsen and Tjøstheim (2001). However, it is usually of somewhat limited practical use due to the slow convergence rate [c.f., Remark 3.7 of Karlsen and Tjøstheim (2001)]. A simulated example is given in Appendix B of the supplemental document to discuss the finite sample performance of the estimation method in (3.6). (3.6) By (3.5) and Theorem 3.1, we can obtain the following corollary directly. Corollary 3.1. Suppose that the conditions of Theorem 3.1 are satisfied, and let C ∈ E such that IC has a φ-positive support and πs (C) < ∞. bn has an asymptotically normal distribution of the form: Then the estimator θ p d bn − θ 0 ) −→ (3.7) NC (n)(θ N(0d , σ 2 L̈−1 C (θ 0 )), where L̈C (θ 0 ) = πs−1 (C)L̈(θ 0 ). Remark 3.3. In practice, we may choose C as a compact set such that φ(C) > 0 and πs (C) < ∞. In the additional simulation study (Example B.1) given in the supplemental document, for two types of 1/2-null recurrent Markov processes, we choose C = [−A, A] with the positive constant A carefully chosen, which works well in our setting. If πs (·) has a continuous derivative function ps (·), we can show that Z L̈C (θ 0 ) = ġ(x, θ 0 )ġτ (x, θ 0 )pC (x) dx with pC (x) = ps (x)/πs (C). The density function pC (x) can be estimated by the kernel method. Then, replacing θ 0 by the NLS estimated value, we can obtain a consistent estimate for L̈C (θ 0 ). Note that NC (n) is observable and σ 2 can be estimated bn ). Hence, for by calculating the variance of the residuals ebt = Yt − g(Xt , θ inference purposes, one may not need to estimate β and Ls (·) when {Xt } is β-null recurrent, as L̈C (θ 0 ), σ 2 and NC (n) in (3.7) can be explicitly computed without knowing any information about β and Ls (·). From (3.4) in Theorem 3.1 and (2.3) in Section 2.1 above, we have the following corollary. Corollary 3.2. Suppose that the conditions of Theorem 3.1 are satisfied. Furthermore, {Xt } is a β-null recurrent Markov chain with 0 < β < 1. Then we have   1 b (3.8) , θ n − θ 0 = OP p nβ Ls (n) 12 D. LI, D. TJØSTHEIM AND J. GAO where Ls (n) is defined in Section 2.1. Remark 3.4. As β < 1 and Ls (n) is a slowly varying positive function, bn is slower than √n, for the integrable case, the rate of convergence of θ the rate of convergence of the parametric NLS estimator in the stationary time series case. Combining (2.3) and Theorem 3.1, the result (3.8) can be strengthened to q d bn − θ 0 ) −→ nβ Ls (n)(θ [Mβ−1 (1)σ 2 L̈−1 (θ 0 )]1/2 · Nd , (3.9) where Nd is a d-dimensional normal distribution with mean zero and covariance matrix being the identity matrix, which is independent of Mβ (1). A similar result is also obtained by Chan and Wang (2012). Corollary 3.2 and (3.9) complement the existing results on the rates of convergence of nonparametric estimators in β-null recurrent Markov processes [c.f., Karlsen, Myklebust and Tjøstheim (2007), Gao et al. (2015)]. For the random walk case, which corresponds to 1/2-null recurrent Markov chain, the rate of convergence is n1/4 , which is similar to a result obtained by PP for the processes that are of I(1) type. 3.2. Asymptotically homogeneous function on Θ. We next establish an asymptotic theory for a parametric estimator of θ 0 when g(·, ·) and its derivatives belong to a class of asymptotically homogeneous functions. For a unit root process {Xt }, PP establish the consistency and limit distribution of bn by using the local time technique. Their method relies the NLS estimator θ on the linear framework of the unit root process, the functional limit theorem of the partial sum process and the continuous mapping theorem. The Harris recurrent Markov chain is a general process and allows for a possibly nonlinear framework, however. In particular, the null recurrent Markov chain can be seen as a nonlinear generalization of the linear unit root process. Hence, the techniques used by PP for establishing the asymptotic theory is not applicable in such a possibly nonlinear Markov chain framework. Meanwhile, as mentioned in Section 1, the methods used to prove Theorem 3.1 cannot be applied here directly because the asymptotically homogeneous functions usually are not bounded and integrable. This leads to the violation of the conditions in the ergodic theorem when the process is null recurrent. In fact, most of the existing limit theorems for the null recurrent Markov process h(Xt ) [c.f., Chen (1999, 2000)] only consider the case where h(·) is bounded and integrable. Hence, it is quite challenging to extend Theorem 3.3 in PP to the case of general null recurrent Markov chains and establish an asymptotic theory for the NLS estimator for the case of asymptotically homogeneous functions. NONLINEAR AND NONSTATIONARY REGRESSION 13 bn . To address the above concerns, we have to modify the NLS estimator θ Let Mn be a positive and increasing sequence satisfying Mn → ∞ as n → ∞, but is dominated by a certain polynomial rate. We define the modified loss function by (3.10) Qn,g (θ) = n X t=1 [Yt − g(Xt , θ)]2 I(|Xt | ≤ Mn ). The modified NLS (MNLS) estimator θ n can be obtained by minimizing Qn,g (θ) over θ ∈ Θ, (3.11) θn = arg min Qn,g (θ). θ∈Θ The above truncation technique enables us to develop the limit theorems for the parametric estimate θ n even when the function g(·, ·) or its derivatives are unbounded. A similar truncation idea is also used by Ling (2007) to estimate the ARMA-GARCH model when the second moment may not exist [it is called as the self-weighted method by Ling (2007)]. However, Assumption 2.1 in Ling (2007) indicates the stationarity for the model. The Harris recurrence considered in the paper is more general and includes both the stationary and nonstationary cases. As Mn → ∞, for the integrable case discussed in Section 3.1, we can easily show that θ n has the same asymptotic bn under some regularity conditions. In Example 5.1 below, distribution as θ we compare the finite sample performance of these two estimators, and find that they are quite similar. Furthermore, when {Xt } is positive recurrent, as mentioned in the last paragraph of Section 2.3, although the asymptotically homogeneous g(x, θ) and its derivatives are unbounded and not integrable on Θ, it may be reasonable to assume that g(x, θ)ps (x) and its derivatives (with respect to θ) are integrable on Θ. In this case, Theorem 3.1 and Corollary 3.1 in Section 3.1 still hold for the estimation θ n and the role of N (n) [or NC (n)] is the same as that of the sample size, which implies that the root-n consistency in the stationary time series case can be derived. Hence, we only consider the null recurrent {Xt } in the remaining subsection. Let Bi (1) = [i − 1, i), i = 1, 2, . . . , [Mn ], Bi (2) = [−i, −i + 1), i = 1, 2, . . . , [Mn ], B[Mn ]+1 (1) = [[Mn ], Mn ], B[Mn ]+1 (2) = [−Mn , −[Mn ]]. It is easy to check that Bi (k), i = 1, 2, . . . , [Mn ] + 1, k = 1, 2, are disjoint, S S[M ]+1 and [−Mn , Mn ] = 2k=1 i=1n Bi (k). Define [Mn ] ζ0 (Mn ) = X i=0 [πs (Bi+1 (1)) + πs (Bi+1 (2))], 14 D. LI, D. TJØSTHEIM AND J. GAO and [Mn ] Λn (θ) = X ḣg i=0     i i , θ ḣτg , θ πs (Bi+1 (1)) Mn Mn ḣg     2 i i , θ − hg , θ0 πs (Bi+1 (1)) Mn Mn [Mn ] + X i=0 e n (θ, θ 0 ) = Λ [Mn ] X hg i=0 + [Mn ] X hg i=0    −i −i τ , θ ḣg , θ πs (Bi+1 (2)), Mn Mn    2 −i −i , θ − hg , θ0 πs (Bi+1 (2)), Mn Mn where hg (·, ·) and ḣg (·, ·) will be defined in Assumption 3.3(i) below. Some additional assumptions are introduced below to establish asymptotic properties for θ n . Assumption 3.3. (i) g(x, θ), ġ(x, θ) and g̈(x, θ) are asymptotically homogeneous on Θ with asymptotic orders κg (·), κ̇g (·) and κ̈g (·), and limit homogeneous functions hg (·, ·), ḣg (·, ·) and ḧg (·, ·), respectively. Furthermore, the asymptotic orders κg (·), κ̇g (·) and κ̈g (·) are independent of θ. (ii) The function hg (·, θ) is continuous on the interval [−1, 1] for all θ ∈ e θ 0 ) which achieves unique Θ. For all θ 6= θ 0 , there exist a continuous Λ(·, e n )} such that minimum at θ = θ 0 and a sequence of positive numbers {ζ(M (3.12) lim n→∞ 1 e n) ζ(M e n (θ, θ 0 ) = Λ(θ, e θ 0 ). Λ For θ in a neighborhood of θ 0 , both ḣg (·, θ) and ḧg (·, θ) are continuous on the interval [−1, 1] and there exist a continuous and positive definite matrix Λ(θ) and a sequence of positive numbers {ζ(Mn )} such that (3.13) lim n→∞ 1 Λn (θ) = Λ(θ). ζ(Mn ) e n ) and ζ0 (Mn )/ζ(Mn ) are bounded, and Furthermore, both ζ0 (Mn )/ζ(M ζ0 (ln )/ζ0 (Mn ) = o(1) for ln → ∞ but ln = o(Mn ). (iii) The asymptotic orders κg (·), κ̇g (·) and κ̈g (·) are positive and nondecreasing such that κg (n) + κ̈g (n) = O(κ̇g (n)) as n → ∞. (iv) For each x ∈ [−Mn , Mn ], Nx (1) := {y : x − 1 < y < x + 1} is a small set and the invariant density function ps (x) is bounded away from zero and infinity. NONLINEAR AND NONSTATIONARY REGRESSION 15 Remark 3.5. Assumption 3.3(i) is quite standard; see, for example, condition (b) in Theorem 5.2 in PP. The restriction that the asymptotic orders are independent of θ can be relaxed at the cost of more complicated assumptions and more lengthy proofs. For example, to ensure the global consistency of θ n , we need to assume that there exist ǫ∗ > 0 and a neighborhood Bθ1 of θ 1 for any θ 1 6= θ 0 such that inf inf |pκg (n, θ) − qκg (n, θ 0 )| → ∞ |p−p̄|<ǫ∗ ,|q−q̄|<ǫ∗ θ∈Bθ 1 for p̄, q̄ > 0. And to establish the asymptotic normality of θ n , we need to impose additional technical conditions on the asymptotic orders and limit homogeneous functions, similar to condition (b) in Theorem 5.3 of PP. The e n ) in Assumption 3.3(ii) e θ 0 ) and ζ(M explicit forms of Λ(θ), ζ(Mn ), Λ(θ, can be derived for some special cases. For example, when {Xt } is generated by a random walk process, we have πs (dx) = dx and [Mn ] Λn (θ) = (1 + o(1)) X ḣg i=−[Mn ] = (1 + o(1))Mn Z 1 −1     i i τ , θ ḣg ,θ Mn Mn ḣg (x, θ)ḣτg (x, θ) dx, R1 which implies that ζ(Mn ) = Mn and Λ(θ) = −1 ḣg (x, θ)ḣτg (x, θ) dx in (3.13). e n ) can be derived similarly for the e θ 0 ) and ζ(M The explicit forms of Λ(θ, above two cases and details are thus omitted. Define Jg (n, θ 0 ) = κ̇2g (Mn )ζ(Mn )Λ(θ 0 ). We next establish an asymptotic theory for θ n when {Xt } is null recurrent. Theorem 3.2. Let {Xt } be a null recurrent Markov process, Assumptions 3.1(ii) and 3.3 hold. (a) The solution θ n which minimizes the loss function Qn,g (θ) over Θ is consistent, that is, (3.14) θ n − θ 0 = oP (1). (b) The estimator θ n has the asymptotically normal distribution, (3.15) d 2 N 1/2 (n)J1/2 g (n, θ 0 )(θ n − θ 0 ) −→ N(0d , σ Id ), where Id is a d × d identity matrix. 16 D. LI, D. TJØSTHEIM AND J. GAO Remark 3.6. From Theorem 3.2, the asymptotic distribution of θ n for the asymptotically homogeneous regression function is quite different from bn for the integrable regression function when the process is null that of θ recurrent. Such finding is comparable to those in PP. The choice of Mn in the estimation method and asymptotic theory will be discussed in Corollaries 3.3 and 3.4 below. Remark 3.7. As in Corollary 3.1, we can modify (3.15) for inference purposes. Define Jg,C (n, θ 0 ) = κ̇2g (Mn )Λn,C (θ 0 ), where [Mn ] Λn,C (θ) = X ḣg i=0     i πs (Bi+1 (1)) i τ , θ ḣg ,θ Mn Mn πs (C) [Mn ] + X i=0 ḣg     πs (Bi+1 (2)) −i −i τ , , θ ḣg ,θ Mn Mn πs (C) where C satisfies the conditions in Corollary 3.1. Then, by (3.5) and (3.15), we can show that (3.16) 1/2 1/2 d NC (n)Jg,C (n, θ 0 )(θ n − θ 0 ) −→ N(0d , σ 2 Id ). When {Xt } is β-null recurrent, we can use the asymptotically normal distribution theory (3.16) to conduct statistical inference without knowing any information of β as NC (n) is observable and Jg,C (n, θ 0 ) can be explicitly computed through replacing Λn,C (θ 0 ) by the plug-in estimated value. From (3.15) in Theorem 3.2 and (2.3) in Section 2 above, we have the following two corollaries. The rate of convergence in (3.17) below is quite general for β-null recurrent Markov processes. When β = 1/2, it is the same as the convergence rate in Theorem 5.2 of PP. Corollary 3.3. Suppose that the conditions of Theorem 3.2 are satisfied. Furthermore, let {Xt } be a β-null recurrent Markov chain with 0 < β < 1. Taking Mn = M0 n1−β L−1 s (n) for some positive constant M0 , we have (3.17) θ n − θ 0 = OP ((nκ̇2g (Mn ))−1/2 ). Corollary 3.4. Suppose that the conditions of Theorem 3.2 are satisfied. Let g(x, θ 0 ) = xθ0 , {Xt } be a random walk process and Mn = M0 n1/2 for some positive constant M0 . Then we have (3.18) θ n − θ0 = OP (n−1 ), where θn is the MNLS estimator of θ0 . Furthermore, q d (3.19) M03 N (n)n3/2 (θ n − θ0 ) −→ N(0, 3σ 2 /2). NONLINEAR AND NONSTATIONARY REGRESSION 17 Remark 3.8. For the simple linear regression model with regressors generated by a random walk process, (3.18) and (3.19) imply the existence of super consistency. Corollaries 3.3 and 3.4 show that the rates of convergence for the parametric estimator in nonlinear cointegrating models rely not only on the properties of the function g(·, ·), but also on the magnitude of β. In the above two corollaries, we give the choice of Mn for some special cases. In fact, for the random walk process {Xt } defined as in Example 2.1(i) with E[x21 ] = 1, we have [nr] 1 1 X √ X[nr] = √ xi ⇒ B(r), n n i=1 where B(r) is a standard Brownian motion and “⇒” denotes the weak convergence. Furthermore, by the continuous mapping theorem [c.f., Billingsley (1968)], 1 sup √ X[nr] ⇒ sup B(r), 0≤r≤1 n 0≤r≤1 which implies that it is reasonable to let Mn = Cα n1/2 , where Cα may be chosen such that   (3.20) α = P sup B(r) ≥ Cα = P(|B(1)| ≥ Cα ) = 2(1 − Φ(Cα )), 0≤r≤1 where the second equality is due to the reflection principle and Φ(x) = √ Rx −u2 /2 / 2π) du. This implies that C can be obtained when α is given, (e α −∞ such as α = 0.05. For the general β-null recurrent Markov process, the choice of the optimal Mn remains as an open problem. We conjecture that it may fn1−βb with βb defined in (3.6) and M f chosen by be an option to take Mn = M a data-driven method, and will further study this issue in future research. 4. Discussions and extensions. In this section, we discuss the applications of our asymptotic results in estimating the nonlinear heteroskedastic regression and nonlinear regression with I(1) processes. Furthermore, we also discuss possible extensions of our model to the cases of multivariate regressors and nonlinear autoregression. 4.1. Nonlinear heteroskedastic regression. We introduce an estimation method for a parameter vector involved in the conditional variance function. For simplicity, we consider the model defined by (4.1) Yt = σ(Xt , γ 0 )et∗ for γ 0 ∈ Υ ⊂ Rp , where {et∗ } satisfies Assumption 3.1(ii) with a unit variance, σ 2 (·, ·) : Rp+1 → R is positive, and γ 0 is the true value of the p-dimensional parameter vector 18 D. LI, D. TJØSTHEIM AND J. GAO involved in the conditional variance function. Estimation of the parametric nonlinear variance function defined in (4.1) is important in empirical applications as many scientific studies depend on understanding the variability of the data. When the covariates are integrated, Han and Park (2012) study the maximum likelihood estimation of the parameters in the ARCH and GARCH models. A recent paper by Han and Kristensen (2014) further considers the quasi maximum likelihood estimation in the GARCH-X models with stationary and nonstationary covariates. We next consider the general Harris recurrent Markov process {Xt } and use a robust estimation method for model (4.1). Letting ̟0 be a positive number such that E[log(e2t∗ )] = log(̟0 ), we have log(Yt2 ) = log(σ 2 (Xt , γ 0 )) + log(e2t∗ ) (4.2) = log(σ 2 (Xt , γ 0 )) + log(̟0 ) + log(e2t∗ ) − log(̟0 ) =: log(̟0 σ 2 (Xt , γ 0 )) + ζt , where E(ζt ) = 0. Since our main interest lies in the discussion of the asymptotic theory for the estimator of γ 0 , we first assume that ̟0 is known to simplify our discussion. Model (4.2) can be seen as another nonlinear mean regression model with parameter vector γ 0 to be estimated. The logtransformation would make data less skewed, and thus the resulting volatility estimator may be more robust in terms of dealing with heavy-tailed {et∗ }. Such transformation has been commonly used to estimate the variability of the data in the stationary time series case [c.f., Peng and Yao (2003), Gao (2007), Chen, Cheng and Peng (2009)]. However, any extension to Harris recurrent Markov chains which may be nonstationary has not been done in the literature. Our estimation method will be constructed based on (4.2). Noting that ̟0 is assumed to be known, define (4.3) σ∗2 (Xt , γ 0 ) = ̟0 σ 2 (Xt , γ 0 ) and g∗ (Xt , γ 0 ) = log(σ∗2 (Xt , γ 0 )). Case (I). If g∗ (Xt , γ) and its derivatives are integrable on Υ, the logb n can be obtained transformed nonlinear least squares (LNLS) estimator γ by minimizing Ln,σ (γ) over γ ∈ Υ, where (4.4) Ln,σ (γ) = n X t=1 [log(Yt2 ) − g∗ (Xt , γ)]2 . Letting Assumptions 3.1 and 3.2 be satisfied with et and g(·, ·) replaced by ζt and g∗ (·, ·), respectively, then the asymptotic results developed in Section 3.1 bn. still hold for γ NONLINEAR AND NONSTATIONARY REGRESSION 19 Case (II). If g∗ (Xt , γ) and its derivatives are asymptotically homogeneous on Υ, the log-transformed modified nonlinear least squares (LMNLS) estimator γ n can be obtained by minimizing Qn,σ (γ) over γ ∈ Υ, where (4.5) Qn,σ (γ) = n X t=1 [log(Yt2 ) − g∗ (Xt , γ)]2 I(|Xt | ≤ Mn ), where Mn is defined as in Section 3.2. Then the asymptotic results developed in Section 3.2 still hold for γ n under some regularity conditions such as a slightly modified version of Assumptions 3.1 and 3.3. Hence, it is possible to achieve the super-consistency result for γ n when {Xt } is null recurrent. In practice, however, ̟0 is usually unknown and needs to be estimated. We next briefly discuss this issue for case (ii). We may define the loss function by Qn (γ, ̟) = n X [log(Yt2 ) − log(̟σ 2 (Xt , γ))]2 I(|Xt | ≤ Mn ). t=1 Then the estimators γ n and ̟n can be obtained by minimizing Qn (γ, ̟) over γ ∈ Υ and ̟ ∈ R+ . A simulated example (Example B.2) is given in Appendix B of the supplemental document to examine the finite sample performance of the LNLS and LMNLS estimations considered in cases (i) and (ii), respectively. 4.2. Nonlinear regression with I(1) processes. As mentioned before, PP consider the nonlinear regression (1.1) with the regressors {Xt } generated by (4.6) Xt = Xt−1 + xt , xt = ∞ X φj εt−j , j=0 where {εj } is a sequence of i.i.d. random variables and {φj } satisfies some summability conditions. For simplicity, we assume that X0 = 0 throughout this subsection. PP establish a suite of asymptotic results for the NLS estimator of the parameter θ 0 involved in (1.1) when {Xt } is defined by (4.6). An open problem is how to establish such results by using the β-null recurrent Markov chain framework. This is quite challenging as {Xt } defined by (4.6) is no longer a Markov process except for some special cases (for example, φj = 0 for j ≥ 1). We next consider solving this open problem for the case where g(·, ·) is asymptotically homogeneous on Θ and derive an asymptotic theory for θ n by using Theorem 3.2 (the discussion for the integrable case is more 20 D. LI, D. TJØSTHEIM AND J. GAO complicated, and will be considered in a future study). Our main idea is to approximate Xt by Xt∗ which is defined by Xt∗ = φ t X εs , φ := s=1 ∞ X j=0 φj 6= 0, and then show that the asymptotically homogeneous function of Xt is asymptotically equivalent to the same function of Xt∗ . As {Xt∗ } is a random walk process under the Assumption E.1 (see Appendix E of the supplemental document), we can then make use of Theorem 3.2. Define  Z 1 2 τ Jg∗ (n, θ 0 ) = κ̇g (Mn )Mn ḣg (x, θ 0 )ḣg (x, θ 0 ) dx . (4.7) −1 We next give some asymptotic results for θ n for the case where {Xt } is a unit root process (4.6), and the proof is provided in Appendix E of the supplemental document. Theorem 4.1. Let Assumptions E.1 and E.2 in Appendix E of the supplemental document hold, and n−1/(2(2+δ)) Mn → ∞, where δ > 0 is defined in Assumption E.1(i). (a) The solution θ n which minimizes the loss function Qn,g (θ) over Θ is consistent, that is, θ n − θ 0 = oP (1). (4.8) (b) The estimator θ n has the asymptotically normal distribution, (4.9) 1/2 d Nε1/2 (n)Jg∗ (n, θ0 )(θ n − θ 0 ) −→ N(0d , σ 2 Id ), where Nε (n) is the number of regenerations for the random walk {Xt∗ }. Remark 4.1. Theorem 4.1 establishes an asymptotic theory for θ n when {Xt } is a unit root process (4.6). Our results are comparable with Theorems 5.2 and 5.3 in PP. However, we establish asymptotic normal1/2 1/2 ity in (4.9) with stochastic rate Nε (n)Jg∗ (n, θ 0 ), and PP establish their asymptotic mixed normal distribution theory with a deterministic rate. As √ 1/2 1/2 1/2 Nε (n)Jg∗ (n, θ0 ) ∝ n1/4 Jg∗ (n, θ 0 ) in probability, if we take Mn = M0 n as in Corollary 3.4, we will find that our rate of convergence of θ n is the same as that derived by PP. NONLINEAR AND NONSTATIONARY REGRESSION 21 4.3. Extensions to multivariate regression and nonlinear autoregression. The theoretical results developed in Section 3 are limited to nonlinear regression with a univariate Markov process. A natural question is whether it is possible to extend them to the more general case with multivariate covariates. In the unit root framework, it is well known that it is difficult to derive the limit theory for the case of multivariate unit root processes, as the vector Brownian motion is transient when the dimension is larger than (or equal to) 3. In contrast, under the framework of the Harris recurrent Markov chains, it is possible for us to generalize the theoretical theory to the multivariate case (with certain restrictions). For example, it is possible to extend the theoretical results to the case with one nonstationary regressor and several other stationary regressors. We next give an example of vector autoregressive (VAR) process which may be included in our framework under certain conditions. Example 4.1. defined by (4.10) Consider a q-dimensional VAR(1) process {Xt } which is Xt = AXt−1 + b + xt , t = 1, 2, . . . , where X0 = 0q , A is a q × q matrix, b is a q-dimensional vector and {xt } is a sequence of i.i.d. q-dimensional random vectors with mean zero. If all the eigenvalues of the matrix A are inside the unit circle, under some mild conditions on {xt }, Theorem 3 in Myklebust, Karlsen and Tjøstheim (2012) shows that the VAR(1) process {Xt } in (4.10) is geometric ergodic, which belongs to the category of positive recurrence. On the other hand, if the matrix A has exactly one eigenvalue on the unit circle, under some mild conditions on {xt } and b, Theorem 4 in Myklebust, Karlsen and Tjøstheim (2012) shows that the VAR(1) process {Xt } in (4.10) is β-null recurrent with β = 1/2. For this case, the asymptotic theory developed in Section 3 is applicable. However, when A has two eigenvalues on the unit circle, under different restrictions, {Xt } might be null recurrent (but not β-null recurrent) or transient. If A has three or more eigenvalues on the unit circle, the VAR(1) process {Xt } would be transient, which indicates that the limit theory developed in this paper would be not applicable. We next briefly discuss a nonlinear autoregressive model of the form: (4.11) Xt+1 = g(Xt , θ 0 ) + et+1 , t = 1, 2, . . . , n. For this autoregression case, {et } is not independent of {Xt }, and thus the proof strategy developed in this paper needs to be modified. Following the argument in Karlsen and Tjøstheim (2001), in order to develop 22 D. LI, D. TJØSTHEIM AND J. GAO an asymptotic theory for the parameter estimation in the nonlinear autoregression (4.11), we may need that the process {Xt } is Harris recurrent but not that the compound process {(Xt , et+1 )} is also Harris recurrent. This is because we essentially have to consider sums of products like ġ(Xt , θ 0 )et+1 = ġ(Xt , θ 0 )(Xt+1 − g(Xt , θ 0 )), which are of the general form treated in Karlsen and Tjøstheim (2001). The verification of the Harris recurrence of {Xt } has been discussed by Lu (1998) and Example 2.1 given in Section 2.2 above. How to establish an asymptotic theory for the parameter estimation of θ 0 in model (4.11) will be studied in our future research. 5. Simulated examples. In this section, we provide some simulation studies to compare the finite sample performance of the proposed parametric estimation methods and to illustrate the developed asymptotic theory. Example 5.1. (5.1) Consider the generalized linear model defined by Yt = exp{−θ0 Xt2 } + et , θ0 = 1, t = 1, 2, . . . , n, where {Xt } is generated by one of the three Markov processes: (i) AR(1) process: Xt = 0.5Xt−1 + xt , (ii) Random walk process: Xt = Xt−1 + xt , (iii) TAR(1) process: Xt = 0.5Xt−1 I(|Xt−1 | ≤ 1)+Xt−1 I(|Xt−1 | > 1)+xt , X0 = 0 and {xt } is a sequence of i.i.d. standard normal random variables for the above three processes. The error process {et } is a sequence of i.i.d. N(0, 0.52 ) random variables and independent of {xt }. In this simulation study, we compare the finite sample behavior of the NLS estimator θbn with that of the MNLS estimator θn , and the sample size n is chosen to be 500, 1000 and 2000. The aim of this example is to illustrate the asymptotic theory developed in Section 3.1 as the regression function in (5.1) is integrable when θ0 > 0. Following the discussion in Section 2.2, the AR(1) process defined in (i) is positive recurrent, and the random process defined in (ii) and the TAR(1) process defined in (iii) are 1/2-null recurrent. We generate 500 replicated samples for this simulation study, and calculate the means and standard errors for both of the parametric estimators in 500 simulations. In the MNLS estimation procedure, we choose Mn = Cα n1−β with α = 0.01, where Cα is defined in (3.20), β = 1 for case (i), and β = 1/2 for cases (ii) and (iii). It is easy to find that C0.01 = 2.58. The simulation results are reported in Table 1, where the numbers in the parentheses are the standard errors of the NLS (or MNLS) estimator in the 500 replications. From Table 1, we have the following interesting findings. (a) The parametric estimators perform better in the stationary case (i) than in the nonstationary cases (ii) and (iii). This is consistent with the asymptotic 23 NONLINEAR AND NONSTATIONARY REGRESSION Table 1 Means and standard errors for the estimators in Example 5.1 Sample size 500 1000 2000 NLS MNLS The regressor Xt is generated in case (i) 1.0036 (0.0481) 1.0002 (0.0339) 1.0036 (0.0481) 1.0002 (0.0339) 1.0000 (0.0245) 1.0000 (0.0245) NLS MNLS The regressor Xt is generated in case (ii) 0.9881 (0.1783) 0.9987 (0.1495) 0.9881 (0.1783) 0.9987 (0.1495) 0.9926 (0.1393) 0.9926 (0.1393) NLS MNLS The regressor Xt is generated in case (iii) 0.9975 (0.1692) 1.0028 (0.1463) 0.9975 (0.1692) 1.0028 (0.1463) 0.9940 (0.1301) 0.9940 (0.1301) results obtained in Section 3.1 such as Theorem 3.1 and Corollaries 3.1 and 3.2, which indicate that the convergence rates of the parametric estimators can achieve OP (n−1/2 ) in the stationary case, but only OP (n−1/4 ) in the 1/2null recurrent case. (b) The finite sample behavior of the MNLS estimator is the same as that of NLS estimator since α = 0.01 means little sample information is lost. (c) Both of the two parametric estimators improve as the sample size increases. (d) In addition, for case (i), the ratio of the standard √ errors between 500 and 2000 is 1.9633 (close to the theoretical ratio 4 = 2); for case (iii), the ratio of the standard errors between 500 and 2000 is 1.3005 (close to the theoretical ratio 41/4 = 1.4142). Hence, this again confirms that our asymptotic theory is valid. Example 5.2. (5.2) Consider the quadratic regression model defined by Yt = θ0 Xt2 + et , θ0 = 0.5, t = 1, 2, . . . , n, where {Xt } is generated either by one of the three Markov processes introduced in Example 5.1, or by (iv) the unit root process: Xt = Xt−1 + xt , xt = 0.2xt−1 + vt , in which X0 = x0 = 0, {vt } is a sequence of i.i.d. N(0, 0.75) random variables, and the error process {et } is defined as in Example 5.1. In this simulation study, we are interested in the finite sample behavior of the MNLS estimator to illustrate the asymptotic theory developed in Section 3.2 as the regression function in (5.2) is asymptotically homogeneous. For the comparison purpose, we also investigate the finite sample behavior of the NLS estimation, although we do not establish the related asymptotic theory under the framework of null recurrent Markov chains. The sample size n is chosen to be 500, 1000 and 2000 as in Example 5.1 and the replication number is R = 500. In the MNLS estimation procedure, as in the previous example, we choose Mn = 2.58n1−β , where β = 1 for case (i), and β = 1/2 for cases (ii)–(iv). 24 D. LI, D. TJØSTHEIM AND J. GAO Table 2 Means and standard errors for the estimators in Example 5.2 Sample size NLS MNLS 500 1000 The regressor Xt is generated in case (i) 0.5002 (0.0095) 0.4997 (0.0068) 0.5003 (0.0126) 0.4998 (0.0092) 2000 0.4998 (0.0050) 0.4997 (0.0064) NLS MNLS The regressor Xt is generated in case (ii) 0.5000 (2.4523 × 10−4 ) 0.5000 (6.7110 × 10−5 ) 0.5000 (2.7250 × 10−5 ) 0.5000 (2.4523 × 10−4 ) 0.5000 (6.7112 × 10−5 ) 0.5000 (2.7251 × 10−5 ) NLS MNLS The regressor Xt is generated in case (iii) 0.5000 (2.6095 × 10−4 ) 0.5000 (8.4571 × 10−5 ) 0.5000 (3.1268 × 10−5 ) 0.5000 (2.6095 × 10−4 ) 0.5000 (8.4572 × 10−5 ) 0.5000 (3.1268 × 10−5 ) NLS MNLS The regressor Xt is generated in case (iv) 0.5000 (2.1698 × 10−4 ) 0.5000 (7.1500 × 10−5 ) 0.5000 (2.6017 × 10−5 ) 0.5000 (2.1699 × 10−4 ) 0.5000 (7.1504 × 10−5 ) 0.5000 (2.6017 × 10−5 ) The simulation results are reported in Table 2, from which, we have the following conclusions. (a) For the regression model with asymptotically homogeneous regression function, the parametric estimators perform better in the nonstationary cases (ii)–(iv) than in the stationary case (i). This finding is consistent with the asymptotic results obtained in Sections 3.2 and 4.2. (b) The MNLS estimator performs as well as the NLS estimator (in particular for the nonstationary cases). Both the NLS and MNLS estimations improve as the sample size increases. 6. Empirical application. In this section, we give an empirical application of the proposed parametric model and estimation methodology. Example 6.1. Consider the logarithm of the UK to US export and import data (in £). These data come from the website: https://www. uktradeinfo.com/, spanning from January 1996 to August 2013 monthly and with the sample size n = 212. Let Xt be defined as log(Et ) + log(pUK t )− US log(pt ), where {Et } is the monthly average of the nominal exchange rate, and {pit } denotes the consumption price index of country i. In this example, we let {Yt } denote the logarithm of either the export or the import value. The data Xt and Yt are plotted in Figures 1 and 2, respectively. Meanwhile, the real data application considered by Gao, Tjøstheim and Yin (2013) suggests that {Xt } may follow the threshold autoregressive model proposed in that paper, which is shown to be a 1/2-null recurrent Markov process. Furthermore, an application of the estimation method by (3.6) gives β0 = 0.5044. This further supports that {Xt } roughly follows a β-null recurrent Markov chain with β = 1/2. NONLINEAR AND NONSTATIONARY REGRESSION Fig. 1. 25 Plot of the real exchange rate Xt . To avoid possible confusion, let Yex,t and Yim,t be the export and import data, respectively. We are interested in estimating the parametric relationship between Yex,t (or Yim,t ) and Xt . In order to find a suitable parametric relationship, we first estimate the relationship nonparametrically based on Yex,t = mex (Xt ) + et1 and Yim,t = mim (Xt ) + et2 [c.f., Karlsen, Myklebust and Fig. 2. Plot of the logarithm of the export and import data Yt . 26 D. LI, D. TJØSTHEIM AND J. GAO Tjøstheim (2007)], where mex (·) and mim (·) are estimated by Pn t=1 K((Xt − x)/h)Yex,t and m b ex (x) = P n t=1 K((Xt − x)/h) (6.1) Pn t=1 K((Xt − x)/h)Yim,t m b im (x) = P , n t=1 K((Xt − x)/h) where K(·) is the probability density function of the standard normal distribution and the bandwidth h is chosen by the conventional leave-one-out cross-validation method. Then a parametric calibration procedure (based on the preliminary nonparametric estimation) suggests using a third-order polynomial relationship of the form (6.2) Yex,t = θex,0 + θex,1 Xt + θex,2 Xt2 + θex,3 Xt3 + eex,t for the export data, where the estimated values (by using the method in Section 3.2) of θex,0 , θex,1 , θex,2 and θex,3 are 21.666, 5.9788, 60.231 and 139.36, respectively, and (6.3) Yim,t = θim,0 + θim,1 Xt + θim,2 Xt2 + θim,3 Xt3 + eim,t for the import data, where the estimated values of θim,0 , θim,1 , θim,2 and θim,3 are 21.614, 3.5304, 37.789 and 87.172, respectively. Their plots are given in Figures 3 and 4, respectively. While Figures 3 and 4 suggest some relationship between the exchange rate and either the export or the import variable, the true relationship may Fig. 3. Plot of the polynomial model fitting (6.2). NONLINEAR AND NONSTATIONARY REGRESSION Fig. 4. 27 Plot of the polynomial model fitting (6.3). also depend on some other macroeconomic variables, such as, the real interest rate in the UK during the period. As discussed in Section 4.3, we would like to extend the proposed models from the univariate case to the multivariate case. As a future application, we should be able to find a more accurate relationship among the export or the import variable with the exchange rate and some other macroeconomic variables. 7. Conclusions. In this paper, we have systematically studied the nonlinear regression under the general Harris recurrent Markov chain framework, which includes both the stationary and nonstationary cases. Note that the nonstationary null recurrent process considered in this paper is under Markov perspective, which, unlike PP, indicates that our methodology has the potential of being extended to the nonlinear autoregressive case. In this paper, we not only develop an asymptotic theory for the NLS estimator of θ 0 when g(·, ·) is integrable, but also propose using a modified version of the conventional NLS estimator for the asymptotically homogeneous g(·, ·) and adopt a novel method to establish an asymptotic theory for the proposed modified parametric estimator. Furthermore, by using the log-transformation, we discuss the estimation of the parameter vector in a conditional volatility function. We also apply our results to the nonlinear regression with I(1) processes which may be non-Markovian, and establish an asymptotic distribution theory, which is comparable to that obtained by PP. The simulation studies and empirical applications have been provided to illustrate our approaches and results. 28 D. LI, D. TJØSTHEIM AND J. GAO APPENDIX A: OUTLINE OF THE MAIN PROOFS In this Appendix, we outline the proofs of the main results in Section 3. The detailed proofs of these results are given in Appendix C of the supplemental document. The major difference between our proof strategy and that based on the unit root framework [c.f., PP and Kristensen and Rahbek (2013)] is that our proofs rely on the limit theorems for functions of the Harris recurrent Markov process (c.f., Lemmas A.1 and A.2 below) whereas PP and Kristensen and Rahbek (2013)’s proofs use the limit theorems for integrated time series. We start with two technical lemmas which are crucial for the proofs of Theorems 3.1 and 3.2. The proofs for these two lemmas are given in Appendix D of the supplemental document by Li, Tjøstheim and Gao (2015). Lemma A.1. Let hI (x, θ) be a d-dimensional integrable function on Θ and suppose that Assumption 3.1(i) is satisfied for {Xt }. (a) Uniformly for θ ∈ Θ, we have Z n 1 X (A.1) hI (Xt , θ) = hI (x, θ)πs (dx) + oP (1). N (n) t=1 (b) If {et } satisfies Assumption 3.1(ii), we have, uniformly for θ ∈ Θ, (A.2) 1 N (n) t=1 p hI (Xt , θ)et = OP ( N (n)). hI (x, θ 0 )hτI (x, θ 0 )πs (dx) is positive definite, we have   Z n X d 2 τ hI (Xt , θ 0 )et −→ N 0d , σ hI (x, θ 0 )hI (x, θ 0 )πs (dx) . Furthermore, if (A.3) p R n X t=1 Lemma A.2. Let hAH (x, θ) be a d-dimensional asymptotically homogeneous function on Θ with asymptotic order κ(·) (independent of θ) and limit homogeneous function hAH (·, ·). Suppose that {Xt } is a null recurrent Markov process with the invariant measure πs (·) and Assumption 3.3(iv) are satisfied, and hAH (·, θ) is continuous on the interval [−1, 1] for all θ ∈ Θ. Furthermore, letting     [Mn ] X i i τ , θ hAH , θ πs (Bi+1 (1)) ∆AH (n, θ) = hAH Mn Mn i=0 [Mn ] + X i=0 hAH     −i −i τ , θ hAH , θ πs (Bi+1 (2)) Mn Mn NONLINEAR AND NONSTATIONARY REGRESSION 29 with Bi (1) and Bi (2) defined in Section 3.2, there exist a continuous and positive definite matrix ∆AH (θ) and a sequence of positive numbers {ζAH (Mn )} such that ζ0 (Mn )/ζAH (Mn ) is bounded, ζ0 (ln )/ζ0 (Mn ) = o(1) for ln → ∞ but ln = o(Mn ), and 1 ∆AH (n, θ) = ∆AH (θ), n→∞ ζAH (Mn ) lim where ζ0 (·) is defined in Section 3.2. (a) Uniformly for θ ∈ Θ, we have [N (n)JAH (n, θ)]−1 n X t=1 (A.4) hAH (Xt , θ)hτAH (Xt , θ)I(|Xt | ≤ Mn ) = Id + oP (1), where JAH (n, θ) = κ2 (Mn )ζAH (Mn )∆AH (θ). (b) If {et } satisfies Assumption 3.1(ii), we have, uniformly for θ ∈ Θ, −1/2 JAH (n, θ) (A.5) n X t=1 and furthermore, N −1/2 p hAH (Xt , θ)I(|Xt | ≤ Mn )et = OP ( N (n)), −1/2 (n)JAH (n, θ 0 ) n X t=1 (A.6) d hAH (Xt , θ0 )I(|Xt | ≤ Mn )et −→ N(0d , σ 2 Id ). Proof of Theorem 3.1. For Theorem 3.1(a), we only need to verify the following sufficient condition for the weak consistency [Jennrich (1969)]: for a sequence of positive numbers {λn }, (A.7) 1 [Ln,g (θ) − Ln,g (θ 0 )] = L∗ (θ, θ0 ) + oP (1) λn uniformly for θ ∈ Θ, where L∗ (·, θ 0 ) is continuous and achieves a unique minimum at θ 0 . This sufficient condition can be proved by using (A.1) and (A.2) in Lemma A.1, and (3.3) in Theorem 3.1(a) is thus proved. Combining the so-called Cramér–Wold device in Billingsley (1968) and (A.3) in Lemma A.1(b), we can complete the proof of the asymptotically normal distribution in (3.4). Details can be found in Appendix C of the supplementary material.  Proof of Corollary 3.1. The asymptotic distribution (3.7) can be proved by using (3.5) and Theorem 3.1(b).  30 D. LI, D. TJØSTHEIM AND J. GAO Proof of Corollary 3.2. The convergence result (3.8) can be proved by using (2.3) and (3.4), and following the proof of Lemma A.2 in Gao et al. (2015). A detailed proof is given in Appendix C of the supplementary material.  Proof of Theorem 3.2. The proof is similar to the proof of Theorem 3.1 above. To prove the weak consistency, similar to (A.7), we need to verify the sufficient condition: for a sequence of positive numbers {λ∗n }, (A.8) 1 [Qn,g (θ) − Qn,g (θ 0 )] = Q∗ (θ, θ0 ) + oP (1) λ∗n uniformly for θ ∈ Θ, where Q∗ (·, θ 0 ) is continuous and achieves a unique minimum at θ 0 . Using Assumption 3.3(ii) and following the proofs of (A.4) and (A.5) in Lemma A.2 (see Appendix D in the supplementary material), we may prove (A.8) and thus the weak consistency result (3.14). Combining the Cramér–Wold device and (A.6) in Lemma A.2(b), we can complete the proof of the asymptotically normal distribution for θ n in (3.15). More details are given in Appendix C of the supplementary material.  Proof of Corollary 3.3. By using Theorem 3.2(b) and (2.3), and following the proof of Lemma A.2 in Gao et al. (2015), we can directly prove (3.17).  Proof of Corollary 3.4. The convergence result (3.18) follows from (3.17) in Corollary 3.3 and (3.19) can be proved by using (3.15) in Theorem 3.2(b).  Acknowledgments. The authors are grateful to the Co-Editor, Professor Runze Li, an Associate Editor and two referees for their valuable and constructive comments and suggestions that substantially improved an earlier version of the paper. Thanks also go to Professor Peter Phillips and other colleagues who commented on this paper and the participants of various conferences and seminars where earlier versions of this paper were presented. This work was started when the first and third authors visited the second author at Department of Mathematics, University of Bergen in 2011. SUPPLEMENTARY MATERIAL Supplement to “Estimation in nonlinear regression with Harris recurrent Markov chains” (DOI: 10.1214/15-AOS1379SUPP; .pdf). We provide some additional simulation studies, the detailed proofs of the main results in Section 3, the proofs of Lemmas A.1 and A.2 and Theorem 4.1. NONLINEAR AND NONSTATIONARY REGRESSION 31 REFERENCES Bandi, F. and Phillips, P. C. B. (2009). Nonstationary continuous-time processes. In Handbook of Financial Econometrics (Y. Aı̈t-Sahalia and L. P. Hansen, eds.) 1 139–201. Bec, F., Rahbek, A. and Shephard, N. (2008). The ACR model: A multivariate dynamic mixture autoregression. Oxf. Bull. Econ. Stat. 70 583–618. Billingsley, P. (1968). Convergence of Probability Measures. Wiley, New York. MR0233396 Chan, N. and Wang, Q. (2012). Nonlinear cointegrating regressions with nonstationary time series. Working paper, School of Mathematics, Univ. Sydney. Chen, X. (1999). How often does a Harris recurrent Markov chain recur? Ann. Probab. 27 1324–1346. MR1733150 Chen, X. (2000). On the limit laws of the second order for additive functionals of Harris recurrent Markov chains. Probab. Theory Related Fields 116 89–123. MR1736591 Chen, L.-H., Cheng, M.-Y. and Peng, L. (2009). Conditional variance estimation in heteroscedastic regression models. J. Statist. Plann. Inference 139 236–245. MR2474001 Chen, J., Gao, J. and Li, D. (2012). Estimation in semi-parametric regression with non-stationary regressors. Bernoulli 18 678–702. MR2922466 Gao, J. (2007). Nonlinear Time Series: Semiparametric and Nonparametric Methods. Monographs on Statistics and Applied Probability 108. Chapman & Hall/CRC, Boca Raton, FL. MR2297190 Gao, J., Tjøstheim, D. and Yin, J. (2013). Estimation in threshold autoregressive models with a stationary and a unit root regime. J. Econometrics 172 1–13. MR2997126 Gao, J., Kanaya, S., Li, D. and Tjøstheim, D. (2015). Uniform consistency for nonparametric estimators in null recurrent time series. Econometric Theory 31 911–952. MR3396235 Han, H. and Kristensen, D. (2014). Asymptotic theory for the QMLE in GARCHX models with stationary and nonstationary covariates. J. Bus. Econom. Statist. 32 416–429. MR3238595 Han, H. and Park, J. Y. (2012). ARCH/GARCH with persistent covariate: Asymptotic theory of MLE. J. Econometrics 167 95–112. MR2885441 Höpfner, R. and Löcherbach, E. (2003). Limit theorems for null recurrent Markov processes. Mem. Amer. Math. Soc. 161 vi+92. MR1949295 Jennrich, R. I. (1969). Asymptotic properties of non-linear least squares estimators. Ann. Math. Statist. 40 633–643. MR0238419 Kallianpur, G. and Robbins, H. (1954). The sequence of sums of independent random variables. Duke Math. J. 21 285–307. MR0062976 Karlsen, H. A., Myklebust, T. and Tjøstheim, D. (2007). Nonparametric estimation in a nonlinear cointegration type model. Ann. Statist. 35 252–299. MR2332276 Karlsen, H. A., Myklebust, T. and Tjøstheim, D. (2010). Nonparametric regression estimation in a null recurrent time series. J. Statist. Plann. Inference 140 3619–3626. MR2674152 Karlsen, H. A. and Tjøstheim, D. (2001). Nonparametric estimation in null recurrent time series. Ann. Statist. 29 372–416. MR1863963 Kasahara, Y. (1984). Limit theorems for Lévy processes and Poisson point processes and their applications to Brownian excursions. J. Math. Kyoto Univ. 24 521–538. MR0766640 Kristensen, D. and Rahbek, A. (2013). Testing and inference in nonlinear cointegrating vector error correction models. Econometric Theory 29 1238–1288. MR3148831 32 D. LI, D. TJØSTHEIM AND J. GAO Lai, T. L. (1994). Asymptotic properties of nonlinear least squares estimates in stochastic regression models. Ann. Statist. 22 1917–1930. MR1329175 Li, R. and Nie, L. (2008). Efficient statistical inference procedures for partially nonlinear models and their applications. Biometrics 64 904–911. MR2526642 Li, D., Tjøstheim, D. and Gao, J. (2015). Supplement to “Estimation in nonlinear regression with Harris recurrent Markov chains.” DOI:10.1214/15-AOS1379SUPP. Lin, Z., Li, D. and Chen, J. (2009). Local linear M -estimators in null recurrent time series. Statist. Sinica 19 1683–1703. MR2589204 Ling, S. (2007). Self-weighted and local quasi-maximum likelihood estimators for ARMAGARCH/IGARCH models. J. Econometrics 140 849–873. MR2408929 Lu, Z. (1998). On the geometric ergodicity of a non-linear autoregressive model with an autoregressive conditional heteroscedastic term. Statist. Sinica 8 1205–1217. MR1666249 Malinvaud, E. (1970). The consistency of nonlinear regressions. Ann. Math. Statist. 41 956–969. MR0261754 Meyn, S. and Tweedie, R. L. (2009). Markov Chains and Stochastic Stability, 2nd ed. Cambridge Univ. Press, Cambridge. MR2509253 Myklebust, T., Karlsen, H. A. and Tjøstheim, D. (2012). Null recurrent unit root processes. Econometric Theory 28 1–41. MR2899213 Nummelin, E. (1984). General Irreducible Markov Chains and Nonnegative Operators. Cambridge Tracts in Mathematics 83. Cambridge Univ. Press, Cambridge. MR0776608 Park, J. Y. and Phillips, P. C. B. (1999). Asymptotics for nonlinear transformations of integrated time series. Econometric Theory 15 269–298. MR1704225 Park, J. Y. and Phillips, P. C. B. (2001). Nonlinear regressions with integrated time series. Econometrica 69 117–161. MR1806536 Peng, L. and Yao, Q. (2003). Least absolute deviations estimation for ARCH and GARCH models. Biometrika 90 967–975. MR2024770 Schienle, M. (2011). Nonparametric nonstationary regression with many covariates. Working paper, Humboldt–Univ. Berlin. Severini, T. A. and Wong, W. H. (1992). Profile likelihood and conditionally parametric models. Ann. Statist. 20 1768–1802. MR1193312 Skouras, K. (2000). Strong consistency in nonlinear stochastic regression models. Ann. Statist. 28 871–879. MR1792791 Teräsvirta, T., Tjøstheim, D. and Granger, C. W. J. (2010). Modelling Nonlinear Economic Time Series. Oxford Univ. Press, Oxford. MR3185399 Wu, C.-F. (1981). Asymptotic theory of nonlinear least squares estimation. Ann. Statist. 9 501–513. MR0615427 D. Li Department of Mathematics University of York Heslington Campus York, YO10 5DD United Kingdom E-mail: degui.li@york.ac.uk D. Tjøstheim Department of Mathematics University of Bergen Post box 7800 5020 Bergen Norway E-mail: Dag.Tjostheim@math.uib.no J. Gao Department of Econometrics and Business Statistics Monash University at Caulfield Caulfield East, Victoria 3145 Australia E-mail: jiti.gao@monash.edu
10math.ST
Memcapacitive neural networks Yuriy V. Pershin and Massimiliano Di Ventra arXiv:1307.6921v1 [cond-mat.dis-nn] 26 Jul 2013 Abstract We show that memcapacitive (memory capacitive) systems can be used as synapses in artificial neural networks. As an example of our approach, we discuss the architecture of an integrate-and-fire neural network based on memcapacitive synapses. Moreover, we demonstrate that the spike-timing-dependent plasticity can be simply realized with some of these devices. Memcapacitive synapses are a low-energy alternative to memristive synapses for neuromorphic computation. Y. V. Pershin is with the Department of Physics and Astronomy and USC Nanocenter, University of South Carolina, Columbia, SC, 29208 e-mail: pershin@physics.sc.edu. M. Di Ventra is with the Department of Physics, University of California, San Diego, La Jolla, California 92093-0319 e-mail: diventra@physics.ucsd.edu. 1 Memcapacitive neural networks Electronic devices with memory such as memristive [1], memcapacitive and meminductive systems [2] are promising components for unconvential computing applications because of their ability to store and process information at the same space location [3]. Moreover, if these devices are used as memory and computing elements in, e.g., neural networks, high-integration density and low-power consumption can be easily achieved. So far, only memristive devices have been considered as electronic synapses in artificial neural networks [4], [5], [6], [7]. In this article, we show instead that memcapacitive systems could play a similar role, thus offering the benefit of low power dissipation [2] and, in some instances, full compatibility with CMOS technology [8], an added benefit for electronic realizations of ”smart electronics”. According to their definition [2], voltage-controlled memcapacitive systems are described by the equations VC (t) = C −1 (x, q, t) q(t) ẋ = f (x, q, t) (1) (2) where q(t) is the charge on the capacitor at time t, VC (t) is the applied voltage, C is the memcapacitance, which depends on the state of the system and can vary in time, x is a set of n state variables describing the internal state of the system, and f is a continuous n-dimensional vector function. It is currently well established that in biological neural networks the synapse strength encodes memories [9]. In electronic circuits, the memory feature of memcapacitive systems (provided by their internal states characterized by x) can play a similar role. In figure 1 we show an example of memcapacitive neural network. In this leaky integrate-and-fire network, N input neurons are connected to the RC block of the output neuron with the help of memcapacitive synapses C1 −CN . Each memcapacitive synapse contains a memcapacitive system and two diodes. It is assumed that the switching of memcapacitive system involves a voltage threshold, which is above voltage pulse amplitudes involved in this network. Subjected to a voltage pulse from the i-th input neuron, the memcapacitive system Ci charges the integrating capacitor C in proportion to its capacitance Ci . As soon as the voltage across C reaches the threshold of Nout , Nout fires a forward voltage pulse and uses the controllable switch S to reset C . The diodes connected to the ground discharge C1 − CN after the pulse disappearance, and can be replaced by resistors. 2 Fig. 2 presents simulations of the integrate-and-fire network in the LTspice environment assuming the firing of only one input neuron. Here, we compare the circuit response subjected to the same input pulse sequence (periodic firing of N1 ) at different values of corresponding synaptic connection (memcapacitance C1 ). The stronger synaptic connection (Fig. 2(a)) results in faster charging of the integrating capacitor C and higher rate of the output neuron Nout firing. This result is compatible with operation of excitatory synapses. In order to model inhibitory synapses, one can use the synaptic connection similar to that shown in Fig. 1 with diodes connected with opposite polarity to the integrating capacitor and power supply voltage V (instead of the ground). The inset in Fig. 1 shows the schematics of the inhibitory synapse explicitly. Moreover, the inhibitory synapse should be driven by inverted pulses. To evaluate the strengths and weaknesses of using memcapacitive systems as synapses, we compare the energy dissipation in memcapacitive and memristive neural networks. Indeed, the circuit depicted in Fig. 1 can also operate with memristive synapses replacing the memcapacitive ones. Let us then estimate the amount of energy lost in both cases. For this purpose, we consider the situation when a single voltage pulse fired by N1 charges C by a small amount of charge q from VC = 0. In the case of memcapacitive network, the dissipated energy is the energy stored in C1 due to the pulse, namely, UC = qV1 /2 ≈ qV /2 if C1  C . In the case of memristive network, UR ≈ ∆tV I ≈ qV . Consequently, in this application, the memcapacitive synapses are two times more energy efficient. However, the memristive networks require less components as the diodes connected to the ground in Fig. 1 are not required when memristive synapses are not used. Let us now consider a realization of the spike-timing-dependent plasticity (STDP) with memcapacitive N1 V1 V C1 GND GND NN Fig. 1. V V Nj . . VN CN C .. Cj S . . . R Vout Nout Memcapacitive synapses in an integrate-and-fire neural network. N input electronic neurons N1 -NN are connected to the output neuron Nout using memcapacitive synapses. The inset: schematics of the inhibitory synapse. 3 18 18 16 12 10 8 VC 6 4 (a) 2 Fig. 2. 1 2 Time (μs) 12 10 8 VC 6 4 (b) 2 Vout 0 0 V1 14 Voltage (V) Voltage (V) 16 V1 14 Vout 0 3 4 0 1 2 Time (μs) 3 4 Simulation of the integrate-and-fire memcapacitive network (Fig. 1) with only one spiking neuron. The regular 5V 100ns spikes of the input neuron N1 trigger the output neuron Nout (with 3V voltage threshold shown by the horizontal dashed line) at different frequencies depending on the strength of memcapacitive synapse (C1 =2nF in (a) and 0.8nF in (b)). This plot was obtained with C = 5nF, R = 10kΩ, and BAT54 diode model. Here, VC is the voltage across C, and the lines are shifted by 7V for clarity. synapses. For this purpose, we consider a bipolar memcapacitive system with threshold [2], [10], which is also suitable for the integrate-and-fire network considered above. In biological neural networks, when a postsynaptic signal reaches the synapse before the action potential of the presynaptic neuron, the synapse shows long-term depression (LTD), namely its strength decreases (weaker connection between the neurons) depending on the time difference between the postsynaptic and presynaptic signals. Conversely, when the postsynaptic action potential reaches the synapse after the presynaptic action potential, the synapse undergoes a longtime potentiation (LTP), namely the signal transmission between the two neurons increases in proportion to the time difference between the presynaptic and postsynaptic signals. In electronic circuits, STDP can be implemented using double voltage pulses as shown in Fig. 3 (see also Ref. [7]). In this case, the pulse overlap provides opposite voltage polarities (across the synapse) depending on timing of presynaptic and postsynaptic pulses. Using a SPICE model of memcapacitive system with threshold [10] we simulate the dynamics of a memcapacitive synapse subjected to LTP and LTD pulses. The bottom line in Fig. 3 clearly shows the corresponding increase and decrease of the synaptic strength (memcapacitance). In conclusion, we have presented an alternative to simulate synaptic behavior that uses memcapacitive systems instead of memristive systems. The corresponding memcapacitive neural networks can operate 4 600 presynaptic Voltage (V) 10 500 8 400 6 300 postsynaptic 4 200 2 100 0 Fig. 3. Memcapacitance (pF) 12 LTP 0 2 LTD 4 6 8 Time (μs) 0 10 STDP with memcapacitive synapses. This plot was obtained using a model of bipolar memcapacitive system with threshold [10] with Vt = 3V, Clow = 10pF, Chigh = 100pF, C(t = 0) = 50pF, β = 2 × 10−5 F/(V·s). Here, the lines are shifted by 5V for clarity. at low energy consumption, and in some cases they are compatible with CMOS technology making them promising candidates for neuromorphic computing. This work has been partially supported by NSF grant ECCS-1202383, the Center for Magnetic Recording Research at UCSD, and Burroughs Wellcome Fund 2013 Collaborative Research Travel Grant. R EFERENCES [1] L. O. Chua and S. M. Kang, “Memristive devices and systems,” Proc. IEEE, vol. 64, pp. 209–223, 1976. [2] M. Di Ventra, Y. V. Pershin, and L. O. Chua, “Circuit elements with memory: Memristors, memcapacitors, and meminductors,” Proc. IEEE, vol. 97, no. 10, pp. 1717–1724, 2009. [3] M. Di Ventra and Y. V. Pershin, “The parallel approach,” Nature Physics, vol. 9, p. 200, 2013. [4] G. S. Snider, “Cortical computing with memristive nanodevices,” SciDAC Review, vol. 10, pp. 58–65, 2008. [5] S. H. Jo, T. Chang, I. Ebong, B. B. Bhadviya, P. Mazumder, and W. Lu, “Nanoscale memristor device as synapse in neuromorphic systems,” Nano Lett., vol. 10, pp. 1297–1301, 2010. [6] Y. V. Pershin and M. Di Ventra, “Experimental demonstration of associative memory with memristive neural networks,” Neural Networks, vol. 23, p. 881, 2010. [7] Y. V. Pershin and M. Di Ventra, “Neuromorphic, digital and quantum computation with memory circuit elements,” Proc. IEEE, vol. 100, p. 2071, 2012. [8] F. L. Traversa, F. Bonani, Y. V. Pershin, and M. Di Ventra, “Dynamic computing random access memory,” arXiv:1306.6133, 2013. [9] W. M. Cowan, T. C. Sudhof, and C. F. Stevens, Eds., Synapses. The Johns Hopkins University Press, 2001. [10] D. Biolek, M. D. Ventra, and Y. V. Pershin, “Reliable spice simulations of memristors, memcapacitors and meminductors,” arXiv:1307.2717, 2013.
9cs.NE
Minimum Cuts and Shortest Cycles in Directed Planar Graphs via Noncrossing Shortest Paths∗ Hung-Chun Liang† Hsueh-I Lu‡ arXiv:1703.07964v1 [cs.DS] 23 Mar 2017 March 24, 2017 Abstract Let G be an n-node simple directed planar graph with nonnegative edge weights. We study the fundamental problems of computing (1) a global cut of G with minimum weight and (2) a cycle of G with minimum weight. The best previously known algorithm for the former problem, running in O(n log3 n) time, can be obtained from the algorithm of Łacki, ˛ Nussbaum, Sankowski, and Wulff-Nilsen for single-source all-sinks maximum flows. The best previously known result for the latter problem is the O(n log3 n)-time algorithm of Wulff-Nilsen. By exploiting duality between the two problems in planar graphs, we solve both problems in O(n log n log log n) time via a divide-and-conquer algorithm that finds a shortest non-degenerate cycle. The kernel of our result is an O(n log log n)-time algorithm for computing noncrossing shortest paths among nodes well ordered on a common face of a directed plane graph, which is extended from the algorithm of Italiano, Nussbaum, Sankowski, and Wulff-Nilsen for an undirected plane graph. 1 Introduction Let G be an n-node m-edge simple graph with nonnegative edge weights. G is unweighted if the weights of all edges of G are identical. Let C be a subgraph of G. The weight w(C) of C is the sum of edge weights of C. Let G \ C denote the graph obtained from G by deleting the edges of C. Paths are allowed to repeat nodes throughout the paper. For nodes s and t, an st-path of G is a path of G from s to t and an st-cut of G is a subgraph C of G such that there are no st-paths in G \ C. A (global) cut of G is an st-cut of G for some nodes s and t of G. A cycle of G is an ss-path of G for some node s of G. • The minimum-cut problem on G seeks a cut of G with minimum weight. For instance, the v1 v3 -cut consisting of edge v2 v3 is the minimum cut of the graph in Figure 1(a). The 2 best known algorithm on directed G, due to Hao and Orlin [30], runs in O(mn log nm ) time. On undirected G, Nagamochi and Ibaraki [54] and Stoer and Wagner [61] solved the problem in O(mn + n2 log n) time and Karger [37] solved the problem in expected ∗ A preliminary version of this paper appeared as the master’s thesis of the first author [45]. The journal version appeared in SIAM Journal on Discrete Mathematics [46]. † Graduate Institute of Computer Science and Information Engineering, National Taiwan University. Email: sirbatostar@yahoo.com.tw. ‡ Corresponding author. Department of Computer Science and Information Engineering, National Taiwan University. This author also holds joint appointments in the Graduate Institute of Networking and Multimedia and the Graduate Institute of Biomedical Electronics and Bioinformatics, National Taiwan University. Address: 1 Roosevelt Road, Section 4, Taipei 106, Taiwan, ROC. Research of this author is supported in part by MOST grant 104–2221– E–002–044–MY3. Email: hil@csie.ntu.edu.tw. Web: www.csie.ntu.edu.tw/~hil. 1 6 v2 9 v4 v2 6 5 v1 f2 1 ⋆ v4 2 v3 (a) G v1 f3 6 7 7 ⋆ 5 1 f4 ⋆ ⋆ 5 f3 f4 1 2 ⋆ 8 f1 8 9 ⋆ ⋆ 9 7 f2 ⋆ ⋆ 8 v3 (b) G△ 2 ⋆ f1 (c) G∗△ Figure 1: (a) A simple planar graph G. (b) A simple bidirected plane graph G△ obtained from G by adding edges with weights ⋆ = 0 (respectively, ⋆ = ∞) if we are seeking a minimum cut (respectively, shortest cycle) of G. (c) The dual of G△ . O(m log3 n) time. Kawarabayashi and Thorup [38] recently announced the first known o(mn)-time algorithm on undirected unweighted G, improving upon the algorithm of Gabow [24] designed twenty years ago. • The shortest-cycle problem on G seeks a cycle of G with minimum weight. For instance, cycle v2 v3 v2 with weight 6 is the shortest cycle of the graph in Figure 1(a). Since a shortest directed cycle containing edge ts is obtainable from a shortest st-path, the problem on directed graphs can be reduced to computing all-pairs shortest paths in, e.g., O(mn + n2 log n) time [10]. Vassilevska Williams and Williams [65] argued that finding a truly subcubic algorithm for the problem might be hard. For directed (respectively, undirected) unweighted G, Itai and Rodeh [32] solved the problem in O(µ(n) log n) (respectively, O(min(mn, µ(n)))) time, where µ(n) = O(n2.373 ) [64] is the time for multiplying two n × n matrices. If G is undirected and planar, Chalermsook, Fakcharoenphol, and Nanongkai [8] showed that the time complexity of both aforementioned problems on G is O(log n) times that of finding an st-cut of G with minimum weight for any given nodes s and t. Plugging in the O(n log n)-time algorithms, e.g., of Frederickson [23], Borradaile and Klein [1], and Erickson [14], the reduction of Chalermsook et al. solved both problems in O(n log2 n) time. Plugging in the O(n log log n)time algorithm of Italiano, Nussbaum, Sankowski, and Wulff-Nilsen [33], the reduction of Chalermsook et al. solved both problems in O(n log n log log n) time. The best known result for both problems on G is the O(n log log n)-time algorithm of Łacki ˛ and Sankowski [44], relying upon the st-cut oracle of Italiano et al. [33]. This paper addresses both problems for the case that G is directed and planar. While the minimum-cut problem has been thoroughly studied for undirected planar graphs, surprisingly no prior work is specifically for directed planar graphs. Djidjev [12] claimed that his technique for unweighted undirected planar graphs solves the shortest-cycle problem on unweighted directed planar G in O(n3/2 ) time and left open the problem of finding a shortest cycle in unweighted directed planar G in o(n3/2 ) time. Weimann and Yuster [67] gave an O(n3/2 )-time algorithm for the shortest-cycle problem, which should be adjustable to solve the minimum-cut problem also in O(n3/2 ) time (via similar techniques to our proof for Lemma 4.2 in §4 to handle degeneracy in shortest cycles). Wulff-Nilsen [68] reduced the time for the shortest-cycle problem on G to O(n log3 n), but it is unclear how to adjust his algorithm to solve the minimum-cut problem without increasing the required time by too much. The algorithm of Łacki, ˛ Nuss2 baum, Sankowski, and Wulff-Nilsen [43] for single-source all-sinks maximum flows solves the minimum-cut problem on directed planar G in O(n log3 n) time. Below is our result: Theorem 1.1. It takes O(n log n log log n) time to solve the minimum-cut and shortest-cycle problems on an n-node simple directed planar graph with nonnegative edge weights. As pointed out by anonymous reviewers, Mozes, Nikolaev, Nussbaum, and Weimann [51] recently announced an O(n log log n)-time algorithms for the minimum-cut problem. However, unlike our Theorem 1.1, their algorithm requires the condition that there is a unique shortest path between any two nodes. For general directed planar graphs with nonnegative edge weights, they apply an isolation lemma [50, 53] to perturb the edge weights to meet the condition with high probability. Thus, their results are Monte Carlo randomized algorithms. Related work The only known nontrivial linear-time algorithm for the shortest-cycle problem, due to Chang and Lu [9], works on undirected unweighted planar graphs. For undirected G, if G is embedded on an orientable surface of genus g, Erickson, Fox, and Nayyeri [15] solved the problem in gO(g) n log log n time, based on the algorithm of Łacki ˛ and Sankowski [44] for undirected planar graphs. If G is undirected and unweighted and is 2-cell embedded on an orientable surface of genus g = O(nα ) with 0 < α < 1, Djidjev [12] solved the problem in O(g3/4 n5/4 log n) time. On undirected unweighted O(1)-genus G, Weimann and Yuster [67] solved the problem in O(n log n) time. For directed planar G, even if G is unweighted, our Theorem 1.1 remains the best known algorithm. If G is unweighted and embedded on a genus-g surface, the technique of Djidjev [12] solved the problem in O(g 1/2 n3/2 ) time. The shortest-cycle problem on G with negative edge weights can be reduced to one with nonnegative edge weights using the standard reweighting technique via a shortest-path tree in G (e.g., [20, 25, 27, 42, 52]). Cygan, Gabow, and Sankowski [11] studied the problem on graphs whose edge weights are bounded integers. Yuster [69] studied the version on undirected G asking for each node a shortest cycle containing the node. See e.g., [5, 6, 7, 16, 19, 21, 22] for algorithms that compute shortest cycles with prescribed topological properties. See, e.g., [32, 47, 49, 59, 60, 70] for approximation algorithms of the shortest-cycle problem. The closely related problem that seeks a minimum st-cut for given nodes s and t and its dual problem that seeks a maximum st-flow have been extensively studied even for only planar graphs (see, e.g., [1, 14, 39, 66]). A minimum st-cut of G can be obtained in O(m + n) time from a maximum st-flow f of G by identifying the edges from the nodes of G reachable from s to the nodes of G not reachable from s in the residual graph of G with respect to f . No efficient reductions for the other direction are known. Orlin [55] gave the only known O(mn)-time algorithms for the maximum st-flow problem on general graphs with integral edge weights. For undirected planar G, Reif [58] gave an O(n log2 n)-time algorithm for the minimum st-cut problem. Frederickson [23] improved the time complexity of Reif’s algorithm to O(n log n). The best known algorithms for both problems, due to Italiano et al. [33], run in O(n log log n) time. The attempt of Janiga and Koubek [34] to generalize Reif’s algorithm to directed planar G turned out to be flawed [17, 36, 51]. Borradaile and Klein [1] and Erickson [14] gave O(n log n)time algorithms for both problems on directed planar graphs. On directed planar unweighted G, Brandes and Wagner [4] and Eisenstat and Klein [13] solved both problems in O(n) time. The algorithm of Kaplan and Nussbaum [36] is capable of exploiting the condition that nodes s and t are close. For directed planar G, the O(n log3 n)-time algorithm of Łacki ˛ et al. [43] obtains the minimum weights of st-cuts for any given s and all nodes t of G. For any given node subsets S and T of directed planar G, the O(n log3 n)-time algorithm of Borradaile, Klein, Mozes, 3 Nussbaum, and Wulff-Nilsen [2] computes a subgraph C of G with minimum weight such that there is no st-path in G \ C for any s ∈ S and t ∈ T . On undirected planar G, Borradaile, Sankowski, and Wulff-Nilsen [3] gave an O(n log4 n)-time algorithm to compute a GomoryHu cut-equivalent tree [28], a compact representation of st-cuts with minimum weights for all nodes s and t. The kernel of our result is an O(n log log n)-time algorithm for computing noncrossing shortest paths among nodes well ordered on a common face of a directed plane graph, which is extended from the algorithm of Italiano et al. [33] for an undirected plane graph. A closely related NP-hard shortest-noncrossing-paths problem seeks noncrossing paths between k given terminal pairs on h faces with minimum total weight in a plane graph. Takahashi, Suzuki, and Nishizeki [63] solved the problem for undirected plane graphs with h ≤ 2 in O(n log k) time. Papadopoulou [56] addressed the geometric version of the problem, where the terminal pairs are on the boundaries of h polygonal obstacles in the plane with complexity n and gave an O(n)-time algorithm for the case h ≤ 2. Erickson and Nayyeri [18] generalized the result of 2 Takahashi et al., solving the problem for undirected planar graphs in 2O(h ) n log k time. They 2 also generalized the result of Papadopoulou to solve the geometric version in 2O(h ) n time. Each of these algorithms computes an implicit representation of the answers, which may have total size Ω(kn). Polishchuk and Mitchell [57] addressed the problem of finding noncrossing thick paths with minimum total weight. Takahashi, Suzuki, and Nishizeki [62] also considered the rectilinear version of the problem. Technical overview and outline Our proof for Theorem 1.1 consists of a series of reductions. Based upon the duality between simple cycles and minimal cuts in plane graphs, Section 2 gives an O(n)-time reduction from the minimum-cut and shortest-cycle problems in an n-node planar graph to the problem of finding a shortest non-degenerate cycle in an n-node O(1)-degree plane graph G (Lemma 2.1). Let C be a balanced separator of G that corresponds to a fundamental cycle with respect to a shortest-path tree of G. A shortest non-degenerate cycle that does not cross C can be recursively computed from the subgraphs of G separated by C. Although we cannot afford to compute a shortest non-degenerate cycle that crosses C, Section 3 reduces the problem of finding a shortest non-degenerate cycle to finding a C-short cycle, i.e., a non-degenerate cycle that crosses C with the property that if it is not shortest, then a shortest non-degenerate cycle that does not cross C has to be a shortest non-degenerate cycle of G (Lemma 3.1). This reduction is a divide-and-conquer recursive algorithm using the balanced separator C and thus introduces an O(log n)-factor overhead in the running time. A cycle of G that crosses a shortest path P of G can be shortcutted into a non-degenerate cycle that crosses P at most once. Section 4 reduces the problem of finding a C-short cycle to that of finding a (C, P )-short cycle, i.e., a non-degenerate cycle whose weight is no more than that of any non-degenerate cycle that crosses a shortest path P of G in C exactly once (Lemma 4.2). By the technique of Reif [58] that incises G along P , Section 4 further reduces the problem of finding a (C, P )-short cycle to that of finding shortest noncrossing paths among nodes well ordered on the boundary of external face (Lemma 4.1). As a matter of fact, this shortest-noncrossing-paths problem can be solved by the O(n log n)-time algorithm of Klein [40], already yielding improved O(n log2 n)-time algorithms for the minimum-cut and shortest-cycle problems. (Mozes et al. [51] also mentioned that O(n log2 n)-time algorithms can be obtained by plugging in the O(n log n)-time minimum st-cut algorithm of Borradaile and Klein [1] into a directed version of the reduction algorithm of Chalermsook et al. [8].) To achieve the time complexity of Theorem 1.1, Section 5 solves the problem in O(n log log n) time by extending the algorithm of Italiano et al. [33] for an undi4 rected plane graph. Section 6 concludes the paper. 2 Reduction to finding shortest non-degenerate cycles Directed graph G is bidirected if, for any two nodes s and t of G, st is an edge of G if and only if ts is an edge of G. The graph in Figure 1(a) is not bidirected. The degree of node v in bidirected G is the number of neighbors of v in G. The degree of bidirected G is the maximum degree of the nodes in G. A bidirected plane graph is a bidirected planar graph equipped with a plane embedding in which edges between two adjacent nodes are bundled together. Figures 1(b) and 1(c) show two bidirected plane graphs G△ and G∗△ . A cycle passing each node at most once is simple. A cycle is degenerate if it is a node or passes both edges st and ts for two nodes s and t. A cycle not simple (respectively, degenerate) is non-simple (respectively, non-degenerate). Cycle C1 in Figure 2(a) is non-degenerate and non-simple. In the graph G of Figure 1(a), cycle v2 v3 v2 is degenerate and simple, cycle v2 v3 v4 v2 is non-degenerate and simple, and cycle v1 v2 v4 v2 v3 v1 is degenerate and non-simple. The shortest degenerate cycle of G is v2 v3 v2 with weight 6. The shortest non-degenerate cycle of G is v2 v3 v4 v2 with weight 16. Theorem 1.1 can be proved by the following lemma: Lemma 2.1. It takes O(n log n log log n) time to compute a shortest non-degenerate cycle in an n-node O(1)-degree simple bidirected plane graph with nonnegative edge weights. Proof of Theorem 1.1. Adding edges with weights 0 (respectively, ∞) to the input graph does not affect the weight of minimum cuts (respectively, shortest cycles). Hence, we may assume without loss of generality that the input graph G△ has at least four nodes and is a simple bidirected plane graph such that each face of G△ is a triangle. See Figures 1(a) and 1(b) for examples. Let the dual G∗△ of G△ be the simple bidirected plane graph on the 2n − 4 faces of G△ sharing the same set of 6n − 12 edges with G△ that is obtainable in O(n) time from G△ as follows: For any two adjacent nodes s and t of G△ , there are directed edges f g = st and gf = ts in G∗△ , where f and g are the two faces of G△ incident with the bundled edges between s and t such that face g immediately succeeds face f in clockwise order around node s of G△ . See Figure 1(c) for an example. Observe that C is a minimal cut of G△ if and only if C is a simple non-degenerate cycle of G∗△ . By nonnegativity of edge weights, a shortest non-degenerate cycle of G∗△ is a minimum cut of G△ . For instance, the shortest non-degenerate cycle of the graph G∗△ in Figure 1(c) is f1 f4 f3 f1 with weight 5. It corresponds to the v1 v3 -cut {v1 v3 , v2 v3 , v4 v3 } of G△ , which in turn corresponds to the minimum cut {v2 v3 } of G. Although the degenerate cycle f1 f4 f1 is a shortest cycle of G∗△ , it does not correspond to a cut of G in the above manner. Since each node of G∗△ has exactly three neighbors, the statement of the theorem for the minimum-cut problem follows from applying Lemma 2.1 on G∗△ . By nonnegativity of edge weights, it takes O(n) time to obtain a shortest degenerate cycle of G△ by examining the O(n) degenerate cycles of G△ on exactly two nodes. By Lemma 2.1, the statement of the theorem for the shortest-cycle problem is immediate from the following claim: It takes O(n) time to obtain from G△ an O(n)-node O(1)-degree simple bidirected plane graph G such that a shortest non-degenerate cycle of G△ can be computed from a shortest non-degenerate cycle of G in O(n) time. Let G1 and G2 be simple bidirected plane graphs with nonnegative edge weights such that G2 is obtained from G1 by the following O(d)-time operation on a degree-d node v of G1 with d ≥ 4: If u1 , . . . , ud are the neighbors of v in G1 in clockwise order around v, then S PLIT (v) 5 u1 u2 1 2 0 5 0 0 v 8 5 v1 3 6 v4 u3 u4 (a) G1 , C1 , and C1∗ 3 0 0 7 0 v2 0 0 0 4 7 0 0 0 0 u2 2 1 0 0 u4 u1 0 v3 0 8 0 4 6 u3 (b) G2 , C2∗ , and C2 Figure 2: Bidirected plane graphs G1 and G2 and their edge weights are in black solid lines. Shortest non-degenerate cycles C1 = u1 vu2 u3 vu4 u1 and C2∗ = u1 v1 v2 u2 u3 v3 v4 u4 u1 are in blue dashed lines. Shortest non-degenerate cycles C1∗ = u1 vu4 u1 and C2 = u1 v1 v2 v3 v4 u4 u1 are in red dotted lines. • • • • adds zero-weight path v1 v2 · · · vd−1 vd vd−1 · · · v2 v1 with new nodes v1 , . . . , vd , replaces edge ui v by edge ui vi with the same weight for each i = 1, . . . , d, replaces edge vui by edge vi ui with the same weight for each i = 1, . . . , d, and deletes v. See Figure 2 for an example of G1 and G2 . An O(n)-node O(1)-degree simple bidirected plane graph G can be obtained in O(n) time from G△ by iteratively applying S PLIT on each node v of G△ with degree d ≥ 4. To prove the claim, it suffices to ensure the following statement: A shortest non-degenerate cycle C1 of G1 is obtainable in O(d) time from a shortest nondegenerate cycle C2∗ of G2 . For each ui uj -path P of C2∗ with 1 ≤ i 6= j ≤ d such that P has at least two edges and all internal nodes of P are in {v1 , . . . , vd }, we replace P by path ui vuj . By w(P ) = w(ui vuj ), we have w(C1 ) = w(C2∗ ). Since C2∗ is non-degenerate, so is the resulting O(d)-time obtainable cycle C1 of G1 . Since C1 may pass v more than once, C1 could be non-simple. See Figure 2 for an example of C2∗ and C1 . It remains to show w(C1 ) = w(C1∗ ) for any shortest simple non-degenerate cycle C1∗ of G1 . By nonnegativity of edge weights, we have w(C1 ) ≥ w(C1∗ ) even if C1 is non-simple. Let C2 be the cycle of G2 that is obtained from C1∗ as follows: If there is a path ui vuj with 1 ≤ i 6= j ≤ d in C1∗ , then replace it by path ui vi · · · vj uj . By w(ui vuj ) = w(ui vi · · · vj uj ), we have w(C2 ) = w(C1∗ ). Otherwise, let C2 = C1∗ . Since C1∗ is simple, there is at most one path ui vuj in C1∗ . Since C1∗ is non-degenerate, so is C2 . See Figure 2 for an example of C1∗ and C2 . By w(C1 ) = w(C2∗ ) ≤ w(C2 ) = w(C1∗ ), C1 is a shortest nondegenerate cycle of G1 . The rest of the paper proves Lemma 2.1. 3 Divide-and-conquer via balanced separating cycles Let C be a simple non-degenerate cycle of a bidirected plane graph G with nonnegative edge weights. Let intG (C) (respectively, extG (C)) denote the subgraph of G consisting of the nodes and edges on the boundary of the faces of G inside (respectively, outside) of C. A nondegenerate cycle C3 of G is C-short if one of C1 , C2 , and C3 is a shortest non-degenerate cycle 6 v1 v1 2 1 4 v2 1 2 1 1 4 v5 v2 2 1 3 2 1 3 9 9 1 1 1 2 v4 4 9 v5 2 3 v3 9 v6 1 2 1 2 2 1 1 3 2 v3 v7 v6 9 1 v8 0 0 2 v4 4 9 1 9 1 9 v7 0 (b) H (a) G, C, and C ∗ Figure 3: (a) The bidirected plane graph G and its edge weights are in black. The blue dashed cycle C = v1 v2 v3 v4 v5 v1 is a segmented cycle of G whose segments are shortest paths P1 = v1 v2 v3 and P2 = v1 v5 v4 of G. The shortest non-degenerate cycle of intG (C) is v1 v2 v5 v1 with weight 5. The shortest non-degenerate cycle of extG (C) is v2 v6 v7 v5 v4 v3 v2 with weight 7. The red dotted cycle C ∗ = v2 v6 v7 v5 v2 with weight 4 is the unique C-short non-degenerate cycle of G and the unique shortest non-degenerate cycle of G. (b) A bidirected plane graph H. of G, where C1 (respectively, C2 ) is a shortest non-degenerate cycle of intG (C) (respectively, extG (C)). We say that C is segmented if it consists of the following three paths in order: (1) a shortest path P1 , (2) an edge, and (3) the reverse of a shortest path P2 , where one of P1 and P2 is allowed to be a node. Let shortest paths P1 and P2 be the segments of C. See Figure 3(a) for an example. This section proves Lemma 2.1 using Lemmas 3.1, 3.2, and 3.3. Section 4 proves Lemma 3.1. Lemma 3.1. Let G be an n-node O(1)-degree simple bidirected plane graph with nonnegative edge weights. Given a segmented simple non-degenerate cycle C of G together with its segments, it takes O(n log log n) time to compute a C-short non-degenerate cycle of G. Lemma 3.2 (Henzinger, Klein, Rao, and Subramanian [31]). It takes O(n) time to compute a shortest-path tree rooted at any given node of an n-node connected simple directed planar graph with nonnegative edge weights. Lemma 3.3 (Lipton and Tarjan [48], Goodrich [29], Klein, Mozes, and Sommer [41, Lemma 1]). Let G△ be an n-node simple undirected plane triangulation with nonnegative face weights summing to 1 such that the weight of each face of G△ is at most 41 . Given any spanning tree T of G△ , it takes O(n) time to obtain an edge e of G△ \ T such that the total weight of the faces of G△ inside (respectively, outside) of the simple cycle in T ∪ {e} is no more than 34 . Proof of Lemma 2.1. We give a divide-and-conquer recursive algorithm on the input graph H, which can be assumed to be connected without loss of generality. For each degree-2 node y whose neighbors x and z are non-adjacent, we replace y and its incident edges by edges xz and zx with weights w(xy) + w(yz) and w(zy) + w(yx), respectively. The resulting graph G obtainable in O(n) time from H remains an O(1)-degree simple connected bidirected plane graph. See Figure 3 for an example of H and G. Let ℓ be the number of faces in G. Since each maximal simple path on the degree-2 nodes of G has O(1) edges, G has O(ℓ) nodes. A shortest non-degenerate cycle of H can be obtained in O(n) time from a shortest non-degenerate cycle of G, which can be found in O(1) time for the case with ℓ ≤ 4. 7 v1 v1 4 v2 1 1 6 1 v5 v2 2 2 3 v6 0 2 9 2 1 6 1 1 6 2 v4 4 9 0 1 3 v3 v5 0 1 1 1 6 2 1 9 9 v3 v4 0 v7 1 6 1 6 v6 v7 0 (a) G and T (a) G△ and T0 Figure 4: (a) The bidirected plane graph G having 6 faces and its edge weights are in black. A shortest-path tree T rooted at v1 is in blue dashed lines. (b) The plane triangulation G△ consists of all edges. The numbers are weights of the faces of G△ . The undirected version G0 of G consists of the black solid edges and the blue dashed edges. The undirected version T0 of T is in blue dashed lines. The edges in G△ \ G0 are in red dotted lines. To obtain a shortest non-degenerate cycle of G for the case with ℓ ≥ 5, let T be an O(n)-time obtainable shortest-path tree of G rooted at an arbitrary node as ensured by Lemma 3.2. For each face f of the simple undirected unweighted version G0 of G having size k ≥ 3, (1) let f be triangulated into k − 2 faces via adding k − 3 edges without introducing multiple edges, (2) let an arbitrary one of the k − 2 faces be assigned weight 1ℓ , and (3) let the remaining k − 3 faces be assigned weights 0. Let G△ be the resulting simple plane triangulation. The undirected version T0 of T is a spanning tree of G0 and G△ . See Figure 4 for an example. Lemma 3.3 ensures an edge xy of G△ \ T0 obtainable in O(n) time such that the face weights of G△ inside (respectively, outside) of the simple cycle of T0 ∪ {xy} sum to at most 34 . For instance, such an edge xy in the example in Figure 4 is v3 v4 . If x and y are adjacent in G, then let E = ∅; otherwise, let E consist of edges xy and yx with weights ∞. We union G and E to obtain a simple bidirected plane graph G∗ . Let s be the least common ancestor of x and y in T . Let C be the segmented simple non-degenerate cycle of G∗ consisting of (1) the sx-path of T , (2) edge xy, and (3) the reverse of the sy-path of T . By Lemma 3.1, it takes O(n log log n) time to compute a C-short cycle C3 of G∗ . Let H1 = intG∗ (C) \ E and H2 = extG∗ (C) \ E. No matter E = ∅ or not, H1 and H2 are subgraphs of G . We recursively compute a shortest non-degenerate cycle C1 (respectively, C2 ) in H1 (respectively, H2 ), which is also a shortest non-degenerate cycle of intG∗ (C) (respectively, extG∗ (C)). By definition of C3 , a cycle C ∗ in {C1 , C2 , C3 } with minimum weight is a shortest non-degenerate cycle of G∗ . If C ∗ passes an edge in E 6= ∅, then the weight of each non-degenerate cycle of G∗ and G is ∞. Otherwise, we return C ∗ as a shortest non-degenerate cycle of G. The algorithm runs in O(n log log n) time without accounting for the time for its subsequent recursive calls. By ℓ ≥ 5, the number ℓ1 19 ℓ, implying that there (respectively, ℓ2 ) of faces in H1 (respectively, H2 ) is at most 43 ℓ + 1 ≤ 20 are O(log n) levels of recursion. By ℓ1 + ℓ2 ≤ ℓ + 2, the overall number of faces in each recursion level is O(n), implying that the overall number of nodes in each recursion level is O(n). The algorithm runs in O(n log n log log n) time. 8 0 0 3 1 s 1 5 0 u1 1 1 6 1 u2 1 1 t u2 9 1 1 (a) G 8 6 9 1 9 v 0 0 8 0 0 u 1 8 0 6 v t ∞ ∞ 8 9 6 v1 1 3 1 5 1 ∞ 1 3 5 1 ∞ s 1 u1 1 5 u 1 1 3 v2 ∞ ∞ (b) H Figure 5: (a) With P = su1 u2 t and C = su1 u2 tvs, the red dotted cycle u1 u2 uvu1 and the blue dashed cycle u1 vuu2 u1 are (C, P )-cycles of G with minimum weight 2. (b) H is obtained from incising G along P . 4 Non-degenerate cycles that cross the separating cycle This section proves Lemma 3.1 by Lemma 4.2, which is proved by Lemmas 3.2 and 4.1. Section 5 proves Lemma 4.1. If graph G has uv-paths, then let dG (u, v) denote the weight of a shortest uv-path of G. If G has no uv-paths, then let dG (u, v) = ∞. Lemma 4.1. Let G be an n-node simple connected bidirected plane graph with nonnegative edge weights. Let u1 , . . . , uℓ , vℓ , . . . , v1 be O(n) nodes on the boundary of the external face of G in order. It takes overall O(n log log n) time to compute dG (ui , vi ) for each i = 1, . . . , ℓ. Let G be a simple bidirected plane graph. A simple path Q of G aligns with subgraph H of G if Q or the reverse of Q is a path of H. A simple path Q of G passing at least one edge deviates from subgraph H of G if the edges and the internal nodes of Q are not in H. For any simple path P of G, a non-degenerate cycle of G is a P -cycle if it consists of a path aligning with P and a path deviating from P . For any simple non-degenerate cycle of G and any path P of G aligning with C, a P -cycle is a (C, P )-cycle if the first edge of its path deviating from P is in intG (C) if and only if the last edge of its path deviating from P is in extG (C). For instance, the C ∗ in Figure 3(a) is a P1 -cycle of G whose path aligning with P1 is node v2 . The first edge v2 v6 (respectively, last edge v5 v2 ) of its path deviating from P1 is in extG (C) (respectively, intG (C)), so C ∗ is a (C, P1 )-cycle of G. C ∗ is also a (C, P2 )-cycle. A non-degenerate cycle of G is (C, P )-short if its weight is no more than that of any (C, P )-cycle of G. Lemma 4.2. Let G be an n-node O(1)-degree simple bidirected plane graph with nonnegative edge weights. Let C be a simple non-degenerate cycle of G. Given a path P of G aligning with C, it takes O(n log log n) time to compute a (C, P )-short cycle of G. Proof. Let C ∗ be a (C, P )-cycle of G with minimum weight. For instance, the red and blue cycles in Figure 5(a) are two (C, P )-cycles with minimum weight 2. Let C0 be a shortest nondegenerate cycle of G passing at least one endpoint of P , which can be obtained in O(n) time via examining shortest uv-paths in G\{uv, vu} by Lemma 3.2 for all O(1) edges uv of G incident to at least one endpoint of P . If C ∗ passes some endpoint of P , then w(C0 ) ≤ w(C ∗ ), implying 9 Pi R2 P1 P2 P1 u1 P2 v2 R1 Q2 Q1 v1 u2 (a) (b) (c) Figure 6: (a) The red dotted P1 -cycle not intersecting P2 is in intG (C). The blue dashed P2 cycle not intersecting P1 is in extG (C). (b) The red dotted cycle consists of Q1 , R1 , Q2 , and R2 in order is a (C, P1 )-cycle. (c) The degenerate cycle C ′ is obtained from the non-degenerate red dotted cycle C ∗ by replacing the u1 v1 -path of C ∗ with the blue dashed u1 v1 -path of Pi . The green dash-dotted cycle C ′′ is a non-degenerate cycle contained by C ′ . that C0 is a cycle ensured by the lemma. The rest of the proof assumes that C ∗ does not pass any endpoint of P . Thus, P has internal nodes. Let H be an O(n)-node O(1)-degree simple bidirected plane graph obtainable in O(n) time as follows: Suppose that u0 , . . . , uℓ+1 with ℓ ≥ 1 are the nodes of P in order. Let s = v0 = u0 and t = vℓ+1 = uℓ+1 . We incise G along P by • adding new nodes v1 , . . . , vℓ , a new path P ′ = sv1 · · · vℓ t and the reverse of P ′ , • for each i = 1, . . . , ℓ, letting each edge vui (respectively, ui v) incident to ui in intG (C) \ P be replaced by vvi (respectively, vi v) with the same weight, • letting the weight of each edge in P ′ and the reverse of P ′ be ∞, and • embedding the resulting graph H such that P and P ′ are on the external face. See Figure 5 for an example. By Lemma 4.1, it takes overall O(n log log n) time to compute dH (ui , vi ) and dH (vi , ui ) for each i ∈ {1, . . . , ℓ}. Let i1 (respectively, i2 ) be an i ∈ {1, . . . , ℓ} that minimizes dH (ui , vi ) (respectively, dH (vi , ui )). By Lemma 3.2, it takes O(n) time to obtain a simple shortest ui1 vi1 -path P1 of H and a simple shortest vi2 ui2 -path P2 of H. The weight of P1 (respectively, P2 ) is minimum over all ui vi -paths (respectively, vi ui -paths) of H with 1 ≤ i ≤ ℓ. Let C1 (respectively, C2 ) be the non-degenerate cycle of G corresponding to P1 (respectively, P2 ). Let Q be the path of C ∗ that deviates from P . Let ui and uj with 1 ≤ i, j ≤ ℓ be the first and last nodes of Q, respectively. If the first edge of Q is in intG (C), then C ∗ corresponds to a vi ui -path of H, implying w(C2 ) ≤ w(C ∗ ). If the last edge of Q is in intG (C), then C ∗ corresponds to a uj vj -path of H, implying w(C1 ) ≤ w(C ∗ ). For instance, the red (respectively, blue) cycle of G in Figure 5(a) corresponds to the red u1 v1 -path (respectively, blue v1 u1 -path) of H in Figure 5(b). Thus, one of C0 , C1 , and C2 with minimum weight is a cycle ensured by the lemma. Proof of Lemma 3.1. Let G1 = intG (C) and G2 = extG (C). Let P1 and P2 be the given segments of C. Let C ∗ be a shortest non-degenerate cycle of G whose number of edges not in P1 ∪ P2 is minimized over all shortest non-degenerate cycles of G. If C ∗ is a cycle of G1 or G2 , then 10 any cycle of G is C-short, including the one ensured by Lemma 4.2. The rest of the proof assumes that neither G1 nor G2 contains C ∗ . By Lemma 4.2, it suffices to ensure that C ∗ is a (C, P1 )-cycle. We need the following claim: For each i ∈ {1, 2}, if C ∗ ∩ Pi 6= ∅, then C ∗ is a Pi -cycle of G. By the claim, C ∗ intersects both P1 and P2 or else C ∗ would be a cycle of G1 or G2 , as illustrated by Figure 6(a), contradicting the assumption. Since C ∗ is a P1 -cycle and a P2 -cycle, C ∗ consists of four paths Q1 , R1 , Q2 , and R2 in order such that Qi aligns with Pi and Ri deviates from P1 ∪ P2 for each i ∈ {1, 2}. By the assumption, if R1 ⊆ Gi and R2 ⊆ Gj , then {i, j} = {1, 2}. Thus, C ∗ is a (C, P1 )-cycle. See Figure 6(b) for an illustration. It remains to prove the claim. Assume for contradiction that C ∗ intersects Pi but is not a Pi -cycle for an index i ∈ {1, 2}. There are nodes u1 , v1 , u2 , v2 of Pi with u1 6= v1 and u2 6= v2 such that • • • • u1 precedes v1 in Pi , u2 succeeds v2 in Pi , the u1 v1 -path and the u2 v2 -path of C ∗ deviate from Pi , and the u1 v1 -path of C ∗ deviates from the u2 v2 -path of C ∗ . Let C ′ be the cycle of G obtained from C ∗ by replacing the u1 v1 -path of C ∗ with the u1 v1 path of Pi . Since Pi is a shortest path of G, w(C ′ ) ≤ w(C ∗ ). Since C ∗ is non-degenerate, the reverse of each of the u2 v2 -path of C ′ is not in C ′ . Thus, even if C ′ is degenerate, there is a nondegenerate cycle C ′′ in C ′ . See Figure 6(c) for an illustration. By nonnegativity of edge weights, w(C ′′ ) ≤ w(C ′ ). By w(C ′′ ) ≤ w(C ∗ ), C ′′ is a shortest non-degenerate cycle of G whose number of edges not in P1 ∪ P2 is fewer than the number of edges of C ∗ not in P1 ∪ P2 , contradicting the definition of C ∗ . 5 Noncrossing shortest paths among nodes on external face This section proves Lemma 4.1 via extending techniques of Reif [58] and Italiano et al. [33] for undirected planar graphs. Algorithms for r-divisions (Lemma 5.1) and dense-distance graphs (Lemma 5.2) are reviewed in §5.1. Data structures for fast-Dijkstra algorithm (Lemma 5.5) are given in §5.2. Data structures that enables efficient partition of boundary nodes via noncrossing paths (Lemma 5.6) are given in §5.3. Tools involving noncrossing shortest paths (Lemma 5.8) are given in §5.4. Lemma 4.1 is proved by Lemmas 3.2, 5.1, 5.2, 5.5, 5.6, and 5.8 in §5.5. 5.1 Dense-distance graph Let G be a simple bidirected plane graph. A division D of G is an edge-disjoint partition of G into bidirected plane subgraphs, each of which is a piece of D. The multiplicity of node v of G in D is the number of pieces of D containing v. A node of G with multiplicity two or more in D is a boundary node of D. A face of a piece of D is a hole of the piece if it is not a face of G. For any r > 0, an r-division (see, e.g., [23, 31, 33, 41, 44]) of G is a division of G with O(n/r) pieces, √ each having O(r) nodes, O( r) boundary nodes, and O(1) holes. Lemma 5.1 (Klein, Mozes, and Sommer [41]). For any r > 0, it takes O(n) time to compute an r-division for an n-node simple bidirected plane graph each of whose faces contains at most three nodes. 11 9 1 y1 1 1 1 1 9 x2 1 3 3 5 5 2 2 2 2 2 2 1 9 x3 2 1 1 1 4 4 2 x3 4 3 x1 1 9 9 4 y2 1 1 x1 1 x2 3 1 y1 9 4 y2 4 (b) K(H) (a) H Figure 7: (a) A piece H in which x1 , x2 , and x3 are the boundary nodes in one hole and y1 and y2 the boundary nodes in the other hole. (b) K(H). Let D be an r-division of G. For any connected component H of any piece of D, let K(H) denote the complete directed graph on the boundary nodes of D in H in which w(uv) = dH (u, v). See Figure 7 for an example. The dense distance graph (see, e.g., [33]) K(D) of D is √ the O(n)-edge simple directed graph on the O(n/ r) boundary nodes of D simplified from the union of K(H) over all connected components H of all pieces of D by keeping exactly one copy of parallel edges with minimum weight. For any edge uv of K(D), an underlying uv-path is a uv-path in some connected component H of some piece of D with weight equal to w(uv) in K(D). For any path Π of K(D), an underlying path of Π consists of an underlying uv-path for each edge uv of Π. Lemma 5.2 (Klein [40]). For any given r-division D of an n-node simple bidirected plane graph with nonnegative edge weights, it takes O(n log r) time to compute K(D) and a data structure from which, for any path Π of K(D), the first c edges of an underlying path of Π can be obtained in O(c log log r) time. 5.2 Fast-Dijkstra algorithm Consider the following equation w(u1 v1 ) + w(u2 v2 ) ≤ w(u1 v2 ) + w(u2 v1 ) (1) for distinct nodes u1 , u2 , v1 , v2 of a simple directed graph H with edge weights. A type-1 Monge unit is a complete H equipped with a cyclic ordering for the nodes of H such that Equation (1) holds for any distinct nodes u1 , u2 , v2 , v1 of H in order. A type-2 Monge unit is a complete bipartite H equipped with an ordering for each of the two maximal independent sets of H such that Equation (1) holds for any distinct nodes u1 and u2 of one independent set in order and any distinct nodes v1 and v2 of the other independent set in order. A Monge decomposition of a simple directed graph K with edge weights is a set M of Monge units on node subsets of K such that K is the graph simplified from the union of the Monge units in M . The multiplicity of a node v of K in M is the number of Monge units in M that contain v. The size of M is the sum of the multiplicities of all nodes of K in M . An equivalent 12 x2 x2 x1 x3 2 2 3 6 5 5 x1 x3 2 7 2 2 2 y1 3 2 2 2 6 5 5 2 2 2 2 2 2 y2 y1 (a) y2 (b) Figure 8: Each of the two graphs can be simplified from the union of two type-2 Monge units. form of the following lemma is proved by Mozes and Wulff-Nilsen [52, §4.4] using the algorithm of Klein [40] and used by Kaplan, Mozes, Nussbaum, and Sharir [35, §5.2]. Specifically, for any hole C of a piece H of D, the complete graph on the nodes of C with w(uv) = dH (u, v) for any nodes u and v in C equipped with the cyclic ordering of C is a type-1 Monge unit. For instance, the subgraphs of K(H) in Figure 7(b) induced by {x1 , x2 , x3 } and {y1 , y2 } equipped with their cyclic orders on the holes are two type-1 Monge units. For any two holes C1 and C2 of a piece H of D, Mozes et al. showed that the complete bipartite graph on the nodes of C1 and C2 with w(uv) = dH (u, v) for nodes u and v such that each of C1 and C2 contains exactly one of u and v can be simplified from the union of O(1) type-2 Monge units. For instance, the subgraph of K(H) in Figure 7 consisting of edges between {x1 , x2 , x3 } and {y1 , y2 } can be simplified from the union of the graphs in Figures 8(a) and 8(b). The edges of the graph in Figure 8(a) from hx1 , x2 , x3 i (respectively, hy2 , y1 i) to hy1 , y2 i (respectively, hx3 , x1 , x2 i) form a type-2 Monge unit. The edges of the graph in Figure 8(b) from hx3 , x1 , x2 i (respectively, hy1 , y2 i) to hy1 , y2 i (respectively, hx3 , x1 , x2 i) form a type-2 Monge unit. Lemma 5.3. For any given r-division D of an n-node simple bidirected plane graph with nonnegative edge weights, it takes O(n log r) time to obtain a Monge decomposition M (D) of K(D) such that the multiplicity of a node of K(D) in M (D) is O(1) times its multiplicity in D. As summarized in the following lemma, given a size-m Monge decomposition of graph K, there are O(m log2 m)-time obtainable data structures for range minimum queries (see, e.g., Kaplan et al. [35] and Gawrychowski, Mozes, and Weimann [26]) with which the fast-Dijkstra algorithm of Fakcharoenphol and Rao [20] outputs a shortest-path tree of K in O(m log2 m) time. Lemma 5.4. Given a size-m Monge decomposition of a simple strongly connected directed graph K with nonnegative edge weights, it takes O(m log2 m) time to compute a shortest-path tree of K rooted at any given node. Lemma 5.5. Let D be a given r-division of an n-node simple plane graph with nonnegative edge weights. It takes O(n log r) time to compute a data structure from which, for any subset X of the boundary nodes of D such that the subgraph K of K(D) induced by X is strongly connected, it takes O(m log2 m) time to compute a shortest-path tree of K rooted at any given node, where m is the sum of the multiplicities of the nodes of X in D. Proof. Let M (D) be a Monge decomposition of K(D) as ensured by Lemma 5.3. Let M consist of the subgraph H[X] of H induced by X for each Monge unit H in M (D). Each H[X] remains 13 4 u1 2 1 2 x 1 v1 6 1 1 y 2 1 0 3 u2 v1 1 1 1 1 z 1 1 u1 1 1 1 x 1 1 1 2 2 z 1 v2 1 0 1 0 1 y 1 2 0 u2 v2 5 (b) G[P1 , P2 ] (a) G, P1 , and P2 Figure 9: (a) P1 = u1 xyzv1 and P2 = u2 xyzv2 are noncrossing shortest paths of G. (b) G[P1 , P2 ]. a Monge unit with the induced cyclic ordering (respectively, orderings) of the nodes in H[X] for the first (respectively, second) type. Thus, M is a Monge decomposition of K preserving the property that the multiplicity of a node of K in M is O(1) times its multiplicity in D, implying that the size of M is O(m). It takes overall O(m) time to obtain the induced cyclic ordering or the two induced orderings of the nodes of H[X] from H for each Monge unit H in M (D). Since the weight of each edge of H[X] can be obtained in O(1) time from its weight in H, we have an implicit representation of M in O(m) time. The lemma follows from Lemma 5.4. 5.3 Noncrossing paths Let G be a simple connected bidirected plane graph. Let u1 , u2 , v2 , v1 be distinct nodes on the boundary of the external face of connected plane graph G in order. A simple u1 v1 -path P1 and a simple u2 v2 -path P2 of G are noncrossing if P1 ∩ P2 is empty or is a path. For instance, in Figure 9, P1 in red and P2 in blue are noncrossing. For noncrossing P1 and P2 , let G[P1 , P2 ] denote the connected bidirected plane subgraph of G enclosed by P1 , P2 , and the u1 u2 -path and v2 v1 -path on the boundary of the external face of G following the order of u1 , u2 , v2 , v1 . See Figure 9 for an example. Let D be an r-division of G. Our proof of Lemma 4.1 needs a data structure B(D) with the following property: For distinct nodes u1 , u2 , u3 , v3 , v2 , v1 on the external face of G in order, any disjoint simple u1 v1 -path P1 and u3 v3 -path P3 of G, and any simple u2 v2 -path P2 of G[P1 , P3 ] such that P1 and P2 are noncrossing, given X(1, 3) and P2 \ P1 , it takes O((m1 + m2 ) log r) time to obtain X(1, 2) and X(2, 3), where X(i, j) with 1 ≤ i < j ≤ 3 consists of the boundary nodes of D in G[Pi , Pj ], m1 is the sum of multiplicities of the nodes of X(1, 3) in D, and m2 is the number of edges in P2 \ P1 . See Figure 10 for an illustration. Lemma 5.6. It takes O(n) time to compute a data structure B(D) for any given r-division D of any n-node simple connected bidirected plane graph. Proof. Given X(1, 3) and the edge set E of P2 \ P1 , it takes O(m1 + m2 ) time to obtain the nodes of X(1, 3) in E, which belongs to X(1, 2) ∩ X(2, 3). Let X consist of the nodes of X(1, 3) not in E. If X = ∅, then X(1, 2) = X(2, 3) = X(1, 3). The rest of the proof assumes X 6= ∅. Let 0 (respectively, 1 ) consist of the pieces H of D such that H contains nodes of X and no (respectively, some) edges of E. We have 1 6= ∅, since G[P1 , P3 ] is connected and E 6= ∅. Let A be the O(m1 + m2 )-time obtainable undirected bipartite graph on the nodes x in X and the pieces H of D in 0 such that H and x are adjacent in A if and only if H contains x in G. The nodes of X in the same connected component of A either all belong to X(1, 2) or all belong to X(2, 3). Since G[P1 , P3 ] is connected, each connected component of A contains a node of X H H H H 14 P1 u1 v1 P1 u1 u2 v1 u2 P2 u2 P2 (b) G[P1 , P2 ] v2 v2 P2 u3 v3 v2 P3 (a) G[P1 , P3 ] u3 v3 P3 (c) G[P2 , P3 ] Figure 10: An illustration for the definition of B(D), where P1 is the blue solid u1 v1 -path, P3 is the green dash-dotted u3 v3 -path, and P2 is the red dotted u2 v2 -path. P1 and P3 are disjoint. P1 and P2 are noncrossing. (a) G[P1 , P3 ], in which the boundary nodes of D form X(1, 3). (b) G[P1 , P2 ], in which the boundary nodes of D form X(1, 2). (c) G[P2 , P3 ], in which the boundary nodes of D form X(2, 3). H that belongs to a piece of H ∈ 1 in G. It takes overall O(m1 + m2 ) time to obtain H ∩ E, C ∩ E, and C ∩ X for each hole C of each piece H of D in 1 . Since each piece of D has O(1) holes, it remains to show that with the B(D) defined below, for each hole C of each piece H of D in 1 , it takes O(m log r) time to determine the nodes of C ∩ X in X(1, 2), where m is the number of nodes in H ∩ X plus the number of edges in H ∩ E. Assume without loss of generality that the external face of each piece H of D is a hole of H. The O(n)-time obtainable data structure B(D) consists of (1) the cyclic ordering of the incident edges around each node of G and (2) the following items for each hole C of each piece H of D: H H • An arbitrary simple path Q of H from a node of C to a node q on the external face of H. • The ordering indices of the nodes on Q. • The cyclic ordering indices of the nodes on C. H It takes overall O(m1 + m2 ) time to obtain Q ∩ E for each hole C of each piece H of D in 1 . With the first part of B(D), if uv is an edge of G[P1 , P3 ] with u ∈ P2 and v ∈ / P2 , then it takes O(1) time to determine whether v ∈ G[P1 , P2 ]. With the second part of B(D), for any k-node subset U of any piece H of D and any hole C of H, it takes O(k) time to determine the ordering indices of the nodes of U ∩ Q in Q and the cyclic ordering indices of the nodes of U ∩ C in C. Case 1: C ∩ E 6= ∅. As illustrated by Figure 11(a), it takes overall O(m log r) time via sorting their ordering indices to compute, for each node x of C ∩X, the first node u ∈ E in the traversal of C starting from x following the order of u1 , u3 , v3 , v1 and the node v of C preceding u in the traversal. We have x ∈ X(1, 2) if and only if v ∈ G[P1 , P2 ], which can be determined in O(1) time. Case 2: C ∩E = ∅. As illustrated by Figure 11(b), if Q∩E 6= ∅, then let v be the node preceding the first node u of Q in E. Let C ′ be the boundary of the external face of H. As illustrated by Figure 11(c), if Q ∩ E = ∅, then let v be the node of C ′ preceding the first node u of C ′ in E on the traversal of C ′ starting from q following the order of u1 , u3 , v3 , v1 . Either way, it takes O(m) 15 v x q C C Q Q E u E v C E v E u u Q E C′ q (a) (c) (b) Figure 11: Illustrations for the proof of Lemma 5.6. P2′ u1 P1 u2 u v1 v P2 v2 Figure 12: An illustration for the proof of Lemma 5.7. time to obtain v and determine whether v ∈ G[P1 , P2 ]. If v ∈ G[P1 , P2 ], then C ∩ X ⊆ X(1, 2). Otherwise, C ∩ X ⊆ X(2, 3). 5.4 Noncrossing shortest paths Lemma 5.7. Let G be a simple connected bidirected plane graph with nonnegative edge weights. If nodes u1 , u2 , v2 , v1 are on the boundary of the external face of G in order, then for any shortest u1 v1 path P1 of G, there is a shortest u2 v2 -path P2 of G such that P1 and P2 are noncrossing. Proof. As illustrated by Figure 12, suppose that P2′ is a shortest u2 v2 -path of G with P1 ∩P2′ 6= ∅. Let u (respectively, v) be the first (respectively, last) node of P2′ in P1 . Let P2 be obtained from P2′ by replacing its uv-path with the uv-path of P1 . By the order of u1 , u2 , v2 , v1 on the boundary of the external face of G, P2 is well defined and is a shortest u2 v2 -path of G such that P1 and P2 are noncrossing. Lemma 5.8. Let G be an n-node simple connected bidirected plane graph with nonnegative edge weights. Let u1 , . . . , uk , vk , . . . , v1 be 2k distinct nodes on the boundary of the external face of G in 16 order. For each i ∈ {1, k}, let Pi be a simple shortest ui vi -path of G such that P1 and Pk are noncrossing. Let h be the number of nodes of G[P1 , Pk ] not in P1 ∩ Pk . Given P1 \ Pk and Pk \ P1 , consider the problem of computing dG (ui , vi ) for all i = 1, . . . , k. 1. If P1 ∩ Pk = ∅, then the problem can be solved in O(h log k) time. 2. If P1 ∩ Pk = ∅ and we are given a set Z of O(1) nodes such that for each i = 1, . . . , k at least one shortest ui vi -path passes at least one node of Z, then the problem can be solved in O(h) time. 3. If P1 ∩ Pk 6= ∅ and we are given w(P1 ∩ Pk ), then the problem can be solved in O(h) time. Proof. Since P1 \ Pk and Pk \ P1 are given, it takes O(h) time to obtain G[P1 , Pk ] excluding the edges and internal nodes of P1 ∩Pk . Statements 2 and 3 follow from Lemmas 3.2 and 5.7. As for Statement 1, under the assumption that a simple shortest ua va -path Pa and a simple shortest ub vb -path Pb of G are given and disjoint, below is the recursive algorithm M EASURE (a, b) with 1 ≤ a < b ≤ k for solving the (a, b)-subproblem of computing dG (ui , vi ) for all indices i with a < i < b: Let i = ⌊(a + b)/2⌋. By Lemma 3.2, it takes time linear in the number of nodes in G[Pa , Pb ] to obtain dG (ui , vi ) and a simple shortest ui vi -path Pi of G[Pa , Pb ] that is noncrossing with both Pa and Pb . For the (a, i)-subproblem, if Pa ∩ Pi = ∅, then call M EASURE (a, i); otherwise, apply Statement 2 with Z consisting of an arbitrary node in Pa ∩ Pi . For the (i, b)-subproblem, if Pi ∩ Pb = ∅, then call M EASURE (i, b); otherwise, apply Statement 2 with Z consisting of an arbitrary node in Pi ∩ Pb . The algorithm for the statement obtains dG (u1 , v1 ) and dG (uk , vk ) from P1 and Pk and calls M EASURE (1, k). Since each dG (ui , vi ) with 1 < i < k is computed by Lemma 3.2 or Statement 2, the correctness holds trivially. By the choice of i, M EASURE (1, k) runs in O(log k) levels of recursion. Since Pa ∩ Pb = ∅ holds for each call to M EASURE (a, b), each node of G[P1 , Pk ] appears in at most two subgraphs G[Pa , Pb ] in the same level of recursion. Thus, the overall running time for each level of recursion is O(h). The algorithm runs in O(h log k) time. 5.5 Proving Lemma 4.1 Proof of Lemma 4.1. For each i = 1, . . . , ℓ, let di = dG (ui , vi ). With the modification below, each di with 1 ≤ i ≤ ℓ equals the weight of a shortest u′i vi′ -path in the resulting G, which remains an O(n)-node simple connected bidirected plane graph: (1) for each i = 1, . . . , ℓ, add new nodes u′i and vi′ in the external face, zero-weighted edges u′i ui and vi vi′ , and ∞-weighted edges ui u′i and vi′ vi , (2) contract each zero-weighted strongly connected subgraph into a single node, (3) delete all self-loops, and (4) delete all except one copy of each set of multiple edges with minimum weight. Thus, the rest of the proof assumes that u1 , . . . , uℓ , vℓ , . . . , v1 are distinct and G does not have any zero-weighted cycles, implying that all shortest paths of G are simple. Let G△ be an O(n)-node bidirected plane graph obtainable in O(n) time from G by identifying nodes ui and vi into a new node zi for each i = 1, . . . , ℓ and then triangulating each face of size larger than 3. Let r = max(1, ⌈log 62 n⌉). (2) By Lemma 5.1, an r-division D0 for G△ can be computed in O(n) time. Let D1 be the division of G induced by D0 : Each piece of D1 is obtained from a piece of D0 by deleting the edges added √ to triangulate faces of size larger than 3. Each piece of D0 has O(r) nodes, O( r) boundary nodes, and O(1) holes, so does each piece of D1 . Let I consist of indices 1 and ℓ and the indices i such that at least one of ui and vi is a boundary node of D1 . Since each zi with i ∈ I \ {1, ℓ} √ is a boundary node in D0 , the cardinality of I is O(n/ r). To turn both of ui and vi with i ∈ I 17 Subroutine S OLVE(a, b) If I(a, b) = ∅, then solve the (a, b)-subproblem by Lemma 5.8(1) and return. If I(a, b) 6= ∅, then let i be a median of I(a, b) and let P (respectively, P ′ ) be a shortest ui vi -path whose first (respectively, last) c edges can be obtained in O(c log log r) time. Case 1: P ∩ (Pa ∪ Pb ) = ∅. Let Pi = P . Call L ABEL(Pi ), S OLVE(a, i), and S OLVE(i, b). Return. Case 2: P ∩ (Pa ∪ Pb ) 6= ∅. • Call L ABEL(P [ui , x]), where x is the first node of P in Pa ∪ Pb . • Call L ABEL(P ′ [y, vi ]), where y is the last node of P ′ in P [ui , x] ∪ Pa ∪ Pb . Case 2(1): y ∈ Pa ∪ Pb . Let j be the index in {a, b} with x ∈ Pj . • If y ∈ / Pj , then solve the (a, b)-subproblem by Lemma 5.8(2) with Z = {x, y}. Return. • If y ∈ Pj , then let Pi = P [ui , x]Pj [x, y]P ′ [y, vi ], implying w(Pi ∩ Pj ) = φ(y) − φ(x). – If x ∈ Pa , then solve the (a, i)-subproblem by Lemma 5.8(3) and call S OLVE(i, b). Return. – If x ∈ Pb , then solve the (i, b)-subproblem by Lemma 5.8(3) and call S OLVE(a, i). Return. Case 2(2): y ∈ / Pa ∪ Pb , implying y ∈ P [ui , x] and y 6= x. Let Pi = P [ui , y]P ′ [y, vi ]. Let Z = {x}. • If x ∈ Pa , then solve the (a, i)-subproblem by Lemma 5.8(2) and call S OLVE(i, b). Return. • If x ∈ Pb , then solve the (i, b)-subproblem by Lemma 5.8(2) and call S OLVE(a, i). Return. Figure 13: Subroutine S OLVE (a, b). √ into boundary nodes, we introduce O(n/r) new O( r)-node pieces, which form a partition of the nodes ui and vi with i ∈ I. Let D be the resulting division of G. Each new piece of D has √ √ O( r) nodes and no edges, so it has O( r) boundary nodes and O(1) holes. Thus, D is an r-division of G such that each ui with 1 ≤ i ≤ ℓ is a boundary node in D if and only if so is vi . Let G′ be the simple bidirected plane graph with edge weights obtained from G by reversing the direction of each edge. Let D ′ be the r-division of G′ corresponding to D. By Equation (2), it takes O(n log log n) time to compute K(D) and K(D ′ ) and the data structures ensured by Lemmas 5.2 and 5.5. For any nodes x and y in a shortest path P of G, let P [x, y] denote the xy-path of P . We need a subroutine L ABEL (P ) to compute label φ(z) for each node z of a shortest path P of G under the assumption that φ(z) for at most one node of P is pre-computed: Let z ∗ be the node with pre-computed φ(z ∗ ). If there is no such a node, then let z ∗ be an arbitrary node of P and let φ(z ∗ ) = 0. For each node z that precedes z ∗ in P , let φ(z) = φ(z ∗ ) − w(P [z, z ∗ ]). For each node z that succeeds z ∗ in P , let φ(z) = φ(z ∗ ) + w(P [z, z ∗ ]). Subroutine L ABEL (P ) runs in O(1) time per node of P and does not overwrite φ(z) for any z with pre-computed φ(z). After running L ABEL (P ), for any nodes x and y of P , w(P [x, y]) can be obtained from φ(y) − φ(x) in O(1) time. For any indices a and b, let set I(a, b) consist of the indices i ∈ I with a < i < b. For each i ∈ {1, ℓ}, let Pi be a shortest ui vi -path of G obtainable in O(n) time by Lemma 3.2. If P1 ∩ Pℓ 6= ∅, then the lemma follows from Lemma 5.8(2) with Z = {x} for an arbitrary node x ∈ P1 ∩ Pℓ . The rest of the proof assumes P1 ∩ Pℓ = ∅. The algorithm proving the lemma calls L ABEL (P1 ), L ABEL (Pk ), and S OLVE (1, ℓ), where the main subroutine S OLVE (a, b), as defined in Figure 13 and elaborated below, solves the (a, b)-subproblem of computing di for all indices i with a ≤ i ≤ b under the condition that 18 ua x va ua vi vb y va ua ui vi ui vi ub vb ub vb x x va y ui ub y (a) (b) (c) Figure 14: Illustrations for the proof of Lemma 4.1. All Pa and Pb are in black. Each P [ui , x] is in red dots. Each P ′ [y, vi ] is in blue dashes. • shortest ua va -path Pa of G and shortest ub vb -path Pb of G are disjoint, • φ(z) is pre-computed for each node z ∈ Pa ∪ Pb , and • the set X(a, b) of boundary nodes of D in G[Pa , Pb ] is given. By Equation (2), it remains to prove that S OLVE (1, ℓ) correctly solves the (1, ℓ)-subproblem in O(n log r) time. If I(a, b) = ∅, then all ui with a < i < b are not boundary nodes in D. Since these ui induce a connected subgraph of G, they belong to a common piece of D, implying b − a = O(r). The (a, b)-subproblem can be solved by Lemma 5.8(1) in O(h(a, b) log r) time, where h(a, b) is the number of nodes in G[Pa , Pb ] that are not in Pa ∩ Pb . For the case with I(a, b) 6= ∅, we cannot afford to directly compute a shortest ui vi -path Pi of G for a median i of I(a, b) by Lemma 3.2. Instead, in the subgraph of K(D) induced by the given set X(a, b) of boundary nodes of D in G[Pa , Pb ], we compute a shortest ui vi -path Π (respectively, Π′ ) of K(D) (respectively, K(D ′ )), the first (respectively, last) c edges of whose underlying path P (respectively, P ′ ) can be obtained in O(c log log r) time by Lemma 5.2. By Lemma 5.7, G[Pa , Pb ] contains at least one shortest ui vi -path of G, implying that the subgraph of K(D) induced by X(a, b) contains at least one shortest ui vi -path of K(D). Therefore, P and P ′ are shortest ui vi -paths of G in G[Pa , Pb ]. If P does not intersect Pa ∪ Pb , then it takes O(log log r) time per node to obtain P . As in Case 1 of Figure 13, the subroutine lets Pi = P and calls L ABEL (Pi ), S OLVE (a, i), and S OLVE (i, b). If P intersects Pa ∪ Pb , it takes O(log log r) time per node to obtain P [ui , x] and P ′ [y, vi ], where x is the first node of P in Pa ∪ Pb and y is the last node of P ′ in P [ui , x] ∪ Pa ∪ Pb , as stated by the first two bullets in Case 2 of Figure 13. The subroutine calls L ABEL (P [ui , x]) and L ABEL (P ′ [y, vi ]). • As illustrated by Figure 14(a), if each of Pa and Pb contains exactly one of x and y, then the (a, b)-subproblem is solved in O(h(a, b)) time by Lemma 5.8(2) with Z = {x, y}, as stated by the first bullet in Case 2(1) of Figure 13. • As illustrated by Figure 14(b), if x, y ∈ Pa , then let Pi = P [ui , x]Pa [x, y]P ′ [y, vi ]. The (i, b)-subproblem is solved by calling S OLVE (i, b). The (a, i)-subproblem is solved by Lemma 5.8(3) with w(Pa ∩ Pi ) = φ(y) − φ(x) in O(h(a, b)) time. The case with x, y ∈ Pb is similar. The second bullet of Case 2(1) in Figure 13 states these two cases. • As illustrated by Figure 14(c), if x ∈ Pa and y ∈ / Pa ∪ Pb , then the shortest ui vi -path Pi = P [ui , y]P ′ [y, vi ] is disjoint with Pa ∪ Pb . The (i, b)-subproblem is solved by calling S OLVE (i, b). Since at least one shortest ui vi -path of G[Pa , Pi ] passes x, the (a, i)subproblem can be solved in O(h(a, b)) time by Lemma 5.8(2) with Z = {x}. The case / Pa ∪ Pb is similar. Case 2(2) in Figure 13 states these two cases. with x ∈ Pb and y ∈ 19 The correctness holds trivially, since each di with 1 ≤ i ≤ ℓ is computed somewhere during the execution of S OLVE (1, ℓ) by Lemma 5.8. Since i is chosen to be a median of I(a, b) in each subroutine call to S OLVE (a, b), there are O(log n) levels of recursion in executing S OLVE (1, ℓ). Let m(a, b) be the sum of the multiplicities of the nodes of X(a, b) in D. By Lemma 5.5, the time for computing Π and Π′ is O(m(a, b) log 2 m(a, b)). In order to maintain the condition that X(a, b) is given whenever S OLVE (a, b) is called, we apply Lemma 5.6 to obtain X(a, i) and X(i, b) in O((m(a, b) + mi ) log r) time before calling S OLVE (a, i) or S OLVE (i, b), where mi is the number of edges in Pi \ (Pa ∪ Pb ). Since Pa and Pb are disjoint, each boundary node of D is contained by one or two subgraphs G[Pa , Pb ] of the same recursion level. Since there are √ O(n/r) pieces of D and each piece of D has O( r) boundary nodes, the sum of m(a, b) over all √ subgraphs G[Pa , Pb ] at the same recursion level is O(n/ r). Since each edge of G appears in at most one Pi \ (Pa ∪ Pb ) for all subroutine calls to S OLVE (a, b), the sum of all mi throughout the execution of S OLVE (1, ℓ) is O(n). By Equation (2), the overall time for computing Π and Π′ is   n 2 O log n · √ log n = O(n). r The overall time of finding all paths P , P [ui , x], and P ′ [y, vi ] is O(n log log r), since their edges are disjoint and all of them are obtainable in O(log log r) time per node. Therefore, the running time of S OLVE (1, ℓ) is dominated by the sum of the O(h(a, b) log r) time for solving the (a, b)subproblems by Lemmas 5.8(1), 5.8(2), and 5.8(3) at the bottom of recursion. Since the sum of h(a, b) over all these (a, b)-subproblems is O(n), the running time of S OLVE (1, ℓ) is O(n log r). The lemma is proved. 6 Concluding remarks We give the first known O(n log n log log n)-time algorithms for finding a minimum cut and a shortest cycle in an n-node simple directed planar graph G with nonnegative edge weights. For the case that G is restricted to be unweighted, our shortest-cycle algorithm remains the best known result for the shortest-cycle problem. The best algorithm for the minimum-cut problem, running in O(n log n) time, is obtained by plugging in the O(n)-time minimum stcut algorithm of, e.g., Brandes and Wagner [4] and Eisenstat and Klein [13] to a directed version of the reduction algorithm of Chalermsook et al. [8]. Thus, an interesting future direction is to further reduce the running time of our algorithms on both problems for this special case. Extending our results to bounded-genus graphs is also of interest. Acknowledgment We thank the anonymous reviewers for helpful comments. References [1] G. Borradaile and P. N. Klein. An O(n log n) algorithm for maximum st-flow in a directed planar graph. Journal of the ACM, 56(2):9.1–9.30, 2009. [2] G. Borradaile, P. N. Klein, S. Mozes, Y. Nussbaum, and C. Wulff-Nilsen. Multiple-source multiple-sink maximum flow in directed planar graphs in near-linear time. In Proceedings of the 52nd Annual IEEE Symposium on Foundations of Computer Science, pages 170–179, 2011. 20 [3] G. Borradaile, P. Sankowski, and C. Wulff-Nilsen. Min st-cut oracle for planar graphs with near-linear preprocessing time. ACM Transactions on Algorithms, 11(3):16.1–16.29, 2015. [4] U. Brandes and D. Wagner. A linear time algorithm for the arc disjoint Menger problem in planar directed graphs. Algorithmica, 28(1):16–36, 2000. [5] S. Cabello. Finding shortest contractible and shortest separating cycles in embedded graphs. ACM Transactions on Algorithms, 6(2):24.1–24.18, 2010. [6] S. Cabello, E. W. Chambers, and J. Erickson. Multiple-source shortest paths in embedded graphs. SIAM Journal Computing, 42(4):1542–1571, 2013. [7] S. Cabello, É. Colin de Verdière, and F. Lazarus. Finding shortest non-trivial cycles in directed graphs on surfaces. In Proceedings of the 26th ACM Symposium on Computational Geometry, pages 156–165, 2010. [8] P. Chalermsook, J. Fakcharoenphol, and D. Nanongkai. A deterministic near-linear time algorithm for finding minimum cuts in planar graphs. In Proceedings of the 15th Annual ACM-SIAM Symposium on Discrete Algorithms, pages 828–829, 2004. [9] H.-C. Chang and H.-I. Lu. Computing the girth of a planar graph in linear time. SIAM Journal on Computing, 42(3):1077–1094, 2013. [10] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to Algorithms. MIT Press, 3rd edition, 2009. [11] M. Cygan, H. N. Gabow, and P. Sankowski. Algorithmic applications of Baur-Strassen’s theorem: Shortest cycles, diameter and matchings. In Proceedings of the 53rd Annual IEEE Symposium on Foundations of Computer Science, pages 531–540, 2012. [12] H. Djidjev. A faster algorithm for computing the girth of planar and bounded genus graphs. ACM Transactions on Algorithms, 7(1):3.1–3.16, 2010. [13] D. Eisenstat and P. N. Klein. Linear-time algorithms for max flow and multiple-source shortest paths in unit-weight planar graphs. In Proceedings of the 45th ACM Symposium on Theory of Computing, pages 735–744, 2013. [14] J. Erickson. Maximum flows and parametric shortest paths in planar graphs. In Proceedings of the 21st Annual ACM-SIAM Symposium on Discrete Algorithms, pages 794–804, 2010. [15] J. Erickson, K. Fox, and A. Nayyeri. Global minimum cuts in surface embedded graphs. In Proceedings of the 23rd Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1309– 1318, 2012. [16] J. Erickson and S. Har-Peled. Optimally cutting a surface into a disk. Discrete & Computational Geometry, 31(1):37–59, 2004. [17] J. Erickson and A. Nayyeri. Minimum cuts and shortest non-separating cycles via homology covers. In Proceedings of the 22nd Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1166–1176, 2011. [18] J. Erickson and A. Nayyeri. Shortest non-crossing walks in the plane. In Proceedings of the 22nd Annual ACM-SIAM Symposium on Discrete Algorithms, pages 297–208, 2011. 21 [19] J. Erickson and P. Worah. Computing the shortest essential cycle. Discrete & Computational Geometry, 44(4):912–930, 2010. [20] J. Fakcharoenphol and S. Rao. Planar graphs, negative weight edges, shortest paths, and near linear time. Journal of Computer and System Sciences, 72(5):868–889, 2006. [21] K. Fox. Shortest non-trivial cycles in directed and undirected surface graphs. In Proceedings of the 24th Annual ACM-SIAM Symposium on Discrete Algorithms, pages 352–364, 2013. [22] K. Fox. Fast algorithms for surface embedded graphs via homology. PhD thesis, University of Illinois at Urbana-Champaign, 2014. [23] G. N. Frederickson. Fast algorithms for shortest paths in planar graphs, with applications. SIAM Journal on Computing, 16(6):1004–1022, 1987. [24] H. N. Gabow. A matroid approach to finding edge connectivity and packing arborescences. Journal of Computer and System Sciences, 50(2):259–273, 1995. [25] H. N. Gabow and R. E. Tarjan. Faster scaling algorithms for network problems. SIAM Journal on Computing, 18(5):1013–1036, 1989. [26] P. Gawrychowski, S. Mozes, and O. Weimann. Submatrix maximum queries in Monge matrices are equivalent to predecessor search. In B. Speckmann, editor, Proceedings of the 42nd International Colloquium on Automata, Languages, and Programming, pages 580—592, 2015. [27] A. V. Goldberg. Scaling algorithms for the shortest paths problem. SIAM Journal on Computing, 24(3):494–504, 1995. [28] R. E. Gomory and T. C. Hu. Multi-terminal network flows. Journal of the SIAM, 9(4):551– 570, 1961. [29] M. T. Goodrich. Planar separators and parallel polygon triangulation. Journal of Computer and System Sciences, 51(3):374–389, 1995. [30] J. Hao and J. B. Orlin. A faster algorithm for finding the minimum cut in a directed graph. Journal of Algorithms, 17(3):424–446, 1994. [31] M. R. Henzinger, P. N. Klein, S. Rao, and S. Subramanian. Faster shortest-path algorithms for planar graphs. Journal of Computer and System Sciences, 55(1):3–23, 1997. [32] A. Itai and M. Rodeh. Finding a minimum circuit in a graph. SIAM Journal on Computing, 7(4):413–423, 1978. [33] G. F. Italiano, Y. Nussbaum, P. Sankowski, and C. Wulff-Nilsen. Improved algorithms for min cut and max flow in undirected planar graphs. In Proceedings of the 43rd ACM Symposium on Theory of Computing, pages 313–322, 2011. [34] L. Janiga and V. Koubek. Minimum cut in directed planar networks. Kybernetika, 28(1):37– 49, 1992. [35] H. Kaplan, S. Mozes, Y. Nussbaum, and M. Sharir. Submatrix maximum queries in Monge matrices and Monge partial matrices, and their applications. In Proceedings of the 23rd Annual ACM-SIAM Symposium on Discrete Algorithms, pages 338–355, 2012. 22 [36] H. Kaplan and Y. Nussbaum. Minimum s-t cut in undirected planar graphs when the source and the sink are close. In T. Schwentick and C. Dürr, editors, Proceedings of the 28th International Symposium on Theoretical Aspects of Computer Science, pages 117–128, 2011. [37] D. R. Karger. Minimum cuts in near-linear time. Journal of the ACM, 47(1):46–76, 2000. [38] K.-i. Kawarabayashi and M. Thorup. Deterministic global minimum cut of a simple graph in near-linear time. In Proceedings of the 47th ACM Symposium on Theory of Computing, pages 665–674, 2015. [39] S. Khuller and J. Naor. Flow in planar graphs: A survey of recent results. In Planar Graphs, DIMACS Series in Discrete Math and Theoretical Computer Science 9, pages 59–84. AMS, 1993. [40] P. N. Klein. Multiple-source shortest paths in planar graphs. In Proceedings of the 16th Annual ACM-SIAM Symposium on Discrete Algorithms, pages 146–155, 2005. [41] P. N. Klein, S. Mozes, and C. Sommer. Structured recursive separator decompositions for planar graphs in linear time. In Proceedings of the 45th ACM Symposium on Theory of Computing, pages 505–514, 2013. [42] P. N. Klein, S. Mozes, and O. Weimann. Shortest paths in directed planar graphs with negative lengths: A linear-space O(n log2 n)-time algorithm. ACM Transactions on Algorithms, 6(2):30.1–30.18, 2010. [43] J. Łacki, ˛ Y. Nussbaum, P. Sankowski, and C. Wulff-Nilsen. Single source - all sinks max flows in planar digraphs. In Proceedings of the 53rd Annual IEEE Symposium on Foundations of Computer Science, pages 599–608, 2012. [44] J. Łacki ˛ and P. Sankowski. Min-cuts and shortest cycles in planar graphs in O(n log log n) time. In Proceedings of the 19th Annual European Symposium on Algorithms, pages 155–166, 2011. [45] H.-C. Liang. Minimum cuts and shortest cycles in directed planar graphs via shortest non-crossing paths. Master’s thesis, National Taiwan University, July 2015. [46] H.-C. Liang and H.-I. Lu. Minimum cuts and shortest cycles in directed planar graphs via noncrossing shortest paths. SIAM Journal on Discrete Mathematics, 31(1):454–476, 2017. [47] A. Lingas and E.-M. Lundell. Efficient approximation algorithms for shortest cycles in undirected graphs. Information Processing Letters, 109(10):493–498, 2009. [48] R. J. Lipton and R. E. Tarjan. A separator theorem for planar graphs. SIAM Journal on Applied Mathematics, 36:177–189, 1979. [49] B. Monien. The complexity of determining a shortest cycle of even length. Computing, 31(4):355–369, 1983. [50] R. Motwani and P. Raghavan. Randomized Algorithms. Cambridge University Press, 1995. [51] S. Mozes, C. Nikolaev, Y. Nussbaum, and O. Weimann. Minimum cut of directed planar graphs in O(n log log n) time. Computing Research Repository, December 2015. http://arxiv.org/abs/1512.02068. 23 [52] S. Mozes and C. Wulff-Nilsen. Shortest paths in planar graphs with real lengths in O(n log2 n/ log log n) time. In M. de Berg and U. Meyer, editors, Proceedings of the 18th Annual European Symposium on Algorithms, Lecture Notes in Computer Science 6347, pages 206–217. Springer, 2010. [53] K. Mulmuley, U. V. Vazirani, and V. V. Vazirani. Matching is as easy as matrix inversion. Combinatorica, 7(1):105–113, 1987. [54] H. Nagamochi and T. Ibaraki. Computing edge-connectivity in multigraphs and capacitated graphs. SIAM Journal on Discrete Mathematics, 5(1):54–66, 1992. [55] J. B. Orlin. Max flows in O(nm) time, or better. In Proceedings of the 45th ACM Symposium on Theory of Computing, pages 765–774, 2013. [56] E. Papadopoulou. k-pairs non-crossing shortest paths in a simple polygon. International Journal of Computational Geometry and Applications, 9(6):533–552, 1999. [57] V. Polishchuk and J. S. B. Mitchell. Thick non-crossing paths and minimum-cost flows in polygonal domains. In Proceedings of the 23rd ACM Symposium on Computational Geometry, pages 56–65, 2007. [58] J. H. Reif. Minimum s-t cut of a planar undirected network in O(n log2 n) time. SIAM Journal on Computing, 12(1):71–81, 1983. [59] L. Roditty and R. Tov. Approximating the girth. ACM Transactions on Algorithms, 9(2):15.1– 15.13, 2013. [60] L. Roditty and V. Vassilevska Williams. Subquadratic time approximation algorithms for the girth. In Proceedings of the 23rd Annual ACM-SIAM Symposium on Discrete Algorithms, pages 833–845, 2012. [61] M. Stoer and F. Wagner. A simple min-cut algorithm. Journal of the ACM, 44(4):585–591, 1997. [62] J. Takahashi, H. Suzuki, and T. Nishizeki. Finding shortest non-crossing rectilinear paths in plane regions. In Proceedings of the 4th International Symposium on Algorithms and Computation, pages 98–107, 1993. [63] J.-y. Takahashi, H. Suzuki, and T. Nishizeki. Shortest noncrossing paths in plane graphs. Algorithmica, 16(3):339–357, 1996. [64] V. Vassilevska Williams. Multiplying matrices faster than Coppersmith-Winograd. In Proceedings of the 44th ACM Symposium on Theory of Computing, pages 887–898, 2012. [65] V. Vassilevska Williams and R. Williams. Subcubic equivalences between path, matrix and triangle problems. In Proceedings of the 51st Annual IEEE Symposium on Foundations of Computer Science, pages 645–654, 2010. [66] K. Weihe. Edge-disjoint (s, t)-paths in undirected planar graphs in linear time. Journal of Algorithms, 23(1):121–138, 1997. [67] O. Weimann and R. Yuster. Computing the girth of a planar graph in O(n log n) time. SIAM Journal on Discrete Mathematics, 24(2):609–616, 2010. 24 [68] C. Wulff-Nilsen. Algorithms for planar graphs and graphs in metric spaces. PhD thesis, University of Copenhagen, 2010. [69] R. Yuster. A shortest cycle for each vertex of a graph. Information Processing Letters, 111(2122):1057–1061, 2011. [70] R. Yuster and U. Zwick. Finding even cycles even faster. SIAM Journal on Discrete Mathematics, 10(2):209–222, 1997. 25
8cs.DS
A Survey of Shortest-Path Algorithms Amgad Madkour1 , Walid G. Aref1 , Faizan Ur Rehman2 , Mohamed Abdur Rahman2 , Saleh Basalamah2 1 Purdue University, West Lafayette, USA 2 Umm Al-Qura University, Makkah, KSA arXiv:1705.02044v1 [cs.DS] 4 May 2017 May 8, 2017 Abstract A shortest-path algorithm finds a path containing the minimal cost between two vertices in a graph. A plethora of shortest-path algorithms is studied in the literature that span across multiple disciplines. This paper presents a survey of shortest-path algorithms based on a taxonomy that is introduced in the paper. One dimension of this taxonomy is the various flavors of the shortest-path problem. There is no one general algorithm that is capable of solving all variants of the shortest-path problem due to the space and time complexities associated with each algorithm. Other important dimensions of the taxonomy include whether the shortest-path algorithm operates over a static or a dynamic graph, whether the shortest-path algorithm produces exact or approximate answers, and whether the objective of the shortest-path algorithm is to achieve time-dependence or is to only be goal directed. This survey studies and classifies shortest-path algorithms according to the proposed taxonomy. The survey also presents the challenges and proposed solutions associated with each category in the taxonomy. 1 Introduction The shortest-path problem is one of the well-studied topics in computer science, specifically in graph theory. An optimal shortest-path is one with the minimum length criteria from a source to a destination. There has been a surge of research in shortest-path algorithms due to the problem’s numerous and diverse applications. These applications include network routing protocols, route planning, traffic control, path finding in social networks, computer games, and transportation systems, to count a few. There are various graph types that shortest-path algorithms consider. A general graph is a mathematical object consisting of vertices and edges. An aspatial graph contains vertices where their positions are not interpreted as locations in space. On the other hand, a spatial graph contains vertices that have locations through the edge’s end-points. A planar graph is plotted in two dimensions with no edges crossing and with continuous edges that need not be straight. There are also various settings in which a shortest-path can be identified. For example, the graph can be static, where the vertices and the edges do not change over time. In contrast, a graph can be dynamic, where vertices and edges can be introduced, updated or deleted over time. The graph contains either directed or undirected edges. The weights over the edges can either be negative or non-negative weights. The values can be real or integer numbers. This relies on the type of problem being issued. The majority of shortest-path algorithms fall into two broad categories. The first category is singlesource shortest-path (SSSP), where the objective is to find the shortest-paths from a single-source vertex to all other vertices. The second category is all-pairs shortest-path (APSP), where the objective is to find the shortest-paths between all pairs of vertices in a graph. The computation of shortest-path can generate either exact or approximate solutions. The choice of which algorithm to use depends on the characteristics of the graph and the required application. For example, approximate shortest-path algorithms objective is 2 2 TAXONOMY to produce fast answers even in the presence of a large input graph. A special sub-graph, called a spanner, can also be created from the main graph that approximates the distances so that a shortest-path can be computed over that sub-graph. Given the large body of literature on algorithms for computing the shortest-path, the objective of this survey is to present a breakdown of these shortest-path algorithms through an appropriate taxonomy. The taxonomy aims to help researchers, practitioners, and application developers understand how each shortest-path algorithm works and to help them decide which type or category of shortest-path algorithms to use given a specific scenario or application domain. Figure 1 illustrates the proposed taxonomy where each branch describes a specific category of shortest-path problem. Figure 1: Taxonomy of Shortest-Path Algorithms 2 Taxonomy As in Figure 1, the proposed taxonomy classifies the various shortest-path algorithms into multiple highlevel branches. The static branch in Figure 1 lists algorithms that operate over graphs with fixed weights for each edge. The weights can denote distance, travel time, cost, or any other weighting criteria. Given that the weights are fixed, some static algorithms perform precomputations over the graph. The algorithms 3 RELATED WORK 3 try to achieve a trade-off between the query time compared to the precomputation and storage requirements. Static algorithms consists of two classical algorithms for shortest-path fall under the two main categories (1) Single-source shortest-path (SSSP), and (2) All-pairs shortest-path (APSP). The SSSP algorithms compute the shortest-path from a given vertex to all other vertices. The APSP algorithms compute the shortest-paths between all pairs of vertices in the graph. Hierarchical algorithms break the shortest-path problem into a linear complexity problem. This can lead to enhanced performance in computation by orders of magnitude. Goal-directed algorithms optimize in terms of distance or time toward the target solution. Distance oracle algorithms include a preprocessing step to speed up the shortest-path query time. Distance oracle algorithms can either be exact or approximate. The dynamic branch in Figure 1 lists algorithms that process update or query operations on a graph over time. The update operation can insert or delete edges from the graph, or update the edge weights. The query operation computes the distance between source and destination vertices. Dynamic algorithms include both (APSP) and (SSSP) algorithms. Time-dependent algorithms target graphs that change over time in a predictable fashion. Stochastic shortest-path algorithms capture the uncertainty associated with the edges by modeling them as random variables. Parametric shortest-path algorithms compute a solutions based on all values of a specific parameter. Replacement path algorithms computes a solution that avoids a specified edge, for every edge between the source vertex and the destination vertex. Replacement paths algorithms achieve good performance by reusing the computations of each edge it avoids. On the other hand, alternative path algorithms also computes a shortest path between vertices that avoids a specified edge. The distinguishing factor between both categories is that replacement paths are not required to indicate a specific vertex or edge. On the other hand, alternative shortest-paths avoids the specified edge on the shortest-path. The weighted-regions problem finds the approximate shortest-path on weighted planar divisions. 3 Related Work Zwick [140] survey adopts a theoretical stand-point with regards to the exact and approximate shortest paths algorithms. Zwick’s survey addresses single-source shortest-path (SSSP), all pairs shortest-path (APSP), spanners (a weighted graph variation), and distance oracles. The survey illustrates the various variations that each category adopts when handling negative and non-negative edge weights as well as directed and undirected graphs. Sen [121] surveys approximate shortest-paths algorithms with a focus on spanners and distance oracles. Sen’s survey discusses how spanners and distance oracles algorithms are constructed and their practical applicability over a static all-pairs shortest-paths setting. Sommer [125] surveys query processing algorithms that trade-off the index size and the query time. Sommer’s survey also introduce the transportation network class of algorithms, and include algorithms for general graphs as well as planar and complex graphs. Many surveys focus on algorithms that target traffic applications, especially route planning methods. In such related work, a network denotes a graph. Holzer et al. [81] classify variations of Dijkstra’s algorithm according to the adopted speedup approaches. Their survey emphasizes on techniques that guarantee correctness. It argues that the effectiveness of speed-up techniques highly relies on the type of data. In addition, the best speedup technique depends on the layout, memory and tolerable preprocessing time. In contrast to optimal shortest-path algorithms, Fu et al. [60] survey algorithms that target heuristic shortest-path algorithms to quickly identify the shortest-path. Heuristic algorithms aim is to minimize computation time. The survey proposes the main distinguishing features of heuristic algorithms as well as their computational costs. Goldberg [66] investigates the performance of point-to-point shortestpath algorithms over road networks from a theoretical standpoint. Goldberg reviews algorithms, e.g., Dijkstra and A∗, and illustrates heuristic techniques for computing the shortest-path given a subset of the graph. The survey proves the good worst-case and average-case bounds over a graph. Also, it discusses reach-based pruning and illustrates how all-pairs shortest-path algorithms can be altered to compute reaches while maintaining the same time bound as their original counterparts. Delling and Wagner [37] survey route planning speedup techniques over some shortest-path problems including dynamic and timedependent variants. For example, the authors argue that shortcuts used in static networks cannot work in 4 PROBLEM DEFINITION 4 a time-dependent network. In essence, they investigate which networks can existing techniques be adopted to. Bast [11] illustrates speed-up techniques for fast routing between road networks and transportation networks. Bast’s survey argues that the algorithms for both networks are different and require specialized speed-up techniques for each. Also, the survey presents how the speed-up technique performs against Dijkstra’s algorithm. Moreover, the survey presents two open questions, namely, (1) how to achieve speed-up despite the lack of a hierarchy in transportation networks, and (2) how to efficiently compute local searches, e.g., as in neighborhoods. Demetrescu and Italiano [39] survey algorithms that investigate fully dynamic directed graphs with emphasis on dynamic shortest-paths and dynamic transitive closures. The survey focuses on defining the algebraic and combinatorial properties as well as tools for dynamic techniques. The survey tackles two important questions, namely whether dynamic shortest-paths achieve a space complexity of O(n2 ), and whether single-source shortest path algorithms in a fully-dynamic setting be solved efficiently over general graphs. Nannicini and Liberti [105] survey techniques for dynamic graph weights and dynamic graph topology. They list classical and recent techniques for finding trees and shortest-paths in large graphs with dynamic weights. They target two versions of the problem, namely, time-dependence, and what they refer to as cost updates of the weights. Dean’s survey [35] focuses on time-dependent techniques in a dynamic setting. It surveys one special case, namely, the First-In-First-Out (FIFO) network as it exposes structural properties that allow for the development of efficient polynomial-time algorithms. This survey presents these aspects that are different from all its predecessors. First, it presents a taxonomy that can aid in identifying the appropriate algorithm to use given a specific setting. Second, for each branch of the taxonomy, the algorithms are presented in chronological order that captures the evolution of the specific ideas and algorithms over time. Moreover, our survey is more comprehensive. We cover more recent algorithms that have been invented after the publication of the other surveys. 4 Problem Definition Given a set of vertices V , a source vertex s, a destination vertex d, where s, d ∈ V , and a set of weighted edges E, over the set V , find the shortest-path between s and d that has the minimum weight. The input to the shortest-path algorithm is a graph G that consists of a set of vertices V and edges E. The graph is defined as G = (V, E). The edges can be directed or undirected. The edges have explicit weights, where a weight is defined as w(e), where e ∈ E, or unweighted, where the implicit weight is considered to be 1. When calculating the algorithm complexity, we refer to the size of the set of vertices V as n and the size of the set of edges E as m. 5 Static Shortest-Path Algorithms In this section, we review algorithms for both the single-source shortest-path (SSSP) and all-pairs shortestpath (APSP) problems. 5.1 Single-Source Shortest-Path (SSSP) Definition: Given a Graph G = (V, E) and Source s ∈ V , compute all distances δ(s, v), where v ∈ V . The simplest case for SSSP is when the graph is unweighted. Cormen et al. [34] suggest that breadthfirst search can be simply employed by starting a scan from a root vertex and inspecting all the neighboring vertices. For each neighboring vertex, it probes the non-visited vertices until the path with the minimum number of edges from the source to the destination vertex is identified. 5 STATIC SHORTEST-PATH ALGORITHMS 5 Dijkstra’s algorithm [42] solves the single source shortest-path (SSSP) problem from a given vertex to all other vertices in a graph. Dijkstra’s algorithm is used over directed graphs with non-negative weights. The algorithm identifies two types of vertices: (1) Solved and (2) Unsolved vertices. It initially sets the source vertex as a solved vertex and checks all the other edges (through unsolved vertices) connected to the source vertex for shortest-paths to the destination. Once the algorithm identifies the shortest edge, it adds the corresponding vertex to the list of solved vertices. The algorithm iterates until all vertices are solved. Dijkstra’s algorithm achieves a time complexity of O(n2 ). One advantage of the algorithm is that it does not need to investigate all edges. This is particularly useful when the weights on some of the edges are expensive. The disadvantage is that the algorithm deals only with non-negative weighted edges. Also, it applies only to static graphs. Dijkstra’s algorithm performs a brute-force search in order to find the optimum shortest-path and as such is known to be a greedy algorithm. Dijkstra’s algorithm follows a successive approximation procedure based on Bellman Ford’s optimality principle [17]. This implies that Dijkstra’s algorithm can solve the dynamic programming equation through a method called the reaching method [41, 123, 124]. The advantage of dynamic programming is that it avoids the brute-force search process by tackling the sub-problems. Dynamic programming algorithms probe an exponentially large set of solutions but avoids examining explicitly all possible solutions. The greedy and the dynamic programming versions of Dijkstra’s algorithm are the same in terms of finding the optimal solution. However, the difference is that both may get different paths to the optimal solutions. Fredman and Tarjan [56] improve over Dijkstra’s algorithm by using a Fibonnaci heap (F-heap). This implementation achieves O(nlogn + m) running time because the total incurred time for the heap operations is O(n log n + m) and the other operations cost O(n + m). Fredman and Willard [57–59] introduce an extension that includes an O(m+n log n/loglog n) variant of Dijkstra’s algorithm through a structure termed the AF-Heap. The AF-Heap provides constant amortized costs for most heap operations and O(log n/loglog n) amortized cost for deletion. Driscoll and Gabow [47] propose a heap termed the relaxed Fibonacci heap. A relaxed heap is a binomial queue that allows heap order to be violated. The algorithm provides a parallel implementation of Dijkstra’s algorithm. Another line of optimization is through improved priority queue implementations. Boas [23] and Boas et al. [24] implementations are based on a stratified binary tree. The proposed algorithm enables online manipulation of a priority queue. The algorithm has a processing time complexity of O(loglog n) and storage complexity of O(n loglog n). A study by Thorup [128] indicates the presence of an analogy between sorting and the SSSP problem, where SSSP is no harder than sorting edge weights. Thorup [128] describes a priority queue giving a complexity of O(loglog n) per operation and O(m loglog n) complexity for the SSSP problem. The study examines the complexity of using a priority queue given memory with arbitrary word size. Following the same analogy, Han [70] proposes a deterministic integer sorting algorithm in linear space that achieves a time complexity of O(m loglog n logloglog n) for the SSSP problem. The approach by Han [70] illustrates that sorting arbitrarily large numbers can be performed by sorting on very small integers. Thorup [129] proposes a deterministic linear space and time algorithm by building a hierarchical bucketing structure that avoids the sorting operation. A bucketing structure is a dynamic set into which an element can be inserted or deleted. The elements from the buckets can be picked in an unspecified manner as in a doubly-linked list. The algorithm by Thorup [129] works by traversing a component tree. Hagerup [69] improves over the algorithm of Thorup, achieving a time complexity of O(n + m log w), where w is the width of the machine word. This is done through a deterministic linear time and space algorithm. Bellman, Ford, and Moore [18,53,100] develop an SSSP algorithm that is capable of handling negative weights unlike Dijkstra’s algorithm. It operates in a similar manner to Dijkstra’s, where it attempts to compute the shortest-path but instead of selecting the shortest distance neighbor edges with shortest distance, it selects all the neighbor edges. Then, it proceeds in n − 1 cycles in order to guarantee that all changes have been propagated through the graph. While it provides a faster solution than BellmanFord’s algorithm, Dijkstra’s algorithm is unable to detect negative cycles or operate with negative weights. 5 STATIC SHORTEST-PATH ALGORITHMS 6 However, if there is a negative cycle, then there is no shortest-path that can be computed. The reason is due to the lower total weight incurred due to the traversal cycle. Bellman-Ford’s algorithm achieves a run-time complexity of O(nm). Its strong points include the ability to operate on negative weights and detect negative cycles. However, the disadvantages include its slower run-time when compared to Dijkstra’s algorithm. Also, Bellman-Ford’s algorithm does not terminate when the iterations do not affect the graph weights any further. Karp [84] addresses the issue of whether a graph contains a negative cycle or not. He defines a concept termed minimum cycle mean and indicates that finding the minimum cycle mean is similar to finding the negative cycle. Karp’s algorithm achieves a time complexity of O(nm). Yen [137] proposes two performance modifications over Bellman Ford, and Moore [18, 53, 100]. The first involves the relaxation of edges. An edge is relaxed if the value of the vertex has changes. The second modification is dividing the edges based on a linear ordering over all vertices. Then, the set of edges are partitioned into one or more subsets. This is followed by performing comparisons between the two sets according to the proposed partitioning scheme. A slight improvement to what Yen [137] proposes has been introduced by Bannister and Eppstein [10] where instead of using an arbitrary linear ordering, they use a random ordering. The result is fewer number of iterations over both subsets. 5.2 All-Pairs Shortest-Path (APSP) Definition: Given a graph G = (V, E), compute all distances between a source vertex s and a destination v, where s and v are elements of the set V . The most general case of APSP is a graph with non-negative edge weights. In this case, Dijkstra’s algorithm can be computed separately for each vertex in the graph. The time complexity will be O(mn + n2 logn) [83]. A vast number of algorithms has been proposed that handle real edge-weights for the all-pairs shortestpath problem. Floyd-Warshall algorithm [52, 134] tries to find all pairs shortest-paths (APSP) in a weighted graph containing positive and negative weighted edges. Their algorithm can detect the existence of negative-weight cycles but it does not resolve these cycles. The complexity of Floyd-Warshall algorithm is O(n3 ), where n is the number of vertices. The detection of negative-weight cycle is done by probing the diagonal path matrix. Floyd-Warshall algorithm cannot find the exact shortest-paths between vertices pairs because it does not store the intermediate vertices while calculating. However, using a simple update, one can store this information within the algorithm steps. The space complexity of the algorithm is O(n3 ). However, this space complexity can reach O(n2 ) by using a single displacement array. The strong point of the algorithm is that it can handle negative-weight edges and can detect negative-weight cycles. The main drawback though is that the timing complexity for running Dijkstra’s algorithm on all vertices (to convert it from SSSP to APSP) will be O(mn + n2 logn). This timing complexity is lower than O(n3 ) if and only if m < n2 (i.e., having a sparse graph). Many studies have been proposed better running time over Floyd-Warshall’s algorithm on real-valued edge weights. A notable enhancement has been proposed by Fredman [55] that relies on a matrix-oriented approach. His approach relies on the theorem proposed by Aho and Hopcroft [5] the complexity of an N xN matrix multiplication using a min/plus multiplication approach is similar to that of shortestpaths. He shows that O(N 5/2 ) comparisons suffices to solve the all-pairs shortest-paths (APSP) problem. The algorithm achieves a complexity of O(n3 (loglogn)/logn1/3). Table 1 summarizes the enhancements proposed for real-valued edges up to this date. Table 1: Algorithms and complexities for real-valued edges 5 7 STATIC SHORTEST-PATH ALGORITHMS Time Complexity n3 3 n (loglogn)/logn1/3 n3 (loglogn/logn)1/2 n3 /(logn)1/2 3 n (loglogn/logn)5/7 n3 loglogn/logn 3 n (loglogn)1/2 /logn n3 /logn) n3 (loglogn/logn)5/4 n3 (loglogn)3 /(logn)2 n3 (loglogn)/(logn)2 Author [52, 134] [55] [126] [45] [71] [127] [141] [27] [72] [28] [73] The best result by Han and Takaoka [73] achieve O(loglogn)2 reduction factor when compared to the result of [28]. Their approach focuses on the distance product computation. First, an nxn matrix js divided into m sub-matrices, each having nxn/m dimensions, where m is determined based on a specific criterion. Then, the algorithm proceeds in a series of matrix manipulations, index building, encoding, and partitioning steps until it reaches the proposed bound. The best non-negative edge weight complexity is O(n2 logn) [98]. First, the algorithm sorts all adjacency lists in an increasing weight fashion. Then, it performs an SSSP computation n times and proceeds in iterations. In the first phase, it uses the notion of potential over the edges of vertices and selects and labels the edge with the minimum potential. Potential derived from the potential-model is defined as a probability distribution on complete directed graphs with arbitrary edge lengths that contain no negative cycles. The algorithm runs in two main phases, each with a specific invariant and has an O(n2 logn) complexity. The best positive integer edge weight complexity is O(nω + c) [110], where ω < 2.575 is the exponent being proposed by Coppersmith and Winograd [33]. Their proposed algorithm provides a transition between the fastest exact and approximate shortest-paths algorithms with a linear error rate. The algorithm focuses on directed graphs with small positive integer weights in order to obtain additive approximations. The approximations are polynomial given the actual distance between pairs of vertices. 5.3 Distance Oracles Definition: Given a graph G = (V, E), a distance oracle encompasses a (1) data structure or index that undergoes preprocessing, and a (2) query algorithm. The term distance oracle has been proposed by Thorup and Zwick [132]. It proposes a faster alternative to the SSSP and APSP algorithms. This can be achieved by preprocessing the graph and creating an auxiliary data structure to answer queries. Distance oracle operates in two phases, namely, a preprocessing phase and a query phase. In the preprocessing phase, information such as data structures or indexes are computed. In contrast, the query processing phase processes queries efficiently using the outcome from the preprocessing phase. Distance oracles may return exact or approximate distances. A distance oracle provides an efficient trade-off between space (in terms of data structure or index storage) and query time. 5.3.1 Exact Distances Fakcharoenphol and Rao [51] propose an algorithm for planar graphs that balances the trade-off between preprocessing and query time. √ The preprocessing complexity for both space and time is Õ(n), and the run-time complexity is Õ( n). Their proposed approach creates a non-planar graph given a subset of vertices followed by the computation of the shortest-path tree. First, the graph is divided into a set 5 STATIC SHORTEST-PATH ALGORITHMS 8 of bipartite graphs. The distance matrices of the bipartite graph need to √ comply with a non-crossing condition referred to as the Monge condition. The proposed result of O( n) holds as long as the noncrossing condition is enforced. Klein et al. [88] propose a linear-space algorithm with a fast preprocessing complexity of O(nlog 2 n), over a directed planar graph. The graph can include both positive and negative edges. Given a planar directed graph G, and a source vertex, the algorithm finds a curve known as a Jordan √ curve. A Jordan curve C is identified if it passes through O( n) vertices. A boundary vertex is one that passes through C. Cutting the graph and duplicating the boundary vertices creates subgraphs Gi . The algorithm passes through five stages: (1) recursively compute the distances from r within a graph where r is an arbitrary boundary vertex, (2) compute all distances between boundary vertices, (3) use a variant of Bellman-Ford to compute the graph distances from the boundary vertex r to all other boundary vertices, (4) use Dijkstra’s algorithm to compute the graph distances from the boundary vertex r to all other vertices, (5) use Dijkstra’s algorithm to compute graph distances from the source Vertix. This requires time of O(nlogn). Djidjev [44] proposes a faster query time algorithm and proves that for any S ∈ [n, n2 ], a distance oracle can have a space complexity during preprocessing of O(S), and query time complexity of O(n2 /S). Djidjev’s objective is to have an algorithm in which the product of preprocessing-space and query-time is not√greater than those of SSSP and APSP problems. The proposed algorithm provides a complexity of O( n) for any class of directed graphs where the separator theorem holds. Cabello [25] improves the preprocessing time, and provides a theoretical proof that, √ for any S ∈ [n4/3 , n2 ], a distance oracle can have O(S) preprocessing space complexity, and O(n/ S) query time complexity. This is slower than the algorithm proposed by Djidjev [44] by a logarithmic factor but still covers a wider range of S. The proposed approach constructs a data structure between any pair of vertices that can answer distance-based queries. Then, the algorithm queries the data structure with those pairs. Wulff-Nilsen [135] proposes a constant query-time algorithm for unweighted graphs, and proves that for any S ∈ [(logn/loglogn)2, n2/5 ], a distance oracle can have a space complexity of o(n2 ). The algorithm relies on the Wiener index of a graph. The Weiner index defines the sum of distances between all pairs of vertices in a graph. The proposed technique shows the existence of subquadratic time algorithms for computing the Wiener index. Computing the Wiener index has the same complexity as computing the average vertex pairs distances. Henzinger et al. [78] propose a SSSP algorithm requiring O(n4/3 log(nL)) time, where L is the absolute value of an edge with the smallest negative value. The proposed algorithm also achieves a similar bound for planar graphs and planar bipartite graphs. They also propose a parallel and dynamic variant of the algorithm. The key component of their approach is the use of graph-decompositions based on planar separators. Mozes and Sommer [101] propose an algorithm to answer distance queries between pairs of vertices in planar graphs with non-negative edge weights. They prove that, for any S ∈ [nloglogn, n2 ], a distance oracle can have Õ(S)√preprocessing time complexity, and O(S) space complexity. Distance queries can be answered in Õ(n/ S). The graph can be preprocessed in Õ(n) and the generated data √ structure will have a size of O(nloglogc). The query time will be Õ(c) where C is a cycle with c = O( n) vertices. 5.3.2 Approximate Distances Approximate distance oracles algorithms attempt to compute shortest-paths by querying only some of the distances. It is important to note that algorithms that deal with finite metric spaces produce only approximate answers. Some algorithms create spanners, where a spanner is a sparse sub-graph that approximates the original graph. They can be regarded as a spanning tree that maintains the locality aspects of the graph. These locality aspects defines a stretch where a stretch is a multiplicative factor 5 STATIC SHORTEST-PATH ALGORITHMS 9 that indicates the amount distances increase in the graph. The stretch is a result of utilizing the spanner edges only [48]. Other algorithms approximate distances by triangulation using a concept called landmark or beacon [125] that is selected by random sampling, where each vertex stores distances to all landmarks. Note that given the definition of approximate distance oracles, the actual shortest-path is still not guaranteed to be retrieved. Zwick [139] presents an APSP algorithm for directed graphs that utilizes a matrix multiplication where the approximate distance is computed in O((nω /ǫ)log(W/ǫ), where ǫ > 0 for any ǫ. They define the stretch as 1 + ǫ and W represents the largest weighted edge identified in the graph. Aingworth et al. [7] propose an APSP algorithm for undirected graphs with unweighted edges that does not adopt a matrix multiplication approach. A trade-off of not using fast matrix multiplication is a small√additive error. They propose two algorithms; one that achieves an additive error of 2 in time O(n2.5 log n). They also provide an estimate of graph paths and distances in O(n5/2 (log n)1/2 ) and another 2/3-approximation algorithm that achieves a query time of O(m(n log n)1/2 ). Dor et al. [46] improve on previous surplus results by proposing an APSP algorithm that computes the surplus 2 estimate in Õ(n3/2 m1/2 ). They also show that, for any k, a surplus 2(k-1) estimate takes Õ(kn2−1/k m1/k ) to be computed. Their work relies on the one main observation that there is a set of vertices that represent vertices with high degree value. In other words, a set of vertices X is said to represent a set of Y if all vertices in X have a neighbor in Y . Cohen and Zwick [32] improve the work proposed by Dor et al. [46] for weighted undirected graphs by proposing an algorithm that computes the surplus 2 estimate of all distances in Õ(n3/2 m1/2 ) and 3 estimate in Õ(n2 ). They show that finding the estimated distances between all-pairs in directed graphs is a hard problem, similar to the Boolean Matrix multiplication. This makes their proposed approximation algorithm only valid for undirected graphs. Their algorithm relies on two important aspects: partitioning of the graph with the assumption that it is directed and the use of an SSSP algorithm, e.g., Dijkstra’s. Patrascu and Roditty [108] further improve the stretch bound of intermediate vertices on the expense of increasing the space requirements and achieve Õ(n2/3 ). This approach defines the notion of balls, defined as B, where balls around each vertex grow geometrically and stop based on a specific criteria. Given the vertices s and t, the worst-case happens when the balls do not intersect. Agarwal et al. [4] also propose a 2 estimate approach that can be implemented in a distributed fashion. The approach is mainly meant for compact routing protocols. It aims to characterize the space and time trade-off for approximate distance queries in sparse graphs. For both approaches above (i.e., [108] and [4]), the space versus query time trade-off depends on the number of edges. For spanners, Elkin and Peleg [48] propose a general (1 + ǫ, β)-spanner with space complexity of O(βn1+1/k ), where β = β(κ, ǫ) is a constant when κ and ǫ are also constants. They claim that the stretch and spanners can be minimized in a simultaneous evaluation fashion. Baswana and Sen [13] propose a spanner with a (2k − 1) stretch that can be computed in O(km) and with a size of O(kn1+1/k ), where k > 1. They provide a theoretical proof that a spanner with a (2k − 1) stretch can be computed without distance computation in linear time through a novel clustering technique. The proposed approach can take O(k) rounds. Each round explores an adjacency vertex list in order to determine the edges that need to be removed. The advantage of this approach is its applicability to various computational environments, e.g., the synchronous distributed model, the external memory model, and the CRCW PRAM model. For planar graphs, Thorup [130] proposes an (1 + ǫ)-approximate distance oracle. This approach provides a constant number of shortest-paths through separators in contrast to Lipton et al. [92]. For each vertex, it stores the shortest-path distances to a set of O(1/ǫ) landmarks per level. This process is performed recursively for O(logn) levels. 5 STATIC SHORTEST-PATH ALGORITHMS 10 Kawarabayashi et al. [86] propose a planar graph algorithm that provides tunable trade-offs, where a polylogarithmic query time can be achieved while maintaining a linear space requirement with respect to the graph size. The proposed approach achieves a preprocessing time complexity of O(nlog 2 n) and query time of O(ǫ−2 log 2 n). It achieves faster running time than Thorup’s approach that computes a set C of connections that covers all vertices of a graph with every vertex containing O(ǫ−1 ) connections [130]. In contrast, only a subset of vertices is covered using Kawarabayashi et al. approach. The approach is O(ǫ−1 ) times the number of paths in space complexity. For complex networks, Chen et al. [30] proposes a distance oracle over random power-law graphs [6] with 3 estimate that has a space complexity of O(n4/3 ). Their approach adopts the distance oracle proposed by Thorup and Zwick [132], where they use high-degree vertices as landmarks. The adaptation includes selecting vertices with the highest degree as landmarks. It encodes the shortest-paths in the vertex labels. 5.4 Goal-Directed Shortest-Paths A goal-directed shortest-path search algorithm is based on adding annotations to vertices or edges of the graph that consist of additional information. This information allows the algorithm to determine which part of the graph to prune in the search space. 5.4.1 Simple Goal-Directed Search Hart et al. [74] propose a simple goal-directed algorithm, termed A∗ . The algorithm proposes a heuristic approach in finding the shortest-path. Unlike Dijkstra’s algorithm, A∗ is an informed algorithm, where it searches the routes that lead to the A∗ final goal. A∗ is an optimal best-first-search greedy algorithm. But what sets A∗ aside from other algorithms is its ability to maintain the distance it traveled into account. A∗ always finds the shortest-path if an admissible heuristic function is used. The strong point of the algorithm is that it is meant to be faster than Dijkstra since it explores less number of vertices. On the downside, if A∗ does not use a good heuristic method, it will not reach the shortest-path. Some of the variants of the A∗ algorithm use landmarks and other techniques in order to achieve better performance than A∗ under various setups. Goldberg and Werneck [67] propose a preprocessing phase where initially a number of landmarks are selected followed by the computation of the shortest-path where it is stored between the vertices of all these landmarks. They propose a constant-time lower-bound technique using the computed distances in addition to the triangle inequality property. The lower-bound technique is based on the A∗ algorithm, the landmark chosen, and the triangle inequality. Gutman [68] offers a comparable solution to the problem, where his work is based on the concept of reach. Gutman’s technique relies on storing a reach value and the Euclidean coordinates of all vertices. The advantage of Gutman’s approach is that it can be combined with the A∗ algorithm when compared to the work by Goldberg and Werneck [67], Gutman’s [68] outperforms their proposed technique given one landmark while it performs worse given sixteen landmarks. On the downside, Gutman’s approach depends on domain-specific assumptions, longer preprocessing complexity, and inapplicability in a dynamic setting. Potamias et al. [109] propose an approximate landmark-based technique for point-to-point distance estimation over large networks. A theoretical proof is presented to indicate that the problem is NP-Hard and they propose heuristic solutions. In specific, they propose a smart landmark selection technique that can yield higher accuracy, reaching 250 times less space than selecting landmarks at random. Among their evaluated strategies, the Centrality is more robust than the Degree strategy. Also, strategies based on partitioning, e.g., Border/P exhibit better computational cost across datasets. Kleinberg et al. [89] propose an algorithm with provable performance guarantees for beacon-based triangulation and embedding. The beacon-based algorithms are basically designed for triangulation, where 5 STATIC SHORTEST-PATH ALGORITHMS 11 they use the triangle inequality to deduce the unmeasured distances. They indicate that a multiplicative error of 1 + δ on a 1 − ǫ fraction of distances can be achieved by triangulation-based reconstruction given a constant number of beacons. The algorithm also achieves a constant distortion over 1 − ǫ of distances. Maue2009 et al. [95] claim that Dijkstra’s algorithm can be enhanced by precomputing the shortestpath distances. They propose to partition the graph into k non-overlapping clusters and perform two operations; (1) store the start and end point, (2) store the shortest connection between each pair of √ clusters. The proposed algorithm achieves a speed-up scaling factor of k in contrast to Dijkstra’s algorithm. 5.4.2 Advanced Goal-Directed Search Edge labels is an approach that relies on precomputing the information for an edge e and vertices M . The superset M (e) represents all the vertices on a shortest-path that start with an edge e. The graph is first partitioned into a set of regions of the same size alongside a precomputed set of boundary vertices. In order to compute the edge flags, an SSSP computation is done on the regions for all the boundary vertices. Various work, e.g., Kohler et al. [90], Schulz et al. [119], and Lauther [91] further present some of the edge-label variations. Möhring et al. [99] propose an algorithm for sparse directed graphs with non-negative edge weights, termed the arc-flag approach. The arc-flag approach preprocesses graph data to generate information that speeds up shortest-path queries by dividing the graph into regions and determining if an arc in a specific region lies on the shortest-path. Given a suitable partitioning scheme and a bi-directed search, the arc-flag approach 500 times faster than the standard Dijkstra’s algorithm over a large graph. Schilling et al. [116] present a further improvement by searching once for each region. Their approach achieves speed-up of more than 1,470 on a subnetwork of 1 million vertices. Goldberg and Werneck [67] propose an A∗ based search Landmarks (ALT) algorithm that uses the triangle inequality. They show that precomputing the distances to a set of landmarks can bound the shortest path computational cost. They propose an average of 20 landmarks that are well-distributed over the corners of the graph. In turn, their approach leads to speed up for route planning. Bauer et al. [16] study how to systematically combine speed-up techniques proposed for Dijkstra’s algorithm, e.g., adding goal-direction approaches to hierarchical approaches. They present generalized technique that demonstrates how speed-up performance can be improved. Their results show that Highway vertex Routing and Arc-Flags achieves the best speed-up while maintaining an adequate preprocessing cost. They also present a hierarchical A∗ -based search Landmarks (ALT) algorithm on dense graphs. Delling et al. [36] present an algorithm termed round-based public transit router (RAPTOR). RAPTOR is not based on Dijkstra’s algorithm as it probes each route in the graph at most once. RAPTOR works in fully dynamic scenarios and can be extended to handle, for example, flexible departure times. Bauer and Delling [15] uses hierarchical based techniques to extend the edge flag approach, e.g., using contraction hierarchies during preprocessing, and hence tackling a main processing drawback of edge flags. The proposed work is termed (Shortcuts + Arc-Flags) or SHARC, for short. The key observation about SHARC is that it is enough to set sub-optimal edge flags to most edges, and this focuses the preprocessing on important edges only. Another observation is that SHARC incorporates hierarchical aspects implicitly. SHARC also extends the edge flag approach of Möhring et al. [99] to achieve a fast unidirectional query algorithm. Maue et al. [95] propose a goal-directed algorithm that utilizes precomputed cluster distances (PCD). The proposed approach first partitions the graph into clusters. This is followed by precomputing the shortest connections between the pairs of clusters U and V . PCDs produce bounding factors for distances that can be used to prune the search when compared with the A∗ algorithm. In turn, this achieves a 5 STATIC SHORTEST-PATH ALGORITHMS 12 speed-up comparable to ALT while using less space. 5.5 Hierarchical Shortest-Path Hierarchical shortest-path algorithms deal with generating a multi-layered vertex hierarchy in the preprocessing stage. A hierarchical structure is prominent in areas, e.g., road networks, where it exhibits hierarchical properties, e.g., ordering important streets, motorways, and urban streets [117]. In general, methods using contraction hierarchies provide low space complexity. Contraction hierarchies contain many variants such as reach-based methods and highway hierarchies and vertex routing. On the other hand, Transit-vertex Routing and Hub Labels provide fast query-time [125]. The following sections discuss various algorithms that follow a hierarchical approach. 5.5.1 Highway Hierarchies Highway Hierarchies capture edge-based properties. For example, highway edges exhibit a better representation for shortest paths although they may not be located between the source and the destination vertices. The algorithm generates a hierarchy of graphs that enables fast query time with correctness guarantees. Sanders and Schultes [113, 114] propose a static undirected highway hierarchies algorithm around the notion of correctly defining local search and highway network appropriately. They define local search as one that visits H (tuning parameter) closest vertices from the source or target. A highway edge is created if it lies on the path from the source vertex to the destination vertex with that edge not being within the H closest vertices from the source or destination. Nannixini et al. [103] propose an algorithm that relies on time-dependent lengths. They extend the original algorithm by Sanders and Schultes [113] to the case of directed graphs. Their aim is to find the fastest paths on a large dynamic road network that have quasi real-time updates. 5.5.2 Contraction Hierarchies A contraction hierarchy has a level for each vertex reaching up to n levels. Hierarchical models can improve query performance as search can be conducted in an upwards manner only over the graph. This reduced the space complexity as edges are stored at their lower endpoints only. Geisberger et al. [62] propose contraction hierarchies, where vertices are initially ordered by importance, and then a hierarchy is generated by contracting the least important vertices in an iterative manner. Contracting is the process of replacing the shortest-paths passing a vertex by what they call shortcuts. They propose a hierarchical algorithm that utilizes a bidirectional shortest-path search technique. Batz et al. [14] propose a time-dependent version of the algorithm. It tackles time-dependent road networks where it proposes a fast and exact route planning algorithm. The issue it faces is space complexity. They tackle this problem by using approximations of piecewise-linear functions that lead to significant space reduction while preserving correctness. The proposed approach relies on approximating shortcuts and non-shortcuts to acquire time-dependent edge weights. Then, these weights can then be used with their bidirectional search algorithm to create a corridor of shortcuts that can be searched. Kieritzcite et al. [87] propose a distributed memory parallelization of time-dependent contraction hierarchies. The algorithm identifies vertices that can be contracted in every iteration. Parallelization is achieved when each process contracts its vertices independently and the vertices contractions do not overlap with each other. They attempt to approximate the ordering of the sequential algorithms used. 5 STATIC SHORTEST-PATH ALGORITHMS 13 Geisberger et al. [63] devise an algorithm based on contraction hierarchies to calculate continent-based shortest-paths. The preprocessing step relies on the hierarchical properties of road networks in order to add shortcut edges. They use a modified version of Dijkstra’s algorithm that visits only a few hundred vertices that in turn makes it suitable to implement on mobile devices. 5.5.3 Multi-Level Graphs In a multi-level overlay graph, if a set of vertices lie at a specific level, then the shortest-paths in that level do not use vertex from the upper levels. In turn, this method depends on the correct selection of vertices to act as landmarks on the higher levels. Schulz et al. [120] propose a multi-level graph-based decomposition method that targets space reduction. This method precomputed the shortest-paths and replaces the weights of single edges with a weight equal to the shortest-path length. The result is a subgraph that is smaller in size when compared with the original graph. The subgraph distances between a set of vertices is the same as the shortest-path graph distance between the same set of vertices in the original graph. Holzer et al. [80] introduce several vertex selection criteria on overlay graphs. These include criteria to determine a representative subset of the original graph. They investigate the criteria’s effectiveness over multilevel overlay graphs and the speed-up achieved for shortest-path computation. 5.5.4 Transit vertex Routing Transit vertex routing precomputed the shortest paths to and from all landmarks identified in a graph. The algorithm requires extensive preprocessing but exhibits very fast query time as it requires a limited number of look-ups between landmarks located in different locations. Bast et al. [12] propose transit vertex routing. They suggest that a vertical and horizontal sweep are sufficient to compute the set of transit vertices. They also illustrate some techniques to make the approach more space-efficient. Arz et al. [8] propose a variant of contraction hierarchies that achieves an order of magnitude speeds up , similar to the time needed to find contraction hierarchies. They propose a graph-theoretical locality filter that does not affect the query time. 5.5.5 Hub Labeling Modeling road networks as a low-dimensional graph is a method used for computing the shortest paths. One method used for such modeling is the process of labeling. Algorithms for labeling have been introduced in the distributed computing field [61, 132]. In the labeling preprocessing stage, each vertex v is computed and assigned a forward label and a reverse label. The forward label encompasses a set of vertices w, where each vertex contains a computed distance dist(v, w) from v. The reverse label consists of a set of vertices u, where each vertex contains a computed distance dist(u, v) to v. These labels are later used in the query stage to determine the vertices that minimize the distance from source to destination. A label can be perceived as a set of hubs that a vertex v has a direct connection to. The labeling algorithm ensures that any two vertices have one hub in common when computing the shortest path. Hub labeling starts by preprocessing the vertices, where, for each vertex v, it precomputes the distance to a set of landmarks L(v) in the vertex label. The query algorithm is fast as long as the number of landmarks of the source and destination vertices is small. Storing the labels in a consecutive manner allows the algorithm to exhibit good locality. Abraham and Delling [1, 2] propose a labeling scheme that, given a vertex s and t, it considers the 6 DYNAMIC SHORTEST-PATH ALGORITHMS 14 sets of vertices visited by the forward contraction hierarchy from s and the reverse contraction hierarchy of t. The contraction hierarchies algorithm computes for the shortest-path the intersection of the forward and reverse sets that contain the maximum-rank vertex. Babenko et al. [9] propose an approximation algorithm for producing small labels. Their main target is to reduce the size of the maximum hub-label. This reduction process leads to unbalanced solutions as vertices will have a skewed label sizes. They propose an approximation algorithm for the maximum label size that runs in O(logn). The proposed approach reduces the the hub-labeling problem to a set-covering problem. Cohen et al. [31] propose a data structure for storing the reachability label using a 2-hops cover of all the paths in a graph. Each vertex vǫV T precomputes the Label Lin and Lout ⊆ V such that, for any pair s and t, at least one vertex is in Lout (s) Lin (t). The distance labeling query finds the shortest-path from source s toTdestination t by finding the minimum distance from (Lout (s), x) to (x, Lin (t)) for each label xǫ(Lout (s) Lin (t)). The size of a label L is not guaranteed and the polynomial preprocessing time is approximately O(logn) for finding a 2-hop cover of the invariant paths whose size is larger than the set of all shortest-paths. Chang et al. [29] propose a multi-hop distance labeling with a size smaller than another 2-hop labeling approach [31]. In the preprocessing phase, the algorithm stores a parent function P that assigns the parent vertex to each vertex by avoiding the preprocessing of the all-pairs shortest-path. The proposed approach performs vertex separation on the graph G that divides G into multiple connected subgraphs. The graph is further decomposed into a minimal tree T (I, F ), where I ⊂ V represents the set of vertices and F is the set of edges. The approach uses the distance query to compute the minimum distance. The time complexity of query processing is O(tw ∗ h), where tw represents the width and h represents the height of the decomposed tree T . 5.5.6 Highway Node Routing The motivation behind using highway node routing is that prominent vertices that overlap various shortest-paths will generate sparse overlay graphs. The result would be faster query processing and lower space overhead. Schultes and Sanders [118] proposes a dynamic algorithm that is space-efficient and allows query time to be thousand times faster when compared to Dijkstra’s algorithm. The choice of vertices is achieved by capitalizing on previous results in addition to using the required vertex sets defined by highway hierarchies algorithms. They simplify the complications of computation into the prepreprocessing step. This also leads to simplification of the query processing algorithm, especially the dynamic variants. Abraham [3] suggests that road networks do not necessarily have a significant highway dimension. The proposed algorithm relies on realizing balls of a specific radius r. For every r > 0, there exits a sparse set Sr where shortest-path of length more than r will have a vertex from the set Sr . If every ball having radius O(r) contains less number of vertices than Sr , then the set Sr is sparse. 6 Dynamic Shortest-Path Algorithms The main requirement of dynamic shortest-path algorithms is to process updates and query operations efficiently in an online fashion. In the update operation, edges are inserted or deleted from the graph. In the query operation, the distance between vertices is computed. Fully dynamic algorithms are those that can process insertions and deletions. Incremental algorithms can process insert operations, but not delete operations. Decremental algorithms can process delete operations, but not insert operations. This implies that incremental and decremental algorithms are 6 DYNAMIC SHORTEST-PATH ALGORITHMS 15 partially dynamic. The following section illustrates the algorithms that demonstrate the aforementioned differences. 6.1 All-Pairs Shortest-Path (APSP) The all-pairs shortest-paths algorithms reports the distances between any two vertices in a graph. The algorithms attempt to answer distance queries between any two vertices while dynamically maintaining changes that can occur to the graph such as inserts, deletes, and updates. Demetrescu and Italiano [38] propose a fully dynamic algorithm over directed graphs for all-pairs shortest-paths with real-valued edge weights. Every edge can have a predefined number of values. Their algorithm achieves an amortized time complexity of O(Sn2.5 log 3 n) for update operations while achieving an optimal worst-case for query processing time. The proposed algorithm for the update operation inserts or deletes a vertex in addition to all its possible edges. The algorithm also maintains a complete distance matrix between updates. Thorup [131] improves over Demetrescu and Italiano [38] by reducing the fully-dynamic graph problem to a smaller set of decremental problems. Thorup adopts the idea of a fully-dynamic minimum spanning tree by utilizing the efficiency of the decremental algorithm to solve the fully-dynamic all-pairs shortestpaths problem. Bernstein [19] presents a (2 + ǫ)-approximation algorithm for APSP over an undirected graph with positive edge weights. Bernstein’s algorithm achieves an update time that is almost linear and a query time of O(loglogn). The proposed query algorithm is deterministic while the update procedure is randomized. The algorithm run-time behavior depends on the distance from the source vertex to the destination vertex. Since d(x, y) is not known beforehand, the algorithm relies on guessing several different values for d(x, y). Roditty and Zwick [111] propose a fully dynamic APSP algorithm for unweighted directed graphs. The algorithm is randomized and the correctness of the returned results are claimed to be high. The proposed algorithm passes through a set of phases that rely on the ideas of a decremental algorithm [77]. They demonstrate how the incremental and decremental versions of the SSSP problems are similar in terms of complexity to the the static all-pairs shortest-paths problem over directed or undirected graphs Bernstein [21] proposes an (1 + ǫ) approximate algorithm that improves over existing studies with respect to the delete operation and edge weight increase. The algorithm computes the decremental all-pairs shortest-paths on weighted graphs. The approach achieves an update time of o(mn2 ) using a randomized algorithm. Henzinger et al. [75] enhances over the fastest deterministic algorithm by Shiloach and Even [122] by achieving an update time of O(n5/2 ). It also achieves a constant query time. Also, they propose a deterministic algorithm with with an update time of O(mn) and a query time of O(loglogn). They introduce two techniques, namely a lazy Even-Shiloach tree algorithm. The proposed approach maintains a shortest-paths tree that is bounded by distance with a Even-Shiloach tree based de-randomization technique. 6.2 Single-Source Shortest-Path The single-source shortest-paths algorithm reports the distances from a given source vertex. The dynamic algorithm computes the update and query operations in an online fashion. The update operation inserts, deletes, or modify the edge’s weight. The query operation probes for the distance from the source vertex to a given target vertex. Fakcharoenphol and Rao [51] propose an algorithm for planar graphs with real-valued edge weights. 7 TIME-DEPENDENT SHORTEST-PATH ALGORITHMS 16 It achieves a time complexity of O(nlog 3 n). It performs update and query operations in O(n4/5 log 13/5 n) amortized time. The proposed algorithm uses Monge matrices [26] with a combination of Bellman-Ford and Dijkstra’s algorithms for searching in sub-linear time. Bernstein and Roditty [22] propose a dynamic shortest-paths algorithm that can achieve an update time better than O(n) without sacrificing query time. In specific, they obtain O(n2+o(1) ) total update time and constant query time. The main type of graphs that it can achieve this result on is moderately sparse graphs. Bernstein and Roditty propose two randomized decremental algorithms that operate over unweighted, undirected graph for two approximate shortest-path problems. Henzinger et al. [76] improve the update operation time of Bernstein and Roditty [22] to O(n1.8+o(1) + m ) while maintaining a constant query time. The algorithm utilizes the center-cover data structure where, given a parameter h and a constant γ, maintains O(h) vertices, referred to as centers. The main property of the center-cover data structure is that every vertex within a specific distance is in a tree termed Even-Shiloach tree (ES-tree). The proposed algorithm has the same property of the center-cover data structure and is fastest when h is moderately small. 1+o(1) 7 Time-Dependent Shortest-Path Algorithms A time-dependent shortest-path algorithm processes graphs that have edges associated with a function, known as an edge-delay function. The edge-delay function indicates how much time is needed to travel from one vertex to another vertex. The query operation probes for the the minimum-travel-time path from the source to the destination vertex over graph. The returned result represents the best departure time found in a given time interval. 7.1 Continuous-Time Algorithms Kanoulas et al. [82] propose an algorithm that finds a set of all fastest paths from source to destination given a specified time interval. The specified interval is defined by the user and represents the departure or arrival time. The query algorithm finds a partitioning scheme for the time interval and creates a set of sub-intervals where each sub-interval is assigned to a set of fastest paths. Unlike the A∗ algorithm, the proposed algorithm probes the graph only once instead of multiple times. Ding et al. [43] propose an algorithm that finds the departure time that minimizes the travel time over a road network. Also, the traffic conditions are dynamically changing in the road network. The algorithm is capable of operating on a variety of time-dependent graphs. George et al. [64, 65] propose a Time-Aggregated Graph (TAG) graph that changes its topology with time. In TAG, vertices and edges are modeled as time series. Apart from time dependence, it is also responsible for managing the edges and vertices that are absent during any instance in time. They propose two algorithms to compute shortest-path using time-aggregated network (SP-TAG) and best start-time shortest-path (BEST). SP-TAG finds the shortest-path at the time of given query using a greedy algorithm. On the other hand, BEST algorithm finds out the best start-time (i.e., earliest travel time) over the entire period using TAG. The time complexity of SP-TAG and BEST are O(e(logT +logn), and O(n2 eT ), respectively, where e represents edges, n represents vertices, and T represents the time instance. Ding et al. [43] propose an algorithm for the shortest-path problem over a large time-dependent graph GT. Each edge has a delay function that denotes the time taken from the source vertex to the destination vertex at a given time. The user queries the least travel time (LTT). The proposed algorithm achieves a space complexity of O((n + m)α(T )) and a time complexity of O((nlogn + m)α(T )). 8 STOCHASTIC SHORTEST-PATH ALGORITHMS 7.2 17 Discrete-Time Algorithms Nannicini et al. [104] propose a bidirectional A∗ algorithm that restricts the A∗ search to a set of vertices that are defined by a time-independent algorithm. The bidirectional A∗ algorithm operates in two modes, where the first mode, namely theforward search algorithm, is run on the graph weighted by a specific cost function while the second mode, namely the backward search, is run on the graph weighted by a lower-bound function. Delling and Wagner [37] reanalyzes various time-dependent technique. The concluded that the most of the techniques that operate over time-dependent graphs guarantee correctness by augmenting the preprocessing and query phases subroutines. Foschini et al. [54] study the computational complexity of the shortest-paths problem over timedependent graphs. They conclude that linear edge-cost functions causes the shortest path to the destination changes nθ(logn) times. They study the complexity of the arrival time by mapping the problem to a parametric shortest-paths problem in order for it to be analyzed correctly. Demiryurek et al. [40] propose a technique to speed-up the fastest-path computation over timedependent spatial graphs. They propose a technique based on the A∗ bidirectional time-dependent algorithm that operates in two main stages. The first stage is pre-computation, where it partitions the graph into a set of partitions that do not overlap. Next, they calculate a lower-bound distance label for vertices and borders. The second state is online, where it probes for the fastest path by utilizing a heuristic function based on the computed distance labels. The results indicate that the proposed technique decreases the computation time and reduces the storage complexity significantly. 8 Stochastic Shortest-Path Algorithms A stochastic shortest-path attempts to capture the uncertainty associated with the edges by modeling them as random variables. Then, the objective becomes to compute the shortest-paths based on the minimum expected costs. The two notable lines of research in this problem are adaptive and nonadaptive algorithms. The adaptive algorithms determine what the next best next hop would be based on the current graph at a certain time instance. The non-adaptive algorithms focus on minimizing the length of the path. 8.1 Adaptive Algorithms Miller-Hooks and Mahmassani [96] propose an algorithm to determine the apriori least-expected-timepaths from all source vertices to a single destination vertex. This computation is for done for each departure time during busy time of the graph. They also propose a lower-bound over these apriori least-expected-time-paths. Nikolova et al. [107] propose an algorithm that maximizes the probability without exceeding a specific threshold for the shortest-paths length. They define a probabilistic model where edge weights are drawn from a known probability distribution. The optimal path is the one with the maximum probability indicating a path that does not pass a specific threshold. 8.2 Non-Adaptive Algorithms Loui [93] proposes using a utility function with the length of the path, where the utility function is monotone and non-decreasing. When the utility function exhibits a linear or an exponential behavior, it 9 PARAMETRIC SHORTEST-PATH ALGORITHMS 18 becomes separable into the edge lengths. This allows the utility function to be identified using classical shortest-paths algorithms via paths that maximize the utility function. Nikolova et al. [106] propose an algorithm for optimal route planning under uncertainty. They define the target as a function of both the path length and the departure time starting from the source. They indicate that path and start time are jointly optimizable due to the penalizing behavior that they exhibit for late and early arrivals. They also indicated that this joint optimization is reducible to classic shortestpath algorithms. 9 Parametric Shortest-Path Algorithms Parametric shortest-paths objective is to compute the shortest-paths for all vertices based on a specific parameter. It probes for the parameter values known as breakpoints where the shortest-path tends to change. The edge value varies based on a linear function of the parameter value. Mulmuley and Shah [102] propose a model for lower-bound computation. It is a variant of the Parallel Random Access Machine. The proof starts with a lower-bound definition about the parametric complexity of the shortest-path problem. Plotting the weights of the shortest-path as a function results in an optimal cost graph that is piecewise-linear and concave. Breakpoints are defined as a fixed set of linear weight functions over a fixed graph. Young et al. [138] propose a model where the computed edge values makes it more tractable than its predecessors. This tractability allows obtaining shortest-paths in polynomial time. They use the algorithm proposed by Karp and Orlin [85] and modify it to use Fibonacci heaps instead in order to improve its performance. Erickson [50] proposes an algorithm for computing the maximum flow in planar graphs. The algorithm maintains three structures, namely an edge spanning tree, a predecessor dual vertex set, and the slack value of dual edge set. They compute the initial predecessor pointers and slacks in O(nlogn) using Dijkstra’s algorithm. 10 Replacement Shortest-Path Algorithms Consider a Graph G = (V, E), where V is the set of vertices and E is the set of edges. For every Edge e ε E on the shortest-path from source s ε V to destination d ε V , the replacement path algorithm calculates the shortest-path from s to d that avoids e. Emek et al. [49] propose an algorithm that computes the replacement path in near-linear time. The algorithm requires O(nlog 3 n) time during the preprocessing stage and O(hloglogn) time to answer the replacement path query, where h is the number of hops in a weighted planar directed graph. Roditty and Zwick [112] propose a Monte-Carlo randomized algorithm that computes√the replacement path in an unweighted directed graph. The run-time complexity of the algorithm is Õ(m n). The Monte Carlo algorithm √ improves the run-time of the k-simple shortest-path and Vickrey pricing problems [79] by a factor of n. Bernstein [20] proposes an approximate (1 + ǫ) replacement-path algorithm that computes the paths in O(ǫ−1 log 2 n(m + nlog(nC/c)(m + nlogn)) = Õ(mlog(nC/c)/ǫ) time, where C/c is the ratio√ of largest and smallest edge-weights in the graph. Bernstein’s algorithm achieves a running time of Õ(km n) when applied over the k-th simple shortest-paths problem. 11 ALTERNATIVE SHORTEST-PATH ALGORITHMS 11 19 Alternative Shortest-Path Algorithms The alternative shortest-path problem reports paths that avoid a given vertex or edge, termed the unwanted vertex or the unwanted edge. The key difference between the replacement-path and the alternative shortest-path is that the user is not required to specify the unwanted vertex or edge for replacement paths. The goal of the alternative path problem is reusing the previously computed results of the unwanted vertex or edge. In turn, this achieves better performance. Existing algorithms, e.g., all-pairs dynamic shortest-paths, do not solve the alternative shortest-path problem because of the high complexity of the update operation. Xie et al. [136] propose a storage schemed, termed iSPQF. It is an extension of the shortest-path quad-tree [115] that further reduces the number of quad-trees at each vertex. The space complexity of the shortest-path quad-tree into forest (SPQF) is O(n1.5 ). The SPQF algorithm can find the alternative shortest-path over a single source (from source s to destination d that avoids Vertex v) as well as all pairs (from set of sources X to set of destinations Y that avoid Vertex v) in O(n) time-complexity. 12 Weighted Region Shortest-Path Algorithms Mitchell and Papadimitriou [97] define the Weighted Region Problem (WRP) as a generalization of the two-dimensional shortest path problem with obstacles. The problem assumes that the plane is subdivided into weighted polygonal regions. The objective is to minimize the cost according to a weighted Euclidean metric. The study by Mitchell and Papadimitriou sheds light on the discriminating properties of the weighted region problem over planar divisions and proposes an algorithm that runs in O(n8 L), where n is the number of vertices and L is the number of bits required to encode the problem instance. In specific, L = O(log(nN W/ǫW )), where N is the maximum integer representing vertices of the triangulation, and ǫ > 0 is a user-specified error value that can be tolerated. Mata and Mitchell [94] propose an algorithm to compute the approximate optimal-path for the weighted planar subdivision problem by constructing a sparse graph, termed the path-net. The approach uses Snell’s law of Refraction [133] to divide the vertices into cones that bound the path of a vertex. The worst-case complexity to build the path-net graph with O(kn) vertices is O(kn3 ), where k is the number of cones. After being scanned, it produces the paths that are within a factor of (1 + ǫ) from the optimal solution. 13 Conclusion In this paper, we devise a taxonomy for the shortest-path problem. For each branch of the taxonomy, we illustrate the discriminating features and highlight the state-of-the-art research. The taxonomy provides investigators of the shortest-path problem with a guideline on where a required problem definition maps within the current related work. Acknowledgements Walid G. Aref’s research has been supported in part by the National Science Foundation under Grant IIS 1117766. REFERENCES 20 References [1] I. Abraham and D. Delling. A hub-based labeling algorithm for shortest paths in road networks. Experimental Algorithms, 2011. [2] I. Abraham, D. Delling, A. Goldberg, and R. Werneck. Hierarchical hub labelings for shortest paths. AlgorithmsESA 2012, 2012. [3] I. Abraham, A. Fiat, A. V. Goldberg, and R. F. Werneck. Highway dimension, shortest paths, and provably efficient algorithms. Proceedings of the Twenty-First Annual ACM-SIAM Symposium on Discrete Algorithms, pages 782–793, 2010. [4] R. Agarwal, P. B. Godfrey, and S. Har-Peled. Approximate distance queries and compact routing in sparse graphs. IEEE INFOCOM, pages 1754–1762, 2011. [5] A. V. Aho and J. E. Hopcroft. The Design and Analysis of Computer Algorithms. AddisonWesley Longman Publishing Co., Inc., Boston, MA, USA, 1st edition, 1974. [6] W. Aiello, F. Chung, and L. Lu. A random graph model for massive graphs. STOC, 2000. [7] D. Aingworth, C. Chekuri, and R. Motwani. Fast Estimation of Diameter and Shortest Paths (without matrix multiplication). SODA, pages 547–553, 1996. [8] J. Arz, D. Luxen, and P. Sanders. Transit Node Routing Reconsidered. SEA, 2013. [9] M. Babenko, A. Goldberg, A. Gupta, and V. Nagarajan. Algorithms for hub label optimization. Automata, Languages, and Programming, 2013. [10] M. J. Bannister and D. Eppstein. Randomized Speedup of the Bellman-Ford Algorithm. ANALCO, 2011. [11] H. Bast. Car or public transport two worlds. Efficient Algorithms, pages 355–367, 2009. [12] H. Bast, S. Funke, D. Matijevic, P. Sanders, and D. Schultes. In Transit to Constant Time Shortest-Path Queries in Road Networks. ALENEX, 2007. [13] S. Baswana and S. Sen. A simple and linear time randomized algorithm for computing sparse spanners in weighted graphs. Random Structures and Algorithms, pages 532–563, 2007. [14] G. Batz, R. Geisberger, S. Neubauer, and P. Sanders. Time-dependent contraction hierarchies and approximation. Experimental Algorithms, pages 166–177, 2010. [15] R. Bauer and D. Delling. SHARC: Fast and robust unidirectional routing. Journal of Experimental Algorithmics (JEA), 2009. [16] R. Bauer, D. Delling, P. Sanders, D. Schieferdecker, D. Schultes, and D. Wagner. Combining hierarchical and goal-directed speed-up techniques for dijkstra’s algorithm. Journal of Experimental Algorithmics, pages 303–318, 2010. [17] R. Bellman. Dynamic Programming. Princeton University Press, 1957. [18] R. Bellman. On a routing problem. Quarterly of Applied Mathematics, 1958. [19] A. Bernstein. Fully Dynamic (2 + epsilon) Approximate All-Pairs Shortest Paths with Fast Query and Close to Linear Update Time. 2009 50th Annual IEEE Symposium on Foundations of Computer Science, pages 693–702, 2009. [20] A. Bernstein. A Nearly Optimal Algorithm for Approximating Replacement Paths and k Shortest Simple Paths in General Graphs. Proceedings of the Twenty-First Annual ACMSiam Symposium on Discrete Algorithms, pages 742–755, 2010. REFERENCES 21 [21] A. Bernstein. Maintaining shortest paths under deletions in weighted directed graphs. STOC, page 725, 2013. [22] A. Bernstein and L. Roditty. Improved dynamic algorithms for maintaining approximate shortest paths under deletions. ACM-SIAM Symposium on Discrete Algorithms, pages 1355– 1365, 2011. [23] P. v. E. Boas. Preserving order in a forest in less than logarithmic time. pages 75–84, 1975. [24] P. v. E. Boas, R. Kaas, and E. Zijlstra. Design and implementation of an efficient priority queue. Mathematical Systems Theory, pages 99–127, 1976. [25] S. Cabello. Many distances in planar graphs. Algorithmica, pages 361–381, 2012. [26] K. Cechlrov and P. Szab. On the monge property of matrices. Discrete Mathematics, 81(2):123 – 128, 1990. [27] T. M. Chan. All-pairs shortest paths for unweighted undirected graphs in o(mn) time. Proceedings of the seventeenth annual ACM-SIAM symposium on Discrete algorithm, pages 514–523, 2006. [28] T. M. Chan. More algorithms for all-pairs shortest paths in weighted graphs. Proceedings of the thirty-ninth annual ACM symposium on Theory of computing, pages 590–598, 2007. [29] L. Chang, J. X. Yu, L. Qin, H. Cheng, and M. Qiao. The exact distance to destination in undirected world. The VLDB Journal, 21(6):869–888, 2012. [30] W. Chen, C. Sommer, S.-H. Teng, and Y. Wang. A compact routing scheme and approximate distance oracle for power-law graphs. ACM Transactions on Algorithms, pages 1–26, 2012. [31] E. Cohen, E. Halperin, H. Kaplan, and U. Zwick. Reachability and Distance Queries via 2-Hop Labels. SIAM Journal on Computing, 32:1338–1355, 2003. [32] E. Cohen and U. Zwick. All-Pairs Small-Stretch Paths. Journal of Algorithms, pages 335–353, 2001. [33] D. Coppersmith and S. Winograd. Matrix multiplication via arithmetic progressions. Journal of Symbolic Computation, pages 251 – 280, 1990. [34] T. H. Cormen, C. Stein, R. L. Rivest, and C. E. Leiserson. Introduction to Algorithms. McGraw-Hill Higher Education, 2nd edition, 2001. [35] B. Dean. Shortest paths in FIFO time-dependent networks: Theory and algorithms. Rapport technique, 2004. [36] D. Delling, T. Pajor, and R. Werneck. Round-based public transit routing. ALENEX’12, 2012. [37] D. Delling and D. Wagner. Time-dependent route planning. Robust and Online Large-Scale Optimization, 2:1–18, 2009. [38] C. Demetrescu and G. Italiano. A new approach to dynamic all pairs shortest paths. Journal of the ACM (JACM), pages 1–29, 2004. [39] C. Demetrescu and G. F. Italiano. Dynamic shortest paths and transitive closure: Algorithmic techniques and data structures. Journal of Discrete Algorithms, pages 353–383, 2006. [40] U. Demiryurek, F. Banaei-kashani, and C. Shahabi. Online Computation of Fastest Path in Time-Dependent. SSTD, pages 92–111, 2011. [41] E. V. Denardo. Dynamic Programming: Models and Applications. Dover Publications, 2003. REFERENCES 22 [42] E. W. Dijkstra. A note on two problems in connexion with graphs. Numerische Mathematik, pages 269–271, 1959. [43] B. Ding, J. X. Yu, and L. Qin. Finding time-dependent shortest paths over large graphs. Proceedings of the 11th international conference on Extending database technology Advances in database technology EDBT 08, page 205, 2008. [44] H. Djidjev. Efficient algorithms for shortest path queries in planar digraphs. Graph-Theoretic Concepts in Computer Science, pages 151–165, 1996. [45] W. Dobosiewicz. A more efficient algorithm for min-plus multiplication. Internat. J. Comput. Math, 1990. [46] D. Dor, S. Halperin, and U. Zwick. All-pairs almost shortest paths. SIAM Journal on Computing, 2000. [47] J. Driscoll and H. Gabow. Relaxed heaps: An alternative to Fibonacci heaps with applications to parallel computation. Communications of the ACM, pages 1343–1354, 1988. [48] M. Elkin and D. Peleg. (1+epsilon,beta)-spanner constructions for general graphs. SIAM Journal on Computing, pages 608–631, 2004. [49] Y. Emek, D. Peleg, and L. Roditty. A near-linear-time algorithm for computing replacement paths in planar directed graphs. ACM Transactions on Algorithms, 6:1–13, 2010. [50] J. Erickson. Maximum flows and parametric shortest paths in planar graphs. SIAM, 2010. [51] J. Fakcharoenphol and S. Rao. Planar graphs, negative weight edges, shortest paths, and near linear time. Journal of Computer and System Sciences, pages 868–889, 2006. [52] R. Floyd. Algorithm 97: Shortest Path. Communications of the ACM, pages 344–348, 1962. [53] L. R. Ford. Network flow theory. Report P-923, The Rand Corporation, 1956. [54] L. Foschini, J. Hershberger, and S. Suri. On the complexity of time-dependent shortest paths. Algorithmica, 2014. [55] M. Fredman. New bounds on the complexity of the shortest path problem. SIAM, pages 83–89, 1976. [56] M. Fredman and R. Tarjan. Fibonacci heaps and their uses in improved network optimization algorithms. Journal of the ACM (JACM), pages 338–346, 1987. [57] M. Fredman and D. Willard. Trans-dichotomous algorithms for minimum spanning trees and shortest paths. Proceedings [1990] 31st Annual Symposium on Foundations of Computer Science, pages 719–725, 1990. [58] M. Fredman and D. Willard. Surpassing the information theoretic bound with fusion trees. Journal of computer and system sciences, pages 424–436, 1993. [59] M. L. Fredman and D. E. Willard. BLASTING through the information theoretic barrier with FUSION TREES. Proceedings of the twenty-second annual ACM symposium on Theory of computing - STOC ’90, pages 1–7, 1990. [60] L. Fu, D. Sun, and L. Rilett. Heuristic shortest path algorithms for transportation applications: State of the art. Computers & Operations Research, pages 3324–3343, 2006. [61] C. Gavoille, D. Peleg, S. Pérennes, and R. Raz. Distance labeling in graphs. J. Algorithms, pages 85–112, 2004. [62] R. Geisberger, P. Sanders, D. Schultes, and D. Delling. Contraction hierarchies: Faster and simpler hierarchical routing in road networks. Experimental Algorithms, pages 319–333, 2008. REFERENCES 23 [63] R. Geisberger, P. Sanders, D. Schultes, and C. Vetter. Exact routing in large road networks using contraction hierarchies. Transportation Science, pages 388–404, 2012. [64] B. George, S. Kim, and S. Shekhar. Spatio-temporal network databases and routing algorithms: A summary of results. Spatial and Temporal Databases, pages 460–477, 2007. [65] B. George and S. Shekhar. Time-Aggregated Graphs for Modeling. Advances in Conceptual Modelling, pages 85–99, 2006. [66] A. Goldberg. Point-to-point shortest path algorithms with preprocessing. SOFSEM, pages 9–12, 2007. [67] A. Goldberg and R. Werneck. Computing Point-to-Point Shortest Paths from External Memory. ALENEX/ANALCO, 2005. [68] R. Gutman. Reach-Based Routing: A New Approach to Shortest Path Algorithms Optimized for Road Networks. ALENEX/ANALC, 2004. [69] T. Hagerup. Improved shortest paths on the word RAM. Automata, Languages and Programming, pages 61–72, 2000. [70] Y. Han. Improved Fast Integer Sorting in Linear Space. Information and Computation, pages 81–94, 2001. [71] Y. Han. Improved algorithm for all pairs shortest paths. Information Processing Letters, pages 245–250, 2004. [72] Y. Han. An o(n3 (loglogn/logn)5/4) time algorithm for all pairs shortest paths. Proceedings of the 14th conference on Annual European Symposium - Volume 14, pages 411–417, 2006. [73] Y. Han and T. Takaoka. An o(n3 log log n/ log2 n) time algorithm for all pairs shortest paths. Proceedings of the 13th Scandinavian conference on Algorithm Theory, pages 131–141, 2012. [74] P. Hart, N. Nilsson, and B. Raphael. Formal basis for the heuristic determination of minimum cost paths. Systems Science and Cybernetics, pages 100–107, 1968. [75] M. Henzinger, S. Krinninger, and D. Nanongkai. Dynamic Approximate All-Pairs Shortest Paths: Breaking the O(mn) Barrier and Derandomization. 2013 IEEE 54th Annual Symposium on Foundations of Computer Science, pages 538–547, 2013. [76] M. Henzinger, S. Krinninger, and D. Nanongkai. A Subquadratic-Time Algorithm for Decremental Single-Source Shortest Paths. SODA, pages 1053–1072, 2014. [77] M. R. Henzinger and V. King. Fully Dynamic Biconnectivity. FOCS, pages 664–672, 1995. [78] M. R. Henzinger, P. Klein, S. Rao, and S. Subramanian. Faster Shortest-Path Algorithms for Planar Graphs. Journal of Computer and System Sciences, pages 3–23, 1997. [79] J. Hershberger and S. Suri. Vickrey prices and shortest paths: What is an edge worth? pages 252–, 2001. [80] M. Holzer, F. Schulz, and D. Wagner. Engineering multilevel overlay graphs for shortest-path queries. Journal of Experimental Algorithmics, 13(2):2.5, Feb. 2009. [81] M. Holzer, F. Schulz, D. Wagner, and T. Willhalm. Combining speed-up techniques for shortest-path computations. Journal of Experimental Algorithmics, 2005. [82] E. Kanoulas, Y. Du, T. Xia, and D. Zhang. Finding Fastest Paths on A Road Network with Speed Patterns. 22nd International Conference on Data Engineering (ICDE’06), pages 10–10, 2006. REFERENCES 24 [83] D. Karger, D. Koller, and S. Phillips. Finding the hidden path: time bounds for all-pairs shortest paths. Proceedings 32nd Annual Symposium of Foundations of Computer Science, pages 560–568, 1993. [84] R. Karp. A characterization of the minimum cycle mean in a digraph. Discrete mathematics, pages 309–311, 1978. [85] R. Karp and J. Orlin. Parametric shortest path algorithms with an application to cyclic staffing. Discrete Applied Mathematics, pages 37–45, 1981. [86] K.-i. Kawarabayashi, P. Klein, and C. Sommer. Linear-space approximate distance oracles for planar, bounded-genus and minor-free graphs. Automata, Languages and . . . , pages 135–146, 2011. [87] T. Kieritz, D. Luxen, P. Sanders, and C. Vetter. Distributed time-dependent contraction hierarchies. Experimental Algorithms, pages 1–11, 2010. [88] P. N. Klein, S. Mozes, and O. Weimann. Shortest Paths in Directed Planar Graphs with Negative Lengths : a Linear-Space O ( n log 2 n ) -Time Algorithm. ACM Transactions on Algorithms, 2010. [89] J. Kleinberg, a. Slivkins, and T. Wexler. Triangulation and Embedding Using Small Sets of Beacons. 45th Annual IEEE Symposium on Foundations of Computer Science, pages 444–453, 2004. [90] E. Köhler, R. Möhring, and H. Schilling. Acceleration of shortest path and constrained shortest path computation. Experimental and Efficient Algorithms, pages 1–17, 2005. [91] U. Lauther. An Extremely Fast, Exact Algorithm for Finding Short test Paths in Static Networks with Geographical Background. Geoinformation undMobilit at - von der Forschung zur praktischen Anwendung, pages 219–230, 2004. [92] R. Lipton, D. Rose, and R. Tarjan. Generalized nested dissection. SIAM journal on numerical analysis, (2):346–358, 1979. [93] R. Loui. Optimal paths in graphs with stochastic or multidimensional weights. Communications of the ACM, 1983. [94] C. Mata and J. S. B. Mitchell. A new algorithm for computing shortest paths in weighted planar subdivisions. Proc. 13th Annu. ACM Sympos. Comput. Geom., pages 264–273, 1997. [95] J. Maue, P. Sanders, and D. Matijevic. Goal-directed shortest-path queries using precomputed cluster distances. Journal of Experimental Algorithmics, 2009. [96] E. Miller-Hooks and H. Mahmassani. Least expected time paths in stochastic, time-varying transportation networks. Transportation Science, pages 198–215, 2000. [97] J. Mitchell and C. Papadimitriou. The Weighted Region Problem: Finding Shortest Paths Through a Weighted Planar Subdivision. 1990. [98] A. Moffat and T. Takaoka. An all pairs shortest path algorithm with expected running time o(n2 log n). SIAM J Computing, page 10231031, 1987. [99] R. H. Möhring, H. Schilling, B. Schütz, D. Wagner, and T. Willhalm. Partitioning graphs to speedup Dijkstra’s algorithm. Journal of Experimental Algorithmics, 2007. [100] E. F. Moore. The shortest path through a maze. Proceedings of the International Symposium of Switching Theory 1957, Part II, 1957. [101] S. Mozes and C. Sommer. Exact distance oracles for planar graphs. SODA, 2012. REFERENCES 25 [102] K. Mulmuley and P. Shah. A lower bound for the shortest path problem. Journal of Computer and System Sciences, 63:253–267, 2001. [103] G. Nannicini, P. Baptiste, G. Barbier, D. Krob, and L. Liberti. Fast paths in large-scale dynamic road networks. Computational Optimization and Applications, 2010. [104] G. Nannicini, D. Delling, L. Liberti, and D. Schultes. Bidirectional A search for timedependent fast paths. Experimental Algorithms, pages 334–346, 2008. [105] G. Nannicini and L. Liberti. Shortest paths on dynamic graphs. International Transactions in Operational Research, pages 551–563, 2008. [106] E. Nikolova, M. Brand, and D. Karger. Optimal Route Planning under Uncertainty. ICAPS, 2006. [107] E. Nikolova, J. Kelner, M. Brand, and M. Mitzenmacher. Stochastic shortest paths via quasiconvex maximization. AlgorithmsESA 2006, 2006. [108] M. Patrascu and L. Roditty. Distance oracles beyond the Thorup-Zwick bound. Foundations of Computer Science, (1):815–823, 2010. [109] M. Potamias, F. Bonchi, C. Castillo, and A. Gionis. Fast shortest path distance estimation in large networks. Proceeding of the 18th ACM conference on Information and knowledge management - CIKM ’09, page 867, 2009. [110] L. Roditty and A. Shapira. All-pairs shortest paths with a sublinear additive error. ACM Transactions on Algorithms, pages 1–12, 2011. [111] L. Roditty and U. Zwick. On Dynamic Shortest Paths Problems. Algorithmica, pages 389–401, 2010. [112] L. Roditty and U. Zwick. Simple shortest paths in unweighted directed graphs. ACM Transactions on Algorithms, 8(4):1–11, 2012. [113] P. Sanders and D. Schultes. Highway hierarchies hasten exact shortest path queries. AlgorithmsEsa 2005, pages 568–579, 2005. [114] P. Sanders and D. Schultes. Engineering highway hierarchies. AlgorithmsESA 2006, pages 804–816, 2006. [115] J. Sankaranarayanan, H. Alborzi, and H. Samet. Efficient query processing on spatial networks. pages 200–209, 2005. [116] E. K. Schilling, R. H. Möhring, and Heiko. Fast point-to-point shortest path computations with arc-flags. DIMACS Challenge, 2006. [117] D. Schultes. Fast and exact shortest path queries using highway hierarchies. Master-Arbeit, Universität des Saarlandes, . . . , 2005. [118] D. Schultes and P. Sanders. Dynamic highway-node routing. Experimental Algorithms, pages 66–79, 2007. [119] F. Schulz, D. Wagner, and K. Weihe. Dijkstra s Algorithm On Line : An Empirical Case Study from Public Railroad Transport. Vitter, J.S., Zaroliagis, C.D., 1999. [120] F. Schulz, D. Wagner, and C. Zaroliagis. Using multi-level graphs for timetable information in railway systems. Algorithm Engineering and Experiments, pages 43–59, 2002. [121] S. Sen. Approximating shortest paths in graphs. WALCOM: Algorithms and Computation, pages 32–43, 2009. REFERENCES 26 [122] Y. Shiloach and S. Even. An on-line edge-deletion problem. J. ACM, 1981. [123] M. Sniedovich. Dijkstra s algorithm revisited : the dynamic programming connexion. Journal of Control and Cybernetics, pages 599–620, 2006. [124] M. Sniedovich. Dynamic Programming: Foundations and Principles. Francis and Taylor, 2010. [125] C. Sommer. Shortest-path queries in static networks. ACM Computing Surveys, 2012. [126] T. Takaoka. A new upper bound on the complexity of the all pairs shortest path problem. Information Processing Letters, pages 195–199, 1992. [127] T. Takaoka. A faster algorithm for the all-pairs shortest path problem and its application. COCOON, pages 278–289, 2004. [128] M. Thorup. On RAM priority. SODA, pages 59–67, 1996. [129] M. Thorup. Undirected single-source shortest paths with positive integer weights in linear time. Journal of the ACM (JACM), pages 1–33, 1999. [130] M. Thorup. Compact oracles for reachability and approximate distances in planar digraphs. Journal of the ACM, 51:993–1024, 2004. [131] M. Thorup. Fully-dynamic all-pairs shortest paths: Faster and allowing negative cycles. Algorithm Theory-SWAT 2004, pages 384–396, 2004. [132] M. Thorup and U. Zwick. Approximate distance oracles. Journal of the ACM, 52:1–24, 2005. [133] W. Warntz. Transportation, social physics, and the law of refraction. The Professional Geographer, pages 2–7, 1957. [134] S. Warshall. A theorem on boolean matrices. Journal of the ACM (JACM), (1), 1962. [135] C. Wulff-Nilsen. Constant time distance queries in planar unweighted graphs with subquadratic preprocessing time. Computational Geometry, pages 831–838, 2013. [136] K. Xie, K. Deng, S. Shang, X. Zhou, and K. Zheng. Finding Alternative Shortest Paths in Spatial Networks. ACM Transactions on Database Systems, pages 1–31, 2012. [137] J. Y. Yen. An algorithm for finding shortest routes from all source nodes to a given destination in general networks. Quarterly of Applied Mathematics, 1970. [138] N. Young, R. Tarjant, and J. Orlin. Faster parametric shortest path and minimumbalance algorithms. Networks, 21, 2002. [139] U. Zwick. All pairs shortest paths in weighted directed graphs-exact and almost exact algorithms. Proceedings 39th Annual Symposium on Foundations of Computer Science (Cat. No.98CB36280), pages 310–319, 1998. [140] U. Zwick. Exact and approximate distances in graphsa survey. ESA, 2001. [141] U. Zwick. A slightly improved sub-cubic algorithm for the all pairs shortest paths problem with real edge lengths. pages 921–932, 2004.
8cs.DS
Event-triggered stabilization of disturbed linear systems over digital channels arXiv:1801.08704v1 [math.OC] 26 Jan 2018 Mohammad Javad Khojasteh, Mojtaba Hedayatpour, Jorge Cortés, Massimo Franceschetti Abstract— We present an event-triggered control strategy for stabilizing a scalar, continuous-time, time-invariant, linear system over a digital communication channel having bounded delay, and in the presence of bounded system disturbance. We propose an encoding-decoding scheme, and determine lower bounds on the packet size and on the information transmission rate which are sufficient for stabilization. We show that for small values of the delay, the timing information implicit in the triggering events is enough to stabilize the system with any positive rate. In contrast, when the delay increases beyond a critical threshold, the timing information alone is not enough to stabilize the system and the transmission rate begins to increase. Finally, large values of the delay require transmission rates higher than what prescribed by the classic data-rate theorem. The results are numerically validated using a linearized model of an inverted pendulum. Index Terms— Control under communication constraints, event-triggered control, quantized control rate of transmission. This apparently counterintuitive result can be explained by noting that the act of triggering essentially reveals the state of the system, which can then be perfectly tracked by the controller. Our previous work [31] quantifies the information implicit in the timing of the triggering events, as a function of the communication delay and for a given triggering strategy, showing a phase transition behavior. When there are no system disturbances and the delay in the communication channel is small enough, a positive rate of transmission is all is needed to achieve exponential stabilization. When the delay in the communication channel is larger than a critical threshold, the implicit information in the act of triggering is not enough for stabilization, and the transmission rate must increase. These results are compared with a time-triggered implementation subject to delay in [32]. I. I NTRODUCTION The literature, however, has not considered to what extent the implicit information in the triggering events is still valuable in the presence of system disturbances. These disturbances add an additional degree of uncertainty in the state estimation process, beside the one due to the unknown delay, and their effect should be properly accounted for. With this motivation, we consider stabilization of a linear, timeinvariant system subject to bounded disturbance over a communication channel having a bounded delay. In comparison with [31], we consider here a weaker notion of stability, requiring the state to be bounded at all times beyond a fixed horizon, but without imposing exponential convergence guarantees. This allows to simplify the treatment and to derive a simpler event-triggered control strategy. We design an encoding-decoding scheme for this strategy, and show that when the size of the packet transmitted through the channel at every triggering event is above a certain fixed value, then for small values of the delay our strategy achieves stabilization using only implicit information and transmitting at a rate arbitrarily close to zero. In contrast, for values of the delay above a given threshold, the transmission rate must increase and eventually surpasses the one prescribed by the classic data-rate theorem. It follows that for small values of the delay, we can successfully exploit the implicit information in the triggering events and compensate for the presence of system disturbances. On the other hand, large values of the delay imply that information has been excessively aged and corrupted by the disturbance, so that increasingly higher communication rates are required. All results are numerically validated by implementing our strategy to stabilize an inverted pendulum, linearized about its equilibrium point, over a communication channel. Proofs are omitted for brevity and will appear in full elsewhere. Networked control systems (NCS) [1], where the feedback loop is closed over a communication channel, are a fundamental component of cyber-physical systems (CPS) [2], [3]. In this context, data-rate theorems state that the minimum communication rate to achieve stabilization is equal to the entropy rate of the system, expressed by the sum of the logarithms of the unstable modes. Early examples of datarate theorems appeared in [4], [5]. Key later contributions appeared in [6] and [7]. These works consider a “bit-pipe" communication channel, capable of noiseless transmission of a finite number of bits per unit time evolution of the system. Extensions to noisy communication channels are considered in [8]–[12]. Stabilization over time-varying bit-pipe channels, including the erasure channel as a special case, are studied in [13], [14]. Additional formulations include stabilization of systems with random open loop gains over bit-pipe channels [15], stabilization of switched linear systems [16], systems with uncertain parameters [15], [17], multiplicative noise [18], [19], optimal control [20]–[23], and stabilization using event-triggered strategies [24]–[29]. This paper focuses on the case of stabilization using eventtriggered communication strategies. In this context, a key observation made in [30] is that if there is no delay in the communication process, there are no system disturbances, and the controller has knowledge of the triggering strategy, then it is possible to stabilize the system with any positive M. J. Khojasteh and M. Franceschetti are with the Department of Electrical and Computer Engineering of University of California, San Diego. M. Hedayatpour is with the Faculty of Engineering & Applied Science, University of Regina, SK, Canada. J. Cortés is with the Department of Mechanical and Aerospace Engineering, University of California, San Diego.{mkhojasteh,massimo,cortes}@ucsd.edu, hedayatm@uregina.ca Notation: Throughout the paper, R and N represent the set of real and natural numbers, respectively. Also, log and ln represent base 2 and natural logarithms, respectively. For a function f : R → Rn and t ∈ R, we let f (t+ ) denote the right-hand limit of f at t, namely lims→t+ f (s). In addition, ⌊x⌋ (resp. ⌈x⌉) denote the nearest integer less (resp. greater) than or equal to x. We denote the modulo function by mod(x, y), whose value is the remainder after division of x by y. sign(x) denotes the sign of x. II. P ROBLEM we also define the k th triggering interval as ∆′k = tk+1 − tks . s When referring to a generic triggering or reception time, for convenience we skip the super-script k in tkr and tkc . In this setting, the classical data-rate theorem states that the controller can stabilize the plant if it receives information at least with rate A/ ln 2 [31]. Let bs (t) be the number of bits transmitted by the sensor up to time t. We define the information transmission rate as FORMULATION The block diagram of a networked control system as a plant-sensor-channel-controller tuple is represented in Figure 1. The plant is described by a scalar, continuous-time, (5) Rs = lim sup t→∞ bs (t) . t Since at every triggering interval the sensor sends g(ts ) bits, we have PN g(tks ) . (6) Rs = lim sup Pk=1 N ′ N →∞ k=1 ∆k At the controller, the estimated state is represented by x̂ and evolves during the inter-reception times as ˙ x̂(t) = Ax̂(t) + Bu(t), Fig. 1. System model. linear time-invariant model as: ẋ = Ax(t) + Bu(t) + w(t), (1) where x(t) ∈ R and u(t) ∈ R for t ∈ [0, ∞) are the plant state and control input, respectively, and w(t) ∈ R represents the process disturbance. The latter is upper bounded as: |w(t)| ≤ M, (2) where M is a positive real number. In (1), A is a positive real number, B ∈ R, and |x(0)| ≤ L (3) for some positive real number L. We assume that the sensor measures the system state exactly, and the controller acts with infinite precision and without delay. However, the measured state is sent to the controller through a communication channel that only supports a finite data rate and is subject to bounded delay. More precisely, when the sensor transmits packet via the communication channel, the controller will receive the packet entirely and without any error, but with unknown bounded delay. The sequence of triggering times at which the sensor transmits a packet of length g(tks ) bits, is denoted by {tks }k∈N and the sequence of times at which the controller receives the corresponding packet and decodes it, is denoted by {tkc }k∈N . Communication delays are uniformly upper-bounded by γ, a finite non-negative real number, as follows: ∆k = where ∆k is the k th tkc − tks ≤ γ, (4) communication delay. For all k ≥ 1, t ∈ [tkc , tk+1 ], c (7) starting from x̂(tk+ c ) with x̂(0) = x̂0 . We assume that the sensor has knowledge of the time the actuator performs the control action. This is to ensure that the sensor can also compute x̂(t) for all time t. In practice, this corresponds to assuming an instantaneous acknowledgment from the actuator to the sensor via the control input, as discussed in [8], [33]. To obtain such causal knowledge, one can monitor the output of the actuator provided that the control input changes at each reception time. In case the sensor has only access to the system state, one can use a narrowband signal in the control input to excite a specific frequency of the state, that can signal the time at which the control action has been applied. The state estimation error is defined as z(t) = x(t) − x̂(t), (8) where z(0) = x(0)− x̂0 . We use this error to determine when a triggering event occurs in our controller design to ensure a property similar to practical stability [34] for the system in (1). III. C ONTROL D ESIGN This section proposes our event-triggered control strategy, along with a quantization policy to generate and send packets at every triggering event, to stabilize the scalar, continuoustime linear time-invariant system described in Section II. Along the way, we also characterize a sufficient information transmission rate to accomplish this. Assume a triggering event occurs when |z(t)| = J, (9) where J is a positive real number. If the controller knows the triggering time ts , then it also knows that x(ts ) = ±J + x̂(ts ). It follows that, it may compute the exact value of x(ts ) by just transmitting one single bit at every triggering time. In general, however, the controller does not have knowledge of ts because of the delay, but only knows the bound in (4). Let z̄(tc ) be an estimate of z(tc ) constructed by the controller knowing that |z(ts )| = v(ts ) and using (4) and the decoded packet received through the communication channel. We define the following updating procedure, called jump strategy x̂(t+ c ) = z̄(tc ) + x̂(tc ). (10) At triggering time ts the sensor encodes the system state in packet p(ts ) of size g(ts ), consisting of the sign of z(ts ) and a quantized version of ts , which we denote by q(ts ), and send it to the controller. Using the bound in (4) and by decoding the received packet, the controller reconstructs the quantized version of ts . Finally, the controller can estimate z(tc ) as follows: z̄(tc ) = sign(z(ts ))JeA(tc −q(ts )) . (11) Using (11) and the quantization policy described in Theorem 1, if the sensor has causal knowledge of delay in the communication channel, then the sensor can calculate x̂(t) at each time t. Next, we show that the proposed event-triggered scheme has triggering intervals that are uniformly lower bounded and consequently does not show “Zeno behavior”, namely infinitely many triggering events in a finite time interval Lemma 2: Consider the plant-sensor-channel-controller model with plant dynamics (1), estimator dynamics (7), triggering strategy (9), and jump strategy (10). If the packet M (eAγ − 1) then size satisfies (14) for all k ∈ N, and J > Aρ 0 for all k ∈ N tk+1 − tks ≥ s = x(tc ) − x̂(t+ c ) |z(t+ c )| N →∞ = |z(tc ) − z̄(tc )| ≤ ρ0 J, ρ0 − 1 ln(1 + A M Aγ JA (e eAγ − 1) ) (13) then (12) holds. We next propose our quantization algorithm and rely on Lemma 1 to lower bound the packet size to ensure (12). Theorem 1: Consider the plant-sensor-channel-controller model with plant dynamics (1), estimator dynamics (7), triggering strategy (9), and jump strategy (10). If the control has enough information about x(0) such that state estimation error satisfies |z(0)| < J , there exists a quantization policy that achieves (12) for all k ∈ N with a packet size ) ( Abγ k , g(ts ) ≥ max 0, 1 + log Aγ −1) ) ln(1 + ρ0 −(M/JA)(e eAγ (14) M (eAγ − 1). where b > 1 and J > Aρ 0 Next, we show that using our encoding and decoding scheme, if the sensor has a causal knowledge of the delay in the communication channel, it can compute the state estimated by the controller. Proposition 1: Consider the plant-sensor-channelcontroller model with plant dynamics (1), estimator dynamics (7), triggering strategy (9), and jump strategy (10). k=1 ∆′k . (16) Using Lemma 2, we deduce that Rtr ≤ (12) where 0 < ρ0 < 1 is a constant design parameter. To find a lower bound on the size of the packet so that (12) is ensured, the next result bounds how large the difference |ts − q(ts )| of the triggering time and its quantized version can be. Lemma 1: For the plant-sensor-channel-controller model with plant dynamics (1), estimator dynamics (7), triggering strategy (9), and jump strategy (10), using (11) with J > M Aγ − 1), if Aρ0 (e |ts − q(ts )| ≤ N Rtr = lim sup PN = z(tc ) − z̄(tc ), the sensor chooses the packet size g(ts ) large enough to satisfy the following equation for all possible tc ∈ [ts , ts +γ] (15) The frequency with which transmission events are triggered is captured by the triggering rate Noting that with the jump strategy (10), we have z(t+ c ) J+M 1 A ln( ). A ρ0 J + M A A J+ M ln( ρ J+AM 0 A ) for all initial conditions and possible delay and process noise values. Combining this bound and Theorem 1, we arrive at the following result. Corollary 1: Consider the plant-sensor-channel-controller model with plant dynamics (1), estimator dynamics (7), triggering strategy (9), and jump strategy (10). If the control has enough information about x(0) such that state estimation M (eAγ −1), there exists error satisfies |z(0)| < J with J > Aρ 0 a quantization policy that achieves (12) for all k ∈ N and for all delay and process noise realization with an information transmission rate Rs ≥ A J+ M ln( ρ J+AM 0 A ( max 0, 1 + log ) Abγ ln(1 + (17) ) ρ0 −(M/JA)(eAγ −1) ) eAγ . Figure 2 shows the sufficient transmission rate as a function of the bound γ on the channel delay. As expected, the rate starts from zero and as γ increases, goes above the data-rate theorem. The next result ensures a property similar to practical stability [34] for the system in (1). Theorem 2: Consider the plant-sensor-channel-controller model with plant dynamics (1), estimator dynamics (7), triggering strategy (9), and jump strategy (10). Assume the pair (A, B) is stabilizable. If the control has enough information about x(0) such that state estimation error satisfies M (eAγ − 1), and if the sensor use |z(0)| < J with J > Aρ 0 the quantization policy proposed in Theorem 1, then there exists a time T0 and a real number κ such that, |x(t)| ≤ κ for all t ≥ T0 , provided that the packet size is lower bounded by (14). In addition, we add the process noise w(t) to the linearized system model. w(t) is a vector of length four, and we assume that all the elements of w(t) are upper bounded M . Also, a simple feedback control law can be derived for (18) as u = −ks where k is chosen such that A − Bk is Hurwitz.  We let k be as follows k = −1.00 −2.04 20.36 3.93 . Note that although Theorem 1 holds for the linear system with any worst-case delay, the linearizion is only valid for sufficiently small values of γ. 35 sufficient rate data-rate theorem 30 Rate (bits/s) 25 20 15 10 5 0 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 Channel Delay Upperbound, γ (sec) Fig. 2. Illustration of sufficient transmission rate as a function of γ. Here, M A=5.5651, ρ0 = 0.1, b = 1.0001, M = 0.2, and J = Aρ (eAγ −1)+0.1. 0 From Corollary 1, it follows that a transmission rate lower bounded by (17) is sufficient to ensure the property similar to practical stability stated in Theorem 2. IV. S IMULATION We now implement the proposed event-triggered control scheme on a dynamical system such as a linearized inverted pendulum. In this section, initially, a mathematical model of an inverted pendulum mounted on a cart is presented. Then the nonlinear equations are linearized about the equilibrium state of the system. In addition, a canonical transformation is applied to the linear time-invariant system to decouple the equations of motion. We consider the two-dimensional problem where motion of the pendulum is constrained in a plane and its position can be measured by angle θ. We assume that inverted pendulum has mass m1 , length l, and moment of inertia I. Also, the pendulum is mounted on top of a cart of mass m2 constrained to move in y direction. Nonlinear equations governing the motion of the cart and pendulum can be written as follows: 2 (I + m1 l )θ̈ + m1 g0 lsinθ = −m1 lÿcosθ where ν is the damping coefficient between the pendulum and the cart and g0 is the gravitational acceleration. A. Linearizion We define θ = π as the equilibrium position of the pendulum and φ as small deviations from θ. We derive the linearized equations of motion using small angle approximation. Let’s define state variable s = [y, ẏ, φ, φ̇]T , where y and ẏ are the position and velocity of the cart respectively. Assuming m1 = 0.2 kg, m2 = 0.5 kg, ν = 0.1 N/m/s, l = 0.3 m, I = 0.006 kg/m2 , one can write the evolution of s in time as follows:  0 0  A= 0 0 1 0 −0.1818 2.6730 0 0 −0.4545 31.1800 where  0 0 Ã =  0 0    0 0 0 10.0000   −5.6041 0 0   , B̃ = −2.3865  10.0979  0 −0.1428 0  0 0 5.5651 2.2513 s̃(t) = P −1 s(t) and w̃(t) = P −1 w(t). Moreover, ũ(t) = −k̃s̃(t) where k̃ = kP  , that is, k̃ = −1.0000 −0.1295 0.7422 7.2624 . C. Event-triggered design For the first three coordinates of the diagonalized system (19) which are stable the state estimation ŝ at the controller simply constructs as follows: ŝ˙ = Ãŝ(t) + B̃ ũ(t) (m1 + m2 )ÿ + ν ẏ + m1 lθ̈ cos θ − m1 lθ̇2 sinθ = F ṡ = As(t) + Bu(t) + w(t), B. Diagonalization The eigenvalues of the open-loop gain of the system A  are e = 0 −5.6041 −0.1428 5.5651 . Hence, three of the four modes of the system are stable and do not need any actuation. Also, the open-loop gain of the system A is diagonalizable (All eigenvalues of A are distinct). As a result, diagonalization of the matrix A, enables us to apply Theorem 1 to the unstable mode of the system, and consequently stabilize the whole system. Using the eigenvector matrix P , we diagonalize the system to obtain s̃˙ = Ãs̃(t) + B̃ ũ(t) + w̃(t) (19) (18)    0 0   0  , B = 1.8180 .  0  1 0 4.5450 starting from ŝ(0). The unstable mode of the system is as follow s̃˙ 4 = 5.5651s̃4(t) + 2.2513ũ(t) + w̃4 (t) (20) Then using the problem formulation in section II the estimated state for the unstable mode ŝ4 evolves during the inter-reception times as ŝ˙ 4 (t) = 5.5651ŝ4(t) + 2.2513ũ(t), t ∈ [tkc , tk+1 ], (21) c starting from ŝ4 (tk+ c ) and ŝ4 (0). The triggering occurs when |z̃4 (t)| = |s̃4 (t) − ŝ4 (t)| = J, where |z̃4 (t)| is the estate estimation error for the unstable mode. Let λ4 be the eigenvalue corresponding to the unstable mode which is equal to 5.5651. Then using Theorem 1 we choose M (eλ4 γ − 1) + 0.005, J= λ4 ρ0 exceeds the triggering function depends on the random channel delay with upper bound γ. In the second row of Figure 4, the evolution of the unstable state (20) and its state estimation are presented (21). Finally, the last row in Figure 4 represents the evolution of all actual states of the linearized system (18) in time. Finally, Figure 3 presents the simulation of information transmission rate versus the worst-case delay in communication channel γ for stabilizing the linearized model of the inverted pendulum. 25 simulations data-rate theorem Rate (bits/s) 20 15 10 5 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Channel Delay Upperbound, γ (sec) Fig. 3. Information transmission rate in simulations compared to the datarate theorem. Note that the rate calculated from simulations does not start at zero worst-case delay because the minimum channel delay upper bound is equal to one sampling time (0.005 seconds in this example). M is chosen to be 0.2 in these simulations, and simulation time is T = 5 seconds. and the size of the packet for all ts to be ( ) Abγ g(ts ) = max 1, ⌈1 + log , Aγ −1) ⌉ ) ln(1 + ρ0 −(M/JA)(e eAγ where b = 1.0001, ρ0 = 0.9. The packet size for the simulation has two differences from the lower bound provided in Theorem 1. Because the packet size should be an integer we used the ceiling operator, and since we should have at least one bit, to send a packet we take the maximum between 1 and the result of the ceiling operator. D. Simulation Results The following simulation parameters are chosen for the system: simulation time T = 5 seconds, sampling time ∆t = 0.005 seconds, s̃(0) = P −1 [0, 0, 0, 0.1001]T , and ŝ(0) = P −1 [0, 0, 0, 0.10]T . Theorem 1 is developed based on a continuous system but the simulation environments are all digital. We tried to make the discrete model as close to the continuous model by choosing a very small sampling time. However, the minimum upper bound for the channel delay will be equal to one sampling time. A set of three simulations are carried out as follows. For simulation (a) we assumed the process disturbance is zero and channel delay upper bounded by sampling time. In simulation (b) we assumed that the process disturbance upper bounded by M and channel delay upper bounded by sampling time. Finally, for simulation (c) we assumed that the process disturbance upper bounded by M and channel delay upper bounded by γ. Simulation results for simulation (a), (b) and (c) are presented in Figure 4. Each column represents a different simulation. The first row shows the triggering function for s̃4 (20) and the absolute value of state estimation error for the unstable coordinate, that is, |z̃4 (t)| = |s̃4 (t) − ŝ4 (t)|. As soon as the absolute value of this error is equal or greater than the triggering function, sensor transmit a packet, and the jumping strategy adjusts ŝ4 at the reception time to practically stabilize the system. The amount this error V. C ONCLUSIONS We have presented an event-triggered control scheme for the stabilization of noisy, scalar, continuous, linear timeinvariant systems over a communication channel subject to random bounded delay. We have also developed an algorithm for coding/decoding the quantized version of the estimated states, leading to the characterization of a sufficient transmission rate for stabilizing the system. We have illustrated our results on a linearization of the inverted pendulum for different channel delay bounds. Future work will study the identification of necessary conditions on the transmission rate, the investigation of the effect of delay on nonlinear systems, and the implementation of the proposed control strategies on real systems. ACKNOWLEDGEMENTS This research was partially supported by NSF award CNS1446891. R EFERENCES [1] J. P. Hespanha, P. Naghshtabrizi, and Y. Xu, “A survey of recent results in networked control systems,” Proceedings of the IEEE, vol. 95, no. 1, pp. 138–162, 2007. [2] K.-D. Kim and P. R. Kumar, “Cyber–physical systems: A perspective at the centennial,” Proceedings of the IEEE, vol. 100 (Special Centennial Issue), pp. 1287–1308, 2012. [3] R. M. Murray, K. J. Astrom, S. P. Boyd, R. W. Brockett, and G. Stein, “Future directions in control in an information-rich world,” IEEE Control Systems, vol. 23, no. 2, pp. 20–33, 2003. [4] W. S. Wong and R. W. Brockett, “Systems with finite communication bandwidth constraints. II. stabilization with limited information feedback,” IEEE Transactions on Automatic Control, vol. 44, no. 5, pp. 1049–1053, 1999. [5] J. Baillieul, “Feedback designs for controlling device arrays with communication channel bandwidth constraints,” in ARO Workshop on Smart Structures, Pennsylvania State Univ, 1999, pp. 16–18. [6] S. Tatikonda and S. Mitter, “Control under communication constraints,” IEEE Transactions on Automatic Control, vol. 49, no. 7, pp. 1056–1068, 2004. [7] G. N. Nair and R. J. Evans, “Stabilizability of stochastic linear systems with finite feedback data rates,” SIAM Journal on Control and Optimization, vol. 43, no. 2, pp. 413–436, 2004. [8] A. Sahai and S. Mitter, “The necessity and sufficiency of anytime capacity for stabilization of a linear system over a noisy communication link. Part I: Scalar systems,” IEEE Transactions on Information Theory, vol. 52, no. 8, pp. 3369–3395, 2006. [9] S. Tatikonda and S. Mitter, “Control over noisy channels,” IEEE transactions on Automatic Control, vol. 49, no. 7, pp. 1196–1201, 2004. [10] A. S. Matveev and A. V. Savkin, Estimation and control over communication networks. Springer Science & Business Media, 2009. [11] A. Khina, W. Halbawi, and B. Hassibi, “(almost) practical tree codes,” in 2016 IEEE International Symposium on Information Theory (ISIT), July 2016, pp. 2404–2408. [12] R. T. Sukhavasi and B. Hassibi, “Linear time-invariant anytime codes for control over noisy channels,” IEEE Transactions on Automatic Control, vol. 61, no. 12, pp. 3826–3841, 2016. M = 0.0, γ = 0.005 sec, g(ts ) = 1 bit 6 M = 0.05, γ = 0.005 sec, g(ts ) = 1 bit × 10-3 6 Triggering Function |z̃4 | 5 × 10-3 M = 0.05, γ = 0.1 sec, g(ts ) = 4 bits 0.06 Triggering Function |z̃4 | 5 4 4 0.04 3 3 0.03 2 2 0.02 1 1 0.01 0 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Triggering Function |z̃4 | 0.05 0 0 0.5 1 1.5 Time in seconds 2 2.5 3 3.5 4 4.5 5 0 0.5 1 1.5 Time in seconds 0.3 s̃4 ŝ4 0.25 0.2 0.2 0.15 0.15 0.1 0.1 0.05 0.05 0 0 -0.05 -0.05 -0.1 -0.1 2.5 3 3.5 4 4.5 5 0.3 0.3 s̃4 ŝ4 0.25 2 Time in seconds s̃4 ŝ4 0.25 0.2 0.15 0.1 0.05 -0.15 0 -0.05 -0.15 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -0.1 0 0.5 1 1.5 Time in seconds 2 2.5 3 3.5 4 4.5 5 0 0.5 1 1.5 Time in seconds 0.1 0.1 s1 s2 s3 s4 0.05 0 -0.05 2 2.5 3 3.5 4 4.5 5 Time in seconds 0.2 s1 s2 s3 s4 0.05 0 -0.05 s1 s2 s3 s4 0.1 0 -0.1 -0.1 -0.15 -0.15 -0.2 -0.2 -0.25 -0.25 -0.3 -0.3 -0.35 -0.35 -0.4 -0.4 0 0.5 1 1.5 2 2.5 3 Time in seconds 3.5 4 4.5 5 -0.1 -0.2 -0.3 -0.4 0 0.5 1 1.5 2 2.5 3 Time in seconds (a) (b) 3.5 4 4.5 5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Time in seconds (c) Fig. 4. Simulation results: The first row represents the absolute value of state estimation error for the unstable mode of the system (20). The second row represents the unstable mode (20), and its state estimate (21). Finally, and the last row represents the evolution of all actual states of the real system (18) in time. [13] P. Minero, M. Franceschetti, S. Dey, and G. N. Nair, “Data rate theorem for stabilization over time-varying feedback channels,” IEEE Transactions on Automatic Control, vol. 54, no. 2, p. 243, 2009. [14] P. Minero, L. Coviello, and M. Franceschetti, “Stabilization over Markov feedback channels: the general case,” IEEE Transactions on Automatic Control, vol. 58, no. 2, pp. 349–362, 2013. [15] V. Kostina, Y. Peres, M. Z. Rácz, and G. Ranade, “Rate-limited control of systems with uncertain gain,” 54th Annual Allerton Conference on Communication, Control, and Computing, pp. 1189–1196, 2016. [16] G. Yang and D. Liberzon, “Feedback stabilization of switched linear systems with unknown disturbances under data-rate constraints,” IEEE Transactions on Automatic Control, 2017. [17] G. Ranade and A. Sahai, “Control capacity,” in Information Theory (ISIT), 2015 IEEE International Symposium on. IEEE, 2015, pp. 2221–2225. [18] J. Ding, Y. Peres, G. Ranade, and A. Zhai, “When multiplicative noise stymies control,” arXiv preprint arXiv:1612.03239, 2016. [19] G. Ranade and A. Sahai, “Non-coherence in estimation and control,” in Communication, Control, and Computing (Allerton), 2013 51st Annual Allerton Conference on. IEEE, 2013, pp. 189–196. [20] S. Tatikonda, A. Sahai, and S. Mitter, “Stochastic linear control over a communication channel,” IEEE transactions on Automatic Control, vol. 49, no. 9, pp. 1549–1561, 2004. [21] V. Kostina and B. Hassibi, “Rate-cost tradeoffs in control,” in Communication, Control, and Computing (Allerton), 2016 54th Annual Allerton Conference on. IEEE, 2016, pp. 1157–1164. [22] A. Khina, Y. Nakahira, Y. Su, and B. Hassibi, “Algorithms for optimal control with fixed-rate feedback,” in 2017 IEEE 56th Annual Conference on Decision and Control (CDC), Dec 2017, pp. 6015– 6020. [23] A. Khina, G. M. Pettersson, V. Kostina, and B. Hassibi, “Multi-rate control over awgn channels via analog joint source-channel coding,” in Decision and Control (CDC), 2016 IEEE 55th Conference on. IEEE, 2016, pp. 5968–5973. [24] M. J. Khojasteh, P. Tallapragada, J. Cortés, and M. Franceschetti, [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] “The value of timing information in event-triggered control: The scalar case,” 54th Annual Allerton Conference on Communication, Control, and Computing, pp. 1165–1172, Sep. 2016. P. Tallapragada and J. Cortés, “Event-triggered stabilization of linear systems under bounded bit rates,” IEEE Transactions on Automatic Control, vol. 61, no. 6, pp. 1575–1589, 2016. L. Li, X. Wang, and M. Lemmon, “Stabilizing bit-rates in quantized event triggered control systems,” in Proceedings of the 15th ACM international conference on Hybrid Systems: Computation and Control. ACM, 2012, pp. 245–254. J. Pearson, J. P. Hespanha, and D. Liberzon, “Control with minimal cost-per-symbol encoding and quasi-optimality of event-based encoders,” IEEE Transactions on Automatic Control, vol. 62, no. 5, pp. 2286–2301, 2017. Q. Ling, “Bit rate conditions to stabilize a continuous-time scalar linear system based on event triggering,” IEEE Transactions on Automatic Control, 2017, to appear. S. Linsenmayer, R. Blind, and F. Allgöwer, “Delay-dependent data rate bounds for containability of scalar systems,” IFAC-PapersOnLine, vol. 50, no. 1, pp. 7875–7880, 2017. E. Kofman and J. H. Braslavsky, “Level crossing sampling in feedback stabilization under data-rate constraints,” in 45st IEEE Conference on Decision and Control (CDC). IEEE, 2006, pp. 4423–4428. M. J. Khojasteh, P. Tallapragada, J. Cortés, and M. Franceschetti, “The value of timing information in event-triggered control,” arXiv preprint arXiv:1609.09594, 2016. M. J. Khojasteh, P. Tallapragada, J. Cortés, and M. Franceschetti, “Time-triggering versus event-triggering control over communication channels,” in 2017 IEEE 56th Annual Conference on Decision and Control (CDC), Dec 2017, pp. 5432–5437. Q. Ling, “Bit rate conditions to stabilize a continuous-time linear system with feedback dropouts,” IEEE Transactions on Automatic Control, vol. PP, no. 99, pp. 1–1, 2017. V. Lakshmikantham, S. Leela, and A. A. Martynyuk, Practical stability of nonlinear systems. World Scientific, 1990.
3cs.SY
arXiv:1803.09301v1 [math.KT] 25 Mar 2018 TATE-BETTI AND TATE-BASS NUMBERS E. ENOCHS AND S. ESTRADA AND A. IACOB Abstract. We define Tate-Betti and Tate-Bass invariants for modules over a commutative noetherian local ring R. Then we show the periodicity of these invariants provided that R is a hypersurface. In case R is also Gorenstein, we see that a finitely generated R-module M and its Matlis dual have the same Tate-Betti and Tate-Bass numbers. 1. Introduction We consider a commutative noetherian local ring (R, m, k). It is known that a module M has a complete projective resolution T → P → M if and only if M has finite Gorenstein projective dimension. We prove that when M is a finitely generated R-module of finite Gorenstein projective dimension we can construct a complete projective resolution T → P → M with both T and P homotopically minimal complexes, and so unique up to isomorphism. Then each of the modules Pn (n ≥ 0) and Tn (n ∈ Z) are free modules of finite ranks. The ranks of the modules Pn are usually denoted βn (M) and are called the Betti numbers of M. The boundedness of the sequence of Betti numbers of a module M, as well as the interplay between the boundedness of the Betti numbers and the eventual periodicity of the module M have been studied intensively (see for example [4], [9], [10], [11], and [2]). We focus here on the invariants βbn (M), where for each n ∈ Z, βbn (M) is the rank of the module Tn . We call these invariants the Tate-Betti numbers of M (see [3] for another way to define these invariants). For an arbitrary module N we can use an analogous procedure to construct a complete injective resolution N → I → U where both I and U are homotopically minimal complexes (and hence unique up to isomorphism). Then we can define the Tate-Bass invariants µ bn (p, N) for n ∈ Z and p ⊂ R a prime ideal of R. 2010 Mathematics Subject Classification. 13H10,18G25, 18G35, 13D02. key words: Tate-Betti and Tate-Bass number, complete projective resolution, eventually periodic complex, Matlis duality. 1 2 E. ENOCHS AND S. ESTRADA AND A. IACOB Our main results (Theorem 2 and Theorem 3) give sufficient conditions on the residue field k that guarantee the periodicity of the Tate-Betti numbers βbn (M) (where M is finitely generated of finite Gorenstein projective dimension) and respectively the periodicity of the Tate-Bass numbers µ bn (m, N). We prove (Theorem 2) that if k has an eventually periodic minimal projective resolution with period s, then for every finitely generated R-module M we have that the Tate-Betti invariants of M are periodic of period s. We also prove (Theorem 3) that under the same hypothesis on k we have that the Tate-Bass invariants µ bn (m, N) are periodic of period s, for every module N of finite Gorenstein injective dimension. In the second part of the paper we consider a commutative local Gorenstein ring (R, m, k) and a finitely generated R-module M. We prove that if T → P → M is a minimal complete projective resolution of M, then M ν → P ν → T ν is a minimal complete injective resolution of M ν . It follows that for each n we have µ bn (m, M ν ) = βbn . Also, ν µn (m, M ) = βn (see Section 3 for definitions). 2. Preliminaries We recall that a module G is Gorenstein projective if there is an exact and Hom(−, P roj) exact complex . . . → P1 → P0 → P−1 → P−2 → . . . of projective modules such that G = Ker(P0 → P−1 ). Definition 1. A module R M has finite Gorenstein projective dimension if there exists an exact sequence 0 → Gn → Gn−1 → . . . → G1 → G0 → M → 0 with all Gi Gorenstein projective modules. If the integer n ≥ 0 is the least with this property then M has Gorenstein projective dimension n (in short, G.p.d.R (M) = n). If no such n exists then M has infinite Gorenstein projective dimension. The Gorenstein injective modules, and Gorenstein injective dimension are defined dually. The Tate cohomology modules are defined by means of complete resolutions. We recall the definition: Definition 2. A module M has a complete projective resolution if there u exists a diagram T − → P → M with P → M a projective resolution, T a totally acyclic complex and u : T → P a map of complexes such that un : Tn → Pn is an isomorphism for all n ≫ 0. TATE-BETTI AND TATE-BASS NUMBERS 3 It is known that a module M has a complete projective resolution if and only if and only if it has finite Gorenstein projective dimension. In particular, when R is Gorenstein, every R M has a complete projective resolution. Complete injective resolutions are defined dually. It is known that a module R N has a complete injective resolution if and only if N has finite Gorenstein injective dimension. Over a Gorenstein ring R, every module N has such a complete injective resolution. 3. Tate-Betti numbers and Tate-Bass numbers Let R be a commutative local noetherian ring, and let M be an Rmodule of finite Gorenstein projective dimension. Then there is a complete projective resolution of M, T → P → M. If M is finitely generated then we can choose P to be a minimal projective resolution of M ([7]). We recall ([8]) that a complex C is said to be homologically minimal if any homology isomorphism f : C → C is an isomorphism in C(R − Mod). A complex C is said to be homotopically minimal if each homotopy isomorphism f : C → C is an isomorphism. So if C is homologically minimal, it is also homotopically minimal. Thus a minimal projective resolution P of M, as above, is homotopically minimal and in fact homologically minimal (see page 78 in chapter 8 of [8]), and so such a P is unique up to isomorphism. We show first of all that when M is finitely generated we can also get T to be homotopically minimal, and so also unique up to isomorphism. We will use the following Lemma 1. Let K be a finitely generated Gorenstein projective reduced R-module (i.e. K has no nontrivial projective direct summands). Then there exists an exact and Hom(−, P roj) exact complex 0 → K → Q0 → Q−1 → Q−2 → . . . with each Qn a finitely generated free module. Proof. Let K be finitely generated, Gorenstein projective and reduced. Then the dual K ∗ = Hom(K, R) is also such. Also if 0 → K ′ → P → K → 0 is exact where P → K is a projective cover of K, then K ′ is also finitely generated, Gorenstein projective and reduced. Since the dual module, K ∗ , is a finitely generated Gorenstein projective module that is also reduced there exists a short exact sequence 0 → 4 E. ENOCHS AND S. ESTRADA AND A. IACOB L → P → K ∗ → 0 with P → K ∗ a projective cover, and with L Gorenstein projective finitely generated and reduced. This gives an exact sequence 0 → K ∗∗ → P ∗ → L∗ → 0 with P ∗ finitely generated projective, and with L∗ finitely generated Gorenstein projective and reduced. Then K ∗∗ → P ∗ is a projective preenvelope, and therefore if K ∗∗ → Q is the projective envelope then K ∗∗ → Q is an injective map; also, since coker(K → Q) is a direct summand of L∗ , it is finitely generated Gorenstein projective and reduced. So K has a projective envelope K → Q where K → Q is an injection and where coker(K → Q) is also finitely generated, Gorenstein projective and reduced. Also, if 0 → K → Q → K0 → 0 is exact, then Q → K0 is a projective cover ([7], Proposition 10.2.10). So there exists a short exact sequence 0 → K → Q → K0 → 0 with K → Q a projective preenvelope and with K0 a finitely generated reduced Gorenstein projective R-module. Continuing, we obtain an exact and Hom(−, P roj)-exact complex 0 → K → Q → Q−1 → Q−2 → . . . with each Qn a finitely generated free R-module.  We can prove now that when M is a finitely generated R-module of finite Gorenstein projective dimension we can construct a complete projective resolution T → P → M with both T and P unique up to isomorphism. To see this let 0 → Km → Pm−1 → · · · → P0 → 0 be a partial minimal projective resolution of M but where m = G.p.d.R M. Then Km is Gorenstein projective and since the resolution is minimal, Km is also reduced (i.e. has no nontrivial projective direct summands). Using Lemma 1 above it is not hard to see that there exists an exact and Hom(−, P roj) exact complex T with each Tn finitely generated free module, and with Km = Ker(Tm−1 → Tm−2 ). Since for each d, the complex . . . → Td+2 → Td+1 → Kd → 0 is a minimal projective resolution, it follows that T is a homologically minimal complex ([8], page 78). So for a finitely generated M we can construct a complete projective resolution T →P →M TATE-BETTI AND TATE-BASS NUMBERS 5 where both T and P are homotopically minimal, and so unique up to isomorphism. We call such a diagram a minimal complete projective resolution of M. Then each of Pn (n ≥ 0) and Tn (n arbitrary) are free modules of finite rank. As usual, the ranks of the Pn are denoted βn (M). We denote the ranks of the Tn by βbn (M). The numbers βn (M) are called the Betti invariants of M. We call the invariants βbn (M) the Tate-Betti invariants of M (see [3] for another way to define these invariants). For an arbitrary module N we can use an analogous procedure to construct a complete injective resolution N →I→U where both I and U are homotopically minimal complexes (and hence unique up to isomorphism). Then using Matlis and Bass, we can define the Bass invariants µn (p, N) for n ≥ 0 and p ⊂ R a prime ideal of R, and then the Tate-Bass invariants µ bn (p, N) for arbitrary n and p a prime ideal. Our main results are about the periodicity of these invariants. We recall first the following: Definition 3. A complex C = (Cn ) is said to be eventually periodic of period s ≥ 1 if for some n0 we have that for all n ≥ n0 that (Cn+1 → Cn → Cn−1 ) ∼ = (Cn+s+1 → Cn+s → Cn+s−1) Saying that C is periodic of period s will have the obvious meaning. Remark 1. If T → P → M is a minimal complete projective resolution of a finitely generated M and if P is eventually periodic, then trivially T is also eventually periodic. But using the minimality of T it can be seen that in fact T is periodic. If this is the case where the period is s then we see that βbn (M) = βbn+s (M) for all n. So we can say that the Tate-Betti invariants are periodic of period s. However it may happen that the Tate-Betti invariants of M are periodic without T being periodic. So we can speak of the invariants being periodic without the associated complex being periodic. 6 E. ENOCHS AND S. ESTRADA AND A. IACOB We prove that when the residue field k has an eventually periodic minimal projective resolution the Tate-Betti numbers of any finitely generated R M of finite Gorenstein projective dimension are periodic. Then we prove that under the same hypothesis on k, the Tate-Bass numbers µ bn (m, N) are periodic, for any R N of finite Gorenstein injective dimension. We will use [6] to deduce the following balance result (see also [3], Section 5). Theorem 1. Let R be any commutative ring. If T → P → M and N → I → U are complete projective and injective resolutions of M and N respectively (equivalently G.p.d.R (M) and G.i.d.R (N) are finite). Then the homologies of Hom(T, N) and of Hom(M, U) are naturally isomorphic. The analogous result for T ⊗ N and M ⊗ U also holds. Proof. Without lost of generality let us assume G.p.d.R (M) = m and G.i.d.R (N) = n and m ≥ n. H i (Hom(T, N)) = H i−m−1 (Hom(T, C−m )) ∼ = ∼ = H i−m−1 (Hom(Km , U)) = H i (Hom(M, U)), where C−m = Ker(U−m → U−m−1 ), Km = Ker(Tm → Tm−1 and ∼ = follows from ([6], Corollary 3.4). Note that if case m > n, we are using the fact that the class of Gorenstein injective modules is closed under cokernels of monomorphisms. The second statement follows in the same way.  We can prove now our main results. Theorem 2. If the residue field k of R as an R-module has an eventually periodic minimal projective resolution (with the period being s) then for every finitely generated module M of finite Gorenstein projective dimension we have that the Tate-Betti invariants of M are periodic of period s. Proof. We let T → P → k be a minimal complete projective resolution of k. Since P is eventually periodic of period s we have that the complex T is periodic of period s. Consequently the complex T ⊗ M is periodic of period s. This gives that for every n Hn (T ⊗ M) ∼ = Hn+s (T ⊗ M). ′ ∼ But by [3], Hn (T ⊗ M) = Hn (k ⊗ T ) for all n, where T ′ → P ′ → M is TATE-BETTI AND TATE-BASS NUMBERS 7 a minimal complete projective resolution of M. t′n+1 t′ n ′ ′ → Tn−1 → . . . is a homologically Since T ′ = . . . → Tn+1 −−→ Tn′ − minimal complex, it follows (Proposition 8.1.3 of [8]) that Im(t′n ) ⊂ ′ mTn−1 for all n. αn+1 αn ′ −−−→ k ⊗ Tn′ −→ Consider the complex k ⊗ T ′ = . . . → k ⊗ Tn+1 ′ k ⊗ Tn−1 . . .. We have αn ((x + m) ⊗ y) = (x + m) ⊗ t′n (y); by the ′ ′ above tn (y) = rz with r ∈ m and z ∈ Tn−1 . So αn ((x + m) ⊗ y) = (x + m) ⊗ rz = (xr + m) ⊗ z = (0 + m) ⊗ z = 0. Thus Im(αn ) = 0 and Ker(αn ) = k ⊗ Tn′ for all n. Then the n-th homology module of k ⊗ T ′ , b b Ker(αn ) Hn (k ⊗ T ′ ) = Im(α = k ⊗ Tn′ ≃ k ⊗ Rβn ≃ k βn , is a vector space of n+1 ) dimension βbn over k. Since Hn (k ⊗ T ′ ) ∼ = Hn (T ⊗ M) and since Hn (T ⊗ M) ∼ = Hn+s (T ⊗ M) b b for all n we see that βn (M) = βn+s (M) for all n.  Theorem 3. If the residue field k of R as an R-module has an eventually periodic minimal projective resolution (with period s ≥ 1), then for any module N of finite Gorenstein injective dimension, the invariants µ bn (m, N) are periodic of period s. Proof. Again let T → P → k be a minimal complete projective resolution of k and let N → I → U be a minimal complete injective resolution of N. We have that Hom(T, N) and Hom(k, U) have naturally isomorphic homology modules (Theorem 1). But T is periodic of period s, so Hom(T, N) is periodic of period s. So we get that H n (Hom(k, U)) ∼ = H n+s (Hom(k, U)) for all n. But as in Bass ([1]) we see that H n (Hom(k, U)) is a vector space over k whose dimension is precisely µ bn (m, N).  Remark 2. 1. If M is eventually periodic, then its Betti sequence is bounded. The converse is not true in general. A counterexample was given by R. Schulz in [12], Proposition 4.1. D. Eisenbud proved ([4]) that the converse does hold over group rings of finite groups, and that it also holds in the commutative Noetherian local setting when the rings considered are complete intersections. In fact, it was shown that over a hypersurface (that is, a complete intersection ring of codimension one) any minimal free resolution eventually becomes periodic. So over a hypersurface ring both Theorem 2 and Theorem 3 hold. Remark 3. Our main results hold provided that k has an eventually periodic minimal projective resolution, and so its Betti numbers are 8 E. ENOCHS AND S. ESTRADA AND A. IACOB bounded. By [10] (Corollary 1), if the Betti numbers of k are bounded then R is a hypersurface. So Theorems 2 and 3 both hold if and only if R is a hypersurface. 4. Matlis duality Let (R, m, k) be a commutative local Gorenstein ring, and let M be a finitely generated R-module. Then there exists a diagram T → P → M as above, with both T and P homotopically minimal, and so unique up to isomorphism. b Then for each n ∈ Z, we have Pn = Rβn and Tn = Rβn . We show that M ν → P ν → T ν is a minimal complete injective resolution of the module M ν , where M ν denotes the Matlis dual HomR (M, E(k)). - Since E(k) is injective, both P ν and T ν are exact complexes of injective modules. Let Mj = Ker(Pj−1 → Pj−2 ); then Mjν ⊂ Pjν is an injective preenvelope with Pjν = Hom(Rβj , E(k)) ≃ E(k)βj . So the injective envelope of Mjν is a direct summand of E(k)βj , so it is E(k)tj for some 1 ≤ tj ≤ βj . Then as in the proof of [7], Corollary 3.4.4, there is an exact sequence Rtj → Mj → 0. Therefore Rtj → Mj is a projective precover. Since Pj → Mj is a projective cover, it follows that Rβj is a direct summand of Rtj . So βj ≤ tj , and so we have βj = tj for all j, and Mjν → Pjν is an injective envelope, for all j. t t 1 0 Since T = . . . → T1 − → T0 − → T−1 → . . . is exact with each Tj finitely generated free and with each Gj+1 = Ker(tj ) Gorenstein projective, it follows that T ν is an exact complex of injective modules, with ν Ker(Tjν → Tj+1 ) = Gνj Gorenstein injective (we have that each Gj is also Gorenstein flat in this case, so T or1 (Gj , A) = 0, for any injective module A, for each j. Then Ext1 (A, Gνj ) = Ext1 (A, Hom(Gj , E(k)) ≃ Hom(T or1(Gj , A), E(k)) = 0, for any injective module A. It follows that Gνj is Gorenstein injective). Thus T ν is a totally acyclic injective complex. As above, since . . . → T1 → T0 → G0 → 0 is a minimal projective resolution, it follows that 0 → Gν0 → T0ν → T1ν → . . . is a minimal injective resolution. ν ν Similarly, 0 → Gν−n−1 → T−n−1 → T−n → . . . is a minimal injective ν resolution of G−n−1 . By [7], Theorem 10.1.13, the Gorenstein injective ν module Gν−n−1 is reduced. Thus T−n−1 → Gν−n is in fact an injective cover. Similarly we have that Tjν → Gνj+1 is an injective cover for each TATE-BETTI AND TATE-BASS NUMBERS 9 j ≤ 0. ν ν Thus . . . T−2 → T−1 → Gν0 → 0 is a minimal left injective resolution. So we have M ν → P ν → T ν a complete injective resolution of M ν with both P ν and T ν minimal. b We have Pnν = E(k)βn , and Tnν = E(k)βn , for each n. It follows that for each n we have µ bn (m, M ν ) = βbn . Also, µn (m, M ν ) = βn for each n ≥ 0. References [1] H. Bass. On the ubiquity of Gorenstein rings. Math. Zeitschr., 82: 8–28, 1963. [2] P. Bergh. Complexity and periodicity. Colloq. Math., 2:169–191, 2006. [3] L.W. Christensen, and D. Jorgensen. Tate (co)homology via pinched complexes. Transactions of the AMS, 366: 667–689, 2014. [4] D. Eisenbud. Homological Algebra on a complete intersection, with an application to group representations . Transactions of the AMS, 260:35–64, 1990. [5] E.E. Enochs and O.M.G. Jenda. Gorenstein injective and projective modules. Mathematische Zeitschrift, (220):611–633, 1995. [6] E.E. Enochs, and S. Estrada, and A. Iacob Balance with unbounded complexes. Bull. London Math. Soc., 44:439–442, 2012. [7] E.E. Enochs and O.M.G. Jenda. Relative Homological Algebra. Walter de Gruyter, 2000. De Gruyter Exposition in Math; 30. [8] E.E. Enochs and O.M.G. Jenda. Relative Homological Algebra 2. Walter de Gruyter, 2011. De Gruyter Exposition in Math; 54. [9] V. Gasharov, and I. Peeva. Boundedness versus periodicity over commutative local rings. Transactions of the AMS, 320:569–580, 1990. [10] T. Gulliksen. A proof of the existence of minimal R-algebra resolutions. Acta Math., 120:53–58, 1968. [11] I. Peeva Exponential growth of Betti numbers. Journal of Pure and Applied Algebra., 126:317–323, 1998. [12] R. Schultz Boundedness and periodicity of modules over QF rings. Journal of Algebra., 101:450–469, 1986.
0math.AC
1 The Rate-Distortion Function and Excess-Distortion Exponent of Sparse Regression Codes with Optimal Encoding Abstract—This paper studies the performance of sparse regression codes for lossy compression with the squared-error distortion criterion. In a sparse regression code, codewords are linear combinations of subsets of columns of a design matrix. It is shown that with minimum-distance encoding, sparse regression codes achieve the Shannon rate-distortion function for i.i.d. Gaussian sources R∗ (D) as well as the optimal excess-distortion exponent. This completes a previous result which showed that R∗ (D) and the optimal exponent were achievable for distortions below a certain threshold. The proof of the rate-distortion result is based on the second moment method, a popular technique to show that a non-negative random variable X is strictly positive with high probability. In our context, X is the number of codewords within target distortion D of the source sequence. We first identify the reason behind the failure of the standard second moment method for certain distortions, and illustrate the different failure modes via a stylized example. We then use a refinement of the second moment method to show that R∗ (D) is achievable for all distortion values. Finally, the refinement technique is applied to Suen’s correlation inequality to prove the achievability of the optimal Gaussian excess-distortion exponent. Index Terms—Lossy compression, sparse superposition codes, rate-distortion function, Gaussian source, error exponent, second moment method, large deviations I. I NTRODUCTION D EVELOPING practical codes for lossy compression at rates approaching Shannon’s rate-distortion bound has long been an important goal in information theory. A practical compression code requires a codebook with low storage complexity as well as encoding and decoding with low computational complexity. Sparse Superposition Codes or Sparse Regression Codes (SPARCs) are a recent class of codes introduced by Barron and Joseph, originally for communcation over the AWGN channel [1], [2]. They were subsequently used for lossy compression with the squared-error distortion criterion in [3]–[5]. The codewords in a SPARC are linear combinations of columns of a design matrix A. The storage complexity of the code is proportional to the size of the matrix, which is polynomial in the block length n. A computationally efficient encoder for compression with SPARCs was proposed in [5] and shown to achieve rates approaching the Shannon rate-distortion function for i.i.d. Gaussian sources. This work was partially supported by a Marie Curie Career Integration Grant (Grant Agreement Number 631489) and by NSF Grant CCF-1217023. This paper was presented in part at the 2014 IEEE International Symposium on Information Theory. R. Venkataramanan is with the Department of Engineering, University of Cambridge, Cambridge CB2 1PZ, UK (e-mail: ramji.v@eng.cam.ac.uk). S. Tatikonda is with the Department of Statistics and Data Science, Yale University, New Haven CT 06511, USA (e-mail: sekhar.tatikonda@yale.edu). 3.5 3 0.5 log σ2/D 2.5 Rate (bits) arXiv:1401.5272v6 [cs.IT] 19 Jun 2017 Ramji Venkataramanan, Senior Member, IEEE, and Sekhar Tatikonda, Senior Member, IEEE 2 1.5 1-D/σ2 1 0.5 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 D/σ2 Fig. 1. The solid line shows the previous achievable rate R0 (D), given in (1). The rate-distortion function R∗ (D) is shown in dashed lines. It coincides with R0 (D) for D/σ 2 ≤ x∗ , where x∗ ≈ 0.203. In this paper, we study the compression performance of SPARCs with the squared-error distortion criterion under optimal (minimum-distance) encoding. We show that for any ergodic source with variance σ 2 , SPARCs with optimal encoding achieve a rate-distortion trade-off given by 2 R∗ (D) := 12 log σD . Note that R∗ (D) is the optimal ratedistortion function for an i.i.d. Gaussian source with variance σ 2 . The performance of SPARCs with optimal encoding was first studied in [4], where it was shown that for any distortionlevel D, rates greater than    1 σ2 D R0 (D) := max log , 1 − 2 (1) 2 D σ are achievable with the optimal Gaussian excess-distortion exponent. The rate R0 (D) in (1) is equal to R∗ (D) when D D ∗ ∗ ∗ σ 2 ≤ x , but is strictly larger than R (D) when σ 2 > x , ∗ where x ≈ 0.203; see Fig. 1. In this paper, we complete the result of [4] by proving that sparse regression codes achieve the Gaussian rate-distortion function R∗ (D) for all distortions D ∈ (0, σ 2 ). We also show that these codes attain the optimal excess-distortion exponent for i.i.d. Gaussian sources at all rates. Though minimum-distance encoding is not practically feasible (indeed, the main motivation for sparse regression codes is that they enable low-complexity encoding and decoding), characterizing the rate-distortion function and excess-distortion exponent under optimal encoding establishes a benchmark to compare the performance of various computationally efficient 2 Section 1 M columns Section 2 M columns Decoder: This is a mapping h : BM,L → Rn . On receiving β ∈ BM,L from the encoder, the decoder produces reconstruction h(β) = Aβ. Since there are M columns in each of the L sections, the total number of codewords is M L . To obtain a compression rate of R nats/sample, we therefore need Section L M columns A: M L = enR . β: 0, 0, √cL , 0, √cL , 0, √c , 0, L ,0 T Fig. 2. A is an n × M L matrix and β is a M L × 1 binary vector. The positions of the non-zeros in β correspond to the gray columns of A which combine to form the codeword Aβ. encoding schemes. Further, the results of this paper and [4] together show that SPARCs retain the good covering properties of the i.i.d. Gaussian random codebook, while having a compact representation in terms of a matrix whose size is a low-order polynomial in the block length. Let us specify some notation before proceeding. Uppercase letters are used to denote random variables, and lowercase letters for their realizations. Bold-face letters are used to denote random vectors and matrices. All vectors have length n. The source sequence is S := (S1 , . . . , Sn ), and the reconstruction sequence is Ŝ := (Ŝ1 , . . . , Ŝn ). kxk denotes the √ is the normalized version. `2 -norm of vector x, and |x| = kxk n N (µ, σ 2 ) denotes the Gaussian distribution with mean µ and variance σ 2 . Logarithms are with base e and rate is measured in nats, unless otherwise mentioned. The notation an ∼ bn means that limn→∞ n1 log an = limn→∞ n1 log bn , and w.h.p is used to abbreviate the phrase ‘with high probability’. We will use κ, κ1 , κ2 to denote generic positive constants whose exact value is not needed. A. SPARCs with Optimal Encoding A sparse regression code is defined in terms of a design matrix A of dimension n × M L whose entries are i.i.d. N (0, 1). Here n is the block length and M and L are integers whose values will be specified in terms of n and the rate R. As shown in Fig. 2, one can think of the matrix A as composed of L sections with M columns each. Each codeword is a linear combination of L columns, with one column from each section. Formally, a codeword can be expressed as Aβ, where β is an M L×1 vector (β1 , . . . , βM L ) with the following property: there is exactly one non-zero βi for 1 ≤ i ≤ M , one non-zero βi for M + 1 ≤ i ≤ 2M , and so forth. The non-zero values of β are all set equal to √cL where c is a constant that will be specified later. Denote the set of all β’s that satisfy this property by BM,L . Minimum-distance encoder: This is defined by a mapping g : Rn → BM,L . Given the source sequence S, the encoder determines the β that produces the codeword closest in Euclidean distance, i.e., g(S) = argmin kS − Aβk. β∈BM,L (2) For our constructions, we choose M = Lb for some b > 1 so that (2) implies nR L log L = . (3) b Thus L is Θ (n/ log n),  and the number  of columns M L in b+1 the dictionary A is Θ (n/ log n) , a polynomial in n. B. Overview of our Approach To show that a rate R can be achieved at distortion-level D, we need to show that with high probability at least one of the enR choices for β satisfies |S − Aβ|2 ≤ D. (4) If β satisfies (4), we call it a solution. Denoting the number of solutions by X, the goal is to show that X > 0 with high probability when R > R∗ (D). Note that X can be expressed as the sum of enR indicator random variables, where the ith indicator is 1 if β(i) is a solution and zero otherwise, for 1 ≤ i ≤ enR . Analyzing the probability P (X > 0) is challenging because these indicator random variables are dependent: codewords Aβ(1) and Aβ(2) will be dependent if β(1) and β(2) share common nonzero terms. To handle the dependence, we use the second moment method (second MoM), a technique commonly used to prove existence (‘achievability’) results in random graphs and random constraint satisfaction problems [6]. In the setting of lossy compression, the second MoM was used in [7] to obtain the rate-distortion function of LDGM codes for binary symmetric sources with Hamming distortion. For any non-negative random variable X, the second MoM [8] bounds the probability of the event X > 0 from below as1 P (X > 0) ≥ (EX)2 . E[X 2 ] (5) Therefore the second MoM succeeds if we can show that (EX)2 /E[X 2 ] → 1 as n → ∞. It was shown in [4] that the second MoM succeeds for R > R0 (D), where R0 (D) is defined in (1). In contrast, for R∗ (D) < R < R0 (D) it was found that (EX)2 /E[X 2 ] → 0, so the second MoM fails. From this result in [4], it is not clear whether the gap from R∗ (D) is due to an inherent weakness of the sparse regression codebook, or if it is just a limitation of the second MoM as a proof technique. In this paper, we demonstrate that it is the latter, and refine the second MoM to prove that all rates greater than R∗ (D) are achievable. 1 The inequality (5) follows from the Cauchy-Schwarz inequality (E[XY ])2 ≤ EX 2 EY 2 by substituting Y = 1{X>0} . 3 Our refinement of the second MoM is inspired by the work of Coja-Oghlan and Zdeborová [9] on finding sharp thresholds for two-coloring of random hypergraphs. The high-level idea is as follows. The key ratio (EX)2 /E[X 2 ] can be expressed as (EX)/E[X(β)], where X(β) denotes the total number of solutions conditioned on the event that a given β is a solution. (Recall that β is a solution if |S − Aβ|2 ≤ D.) Thus when the second MoM fails, i.e. the ratio goes to zero, we have a situation where the expected number of solutions is much smaller than the expected number of solutions conditioned on the event that β is a solution. This happens because for any S, there are atypical realizations of the design matrix that yield a very large number of solutions. The total probability of these matrices is small enough that EX in not significantly affected by these realizations. However, conditioning on β being a solution increases the probability that the realized design matrix is one that yields an unusually large number of solutions. At low rates, the conditional probability of the design matrix being atypical is large enough to make E[X(β)]  EX, causing the second MoM to fail.2 The key to rectifying the second MoM failure is to show that X(β) ≈ EX with high probability although E[X(β)]  EX. We then apply the second MoM to count just the ‘good’ solutions, i.e., solutions β for which X(β) ≈ EX. This succeeds, letting us conclude that X > 0 with high probability. error probability decays exponentially for all rates smaller than the channel capacity. In contrast, we use a refinement of the second moment method for the rate-distortion function, and Suen’s correlation inequality to obtain the excess-distortion exponent. Beyond the excess-distortion exponent, the dispersion is another quantity of interest in a lossy compression problem [12], [13]. For a fixed excess-distortion probability, the dispersion specifies how fast the rate can approach the rate-distortion function with growing block length. It was shown that for discrete memoryless and i.i.d. Gaussian sources, the optimal dispersion was equal to the inverse of the second derivative of the excess-distortion exponent. Given that SPARCs attain the optimal excess-distortion exponent, it would be interesting to explore if they also achieve the optimal dispersion for i.i.d. Gaussian sources with squared-error distortion. The rest of the paper is organized as follows. The main results, specifying the rate-distortion function and the excessdistortion expoenent of SPARCs, are stated in Section II. In Section III, we set up the proof and show why the second MoM fails for R < (1 − ρD2 ). As the proofs of the main theorems are technical, we motivate the main ideas with a stylized example in Section III-C. The main results are proved in Section IV, with the proof of the main technical lemma given in Section V. C. Related Work As mentioned above, the second moment method was used in [7] to analyze the rate-distortion function of LDGM codes for binary symmetric sources with Hamming distortion. The idea of applying the second MoM to a random variable that counts just the ‘good’ solutions was recently used to obtain improved thresholds for problems such as random hypergraph 2-coloring [9], k-colorability of random graphs [10], and random k-SAT [11]. However, the key step of showing that a given solution is ‘good’ with high probability depends heavily on the geometry of the problem being considered. This step requires identifying a specific property of the random object being considered (e.g., SPARC design matrix, hypergraph, or boolean formula) that leads to a very large number of solutions in atypical realizations of the object. For example, in SPARC compression, the atypical realizations are design matrices with columns that are unusually well-aligned with the source sequence to be compressed; in random hypergraph 2coloring, the atypical realizations are hypergraphs with an edge structure that allows an unusually large number of vertices to take on either color [9]. It is interesting to contrast the analysis of SPARC lossy compression with that of SPARC AWGN channel coding in [1]. The dependence structure of the SPARC codewords makes the analysis challenging in both problems, but the techniques required to analyze SPARC channel coding are very different from those used here for the excess distortion analysis. In the channel coding case, the authors use a modified union bound together with a novel bounding technique for the probability of pairwise error events [1, Lemmas 3,4] to establish that the 2 This is similar to the inspection paradox in renewal processes. II. M AIN R ESULTS The probability of excess distortion at distortion-level D of a rate-distortion code Cn with block length n and encoder and decoder mappings g, h is  Pe (Cn , D) = P |S − h(g(S))|2 > D . (6) For a SPARC generated as described in Section I-A, the probability measure in (6) is with respect to the random source sequence S and the random design matrix A. A. Rate-Distortion Trade-off of SPARC Definition 1. A rate R is achievable at distortion level D if there exists a sequence of SPARCs {Cn }n=1,2,... such that limn→∞ Pe (Cn , D) = 0 where for all n, Cn is a rate R code defined by an n × Ln Mn design matrix whose parameter Ln satisfies (3) with a fixed b and Mn = Lbn . Theorem 1. Let S be drawn from an ergodic source with mean 2 0 and variance σ 2 . For D ∈ (0, σ 2 ), let R∗ (D) = 12 log σD . 2 Fix R > R∗ (D) and b > bmin ( σD ), where bmin (x) = 1+  1 2 x 20R x4    √  1/2 2 2 x 1 1 1 1 − x −1 + 1 + (x−1) R − 2 (1 − x ) (7) for 1 < x ≤ e2R . Then there exists a sequence of rate R SPARCs {Cn }n=1,2... for which limn→∞ Pe (Cn , D) = 0, where Cn is defined by an n × Ln Mn design matrix, with Mn = Lbn and Ln determined by (3). 4 Remark: Though the theorem is valid for all D ∈ (0, σ 2 ), it is most relevant for the case σD2 > x∗ , where x∗ ≈ 0.203 is the solution to the equation 1 (1 − x) + log x = 0. 2 let a2 = De2R . Fix any  ∈ (0, a2 − σ 2 ), and  2   a − 7 . b > max 2, bmin 5 D (12) For σD2 ≤ x∗ , [4, Theorem 1] already guarantees that the optimal rate-distortion function can be achieved, with a smaller value of b than that required by the theorem above. There exists a sequence of rate R SPARCs with parameter b that achieves the excess-distortion exponent   a2 −  1 a2 −  − 1 − log . 2 σ2 σ2 B. Excess-distortion exponent of SPARC Consequently, the supremum of excess-distortion exponents achievable by SPARCs for i.i.d. Gaussian sources sources is equal to the optimal one, given by (9). The excess-distortion exponent at distortion-level D of a sequence of rate R codes {Cn }n=1,2,... is given by r(D, R) = − lim sup n→∞ 1 log Pe (Cn , D), n (8) where Pe (Cn , D) is defined in (6). The optimal excessdistortion exponent for a rate-distortion pair (R, D) is the supremum of the excess-distortion exponents over all sequences of codes with rate R, at distortion-level D. The optimal excess-distortion exponent for discrete memoryless sources was obtained by Marton [14], and the result was extended to memoryless Gaussian sources by Ihara and Kubo [15]. Fact 1. [15] For an i.i.d. Gaussian source distributed as N (0, σ 2 ) and squared-error distortion criterion, the optimal excess-distortion exponent at rate R and distortion-level D is ( ∗ r (D, R) = 1 2 0  a2 σ2 − 1 − log a2 σ2  R > R∗ (D) R ≤ R∗ (D) (9) 1 lim − log P (|S|2 ≥ a2 − ) n   1 a2 −  a2 −  = − 1 − log 2 σ2 σ2 n→∞ (14) for (a2 −) > σ 2 . Thus P (|S|2 ≥ a2 −) decays exponentially with n; in comparison exp(−κn1+c ) decays faster than exponentially with n. Therefore, from (13), the excess-distortion exponent satisfies −1 log Pe (Cn , D) n −1 h log P (|S|2 ≥ a2 − ) ≥ lim inf n→∞ n   exp(−κn1+c ) + log 1 + P (|S|2 ≥ a2 − )  2  1 a − a2 −  = − 1 − log . 2 σ2 σ2 lim inf n→∞ where a2 = De2R . For R > R∗ (D), the exponent in (9) is the Kullback-Leibler divergence between two zero-mean Gaussians, distributed as N (0, a2 ) and N (0, σ 2 ), respectively. The next theorem characterizes the excess-distortion exponent performance of SPARCs. Theorem 2. Let S be drawn from an ergodic source with 2 mean zero and variance σ 2 . Let D ∈ (0, σ 2 ), R > 12 log σD , and γ 2 ∈ (σ 2 , De2R ). Let    7 2 b > max 2, bmin γ /D , (10) 5 where bmin (.) is defined in (7). Then there exists a sequence of rate R SPARCs {Cn }n=1,2... , where Cn is defined by an n × Ln Mn design matrix with Mn = Lbn and Ln determined by (3), whose probability of excess distortion at distortionlevel D can be bounded as follows for all sufficiently large n.  Pe (Cn , D) ≤ P (|S|2 ≥ γ 2 ) + exp −κn1+c , Proof: From Theorem 2, we know that for any  ∈ (0, a2 − σ 2 ), there exists a sequence of rate R SPARCs {Cn } for which   exp(−κn1+c ) Pe (Cn , D) ≤ P (|S|2 ≥ a2 − ) 1 + P (|S|2 ≥ a2 − ) (13) for sufficiently large n, as long as the parameter b satisfies (12). For S that is i.i.d. N (0, σ 2 ), Cramér’s large deviation theorem [16] yields (11) where κ, c are strictly positive universal constants. Corollary 1. Let S be drawn from an i.i.d. Gaussian source 2 with mean zero and variance σ 2 . Fix rate R > 21 log σD , and (15) Since  > 0 can be chosen arbitrarily small, the supremum of all achievable excess-distortion exponents is   1 a2 a2 − 1 − log 2 , 2 σ2 σ which is optimal from Fact 1. We remark that the function bmin (x) is increasing in x. Therefore (12) implies that larger values of the design parameter b are required to achieve excess-distortion exponents closer to the optimal value (i.e., smaller values of  in Corollary 1). III. I NADEQUACY OF THE D IRECT S ECOND M O M A. First steps of the proof Fix a rate R > R∗ (D), and b greater than the minimum value specified by the theorem. Note that De2R > σ 2 since 2 R > 12 log σD . Let γ 2 be any number such that σ 2 < γ 2 < De2R . 5 Code Construction: For each block length n, pick L as specified by (3) and M = Lb . Construct an n × M L design matrix A with entries drawn i.i.d. N (0, 1). The codebook consists of all vectors Aβ such that β ∈ BM,L . The non-zero entries of β are all set equal to a value specified below. Encoding and Decoding: If the source sequence S is such that |S|2 ≥ γ 2 , then the encoder declares an error. If |S|2 ≤ D, then S can be trivially compressed to within distortion D using the all-zero codeword. The addition of this extra codeword to the codebook affects the rate in a negligible way. If |S|2 ∈ (D, γ 2 ), then S is compressed in two steps. First, quantize |S|2 with an n-level uniform scalar quantizer Q(.) with support in the interval (D, γ 2 ]. For input x ∈ (D, γ 2 ], if   (γ 2 − D)i (γ 2 − D)(i − 1) , D+ , x∈ D+ n n for i ∈ {1, . . . , n}, then the quantizer output is (γ 2 − D)(i − 21 ) Q(x) = D + . n Conveying the scalar quantization index to the decoder (with an additional log n nats) allows us to adjust the codebook vari3 ance according to the norm of the observed psource sequence. 2 The non-zero entries of β are each set to (Q(|S| ) − D)/L so that each SPARC codeword has variance (Q(|S|2 ) − D). Define a “quantized-norm” version of S as s Q(|S|2 ) S̃ := S. (16) |S|2 Note that |S̃|2 = Q(|S|2 ). We use the SPARC to compress S̃. The encoder finds β̂ := argmin kS̃ − Aβk2 . β∈BM,L The decoder receives β̂ and reconstructs Ŝ = Aβ̂. Note that for block length n, the total number of bits transmitted by encoder is log n+L log M , yielding an overall rate of R+ logn n nats/sample. Error Analysis: For S such that |S|2 ∈ (D, γ 2 ), the overall distortion can be bounded as 2 |S − Aβ̂| = |S − S̃ + S̃ − Aβ̂| 2 (17) can be bounded as κ , (18) n for some positive constant κ. The overall rate (including that of the scalar quantizer) is R + logn n . Denoting the probability of excess distortion for this random code by Pe,n , we have |S − Aβ̂|2 ≤ D + Pe,n ≤ P (|S|2 ≥ γ 2 ) + lim P (|S|2 ≥ γ 2 ) = 0. To bound the second term in (19), without loss of generality we can assume that the source sequence S̃ = (ρ, . . . , ρ). This is because the codebook distribution is rotationally invariant, due to the i.i.d. N (0, 1) design matrix A. For any β, the entries of Aβ(i) i.i.d. N (0, ρ2 − D). We enumerate the codewords as Aβ(i), where β(i) ∈ BM,L for i = 1, . . . , enR . Define the indicator random variables  1 if |Aβ(i) − S̃|2 ≤ D, Ui (S̃) = (21) 0 otherwise. We can then write  nR  e X P (E(S̃)) = P  Ui (S̃) = 0 . (22) i=1 For a fixed S̃, the Ui (S̃)’s are dependent. To see this, consider codewords Ŝ(i), Ŝ(j) corresponding to the vectors β(i), β(j) ∈ BM,L , respectively. Recall that a vector in BM,L is uniquely defined by the position of the non-zero value in each of its L sections. If β(i) and β(j) overlap in r of their non-zero positions, then the column sums forming codewords Ŝ(i) and Ŝ(j) will share r common terms, and consequently Ui (S̃) and Uj (S̃) will be dependent. For brevity, we henceforth denote Ui (S̃) by just Ui . Applying the second MoM with nR X := e X Ui , i=1 we have from (5) P (X > 0) ≥ EX (EX)2 (a) = E[X 2 ] E[X| U1 = 1] (23) where (a) is obtained by expressing E[X 2 ] as follows.  nR  e enR X X 2   E[X ] = E X Ui = E[XUi ] i=1 = 3 The scalar quantization step is only included to simplify the analysis. In fact, we could use the same codebook variance (γ 2 − D) for all S that satisfy |S|2 ≤ (γ 2 − D), but this would make the forthcoming large deviations analysis quite cumbersome. (20) n→∞ 2 (17) κ1 κ2 |S̃ − Aβ̂| ≤ 2+ + |S̃ − Aβ̂|2 n n for some positive constants κ1 , κ2 . The last inequality holds 2 because the step-size of the scalar quantizer is (γ n−D) , and |S|2 ∈ (D, γ 2 ). Let E(S̃) be the event that the minimum of |S̃ − Aβ|2 over β ∈ BM,L is greater than D. The encoder declares an error if E(S̃) occurs. If E(S̃) does not occur, the overall distortion in P (E(S̃) | |S̃|2 = ρ2 ). (19) As γ 2 > σ 2 , the ergodicity of the source guarantees that 2 ≤ |S − S̃| + 2|S − S̃||S̃ − Aβ̂| + |S̃ − Aβ̂| max ρ2 ∈(D,γ 2 ) enR X i=1 (24) P (Ui = 1)E[X|Ui = 1] i=1 = EX · E[X| U1 = 1]. The last equality in (24) holds because EX = PenR i=1 P (Ui = 6 1), and due to the symmetry of the code construction. As E[X 2 ] ≥ (EX)2 , (23) implies that E[X| U1 = 1] ≥ EX. Therefore, to show that X > 0 w.h.p, we need The expected number of solutions is given by   EX = enR P (U1 = 1) = enR P |Aβ(1) − S̃|2 ≤ D . (33) E[X| U1 = 1] → 1 as n → ∞. EX Since S̃ = (ρ, ρ, . . . , ρ), and Aβ(1) is i.i.d. N (0, ρ2 − D), applying Lemma 1 we obtain the bounds 2 2 2 2 κ √ enR e−nf (ρ ,ρ −D,D) ≤ EX ≤ enR e−nf (ρ ,ρ −D,D) , n (34) Note that ρ2 1 (35) f (ρ2 , ρ2 − D, D) = log . 2 D (25) B. EX versus E[X| U1 = 1] To compute EX, we derive a general lemma specifying the probability that a randomly chosen i.i.d N (0, y) codeword is within distortion z of a source sequence S with |S|2 = x. This lemma will be used in other parts of the proof as well. Lemma 1. Let S be a vector with |S|2 = x. Let Ŝ be an i.i.d. N (0, y) random vector that is independent of S. Then for x, y, z > 0 and sufficiently large n, we have   κ √ e−nf (x,y,z) ≤ P |Ŝ − S|2 ≤ z ≤ e−nf (x,y,z) , (26) n where κ is a universal positive constant and for x, y, z > 0, the large-deviation rate function f is  x+z xz A 1 A if z ≤ x + y, 2y − Ay − 4y − 2 ln 2x f (x, y, z) = 0 otherwise, (27) and p A = y 2 + 4xz − y. (28) Proof: We have   2 P |Ŝ − S| ≤ z = P n =P n 1X (Ŝk − Sk )2 ≤ z n k=1 ! √ 1X (Ŝk − x)2 ≤ z n ! (29) , k=1 where the last equality is due to the rotational invariance of the distribution of Ŝ, i.e., Ŝ has the same joint distribution as OŜ for any orthogonal (rotation) matrix O. In particular, we √ choose√O to be the matrix that rotates S to the vector ( x, . . . , x), and note that |Ŝ − S|2 = |OŜ − OS|2 . Then, using the strong version of Cramér’s large deviation theorem due to Bahadur and Rao [16], [17], we have ! n κ −nI(x,y,z) 1X √ e ≤P (Ŝk − x)2 ≤ z ≤ e−nI(x,y,z) , n n k=1 (30) where the large-deviation rate function I is given by n √ 2o I(x, y, z) = sup λz − log Eeλ(Ŝ− x) . (31) λ≥0 The expectation on the RHS of (31) is computed with Ŝ ∼ N (0, y). Using standard calculations, we obtain log Ee √ λ(Ŝ− x)2 λx 1 = − log(1 − 2yλ), 1 − 2yλ 2 λ < 2y. (32) Substituting the expression in (32) in (31) and maximizing over λ ∈ [0, 2y) yields I(x, y, z) = f (x, y, z), where f is given by (27). Next consider E[X| U1 = 1]. If β(i) and β(j) overlap in r of their non-zero positions, the column sums forming codewords Ŝ(i) and Ŝ(j) will share r common terms. Therefore, nR E[X| U1 = 1] = e X P (Ui = 1| U1 = 1) i=1 nR e X P (Ui = 1, U1 = 1) = P (U1 = 1) i=1 L   P (U2 = U1 = 1| F12 (r)) (a) X L = (M − 1)L−r r P (U1 = 1) r=0 (36) where F12 (r) is the event that the codewords corresponding to U1 and U2 share r common terms. In (36), (a) holds because for each codeword Ŝ(i), there are a total of Lr (M − 1)L−r codewords which share exactly r common terms with Ŝ(i), for 0 ≤ r ≤ L. From (36) and (33), we obtain E[X| U1 = 1] EX L   X L P (U2 = U1 = 1| F12 (r)) (M − 1)L−r = r enR (P (U1 = 1))2 r=0   X L P (U2 = U1 = 1| F12 (α)) (a) ∼ 1+ Lα M Lα (P (U1 = 1))2 1 L (37) α= L ,..., L (b) = 1+ X en∆α 1 α= L ,..., L L where (a) is obtained by substituting α = Lr and enR = M L . The notation xL ∼ yL means that xL /yL → 1 as L → ∞. The equality (b) is from [4, Appendix A], where it was also shown that κ R log 2 ∆α ≤ + min{α, ᾱ, log (38) L } − h(α) L b where ! 1+α 1 h(α) := αR − log . (39) 2 1 − α(1 − 2D ρ2 ) The inequality in (38) is asymptotically tight [4]. The term en∆α in (37) may be interpreted as follows. Conditioned on β(1) being a solution, the expected number of solutions that share αL common terms with β(1) is ∼ en∆α EX. Recall that we require the left side of (37) to tend to 1 as n → ∞. Therefore, we need ∆α < 0 for α = L1 , . . . , L L . From (38), we need h(α) to be positive in order to guarantee that ∆α < 0. 7 However, when R < (1 − ρD2 ), it can be verified that h(α) < 0 for α ∈ (0, α∗ ) where α∗ ∈ (0, 1) is the solution to h(α) = 0. 2 Thus ∆α is positive for α ∈ (0, α∗ ) when 21 log ρD ≤ R ≤ (1 − ρD2 ). Consequently, (37) implies that E[X| U1 = 1] X n∆α → ∞ as n → ∞, ∼ e EX α (40) and the second MoM fails. as follows. E[X|U1 = 1] = P (Rn ∈ C1 | U1 = 1)E[X|U1 = 1, C1 ] + P (Rn ∈ C2 | U1 = 1)E[X|U1 = 1, C2 ] (1 − e−np )(en /N ) (a) = en −np (1 − e )(en /N ) + e−np (e2n /N ) e−np (e2n /N ) e2n + −np (1 − e )(en /N ) + e−np (e2n /N ) (1 − e−np )e2n + en(4−p) = , (1 − e−np )en + en(2−p) (44) where (a) is obtained by using Bayes’ rule to compute P (Rn ∈ C1 | U1 = 1). The second MoM ratio in (43) therefore equals C. A Stylized Example Before describing how to rectify the second MoM failure in the SPARC setting, we present a simple example to give intuition about the failure modes of the second MoM. The proofs in the next two sections do not rely on the discussion here. Consider a sequence of generic random structures (e.g., a sequence of random graphs or SPARC design matrices) denoted by Rn , n ≥ 1. Suppose that for each n, the realization of Rn belongs to one of two categories: a category C1 structure which has which has en solutions, or a category C2 structure which has e2n solutions. In the case of SPARC, a solution is a codeword that is within the target distortion. Let the probabilities of Rn being of each category be P (Rn ∈ C1 ) = 1 − e−np , P (Rn ∈ C2 ) = e−np , (41) where p > 0 is a constant. Regardless of the realization, we note that Rn always has at least en solutions. We now examine whether the second MoM can guarantee the existence of a solution for this problem as n → ∞. The number of solutions X can be expressed as a sum of indicator random variables: N X X= Ui , i=1 where Ui = 1 if configuration i is a solution, and N is the total number of configurations. (In the SPARC context, a configuration is a codeword.) We assume that the configurations are symmetric (as in the SPARC set-up), so that each one has equal probability of being a solution, i.e., P (Ui = 1 | Rn ∈ C1 ) = en e2n , P (Ui = 1 | Rn ∈ C2 ) = . N N (42) Due to symmetry, the second moment ratio can be expressed as EX 2 E[X | U1 = 1] E[X | U1 = 1] = = . 2 (EX) EX (1 − e−np )en + e−np e2n (43) The conditional expectation in the numerator can be computed E[X | U1 = 1] EX 2 (1 − e−np )e2n + en(4−p) = = . 2 (EX) EX [(1 − e−np )en + en(2−p) ]2 (45) We examine the behavior of the ratio above as n → ∞ for different values of p. Case 1: p ≥ 2. The dominant term in both the numerator and the denominator of (45) is e2n , and we get E[X | U1 = 1] → 1 as n → ∞, EX and the second MoM succeeds. (46) Case 2: 1 < p ≤ 2. The dominant term in the numerator is en(4−p) , while the dominant term in the denominator is e2n . Hence E[X | U1 = 1] en(4−p) n→∞ = (1 + o(1)) ∼ en(2−p) −→ ∞. EX e2n (47) Case 3: 0 < p ≤ 1. The dominant term in the numerator is en(4−p) , while the dominant term in the denominator is en(4−2p) . Hence E[X | U1 = 1] en(4−p) n→∞ = n(4−2p) (1 + o(1)) ∼ enp −→ ∞. (48) EX e Thus in both Case 2 and Case 3, the second MoM fails because the expected number of solutions conditioned on a solution (U1 = 1) is exponentially larger than the unconditional expected value. However, there is an important distinction between the two cases, which allows us to fix the failure of the second MoM in Case 2 but not in Case 3. Consider the conditional distribution of the number of solutions given U1 = 1. From the calculation in (44), we have P (X = en | U1 = 1) = P (Rn ∈ C1 | U1 = 1) (1 − e−np )en = , (1 − e−np )en + en(2−p) P (X = e2n | U1 = 1) = P (Rn ∈ C2 | U1 = 1) = (49) en(2−p) . (1 − e−np )en + en(2−p) When 1 < p ≤ 2, the first term in the denominator of the 8 RHS dominates, and the conditional distribution of X is n P (X = e | U1 = 1) = 1 − e P (X = e 2n | U1 ) = e −n(p−1) −n(p−1) (1 + o(1)), (1 + o(1)). Using this notation, we have (50) Thus the conditional probability of a realization Rn being category C1 given U1 = 1 is slightly smaller than the unconditional probability, which is 1−e−np . However, conditioned on U1 = 1, a realization Rn is still extremely likely to have come from category C1 , i.e., have en solutions. Therefore, when 1 < p ≤ 2, conditioning on a solution does not change the nature of the ‘typical’ or ‘high-probability’ realization. This makes it possible to fix the failure of the second MoM in this case. The idea is to define a new random variable X 0 which counts the number of solutions coming from typical realizations, i.e., only category C1 structures. The second MoM is then applied to X 0 to show that is strictly positive with high probability. When p < 1, conditioning on a solution completely changes the distribution of X. The dominant term in the denominator of the RHS in (49) is en(2−p) , so the conditional distribution of X is P (X = en | U1 = 1) = e−n(1−p) (1 + o(1)), P (X = e2n | U1 ) = 1 − e−n(1−p) (1 + o(1)). (51) Thus, conditioned on a solution, a typical realization of Rn belongs to category C2 , i.e., has e2n solutions. On the other hand, if we draw from the unconditional distribution of Rn in (41), a typical realization has en solutions. In this case, the second moment method cannot be fixed by counting only the solutions from realizations of category C1 , because the total conditional probability of such realizations is very small. This is the analog of the “condensation phase” that is found in problems such as random hypergraph coloring [9]. In this phase, although solutions may exist, even an enhanced second MoM does not prove their existence. Fortunately, there is no condensation phase in the SPARC compression problem. Despite the failure of the direct second MoM, we prove (Lemma 2) that conditioning on a solution does not significantly alter the total number of solutions for a very large fraction of design matrices. Analogous to Case 2 above, we can apply the second MoM to a new random variable that counts only the solutions coming from typical realizations of the design matrix. This yields the desired result that solutions exist for all rates R < R∗ (D). IV. P ROOFS OF M AIN R ESULTS A. Proof of Theorem 1 The code parameters, encoding and decoding are as described in Section III-A. We build on the proof set-up of Section III-B. Given that β ∈ BM,L is a solution, for L define Xα (β) to be the number of solutions α = 0, L1 , . . . , L that share αL non-zero terms with β. The total number of solutions given that β is a solution is X X(β) = Xα (β) (52) 1 L α=0, L ,..., L E[X| U1 = 1] (a) E[X(β)] = EX EX X E[Xα (β)] (b) ∼ 1+ = EX 1 L α=0, L ,..., L X en∆α , (53) 1 α= L ,..., L L where (a) holds because the symmetry of the code construction allows us to condition on a generic β ∈ BM,L being a solution; (b) follows from (37). Note that E[Xα (β)] and E[X(β)] are expectations evaluated with the conditional distribution over the space of design matrices given that β is a solution. The key ingredient in the proof is the following lemma, which shows that Xα (β) is much smaller than EX w.h.p ∀α ∈ { L1 , . . . , L L }. In particular, Xα (β)  EX even for α for which E[Xα (β)] ∼ en∆α → ∞ as n → ∞. EX 2 Lemma 2. Let R > 12 log ρD . If β ∈ BM,L is a solution, then for sufficiently large L   P Xα (β) ≤ L−3/2 EX, for L1 ≤ α ≤ L−1 ≥ 1 − η (54) L where η=L  −2.5 b  b −1 2 min (ρ /D) . (55) The function bmin (.) is defined in (7). Proof. The proof of the lemma is given in Section V. The probability measure in Lemma 2 is the conditional distribution on the space of design matrices A given that β is a solution. Definition 2. For  > 0, call a solution β “-good” if X Xα (β) <  EX. (56) 1 L α= L ,..., L Since we have fixed S̃ = (ρ, . . . , ρ), whether a solution β is -good or not is determined by the design matrix. Lemma 2 guarantees that w.h.p any solution β will be -good, i.e., if β is a solution, w.h.p the design matrix is such that the number of solutions sharing any common terms with β is less E[X]. The key to proving Theorem 1 is to apply the second MoM only to -good solutions. Fix  = L−0.5 . For i = 1, . . . , enR , define the indicator random variables  1 if |Aβ(i) − S̃|2 ≤ D and β(i) is -good, Vi = 0 otherwise. (57) The number of -good solutions, denoted by Xg , is given by Xg = V1 + V2 + . . . + VenR . (58) We will apply the second MoM to Xg to show that P (Xg > 0) → 1 as n → ∞. We have P (Xg > 0) ≥ (EXg )2 EXg = E[Xg2 ] E[Xg | V1 = 1] (59) where the second equality is obtained by writing E[Xg2 ] = (EXg )E[Xg | V1 = 1], similar to (24). 9 Lemma 3. a) EXg ≥ (1 − η)EX, where η is defined in (55). b) E[Xg | V1 = 1] ≤ (1 + L−0.5 )EX. Proof: Due to the symmetry of the code construction, we have EXg = e nR (a) P (V1 = 1) = e nR P (U1 = 1)P (V1 = 1|U1 = 1) = EX · P (β(1) is -good | β(1) is a solution). (60) In (60), (a) follows from the definitions of Vi in (57) and Ui in (21). Given that β(1) is a solution, Lemma 2 shows that X Xα (β(1)) < (EX)L−0.5 . (61) 1 α= L ,..., L L with probability at least 1 − η. As  = L−0.5 , β(1) is -good according to Definition 2 if (61) is satisfied. Thus EXg in (60) can be lower bounded as EXg ≥ (1 − η)EX. (62) For part (b), first observe that the total number of solutions X is an upper bound for the number of -good solutions Xg . Therefore E[Xg | V1 = 1] ≤ E[X| V1 = 1]. (63) Given that β(1) is an -good solution, the expected number of solutions can be expressed as E[X| V1 = 1] = E[X0 (β(1)) | V1 = 1] + E[ X Xα (β(1)) | V1 = 1]. 1 L α= L ,..., L (64) There are (M − 1)L codewords that share no common terms with β(1). Each of these codewords is independent of β(1), and thus independent of the event V1 = 1. E[X0 (β(1)) | V1 = 1] = E[X0 (β(1))] = (M − 1)L P (|S̃ − Aβ|2 ≤ D) ≤ M L P (|S̃ − Aβ|2 ≤ D) (65) = EX. Next, note that conditioned on β(1) being an -good solution (i.e., V1 = 1), X Xα (β(1)) <  EX (66) 1 α= L ,..., L L with certainty. This follows from the definition of -good in (56). Using (65) and (66) in (64), we conclude that E[X| V1 = 1] < (1 + )EX. (67) Combining (67) with (63) completes the proof of Lemma 3. Using Lemma 3 in (59), we obtain EXg (1 − η) P (Xg > 0) ≥ ≥ E[Xg | V1 = 1] 1+ −2.5( b = 1−L b −1) 2 min (ρ /D) 1 + L−1/2 , where the last equality is obtained by using the definition of η in (55) and  = L−0.5 . Hence the probability of the existence of at least one good solution goes to 1 as L → ∞. Thus we have shown that for any ρ2 ∈ (D, γ 2 ), the quantity P (E(S̃) | |S̃|2 = ρ2 ) 2 in (19) tends to zero whenever R > 12 log ρD and b > 2 bmin ( ρD ). Combining this with (18)–(20),we conclude that that the probability that κ |S − Aβ̂|2 ≤ D + n goes to one as n → ∞. As γ 2 > σ 2 can be chosen arbitrarily close to σ 2 , the proof of Theorem 1 is complete. B. Proof of Theorem 2 The code construction is as described in Section III-A, with the parameter b now chosen to satisfy (10). Recall the definition of an -good solution in Definition 2. We follow the set-up of Section IV-A and count the number of -good solutions, for an appropriately defined . As before, we want an upper bound for the probability of the event Xg = 0, where the number of -good solutions Xg is defined in (58). Theorem 2 is obtained using Suen’s correlation inequality to upper bound on the probability of the event Xg = 0. Suen’s inequality yields a sharper upper bound than the second MoM. We use it to prove that the probability of Xg = 0 decays super-exponentially in L. In comparison, the second MoM only guarantees a polynomial decay. We begin with some definitions required for Suen’s inequality. Definition 3 (Dependency Graphs [8]). Let {Vi }i∈I be a family of random variables (defined on a common probability space). A dependency graph for {Vi } is any graph Γ with vertex set V (Γ) = I whose set of edges satisfies the following property: if A and B are two disjoint subsets of I such that there are no edges with one vertex in A and the other in B, then the families {Vi }i∈A and {Vi }i∈B are independent. Fact 2. [8, Example 1.5, p.11] Suppose {Yα }α∈A is a family of independent random variables, and each Vi , i ∈ I is a function of the variables {Yα }α∈Ai for some subset Ai ⊆ A. Then the graph with vertex set I and edge set {ij : Ai ∩ Aj 6= ∅} is a dependency graph for {Ui }i∈I . In our setting, we fix  = L−3/2 , let Vi be the indicator the random variable defined in (57). Note that Vi is one if and only if β(i) is an -good solution. The set of codewords that share at least one common term with β(i) are the ones that play a role in determining whether β(i) is an -good solution or not. Hence, the graph Γ with vertex set V (Γ) = {1, . . . , enR } and edge set e(Γ) given by {ij : i 6= j and the codewords β(i), β(j) share at least one common term} (68) nR is a dependency graph for the family {Vi }ei=1 . This follows from Fact 2 by observing that: i) each Vi is a function of the 10 columns of A that define β(i) and all other codewords that share at least one common term with β(i); and ii) the columns of A are generated independently of one another.  For a given codeword β(i), there are Lr (M − 1)L−r other codewords that have exactly r terms in common with β(i), for 0 ≤ r ≤ (L − 1). Therefore each vertex in the dependency nR graph for the family {Vi }ei=1 is connected to L−1 X L (M − 1)L−r = M L − 1 − (M − 1)L r r=1 Fact 3 (Suen’s Inequality [8]). Let Vi ∼ Bern(pi ), i ∈ I, be a finite family of Bernoulli random variables having a dependency graph Γ. Write i ∼ j if ij is an edge in Γ. Define X X 1 XX E(Vi Vj ), δ = max EVk . λ= EVi , ∆ = i∈I 2 j∼i i∈I i∈I k∼i Then ! P Vi = 0 i∈I λ 2: We have nR λ= e X EVi = EXg    λ λ λ2 , , . ≤ exp − min 2 6δ 8∆ (69) We apply Suen’s inequality with the dependency graph nR specified above for {Vi }ei=1 to compute an upper bound for PenR P (Xg = 0), where Xg = i=1 Vi is the total number of -good solutions for  = L−3/2 . Note that the  chosen here is smaller than the value of L−1/2 used for Theorem 1. This smaller value is required to prove the super-exponential decay of the excess-distortion probability via Suen’s inequality. We also need a stronger version of Lemma 2. 2 Lemma 4. Let R > 12 log ρD . If β ∈ BM,L is a solution, then for sufficiently large L   P Xα (β) ≤ L−5/2 EX, for L1 ≤ α ≤ L L ≥ 1 − ξ (70) where ξ=L −2.5( b b − 57 ) 2 min (ρ /D) (a) = EX · P (β(1) is -good | β(1) is a solution), where (a) follows from (60). Given that β(1) is a solution, Lemma 4 shows that X Xα (β(1)) < (EX)L−3/2 (74) with probability at least 1 − ξ. As  = L−3/2 , β(1) is -good according to Definition 2 if (74) is satisfied. Thus the RHS of (73) can be lower bounded as follows. λ = EX · P (β(1) is -good | β(1) is a solution) ≥ EX · (1 − ξ). (71) (75) Using the expression from (33) for the expected number of solutions EX, we have ρ2 1 κ λ ≥ (1 − ξ) √ en(R− 2 log D ) , (76) n where κ > 0 is a constant. For b > 75 bmin (ρ2 /D), (71) implies that ξ approaches 1 with growing L. Second term λ/(6δ): Due to the symmetry of the code construction, we have X δ= max P (Vk = 1) i∈{1,...,enR } = . Proof: The proof is nearly identical to that of Lemma 2 3 replaced given in Section V, with the terms L−3/2 and 2L 5 −5/2 by L and 2L , respectively, throughout the lemma. Thus we obtain the following condition on b which is the analog of (107). X k∼i P (Vk = 1) k∼i L−1 X ∀i ∈ {1, . . . , enR } (77)  L = (M − 1)L−r · P (V1 = 1) r r=1  = M L − 1 − (M − 1)L P (V1 = 1) . Combining this together with the fact that L b> (73) i=1 L 1 ,..., L α= L other vertices. X First Term M X     λ= EVi = M L P (V1 = 1), log 2 5 R min α, ᾱ, + max i=1 1 (min{αΛ(α), c1 }) log L 2L α∈{ L ,..., L L}   we obtain 3.5R 1 = +O 1 λ ML Λ(0) L = = ,    2 L − 1 − (M − 1)L −bL − (1 − L−b )L δ M 1 − L 7 ρ 1 (78) = bmin +O . 5 D L where the second equality is obtained by substituting M = Lb . (72) Using a Taylor series bound for the denominator of (78) (see The result is then obtained using arguments analogous to (108) [4, Sec. V] for details) yields the following lower bound for sufficiently large L: and (109). We now compute each of the three terms in the RHS of λ Lb−1 ≥ . (79) Suen’s inequality. δ 2  11 Third Term λ2 /(8∆): We have M ∆= ξ in Lemma 4 to go to 0 with growing L. Using (84) in (19), we conclude that for any γ 2 ∈ 2 2 (σ , De R ) the probability of excess distortion can be bounded as L 1 XX E [Vi Vj ] 2 i=1 j∼i Pe,n ≤ P (|S|2 ≥ γ 2 ) + L M X 1X P (Vi = 1) P (Vj = 1 | Vi = 1) = 2 i=1 j∼i X (a) 1 = EXg P (Vj = 1 | V1 = 1) 2 j∼1 hX i 1 1{Vj = 1} | V1 = 1 = EXg E 2 j∼1 " # X (b) 1 Xα (β(1)) | V1 = 1 . ≤ EXg E 2 L−1 1 α= L ,..., (80) In (80), (a) holds because of the symmetry of the code construction. The inequality (b) is obtained as follows. The number of -good solutions that share common terms with β(1) is bounded above by the total number of solutions sharing common terms with β(1). The latter quantity can be expressed as the sum of the number of solutions sharing exactly αL common terms with β(1), for α ∈ { L1 , . . . , L−1 L }. Conditioned on V1 = 1, i.e., the event that β(1) is a good solution, the total number of solutions that share common terms with β(1) is bounded by  EX. Therefore, from (80) we have # " X 1 ∆ ≤ EXg E Xα (β(1)) | V1 = 1 2 1 α= L ,..., L−1 (81) L −3/2 1 L ≤ (EXg ) (L−3/2 EX) ≤ (EX)2 , 2 2 where we have used  = L−3/2 , and the fact that Xg ≤ X. Combining (81) and (75), we obtain (82) where κ is a strictly positive constant. Applying Suen’s inequality: Using the lower bounds obtained in (76), (79), and (82) in (69), we obtain  nR  e X  P Vi  i=1   ≤ exp −κ min e n(R− 12 log ρ2 D n − log 2n ) , Lb−1 , L3/2 P (E(S̃) | |S̃|2 = ρ2 ) ≤ P (|S|2 ≥ γ 2 ) + exp(−κn1+c ), L (1 − ξ)2 (EX)2 λ2 ≥ ≥ κL3/2 , 8∆ 4L−3/2 (EX)2 max ρ2 ∈(D,γ 2 )  , (83) where κ is a positive constant. Recalling from (3) that L = 2 Θ( logn n ) and R > 21 ln ρD , we see that for b > 2,  nR  e X  P Vi  ≤ exp −κn1+c , (84) i=1 where c > 0 is a constant. Note that the condition b > 7 2 5 bmin (ρ /D) was also needed to obtain (83) via Suen’s inequality. In particular, this condition on b is required for provided the parameter b satisfies    7 b > 2 max 2 max 2, bmin ρ2 /D . 5 ρ ∈(D,γ ) (85) (86) It can be verified from the definition in (7) that bmin (x) is strictly increasing in x ∈ (1, e2R ). Therefore, the maximum   on the RHS of (86) is bounded by max 2, 75 bmin γ 2 /D . Choosing b to be larger than this value will guarantee that (85) holds. This completes the proof of the theorem. V. P ROOF OF L EMMA 2 We begin by listing three useful properties of the function f (x, y, z) defined in (27). Recall that the probability that an i.i.d. N (0, y) sequence is within distortion within distortion z of a norm-x sequence is ∼ e−nf (x,y,z) . 1) For fixed x, y, f is strictly decreasing in z ∈ (0, x + y). 2) For fixed y, z, f is strictly increasing in x ∈ (z, ∞). 3) For fixed x, z and x > z, f is convex in y and attains its minimum value of 12 log xz at y = x − z. These properties are straightforward to verify from the definition (27) using elementary calculus. For K ⊆ {1, . . . , L}, let βK denote the restriction of β to the set K, i.e., βK coincides with β in the sections indicated by K and the remaining entries are all equal to zero. For example, if K = {2, 3}, the second and third sections of βK will each have one non-zero entry, the other entries are all zeros. Definition 4. Given that β is a solution, for α = define Fα (β) as the event that 1 L L, . . . , L, |S̃ − AβK |2 ≥ Dα for every size αL subset K ⊂ {1, . . . , L}, where Dα is the solution to the equation Rα = f (ρ2 , (ρ2 − D)α, Dα ). (87) The intuition behind choosing Dα according to (87) is the following. Any subset of αL sections of the design matrix A defines a SPARC of rate Rα, with each codeword consisting of i.i.d N (0, (ρ2 −D)α) entries. (Note that the entries of a single codeword are i.i.d., though the codewords are dependent due to the SPARC structure.) The probability that a codeword from this rate Rα code is within distortion z of the source sequence 2 2 S̃ is ∼ e−nf (ρ ,(ρ −D)α,z) . Hence the expected number of codewords in the rate Rα codebook within distortion z of S̃ is 2 2 enRα e−nf (ρ ,(ρ −D)α,z) . As f (ρ2 , (ρ2 −D)α, z) is a strictly decreasing function of z in (0, ρ2 ), (87) says that Dα is the smallest expected distortion 12 for any rate Rα code with codeword entries chosen i.i.d. N (0, (ρ2 − D)α). 4 For z < Dα , the expected number of codewords within distortion z of S̃ is vanishingly small. Conditioned on Fα (β), the idea is that any αL sections of β cannot by themselves represent S̃ with distortion less than Dα . In other words, in a typical realization of the design matrix, all the sections contribute roughly equal amounts to finding a codeword within D of S̃. On the other hand, if some αL sections of the SPARC can represent S̃ with distortion less than Dα , the remaining ᾱL sections have “less work” to do— this creates a proliferation of solutions that share these αL common sections with β. Consequently, the total number of solutions is much greater than EX for these atypical design matrices. The first step in proving the lemma is to show that for any β, the event Fα (β) holds w.h.p. The second step is showing that when Fα (β) holds, the expected number of solutions that share any common terms with β is small compared to EX. Indeed, using Fα (β) we can write   P Xα (β) > L−3/2 EX   = P {Xα (β) > L−3/2 EX}, Fαc (β)   + P {Xα (β) > L−3/2 EX}, Fα (β)   ≤ P (Fαc (β)) + P (Fα (β))P Xα (β) < L−3/2 EX | Fα (β) ≤ P (Fαc (β)) E[Xα (β) | Fα (β)] + L−3/2 EX (88) where the last line follows from Markov’s inequality. We will show that the probability on the left side of (88) is small for any solution β by showing that each of the two terms on the RHS of (88) is small. First, a bound on Dα . Lemma 5. For α ∈ (0, 1], 1 ρ2 log 2 . 2 ρ ᾱ + Dα (89) Consequently, Dα < ρ2 ᾱ + Dα for α = L1 , . . . , L . L Rα > f (ρ2 , (ρ2 − D)α, ρ2 ᾱ + Dα) = Proof. The last equality in (89) holds because f (x, x−z, z) = 1 x 2 ln z . Define a function g(α) = Rα − 1 ρ2 log 2 . 2 ρ ᾱ + Dα Then g(0) = 0, g(1) = R − derivative is 1 2 2 ln ρD > 0, and the second −(1 − ρD2 )2 d2 g = < 0. dα2 (1 − (1 − ρD2 )α)2 Therefore g is strictly concave in [0, 1], and its minimum value (attained at α = 0) is 0. This proves (89). Recalling the definition of Dα in (87), (89) implies that f (ρ2 , (ρ2 − D)α, Dα ) = Rα > f (ρ2 , (ρ2 − D)α, ρ2 ᾱ + Dα) 4 Note that D α is not the distortion-rate function at rate Rα as the codewords are not chosen with the optimal variance for rate Rα. As f is decreasing in its third argument (the distortion), we conclude that Dα < ρ2 ᾱ + Dα. We now bound each term on the RHS of (88). Showing that the first term of (88) is small implies that w.h.p any αL sections by themselves will leave a residual distortion of at least Dα . Showing that the second term is small implies that under this condition, the expected number of solutions sharing any common terms with β is small compared to EX. Bounding Fαc (β): From the definition of the event Fα (β), we have P (Fαc (β)) = ∪K P (|S̃ − AβK |2 < Dα | β is a solution) (90) where the union is over all size-αL subsets of {1, . . . , L}. Using a union bound, (90) becomes   L P (|S̃ − AβK |2 < Dα , |S̃ − Aβ|2 < D) c P (Fα (β)) ≤ Lα P (|S̃ − Aβ|2 < D) (91) where K is a generic size-αL subset of {1, . . . , L}, say K = {1, . . . , αL}. Recall from (33) that for sufficiently large n, the denominator in (91) can be bounded from below as 2 2 κ P (|S̃ − Aβ|2 < D) ≥ √ e−nf (ρ ,ρ −D,D) (92) n and f (ρ2 , ρ2 − D, D) = be expressed as 1 2 log ρ2 D. The numerator in (91) can P (|S̃ − AβK |2 < Dα , |S̃ − Aβ|2 < D) Z Dα = ψ(y) P (|S̃ − Aβ|2 < D | |S̃ − AβK |2 = y) dy 0 (93) where ψ is the density of the random variable |S̃ − AβK |2 . Using the cdf at y to bound ψ(y) in the RHS of (93), we obtain the following upper bound for sufficiently large n. P (|S̃ − AβK |2 < Dα , |S̃ − Aβ|2 < D) Z Dα ≤ P (|S̃ − AβK |2 < y) 0 Z (a) ≤ Dα · P (|S̃ − Aβ|2 < D | |S̃ − AβK |2 = y) dy 2 2 κ √ e−nf (ρ ,(ρ −D)α,y) n 0 · P (|(S̃ − AβK ) − AβKc |2 < D | |S̃ − AβK |2 = y) dy Z Dα (b) 2 2 2 κ √ e−nf (ρ ,(ρ −D)α,y) · e−nf (y,(ρ −D)ᾱ,D) dy ≤ n 0 Z Dα (c) κ −nf (ρ2 ,(ρ2 −D)α,Dα ) −nf (Dα ,(ρ2 −D)ᾱ,D) √ e ·e dy. ≤ n 0 (94) In (94), (a) holds for sufficiently large n and is obtained using the strong version of Cramér’s large deviation theorem: note that AβK is a linear combination of αL columns of A, hence it is a Gaussian random vector with i.i.d. N (0, (ρ2 − D)α) entries that is independent of S̃. Inequality (b) is similarly obtained: AβKc has i.i.d. N (0, (ρ2 − D)ᾱ) entries, and is independent of both S̃ and AβK . Finally, (c) holds because 13 the overall exponent 2 2 the two exponents in (99) are equal. To bound (99), we use the following lemma. 2 f (ρ , (ρ − D)α, y) + f (y, (ρ − D)ᾱ, D) is a decreasing function of y, for y ∈ (0, ρ2 ᾱ + Dα], and Dα ≤ ρ2 ᾱ + Dα. Using (92) and (94) in (91), for sufficiently large n we have   L P (Fαc (β)) ≤ κ Lα × e−n[f (ρ 2 ,(ρ2 −D)α,Dα )+f (Dα ,(ρ2 −D)ᾱ,D)−f (ρ2 ,ρ2 −D,D)] . (95)  L Bounding E[Xα (β)| Fα (β)]: There are Lα (M − 1)Lᾱ codewords which share αL common terms with β. Therefore   L (M − 1)Lᾱ Lα × P (|S̃ − Aβ 0 |2 < D | |S̃ − Aβ|2 < D, Fα (β)) (96) E[Xα (β) | Fα (β)] = where β 0 is a codeword that shares exactly αL common terms with β. If K is the size-αL set of common sections between 0 β and β 0 , then β 0 = βK + βK c and P (|S̃ − Aβ 0 |2 < D | |S̃ − Aβ|2 < D, Fα (β)) 0 2 2 = P (|(S̃ − AβK ) − AβK c | < D | |S̃ − Aβ| < D, Fα (β)) ! n X (a) 0 2 (Dα − (AβK <D ≤ P n1 c )i ) i=1 (b) 2 κ ≤ √ e−nf (Dα ,(ρ −D)ᾱ,D) , n (97) where (b) holds for sufficiently large n. In (97), (a) is obtained as follows. Under the event Fα (β), the norm |S̃ − AβK |2 is 0 2 at least Dα , and AβK c is an i.i.d. N (0, (ρ − D)ᾱ) vector independent of S̃, β, and βK . (a) then follows from the 0 rotational invariance of the distribution of AβK c . Inequality (b) is obtained using the strong version of Cramér’s large deviation theorem. Using (97) in (96), we obtain for sufficiently large n E[Xα (β) | Fα (β)]   2 L κ ≤ (M − 1)Lᾱ √ e−nf (Dα ,(ρ −D)ᾱ,D) Lα n   2 L κ √ en(Rᾱ−f (Dα ,(ρ −D)ᾱ,D)) . ≤ Lα n (98) Overall bound: Substituting the bounds from (95), (98) and (33) in (88), for sufficiently large n we have for L1 ≤ α ≤ 1:     L P Xα (β) > L−3/2 EX ≤ κ Lα  2 2 2 2 2 × e−n[f (ρ ,(ρ −D)α,Dα )+f (Dα ,(ρ −D)ᾱ,D)−f (ρ ,ρ −D,D)]  2 2 2 + L3/2 e−n[Rα+f (Dα ,(ρ −D)ᾱ,D)−f (ρ ,(ρ −D),D)] . (99) Since Dα is chosen to satisfy Rα = f (Dα , (ρ2 − D)ᾱ, D), Lemma 6. For α ∈ { L1 , . . . , L−1 L }, we have h f (ρ2 , (ρ2 − D)α, Dα ) + f (Dα , (ρ2 − D)ᾱ, D) i − f (ρ2 , (ρ2 − D), D)  αΛ(α) if Dα > D > c1 if Dα ≤ D. (100) where Dα is the solution of (87), c1 is a positive constant given by (137), and 2    4  D D 1 D 1+ 2 1− 2 Λ(α) = 8 ρ2 ρ ρ   p ! 12 2  2 2 /D 2 ρ 1 ρ  . · −1 + 1 + ρ2 R− log 2 2α ρ ᾱ + Dα ( − 1) D (101) Proof: See Appendix I. We observe that Λ(α) is strictly decreasing for α ∈ (0, 1]. This can be seen by using the Taylor expansion of log(1 − x) for 0 < x < 1 to write    1 ρ2 1 D R− ln 2 =R+ log 1 − α 1 − 2 2α ρ ᾱ + Dα 2α ρ k k−1 ∞  X D α 1 1− 2 . =R− 2 ρ k k=1 (102) Since 1 ρ2 1 R > log > 2 D 2   D 1− 2 , ρ (102) shows that Λ(α) is strictly positive and strictly decreasing in α ∈ (0, 1) with  4  2   D D 1 D 1 + 1 − Λ(0) := lim Λ(α) = α→0 8 ρ2 ρ2 ρ2   p    ! 12 2 2 /D 2 ρ 1 D −1 + 1 + 2  , R− 1− 2 2 ρ ( ρD − 1)  4  2   1 D D D Λ(1) = 1+ 2 1− 2 8 ρ2 ρ ρ   p  ! 12 2 2 2 −1 + 1 + 2 2 ρ /D R − 1 log ρ  . 2 D ( ρD − 1) (103)  Substituting (100) in (99), we have, for α ∈ L1 , . . . , L L :   P Xα (β) > L−3/2 EX   (104) L <κ L3/2 exp(−n · min{αΛ(α), c1 }). Lα 14 Taking logarithms and dividing both sides by L log L, we obtain   1 log P Xα (β) > L−3/2 EX L log L  L log Lα log κ 3 n(min{αΛ(α), c1 }) < + + − L log L L log L 2L L log L (105)   log 2 3 (a) log κ = + min α, ᾱ, + L log L log L 2L (min{αΛ(α), c1 })b − R where to obtain (a), we have used the bound   L log < min {αL log L, (1 − α)L log L, L log 2} Lα and the relation (3). For the right side of (105) to be negative for sufficiently large L, we need   (min{αΛ(α), c1 })b log 2 3 > min α, ᾱ, . (106) + R log L 2L This can be arranged by choosing b to be large enough. Since (106) has to be satisfied for all α ∈ { L1 , . . . , L−1 L }, we need b>  h n R log 2 o 3 i min α, ᾱ, + 1 (min{αΛ(α), c1 }) log L 2L ,..., L α∈{ L L}   1 (a) 2.5R = +O Λ(0) L    2 1 ρ +O . = bmin D L (107) We want a lower bound for gα (Dα ) ≥ Λ(α)α, where Dα is the solution to Rα = f (ρ2 , (ρ2 − D)α, Dα ). We consider the cases Dα > D and Dα ≤ D separately. Recall from Lemma 5 that Dα < ρ2 ᾱ + Dα. Case 1: D < Dα < ρ2 ᾱ + Dα.: In this case, both the f (.) terms in the definition of gα (Dα ) are strictly positive. We can write Dα = ρ2 ᾱ + Dα − δ, (112) where δ ∈ (0, (ρ2 − D)ᾱ). Expanding gα (ρ2 ᾱ + Dα − δ) around ρ2 ᾱ + Dα using Taylor’s theorem, we obtain δ2 δ2 = g 00 (ξ) 2 2 (113) since g(ρ2 ᾱ + Dα) = g 0 (ρ2 ᾱ + Dα) = 0. Here ξ is a number in the interval (D, ρ2 ᾱ + Dα). We bound g(Dα ) from below by obtaining separate lower bounds for g 00 (ξ) and δ. Lower Bound for g 00 (ξ): Using the definition of f in (27), the second derivative of g(u) is g(Dα ) = g(ρ2 ᾱ+Dα)−g 0 (ρ2 ᾱ+Dα)δ+g 00 (ξ) g 00 (u) =  max In (107), (a) holds because Λ(α) is of constant order for all α ∈ (0, 1], hence the maximum is attained at α = L1 . The constant Λ(0) is given by (103), and bmin (.) is defined in the statement of Theorem 1. When b satisfies (107) and L is sufficiently large, for α ∈ { L1 , . . . , L L }, the bound in (105) becomes   1 log P Xα (β) > L−3/2 EX L log L min{αΛ(α), c1 }(b − bmin − O( L1 )) log κ < − L log L R b 2.5( bmin − 1) log κ Λ(0) (b − bmin ) log κ ≤ − = − . L log L L R L log L L (108) Therefore   −2.5( b b −1) min P Xα (β) > L−3/2 EX < κL . (109) This completes the proof of Lemma 2. + + −1 2u2 2ρ4 · [(ρ2 − D)2 α2 + 4ρ2 u]−1/2 hp i2 α(ρ2 − D) (ρ2 − D)2 α2 + 4ρ2 u − (ρ2 − D)α 2D2 · [(ρ2 − D)2 ᾱ2 + 4Du]−1/2 hp i2 . ᾱ(ρ2 − D) (ρ2 − D)2 ᾱ2 + 4Du − (ρ2 − D)ᾱ (114) It can be verified that g 00 (u) is a decreasing function, and hence for ξ ∈ (D, ρ2 ᾱ + Dα), g 00 (ξ) ≥ g 00 (ρ2 ᾱ + Dα) −1 = 2(ρ2 ᾱ + Dα)2 + 2α(ρ2 − D)(ρ2 ᾱ ρ4 + Dα)2 (ρ2 (1 + ᾱ) + Dα) 1 2ᾱ(ρ2 − D)(ρ2 ᾱ + D(1 + α)) (ρ2 + D) = 2 2 2αᾱ(ρ − D)(ρ (1 + ᾱ) + Dα)(ρ2 ᾱ + D(1 + α)) 1 ≥ . 2 4αᾱ(ρ − D)ρ2 (115) + Lower bound for δ: From (111) and (112), note that δ is the solution to Rα = f (ρ2 , (ρ2 − D)α, ρ2 ᾱ + Dα − δ). A PPENDIX I P ROOF OF L EMMA 6 For α ∈ { L1 , . . . , L−1 L }, define the function gα : R → R as gα (u) = f (ρ2 , (ρ2 − D)α, u) + f (u, (ρ2 − D)ᾱ, D) − (111) 1 ρ2 ln . 2 D (110) (116) Using Taylor’s theorem for f in its third argument around the point p := (ρ2 , (ρ2 − D)α, ρ2 ᾱ + Dα), we have Rα = f (p) − ∂f ∂z δ+ p ∂2f ∂z 2 p̃ δ2 2 1 ρ2 1 1 ∂2f = ln 2 + δ+ 2 2 ρ ᾱ + Dα 2(ρ ᾱ + Dα) 2 ∂z 2 (117) δ2 , p̃ 15 where p̃ = p = (ρ2 , (ρ2 − D)α, z̃) for some z̃ ∈ (D, ρ2 ᾱ + Dα). As (117) is a quadratic in δ with positive coefficients for the δ and δ 2 terms, replacing the δ 2 coefficient with an upper bound and solving the resulting quadratic will yield a lower bound for δ. Since the function ∂2f ∂z 2 (x,y,z) 2x2 p = p y y 2 + 4xz( y 2 + 4xz − y)2 (118) is decreasing in z, the δ 2 coefficient can be bounded as follows. Finally, using the lower bounds for g 00 (ξ) and δ from (125) and (115) in (113), we obtain 2    4  α D D D g(Dα ) > 1+ 2 1− 2 8 ρ2 ρ ρ   p  ! 21 2 2 2 /D ρ 2 1 ρ  × −1 + 1 + ρ2 R− ln 2α ρ2 ᾱ + Dα ( D − 1) = αΛ(α). (126) 1 ∂2f 2 ∂z 2 p̃=(ρ2 ,(ρ2 −D)α,z̃) 1 ∂2f ≤ a∗ := 2 ∂z 2 (ρ2 ,(ρ2 −D)α,D) , (119) where a∗ can be computed to be p a∗ = ρ4 α(ρ2 − D) (ρ2 − D)2 α2 + 4ρ2 D hp (ρ2 − D)2 α2 + 4ρ2 D 2 − (ρ − D)α i2 !−1 . (120) Therefore we can obtain a lower bound for δ, denoted by δ, by solving the equation   1 ρ2 1 2 ∗ − Rα − ln 2 = 0. δ a +δ 2(ρ2 ᾱ + Dα) 2 ρ ᾱ + Dα (121) We thus obtain " 1 δ>δ= − 1+ 4(ρ2 ᾱ + Dα)a∗   1/2 # 1 ρ2 2 2 ∗ 1 + 16(ρ ᾱ + Dα) a α R − ln . 2α ρ2 ᾱ + Dα (122) We now show that δ can be bounded from below by αΛ(α) by obtaining lower and upper bounds for a∗ α. From (120) we have ρ4 · [(ρ2 − D)2 α2 + 4ρ2 D]−1/2 hp i2 (ρ2 − D) (ρ2 − D)2 α2 + 4ρ2 D − (ρ2 − D)α p ρ2 /D ≥ , 8D(ρ2 − D) (123) Case 2: Dα ≤ D.: In this case, g(Dα ) is given by g(Dα ) = f (ρ2 , (ρ2 − D)α, Dα ) + f (Dα , (ρ2 − D)ᾱ, D) 1 ρ2 − ln 2 D 1 ρ2 = Rα − ln , 2 D (127) where we have used (111) and the fact that f (Dα , (ρ2 − D)ᾱ, D) = 0 for Dα ≤ D. The right hand side of the equation Rα = f (ρ2 , (ρ2 − D)α, z) is decreasing in z for z ∈ (0, D]. Therefore, it is sufficient to consider Dα = D in order to obtain a lower bound for Rα that holds for all Dα ∈ (0, D]. Next, we claim that the α that solves the equation Rα = f (ρ2 , (ρ2 − D)α, D) lies in the interval ( 21 , 1). Indeed, observe that the LHS of (128) is increasing in α, while the RHS is decreasing in α for α ∈ (0, 1]. Since the LHS is strictly greater than the RHS at 2 α = 1 (R > 21 ln ρD ), the solution is strictly less than 1. On the other hand, for α ≤ 21 , we have   R 1 D 1 ρ2 Rα ≤ ≤ = f (ρ2 , (ρ2 − D), D) 1 − 2 < ln 2 2 ρ 2 D a∗ α = where the inequality is obtained by noting that a∗ α is strictly increasing in α, and hence taking α = 0 gives a lower bound. Analogously, taking α = 1 yields the upper bound ρ4 a α≤ . 2 4D (ρ4 − D2 ) ∗ (124) Using the bounds of (123) and (124) in (122), we obtain " D2 (ρ4 − D2 ) δ>δ≥α −1 + ρ6 p  !1/2 # (125) 2 ρ2 /D 1 ρ2 R− ln . 1 + ρ2 2α ρ2 ᾱ + Dα ( D − 1) (128) 2 < f (ρ2 , (ρ −D) , D), 2 (129) i.e., the LHS of (128) is strictly less than the RHS. Therefore the α that solves (128) lies in ( 12 , 1). To obtain a lower bound on the RHS of (127), we expand f (ρ2 , (ρ2 − D)α, D) using Taylor’s theorem for the second argument. f (ρ2 , (ρ2 − D)α, D) = f (ρ2 , (ρ2 − D) − ∆, D) 1 ρ2 ∂f ∆2 ∂ 2 f = ln −∆ + 2 D ∂y (ρ2 ,(ρ2 −D),D) 2 ∂y 2 (ρ2 ,y0 ,D) (130) 2 2 2 1 ρ ∆ ∂ f = ln + , 2 D 2 ∂y 2 (ρ2 ,y0 ,D) where ∆ = (ρ2 − D)ᾱ, and y0 lies in the interval ( 21 (ρ2 − D), (ρ2 − D)). Using (130) and the shorthand f 00 (y0 ) := ∆2 ∂ 2 f 2 ∂y 2 (ρ2 ,y0 ,D) , 16 (128) can be written as ACKNOWLEDGEMENT 2 Rα − 2 2 1 ρ (ρ − D) 00 ln = ᾱ2 f (y0 ), 2 D 2 (131) We thank the anonymous referee for comments which helped improve the paper. (132) R EFERENCES or 1 ρ2 (ρ2 − D)2 00 ln = Rᾱ + ᾱ2 f (y0 ). 2 D 2 Solving the quadratic in ᾱ, we get R− ᾱ = −R + [R2 + 2(ρ2 − D)2 (R − 12 ln (ρ2 − D)2 f 00 (y0 ) ρ2 00 1/2 D )f (y0 )] . (133) Using this in (131), we get 1 ρ2 Rα − ln 2 D  i1/2 2 h ρ2 1 00 2 2 2 −R + R + 2(ρ − D) (R − 2 ln D )f (y0 ) = . 2(ρ2 − D)2 f 00 (y0 ) (134) The LHS is exactly the quantity we want to bound from below. From the definition of f in (27), the second partial derivative with respect to y can be computed: f 00 (y) = ∂2f ∂y 2 (ρ2 ,y,D) = ρ2 1 y + 2− . (135) 3 2 y y 2(y + 4ρ2 D)3/2 The RHS of (135) is strictly decreasing in y. We can therefore bound f 00 (y0 ) as   2 ρ −D ρ2 00 2 00 00 < f (ρ − D) < f (y0 ) < f (ρ2 − D)3 2 2 12ρ < 2 . (ρ − D)3 (136) Substituting these bounds in (134), we conclude that for Dα ≤ D, 1 ρ2 ln 2 D  " # 12 2 ρ2 1 2 2ρ (R − ln ) (ρ2 − D)  2 D  . ≥ c1 := −R + R2 + 24ρ2 (ρ2 − D) g(Dα ) = Rα − (137) [1] A. Barron and A. Joseph, “Least squares superposition codes of moderate dictionary size are reliable at rates up to capacity,” IEEE Trans. Inf. Theory, vol. 58, pp. 2541–2557, Feb 2012. [2] A. Joseph and A. Barron, “Fast sparse superposition codes have exponentially small error probability for R < C,” IEEE Trans. Inf. Theory, vol. 60, pp. 919–942, Feb 2014. [3] I. Kontoyiannis, K. Rad, and S. Gitzenis, “Sparse superposition codes for Gaussian vector quantization,” in 2010 IEEE Inf. Theory Workshop, p. 1, Jan. 2010. [4] R. Venkataramanan, A. Joseph, and S. Tatikonda, “Lossy compression via sparse linear regression: Performance under minimum-distance encoding,” IEEE Trans. Inf. Thy, vol. 60, pp. 3254–3264, June 2014. [5] R. Venkataramanan, T. Sarkar, and S. Tatikonda, “Lossy compression via sparse linear regression: Computationally efficient encoding and decoding,” IEEE Trans. Inf. Theory, vol. 60, pp. 3265–3278, June 2014. [6] N. Alon and J. H. Spencer, The probabilistic method. John Wiley & Sons, 2004. [7] M. Wainwright, E. Maneva, and E. Martinian, “Lossy source compression using low-density generator matrix codes: Analysis and algorithms,” IEEE Trans. Inf. Theory, vol. 56, no. 3, pp. 1351 –1368, 2010. [8] S. Janson, Random Graphs. Wiley, 2000. [9] A. Coja-Oghlan and L. Zdeborová, “The condensation transition in random hypergraph 2-coloring,” in Proc. 23rd Annual ACM-SIAM Symp. on Discrete Algorithms, pp. 241–250, 2012. [10] A. Coja-Oghlan and D. Vilenchik, “Chasing the k-colorability threshold,” in Proc. IEEE 54th Annual Symposium on Foundations of Computer Science, pp. 380–389, 2013. [11] A. Coja-Oghlan and K. Panagiotou, “Going after the k-SAT threshold,” in Proc. 45th Annual ACM Symposium on Theory of Computing, pp. 705–714, 2013. [12] A. Ingber and Y. Kochman, “The dispersion of lossy source coding,” in Data Compression Conference, pp. 53 –62, March 2011. [13] V. Kostina and S. Verdú, “Fixed-length lossy compression in the finite blocklength regime,” IEEE Trans. Inf. Theory, vol. 58, no. 6, pp. 3309– 3338, 2012. [14] K. Marton, “Error exponent for source coding with a fidelity criterion,” IEEE Trans. Inf. Theory, vol. 20, pp. 197 – 199, Mar 1974. [15] S. Ihara and M. Kubo, “Error exponent for coding of memoryless Gaussian sources with a fidelity criterion,” IEICE Trans. Fundamentals, vol. E83-A, Oct. 2000. [16] F. Den Hollander, Large deviations, vol. 14. Amer. Mathematical Society, 2008. [17] R. R. Bahadur and R. R. Rao, “On deviations of the sample mean,” The Annals of Mathematical Statistics, vol. 31, no. 4, 1960.
7cs.IT
The Conference Paper Assignment Problem: Using Order Weighted Averages to Assign Indivisible Goods arXiv:1705.06840v1 [cs.AI] 19 May 2017 Jing Wu Lian1 , Nicholas Mattei2 , Renee Noble1 , and Toby Walsh3 1 Data61, CSIRO and UNSW, Sydney, Australia renee.noble@data61.csiro.au, lianjingwu@gmail.com 2 IBM T.J. Watson Research Center, New York, USA n.mattei@ibm.com 3 Data61, CSIRO, UNSW, and TU Berlin, Berlin, Germany toby.walsh@data61.csiro.au Abstract. Motivated by the common academic problem of allocating papers to referees for conference reviewing we propose a novel mechanism for solving the assignment problem when we have a two sided matching problem with preferences from one side (the agents/reviewers) over the other side (the objects/papers) and both sides have capacity constraints. The assignment problem is a fundamental problem in both computer science and economics with application in many areas including task and resource allocation. We draw inspiration from multicriteria decision making and voting and use order weighted averages (OWAs) to propose a novel and flexible class of algorithms for the assignment problem. We show an algorithm for finding an Σ -OWA assignment in polynomial time, in contrast to the NP-hardness of finding an egalitarian assignment. Inspired by this setting we observe an interesting connection between our model and the classic proportional multi-winner election problem in social choice. 1 Introduction Assigning indivisible items to multiple agents is a fundamental problem in many fields including computer science, economics and operations research. Algorithms for matching and assignment are used in a variety of application areas including allocating runways to airplanes, residents to hospitals, kidneys to patients [15], students to schools [10], assets to individuals in a divorce, jobs to machines, and tasks to cloud computing nodes [26]. Understanding the properties of the underlying algorithms is an important aspect to ensuring that all participating agents are happy with their allocations and do not attempt to misrepresent their preferences; a key area of study for computational social choice [9]. An area that is near to many academics’ hearts is the problem of allocating papers to referees for peer review. The results of grant, journal, and conference reviewing can have significant impact on the careers of scientists. Ensuring that papers and proposals are reviewed by the most qualified/interested referees most is part of ensuring that items are treated properly and all participants support the outcome of the processes. Making sure these processes work for both the proposers and the reviewers is important and methods for improving peer review have been proposed and discussed in AI [29] and broadly across the sciences [28]. There are a number of ways one can improve the quality of peer review [29]. First is to ensure that reviewers are not incentivized to misreport their reviews for personal gain. Along this line there has been significant interest recently in strategyproof mechanisms for peer review [6]. Unfortunately, the method that we discuss in this paper is not strategyproof. Another way is to ensure that reviewers are competent to provide judgements on the papers they are assigned. The Toronto Paper Matching System [11] is designed to improve the process from this paper-centric model. A third alternative, and the one we focus on in this study, is ensuring that reviewers are happy with the papers they are asked to review. This is fundamentally a question about the optimization objectives of the assignment functions used. Formally, we study the Conference Paper Assignment Problem (CPAP) [22] which is a special of the Multi-Agent Resource Allocation Problem (MARA) [7], and propose a novel assignment, the Σ -OWA assignment. In the CPAP setting we have a two-sided market where on one side the agents/reviewers have preferences over the other side, the objects/papers, and both sides have (possibly infinite) upper and lower capacities. A fundamental tension in assignment settings is the tradeoff between maximizing the social welfare, also know as the utilitarian maximal assignment and the Rawlsian [30] fairness concept of maximizing the utility of the worst off agent, known as the egalitarian maximal assignment. These two ideas are incompatible optimization objectives and diverge in a computational sense as well: computing the utilitarian assignment for additive utilities can be done in polynomial time, while computing the egalitarian assignment is NP-complete [14]. This, perhaps, could be the reason that implementers of large conference paper assignment software often opt for utilitarian assignments, as is supposedly the case for EasyChair [19].4 However, it is also not clear if an egalitarian assignment is desirable for CPAP. Contributions. We establish a motivation for using OWA vectors in the assignment setting and define a novel notion of allocation, the Σ -OWA assignment. We give algorithm to compute an Σ -OWA maximal assignment in polynomial time and we show that the Σ OWA objective generalizes the utilitarian objective. We show that Σ -OWA assignments satisfy a notion of Pareto optimality w.r.t. the pairwise comparisons of the objects by the agents. We implement an algorithm for Σ -OWA assignments and perform experiments on real world conference paper assignment data. 2 Preliminaries From here we will use the more general notation agents/objects to describe our setting. In assignment settings each agent provides their preference over the objects as a reflexive, complete, and transitive preference relation (weak order) over the set of objects, %i . 4 This is technically unsubstantiated as when the authors contacted EasyChair to understand the assignment process we were told, “We do not provide information on how paper assignment in EasyChair is implemented. The information in Garg et.al. may be incorrect or out of date none of the authors worked for EasyChair, they also had no access to the EasyChair code.” We do not assume that %i is complete; it is possible that some agents may have conflicts of interest or have no preference for a particular object; this assumption is often called “having unacceptable objects” in the literature [26]. In many real-world CPAP settings there are a fixed number of equivalence classes into which agents are asked to place the objects [27]. We assume that the number of equivalence classes (ranks) of objects are given as input to the problem and agents tell us within which rank each objects belong. Agents also provide a decreasing utility value for each rank5 . Our main result can be extended to the case where the number of equivalence classes is not fixed. Formally, the CPAP problem is defined by (N, O, %, u, ∆ ): a set of n agents N = {a1 , . . . , an }; a set of m objects O = {o1 , . . . , om }; for each i ∈ N, a reflexive and transitive preference relation (weak order) over the set of objects, %i , divided into ∆ equivalence classes (ranks); and for each i ∈ N a utility vector ui is of length ∆ and assigns a decreasing utility ui (k) → R for each k ∈ [1, ∆ ], i.e., ui (1) > ui (2) > . . . > ui (∆ ). Let ri ( j) be the rank of object j for i and ui (ri ( j)) denote the value of i for j. 2.1 Side Constraints and Feasible Assignments There are two practical constraints that we include in our model, making our model more general than the standard MARA or CPAP problems studied in computer science [7]: upper and lower capacities on both the agents and objects. Agent Capacity: each agent i ∈ N has (possibly all equal) upper and lower bound on their capacity, the number of objects they can be allocated, cNmin (i) and cNmax (i). Object Capacity: each object j ∈ O has a (possibly all equal) upper and lower O bound on the number of agents assigned to it, cO min ( j) and cmax ( j), respectively. We can now define a feasible assignment A for an instance (N, O, , u, ∆ ). For a given assignment A, let A(i, :) denote the set of objects assigned to agent i in A, let A(:, j) denote the set of agents assigned to object j, and let | · | denote the size (number of elements) of a set or vector. A feasible assignment A must obey: O [∀i ∈ N : cNmin (i) ≤ |A(i, :)| ≤ cNmax (i)] ∧ [∀ j ∈ O : cO min ( j) ≤ |A(:, j)| ≤ cmax ( j)]. We write the set of all feasible assignments for an instance as A(N, O, , u, ∆ ).6 2.2 Individual Agent Evaluation We first formalize how an individual agent evaluates their assigned objects. Each feasible assignment A ∈ A gives rise to a signature vector for each agent i ∈ N; intuitively the signature vector is the number of objects at each rank assigned to i. Formally let σ i (A) = (σ i,1 (A), . . . , σ i,∆ (A)) where σ i,l (A) = |{ j ∈ A(i, :)|ri ( j) = l}| for each l ∈ [1, . . . , ∆ ]. 5 6 We assume that agents can give any utilities as input. However, often the utilities are restricted to be the same, i.e., Borda utilities in conference paper bidding, or come from some fixed budget, i.e., bidding fake currency as in course allocation at Harvard [10]. We will omit the arguments when they are clear from context. For indivisible (discrete) objects the lexicographic relation can be modeled by the additive utility relation by setting the agent utilities to high enough values. Formally, if the utility for rank i < j is u(i) > u( j) · m then the lexicographic and additive utility relations are the same, i.e., no matter how many additional objects of rank j the agent receives, one additional object of rank i is more preferred. We now define the relations that a referee might consider between assignments A and B. Lexicographic: An agent i lexicographically prefers A to B if σ i (A) comes before σ i (B) in the lexicographic order. That is, there is an index 1 ≥ l ≥ ∆ such that for all k > l we have σ i,k (A) = σ i,k (B) and σ i,l (A) > σ i,l (B); i.e., i receives at least one more paper of a higher rank in A than in B. The lexicographic relation over vectors has a long history in the assignment literature [18]. Additive Utility: An agent i prefers assignment A to B if he has more additive utility for the objects assigned to him in A than in B. Formally, (and slightly abusing notation) ui (A) = ∑ j∈A(i,:) ui (ri ( j)) > ∑ j∈B(i,:) ui (ri ( j)), or an alternative formulation using the dot product, ui (A) = ui · σ i (A) > ui · σ i (B). 2.3 Overall Assignment Evaluation In the literature there are several optimization objectives defined over an assignment that an implementer may wish to consider. We limit our discussion to the two classical notions below. Additional discussion of objectives, including the imposition of various fairness criteria for the CPAP setting can be found in Garg et al. [19] and for the MARA setting see e.g., Bouveret and Lemaı̂tre [8]. Utilitarian Social Welfare Maximal Assignment: Often called the utilitarian assignment, we want to maximize the total social welfare over all the agents. An assignment is a utilitarian assignment if it satisfies: arg max ∑ ∑ A∈A i∈N j∈A(i,:) ui (ri ( j)) = arg max ∑ ui · σ i (A). A∈A i∈N Egalitarian Social Welfare Maximal Assignment: Often called the egalitarian assignment, we want to enforce the Rawlsian notion of fairness by making sure that the worst off referee is as happy as possible, i.e., maximize the utility of the least well off agent. Formally, arg max min A∈A i∈N ∑ ui (ri ( j)) = arg max min ui · σ i (A). j∈A(i,:) A∈A i∈N In the discrete MARA and CPAP setting where objects are not divisible, the problem of finding an egalitarian assignment is NP-hard [14] while finding a utilitarian assignment can be done in polynomial time [7]. 3 Background and Related Work One and two sided matching and assignment problems have been studied in economics [31] and computer science [26, 9] for over 40 years. Matching and assignment have many applications including kidneys exchanges [15] and school choice [1]. Our problem is often called the multi-agent resource allocation (MARA) problem in computer science [7] The papers to referees formulation of this problem has some additional side constraints common in the economics literature, but not as common in computer science [26]. In the economics literature the Workers-Firms problem is the most closely related analogue to our problem, modeling many-many matchings with capacities [24]. The conference paper assignment has been studied a number of times over the years in computer science [22], as has defining and refining notions of fairness for the assignment vectors in multi-agent allocation problems [20]. We build off the work of Garg et al. [19], who extensively study the notion of fair paper assignments, including leximin and rank-maximal assignments, within the context of conference paper assignment. Garg et al. [19] show that for the setting we study, finding an egalitarian optimal assignment and finding a leximin optimal assignment are both NP-hard when there are three or more equivalence classes; and polynomial time computable when there are only two. They also provide an approximation algorithm for leximin optimal assignments. We know that if the capacity constraints are hard values, i.e., each reviewer must review ≤ x papers and each paper must receive exactly y reviews, then the resulting version of capacitated assignment is NP-hard [25]. Answer set programming for CPAP was studied by Amendola et al. [3]; they encode the CPAP problem in ASP and show that finding a solution that roughly correspond to the leximin optimal and egalitarian solutions can be done in reasonable time for large settings (≈ 100 agents). CPAP also receives considerable attention in the recommender systems [13] and machine learning [12] communities. Often though, this work takes the approach of attempting to infer a more refined utility or preference model in order to distinguish papers. Fairness and efficiency concerns are secondary. A prime example of this is the Toronto Paper Matching System designed by Charlin and Zemel [11]. This system attempts to increase the accuracy of the matching algorithms by having the papers express preferences over the reviewers themselves; where these preferences are inferred from the contents of the papers. We make use of Order weighted averages (OWAs), often employed in multi-criteria decision making [33]. OWAs have recently received attention in computational social choice for voting and ranking [21], finding a collective set of items for a group [32], and multi-winner voting with proportional representation [17, 16]. The key difference between CPAP and voting using OWAs in the ComSoc literature is that CPAP does not select a set of winners that all agents will share. Instead, all agents are allocated a possibly disjoint set of objects. 4 Σ -OWA Assignments We now formally define OWAs and their use for defining assignment objectives. We will discuss alternative formulations of Σ -OWA which have been studied. An order weighted average (OWA) is a function defined for an integer K as a vector α (K) = (α1 , . . . , αK ) of K non-negative numbers. Let x = (x1 , . . . , xK ) be a vector of K numbers and let x↓ be the non-increasing rearrangement of x, i.e. x↓ = x↓1 ≥ x↓2 ≥ . . . ≥ x↓K . Then we say: K OWAα (x) = α · x↓ = ∑ αi · x↓i . i=1 In order to apply OWAs to our setting we need to define the weighted rank signature of an assignment. Let ω i (A) be defined as the sorted vector of utility that a referee gets from an assignment A. Formally, ω i (A) = sort({∀ j ∈ A(i, :) : ui (r( j))}). For example, if A(i, :) included two objects with utility 3, one of utility 1, and one of utility 0, we would have ω i (A) = (3, 3, 1, 0). Our inspiration for applying OWAs comes from a multi-winner voting rule known as Proportional Approval Voting (PAV) [23, 5, 4]. In approval voting settings, each agent can approve of as many candidates as they wish. Under the standard approval voting (AV) method, all approvals from each agent assign one point to the candidate for which they are cast. However, this can lead to a number of pathologies described by Aziz et al. [5] and it intuitively does not seem fair; once a candidate that you like has been selected to the winning set your next candidate selected to the winning set should seemingly count less. Hence in PAV, which is designed to be more fair [4], a voter’s first approval counts for a full point, the second for 1/2, the next for 1/3, and on as a harmonically decreasing sequence. Transitioning this logic to the CPAP setting, we were motivated to find a way to distribute objects to agents that increases the number of agents who receive their top ranked objects. This is the logic of PAV: once you get a candidate into the winning set, you should count less until everyone else has a candidate in the winning set. If we desire to directly get a rank maximal assignment, completely ignoring the utilities, then we know this is polynomial by a result from Garg et al. [19]. However, if we wish to modulate between using the utilities and using only the ranks, perhaps we can use OWAs. We use the sum over all agents of OWAα (ω) = α · ω as the optimization criteria for the assignment. In order to cleanly define this we need to place some restrictions on our OWA vectors. Firstly, the length of α needs to be at least as long as the maximum agent capacity, i.e., |α| ≥ arg maxi∈N (cNmax (i)). Typically the literature on OWAs assumes that α is normalized, i.e., ∑1≤i≤K αi = 1. We do not enforce this convention as we wish to study the PAV setting with α = (1, 1/2, . . .). This is formally a relaxation and we observe that whether or not the OWAs are normalized does not affect our computational results. However, we do require that our OWA vector be non-increasing and that each entry be ≥ 0, i.e., for any i, j ∈ |α|, i < j we have α i ≥ α j ≥ 0. Σ -OWA A SSIGNMENT Input: Given an assignment setting (N, O, , u, ∆ ) with agent capacities [cNmin (i), cNmax (i)] for all i ∈ N, and object capacities O [cO min ( j), cmax ( j)] for all j ∈ O, and a non-increasing OWA vector α i with |α| ≥ max∀i ∈N (cNmax (i)). Question: Find a feasible assignment A such that |n| A = arg max ∑ α i · ω i (A). A∈A i=1 In our formulation, the OWA operator is applied to the vector of agent utilities and then we aggregate (or sum) these modified utilities to give the assignment objective. Hence, the Σ -OWA name. We observe that this formulation strictly generalizes the utilitarian assignment objective; if we set α = (1)n we recover the utilitarian assignment. One may also wish to consider applying the OWA over the sorted vector of total agent utility for their allocation, which one could call the OWA-Σ version of our problem. Indeed, this formulation of the problem has been considered before and proposed in the earliest writings on OWAs for decision making [33]. Taking the OWA-Σ formulation allows one to recover both the utilitarian assignment, α = (1/n, . . . , 1/n), as well as the egalitarian assignment, α = (0, . . . , 0n−1 , 1). However, because the OWA-Σ formulation is a generalization of the egalitarian assignment, it becomes NP-hard in general [14]. We think of the α vector as a kind of control knob given to the implementer of the market, allowing them to apply a sub-linear transform to the agent utilities. This ability may be especially useful when agents are free to report their (normalized) utilities for ranks via bidding or other mechanisms [10]. In many settings the utility vector is controlled by the individual agents, while the OWA vector is under the control of the market implementers. Consider the following example. Example 1. Consider a setting with four agents N = {a1 , a2 , a3 , a4 } agents and four objects O = {o1 , o2 , o3 , o4 }. For all agents let cNmin = cNmax = 2 and for all objects let O 1 cO min = cmax = 2. For the Σ -OWA assignment, let α = (1, /2). a1 a2 a3 a4 o1 o2 11 9 8 8 7 7 6 6 o3 0 2 3 4 o4 0 2 3 4 We get the following allocations. Utilitarian: A(a1 , :) = {o1 , o2 }, u1 (A) = 20; A(a2 , :) = {o1 , o2 }, u2 (A) = 16; A(a3 , :) = {o3 , o4 }, u3 (A) = 6; A(a4 , :) = {o3 , o4 }, u4 (A) = 8; ∑i ui (A) = 50. OWA, α = (1, 1/2): A(a1 , :) = {o1 , o2 }, u1 (A) = 20, α · ω 1 = 15.5; A(a2 , :) = {o2 , o3 }, u2 (A) = 10, α · ω 2 = 9.0; A(a3 , :) = {o1 , o4 }, u3 (A) = 10, α · ω 3 = 8.5; A(a4 , :) = {o3 , o4 }, u4 (A) = 8, α · ω 4 = 5.0; ∑i ui (A) = 48. Egalitarian: A(a1 , :) = {o1 , o4 }, u1 (A) = 11; A(a2 , :) = {o2 , o4 }, u2 (A) = 10; A(a3 , :) = {o2 , o3 }, u3 (A) = 10; A(a4 , :) = {o1 , o3 }, u4 (A) = 10; ∑i ui (A) = 41. Inspecting the results of Example 1, we observe that in the set of all utilitarian maximal assignments have a1 and a2 each being assigned to o1 and o2 , in the set of all Σ -OWA maximal assignments a3 is assigned one of o1 or o2 while a2 is assigned one of o3 or o4 , while in the set of all egalitarian maximal assignments each of the agents receives one of either o1 or o2 along with one of o3 or o4 . Thus we observe the following. Observation 1 The set of assignments returned by each of the three objective functions, utilitarian, egalitarian, and OWA, can be disjoint. There are instances where the set of Σ -OWA assignments is the same as the set of egalitarian assignments, but disjoint from the set of utilitarian assignments. Hence, it is an interesting direction for future work to fully characterize Σ -OWA assignments and discover OWA vectors with nice properties. 4.1 Pareto Optimality An allocation S is more preferred by a given agent with respect to pairwise comparisons than allocation T if S is a result of replacing an item in T with a strictly more preferred item. Note that the pairwise comparison relation is transitive. An allocation is Pareto optimal with respect to pairwise comparisons if there exists no other allocation that each agent weakly prefers and at least one agent strictly prefers. Lemma 1. Consider an agent i and two allocations S and T of equal size. Then if S is at least as preferred as T by i with respect to pairwise comparison, then S yields at least as much OWA value as T for any OWA vector no matter if it is increasing or decreasing. Proof. Note that S can be viewed as a transformation from T where each item j is replaced by some other item j0 that is at least as preferred. Hence, the value of the item either stays the same or increases. In either case, the corresponding OWA multiplied with the value is the same. Since the OWA transform is bilinear, the total OWA score of S is at least as much as that of T . Proposition 1. The Σ -OWA maximal assignment is Pareto optimal with respect to pairwise comparison irrespective of the OWA. Proof. Assume for contradiction that a Σ -OWA maximal assignment A is not Pareto optimal with respect to pairwise comparisons. From Lemma 1, there exists another outcome A0 that each agent weakly prefers and at least one agent strictly prefers. But this means that in A0 each agent gets at least as much OWA score and at least one agent gets strictly more. But this contradicts the fact that A is OWA maximal. 5 An Algorithm for Σ -OWA assignments We give an algorithm for finding Σ -OWA assignments using flow networks. In this proof we use the most general formulation of our problem by allowing the values of the upper and lower per-agent capacities, [cNmin (i), cNmax (i)], to vary for each agent; and the O upper and lower object capacities, [cO min ( j), cmax ( j)], to vary for each object. Theorem 2. An Σ -OWA assignment can be found in polynomial time. Proof. We reduce our problem to the problem of finding a minimum cost feasible flow in a graph with upper and lower capacities on the edges, which is a polynomial time solvable problem. In addition to being polynomial time solvable, we know that the flow is integral as long as all edge capacities are integral, even if we have real valued costs [2]. Figures 1 and 2 provide a high level view of the flow network that we will construct. N C = [cNmin (1), cNmax (1)] ] N (2) , c max C s N (2) = [c min C = [cNmin (3), cNmax (3)] C = [cNmin (n), cNmax (n)] O a1 .. . Gadget a1 o1 a2 .. . Gadget a2 o2 a3 .. . Gadget a3 o3 .. . Gadget an om an O C = [cO min (1), cmax (1)] C= [cmO in (2), O cm ax (2) ] C= O [cO min (3), cmax (3)] t O C = [cO min (m), cmax (m)] Fig. 1. Main gadget for the reduction which enforces the agent and object capacity constraints. In Figure 1 we first build a tripartite graph with two sets of nodes and one set of gadgets per agent: the agent nodes, one for each agent ai ; the agent gadgets, one (illustrated in Figure 2) for each agent ai ; and the object nodes, one for each object o j . There is an edge from the source node s to each of the agent nodes, each with cost 0, minimum flow capacity cNmin (i) and a maximum flow capacity cNmax (i). This set of edges and nodes enforces the constraint that each ai has capacity [cNmin (i), cNmax (i)]. We also construct an edge from each object node to the sink t. Each of these edges has a cost O 0, a minimum capacity cO min ( j), and a maximum capacity cmax ( j). This set of edges O O enforces the constraint that each o j has capacity [cmin ( j), cmax ( j)]. We now turn to the agent gadget depicted in Figure 2 for arbitrary ai . The leftmost node and the rightmost set of nodes in Figure 2 correspond to the agent nodes N and N O o1 α1 )· α1 o1 w w = i( −u ) u i(o 2 =− · α1 w = −ui (o3 ) · α1 α1 w= ai o1 o1 ai o2 o2 ai o3 o3 ai om om o2 α1 o3 α1 −u (o i m)·α 1 om α1 ai α2 w= ·α o 1) i( −u u i (o 2 w=− αd d ) · αd w = −u (o i w= 3 ) · αd o1 αd o2 αd o3 αd −u i (o m)· αD om αd Fig. 2. The per agent gadget. Note that all costs on edges are 0 and all capacities are [0,1] unless otherwise noted. object nodes O in Figure 1, respectively. In each agent gadget we create a tripartite subgraph with the agent node ai serving as the source and the set of object nodes O serving as the sinks. We create three layers of nodes which we describe in turn from left to right. First, we create a set of decision nodes with labels α1 , . . . , αd where cNmax (i) ≤ d ≤ |α|. Intuitively, we will be multiplying the OWA value α1 by the utility for some object, so we need to keep track of all the values that could result. The arcs from ai to each of the nodes in this set has upper capacity 1, minimum capacity 0, and cost 0. If we have the case that cNmax (i) < d then we can set the maximum capacity of the edges to node(s) α j , j > cNmax (i) to 0. This enforces that each value in the OWA vector can modify at most one utility value. For each of the decision nodes α1 , . . . , αd constructed, we create a set of object/decision nodes for each o j which we denote o j αk . From each of the decision nodes α1 , . . . , αd we create an edge to each of the object/decision nodes created for this particular decision node αk , i.e., o1 α1 , o2 α1 , . . . , om α1 for α1 . Each of these edges has maximum capacity 1 and a cost equal to −1 · ui (o j ) · α1 for rank 1 and object o j ∈ O. These costs are the (negative) cost that matching agent ai with object o j at weighted rank dk contributes to the OWA objective. Finally, we create one set of agent/object nodes, one for each o j denoted ai o j . From all the object/decision nodes we connect all nodes with a label of o j to the corresponding agent/paper node, i.e., o1 α1 , o1 α2 , . . . o1 αd all connect to ai o1 with cost 0 and maximum capacity 1. We then connect the agent/object node to the corresponding object node in the main construction from O, i.e., ai o1 to o1 with cost 0 and maximum capacity 1. This set of nodes and edges enforces that each agent can be assigned each object once. We can extract an assignment from the minimum cost feasible flow by observing that paper o j is allocated to agent ai if and only if there is a unit of flow passing from the particular agent/object node ai o j to the object node o j . We now argue for the correctness of our algorithm in two steps, (1) that all constraints for the Σ -OWA assignment problem are enforced and (2) that a minimum cost feasible flow in the constructed graph gives an Σ -OWA assignment. For (1) we note that since the units of flow across the graph represent the assignment and we have explained how the capacity constraints on all edges enforce each of the particular constraints imposed by our definition of a feasible assignment, there is a feasible flow iff the flow satisfies the constraints. For (2) observe that for each agent, the α nodes fill with flow in order from α1 to αd as the OWA vector is non-increasing and the utilities are decreasing, i.e., for each agent, the edge costs monotonically increase from the edges associated with α1 to the edges associated with αd . Thus, for each agent, the first unit of flow to this agent will use the least cost (most negative) edge must be associated with α1 ; and similarly for α2 through αd . From the capacity constraints we know there is only one unit of flow that enters each decision node αi and there is only one unit of flow that can leave each agent/paper node ai o j . This means that each αi can modify only one o j and each o j selected must be unique for this agent. As the decision nodes are filled in order and αi can only modify the value for a single object, we know the total cost of the flow across the agent gadget for each ai is equal to −1 · α i · ω i . Hence, the price of the min cost flow across all agents is equal to −1 · ∑∀i∈N α i · ω i (A). Thus, the min cost flow in the graph is an Σ -OWA assignment. 5.1 Generalizations We observe two possible generalizations of the above construction which allow us to use this constructive proof for more general instances than the CPAP. First, The proof above can be generalized to allow for α to vary for each agent. Specifically, observe that the decision nodes for each agent ai are independent from all other agents. This means that, for each agent (or a class of agents) we could use an OWA vector α ai . This ability may be useful, for instance, when a group of agents reports the same extreme utility distribution and the organizer wishes to apply the same transform to these utilities. The second generalization that we can make to the above construction is to allow each agent to be assigned to each object more than once. While this ability does not make sense in the reviewers/papers setting (unless there are sub reviewers) there could be other capacitated assignment settings where we may wish to assign the agents to objects multiple times e.g., if there are discrete jobs that need to be done a certain number of times but and a single agent can be assigned the same job multiple times. In order to generalize the capacity constraint from 1 for each agent i for each object j we introduce a capacity upper bound zi, j which encodes the number of times that agent i can be assigned to object j. Taking zi, j = 1 for all i and j gives us the original CPAP setting. In order to enforce this constraint, within each agent gadget (Figure 2) we add a capacity constraint equal to zi, j from each edge ai o j to o j . If we want a lower bound for the number of copies of o j assigned to ai we can encode this lower bound on this edge as well. We can extract an assignment from the minimum cost feasible flow by observing that paper o j is allocated to agent ai zi j times if and only if there are units of flow passing from the particular agent/object node ai o j to the object node o j . The argument for correctness follows exactly from the proof of Theorem 2 above. Corollary 1. An Σ -OWA assignment can be found in polynomial time even if each agent ai has a unique OWA vector α ai and each object o j can be assigned to each agent ai any number of times (not just once). 6 Experiments We now turn to the question of how good are Σ -OWA assignments in practice? We answer this question using real world data from three large international conferences (MD-00002-00000001 – 00000003) from WWW.P REF L IB . ORG [27]. We focus discussion on MD-00002-00000003 which has 146 agents and 175 objects. We implemented the algorithm given in Section 5 using networkX for Python and Lemon for C++. However, we still have a run time ≈ O(V 4 ), giving runtime ≈ (1502 · 3)4 ) = 2 × 1019 , which caused our computers to crash even with 16GB of memory. This was quite disappointing as we thought the flow argument could be used to solve this problem on real-world instances. Not to be deterred, we still wanted to investigate the assignments we get from Σ OWA compare to the utilitarian and egalitarian assignments. Consequently, we implemented the model as an MIP in Gurobi 7.0 and it ran in under 1 minute for all instances and settings using 4 cores. Our MIP is similar to the one given by Skowron et al. [32] and the MARA MIP by Bouveret et al. [7]. However, as we have capacity constraints and individual/variable length OWAs, our MIP is more general than either. To encode the Σ -OWA problem we introduce a binary variable xa,o indicating that agent a is assigned object o. We introduce a real valued variable uowa,a which is the Σ -OWA utility for agent a. Finally, we introduce ra,o,p for the OWA matrix which notes that agent a is assigned object o at OWA rank p. The MIP is given below. max ∑a∈A ∑o∈O,p∈P ua (o) · α p · ra,o,p O s.t. cO min (o) ≤ ∑a∈A xa,o ≤ cmax (o) N (a) cN (a) ≤ x ≤ c ∑o∈O a,o max min ∑ p∈P ra,o,p ≤ 1 ∑o∈O ra,o,p ≤ 1 ∑ p∈P ra,o,p ≥ xa,o ∑o∈O ra,o,p ≥ ∑o∈O ra,o,p+1 ∑o∈O ra,o,p · ua (o) ≥ ∑o∈O ra,o,p+1 · ua (o) ∀o ∈ O ∀a ∈ A ∀a ∈ A, ∀o ∈ O ∀a ∈ A, ∀p ∈ P ∀a ∈ A, ∀o ∈ O ∀a ∈ A, ∀p ∈ P ∀a ∈ A, ∀p ∈ P Description: (1) Object Capacities (2) Agent Capacities (3) One Object per OWA Rank (4) Objects Have One Rank (5) Assignment to OWA Link Fcn. (6) Ranks Fill in Increasing Order (7) Agent Utility Must Be Decreasing Constraints (1)–(4) enforce the cardinality constraints on the agents, objects, and OWA rank matrix. Constraint (5) links the agent and object assignments to be positions in the OWA rank matrix. Line (6) enforces that the rank matrix fills from the first position to the cNmax position for each agent. And finally (7) enforces that the Σ -OWA value of the assignment positions in the rank matrix must be decreasing. We then maximize the sum over all agents of the OWA objective value. We found the utilitarian, egalitarian, and Σ -OWA assignments for each of the real world datasets when each object must receive 3–4 reviews and each agent must review 6–7 objects. In the data, each agent sorts the papers into 4 equivalence classes which we gave utility values (5, 3, 1, 0). We use the PAV inspired decreasing harmonic OWA vector (1, 1/2, 1/3, . . .) to compute the Σ -OWA assignment. One of the reasons we wanted to use the Σ -OWA assignment is to allow the market designer to enforce a more equitable distribution of papers with respect to the ranks. Hence, our test statistic is the number of top ranked items that the average agent can expect to receive. Figure 3 shows the agent counts and the cumulative distribution function (CDF) for the number of top ranked items the agents receive. Looking at the left side of the figure, we see that 71 agents receive 5 top ranked papers under the Σ -OWA assignment while under the utilitarian assignment only 46 do. Under the utilitarian assignment 35 agents receive more than 5 top ranked papers. Consequently, on average, agents can expect to get 4 top ranked papers in the Σ -OWA assignment, 3 in the egalitarian assignment, and 4.2 in the utilitarian assignemnt. However under the utilitarian assignment, several agents receive an entire set of top ranked objects, while the egalitarian assignment modulates this so that most agents only receive 3–4 top ranked items. In contrast, the Σ -OWA assignment is a balance between these with the most agents receiving 5 top ranked items. Agents Per Num. Top Ranked 70 Num. of Agents 60 50 40 30 20 10 00 1 2 3 4 5 6 Num. Top Ranked CDF of Num. Top Ranked P(Num. Top Ranked) < x Utilitarian Egalitarian OWA 7 Utilitarian Egalitarian OWA 1.0 0.8 0.6 0.4 0.2 0.00 1 2 3 4 5 6 Num. Top Ranked 7 Fig. 3. The count of agents receiving x top ranked papers (top) and the cumulative distribution function (CDF) (bottom) for the number of agents being assigned x top ranked objects for MD00002-00000003. Though 100% of the agents receive between 1 and 5 top ranked items for the egalitarian and Σ -OWA assignments (CDF), the PDF shows that the most agents receive the most top ranked items under the Σ -OWA assignment. 7 Conclusions We have proposed and provided algorithms for the novel notion of a Σ -OWA assignment. The Σ -OWA assignment using decreasing OWA vectors gives the central orga- nizer a “slider” to move from utility maximizing towards a more rank maximal assignment computationally efficient package. An important open question for future work is to find axiomatic characterizations for good OWA vectors. Additionally, the OWA method, and all methods for CPAP that we surveyed, treat objects as having positive utility. It is generally the case that reviewers at a conference want to review fewer, not more, papers. Consequently it would be interesting to study CPAP from the point of view of chores, as they are called in the economics literature. References [1] Abdulkadiroğlu, A., Pathak, P., Roth, A.E.: The New York City high school match. American Economic Review pp. 364–367 (2005) [2] Ahuja, R.K., Magnanti, T.L., B.Orlin, J.: Network Flows: Theory, Algorithms, and Applications. Prentice Hall (1993) [3] Amendola, G., Dodaro, C., Leone, N., Ricca, F.: On the application of answer set programming to the conference paper assignment problem. In: Proc. of the 15th International Conference of the Italian Association for Artificial Intelligence (AI*IA), pp. 164–178 (2016) [4] Aziz, H., Brill, M., Conitzer, V., Elkind, E., Freeman, R., Walsh, T.: Justified representation in approval-based committee voting. In: Proc. of the 29th AAAI Conference (2015) [5] Aziz, H., Gaspers, S., Gudmundsson, J., Mackenzie, S., Mattei, N., Walsh, T.: Computational aspects of multi-winner approval voting. In: Proc. of the 14th AAMAS Conference (2015) [6] Aziz, H., Lev, O., Mattei, N., Rosenschein, J.S., Walsh, T.: Strategyproof peer selection: Mechanisms, analyses, and experiments. In: Proc. of the 30th AAAI Conference (2016) [7] Bouveret, S., Chevaleyre, Y., Lang, J.: Fair allocation of indivisible goods. In: Brandt, F., Conitzer, V., Endriss, U., Lang, J., Procaccia, A.D. (eds.) Handbook of Computational Social Choice, chap. 12, pp. 284–311. Cambridge University Press (2016) [8] Bouveret, S., Lemaı̂tre, M.: Characterizing conflicts in fair division of indivisible goods using a scale of criteria. Autonomous Agents and Multi-Agent Systems 30(2), 259–290 (2016) [9] Brandt, F., Conitzer, V., Endriss, U., Lang, J., Procaccia, A.D. (eds.): Handbook of Computational Social Choice. Cambridge University Press (2016) [10] Budish, E., Cantillon, E.: The multi-unit assignment problem: Theory and evidence from course allocation at harvard. The American Economic Review 102(5), 2237–2271 (2012) [11] Charlin, L., Zemel, R.S.: The Toronto paper matching system: an automated paper-reviewer assignment system. In: Proc. of the ICML Workshop on Peer Reviewing and Publishing Models (PEER) (2013) [12] Charlin, L., Zemel, R.S., Boutilier, C.: A framework for optimizing paper matching. CoRR abs/1202.3706 (2012) [13] Conry, D., Koren, Y., Ramakrishnan, N.: Recommender systems for the conference paper assignment problem. In: Proc. of the 3rd ACM Conference on Recommender Systems (RecSyS). pp. 357–360 (2009) [14] Demko, S., Hill, T.P.: Equitable distribution of indivisible objects. Mathematical Social Sciences 16, 145–158 (1988) [15] Dickerson, J.P., Procaccia, A.D., Sandholm, T.: Price of fairness in kidney exchange. In: Proc. of the 13th AAMAS Conference. pp. 1013–1020 (2014) [16] Elkind, E., Ismaili, A.: Owa-based extensions of the Chamberlin-Courant rule. In: Proc. of the 4th ADT Conference. pp. 486–502 (2015) [17] Elkind, E., P., Faliszewski, Skowron, P., Slinko, A.: Properties of multiwinner voting rules. In: Proc. of the 13th AAMAS Conference. pp. 53–60 (2014) [18] Fishburn, P.C.: Lexicographic orders, utilities and decision rules: A survey. Management science 20(11), 1442–1471 (1974) [19] Garg, N., Kavitha, T., Kumar, A., Mehlhorn, K., Mestre, J.: Assigning papers to referees. Algorithmica 58(1), 119–136 (2010) [20] Golden, B., Perny, P.: Infinite order lorenz dominance for fair multiagent optimization. In: Proc. of the 9th AAMAS Conference. pp. 383–390 (2010) [21] Goldsmith, J., Lang, J., Mattei, N., Perny, P.: Voting with rank dependent scoring rules. In: Proc. of the 28th AAAI Conference. pp. 698–704 (2014) [22] Goldsmith, J., Sloan, R.: The AI onference paper assignment problem. In: Proc. of the 22nd AAAI ConferenceWorkshop on Preference Handling for Artificial Intelligence (MPREF) (2007) [23] Kilgour, D.M.: Approval balloting for multi-winner elections. In: Handbook on Approval Voting, chap. 6. Springer (2010) [24] Klaus, B., Manlove, D.F., Rossi, F.: Matching under preferences. In: Brandt, F., Conitzer, V., Endriss, U., Lang, J., Procaccia, A.D. (eds.) Handbook of Computational Social Choice, chap. 14, pp. 333–356. Cambridge University Press (2016) [25] Long, C., Wong, R., Peng, Y., Ye, L.: On good and fair paper-reviewer assignment. In: Proc. of the 13th IEEE International Conference on Data Mining (ICDM). pp. 1145–1150 (2013) [26] Manlove, D.: Algorithmics of Matching Under Preferences. World Scientific (2013) [27] Mattei, N., Walsh, T.: Preflib: A library for preferences, http://www.preflib.org. In: Proc. of the 3rd ADT Conference. pp. 259–270 (2013) [28] Merrifield, M.R., Saari, D.G.: Telescope time without tears: a distributed approach to peer review. Astronomy & Geophysics 50(4), 4–16 (2009) [29] Price, S., Flach, P.A.: Computational support for academic peer review: A perspective from artificial intelligence. CACM 60(3), 70–79 (2016) [30] Rawls, J.: A Theory of Justice. Harvard University Press (1971) [31] Roth, A.E., Sotomayor, M.A.O.: Two-Sided Matching: A Study in GameTheoretic Modeling and Analysis. Cambridge University Press (1992) [32] Skowron, P., Faliszewski, P., Lang, J.: Finding a collective set of items: From proportional multi-representation to group recommendation. AIJ 241, 191–216 (2016) [33] Yager, R.: On ordered weighted averaging aggregation operators in multicriteria decisionmaking. IEEE Transactions on Systems, Man and Cybernetics 18(1), 183–190 (1988)
2cs.AI
arXiv:1612.00196v4 [math.ST] 11 Dec 2016 Estimating a monotone probability mass function with known flat regions Dragi Anevski and Vladimir M. Pastukhov ∗ Centre for Mathematical Sciences, Lund University, Lund, Sweden Abstract We propose a new estimator of a discrete monotone probability mass function with known flat regions. We analyse its asymptotic properties and compare its performance to the Grenander estimator and to the monotone rearrangement estimator. 1 Introduction In this paper we introduce a new estimator of a monotone discrete distribution. The problem has been studied before, and in particular by [9], who were the first to study the estimation problem and who also introduced two new estimators. The problem of monotone probability mass function estimation is related to the problem of density estimation under shape constraints, first studied and much earlier by Grenander [8]. The literature for the continuous case problem is vaste, to mention just a few results, see for example [5, 10]. In the discrete case problem some recent results are [2, 6, 7, 9]. Both in the discrete and continuous case problems one has derived, in particular, limit distribution results under the assumption of regions of constancy the true and underlying density/probability mass function. However, to our knowledge, one has previously not used the assumption of regions of constancy in the estimation procedure. In this paper, we do use this information in the constructing of the estimator. Thus we present a Maximum Likelihood estimator (MLE) under the assumption of regions of constancy of the probability mass function and derive some limit properties for new estimator. ∗ pastuhov@maths.lth.se 1 The paper is mainly motivated by the paper by H. K. Jankowski and J. A. Wellner [9], which was the first to study the problem of estimating a discrete monotone distribution. To introduce the estimator, suppose that p = {pi }i∈N+ is a monotone decreasing probability mass P function with support N+ with several known flat regions, i.e. pi > 0, i∈N+ pi = 1 and p1 = · · · = pw1 > pw1 +1 = · · · = pw1 +w2 > · · · > pPm−1 = · · · = pk , j=1 wj +1 (1) where k = sup{i : pi > 0}, m is the number of flat regions of p, w = (w1 , . . . , wm ) is the vector of the lengths (the P numbers of points) of the flat regions of the true mass function p, so that m j=1 wj = k for k < ∞ and P m w = ∞ otherwise. Note, that if p is strictly decreasing at some point j=1 j i, then w = 1 and if p is strictly decreasing on the whole support, then m = k and w = (1, . . . , 1) for k < ∞ and m = ∞ otherwise. Suppose that we have observed X1 , X2 , . . . , Xn i.i.d. random variables with probability mass function p. The empirical estimator of p is then given by p̂n,i = ni , n ni = n X 1{Xj = i}, j=1 i ∈ N+ , (2) and it is also the unrestricted Maximum Likelihood Estimator (MLE) p̂n = argmax g∈Gk k Y gini , i=1 where k o n X k Gk = g ∈ R+ : gi = 1 i=1 P P and with ni = nj=1 1{Xj = i}. Then for a given n = ki=1 ni , the vector (n1 , . . . , nk ) follows a multinomial distributions Mult(n, p). The empirical estimator p̂n is unbiased, consistent and asymptotically normal, see [9, 14]. It, however, does not guaranty that the order restriction p̂n,1 ≥ p̂n,2 ≥ · · · ≥ p̂n,k is satisfied. 2 (3) We next discuss two estimators that do satisfy the order restrictions, first introduced in [9]. These are the order restricted MLE and monotone rearrangement of the empirical estimator. The monotone rearrangement of the empirical estimator p̂R n is defined as p̂R n = rear(p̂n ), (4) where p̂n is the unrestricted MLE in (2) and rear(v) for a vector v = (v1 , . . . , vk ) is the reverse-ordered vector. The estimator p̂R n clearly satisfies the order restriction (3). The MLE under the order restriction (3), p̂G n , is defined as p̂G n = argmax f ∈Fk k Y fini , i=1 where n Fk = f ∈ Rk+ : k X i=1 fi = 1, f1 ≥ f2 ≥ · · · ≥ fk o ⊂ Gk . It is equivalent to the isotonic regression of the unrestricted MLE, see [3, 9, 11], defined by p̂G n = argmin f ∈Fk k X i=1 [p̂n,i − fi ]2 , (5) where the basic estimator p̂n,i is the unrestricted MLE in (2). The estimator p̂G n is usually called the Grenander estimator and is derived using the same algorithm as for the continuous case problem: it is the vector of left derivatives of the leastP concave majorant (LCM) of the empirical distribution function Fn (x) = n−1 ni=1 1[1,x] (Xi ). R The estimators p̂G n and p̂n were introduced and studied in detail in the paper by Jankowski and Wellner [9]. In particular, H. Jankowski and J. Wellner [9] derived consistency of the estimators and analysed further asymptotic properties and performance of√the estimators for distributions and √ different R G data sets. They showed that n(p̂n − p) and n(p̂n − p) converge weakly to the processes Y R and Y G which are obtained by the following transform of a Gaussian process on the space l2 with mean zero and covariance matrix with the components pi δij − pi pj : for all periods of constancy, r through s, of p let (Y R )(r,s) = rear(Y (r,s) ) (Y G )(r,s) = (Y (r,s) )G , 3 where Y (r,s) denotes the r through s elements of Y , cf. Theorem 3.8 in [9]. In this paper we construct an estimator of a monotone probability mass function in the following way p̂∗n = argmax f ∈Fk∗ k X i=1 fini , (6) i=1 where n Fk∗ = f ∈ Rk+ : k Y fi = 1, f1 = · · · = fw1 ≥ fw1 +1 = · · · = fw1 +w2 ≥ · · · ≥ fPm−1 j=1 wj +1 = · · · = fk o P and with ni = nj=1 1{Xj = i}. We note that the vector w = (w1 , . . . , wm ) constitutes the lengths of m flat regions of the true probability mass function. We propose the following algorithm: 1. Assume we are given a data set (x1 , . . . , xn ) of observations from n i.i.d. random variables X1 , X2 , . . . , Xn and the vector of the lengths of the flat regions of the true mass function (w1 , . . . , wm ). 2. We group the probabilities, which are required to be equal, at each flat region of p = {pi }i∈{1,...,k} into the single parameters p′j , j ∈ {1, . . . , m}. Note here, that the true values p′j are strictly decreasing and satisfy the following linear constraint w1 p′1 + w2 p′2 + · · · + wm p′m = 1. 3. Next, we find the order restricted MLE of p̂′n = (p′1 , . . . p′m ), which is equivalent to the isotonic regression with weights (w1 , . . . , wm ), ′ p̂nG = argmin ′ f ′ ∈Fm,w m X j=1 [p̂′n,j − fj′ ]2 wj , where ′ Fm,w m o n X ′ m ′ , = f ∈ R+ : fj′ wj = 1, f1′ ≥ f2′ ≥ · · · ≥ fm j=1 and with p̂′n,j the unrestricted MLE defined by p̂′n = argmax m Y ′ g′ ∈Gm,w j=1 4 n′ g′j j , where ′ Gm,w m n o X ′ m ′ = g ∈ R+ : wj gj′ = 1 ⊃ Fm,w , j=1 cf. Lemma 2 below for a proof of thePequivalence. Here the data are reduced to the vector n′ with n′j = nl=1 1{Xl ∈ {qj , qj + wj }} and where qj is an index of the first element in the j-th flat region of p. ′ 4. Having obtained the MLE p̂nG of p′ , we finally construct the MLE p̂∗n of p ∈ Fk∗ , by letting the probabilities in the flat region of p be equal ′ to the corresponding values in p̂nG . This can be written in matrix form as ′ p̂∗n = Ap̂nG , (7) where A is a k × m matrix, with non-zero elements all ones: [A]qj :qj +wj −1,j = 1, with j ∈ {1, . . . , m}, qj , qj is the first index of the j-th flat region of p and wj is the length of the j-th flat region. Our goal is to investigate the estimator p̂∗n and compare its performance with the monotone rearrangement estimator p̂R n defined in (4) and the GrenanG der estimator p̂n defined in (5). The paper is organised as follows. In Lemma 2 in Section 2 we prove that the order restricted MLE, for the grouped parameters, is given by the isotonic regression of the unrestricted MLE of the grouped parameters. Next, Lemma 3 shows consistency and asymptotic normality of the unrestricted MLE for the grouped parameters. After that in Lemma 4 we show that the order restricted MLE for the grouped parameters is consistent and asymptotically Normal. Finally, in Theorem 1 we show consistency and derive the limit distribution for the new estimator p̂∗n . In Section 3 we make a comparison with previous estimators. In particular, in Lemma 5 we show that p̂∗n has, properly scaled, asymptotically smaller risk both with l2 as well as with Hellinger loss, compared to the Grenander estimator. The asymptotically smaller risk of p̂∗n compared to p̂R n follows from this result together with R the result by [9] on the better risk performance of p̂G n with respect to p̂n . The paper ends with a small simulation study, illustrating the small sample R behaviour of p̂∗n in comparison with p̂G n and p̂n ; the new estimator seems to R G perform better then both p̂n and p̂n . 5 2 Proof of characterization of estimator and asymptotic results In this section we prove the statements which have been made for the algorithm above and analyse the asymptotic properties of the estimator p̂∗n . We begin with a Lemma which will be used later in this section. Lemma 1 Assume {Xn } and {Yn } are sequences of random variables, taking values in the metric space (Rk , l2 ) with k ≤ ∞ endowed with its Borel sigma d d algebra. If Xn → X and limn→∞ P(Xn = Yn ) = 1, then Yn → X. Proof. To prove the statement of the Lemma, we use the Portmanteau Lemma in [14], giving several equivalent characterisations of distributional convergence. From the Portmanteau Lemma it follows that we have to prove E[h(Yn )] → E[h(X)] for all bounded Lipschitz functions h. By the triangle inequality |E[h(Yn )] − E[h(X)]| ≤ |E[h(Xn )] − E[h(X)]| + |E[h(Yn )] − E[h(Xn )]|, (8) where the first term |E[h(Xn )] − E[h(X)]| → 0, by the Portmanteau Lemma. Next, take an arbitrary ε > 0, then the second term in (8) is bounded as |E[h(Yn )] − E[h(Xn )]| ≤ E[|h(Yn ) − h(Xn )|] ≤ E[|h(Yn ) − h(Xn )|1{l2 (Yn , Xn ) > ε}] (9) +E[|h(Yn ) − h(Xn )|1{l2 (Yn , Xn ) ≤ ε}]. Here using the boundness of h, for the first term in the right hand side of (9) we have that E[|h(Yn ) − h(Xn )|1{l2 (Yn , Xn ) > ε}] ≤ 2 sup{h(X)}E[1{l2 (Yn , Xn ) > ε}] = 2 sup{h(X)}P[l2 (Yn , Xn ) > ε], where limn→∞ P[l2 (Yn , Xn ) > ε] = 0 for every ε > 0, since limn→∞ P(Xn = Yn ) = 1. The second term in the right hand side of (9) can be written as E[|h(Yn ) − h(Xn )|1{l2(Yn , Xn ) ≤ ε}] ≤ ε|h|Lip P[l2 (Yn , Xn ) ≤ ε], where |h|Lip is the Lipschitz norm, i.e. |h|Lip is the smallest number such that |h(x) − h(y)| ≤ |h|Lip l2 (x, y). Furthermore limn→∞ P[l2 (Yn , Xn ) ≤ ε] = 1 for every ε > 0, since limn→∞ P(Xn = Yn ) = 1. 6 Therefore, taking the limsup of the the left hand side of equation (9) we obtain lim sup|E[h(Yn )] − E[h(Xn )]| ≤ ε|h|Lip , n→∞ where ε is an arbitrary positive number. Thus |E[h(Yn )] − E[h(Xn )]| → 0, as n → ∞. ✷ Our goal is to obtain the asymptotic distribution of p̂∗n , defined in (6). The true probability mass function p satisfies the order restrictions in Fk∗ . Let us make a reparametrisation by grouping the probabilities, which are required to be equal, at each flat region of p = {pi }i∈{1,...,k} into the single parameters p′j , j ∈ {1, . . . , m}. The reparametrisation transforms Fk∗ into ′ Fm,w m o n X ′ ′ m fj′ wj = 1, f1′ ≥ f2′ ≥ · · · ≥ fm = f ∈ R+ : j=1 and the the estimation problem (6) becomes n′ ′ n′ n′ p̂nG = argmax f ′ 1 1 f ′ 2 2 · · · f ′ mm , (10) ′ f ′ ∈Fm,w Pn where n′j = l=1 1{Xl ∈ {qj , qj + wj − 1}} with qj an index of the first element in the j-th flat region of p. ′ Lemma 2 The solution p̂nG to the ML problem, defined in (10), is given by the weighted isotonic regression problem ′G p̂n = argmin ′ f ′ ∈Fm,w m X j=1 [p̂′n,j − fj′ ]2 wj , (11) where p̂′n,j is the unrestricted (without order restrictions) MLE n′ n′ n′ p̂′n = argmax g ′ 1 1 g ′ 2 2 · · · g ′mm , ′ g′ ∈Gm,w where ′ Gm,w m n o X ′ m = g ∈ R+ : wj gj′ = 1 . j=1 7 (12) Proof. The result is the consequence of the problem of maximising the product of several factors, given relations of order and linear side condition, cf. pages 45–46 in [3] and pages 38–39 [11]. In fact the results show, that for a product of several factors the MLE under the order restrictions coincides with the isotonic regression of the unrestricted ML estimates. ✷ Next, we analyse the asymptotic behaviour of the unrestricted MLE p̂′n in (12). Lemma 3 The unrestricted MLE p̂′n in (12) is given by p̂′n,j = n′j , wj n P n′j = nl=1 1{Xl ∈ {qj , qj + wj − 1}}, where qj is an index of the first element in the flat region of p. It is consistent p p̂′n → p′ and asymptotically normal √ d n(p̂′n − p′ ) → N (0, Σ ′ ), p′ where Σ ′ is an m × m matrix such that [Σ ′ ]ij = δij wii − p′i p′j , with δij the indicator function for i = j. Proof. The result of the Lemma for a case of a finite support of p (k < ∞ and consequently m < ∞) follows directly from the Theorem 2 in [1], also see pages 79–82 in [13]. Next, we consider a case of an infinite support of√p (k = ∞ and, obviously, m = ∞). Let us introduce the notations Zn = n(p̂′n − p′ ) and Z for a N (0, Σ ′ )-distributed r.v. and note that {Zn } is a sequence of processes in l2 , endowed with its Borel sigma algebra B. First, for any finite integer s the sequence of vectors (Zn,t)st=1 converges in distribution to the vector (Z)st=1 ∈ N (0, Σs′ ), where [Σs′ ]ij = δij wpii − pi pj with i = 1, . . . , s and j = 1, . . . , s. This fact follows again from [1, 13]. Second, we show that the sequence {Zn } is tight in the l2 -norm metric. This is shown similarly to as in [9]. In fact, from Lemma 6.2 in [9] it is enough to show that the two conditions sup E[||Zn ||22] < ∞, n X E[|Zn,t |2 ] = 0, lim sup r→∞ n t≥r 8 are satisfied. We note, that for any n √ ′ Zn,j = n(p̂n,j − p′j ) √ n′j − p′j ), = n( wj n p′ 2 where n′j is Bin(n, wj p′j )-distributed. Therefore, E[Zn,j ] = wjj − p′j p′j . Thus, both conditions of Lemma 6.2 are satisfied. Third, since the space l2 is separable and complete, from Prokhorov’s theorem [12] it follows that {Zn } is relatively compact, which means that every sequence from {Zn } contains a subsequence, which converges weakly to some process Z. In addition, if the limit processes have the same laws for every convergent subsequence, then {Zn } converges weakly to {Z}. Next, we show the equality of laws of the limit processes of the convergent subsequences. First, note that since l2 is a separable space, the Borel σalgebra equals the σ-algebra generated by open balls in l2 [4]. Then, it is enough to show that the limit laws agree on finite intersections of open balls in l2 , since these constitute a π-system. To show this, we note that the open balls in l2 can be written as B(z, ε) = ∩M ≥1 BM , where BM = ∪n≥1 AM n , M X 1 AM = {y ∈ l : |zj − yj |2 < ε − }. 2 n n j=1 (M ) By the finite support part of the Lemma, the vectors Zn = (Zn,t)M t=1 converge weakly to Z (M ) = (Zt )M for all finite M, which implies that any t=1 (M ) (M ) subsequence of Zn converges weakly to Z (M ) . That means that, with Pn the law of an arbitrary but fixed subsequence of Zn , and P (M ) the law of (M ) Z (M ) , Pn (A) → P (M ) (A) for any P (M ) -continuity set A. We note that the limit law P (M ) is the same for all subsequences. Therefore, since AM n is a continuity set for the Gaussian limit law P (M ) , and by the continuity properties of a probability measure, we obtain P (B(z, ε)) = = = lim P (BM ) M →∞ lim lim P (AM n ) M →∞ n→∞ lim lim P (M ) (AM n ), M →∞ n→∞ 9 where P is the law of Z. Thus, we have shown that the limit laws, P , of the convergent subsequences of {Zn } agree on the open balls B(z, ε), and, therefore, also on the finite intersections of these open balls. Since the laws agree on the π-system (they are all equal to P ), they agree on the Borel σ-algebra. ✷ Summarising the results from the previous Lemmas, we obtain the final ′ limit result for the estimator p̂nG . ′ Lemma 4 The estimator p̂nG is consistent p ′ p̂nG → p′ and asymptotically normal √ d ′G ! n(p̂n − p′ ) → N 0, Σ , where [Σ]ij = δij wpii − pi pj and δij is the indicator function for i = j. Proof. From Lemma 3 it follows that the basic estimator p̂′n is consistent p p̂′n → p′ . From Theorem 2.2 in [3], it follows that if the basic estimator is consistent, then its isotonic regression is also consistent p ′ p̂nG → p′ . ′ Since p̂′n and p̂nG both are consistent and since p′ is an interior point of ′ ′ ′ Fm,w ⊂ Gm,w , there is an open set ω ⊂ Fm,w such that p′ ∈ ω and P[p̂′n ∈ ω] → 1, ′ P[p̂nG ∈ ω] → 1, ′ ′ as n → ∞. Furthermore, since ω ⊂ Fm,w and as long as p̂′n ∈ Fm,w , the ′G ′ equality p̂n = p̂n holds, we have that ′ ′ ′ ′ P[p̂′n ∈ ω, p̂nG ∈ ω] = P[p̂′n ∈ ω, p̂nG ∈ ω, p̂′n = p̂nG ] ≤ P[p̂′n = p̂nG ] and, since the left hand side of this inequality goes to one as n → ∞, we ′ have shown that Pn→∞ [p̂nG = p̂′n ] = 1. 10 Now let Xn = √ n(p̂′n − p′ ) and Yn = √ ′ ′ n(p̂nG − p′ ). Then, clearly, P[Xn = Yn ] = P[p̂nG = p̂′n ] → 1, as n → ∞. Applying Lemma 1 shows the statement of the Lemma. ✷ ′ Theorem 1 The estimator p̂∗n = Ap̂nG is consistent p p̂∗n → p and asymptotically normal √ d n(p̂∗n − p) → N (0, Σ ∗ ), where Σ ∗ = AΣAT with [Σ]ij = δij wpii − pi pj and A is a k × m matrix whose non-zero elements are [A]qj :qj +wj −1,j = 1, j ∈ {1, . . . , m}, qj is the first index of the j-th flat region of the true mass function p and wj stands for the j-th regions length. Proof. From Lemma 4 it follows that p̂′n is consistent and asymptotically normal. The estimator p̂∗n is given by (7). The statements of the Theorem now follow from the Delta method (see, for example, Theorem 3.1 in [14]). ✷ 3 Comparison of the estimators To compare the estimators we consider the l2 metric l22 (p̂, p) = ||p̂ − p||22 = with k ≤ ∞, and the Hellinger distance k X i=1 (p̂i − pi )2 , k H 2 (p̂, p) = √ 1X p ( p̂i − pi )2 , 2 i=1 with k < ∞. In [9] it has been shown that the Grenander estimator pG n has smaller risk than the rearrangement estimator pR , for both l and H loss. 2 n The next lemma shows that the new estimator p̂∗n performs better than 2 the Grenander estimator pG n , asymptotically, in both the expected l and Hellinger distance sense, properly normalised. 11 Lemma 5 For the l2 metric we have that lim E[nl22 (p̂∗n , p)] ≤ lim E[nl22 (p̂G n , p)] n→∞ n→∞ and for the Hellinger distance with k < ∞, lim E[nH 2 (p̂∗n , p)] ≤ lim E[nH 2 (p̂G n , p)] n→∞ n→∞ Equalities hold if and only if the true probability mass function p is strictly monotone. Proof. First, from Theorem 1 and the continuous mapping theorem we have d nl22 (p̂∗n , p) → ||V ||22 , (13) where V ∈ N (0, Σ ∗ ). Second, using the reduction of error property of isotonic regression (Theorem 1.6.1 in [11]), for any n we have m X j=1 ′G [p̂n,j − p′j ]2 wj ≤ m X j=1 [p̂′n,j − p′j ]2 wj , which is the same as nl22 (p̂∗n , p) ≤ nl22 (p̄n , p), ′ where p̄n = Ap̂′n is constructed from p̂′n in the same way as p̂∗n from p̂nG . Since that for every M > 0 we have E[nl22 (p̂∗n , p)1{nl22 (p̂∗n , p) > M}] ≤ E[nl22 (p̄n , p)1{nl22 (p̂∗n , p) > M}] ≤ E[nl22 (p̄n , p)1{nl22 (p̄n , p) > M}] and lim sup E[nl22 (p̂∗n , p)1{nl22 (p̂∗n , p) > M}] ≤ n→∞ lim sup E[nl22 (p̄n , p)1{nl22 (p̄n , p) > M}]. n→∞ From Lemma 3 for any n we have that E[nl22 (p̄n , p)] = m X w j pj ( j=1 12 1 − pj ) < ∞, wj (14) and also E[||V ||22] = m X w j pj ( j=1 1 − pj ) wj and using the Delta method and the continuous mapping theorem [14] it can d be shown that nl22 (p̄n , p) → ||V ||22 which proves that the sequence {nl22 (p̄n , p)} is asymptotically uniformly integrable (see, for example, Theorem 2.20 in [14]) lim lim sup E[nl22 (p̄n , p)1{nl22 (p̄n , p) > M}] = 0, M →∞ n→∞ which together with (14) proves that lim lim sup E[nl22 (p̂∗n , p)1{nl22 (p̂∗n , p) > M}] = 0, M →∞ n→∞ which shows the asymptotic uniform integrability of the sequence nl22 (p̂∗n , p). Third, since the sequence nl22 (p̂∗n , p) is asymptotically uniformly integrable and converges in distribution to V , it also converges in expectation (Theorem 2.20 in [14]) lim n→∞ E[nl22 (p̂∗n , p)] = E[||V ||22 ] = m X wj p′j ( j=1 1 − p′j ) wj Furthermore, for p̂G n , proposed in [9], we have lim n→∞ E[nl22 (p̂G n , p)] = wj m X X j=1 1 p′j ( − p′j ). q q=1 Pm Pwj ′ 1 P ′ ′ ′ 1 It is obvious that m q=1 pj ( q − pj ). This finishes j=1 j=1 wj pj ( wj − pj ) ≤ the proof of statement for the l2 metric. To prove the statement for Hellinger distance, let us assume that k < ∞ is an arbitrary. It is sufficient to note that nH 2 (p̂∗n , p) √ k 1 X [ n(p∗n,i − pi )]2 p = , √ 2 i=1 ( p∗n,i + pi )2 since then, from the weak convergence and consistency of p̂∗n , Slutsky’s theorem and the continuous mapping theorem, it follows that k nH 2 d (p̂∗n , p) → 13 1 X Vi2 . 8 i=1 pi Furthermore, asymptotic uniform integrability of nH 2 (p̂∗n , p) can be shown using the inequality nH 2 (p̂∗n , p) ≤ nl12 (p̂∗n , p), and asymptotic integrability of nl12 (p̂∗n , p), see [9]. Therefore we also have convergence in expectation k m hX 1 Vi2 i 1 X 1 lim E[nH 2 (p̂∗n , p)] = E = wj ( − pj ). n→∞ 8 pi 8 j=1 wj i=1 (15) Finally, [9] shows that the Hellinger distance of the estimator p̂G n converges in expectation m lim E[nH n→∞ 2 (p̂G n , p)] wj 1 XX 1 ( − pj ) ≥ lim E[nH 2 (p̂∗n , p)] = n→∞ 8 j=1 q=1 q where we note the inequality from a comparison with (15). It is clear that equality holds if and only if p is strictly monotone. ✷ For a visualisation of the finite sample performance of the proposed estimator p̂∗n , we make a small simulation study. We choose the same probability mass functions as the ones chosen in [9]. In Figure 1 we present results of Monte Carlo simulations for 1000 samples, for sample sizes n = 20 and n = 100, for the probability mass functions 1. (top) p(x) = 0.2U(4) + 0.8U(8), 2. (center) p(x) = 0.15U(4) + 0.1U(8) + 0.75U(12), 3. (bottom) p(x) = 0.25U(2) + 0.2U(4) + 0.15U(6) + 0.4U(8), where U(k) stands for the uniform discrete distribution on {1, . . . , k}. The results shown are boxplots for the Hellinger distance and l2 metric, with sample sizes n = 20 on the left and n = 100 on the right in Fig. 1. The simulation study clearly illustrates that the newly proposed estimator p̂∗n has a better finite sample performance than both the Grenander and the monotone rearrangement estimators, in both l2 and H distance sense. Acknowledgements VP’s research is fully supported and DA’s research is partially supported by the Swedish Research Council, whose support is gratefully acknowledged. 14 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.0 l2 l2 l2 H H H H l2 l2 l2 l2 H H H H l2 l2 l2 l2 H H H H l2 l2 l2 l2 H H H H l2 l2 l2 l2 H H H H l2 l2 l2 l2 H H H H 0.0 0.0 0.1 0.1 0.2 0.2 0.3 0.3 0.4 0.4 0.5 0.5 0.6 0.6 0.0 0.0 0.1 0.1 0.2 0.2 0.3 0.3 0.4 0.4 0.5 0.5 0.6 0.6 l2 Figure 1: The boxplots for l2 norms and Hellinger distances for the estimators: the empirical estimator p̂′ (white), the rearrangement estimator p̂R n ∗ (grey), Grenander estimator p̂G (dark grey) and estimator p̂ (shaded). n n References [1] Aitchison, J. and Silvey, S. D. (1958). Maximum-likelihood estimation of parameters subject to restraints. The Annals of Mathematical Statistics, 29 813–828. [2] Balabdaoui, F., Durot, C., Koladjo, F. (2014). On asymptotics of the discrete convex LSE of a pmf. Tech. rep., arXiv.org. [3] Barlow, R. E., Bartholomew, D. J., Bremner, J. M. and Brunk, H. D. (1972). Statistical inference under order restrictions. John Wiley & Sons, London-New York-Sydney. [4] Bogachev V. I. (2007). Measure theory. Vol. I. Springer-Verlag, Berlin. 15 [5] Carolan, C. and Dykstra, R. (1999). Asymptotic behavior of the Grenander estimator at density flat regions. The Canadian Journal of Statistics, 27 557–566. [6] Durot, C., Huet, S., Koladjo, F., Robin, S. (2013). Least-squares estimation of a convex discrete distribution. Computational Statistics and Data Analysis, 67 282–298. [7] Giguelay, J. (2016). Estimation of a discrete probability under constraint of k-monotony. Tech. rep., arXiv.org. [8] Grenander, U. (1956). On the theory of mortality measurement. Skand. Aktuarietidskr., 3 1567–1605. [9] Jankowski, H. K. and Wellner, J. A. (2009). Estimation of a discrete monotone distribution. Electronic journal of statistics, 39 125–153. [10] Prakasa R., B. L. S. (1969). Estimation of a unimodal density. Sankhya Series A, 31 23–36. [11] Robertson, T., Wright, F. T. and Dykstra R. L. (1988). Order restricted statistical inference. John Wiley & Sons, Ltd., Chichester. [12] Shiryaev, A. (2007). Probability. Springer, New York. [13] Silvey S. D. (1975). Statistical inference Penguin Books, Baltimore, Md. [14] van der Vaart, A. W. (1998). Asymptotic statistics Cambridge University Press, Cambridge. 16
10math.ST
Sparse-to-Dense: Depth Prediction from Sparse Depth Samples and a Single Image arXiv:1709.07492v2 [cs.RO] 26 Feb 2018 Fangchang Ma1 and Sertac Karaman1 Abstract— We consider the problem of dense depth prediction from a sparse set of depth measurements and a single RGB image. Since depth estimation from monocular images alone is inherently ambiguous and unreliable, to attain a higher level of robustness and accuracy, we introduce additional sparse depth samples, which are either acquired with a low-resolution depth sensor or computed via visual Simultaneous Localization and Mapping (SLAM) algorithms. We propose the use of a single deep regression network to learn directly from the RGB-D raw data, and explore the impact of number of depth samples on prediction accuracy. Our experiments show that, compared to using only RGB images, the addition of 100 spatially random depth samples reduces the prediction root-mean-square error by 50% on the NYU-Depth-v2 indoor dataset. It also boosts the percentage of reliable prediction from 59% to 92% on the KITTI dataset. We demonstrate two applications of the proposed algorithm: a plug-in module in SLAM to convert sparse maps to dense maps, and super-resolution for LiDARs. Software2 and video demonstration3 are publicly available. I. I NTRODUCTION Depth sensing and estimation is of vital importance in a wide range of engineering applications, such as robotics, autonomous driving, augmented reality (AR) and 3D mapping. However, existing depth sensors, including LiDARs, structured-light-based depth sensors, and stereo cameras, all have their own limitations. For instance, the top-of-the-range 3D LiDARs are cost-prohibitive (with up to $75,000 cost per unit), and yet provide only sparse measurements for distant objects. Structured-light-based depth sensors (e.g. Kinect) are sunlight-sensitive and power-consuming, with a short ranging distance. Finally, stereo cameras require a large baseline and careful calibration for accurate triangulation, which demands large amount of computation and usually fails at featureless regions. Because of these limitations, there has always been a strong interest in depth estimation using a single camera, which is small, low-cost, energy-efficient, and ubiquitous in consumer electronic products. However, the accuracy and reliability of such methods is still far from being practical, despite over a decade of research effort devoted to RGB-based depth prediction including the recent improvements with deep learning approaches. For instance, the state-of-the-art RGB-based depth prediction methods [1–3] produce an average error (measured by the root mean squared error) of over 50cm in indoor scenarios (e.g., on the NYU-Depth-v2 dataset [4]). Such 1 F. Ma and S. Karaman are with the Laboratory for Information & Decision Systems, Massachusetts Institute of Technology, Cambridge, MA, USA. {fcma, sertac}@mit.edu 2 https://github.com/fangchangma/sparse-to-dense 3 https://www.youtube.com/watch?v=vNIIT_M7x7Y (a) RGB (b) sparse depth (c) ground truth (d) prediction Fig. 1: We develop a deep regression model to predict dense depth image from a single RGB image and a set of sparse depth samples. Our method significantly outperforms RGBbased and other fusion-based algorithms. methods perform even worse outdoors, with at least 4 meters of average error on Make3D and KITTI datasets [5, 6]. To address the potential fundamental limitations of RGBbased depth estimation, we consider the utilization of sparse depth measurements, along with RGB data, to reconstruct depth in full resolution. Sparse depth measurements are readily available in many applications. For instance, lowresolution depth sensors (e.g., a low-cost LiDARs) provide such measurements. Sparse depth measurements can also be computed from the output of SLAM4 and visual-inertial odometry algorithms. In this work, we demonstrate the effectiveness of using sparse depth measurements, in addition to the RGB images, as part of the input to the system. We use a single convolutional neural network to learn a deep regression model for depth image prediction. Our experimental results show that the addition of as few as 100 depth samples reduces the root mean squared error by over 50% on the NYU-Depth-v2 dataset, and boosts the percentage of reliable prediction from 59% to 92% on the more challenging KITTI outdoor dataset. In general, our results show that the addition of a few sparse depth samples drastically improves depth reconstruction performance. Our quantitative results may help inform the development of 4 A typical feature-based SLAM algorithm, such as ORB-SLAM [7], keeps track of hundreds of 3D landmarks in each frame. sensors for future robotic vehicles and consumer devices. The main contribution of this paper is a deep regression model that takes both a sparse set of depth samples and RGB images as input and predicts a full-resolution depth image. The prediction accuracy of our method significantly outperforms state-of-the-art methods, including both RGB-based and fusion-based techniques. Furthermore, we demonstrate in experiments that our method can be used as a plug-in module to sparse visual odometry / SLAM algorithms to create an accurate, dense point cloud. In addition, we show that our method can also be used in 3D LiDARs to create much denser measurements. II. R ELATED W ORK RGB-based depth prediction Early works on depth estimation using RGB images usually relied on hand-crafted features and probabilistic graphical models. For instance, Saxena et al. [8] estimated the absolute scales of different image patches and inferred the depth image using a Markov Random Field model. Non-parametric approaches [9–12] were also exploited to estimate the depth of a query image by combining the depths of images with similar photometric content retrieved from a database. Recently, deep learning has been successfully applied to the depth estimation problem. Eigen et al. [13] suggest a two-stack convolutional neural network (CNN), with one predicting the global coarse scale and the other refining local details. Eigen and Fergus [2] further incorporate other auxiliary prediction tasks into the same architecture. Liu et al. [1] combined a deep CNN and a continuous conditional random field, and attained visually sharper transitions and local details. Laina et al. [3] developed a deep residual network based on the ResNet [14] and achieved higher accuracy than [1, 2]. Semi-supervised [15] and unsupervised learning [16–18] setups have also been explored for disparity image prediction. For instance, Godard et al. [18] formulated disparity estimation as an image reconstruction problem, where neural networks were trained to warp left images to match the right. Depth reconstruction from sparse samples Another line of related work is depth reconstruction from sparse samples. A common ground of many approaches in this area is the use of sparse representations for depth signals. For instance, Hawe et al. [19] assumed that disparity maps were sparse on the Wavelet basis and reconstructed a dense disparity image with a conjugate sub-gradient method. Liu et al. [20] combined wavelet and contourlet dictionaries for more accurate reconstruction. Our previous work on sparse depth sensing [21, 22] exploited the sparsity underlying the secondorder derivatives of depth images, and outperformed both [1, 19] in reconstruction accuracy and speed. Sensor fusion A wide range of techniques attempted to improve depth prediction by fusing additional information from different sensor modalities. For instance, Mancini et al. [23] proposed a CNN that took both RGB images and optical flow images as input to predict distance. Liao et al. [24] studied the use of a 2D laser scanner mounted on a mobile ground robot to provide an additional reference depth signal as input and obtained higher accuracy than using RGB images alone. Compared to the approach by Liao et al. [24], this work makes no assumption regarding the orientation or position of sensors, nor the spatial distribution of input depth samples in the pixel space. Cadena et al. [25] developed a multi-modal auto-encoder to learn from three input modalities, including RGB, depth, and semantic labels. In their experiments, Cadena et al. [25] used sparse depth on extracted FAST corner features as part of the input to the system to produce a low-resolution depth prediction. The accuracy was comparable to using RGB alone. In comparison, our method predicts a full-resolution depth image, learns a better cross-modality representation for RGB and sparse depth, and attains a significantly higher accuracy. III. M ETHODOLOGY In this section, we describe the architecture of the convolutional neural network. We also discuss the depth sampling strategy, the data augmentation techniques, and the loss functions used for training. A. CNN Architecture We found in our experiments that many bottleneck architectures (with an encoder and a decoder) could result in good performance. We chose the final structure based on [3] for the sake of benchmarking, because it achieved state-of-theart accuracy in RGB-based depth prediction. The network is tailed to our problem with input data of different modalities, sizes and dimensions. We use two different networks for KITTI and NYU-Depth-v2. This is because the KITTI image is triple the size of NYU-Depth-v2 and consequently the same architecture would require 3 times of GPU memory, exceeding the current hardware capacity. The final structure is illustrated in Figure 2. The feature extraction (encoding) layers of the network, highlighted in blue, consist of a ResNet [14] followed by a convolution layer. More specifically, the ResNet-18 is used for KITTI, and ResNet-50 is used for NYU-Depth-v2. The last average pooling layer and linear transformation layer of the original ResNet have been removed. The second component of the encoding structure, the convolution layer, has a kernel size of 3-by-3. The decoding layers, highlighted in yellow, are composed of 4 upsampling layers followed by a bilinear upsampling layer. We use the UpProj module proposed by Laina et al. [3] as our upsampling layer, but a deconvolution with larger kernel size can also achieve the same level of accuracy. An empirical comparison of different upsampling layers is shown in Section V-A. B. Depth Sampling In this section, we introduce the sampling strategy for creating the input sparse depth image from the ground truth. During training, the input sparse depth D is sampled randomly from the ground truth depth image D∗ on the fly. In particular, for any targeted number of depth samples m Fig. 2: CNN architecture for NYU-Depth-v2 and KITTI datasets, respectively. Cubes are feature maps, with dimensions represented as #features@height×width. The encoding layers in blue consist of a ResNet [14] and a 3×3 convolution. The decoding layers in yellow are composed of 4 upsampling layers (UpProj) followed by a bilinear upsampling. (fixed during training), we compute a Bernoulli probability p= m n , where n is the total number of valid depth pixels in D∗ . Then, for any pixel (i, j), ( D∗ (i, j), with probability p D(i, j) = (1) 0, otherwise With this sampling strategy, the actual number of nonzero depth pixels varies for each training sample around the expectation m. Note that this sampling strategy is different from dropout [26], which scales up the output by 1/p during training to compensate for deactivated neurons. The purpose of our sampling strategy is to increase robustness of the network against different number of inputs and to create more training data (i.e., a data augmentation technique). It is worth exploring how injection of random noise and a different sampling strategy (e.g., feature points) would affect the performance of the network. C. Data Augmentation We augment the training data in an online manner with random transformations, including • Scale: color images are scaled by a random number s ∈ [1, 1.5], and depths are divided by s. • Rotation: color and depths are both rotated with a random degree r ∈ [−5, 5]. • Color Jitter: the brightness, contrast, and saturation of color images are each scaled by ki ∈ [0.6, 1.4]. • Color Normalization: RGB is normalized through mean subtraction and division by standard deviation. • Flips: color and depths are both horizontally flipped with a 50% chance. Nearest neighbor interpolation, rather than the more common bi-linear or bi-cubic interpolation, is used in both scaling and rotation to avoid creating spurious sparse depth points. We take the center crop from the augmented image so that the input size to the network is consistent. D. Loss Function One common and default choice of loss function for regression problems is the mean squared error (L2 ). L2 is sensitive to outliers in the training data since it penalizes more heavily on larger errors. During our experiments we found that the L2 loss function also yields visually undesirable, over-smooth boundaries instead of sharp transitions. Another common choice is the Reversed Huber (denoted as berHu) loss function [27], defined as ( |e|, if |e| ≤ c (2) B(e) = e2 +c2 2c , otherwise [3] uses a batch-dependent parameter c, computed as 20% of the maximum absolute error over all pixels in a batch. Intuitively, berHu acts as the mean absolute error (L1 ) when the element-wise error falls below c, and behaves approximately as L2 when the error exceeds c. In our experiments, besides the aforementioned two loss functions, we also tested L1 and found that it produced slightly better results on the RGB-based depth prediction problem. The empirical comparison is shown in Section VA. As a result, we use L1 as our default choice throughout the paper for its simplicity and performance. IV. E XPERIMENTS We implement the network using Torch [28]. Our models are trained on the NYU-Depth-v2 and KITTI odometry datasets using a NVIDIA Tesla P100 GPU with 16GB memory. The weights of the ResNet in the encoding layers (except for the first layer which has different number of input channels) are initialized with models pretrained on the ImageNet dataset [29]. We use a small batch size of 16 and train for 20 epochs. The learning rate starts at 0.01, and is reduced to 20% every 5 epochs. A small weight decay of 10−4 is applied for regularization. A. The NYU-Depth-v2 Dataset The NYU-Depth-v2 dataset [4] consists of RGB and depth images collected from 464 different indoor scenes with a Microsoft Kinect. We use the official split of data, where 249 scenes are used for training and the remaining 215 for testing. In particular, for the sake of benchmarking, the small labeled test dataset with 654 images is used for evaluating the final performance, as seen in previous work [3, 13]. For training, we sample spatially evenly from each raw video sequence from the training dataset, generating roughly 48k synchronized depth-RGB image pairs. The depth values are projected onto the RGB image and in-painted with a cross-bilateral filter using the official toolbox. Following [3, 13], the original frames of size 640×480 are first downsampled to half and then center-cropped, producing a final size of 304×228. B. The KITTI Odometry Dataset In this work we use the odometry dataset, which includes both camera and LiDAR measurements . The odometry dataset consists of 22 sequences. Among them, one half is used for training while the other half is for evaluation. We use all 46k images from the training sequences for training the neural network, and a random subset of 3200 images from the test sequences for the final evaluation. We use both left and right RGB cameras as unassociated shots. The Velodyne LiDAR measurements are projected onto the RGB images. Only the bottom crop (912×228) is used, since the LiDAR returns no measurement to the upper part of the images. Compared with NYU-Depth-v2, even the ground truth is sparse for KITTI, typically with only 18k projected measurements out of the 208k image pixels. C. Error Metrics We evaluate each method using the following metrics: • • • RMSE: root mean squared error REL: mean absolute relative error δi : percentage of predicted pixels where the relative error is within a threshold. Specifically, o o n n card ŷi : max ŷyii , yŷii < 1.25i , δi = card ({yi }) where yi and ŷi are respectively the ground truth and the prediction, and card is the cardinality of a set. A higher δi indicates better prediction. V. R ESULTS In this section we present all experimental results. First, we evaluate the performance of our proposed method with different loss functions and network components on the prediction accuracy in Section V-A. Second, we compare the proposed method with state-of-the-art methods on both the NYU-Depth-v2 and the KITTI datasets in Section V-B. Third, In Section V-C, we explore the impact of number of sparse depth samples on the performance. Finally, in Section V-D and Section V-E, we demonstrate two use cases of our proposed algorithm in creating dense maps and LiDAR super-resolution. A. Architecture Evaluation In this section we present an empirical study on the impact of different loss functions and network components on the depth prediction accuracy. The results are listed in Table I. Problem RGB Loss L2 berHu L1 RGBd L1 Encoder Conv Conv Conv Conv Conv Conv ChanDrop DepthWise Conv Decoder RMSE REL δ1 δ2 δ3 DeConv2 0.610 0.185 71.8 93.4 98.3 DeConv2 0.554 0.163 77.5 94.8 98.7 DeConv2 0.552 0.159 77.5 95.0 98.7 DeConv3 0.533 0.151 79.0 95.4 98.8 UpConv 0.529 0.149 79.4 95.5 98.9 UpProj 0.528 0.144 80.3 95.2 98.7 UpProj 0.361 0.105 90.8 98.4 99.6 UpProj 0.261 0.054 96.2 99.2 99.7 UpProj 0.264 0.053 96.1 99.2 99.8 TABLE I: Evaluation of loss functions, upsampling layers and the first convolution layer. RGBd has an average sparse depth input of 100 samples. (a) comparison of loss functions is listed in Row 1 - 3; (b) comparison of upsampling layers is in Row 2 - 4; (c) comparison of the first convolution layers is in the 3 bottom rows. 1) Loss Functions: To compare the loss functions we use the same network architecture, where the upsampling layers are simple deconvolution with a 2×2 kernel (denoted as DeConv2 ). L2 , berHu and L1 loss functions are listed in the first three rows in Table I for comparison. As shown in the table, both berHu and L1 significantly outperform L2 . In addition, L1 produces slightly better results than berHu. Therefore, we use L1 as our default choice of loss function. 2) Upsampling Layers: We perform an empirical evaluation of different upsampling layers, including deconvolution with kernels of different sizes (DeConv2 and DeConv3 ), as well as the UpConv and UpProj modules proposed by Laina et al. [3]. The results are listed from row 3 to 6 in Table I. We make several observations. Firstly, deconvolution with a 3×3 kernel (i.e., DeConv3 ) outperforms the same component with only a 2×2 kernel (i.e., DeConv2 ) in every single metric. Secondly, since both DeConv3 and UpConv have a receptive field of 3×3 (meaning each output neuron is computed from a neighborhood of 9 input neurons), they have comparable performance. Thirdly, with an even larger receptive field of 4×4, the UpProj module outperforms the others. We choose to use UpProj as a default choice. 3) First Convolution Layer: Since our RGBd input data comes from different sensing modalities, its 4 input channels (R, G, B, and depth) have vastly different distributions and support. We perform a simple analysis on the first convolution layer and explore three different options. The first option is the regular spatial convolution (Conv). The second option is depthwise separable convolution (denoted as DepthWise), which consists of a spatial convolution performed independently on each input channel, followed by a pointwise convolution across different channels with a window size of 1. The third choice is channel dropout (denoted as ChanDrop), through which each input channel is preserved as is with some probability p, and zeroed out with probability 1 − p. The bottom 3 rows compare the results from the 3 options. The networks are trained using RGBd input with an average of 100 sparse input samples. DepthWise and Conv yield very similar results, and both significantly outperform the ChanDrop layer. Since the difference is small, for the sake of comparison consistency, we will use the convolution layer for all experiments. (a) B. Comparison with the State-of-the-Art In this section, we compare with existing methods. 1) NYU-Depth-v2 Dataset: We compare with RGB-based approaches [3, 13, 30], as well as the fusion approach [24] that utilizes an additional 2D laser scanner mounted on a ground robot. The quantitative results are listed in Table II. Problem #Samples RGB 0 0 0 0 sd 20 50 200 RGBd 225 20 50 200 Method RMSE REL δ1 δ2 δ3 Roy et al. [30] 0.744 0.187 Eigen et al. [2] 0.641 0.158 76.9 95.0 98.8 Laina et al. [3] 0.573 0.127 81.1 95.3 98.8 Ours-RGB 0.514 0.143 81.0 95.9 98.9 Ours-sd 0.461 0.110 87.2 96.1 98.8 Ours-sd 0.347 0.076 92.8 98.2 99.5 Ours-sd 0.259 0.054 96.3 99.2 99.8 Liao et al. [24] 0.442 0.104 87.8 96.4 98.9 Ours-RGBd 0.351 0.078 92.8 98.4 99.6 Ours-RGBd 0.281 0.059 95.5 99.0 99.7 Ours-RGBd 0.230 0.044 97.1 99.4 99.8 TABLE II: Comparison with state-of-the-art on the NYUDepth-v2 dataset. The values are those originally reported by the authors in their respective paper Our first observation from Row 2 and Row 3 is that, with the same network architecture, we can achieve a slightly better result (albeit higher REL) by replacing the berHu loss function proposed in [3] with a simple L1 . Secondly, by comparing problem group RGB (Row 3) and problem group sd (e.g., Row 4), we draw the conclusion that an extremely small set of 20 sparse depth samples (without color information) already produces significantly better predictions than using RGB. Thirdly, by comparing problem group sd and proble group RGBd row by row with the same number of samples, it is clear that the color information does help improve the prediction accuracy. In other words, our proposed method is able to learn a suitable representation from both the RGB images and the sparse depth images. Finally, we compare against [24] (bottom row). Our proposed method, even using only 100 samples, outperforms [24] with 225 laser measurements. This is because our samples are spatially uniform, and thus provides more information than a line measurement. A few examples of our predictions with different inputs are displayed in Figure 3. 2) KITTI Dataset: The KITTI dataset is more challenging for depth prediction, since the maximum distance is 100 meters as opposed to only 10 meters in the NYU-Depth-v2 dataset. A greater performance boost can be obtained from using our approach. Although the training and test data are not the same across different methods, the scenes are similar in the sense that they all come from the same sensor setup on a car and the data were collected during driving. We report the values from each work in Table III. The results in the first RGB group demonstrate that RGBbased depth prediction methods fail in outdoor scenarios, with a pixel-wise RMSE of close to 7 meters. Note that we (b) (c) (d) (e) Fig. 3: Predictions on NYU-Depth-v2. From top to bottom: (a) rgb images; (b) RGB-based prediction; (c) sd prediction with 200 and no rgb; (d) RGBd prediction with 200 sparse depth and rgb; (e) ground truth depth. Problem #Samples Method RGB 0 Make3D [3] 0 Mancini [23] 0 Eigen et al. [13] 0 Ours-RGB RGBd ∼650 full-MAE [25] 50 Ours-RGBd 225 Liao et al. [24] 100 Ours-RGBd 200 Ours-RGBd 500 Ours-RGBd RMSE 8.734 7.508 7.156 6.266 7.14 4.884 4.50 4.303 3.851 3.378 REL 0.280 0.190 0.208 0.179 0.109 0.113 0.095 0.083 0.073 δ1 60.1 31.8 69.2 59.1 70.9 87.1 87.4 90.0 91.9 93.5 δ2 82.0 61.7 89.9 90.0 88.8 95.2 96.0 96.3 97.0 97.6 δ3 92.6 81.3 96.7 96.2 95.6 97.9 98.4 98.3 98.6 98.9 TABLE III: Comparison with state-of-the-art on the KITTI dataset. The Make3D values are those reported in [13] use sparsely labeled depth image projected from LiDAR, instead of dense disparity maps computed from stereo cameras as in [13]. In other words, we have a much smaller training dataset compared with [13, 23]. An additional 500 depth samples bring the RMSE to 3.3 meters, a half of the RGB approach, and boosts δ1 from only 59.1% to 93.5%. Our performance also compares favorably to other fusion techniques including [24, 25], and at the same time demands fewer samples. C. On Number of Depth Samples In this section, we explore the relation between the prediction accuracy and the number of available depth samples. We train a network for each different input size for optimal RMSE [m] 9 (a) color 95 8 90 7 (b) sparse input depth 80 5 75 70 4 (c) RGBd500 2 0 10 RGBd sparse depth RGB 85 6 3 δ1 [%] 100 65 RGBd sparse depth RGB 60 101 102 103 number of depth samples REL 0.25 55 104 100 100 101 102 103 number of depth samples 104 δ2 [%] 98 0.20 (d) ground truth 96 94 0.15 92 90 0.10 Fig. 4: Example of prediction on KITTI. From top to bottom: (a) RGB; (b) sparse depth; (c) RGBd dense prediction; (d) ground truth depth projected from LiDAR. performance. We compare the performance for all three kinds of input data, including RGB, sd, and RGBd. The performance of RGB-based depth prediction is independent of input sample size and is thus plotted as a horizontal line for benchmarking. 0.8 RMSE [m] 100 0.7 95 0.6 90 0.5 85 0.4 80 75 0.3 0.2 0.1 0 10 RGBd sparse depth RGB REL 0.18 100 101 102 number of depth samples 103 δ2 [%] 96 0.14 0.12 94 0.10 92 0.08 0.02 0 10 65 103 100 98 0.16 0.04 RGBd sparse depth RGB 70 101 102 number of depth samples 0.20 0.06 δ1 [%] RGBd sparse depth RGB 101 102 number of depth samples 90 88 103 100 RGBd sparse depth RGB 101 102 number of depth samples 103 Fig. 5: Impact of number of depth sample on the prediction accuracy on the NYU-Depth-v2 dataset. Left column: lower is better; right column: higher is better. On the NYU-Depth-v2 dataset in Figure 5, the RGBd outperforms RGB with over 10 depth samples and the performance gap quickly increases with the number of samples. With a set of 100 samples, the RMSE of RGBd decreases to around 25cm, half of RGB (51cm). The REL sees a larger 88 0.05 0.00 0 10 RGBd sparse depth RGB 101 102 103 number of depth samples 86 84 82 104 100 RGBd sparse depth RGB 101 102 103 number of depth samples 104 Fig. 6: Impact of number of depth sample on the prediction accuracy on the KITTI dataset. Left column: lower is better; right column: higher is better. improvement (from 0.15 to 0.05, reduced by two thirds). On one hand, the RGBd approach consistently outperforms sd, which indicates that the learned model is indeed able to extract information not only from the sparse samples alone, but also from the colors. On the other hand, the performance gap between RGBd and sd shrinks as the sample size increases. Both approaches perform equally well when sample size goes up to 1000, which accounts for less than 1.5% of the image pixels and is still a small number compared with the image size. This observation indicates that the information extracted from the sparse sample set dominates the prediction when the sample size is sufficiently large, and in this case the color cue becomes almost irrelevant. The performance gain on the KITTI dataset is almost identical to NYU-Depth-v2, as shown in Figure 6. With 100 samples the RMSE of RGBd decreases from 7 meters to a half, 3.5 meters. This is the same percentage of improvement as on the NYU-Depth-v2 dataset. Similarly, the REL is reduced from 0.21 to 0.07, again the same percentage of improvement as the NYU-Depth-v2. On both datasets, the accuracy saturates as the number of depth samples increases. Additionally, the prediction has blurry boundaries even with many depth samples (see Figure 8). We believe both phenomena can be attributed to the fact that fine details are lost in bottleneck network architectures. It remains further study if additional skip connections from encoders to decoders help improve performance. D. Application: Dense Map from Visual Odometry Features In this section, we demonstrate a use case of our proposed method in sparse visual SLAM and visual inertial odometry (VIO). The best-performing algorithms for SLAM and VIO are usually sparse methods, which represent the environment with sparse 3D landmarks. Although sparse SLAM/VIO algorithms are robust and efficient, the output map is in the form of sparse point clouds and is not useful for other applications (e.g. motion planning). (a) RGB (b) sparse landmarks Fig. 8: Application to LiDAR super-resolution, creating denser point cloud than the raw measurements. From top to bottom: RGB, raw depth, and predicted depth. Distant cars are almost invisible in the raw depth, but are easily recognizable in the predicted depth. E. Application: LiDAR Super-Resolution (c) ground truth map (d) prediction Fig. 7: Application in sparse SLAM and visual inertial odometry (VIO) to create dense point clouds from sparse landmarks. (a) RGB (b) sparse landmarks (c) ground truth point cloud (d) prediction point cloud, created by stitching RGBd predictions from each frame. We present another demonstration of our method in superresolution of LiDAR measurements. 3D LiDARs have a low vertical angular resolution and thus generate a vertically sparse point cloud. We use all measurements in the sparse depth image and RGB images as input to our network. The average REL is 4.9%, as compared to 20.8% when using only RGB. An example is shown in Figure 8. Cars are much more recognizable in the prediction than in the raw scans. VI. CONCLUSION To demonstrate the effectiveness of our proposed methods, we implement a simple visual odometry (VO) algorithm with data from one of the test scenes in the NYU-Depthv2 dataset. For simplicity, the absolute scale is derived from ground truth depth image of the first frame. The 3D landmarks produced by VO are back-projected onto the RGB image space to create a sparse depth image. We use both RGB and sparse depth images as input for prediction. Only pixels within a trusted region, which we define as the convex hull on the pixel space formed by the input sparse depth samples, are preserved since they are well constrained and thus more reliable. Dense point clouds are then reconstructed from these reliable predictions, and are stitched together using the trajectory estimation from VIO. We introduced a new depth prediction method for predicting dense depth images from both RGB images and sparse depth images, which is well suited for sensor fusion and sparse SLAM. We demonstrated that this method significantly outperforms depth prediction using only RGB images, and other existing RGB-D fusion techniques. This method can be used as a plug-in module in sparse SLAM and visual inertial odometry algorithms, as well as in superresolution of LiDAR measurements. We believe that this new method opens up an important avenue for research into RGBD learning and the more general 3D perception problems, which might benefit substantially from sparse depth samples. The results are displayed in Figure 7. The prediction map resembles closely to the ground truth map, and is much denser than the sparse point cloud from VO. The major difference between our prediction and the ground truth is that the prediction map has few points on the white wall, where no feature is extracted or tracked by the VO. As a result, pixels corresponding to the white walls fall outside the trusted region and are thus removed. This work was supported in part by the Office of Naval Research (ONR) through the ONR YIP program. We also gratefully acknowledge the support of NVIDIA Corporation with the donation of the DGX-1 used for this research. ACKNOWLEDGMENT R EFERENCES [1] F. Liu, C. Shen, and G. Lin, “Deep convolutional neural fields for depth estimation from a single image,” [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015, pp. 5162–5170. D. Eigen and R. Fergus, “Predicting depth, surface normals and semantic labels with a common multi-scale convolutional architecture,” in Proceedings of the IEEE International Conference on Computer Vision, 2015, pp. 2650–2658. I. Laina, C. Rupprecht et al., “Deeper depth prediction with fully convolutional residual networks,” in 3D Vision (3DV), 2016 Fourth International Conference on. IEEE, 2016, pp. 239–248. N. Silberman, D. Hoiem et al., “Indoor segmentation and support inference from rgbd images,” Computer Vision–ECCV 2012, pp. 746–760, 2012. A. Saxena, M. Sun, and A. Y. Ng, “Make3d: Learning 3d scene structure from a single still image,” IEEE transactions on pattern analysis and machine intelligence, vol. 31, no. 5, pp. 824–840, 2009. A. Geiger, P. Lenz, and R. Urtasun, “Are we ready for autonomous driving? the kitti vision benchmark suite,” in Conference on Computer Vision and Pattern Recognition (CVPR), 2012. R. Mur-Artal, J. M. M. Montiel, and J. D. Tardos, “Orbslam: a versatile and accurate monocular slam system,” IEEE Transactions on Robotics, vol. 31, no. 5, pp. 1147–1163, 2015. A. Saxena, S. H. Chung, and A. Y. Ng, “Learning depth from single monocular images,” in Advances in neural information processing systems, 2006, pp. 1161–1168. K. Karsch, C. Liu, and S. B. Kang, “Depth extraction from video using non-parametric sampling,” in European Conference on Computer Vision. Springer, 2012, pp. 775–788. J. Konrad, M. Wang, and P. Ishwar, “2d-to-3d image conversion by learning depth from examples,” in Computer Vision and Pattern Recognition Workshops (CVPRW), 2012 IEEE Computer Society Conference on. IEEE, 2012, pp. 16–22. K. Karsch, C. Liu, and S. Kang, “Depthtransfer: Depth extraction from video using non-parametric sampling,” Pattern Analysis and Machine Intelligence, IEEE Transactions on, no. 99, pp. 1–1, 2014. M. Liu, M. Salzmann, and X. He, “Discrete-continuous depth estimation from a single image,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2014, pp. 716–723. D. Eigen, C. Puhrsch, and R. Fergus, “Depth map prediction from a single image using a multi-scale deep network,” in Advances in neural information processing systems, 2014, pp. 2366–2374. K. He, X. Zhang et al., “Deep residual learning for image recognition,” in Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp. 770–778. Y. Kuznietsov, J. Stückler, and B. Leibe, “Semisupervised deep learning for monocular depth map prediction,” arXiv preprint arXiv:1702.02706, 2017. [16] T. Zhou, M. Brown et al., “Unsupervised learning of depth and ego-motion from video,” arXiv preprint arXiv:1704.07813, 2017. [17] R. Garg, G. Carneiro, and I. Reid, “Unsupervised cnn for single view depth estimation: Geometry to the rescue,” in European Conference on Computer Vision. Springer, 2016, pp. 740–756. [18] C. Godard, O. Mac Aodha, and G. J. Brostow, “Unsupervised monocular depth estimation with left-right consistency,” arXiv preprint arXiv:1609.03677, 2016. [19] S. Hawe, M. Kleinsteuber, and K. Diepold, “Dense disparity maps from sparse disparity measurements,” in Computer Vision (ICCV), 2011 IEEE International Conference on. IEEE, 2011, pp. 2126–2133. [20] L.-K. Liu, S. H. Chan, and T. Q. Nguyen, “Depth reconstruction from sparse samples: Representation, algorithm, and sampling,” IEEE Transactions on Image Processing, vol. 24, no. 6, pp. 1983–1996, 2015. [21] F. Ma, L. Carlone et al., “Sparse sensing for resourceconstrained depth reconstruction,” in Intelligent Robots and Systems (IROS), 2016 IEEE/RSJ International Conference on. IEEE, 2016, pp. 96–103. [22] ——, “Sparse depth sensing for resource-constrained robots,” arXiv preprint arXiv:1703.01398, 2017. [23] M. Mancini, G. Costante et al., “Fast robust monocular depth estimation for obstacle detection with fully convolutional networks,” in Intelligent Robots and Systems (IROS), 2016 IEEE/RSJ International Conference on. IEEE, 2016, pp. 4296–4303. [24] Y. Liao, L. Huang et al., “Parse geometry from a line: Monocular depth estimation with partial laser observation,” in Robotics and Automation (ICRA), 2017 IEEE International Conference on. IEEE, 2017, pp. 5059–5066. [25] C. Cadena, A. R. Dick, and I. D. Reid, “Multi-modal auto-encoders as joint estimators for robotics scene understanding.” in Robotics: Science and Systems, 2016. [26] N. Srivastava, G. E. Hinton et al., “Dropout: a simple way to prevent neural networks from overfitting.” Journal of machine learning research, vol. 15, no. 1, pp. 1929–1958, 2014. [27] A. B. Owen, “A robust hybrid of lasso and ridge regression,” Contemporary Mathematics, vol. 443, pp. 59–72, 2007. [28] R. Collobert, K. Kavukcuoglu, and C. Farabet, “Torch7: A matlab-like environment for machine learning,” in BigLearn, NIPS Workshop, 2011. [29] O. Russakovsky, J. Deng et al., “Imagenet large scale visual recognition challenge,” International Journal of Computer Vision, vol. 115, no. 3, pp. 211–252, 2015. [30] A. Roy and S. Todorovic, “Monocular depth estimation using neural regression forest,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016, pp. 5506–5514.
2cs.AI
Entropy Rate Estimation for Markov Chains with Large State Space arXiv:1802.07889v1 [cs.LG] 22 Feb 2018 Yanjun Han∗, Jiantao Jiao∗ , Chuan-Zheng Lee∗ , Tsachy Weissman∗ , Yihong Wu†, Tiancheng Yu‡ February 23, 2018 Abstract Estimating the entropy based on data is one of the prototypical problems in distribution property testing and estimation. For estimating the Shannon entropy of a distribution on S elements with independent samples, [Pan04] showed that the sample complexity is sublinear in S, and [VV11a] showed that consistent estimation of Shannon entropy is possible if and only if the sample size n far exceeds logS S . In this paper we consider the problem of estimating the entropy rate of a stationary reversible Markov chain with S states from a sample path of n observations. We show that (a) As long as the Markov chain mixes not too slowly, i.e., the relaxation time is S2 at most O( lnS3 S ), consistent estimation is achievable when n ≫ log S. (b) As long as the Markov chain has some slight dependency, i.e., the relaxation 2 S2 time is at least 1 + Ω( ln√SS ), consistent estimation is impossible when n . log S. 2 S Under both assumptions, the optimal estimation accuracy is shown to be Θ( n log S ). In com2 parison, the empirical entropy rate requires at least Ω(S ) samples to be consistent, even when the Markov chain is memoryless. In addition to synthetic experiments, we also apply the estimators that achieve the optimal sample complexity to estimate the entropy rate of the English language in the Penn Treebank and the Google One Billion Words corpora, which provides a natural benchmark for language modeling and relates it directly to the widely used perplexity measure. 1 Introduction Consider a stationary stochastic process {Xt }∞ t=1 , where each Xt takes values in a finite alphabet X of size S. The Shannon entropy rate (or simply entropy rate) of this process is defined as [CT06] H̄ = lim n→∞ where H(X n ) = X 1 H(X n ), n PX n (xn ) ln xn ∈X n ∗ (1) 1 PX n (xn ) Yanjun Han, Jiantao Jiao, Chuan-Zheng Lee, Tsachy Weissman are with the Department of Electrical Engineering, Stanford University, email: {jiantao,yjhan,czlee,tsachy}@stanford.edu † Yihong Wu is with the Department of Statistics and Data Science, Yale University, email: yihong.wu@yale.edu ‡ Tiancheng Yu is with the Department of Electronic Engineering, Tsinghua University, email: thueeyutc14@foxmail.com 1 is the Shannon entropy (or entropy) of the random vector X n = (X1 , X2 , . . . , Xn ) and PX n (xn ) = P (X1 = x1 , . . . , Xn = xn ) is the joint probability mass function. Since the entropy of a random variable depends only on its distribution, we also refer to the entropy H(P ) of a discrete distribution P = (p1 , p2 , . . . , pS ), defined as S X 1 (2) H(P ) = pi ln . pi i=1 The Shannon entropy rate is the fundamental limit of the expected logarithmic loss when predicting the next symbol, given the all past symbols. It is also the fundamental limit of data compressing for stationary stochastic processes in terms of the average number of bits required to represent each symbol [CT06, CBL06]. Estimating the entropy rate of a stochastic process is a fundamental problem in information theory, statistics, and machine learning; and it has diverse applications—see, for example, [Sha51, LLY00, SQBB10, TNS+ 11, WH12, KLMCP13]. There exists extensive literature on entropy rate estimation. It is known from data compression theory that the normalized codelength of any universal code is a consistent estimator for the entropy rate as the number of samples approaches infinity. This observation has inspired a large variety of entropy rate estimators; see e.g. [WZ89, KASW98, EVKV02, CKV04, JPZ+ 13]. However, most of this work has been in the asymptotic regime [Shi96, CG05]. Attention to non-asymptotic analysis has only been more recent, and to date, almost only for i.i.d. data. There has been little work on the non-asymptotic performance of an entropy rate estimator for dependent data—that is, where the alphabet size is large (making asymptotically large datasets infeasible) and the stochastic process has memory. An understanding of this large-alphabet regime is increasingly important in modern machine learning applications. For example, there have been substantial recent advances in probabilistic language models, which are used in applications such as machine translation and search query completion. The entropy rate of (say) the English language represents a fundamental limit on the efficacy of a language model (measured by its perplexity), so it is of interest to language model researchers to obtain an accurate estimate of the entropy rate, which sheds light on how much room there is left for improvement. However, since the alphabet size here is the size of the entire English lexicon, and Google’s One Billion Words corpus includes about two million unique words,1 it is unrealistic to assume the large-sample asymptotics especially when dealing with combinations of words (bigrams, trigrams, etc). It is therefore of significant practical importance to investigate the optimal entropy rate estimator with limited sample size. In the context of non-asymptotic analysis for i.i.d. samples, Paninski [Pan04] first showed that the Shannon entropy can be consistently estimated with o(S) samples when the alphabet size S approaches infinity. The seminal work of [VV11a] showed that when estimating the entropy rate of an i.i.d. source, n ≫ logS S samples are necessary and sufficient for consistency. The entropy estimators proposed in [VV11a] and refined in [VV13], based on linear programming, have not been shown to achieve the minimax estimation rate. Another estimator proposed by the same authors [VV11b] has been shown to achieve the minimax rate in the restrictive regime of lnSS . 1.03 n . Sln S . Using the idea of best polynomial approximation, the independent work of [WY16] 2 S 2 log S and [JVHW15] obtained estimators that achieve the minimax mean-square error Θ(( n log S) + n ) for entropy estimation. The intuition for the Θ( logS S ) sample complexity in the independent case can be interpreted as follows: as opposed to estimating the entire distribution which has S − 1 1 This exceeds the estimated vocabulary of the English language partly because different forms of a word count as different words in language models, and partly because of edge cases in tokenization, the automatic splitting of text into “words”. 2 parameters and requires Θ(S) samples, estimating the scalar functional (entropy) can be done with a logarithmic factor reduction of samples. For Markov chains which are characterized by the S2 transition matrix consisting of S(S − 1) free parameters, it is reasonable to expect an Θ( log S) sample complexity. Indeed, we will show that this is correct provided the mixing time is not too slow. Estimating the entropy rate of a Markov chain falls in the general area of property testing and estimation with dependent data. The prior work [KV16] provided a non-asymptotic analysis of maximum-likelihood estimation of entropy rate in Markov chains and showed that it is necessary to assume certain assumptions on the mixing time for otherwise the entropy rate is impossible to estimate. There has been some progress in related questions of estimating the mixing time from sample path [HKS15, LP16] and estimating the transition matrix [FOPS16]. The current paper makes contribution to this growing field. In particular, the main results of this paper are highlighted as follows: • We provide a tight analysis of the sample complexity of the empirical entropy rate for Markov chains when the mixing time is not too large. This refines results in [KV16] and shows that when mixing is not too slow, the sample complexity of the empirical entropy does not depend on the mixing time. • We obtain a characterization of the optimal sample complexity for estimating the entropy rate of a stationary reversible Markov chain in terms of the sample size, state space size, and mixing time, and partially resolve one of the open questions raised in [KV16]. In particular, we show that when the mixing is neither too fast nor too slow, the sample complexity does not depend on mixing time. In this regime, the performance of the optimal estimator with n samples is essentially that of the empirical entropy rate with n log n samples. As opposed to the lower bound for estimating the mixing time in [HKS15] obtained by applying Le Cam’s method to two Markov chains which produce are statistically indistinguishable, the minimax lower bound in the current paper is much more involved, which, in addition to a series of reductions by means of simulation, relies on constructing two stationary reversible Markov chains with random transition matrices [BCC10], so that the marginal distributions of the sample paths are statistically indistinguishable. • We construct estimators that are efficiently computable and achieve the minimax sample complexity. The key step is to connect the entropy rate estimation problem to Shannon entropy estimation on large alphabets with i.i.d. samples. The analysis uses an alternative probabilistic descriptions of Markov chains by Billingsley [Bil61] and concentration inequalities for Markov chains. • We compare the empirical performance of various estimators for entropy rate on a variety of synthetic data sets, and demonstrate the superior performances of the informationtheoretically optimal estimators compared to the empirical entropy rate. • We apply the information-theoretically optimal estimators to estimate the entropy rate of the Penn Treebank (PTB) and the Google One Billion Words (1BW) datasets. We show that even only with estimates using up to 4-grams, there may exist language models that achieve better perplexity than the current state-of-the-art. The rest of the paper is organized as follows. After setting up preliminary definitions in Section 2, we present a summary of our main results in Section 3. We analyze the empirical entropy rate and prove the achievability theorems for both the empirical entropy rate and our entropy rate 3 estimator in Section 4. The lower bound on the sample complexity for the empirical entropy rate is proven in Section 5.1, and the minimax lower bound is proven in Section 5.2. Section 6 provides empirical results on the performance of various entropy rate estimators on synthetic data, and Section 7 applies the estimators to estimate the entropy rate of the Penn Treebank (PTB) and the Google One Billion Words (1BW) datasets. The auxiliary lemmas used throughout the paper are collected in Section 8, and the proofs of the lemmas are presented in Section 9. 2 Preliminaries We denote by multi (n, P ) the multinomial distribution with n number of trials and event probability vector P . Consider a first-order Markov chain X0 , X1 , X2 , . . . on a finite state space X = {1, 2, . . . , S} with transition kernel T . We denote the entries of T as Tij , that is, Tij = PX2 |X1 (j|i) for i, j ∈ X . Let Ti denote the ith row of T , which is the conditional law of X2 given X1 = i. Throughout the paper, we focus on first-order Markov chains, since any finite-order Markov chain can be converted to a first-order one by extending the state space [Bil61]. We say that a Markov chain is stationary if the distribution of X1 , denoted by π , PX1 , satisfies S X πi Tij = πj for all j ∈ X . i=1 (3) We say that a Markov chain is reversible if it satisfies the detailed balance equations, πi Tij = πj Tji for all i, j ∈ X . (4) If a Markov chain is reversible, the (left) spectrum of its transition matrix T contains S real eigenvalues, which we denote as 1 = λ1 ≥ λ2 ≥ · · · ≥ λS ≥ −1. We define the spectral gap of a reversible Markov chain as γ(T ) = 1 − λ2 . (5) The absolute spectral gap of T is defined as γ ∗ (T ) = 1 − max |λi |, i≥2 (6) and it clearly follows that, for any reversible Markov chain, γ(T ) ≥ γ ∗ (T ). (7) The relaxation time of a reversible Markov chain is defined as τrel (T ) = 1 γ ∗ (T ) . (8) The relaxation time of a reversible Markov chain (approximately) captures its mixing time, which roughly speaking is the smallest n for which the marginal distribution of Xn is close to the Markov chain’s stationary distribution. We refer to [MT06] for a survey. In fact, τrel ≥ 1 always, and τrel = 1 when the Markov chain has no memory. Intuitively speaking, the shorter the relaxation time τrel , the faster the Markov chain “mixes”: that is, the shorter its “memory”, or the sooner evolutions of the Markov chain from different initial states begin to look similar. We consider the following observation model. We observe a sample path of a stationary finitestate Markov chain X0 , X1 , . . . , Xn .2 Since the limit in (1) exists for any stationary process [CT06], 2 We assume that the Markov chain starts at X0 rather than X1 in order to simplify some formulae. 4 the entropy rate of any stationary Markov chain is always well-defined without any additional assumptions on mixing time, irreducibility, or aperiodicity. Furthermore, for Markov chains the Shannon entropy rate H̄ in (1) reduces to H̄ = S X πi i=1 S X Tij ln j=1 1 Tij (9) = H(X1 , X2 ) − H(X1 ) (10) where π is the stationary distribution of this Markov chain. We denote by M1 (S) the set of all discrete distributions with alphabet size S (i.e., the (S − 1)probability simplex), and by M2 (S) the set of all Markov chain transition matrices on a state space of size S. Let M2,rev (S) ⊂ M2 (S) be the set of transition matrices of all stationary reversible Markov chains on a state space of size S. We define the following class of stationary Markov reversible chains whose relaxation time is at most γ1∗ : M2,rev (S, γ ∗ ) = {T ∈ M2,rev (S), γ ∗ (T ) ≥ γ ∗ }. (11) X(i) = {Xj : Xj ∈ X, Xj−1 = i, 1 ≤ j ≤ n}. (13) The goal is to characterize the sample complexity of entropy rate estimation as a function of S, γ ∗ , and the estimation accuracy. Throughout this paper, sometimes we slightly abuse the notation by using M1 (S), M2 (S), M2,rev (S), M2,rev (S, γ ∗ ) to also denote the spaces of probability measures of the corresponding stochastic processes generated according to those parameter sets. Given a sample path X = (X0 , X1 , . . . , Xn ), let π̂ denote the empirical distribution of states, with Pn−1 j=0 1(Xj = i) , (12) π̂i = n and the subsequence of X containing elements following any occurrence of the state i as Since the entropy rate of a first-order Markov chain can be written as H̄ = S X i=1 πi H(X2 |X1 = i), (14) a natural idea is to use π̂i to estimate πi and an appropriate Shannon entropy estimator to estimate H(X2 |X1 = i). The empirical entropy rate is defined as H̄emp = S X   π̂i Ĥemp X(i) , i=1 (15) where Ĥemp (Y) computes the Shannon entropy of the empirical distribution of its argument Y = (Y1 , Y2 , . . . , Ym ). In fact, (15) can also be interpreted as the maximum likelihood estimate of H̄ (Lemma 11). The entropy rate estimator proposed in this paper differs from H̄emp in that we replace the estimator Ĥemp (·) with a minimax rate-optimal estimator for the Shannon entropy from i.i.d. samples. That is, our entropy rate estimator is H̄opt = S X   π̂i Ĥopt X(i) , i=1 (16) where π̂ is defined in (12), where Ĥopt is any minimax rate-optimal Shannon entropy estimator designed for i.i.d. data, such as those found in [VV11b, WY16, JVHW15]. The main property Ĥopt needs to satisfy is a concentration property, which is presented in Lemma 1. 5 3 Main results As motivated by the results in the independent case, one might expect that bias dominates when n is close to S 2 for the empirical entropy, and that the total error (including bias and variance) should not depend on the mixing properties when the mixing is not too slow. This intuition is supported by the following theorem. Theorem 1. Suppose (X0 , X1 , . . . , Xn ) is a sample path from a stationary reversible Markov chain 3 with spectral gap γ. If S 0.01 . n . S 2.99 and γ1 . ln nSln2 S ∧ n ln Sn ln3 S , there exists some constant C > 0 independent of n, S, γ such that the entropy rate estimator (16) satisfies:3 as S → ∞, P S2 |H̄opt − H̄| ≤ C n ln S ! →1 (17) Under the same conditions, there exists some constant C ′ > 0 independent of n, S, γ such that the empirical entropy rate H̄emp in (15) satisfies: as S → ∞, P |H̄emp − H̄| ≤ C ′S 2 n ! → 1. (18) Remark 1. Theorem 1 shows that when the number of samples is not too large (n . S 2.99 ), and 3 2 the mixing is not too slow ( γ1 . ln nSln2 S ∧ n ln Sn ln3 S ), it suffices to take n ≫ lnS S for the estimator H̄opt to achieve a vanishing error, and n ≫ S 2 for the empirical entropy rate. Theorem 1 improves over [KV16] in the analysis of the empirical entropy rate in the sense that unlike the error term 2 S2 ), our dominating term O( Sn ) does not depend on the mixing time. We emphasize that O( nγ the constraint that n being not be too large is not restrictive. The theory of entropy estimation 2 with i.i.d. data shows that the bias only dominates when n . lnS4 S for the optimal estimator, and 2 n . lnS2 S for the empirical entropy. In Theorem 1, we are only characterizing the regime where the bias dominates. The next result shows that the bias of the empirical entropy rate H̄emp is non-vanishing unless n ≫ S 2 , even when the data are independent. Theorem 2. Suppose H̄emp is the empirical entropy rate defined in (15), and H̄ denotes the true entropy rate. Let n ≥ 1, S ≥ 1. If {X0 , X1 , . . . , Xn } are mutually independent and uniformly distributed, then |H̄ − E[H̄emp ]| ≥ ln ! S2 . n+S−1 (19) The following corollary is immediate. Corollary 1. There exists a universal constant c > 0 such that when n ≤ cS 2 , the absolute value of the bias of H̄emp is bounded away from zero even if the Markov chain is memoryless. The next theorem presents a minimax lower bound for entropy rate estimation, which quantifies the limit that any estimation scheme cannot beat. 3 The asymptotic results in this section are interpreted by parameterizing n = nS and γ = γS and S → ∞ subject to the conditions of each theorem. 6 Theorem 3. For n ≥ S2 ln S , ln n ≪ lim inf inf S→∞ S ∗ (ln S)2 , γ ≤ 1 − C2 sup q S ln3 S n , we have S2 |Ĥ − H̄| ≥ C1 n ln S P Ĥ T ∈M2,rev (S,γ ∗ ) ! ≥ 1 . 2 (20) Here C1 , C2 are universal constants from Theorem 5. The following corollary, which follows from Theorem 1 and 3, presents the critical scaling that determines whether consistent estimation of the entropy rate is possible. Corollary 2. If ln3 S S 2 ≪ γ ∗ ≤ 1 − C2 ln√SS , there exists an estimator Ĥ which estimates the entropy rate with a uniformly vanishing error over Markov chains M2,rev (S, γ ∗ ) if and only if n ≫ S2 ln S . To conclude this section we summarize our result in terms of the sample complexity for estimating the entropy rate within a few bits (ǫ = Θ(1)), classified according to the relaxation time: • τrel = 1: this is the i.i.d. case and the sample complexity is Θ( lnSS ); 2 2 • 1 < τrel ≪ 1 + Ω( ln√SS ): in this narrow regime the sample complexity is at most O( lnS S ) and no matching lower bound is known; 2 • 1 + Ω( ln√SS ) ≤ τrel ≪ S : ln3 S 2 the sample complexity is Θ( lnS S ); 2 • τrel & lnS3 S : the sample complexity is Ω( lnS S ) and no matching upper bound is known. In this case the chain mixes very slowly and it is likely that the variance will dominate. 4 4.1 Upper bound analysis Proof of Theorem 1 The performance of Ĥopt and Ĥemp in terms of Shannon entropy estimation is collected in the following lemma. i.i.d. Lemma 1. Suppose α = 0.001, α′ = 0.01 and one observes n i.i.d. samples X1 , X2 , . . . , Xn ∼ P . Then, there exists an entropy estimator Ĥopt = Ĥopt (X1 , . . . , Xn ) ∈ [0, ln S] such that for any t > 0,  S P |Ĥopt − H(P )| ≥ t + c2 n ln S    ≤ 2 exp −c1 t2 n1−α , (21) where c1 , c2 > 0 are universal constants, and H(P ) is the Shannon entropy defined in (2). Moreover, the empirical entropy Ĥemp = Ĥemp (X1 , X2 , . . . , Xn ) ∈ [0, ln S] satisfies, for any t > 0,  P |Ĥemp − H(P )| ≥ t + c2 S n    ≤ 2 exp −c1 t2 n1−α . Consequently, for any β > 0, P c2 S + |Ĥopt − H(P )| ≥ n ln S s P c2 S |H̄emp ) − H(P )| ≥ + n s (22) β c1 n1−α′ ! ≤ 2 , nβ (23) β c1 n1−α′ ! ≤ 2 . nβ (24) and 7 Proof. The part pertaining to the concentration of Ĥopt follows from [WY16, JVHW15, ADOS17]. The part pertaining to the empirical entropy follows from [AK01], [Pan03, Proposition 1], [JVHW17, Eqn. (88)]. 4.1.1 Alternative probabilistic description of Markov chains One key step in the analysis is to identify a high-probability event that ensures the accuracy of the estimator; we refer to such an event as a “good” event. To this end, we adopt the following view on the generation of a finite-state Markov chain [Bil61, p. 19]. The process {X0 , X1 , . . .} can be viewed as having been generated in the following fashion. Consider an independent collection of random variables X0 and Win (i = 1, 2, . . . , S; n = 1, 2, . . .) such that PX0 (i) = πi PWin (j) = Tij . Imagine the variables Win set out in the following array: W11 , W12 , . . . , W1n , . . . W21 , .. ., W22 , . . . , W2n , . . . .. .. .. .. ., ., ., . WS1 , WS2 , . . . , WSn , . . . First, X0 is sampled. If X0 = i, then the first variable in the ith row of the array is sampled, and the result assigned by definition to X1 . If X1 = j, then the first variable in the jth row is sampled, unless j = i, in which case the second variable is sampled. In any case, the result of the sampling is by definition X2 . The next variable sampled is the first one in row X2 which has not yet been sampled. This process thus continues. It follows from the definition that the joint distribution of X0 , X1 , . . . , Xn sampled from this model is  P (Xk = xk , 0 ≤ k ≤ n) = P X0 = x0 , Wxk−1 mk = xk , 1 ≤ k ≤ n , (25) where mk − 1 is the number of elements among {x1 , . . . , xk−1 } that are equal to xk . Due to the independence assumptions, we have P (Xk = xk , 0 ≤ k ≤ n) = P (X0 = a0 )P (Wa0 m1 = a1 ) . . . P (Wan−1 mn = an ) (26) Taj aj+1 . (27) = πa0 n−1 Y j=0 After collecting {X0 , X1 , . . . , Xn } from the model, we assume that the last variable sampled from row i is Wini . It is clear that π̂i = ni , n S X ni = n i=1 and the subsequence of the sample path defined in (13) is simply X(i) = (Wi1 , . . . , Wini ). 8 4.1.2 Analysis of H̄opt and H̄emp Next we define two events that ensure the proposed entropy rate estimator (16) and the empirical entropy rate (15) is accurate, respectively: Definition 1 (“Good” event in estimation). Let 0 < c4 < 1 and c3 ≥ 20 be some universal constants. We take c4 = 0.001. 1. For every i, 1 ≤ i ≤ S, define the event Ei = ( |π̂i − πi | ≤ c3 max ( ln n , nγ s πi ln n nγ )) (28) 2. For every i ∈ [S] such that πi ≥ nc4 −1 ∨ 100c23 lnnγn , define the event Hi as c2 S + |Ĥopt (Wi1 , Wi2 , . . . , Wim ) − Hi | ≤ m ln S for all m such that nπi − c3 from Lemma 1. q nπi ln n γ ≤ m ≤ nπi + c3 q nπi ln n , γ s β , c1 m1−α′ where β = c23 4+10c3 , (29) c1 , c2 , α′ are Finally, define the “good” event as the intersection of all the events above:  Gopt ,  \ i∈[S]   Ei  ∩  \ n i:πi ≥nc4 −1 ∨100c23 ln nγ  Hi  . (30) Analogously, we define the “good” event Gemp for the empirical entropy rate (15) in a similar fashion with (29) replaced by c2 S |Ĥemp (Wi1 , Wi2 , . . . , Wim ) − Hi | ≤ + m s β ′. c1 m1−α (31) The following lemma shows that the “good” events defined in Definition 1 indeed occur with high probability. Lemma 2. Both Gopt and Gemp in Definition 1 occur with probability at least 1− where β = c23 4+10c3 , c3 4c3 (10)β S 2S , − β β c (β−1) 4 n 9 n (32) ≥ 20. Now we present our main upper bound, which implies Theorem 1 as a corollary. Theorem 4. Suppose (X0 , X1 , . . . , Xn ) comes from a stationary reversible Markov chain with spectral gap γ. Then, with probability at least the value in (32), the entropy rate estimator in (16) satisfies s   1−α′ 2 S2 S S ln S S ln S ln n S ln n ln2 S |H̄opt − H̄| . + + , (33) + 1−c4 + n ln S n n nγ nγ where c3 , c4 are constants in Definition 1, and α′ is introduced in (23). We take c4 = 0.001, α′ = 0.01. 9 Similarly, for the empirical entropy rate Ĥemp in (15), we have   1−α′ S2 + |H̄emp − H̄| . n S n 2 S ln S S ln S ln n + + 1−c4 + n nγ s S ln n ln2 S nγ (34) with probability at least the value in (32). Proof. We write H̄ = H̄opt = S X i=1 S X πi H i , (35) π̂i Ĥi , (36) i=1 where Hi = H(X2 |X1 = i), Ĥi = Ĥopt (X(i) ) = Ĥopt (Wi1 , . . . , Wini ). Write H̄opt − H̄ = S X i=1 |   πi Ĥi − Hi + {z } E1 S X i=1 Ĥi (π̂i − πi ) . | {z (37) } E2 Next we bound the two terms separately under the condition that the “good” event Gopt in Definition 1 occurs. q 100c23 ln n . Note that the function πi 7→ nπi − c3 nπiγln n is an increasing function when πi ≥ nγ Thus we have nπi − c3 whenever πi ≥ s 100c23 ln n . nγ q β c2 S , m ln S + c1 m1−α′ Let ǫ(m) , Note that for each i ∈ [S], n o |Ĥi − Hi | ≤ ǫ(ni ) ⊃ = ⊃ nπi ln n = nπi 1 − c3 γ s ln n nπi γ ! ≥ 9 nπi , 10 (38) which is decreasing in m. Let n± i , nπi ± c3 max ( n |Ĥi − Hi | ≤ ǫ(ni ), |π̂i − πi | ≤ max ( ln n , nγ s n ln n γ , πi ln n nγ + |Ĥopt (Wi1 , . . . , Wini ) − Hi | ≤ ǫ(ni ), n− i ≤ ni ≤ ni n+ i \ m=n− i q nπi ln n γ o . )) o {|Ĥopt (Wi1 , . . . , Wim ) − Hi | ≤ ǫ(m)}. The key observation is that for each fixed m, Wi1 , . . . , Wim are i.i.d. as Ti .4 Taking the intersection over i ∈ [S], we have n o |Ĥi − Hi | ≤ ǫ(ni ), i = 1, . . . , S ⊃ Gopt . 4 Note that effectively we are taking a union over the value of ni instead of conditioning. In fact, conditioned on ni = m, Wi1 , . . . , Wim are no longer i.i.d. as Ti . 10 Therefore, on the event Gopt , we have |E1 | ≤ ≤ S X i=1 πi |Ĥi − Hi | X n i:πi ≥nc4 −1 ∨100c23 ln nγ (38) ≤ X πi |Ĥi − Hi | + πi X n i:πi ≤nc4 −1 ∨100c23 ln nγ c2 S + 0.9nπi ln S n i:πi ≥nc4 −1 ∨100c23 ln nγ + X s πi |Ĥi − Hi | ! β c1 (0.9nπi )1−α′ πi ln S n i:πi ≤nc4 −1 ∨100c23 ln nγ S2 + . n ln S   1−α′ S n 2 + S ln S S ln S ln n , ∨ n1−c4 nγ where the last step follows from (38) and the fact that E2 , on the event Gopt , we have |E2 | ≤ S X i=1 Ĥi |π̂i − πi | ≤ ln S S X c3 max i=1 ( ln n , nγ s P α i∈[S] πi πi ln n nγ ) (39) ≤ S 1−α for any α ∈ [0, 1]. As for S ln S ln n ∨ . nγ s S ln n ln2 S . nγ (40) Combining (39) and (40), and using Lemma 2, completes the proof of (33). The proof of (34) follows entirely analogously with Gopt replaced by Gemp . 5 5.1 Impossibility results Lower bound on the empirical entropy rate We first prove Theorem 2, which quantifies the performance limit of the empirical entropy rate. Lemma 11 in Section 8 shows that H̄emp = min P ∈M2 (S) 1 1 ln , n PX1n |X0 (X1n |X0 ) (41) where M2 (S) denotes the set of all Markov chain transition matrices with state space X of size S. Since # " 1 1 ln , (42) H̄ = EP n PX1n |X0 (X1n |X0 ) we know H̄ − E[H̄emp ] ≥ 0. Q We specify the true distribution PX0n (xn0 ) to be the i.i.d. product distribution ni=0 P (xi ), and it suffices to lower bound EP " 1 1 1 1 ln − min ln n n PX1n |X0 (X1 |X0 ) P ∈M2 (S) n PX1n |X0 (X1n |X0 ) h i # (43) = H(P ) − EP H(P̂X1 X2 ) − H(P̂X1 ) (44) = H(PX1 X2 ) − EP [H(P̂X1 X2 )] − (H(PX1 ) − EP [H(P̂X1 )]), (45)   11 where P̂X1 X2 is the empirical distribution of the counts {(xi , xi+1 ) : 0 ≤ i ≤ n − 1}, and P̂X1 is the marginal distribution of P̂X1 X2 . It was shown in [JVHW17] that for any PX1 , 0 ≤ H(PX1 ) − EP [H(P̂X1 )]   S−1 . ≤ ln 1 + n (46) (47) Now, choosing PX1 to be the uniform distribution, we have EP " 1 1 1 1 ln − min ln n n PX1n |X0 (X1 |X0 ) P ∈M2 (S) n PX1n |X0 (X1n |X0 )  ≥ ln(S 2 ) − ln n − ln 1 + ≥ ln ! S2 , n+S−1 S−1 n # (48)  (49) (50) where we have used the fact that the uniform distribution on S elements has entropy ln(S), and it maximizes the entropy among all distribution supported on S elements. 5.2 Minimax lower bound We use a sequence of reductions to prove the lower bound for Markov chains. Specifically, we introduce two auxiliary models, namely, the independent multinomial and independent Poisson model, and show that the sample complexity of the Markov chain model is lower bounded by that of the independent multinomial model (Lemma 3), which is further lower bounded by that of the independent Poisson model (Lemma 4). Finally, Theorem 3 follows from the lower bound for the independent Poisson model in Theorem 5. To be precise, we use the notation PMC , PIM , PIP to denote the probability measure corresponding to the three models respectively. 5.2.1 Reduction from Markov chain to independent multinomial Definition 2 (Independent multinomial model). Given a stationary reversible Markov chain with transition matrix T = (Tij ) ∈ M2,rev (S), stationary distribution πi , i ∈ [S] and absolute spectral gap γ ∗ . Fix an integer n ≥ 0. Under the independent multinomial model, the statistician observes X0 ∼ π, and the following arrays of independent random variables W11 , W12 , . . . , W1m1 W21 , .. ., W22 , . . . , .. .. ., ., W2m2 .. . WS1 , WS2 , . . . , WSmS constant c3 ≥ 20, and within the ith row the random variables n q nπi ln n γ∗ i.i.d. Wi1 , Wi2 , . . . , Wimi ∼ where the number of observations in the ith row is mi = ⌈nπi + c3 max ln n γ∗ , o ⌉ for some Ti . Equivalently, the observations can be summarized into the following (sufficient statistic) S × S matrix C = (Cij ), where each row is independently distributed multi(mi , Ti ), hence the name of independent multinomial model. The following lemma relates the independent multinomial model to the Markov chain model: 12 Lemma 3. If there exists an estimator Ĥ1 under the Markov chain model with parameter n such that sup T ∈M2,rev (S,γ ∗ )   PMC |Ĥ1 − H̄| ≥ ǫ ≤ δ, (51) then there exists another estimator Ĥ2 under the independent multinomial model with parameter n such that sup T ∈M2,rev (S,γ ∗ ) where β = 5.2.2 c23 4+10c3   PIM |Ĥ2 − H̄| ≥ ǫ ≤ δ + 2S , nβ (52) ≥ 1, and c3 is the constant in Definition 2. Reduction from independent multinomial to independent Poisson We introduce the independent Poisson model below, which is parametrized by an S × S symmetric matrix R, an integer n and a parameter λ > 0. Definition 3 (Independent Poisson model). Given an S × S symmetric matrix R = (Rij ) with Rij ≥ 0 and a parameter λ > 0, under the independent Poisson model, we observe X0 ∼ π = π(R), and an S × S matrix C = (Cij ) with independent entries distributed as Cij ∼ Poi (λRij ), where πi = πi (R) = ri , r ri = S X Rij , r = j=1 S X ri . (53) i=1 For each symmetric matrix R, we can define a transition matrix T = T (R) by normalizing the rows:   Tij = Rij /  S X j=1 Rij  . (54) Thanks to the symmetry of R, T is the transition matrix of a reversible Markov chain with a stationary distribution π = π(R). Indeed, the detailed balance equation is satisfied:  πi Rij /  S X j=1  Rij  = πj Rji / S X ! Rji , i=1 where we used the fact that Rij = Rji . Upon observing the Poisson matrix C, the functional to be estimated is the entropy rate H̄ of the normalized transition matrix T = T (R), which can be simplified as follows: Rij πi P S H̄(T (R)) = ln j=1 Rij 1≤i,j≤S X = 1 X ri Rij ln r 1≤i,j≤S Rij  PS j=1 Rij (55) Rij (56)  S X X 1 1 + ri ln ri  . Rij ln =  r 1≤i,j≤S Rij i=1 13 (57) Given τ > 0 and γ, q ∈ (0, 1), define the following collection of symmetric matrices: R(S, γ, τ, q) =    : R = R⊤ , γ ∗ (T ) ≥ γ, R ∈ RS×S + X i,j   Rij ≥ τ, πmin ≥ q , (58)  where T = T (R) is the normalized transition matrix defined in (54), πmin = mini πi . Here the parameters τ and q ensure there exist sufficiently many observations to simulate the independent multinomial model. This is made precise in the next lemma. Lemma 4. If there exists an estimator Ĥ1 for the independent multinomial model with parameter n such that sup T ∈M2,rev (S,γ)   PIM |Ĥ1 − H̄| ≥ ǫ ≤ δ, (59) then there exists another estimator Ĥ2 for the independent Poisson model with parameter λ = such that sup R∈R(S,γ,τ,q) provided q ≥ 5.2.3 c3 ln n nγ ,   PIP |Ĥ2 − H̄(T (R))| ≥ ǫ ≤ δ + Sn−c3 /2 , 4n τ (60) where c3 ≥ 20 is the constant in Definition 2. Minimax lower bounds for the independent Poisson model Now our task is reduced to lower bounding the sample complexity of the independent Poisson model. The general strategy is the so-called method of fuzzy hypotheses, which is an extension of LeCam’s two-point methods. The following version is adapted from [Tsy08, Theorem 2.15] (see also [HJWW17, Lemma 11]). Lemma 5. Let Z be a random variable distributed according to Pθ for some θ ∈ Θ. Let µ1 , µ2 be a pair of probability measures (not necessarily supported on Θ). Let fˆ = fˆ(Z) be an arbitrary estimator of the functional f (θ) based on the observation Z. Suppose there exist ζ ∈ R, ∆ > 0, 0 ≤ β1 , β2 < 1 such that µ1 (θ ∈ Θ : f (θ) ≤ ζ − ∆) ≥ 1 − β1 µ2 (θ ∈ Θ : f (θ) ≥ ζ + ∆) ≥ 1 − β2 . Then   inf sup Pθ |fˆ − f (θ)| ≥ ∆ ≥ fˆ θ∈Θ R 1 − TV(F1 , F2 ) − β1 − β2 , 2 (61) (62) (63) where Fi = PθRµi (dθ) is the marginal distributions of Z induced by the prior µi , for i = 1, 2, and TV(F1 , F2 ) = 12 |dF1 − dF2 | is the total variation distance between distributions F1 and F2 . To apply this method for the independent Poisson model, the parameter is the S × S symmetric matrix R, the function to be estimated is H̄ = H̄(T (R)), the observation (sufficient statistic for R) is C = X0 ∪ {Cij + Cji : i 6= j, 1 ≤ i ≤ j ≤ S} ∪ {Cii : 1 ≤ i ≤ S}. The goal is to construct two symmetric random matrices (whose distributions serve as the priors), such that 14 (a) they are sufficiently concentrated near the desired parameter space R(S, γ, τ, q) for properly chosen parameters γ, τ, q; (b) the entropy rates have different values; (c) the induced marginal laws of C are statistically inseparable. To this end, we need the following results (cf. [WY16, Proof of Proposition 3]): Lemma 6. Let 1 φ(x) , x ln , x ∈ [0, 1]. x Let c > 0, D > 100 and 0 < η0 < 1 be some absolute constants. For any α ∈ (0, 1), η ∈ (0, η0 ), there exist random variables U, U ′ supported on [0, αη −1 ] such that E[φ(U )] − E[φ(U ′ )] ≥ cα (64) & D j = 1, 2, . . . , √ η E[U j ] = E[U ′j ], E[U ] = E[U ′ ] = α. ' (65) (66) Lemma 7 ( [WY16, Lemma 3]). Let V1 and V2 be random variables taking values in [0, M ]. If E[V1j ] = E[V2j ], j = 1, . . . , L, then TV(E[Poi(V1 )], E[Poi(V2 )]) ≤  2eM L L . (67) R where E[Poi(V )] = Poi(λ)PV (dλ) denotes the Poisson mixture with respect to the distribution of a positive random variable V . Now we are ready to define the priors µ1 , µ2 for the independent Poisson model. For simplicity, we assume the cardinality of the state space is S + 1 and introduce a new state 0: Definition 4 (Prior construction). Suppose n ≥ α= S2 ln S . Set S 1 ≤ n ln S S (68) 1 = (d1 ln S)2 η & (69) ' D L= √ , η (70) D where d1 = 8e 2 , and D > 0 is the constant in Lemma 6. Recall the random variables U, U ′ are introduced in Lemma 6. We use a construction that is akin to that studied in [BCC10]. Define S × S symmetric random matrices U = (Uij ) and U′ = (Uij′ ), where {Uij : 1 ≤ i ≤ j ≤ S} be i.i.d. copies of U and {Uij′ : 1 ≤ i ≤ j ≤ S} be i.i.d. copies of U ′ , respectively. Let     b a···a b a···a   R=   a .. . a U   R =     ,   ′ 15 a .. . a U′   ,   (71) where a= √ αS, b = S. (72) Let µ1 and µ2 be the laws of R and R′ , respectively. The parameters γ, τ, q will be chosen later, and we set λ = 4n τ in the independent Poisson model (as in Lemma 4). The construction of this pair of priors achieves the following three goals: (a) Statistical indistinguishablility. Note that the distributions of the first row and column of R and R′ are identical. Hence the sufficient statistics are X0 and C = {Cij + Cji : i 6= j, 1 ≤ i ≤ j ≤ S}∪ {Cii , 1 ≤ i ≤ S}. Denote its the marginal distribution as Fi under the prior µi , for i = 1, 2. The following lemma shows that the distributions of the sufficient statistic are indistinguishable: Lemma 8. For n ≥ S2 ln S , we have TV(F1 , F2 ) = o(1) as S → ∞. (b) Functional value separation. Under the two priors µ1 , µ2 , the corresponding entropy rates 2 of the independent Poisson model differ by a constant factor of nSln S . Here we explain the intuition: in view of (57), for φ(x) = −x ln x we have  where ri = PS j=0 Rij  S S X 1 X H̄(T (R)) =  φ(Rij ) − φ(ri ) r i,j=0 i=0 and r = PS i,j=0 Rij ; (73) similarly,   S S X 1 X ′ φ(Rij )− φ(ri′ ) . H̄(T (R′ )) = ′  r i,j=0 i=0 √ We will show that both r and r ′ are close to their common mean b+ 2aS + S 2 α = S(1+ αS)2 ≈ S. Furthermore, ri and ri′ also concentrate on their common mean. Thus, in view of Lemma 6, we have S2 |H̄(T (R)) − H̄(T (R′ ))| ≈ S|E[φ(U )] − E[φ(U ′ )]| = Ω(Sα) = Ω n ln S ! . (74) The precise statement is summarized in the following lemma: 2 Lemma 9. Assume that n ≥ lnS S and ln n ≪ some ζ ∈ R, such that as S → ∞, S . ln2 S There exist universal constants C1 > 0 and S2 P H̄(T (R)) ≥ ζ + C1 n ln S ! = 1 − o(1), S2 P H̄(T (R )) ≤ ζ − C1 n ln S ! = 1 − o(1). ′ (c) Concentration on parameter space. Although the random matrices R and R′ may take values outside the desired space R (S, γ, τ, q), we show that most of the mass is concentrated on this set with appropriately chosen parameters. The following lemma, which is the core argument of the lower bound, makes this statement precise. 16 S2 ln S . Lemma 10. Assume that n ≥ There exist universal constants C > 0, such that as S → ∞, P (R ∈ R (S, γ, τ, q)) = 1 − o(1),  P R′ ∈ R (S, γ, τ, q) = 1 − o(1), where γ = 1 − C2 q S ln3 S n , τ = S, and q = √1 . 5 n ln S Fitting Lemma 8, Lemma 9 and Lemma 10 into the main Lemma 5, the following minimax lower bound holds for the independent Poisson model. Theorem 5. There exist universal constants C1 , C2 > 0 such that if n ≥ 1 − C2 q S2 ln S , ln n 3 S ln S n , lim inf inf S→∞ where τ = S, q = Ĥ sup PIP R∈R(S,γ ∗ ,τ,q) S2 |Ĥ − H̄| ≥ C1 n ln S ! ≥ ≪ S , γ∗ (ln S)2 1 2 ≤ (75) √1 . 5 n ln S 2 Proof of Theorem 5. For the choice of ζ and ∆ = C1 nSln S in Lemma 9, a combination of Lemma 9 and Lemma 10 gives S2 P R ∈ R (S, γ , τ, q) , H̄(T (R)) ≥ ζ + C1 n ln S ∗ ! = 1 − o(1) (76) as S → ∞, so that β1 = o(1). Similarly, β2 = o(1). By Lemma 8, we have TV(F1 , F2 ) = o(1). Now Theorem 5 follows from Lemma 5 directly. 5.2.4 Proof of Theorem 3 Now we combine the previous results to prove Theorem 3. Firstly, Theorem 5 shows that as S → ∞, inf sup Ĥ R∈R(S,γ ∗ ,τ,q) where τ = S, q = √1 . 5 n ln S n≥ ln S ensures q = inf √1 5 n ln S sup Ĥ T ∈M2,rev (S,γ ∗ ) ! ≥ 1 − o(1) 2 (77) Moreover, since a larger γ ∗ results in a smaller set of parameters for all models, we may always assume that S2 PIP S2 |Ĥ − H̄| ≥ C1 n ln S ≥ PIM c3 ln n nγ ∗ , γ∗ = 1 − C2 q S ln3 S n . For this choice of γ ∗ , the assumption and thus Lemma 4 implies S2 |Ĥ − H̄| ≥ C1 n ln S ! ≥ 1 1 − o(1) − Sn−c3 /2 = − o(1). 2 2 (78) 2S 1 1 − o(1) − β = − o(1) 2 n 2 (79) Finally, an application of Lemma 3 gives inf sup Ĥ T ∈M2,rev (S,γ ∗ ) PMC S2 |Ĥ − H̄| ≥ C1 n ln S completing the proof of Theorem 3. 17 ! ≥ 6 Experiments The entropy rate estimator we proposed in this paper that achieves the minimax rates can be viewed as a conditional approach; in other words, we apply a Shannon entropy estimator for observations corresponding to each state, and then average the estimates using the empirical frequency of the states. More generally, for any estimator Ĥ of the Shannon entropy from i.i.d. data, the conditional approach follows the idea of H̄Cond = S X π̂i Ĥ(X(i) ), (80) i=1 where π̂ is defined in (12). We list several choices of Ĥ: 1. The empirical entropy estimator, which simply evaluates the Shannon entropy of the empirical distribution of the input sequence. It was shown not to achieve the minimax rates in Shannon entropy estimation [JVHW17], and also not to achieve the optimal sample complexity in estimating the entropy rate in Theorem 2 and Corollary 1. 2. The Jiao–Venkat–Han–Weissman (JVHW) estimator, which is based on best polynomial approximation and proved to be minimax rate-optimal in [JVHW15]. The independent work [WY16] is based on similar ideas. 3. The Valiant–Valiant (VV) estimator, which is based on linear programming and proved to achieve the lnSS phase transition for Shannon entropy in [VV13]. 4. The profile maximum likelihood estimator (PML), which is proved to achieve the lnSS phase transition in [ADOS17]. However, there does not exist an efficient algorithm to even approximately compute the PML with provably ganrantees. There is another estimator, i.e., the Lempel–Ziv (LZ) entropy rate estimator [ZL78], which does not lie in the category of conditional approaches. The LZ estimator estimates the entropy through compression: it is well known that for a universal lossless compression scheme, its codelength per symbol would approach the Shannon entropy rate as length of the sample path grows to infinity. Specifically, for the following random matching length defined by Lni = 1 + max {1 ≤ l ≤ n : ∃j ≤ i − 1 s.t. (Xi , · · · , Xi+l−1 ) = (Xj , · · · , Xj+l−1 )} , (81) it is shown in [WZ89] that for stationary and ergodic Markov chains, Lni = H̄ a.s. n→∞ ln n lim (82) We use alphabet size S = 200 and vary the sample size n from 100 to 300000 to demonstrate how the performance varies as the sample size increases. We compare the performance of the estimators by measuring the root mean square error (RMSE) in the following four different scenarios via 10 Monte Carlo simulations: 1. Uniform: The eigenvalue of the transition matrix is uniformly distributed except the largest one and the transition matrix is generated using the method in [Jia09]. Here we use spectral gap γ = 0.1. 2. Zipf: The transition probability Tij ∝ 1 i+j . 18 3. Geometric: The transition probability Tij ∝ 2−|i−j| . 4. Memoryless: The transition matrix consists of identical rows. In all of the four cases, the JVHW estimator outperforms the empirical entropy rate. The results of VV [VV13] and LZ [WZ89] are not included due to their considerable longer running time. For example, when S = 200 and n = 300000 and we try to estimate the entropy rate from a single trajectory of the Markov chain, the empirical entropy and the JVHW estimator were evaluated in less than 30 seconds. The evaluation of LZ estimator and the conditional VV method did not terminate after a month.5 The main reason for the slowness of the VV methods in the context of Markov chains is that for each context it needs to call the original VV entropy estimator (2000 times in total in the above experiment), each of which needs to solve a linear programming. 101 Entropy Rate Estimation Error for Various Estimators 101 Entropy Rate Estimation Error for Various Estimators 100 100 10 RMSE RMSE 10-1 -1 10-2 10-2 10-3 Empirical JVHW(conditional) 10-3 102 103 Empirical JVHW(conditional) 104 105 106 10-4 102 107 103 104 Number of samples (a) Uniform 101 105 106 107 Number of samples (b) Zipf Entropy Rate Estimation Error for Various Estimators 101 10-1 10-1 RMSE 100 RMSE 100 Entropy Rate Estimation Error for Various Estimators 10-2 10-2 10-3 10-3 Empirical JVHW(conditional) 10 Empirical JVHW(conditional) -4 102 103 104 105 106 10 107 Number of samples -4 102 103 104 105 106 107 Number of samples (c) Geometric (d) Memoryless Figure 1: Comparison of the performances of the empirical entropy rate and JVHW estimator in different parameter configurations 5 For LZ, we use the Matlab implementation in https://www.mathworks.com/matlabcentral/fileexchange/51042-entropy-estimat For VV, we use the Matlab implementation in http://theory.stanford.edu/~valiant/code.html. We use 10 cores of a server with CPU frequency 1.9GHz. 19 7 Application: Fundamental limits of language modeling In this section, we apply entropy rate estimators to estimate the fundamental limits of language modeling. There has been a lot of recent interest and progress in developing probabilistic models of natural languages, for applications such as machine translation, spell-checking and search query completion, mostly using recurrent neural networks [ZL16, XWL+ 17, ZSKS16, MXBS16, GG16, JVS+ 16, KG17, SMM+ 17]. A language model specifies the joint probability distribution of a sequence of words, QX n (xn ). It is common to use a (k − 1)th-order Markov assumption to train these models, using sequences of k words (known as k-grams,6 sometimes with Latin prefixes unigrams, bigrams, etc.), with values of k of up to 5 [JM09]. To measure the efficacy of a model QX n , researchers commonly use a metric called perplexity, which is the normalized inverse probability under a model of of a test set X n = (X0 , . . . , Xn ), s 1 . perplexityQ (X n ) = n n QX (X n ) The logarithm of perplexity (also known as the cross-entropy rate) can be seen as a logarithmic loss function, h i 1 1 log perplexityQ (X n ) = log , n QX n (X n ) and in particular, if a language is a stationary and ergodic stochastic process with entropy rate H̄, and X n is drawn from the language with true distribution PX n (X n ), then [Kie91] H̄ ≤ lim inf n→∞ h i 1 1 n log = lim inf log perplexity (X ) , Q n→∞ n QX n (X n ) with equality when Q = P . In this section, all logarithms are with respect to base 2 and all entropy are measured in bits. The entropy rate of the English language is therefore of significant interest to language model researchers: since 2H̄ is a tight lower bound on perplexity, this quantity indicates how close a given language model is to the optimum. Several researchers have presented estimates in bits per character [Sha51, CK78, BPM+ 92]; because language models are trained on words, these estimates are not directly relevant to the present task. In one of the earliest papers on this topic, Claude Shannon [Sha51] gave an estimate of 11.82 bits per word. This latter figure has been comprehensively beaten by recent models; for example, [KG17] achieved a perplexity corresponding to a cross-entropy rate of 4.55 bits per word. To produce an estimate of the entropy rate of English, we used two well-known linguistic corpora: the Penn Treebank (PTB) and Google’s One Billion Words (1BW) benchmark. Results based on these corpora are particularly relevant because of their widespread use in training models. We used the conditional approach proposed in this paper with the JVHW estimator describe in Section 6. The PTB corpus contains about n ≈ 1.2 million words, of which S ≈ 47, 000 are unique. The 1BW corpus contains about n ≈ 740 million words, of which S ≈ 2.4 million are unique. Obviously, the English language is not a first-order Markov process. However, since for stationary stochastic processes (not necessarily Markov), the entropy rate is the limit H̄ = lim H(Xk |X k−1 ), k→∞ 6 In the language modeling literature these are typically known as n-grams, but we use k to avoid conflict with the size of the dataset. 20 estimated cond. entropy Ĥ(Xk |X1k−1 ) PTB 1BW 10 8 best known model for PTB [ZL16] 6 best known model for 1BW 4 [KG17] 2 0 1 2 3 4 memory length k Figure 2: Estimates of conditional entropy based on linguistic corpora we can estimate the entropy rate using estimates of the conditional entropy H(Xk |X k−1 ) for successively increasing k (i.e., successively longer k-grams). Equivalently, we can augment the state space to all (k − 1)-grams and use the estimator (16), relaxing the first-order Markov assumption to a kth order Markov assumption. We did so for k = 1, . . . , 4. It is worth noting that both of these corpora comprise individual sentences, disconnected from each other, so the corpora in effect have a Markov order of about the length of a sentence. Our results are shown in Figure 2. The estimated conditional entropy Ĥ(Xk |X k−1 ) provides us with a refined analysis of the intrinsic uncertainty in language prediction with context length of only k − 1. For 4-grams, using the JVHW estimator on the 1BW corpus, our estimate is 3.46 bits per word. With current state-of-the-art models trained on the 1BW corpus having an cross-entropy rate of about 4.55 bits per word [KG17], this indicates that language models are still at least 0.89 bits per word away from the fundamental limit. (Note that since H(Xk |X k−1 ) is decreasing in k, H(X4 |X 3 ) > H̄.) Similarly, for the much smaller PTB corpus, we estimate an entropy rate of 1.50 bits per word, compared to state-of-the-art models that achieve a cross-entropy rate of about 5.96 bits per word [ZL16], at least 4.4 bits away from the fundamental limit. Since the number of words in the English language (i.e., our “alphabet” size) is huge, in view S2 of the log S result we showed in theory, a natural question is whether a corpus as vast as the 1BW corpus is enough to allow reliable estimates of conditional entropy. A quick answer to this question is that our theory has so far focused on the worst-case analysis and, as demonstrated below, natural language data are much nicer so that the sample complexity for accurate estimation is much lower than what the minimax theory predicts. Specifically, we computed the conditional entropy estimates of Figure 2 but this time restricting the sample to only a subset of the corpus. A plot of the resulting estimate as a function of sample size is shown in Figures 3 and 4. Because sentences in the corpus are in randomized order, the subset of the corpus taken is randomly chosen. To interpret these results, first, note the number of distinct unigrams (i.e., words) in the 1BW corpus is about two million. We recall that in the i.i.d. case, n ≫ S/ ln S samples are necessary [VV11a, WY16, JVHW15], even in the worst case a dataset of 800 million words will be more than adequate to provide a reliable estimate of entropy for S ≈ 2 million. Indeed, the plot for unigrams with the JVHW estimator in Figure 3 supports this. In this case, the entropy estimates for all 21 Figure 3: Estimates of conditional entropy versus sample size for 1BW unigrams; dotted lines are the estimate using the entire corpus (i.e., the final estimate). Note the zoomed-in axes. Table 1: Points at which the 1BW entropy estimates are within 0.1 bit of the final estimate k 1 2 3 sample size 338k 77M 400M % of corpus 0.04% 10.0% 54.2% sample sizes greater than 338 000 words is within 0.1 bits of the entropy estimate using the entire corpus. That is, it takes just 0.04% of the corpus to reach an estimate within 0.1 bits of the true value. We note also that the empirical entropy rate converges to the same value, 10.85, within two decimal places. This is also shown in Figure 3. The dotted lines indicate the final entropy estimate (of each estimator) using the entire corpus of 7.7 × 108 words. Results for similar experiments with bigrams and trigrams are shown in Figure 4 and Table 1. Since the state space for bigrams and trigrams is much larger, convergence is naturally slower, but it nonetheless appears fast enough that our entropy estimate should be within on the order of 0.1 bits of the true value. With these observations, we believe that the estimates based on the 1BW corpus should have enough samples to produce reasonably reliable entropy estimates. As one further measure, to approximate the variance of these entropy estimates, we also ran bootstraps for each memory length k = 1, . . . , 4, with a bootstrap size of the same size as the original dataset (sampling with replacement). For the 1BW corpus, with 100 bootstraps for k = 1, 2, 3, and with 34 for k = 4, the range of estimates (highest less lowest) for each memory length never exceeded 0.001 bit, and the standard deviation of estimates was just 0.0002—that is, the error ranges implied by the bootstraps 22 Figure 4: Estimates of conditional entropy versus sample size for 1BW bigrams and trigrams; dotted lines are the estimate using the entire corpus (i.e., the final estimate) Table 2: Bootstrap estimates of error range k 1 2 3 4 estimate 10.62 6.68 3.44 1.50 PTB st. dev. 0.00367 0.00363 0.00382 0.00244 range 0.0241 0.0271 0.0221 0.0164 estimate 10.85 7.52 5.52 3.46 1BW st. dev. 0.000198 0.000164 0.000146 0.000147 range 0.00133 0.00095 0.00078 0.00054 are too small to show legibly on Figure 2. For the PTB corpus, the range never exceeded 0.03 bit. Further details of our bootstrap estimates are given in Table 2. 8 Auxiliary lemmas Lemma 11. For an arbitrary sequence (x0 , x1 , . . . , xn ) ∈ X n+1 , X = {1, 2, . . . , S}, define the Pn−1 Pn−1 empirical distribution of the consecutive pairs as P̂X1 X2 = n1 i=0 δ(xi ,xi+1 ) . Let P̂X1 = n1 i=0 δxi be the marginal distribution of P̂X1 X2 , and the empirical frequency of state i as X 1 n−1 1(xj = i). π̂i = n j=0 23 (83) Denote the empirical conditional distribution as P̂X2 |X1 = P̂X2 |X1 =i (j) = Pn m=1 P̂X1X2 , P̂X1 i.e., 1(xm = j, xm−1 = i) nπ̂i , (84) P whenever π̂i . Let H̄emp = Si=1 π̂i H(P̂X2 |X1 =i ) be given in (15), and H(·) is the Shannon entropy defined in (2), Then, we have H̄emp = H(P̂X1 X2 ) − H(P̂X1 ), 1 1 ln = min PX1n |X0 (xn1 |x0 ) P ∈M2 (S) n where in (86), for a given transition matrix P , PX1n |X0 (xn1 |x0 ) , (85) (86) Qn−1 t=0 P (xt+1 , xt ). The following lemma gives well-known tail bounds for Poisson and Binomial random variables. Lemma 12. [MU05, Exercise 4.7] If X ∼ Poi(λ) or X ∼ B(n, nλ ), then for any δ > 0, we have P(X ≥ (1 + δ)λ) ≤ eδ (1 + δ)1+δ !λ ≤ e−δ 2 λ/3 P(X ≤ (1 − δ)λ) ≤ e−δ (1 − δ)1−δ !λ ≤ e−δ 2 λ/2 ∨ e−δλ/3 (87) . (88) The following lemma is the Hoeffding inequality. Lemma 13. [Hoe63] Let X1 , X2 , . . . , Xn be independent random variables such that Xi takes its P value in [ai , bi ] almost surely for all i ≤ n. Let Sn = ni=1 Xi , we have for any t > 0, 9 9.1 2t2 P {|Sn − E[Sn ]| ≥ t} ≤ 2 exp − Pn 2 i=1 (bi − ai ) ! . (89) Proofs of main lemmas Proof of Lemma 2 We being with a lemma on the concentration of the empirical distribution π̂ for reversible Markov chains. Lemma 14. Consider a reversible stationary Markov chain with spectral gap γ. Then, for every i, 1 ≤ i ≤ S, every constant c3 > 0, the event Ei = ( happens with probability at most |π̂i − πi | ≥ c3 max 2 , nβ where β = ( ln n , nγ s πi ln n nγ )) (90) c23 4+10c3 . Proof of Lemma 14. Recall the following Bernstein inequality for reversible chains [Pau15, Theorem 3.3]: For any stationary reversible Markov chain with spectral gap γ,  t P |π̂i − πi | ≥ n We have ln n nγ ≥ q πi ln n nγ  if and only if πi ≤ t2 γ ≤ 2 exp − 4nπi (1 − πi ) + 10t ln n nγ . ! . We split the proof of (90) into two parts. 24 (91) 1. πi ≤ ln n nγ : Invoking (91) and setting t = c3 lnγn , we have  Pπ |π̂i − πi | ≥ c3 ln n nγ   ≤ 2 exp − 2 γc23 lnγ 2n 4n lnnγn + 10c3 lnγn c23 ln n ≤ 2 exp − 4 + 10c3 2 = β. n 2. πi ≥ ln n nγ : Invoking (91) and setting t = c3 Pπ |π̂i − πi | ≥ c3 s πi ln n nγ q ! nπi ln n , γ !   we have  ≤ 2 exp − γc23 nπiγln n 4nπi + 10c3 q nπi ln n γ c23 nπi ln n ≤ 2 exp − 4nπi + 10c3 nπi 2 = β. n !   Now we are ready to prove Lemma 2. We only consider Gopt and the upper bound on P (Gemp ) follows from the same steps. By the union bound, it suffices to upper bound the probability of the complement of each event in the definition of the “good” event Gopt (cf. Definition 1). For the first part of the definition, the probability of “bad” events Eic in (28) are upper bounded by X 2 (92) P (Eic ) ≤ S · β , n i∈[S] c2 3 where β = 4+10c as in Lemma 14. Since we have assumed that c3 ≥ 20, we have β ≥ 1. 3 For the second part of the definition, applying Lemma 1, the overall probability of “bad” events Hic in (29) are upper bounded by X i∈[S] ≤ S X ≤ S X ≤ =  1 πi ≥ n P (Hic ) i=1 i=1 S X 2 · c3 s 2 · c3 s 2c3 nπi i=1 S X i=1 ≤D c4 −1 nπi ln n  γ ∨ ln n 100c23 nγ  2 nπi − c3 q nπi ln n γ   β 1 πi ≥ n  2 ln n 1 πi ≥ nc4 −1 ∨ 100c23 (9nπi /10)β nγ  S c4 −1 ∨ ln n 2 nπi ln n 1 πi ≥ nc4 −1 ∨ 100c23 γ (9nπi /10)β nγ ln n 4c3 nπi 1 πi ≥ nc4 −1 ∨ 100c23 (9nπi /10)β nγ nc4 (β−1)  , 25   ln n 100c23 nγ   where D , when πi ≥ 9.2 4c3 (10)β and 9β ln n 2 100c3 nγ . the second step follows from the fact that πi 7→ nπi −c3 q nπi ln n γ is increasing Proof of Lemma 3 We simulate a Markov chain sample path with transition matrix Tij and stationary distribution πi from the independent multinomial model as described in Section 4.1.1, and define the estimator Ĥ2 as follows: output zero if the event ∩1≤i≤S Ei does not happen (where Ei are events defined in Definition 1); otherwise, we set Ĥ2 (X0 , (Wij )i∈[S],j≤mi ) = Ĥ1 (X0 , (Wij )i∈[S],j≤ni ). Note that this is a valid definition since ∩1≤i≤S Ei implies ni ≤ mi for any i ∈ [S]. As a result,     PIM |Ĥ2 − H̄| ≥ ǫ ≤ PIM ((∩1≤i≤S Ei )c ) + PIM (∩1≤i≤S Ei ) PIM |Ĥ2 − H̄| ≥ ǫ| ∩1≤i≤S Ei . It follows from Lemma 2 that PIM ((∩1≤i≤S Ei )c ) ≤ 2S , nβ (94)   c2 (93) 3 where β = 4+10c ≥ 1. Now, it suffices to upper bound PIM |Ĥ2 − H̄| ≥ ǫ| ∩1≤i≤S Ei . The crucial 3 observation is that the joint distribution of (X0 , (ni )i∈[S] , (Wij )i∈[S],j≤ni ) are identical in two models, and thus    PIM |Ĥ2 − H̄| ≥ ǫ| ∩1≤i≤S Ei = PMC |Ĥ1 − H̄| ≥ ǫ| ∩1≤i≤S Ei PIM (∩1≤i≤S Ei ) = PMC (∩1≤i≤S Ei ) .  (95) (96) By definition, the estimator Ĥ1 satisfies   PMC ∩1≤i≤S Ei , |Ĥ1 − H̄| ≥ ǫ ≤ δ. A combination of the previous inequalities gives   PIM |Ĥ2 − H̄| ≥ ǫ ≤ as desired. 9.3 (97) 2S + δ. nβ (98) Proof of Lemma 4 We can simulate the independent multinomial model from the independent Poisson model by conP ditioning on the row sum. For each i, conditioned on Mi , Sj=1 Cij = mi , the random vector Ci = (Ci1 , Ci2 , . . . , CiS ) follows the multinomial distribution multi (mi , Ti ), where T = T (R) is the (Ri1 , Ri2 , . . . , RiS ). transition matrix (54) obtained from normalizing R. In particular, Ti = PS 1 j=1 Rij Furthermore, C1 , . . . , CS are conditionally independent. Thus, to apply the estimator Ĥ1 designed for the independent multinomial model with parameter n that fulfills the guarantee (59), we need to guarantee that Mi > nπi + c3 max ( 26 ln n , γ∗ s nπi ln n γ∗ ) , (99) for all i with probability at least 1 − Sn−c3 /2 . Here c3 ≥ 20 is the constant in Definition 2, and πi = PS j=1 Rij r , (100) P P 4nr where r = 1≤i,j≤S Rij . Note that Mi ∼ Poi(λi ), where λi , 4n j Rij = τ πi ≥ 4nπi , due to τ c3 ln n the assumption that r ≥ τ . By the assumption of πi ≥ πmin ≥ nγ , we have nπi ≥ c3 max ( ln n , γ∗ s nπi ln n γ∗ ) . (101) Then P Mi < nπi + c3 max ( ln n , γ∗ s nπi ln n γ∗ )! ≤ P (Poi(4nπi ) < 2nπi ) (a) ≤ exp(−nπi /2) (102) ≤ n−c3 /2 , (103) (b) where (a) follows from Lemma 12; (b) follows from πi ≥ πmin ≥ proof. 9.4 c3 ln n nγ ≥ c3 ln n n . This completes the Proof of Lemma 8 The dependence diagram for all random variables is as follows: U R π(R) X0 C where π(R) = (π0 (R), π1 (R), · · · , πS (R)) is the stationary distribution defined in (53) obtained by normalizing the matrix R. Recall that for i = 1, 2, Fi denotes the joint distribution on the sufficient statistic (X0 , C) under the prior µi . Our goal is to show that TV(F1 , F2 ) → 0. Note that X0 and C are dependent; however, the key observation is that, by concentration, the distribution √ of X0 is close to a fixed distribution P0 on the state space {0, 1, · · · , S}, where P0 , S(1+√αS) (S αS, 1, 1, · · · , 1). Thus, X0 and C are approximately independent. For clarity, we denote F1 = PX0 ,C , F2 = QX0 ,C . By the triangle inequality of the total variation distance, we have TV(F1 , F2 ) ≤ TV(PX0 ,C , P0 ⊗ PC ) + TV(P0 ⊗ PC , P0 ⊗ QC ) + TV(QX0 ,C , P0 ⊗ QC ). (104) To upper bound the first term, note that C → R → X0 forms a Markov chain. Hence, by the convexity of total variation distance, we have TV(PX0 ,C , P0 ⊗ PC ) = EPC [TV(PX0 |C , P0 )] (105) ≤ EPR [TV(PX0 |R , P0 )] = E[TV(π(R), P0 )] 1 = 2 E π0 (R) − 1+ 1 √ S X 1 √ + E πi (R) − αS S(1 + αS) i=1 27 ! . (106) P S We start √ by showing that the row sums of R concentrate. Let ri = i=0 Rij = a + a = αS. It follows from the Hoeffding inequality in Lemma 13 that P   PS i=1 Uij ,  √   ri − ( αS + αS) ≥ u, i = 1, . . . , S ≤ 2S exp   2   → 0, d1 S ln S 2 S n  −2u2 where (107) 3/2 provided that u ≫ (S lnnS) . P P Next consider the entrywise sum of R. Write r , 0≤i,j≤S Rij = b + 2aS + 1≤i<j≤S 2Uij + √ P 2 2 1≤i≤S Uii . Note that E[r] = b + 2aS + S α = S(1 + αS) , by (72). Then, it follows from the Hoeffding inequality in Lemma 13 that P  r − S(1 + provided that u ≫  √ √  αS)2 ≥ Su ≤ 2 exp   S 3/2 ln S . n S(S−1) 4 2  −2Su2  d21 S ln S 2 n +S      d21 S ln S 2 n →0 (108) Henceforth, we set (S ln2 S)3/2 . (109) n √ αS + αS)| ≤ u for i = 1, 2, · · · , S and |r − S(1 + Hence, with probability tending to one, |r − ( i √ √ αS)2 | ≤ Su. Conditioning on this event, for i = 1, 2, · · · , S we have √ √ 1 u 2u αS u 1 √ + ≤ 3 + . (110) πi (R) − ≤ ( αS + αS) − r E[r] r S S(1 + αS) S2 u= For i = 0, π0 (R) = √ S(1+ αS) , r we have π0 (R) − √ 1 1 1 2u √ ≤√ . = S(1 + αS) − r E[r] 1 + αS S (111) Therefore, in view of (106), we have TV(PX0 ,C , P0 ⊗ PC ) ≤ S X u 2u 2u √ + 3 + S S i=1 S 2  ! 4u + 2 · o(1) = √ + u + o(1) = o(1) S (112) as S → ∞. Similarly, we also have TV(QX0 ,C , P0 ⊗ QC ) = o(1). By (104), it remains to show that TV(P0 ⊗ PC , P0 ⊗ QC ) = o(1). Note that PC , QC are products of Poisson mixtures, by the triangle inequality of total variation distance again we have   4n 4n TV E[Poi( Uij )], E[Poi( Uij′ )] . TV(P0 ⊗ PC , P0 ⊗ QC ) = TV(PC , QC ) ≤ τ τ 1≤i≤j≤S X (113) We upper bound the individual terms in (113). For the total variation distance between Poisson 4n ′ mixtures, note that the random variables 4n S Uij and S Uij match moments up to order D √ = Dd1 ln S, η 28 (114) and are both supported on [0, αη −1 · that if 4n S ] = [0, d21 S ln S 4n n S ] = [0, 4d21 ln S]. It follows from Lemma 7 Dd1 ln S ≥ 8e2 d21 ln S, (115) we have    4n TV E Poi Uij S where we set d1 = D 8e2    4n ′ , E Poi U S ij  1 ≤ 2Dd1 ln S ≤ S D 2 ln 2 4e2 ≤ 1 . S 100 (116) 1 (117) (118) and used the fact that D ≥ 100. By (113), TV(P0 ⊗ PC , P0 ⊗ QC ) ≤ S 2 · 1 1 = 98 = o(1) S 100 S (119) as S → ∞, establishing the desired lemma. 9.5 Proof of Lemma 9 2 Let ∆ = 8ncS log S = of (73), we have cαS 8 , where c is the constant from Lemma 6. Recall that φ(x) = x log x1 . In view   S S X 1 X H̄(T (R)) =  φ(Rij ) − φ(ri ) r i,j=0 i=0 = S S 1X 1 X 1 φ(Rij ) − φ(ri ) (φ(b) + 2Sφ(a) + φ(b + aS)) + r r i,j=1 r i=0   S X X 1 1X 1 = (φ(b) + 2Sφ(a) + φ(b + aS)) + 2 φ(ri ), φ(Uii ) − φ(Uij ) + r i=0 |r {z } r 1≤i≤S 1≤i<j≤S H1 {z | H2 } | {z H3 } where the last step follows from the symmetry of the matrix U. √ √ For the first term, note that |φ(b)+2Sφ(a)+φ(b+aS)| = |φ(S)+2Sφ( αS)+φ(S(1+ αS))| ≤ 10S log S. Thus, conditioned on (108), we have 1 u 1 − ≤ 3, r E[r] S2 where E[r] = S(1 + √ αS)2 . Put h1 , φ(b)+2Sφ(a)+φ(b+aS) √ , S(1+ αS)2 |H1 − h1 | ≤ with probability tending to one. 29 (120) we have 10u ln S √ . S (121) For the second term, by Definition 4, for any i, j, Uij is supported on [0, is supported on [0, Lemma 13 that  d21 S ln S n ln n ] d21 S ln S d21 S ln S ]. n for any i, j. Hence, it follows from the Hoeffding inequality in  ∆S  P 2 φ(Uij ) + φ(Uii ) − S 2 E[φ(U )] ≥ 4 1≤i<j≤S 1≤i≤S X   ≤ 2 exp  X P 1≤i<j≤S ≤ 2 exp −Ω  2 Thus, φ(Uij ) d21 S ln S n S2 (ln n)2 (ln S)4 −2(∆S/4)2 ln d2 Snln S 1 !! 2 + P 1≤i≤S  d21 S ln S n (122) ln d2 Snln S 1   2  (124) →0 (125) as S → ∞, provided that ln n ≪ 0 ≤ φ(U ) ≤ d21 S ln S n (123) S . ln2 S Put h2 = S √ E[φ(U )]. (1+ αS)2 Using (120) and the fact that ln d2 Snln S , we have 1 3 d2 S 2 ln S n ∆ |H2 − h2 | ≤ u · 1 ln 2 + . n 4 d1 S ln S (126) √ + αS)| ≤ Cu ln S and For the third term, condition on the event in (107), we have |φ(ri ) − φ(αS √ |φ(ri )| ≤ C, for some absolute constant C. Put h3 = (1+√1αS)2 φ(αS + αS). We have Cu |H3 − h3 | ≤ √ + Cu ln S. S (127) Finally, combining (121), (126), (127) as well as (109), with probability tending to one, |H̄(T (R)) − (h1 + h2 − h3 )| ≤ S 3/2 ln4 S ∆ + C′ 4 n (128) for some absolute constant C ′ . Likewise, with probability tending to one, we have |H̄(T (R′ )) − (h1 + h′2 − h3 )| ≤ where h′2 = S √ E[φ(U ′ )]. (1+ αS)2 ∆ S 3/2 ln4 S + C′ 4 n (129) In view of Lemma 6, we have |h2 − h′2 | ≥ cαS √ ≥ 2∆. (1 + αS)2 (130) This completes the proof. 9.6 Proof of Lemma 10 We only consider the random matrix R = (Rij ) which is distributed according to the prior µ1 ; the case of µ2 is entirely analogous. 30 First we lower bound πmin with high probability. Recall the definition of u in (109), and (107), √ 2 (108). Since u ≤ αS = n Sln S , we have S ≤ r ≤ 5S and ri ≥ αS for all i ∈ [S] with probability √ √ tending to one. Furthermore, r0 = S(1 + αS) ≥ αS. Consequently, √ 1 αS 1 min ri ≥ = √ , πmin = r 0≤i≤S 5S 5 n ln S as desired. Next, we deal with the spectral gap. Recall T = T (R) is the normalized version of R given in P P (54). Let D = diag(r0 , . . . , rS ) and Dπ = diag(π0 , . . . , πS ), where ri = Sj=0 Rij , r = Si,j=0 Rij , and πi = rri . Then we have T = D −1 R. Furthermore, by the reversiblity of T , T ′ , Dπ1/2 T Dπ−1/2 = D−1/2 RD −1/2 , (131) is a symmetric matrix. Since T ′ is a similarity transform of T , they share the same spectrum. Let 1 = λ1 (T ) ≥ . . . ≥ λS+1 (T ) (recall that T is an (S + 1) × (S + 1) matrix). In view of (71), we have     L , E[R] =    √ b a .. . a···a   α···α   , ..  .  a α···α    Z , R − E[R] =    0 0···0 0 .. . U − E[U] 0       Crucially, the choice of a = αS, b = S in (72) is such that bα = a2 , so that E[R] is a symmetric positive semidefinite rank-one matrix. Thus, we have from (131) T ′ = D −1/2 LD−1/2 + D −1/2 ZD−1/2 . Note that L′ , D−1/2 LD−1/2 is also a symmetric positive semidefinite rank-one matrix. Let λ1 (L′ ) ≥ 0 = λ2 (L′ ) = · · · = λS+1 (L′ ). By Weyl’s inequality [Tao12, Eq. (1.64)], for i = 2, . . . , S +1, we have 1 |λi (T )| ≤ kD −1/2 ZD−1/2 k2 ≤ kD −1/2 k22 kZk2 = kU − E[U]k2 . (132) min0≤i≤S ri Here and below k · k2 stands for the spectral norm (largest singular values). So far everything hasqbeen determinimistic. Next we show that with high probability, the RHS of (132) is at most Ω( S ln3 S n ). Note that U − E[U] is a zero-mean Wigner matrix. Furthermore, Uij takes values in [0, αη −1 ] = d2 S ln S [0, 1 n ], where d1 is an absolute constant. It follows from the standard tail estimate of the spectral norm for the Wigner ensemble (see, e.g. [Tao12, Corollary 2.3.6]) that there exist universal constants C, c, c′ > 0 such that P CS 3/2 ln S kU − E[U]k2 > n ! ≤ c′ e−cS . (133) Combining (107), (132), and (133), the absolute spectral gap of T = T (R) satisfies  P γ ∗ (T (R)) ≥ 1 − C s  S ln3 S  → 1, n as S → ∞. By union bound, we have shown that P (R ∈ R (S, γ, τ, q)) → 1, with γ, τ, q as chosen in Lemma 10. 31 9.7 Proof of Lemma 11 The representation (85) follows from definition of conditional entropy. It remains to show (86). Let P̂ denote the transition matrix corresponding to the empirical conditional distribution, that is, P̂ij , P̂X2 =j|X1 =i . Then, for any transition matrix P = (Pij ), n X S X S 1 1 1 1 X 1(xm−1 = i, xm = j) ln ln = n n PX1n |X0 (x1 |x0 ) n m=1 i=1 j=1 Pij = = S X S 1X 1 (nπ̂i P̂ij ) ln n i=1 j=1 Pij S X i=1 π̂i S X P̂ij ln j=1 = H̄emp + S X i=1 P 1 Pij π̂i D(P̂i· kPi· ), where in the last step D(pkq) = i pi ln pqii ≥ 0 stands for the Kullback–Leibler (KL) divergence between probability vectors p and q. Then (86) follows from the fact that the nonnegativity of the KL divergence. References [ADOS17] Jayadev Acharya, Hirakendu Das, Alon Orlitsky, and Ananda Theertha Suresh. A unified maximum likelihood approach for estimating symmetric properties of discrete distributions. In International Conference on Machine Learning, pages 11–21, 2017. [AK01] András Antos and Ioannis Kontoyiannis. Convergence properties of functional estimates for discrete distributions. Random Structures & Algorithms, 19(3-4):163–193, 2001. [BCC10] Charles Bordenave, Pietro Caputo, and Djalil Chafai. Spectrum of large random reversible Markov chains: two examples. ALEA: Latin American Journal of Probability and Mathematical Statistics, 7:41–64, 2010. [Bil61] Patrick Billingsley. Statistical methods in Markov chains. The Annals of Mathematical Statistics, pages 12–40, 1961. [BPM+ 92] Peter F. Brown, Vincent J. Della Pietra, Robert L. Mercer, Stephen A. Della Pietra, and Jennifer C. Lai. An estimate of an upper bound for the entropy of english. Comput. Linguist., 18(1):31–40, March 1992. [CBL06] Nicolo Cesa-Bianchi and Gabor Lugosi. Prediction, learning, and games. Cambridge University Press, 2006. [CG05] Gabriela Ciuperca and Valerie Girardin. On the estimation of the entropy rate of finite Markov chains. In Proceedings of the International Symposium on Applied Stochastic Models and Data Analysis, 2005. [CK78] Thomas Cover and Roger King. A convergent gambling estimate of the entropy of English. IEEE Transactions on Information Theory, 24(4):413–421, 1978. 32 [CKV04] Haixiao Cai, Sanjeev R. Kulkarni, and Sergio Verdú. Universal entropy estimation via block sorting. IEEE Trans. Inf. Theory, 50(7):1551–1561, 2004. [CT06] Thomas M. Cover and Joy A. Thomas. Elements of Information Theory. Wiley, New York, second edition, 2006. [EVKV02] Michelle Effros, Karthik Visweswariah, Sanjeev R Kulkarni, and Sergio Verdú. Universal lossless source coding with the Burrows Wheeler transform. IEEE Transactions on Information Theory, 48(5):1061–1081, 2002. [FOPS16] Moein Falahatgar, Alon Orlitsky, Venkatadheeraj Pichapati, and Ananda Theertha Suresh. Learning markov distributions: Does estimation trump compression? In Information Theory (ISIT), 2016 IEEE International Symposium on, pages 2689– 2693. IEEE, 2016. [GG16] Yarin Gal and Zoubin Ghahramani. A theoretically grounded application of dropout in recurrent neural networks. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 1019–1027. Curran Associates, Inc., 2016. [HJWW17] Yanjun Han, Jiantao Jiao, Tsachy Weissman, and Yihong Wu. Optimal rates of entropy estimation over lipschitz balls. arxiv preprint arxiv:1711.02141, Nov 2017. [HKS15] Daniel J Hsu, Aryeh Kontorovich, and Csaba Szepesvári. Mixing time estimation in reversible Markov chains from a single sample path. In Advances in neural information processing systems, pages 1459–1467, 2015. [Hoe63] Wassily Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American statistical association, 58(301):13–30, 1963. [Jia09] Qian Jiang. Construction of transition matrices of reversible Markov chains. M. Sc. Major Paper. Department of Mathematics and Statistics. University of Windsor, 2009. [JM09] Daniel Jurafsky and James H. Martin. Speech and Language Processing (2Nd Edition). Prentice-Hall, Inc., Upper Saddle River, NJ, USA, 2009. [JPZ+ 13] Jiantao Jiao, H.H. Permuter, Lei Zhao, Young-Han Kim, and T. Weissman. Universal estimation of directed information. Information Theory, IEEE Transactions on, 59(10):6220–6242, 2013. [JVHW15] Jiantao Jiao, Kartik Venkat, Yanjun Han, and Tsachy Weissman. Minimax estimation of functionals of discrete distributions. Information Theory, IEEE Transactions on, 61(5):2835–2885, 2015. [JVHW17] Jiantao Jiao, Kartik Venkat, Yanjun Han, and Tsachy Weissman. Maximum likelihood estimation of functionals of discrete distributions. IEEE Transactions on Information Theory, 63(10):6774–6798, Oct 2017. [JVS+ 16] Rafal Józefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. CoRR, abs/1602.02410, 2016. [KASW98] Ioannis Kontoyiannis, Paul H Algoet, Yu M Suhov, and AJ Wyner. Nonparametric entropy estimation for stationary processes and random fields, with applications to English text. Information Theory, IEEE Transactions on, 44(3):1319–1327, 1998. 33 [KG17] Oleksii Kuchaiev and Boris Ginsburg. Factorization tricks for LSTM networks. CoRR, abs/1703.10722, 2017. [Kie91] John C Kieffer. Sample converses in source coding theory. IEEE Transactions on Information Theory, 37(2):263–268, 1991. [KLMCP13] Coco Krumme, Alejandro Llorente, Alex Manuel Cebrian, and Esteban Moro Pentland. The predictability of consumer visitation patterns. Scientific reports, 3, 2013. [KV16] Sudeep Kamath and Sergio Verdú. Estimation of entropy rate and Rényi entropy rate for Markov chains. In Information Theory (ISIT), 2016 IEEE International Symposium on, pages 685–689. IEEE, 2016. [LLY00] J Kevin Lanctot, Ming Li, and En-hui Yang. Estimating DNA sequence entropy. In Symposium on discrete algorithms: proceedings of the eleventh annual ACM-SIAM symposium on discrete algorithms, volume 9, pages 409–418, 2000. [LP16] David A Levin and Yuval Peres. Estimating the spectral gap of a reversible markov chain from a short trajectory. arXiv preprint arXiv:1612.05330, 2016. [MT06] Ravi Montenegro and Prasad Tetali. Mathematical aspects of mixing times in Markov chains. Foundations and Trends R in Theoretical Computer Science, 1(3):237–354, 2006. [MU05] Michael Mitzenmacher and Eli Upfal. Probability and computing: Randomized algorithms and probabilistic analysis. Cambridge University Press, 2005. [MXBS16] Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. CoRR, abs/1609.07843, 2016. [Pan03] Liam Paninski. Estimation of entropy and mutual information. Neural Computation, 15(6):1191–1253, 2003. [Pan04] Liam Paninski. Estimating entropy on m bins given fewer than m samples. Information Theory, IEEE Transactions on, 50(9):2200–2203, 2004. [Pau15] Daniel Paulin. Concentration inequalities for markov chains by marton couplings and spectral methods. Electronic Journal of Probability, 20, 2015. [Sha51] Claude E. Shannon. Prediction and entropy of printed English. The Bell System Technical Journal, 30(1):50–64, Jan 1951. [Shi96] Paul C Shields. The ergodic theory of discrete sample paths. Graduate Studies in Mathematics, American Mathematics Society, 1996. [SMM+ 17] Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc V. Le, Geoffrey E. Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. CoRR, abs/1701.06538, 2017. [SQBB10] Chaoming Song, Zehui Qu, Nicholas Blumm, and Albert-László Barabási. Limits of predictability in human mobility. Science, 327(5968):1018–1021, 2010. [Tao12] Terence Tao. Topics in random matrix theory, volume 132. American Mathematical Society Providence, RI, 2012. 34 [TNS+ 11] Taro Takaguchi, Mitsuhiro Nakamura, Nobuo Sato, Kazuo Yano, and Naoki Masuda. Predictability of conversation partners. Physical Review X, 1(1):011008, 2011. [Tsy08] A. Tsybakov. Introduction to Nonparametric Estimation. Springer-Verlag, 2008. [VV11a] Gregory Valiant and Paul Valiant. Estimating the unseen: an n/ log n-sample estimator for entropy and support size, shown optimal via new CLTs. In Proceedings of the 43rd annual ACM symposium on Theory of computing, pages 685–694. ACM, 2011. [VV11b] Gregory Valiant and Paul Valiant. The power of linear estimators. In Foundations of Computer Science (FOCS), 2011 IEEE 52nd Annual Symposium on, pages 403–412. IEEE, 2011. [VV13] Paul Valiant and Gregory Valiant. Estimating the unseen: improved estimators for entropy and other properties. In Advances in Neural Information Processing Systems, pages 2157–2165, 2013. [WH12] Chunyan Wang and Bernardo A Huberman. How random are online social interactions? Scientific reports, 2, 2012. [WY16] Yihong Wu and Pengkun Yang. Minimax rates of entropy estimation on large alphabets via best polynomial approximation. IEEE Transactions on Information Theory, 62(6):3702–3720, 2016. [WZ89] Aaron D. Wyner and Jacob Ziv. Some asymptotic properties of the entropy of a stationary ergodic data source with applications to data compression. IEEE Trans. Inf. Theory, 35(6):1250–1258, 1989. [XWL+ 17] Ziang Xie, Sida I. Wang, Jiwei Li, Daniel Lévy, Aiming Nie, Dan Jurafsky, and Andrew Y. Ng. Data noising as smoothing in neural network language models. CoRR, abs/1703.02573, 2017. [ZL78] Jacob Ziv and Abraham Lempel. Compression of individual sequences via variablerate coding. Information Theory, IEEE Transactions on, 24(5):530–536, 1978. [ZL16] Barret Zoph and Quoc V. Le. Neural architecture search with reinforcement learning. CoRR, abs/1611.01578, 2016. [ZSKS16] Julian G. Zilly, Rupesh Kumar Srivastava, Jan Koutník, and Jürgen Schmidhuber. Recurrent highway networks. CoRR, abs/1607.03474, 2016. 35
10math.ST
arXiv:cs/0111051v1 [cs.CE] 20 Nov 2001 Predicting RNA Secondary Structures with Arbitrary Pseudoknots by Maximizing the Number of Stacking Pairs Samuel Ieong∗ Ming-Yang Kao† Tak-Wah Lam‡ Wing-Kin Sung§ Siu-Ming Yiu‡ Abstract The paper investigates the computational problem of predicting RNA secondary structures. The general belief is that allowing pseudoknots makes the problem hard. Existing polynomial-time algorithms are heuristic algorithms with no performance guarantee and can only handle limited types of pseudoknots. In this paper we initiate the study of predicting RNA secondary structures with a maximum number of stacking pairs while allowing arbitrary pseudoknots. We obtain two approximation algorithms with worst-case approximation ratios of 1/2 and 1/3 for planar and general secondary structures, respectively. For an RNA sequence of n bases, the approximation algorithm for planar secondary structures runs in O(n3 ) time while that for the general case runs in linear time. Furthermore, we prove that allowing pseudoknots makes it NP-hard to maximize the number of stacking pairs in a planar secondary structure. This result is in contrast with the recent NP-hard results on psuedoknots which are based on optimizing some general and complicated energy functions. 1 Introduction Ribonucleic acids (RNAs) are molecules that are responsible for regulating many genetic and metabolic activities in cells. An RNA is single-stranded and can be considered as a sequence of nucleotides (also known as bases). There are four basic nucleotides, namely, Adenine (A), Cytosine (C), Guanine (G), and Uracil (U). An RNA folds into a 3-dimensional structure by forming pairs of bases. Paired bases tend to stabilize the RNA (i.e., have negative free energy). Yet base pairing does not occur arbitrarily. In particular, A-U and C-G form stable pairs and are known as the Watson-Crick base pairs. Other base pairings are less stable and often ignored. An example of a folded RNA is shown in Figure 1. Note that this figure is just schematic; in practice, RNAs are 3-dimensional molecules. ∗ Department of Computer Science, Yale University, New Haven, CT 06520. Department of Computer Science, Northwestern University, Evanston, IL 60201 (kao@cs.northwestern.edu). This research was supported in part by NSF Grant EIA-0112934. ‡ Department of Computer Science, The University of Hong Kong, Hong Kong ({twlam, smyiu}@cs.hku.hk). This research was supported in part by Hong Kong RGC grant HKU-7027/98E. § Department of Computer Science, National University of Singapore, 3 Science Drive 2, Singapore 117543 (ksung@comp.nus.edu.sg). † 1 C C C A A G C A A G A U U A A A U G A U G G A A U A U Stacking Pair U C G G Hairpin Loop U U G A A Internal Loop C C A G C G U Bulge Multi-branched Loop Figure 1: Example of a folded RNA The 3-dimensional structure is related to the function of the RNA. Yet existing experimental techniques for determining the 3-dimensional structures of RNAs are often very costly and time consuming (see, e.g., [6]). The secondary structure of an RNA is the set of base pairings formed in its 3-dimensional structure. To determine the 3-dimensional structure of a given RNA sequence, it is useful to determine the corresponding secondary structure. As a result, it is important to design efficient algorithms to predict the secondary structure with computers. From a computational viewpoint, the challenge of the RNA secondary structure prediction problem arises from some special structures called pseudoknots, which are defined as follows. Let S be an RNA sequence s1 , s2 , · · · , sn . A pseudoknot is composed of two interleaving base pairs, i.e., (si , sj ) and (sk , sℓ ) such that i < k < j < ℓ. See Figure 2 for examples. If we assume that the secondary structure of an RNA contains no pseudoknots, the secondary structure can be decomposed into a few types of loops: stacking pairs, hairpins, bulges, internal loops, and multiple loops (see, e.g., Tompa’s lecture notes [9] or Waterman’s book [11]). A stacking pair is a loop formed by two pairs of consecutive bases (si , sj ) and (si+1 , sj−1 ) with i + 4 ≤ j. See Figure 1 for an example. By definition, a stacking pair contains no unpaired bases and any other kinds of loops contain one or more unpaired bases. Since unpaired bases are destabilizing and have positive free energy, stacking pairs are the only type of loops that have negative free energy and stabilize the secondary structure. It is also natural to assume that the free energies of loops are independent. Then an optimal pseudoknot-free secondary structure can be computed using dynamic programming in O(n3 ) time [3, 5, 12, 13]. However, pseudoknots are known to exist in some RNAs. For predicting secondary structures with pseudoknots, Nussinov et al. [7] have studied the case where the energy function is minimized when the number of base pairs is maximized and have obtained an O(n3 )-time algorithm for predicting secondary structures. Based on some special energy functions, Lyngso and Pedersen [4] have proven that determining the optimal secondary 2 G G G A C A A C C U U U U G A A G C G C A C U G C G C C A C C A C A A A G G G A A G C A Figure 2: Examples of pseudoknots structure possibly with pseudoknots is NP-hard. Akutsu [1] has shown that it is NP-hard to determine an optimal planar secondary structure, where a secondary structure is planar if the graph formed by the base pairings and the backbone connections of adjacent bases is planar (see Section 2 for a more detailed definition). Rivas and Eddy [8], Uemura et al. [10], and Akutsu [1] have also proposed polynomial-time algorithms that can handle limited types of pseudoknots; note that the exact types of such pseudoknots are implicit in these algorithms and difficult to determine. Although it might be desirable to have a better classification of pseudoknots and better algorithms that can handle a wider class of pseudoknots, this paper approaches the problem in a different general direction. We initiate the study of predicting RNA secondary structures that allow arbitrary pseudoknots while maximizing the number of stacking pairs. Such a simple energy function is meaningful as stacking pairs are the only loops that stabilize secondary structures. We obtain two approximation algorithms with worst-case ratios of 1/2 and 1/3 for planar and general secondary structures, respectively. The planar approximation algorithm makes use of a geometric observation that allows us to visualize the planarity of stacking pairs on a rectangular grid; interestingly, such an observation does not hold if our aim is to maximize the number of base pairs. This algorithm runs in O(n3 ) time. The second approximation algorithm is more complicated and is based on a combination of multiple “greedy” strategies. A straightforward analysis cannot lead to the approximation ratio of 1/3. We make use of amortization over different steps to obtain the desired ratio. This algorithm runs in O(n) time. To complement these two algorithms, we also prove that allowing pseudoknots makes it NP-hard to find the planar secondary structure with the largest number of stacking pairs. The proof makes use of a reduction from a well-known NP-complete problem called Tripartite Matching [2]. This result indicates that the hardness of the RNA secondary structure prediction problem may be inherent in the pseudoknot structures and may not be necessarily due to the complication of the energy functions. This is in contrast to the other NP-hardness results discussed earlier. The rest of this paper is organized into four sections. Section 2 discusses some basic properties. Sections 3 and 4 present the approximation algorithms for planar and general secondary structures, respectively. Section 5 details the NP-hardness result. Section 6 concludes the paper with open problems. 3 2 Preliminaries Let S = s1 s2 · · · sn be an RNA sequence of n bases. A secondary structure P of S is a set of Watson-Crick pairs (si1 , sj1 ), . . . , (sip , sjp ), where sir + 2 ≤ sjr for all r = 1, . . . , p and no two pairs share a base. We denote q (q ≥ 1) consecutive stacking pairs (si , sj ), (si+1 , sj−1 ); (si+1 , sj−1 ), (si+2 , sj−2 ) . . . (si+q−1 , sj−q+1 ), (si+q , sj−q ) of P by (si , si+1 , . . . , si+q ; sj−q , . . . , sj−1 , sj ). Definition 1 Given a secondary structure P, we define an undirected graph G(P) such that the bases of S are the nodes of G(P) and (si , sj ) is an edge of G(P) if j = i + 1 or (si , sj ) is a base pair in P. Definition 2 A secondary structure P is planar if G(P) is a planar graph. Definition 3 A secondary structure P is said to contain an interleaving block if P contains three stacking pairs (si , si+1 ; sj−1 , sj ), (si′ , si′ +1 ; sj ′ −1 , sj ′ ), (si′′ , si′′ +1 ; sj ′′ −1 , sj ′′ ) where i < i′ < i′′ < j < j ′ < j ′′ . Lemma 2.1 If a secondary structure P contains an interleaving block, P is non-planar. Proof. Suppose P contains an interleaving block. Without loss of generality, we assume that P contains the stacking pairs (s1 , s2 ; s7 , s8 ), (s3 , s4 ; s9 , s10 ), and (s5 , s6 ; s11 , s12 ). Figure 3(a) shows the subgraph of G(P) corresponding to these stacking pairs. Since this subgraph contains a homeomorphic copy of K3,3 (see Figure 3(b)), G(P) and P are non-planar. s3 s4 s2 s3 s1 s4 s5 s6 s9 s7 s2 s10 s11 s12 s1 s8 s6 s5 s7 s8 s12 s11 (a) s9 s10 (b) Figure 3: Interleaving block 4 3 An Approximation Algorithm for Planar Secondary Structures We present an algorithm which, given an RNA sequence S = s1 s2 . . . sn , constructs a planar secondary structure of S to approximate one with the maximum number of stacking pairs with a ratio of at least 1/2. This approximation algorithm is based on the subtle observation in Lemma 3.1 that if a secondary structure P is planar, the subgraph of G(P) which contains only the stacking pairs of P can be embedded in a grid with a useful property. This property enables us to consider only the secondary structure of S without pseudoknots in order to achieve 1/2 approximation ratio. Definition 4 Given a secondary structure P, we define a stacking pair embedding of P on a grid as follows. Represent the bases of S as n consecutive grid points on the same horizontal grid line L such that si and si+1 (1 ≤ i < n) are connected directly by a horizontal grid edge. If (si , si+1 ; sj−1 , sj ) is a stacking pair of P, si and si+1 are connected to sj and sj−1 respectively by a sequence of grid edges such that the two sequences must be either both above or both below L. Figure 4 shows a stacking pair embedding (Figure 4(b)) of a given secondary structure (Figure 4(a)). Note that (s3 , s9 ) do not form a stacking pair with other base pair, so s3 is not connected to s9 in the stacking pair embedding. Similarly, s4 is not connected to s10 in the embedding. s3 s1 s4 s5 s9 s6 s7 s2 s10 s11 s12 s3 s8 s1 s4 s5 s9 s10 s6 s7 s2 s8 s11 s12 (b) (a) Figure 4: An example of a stacking pair embedding Definition 5 A stacking pair embedding is said to be planar if it can be drawn in such a way that no lines cross or overlap with each other in the grid. The embedding shown in Figure 4(b) is planar. Lemma 3.1 Let P be a secondary structure of an RNA sequence S. Let E be a stacking pair embedding of P. If P is planar, then E must be planar. 5 Proof. If P does not have a planar stacking pair embedding, we claim that P contains an interleaving block. Let L be the horizontal grid line that contains the bases of S in E. Since P does not have a planar stacking pair embedding, we can assume that E has two stacking pairs intersect above L (see Figure 5(a)). (a) (d) (g) (b) (c) (e) (f) (h) (i) Figure 5: Non-planar stacking pair embedding If there is no other stacking pair underneath these two pairs, we can flip one of the pairs below L as shown in Figure 5(b). So, there must be at least one stacking pair underneath these two pairs. By checking all possible cases (all non-symmetric cases are shown in Figures 5(c) to (i)), it can be shown that E cannot be redrawn without crossing or overlapping lines only if it contains an interleaving block (Figures 5(h) and (i)). So, by Lemma 2.1, P is non-planar. By Lemma 3.1, we can relate two secondary structures having the maximum number of stacking pairs with and without pseudoknots in the following lemma. Lemma 3.2 Given an RNA sequence S, let N ∗ be the maximum number of stacking pairs that can be formed by a planar secondary structure of S and let W be the maximum number ∗ of stacking pairs that can be formed by S without pseudoknots. Then, W ≥ N2 . Proof. Let P ∗ be a planar secondary structure of S with N ∗ stacking pairs. Since P ∗ is planar, by Lemma 3.1, any stacking pair embedding of P ∗ is planar. Let E be a stacking pair embedding of P ∗ such that no lines cross each other in the grid. Let L be the horizontal grid line of E which contains all bases of S. Let n1 and n2 be the number of stacking pairs which are drawn above and below L, respectively. Without loss of generality, assume that n1 ≥ n2 . Now, we construct another planar secondary structure P from E by deleting all stacking pairs which are drawn below L. Obviously, P is a planar ∗ secondary structure of S without pseudoknots. Since n1 ≥ n2 , n1 ≥ N2 . As W ≥ n1 , ∗ W ≥ N2 . 6 Based on Lemma 3.2, we now present the dynamic programming algorithm M axSP which computes the maximium number of stacking pairs that can be formed by an RNA sequence S = s1 s2 . . . sn without pseudoknots. Algorithm M axSP Define V (i, j) (for j ≥ i) as the maximum number of stacking pairs without pseudoknots that can be formed by si . . . sj if si and sj form a Watson-Crick pair. Let W (i, j) (j ≥ i) be the maximum number of stacking pairs without pseudoknots that can be formed by si . . . sj . Obviously, W (1, n) gives the maximum number of stacking pairs that can be formed by S without pseudoknots. Basis: For j = i, i + 1, i + 2 or i + 3 (j ≤ n), V (i, j) = 0 W (i, j) = 0. if si , sj form a Watson-Crick pair; Recurrence: For j > i + 3,    V (i, j) W (i, j) = max W (i + 1, j)   W (i, j − 1) V (i, j) = max (  if si , sj form a Watson-Crick pair     ; V (i + 1, j − 1) + 1 if si+1 , sj−1 form a Watson-Crick pair maxi+1≤k≤j−2 {W (i + 1, k) + W (k + 1, j − 1)} ) . Lemma 3.3 Given an RNA sequence S of length n, Algorithm M axSP computes the maximum number of stacking pairs that can be formed by S without pseudoknots in O(n3 ) time and O(n2 ) space. Proof. There are O(n2 ) entries V (i, j) and W (i, j) to be filled. To fill an entry of V (i, j), we check at most O(n) values. To fill an entry of W (i, j), O(1) time suffices. The total time complexity for filling all entries is O(n3 ). Storing all entries requires O(n2 ) space. Although Algorithm M axSP presented in the above only computes the number of stacking pairs, it can be easily modified to compute the secondary structure. Thus we have the following theorem. Theorem 3.4 The Algorithm M axSP is an (1/2)-approximation algorithm for the problem of constructing a secondary structure which maximizes the number of stacking pairs for an RNA sequence S. 7 4 An Approximation Algorithm for General Secondary Structures We present Algorithm GreedySP () which, given an RNA sequence S = s1 s2 . . . sn , constructs a secondary structure of S (not necessarily planar) with at least 1/3 of the maximum possible number of stacking pairs. The approximation algorithm uses a greedy approach. Figure 6 shows the algorithm GreedySP (). // Let S = s1 s2 . . . sn be the input RNA sequence. Initially, all sj are unmarked. // Let E be the set of base pairs output by the algorithm. Initially, E = ∅. GreedySP (S, i) // i ≥ 3 1. Repeatedly find the leftmost i consecutive stacking pairs SP (i.e., find (sp , . . . , sp+i ; sq−i , . . . , sq ) such that p is as small as possible) formed by unmarked bases. Add SP to E and mark all these bases. 2. For k = i − 1 downto 2, Repeatedly find any k consecutive stacking pairs SP formed by unmarked bases. Add SP to E and mark all these bases. 3. Repeatedly find the leftmost stacking pair SP formed by unmarked bases. Add SP to E and mark all these bases. Figure 6: A 1/3-Approximation Algorithm In the following, we analyze the approximation ratio of this algorithm. The algorithm GreedySP (S, i) will generate a sequence of SP ’s denoted by SP1 , SP2 , . . . , SPh . Fact 4.1 For any SPj and SPk (j 6= k), the stacking pairs in SPj do not share any base with those in SPk . For each SPj = (sp , . . . , sp+t ; sq−t , . . . , sq ), we define two intervals of indexes, Ij and Jj , as [p..p + t] and [q − t..q], respectively. In order to compare the number of stacking pairs formed with that in the optimal case, we have the following definition. Definition 6 Let P be an optimal secondary structure of S with the maximum number of stacking pairs. Let F be the set of all stacking pairs of P. For each SPj computed by GreedySP (S, i) and β = Ij or Jj , let Xβ = {(sk , sk+1 ; sw−1 , sw ) ∈ F| at least one of indexes k, k + 1, w − 1, w is in β}. Note that Xβ ’s may not be disjoint. Lemma 4.2 S 1≤j≤h {XIj ∪ XJj } = F. Proof. We prove this lemma by contradiction. Suppose that there exists a stacking pair (sk , sk+1 ; sw−1 , sw ) in F but not in any of XIj and XJj . By Definition 6, none of the 8 indexes, k, k + 1, w − 1, w is in any of Ij and Jj . This contradicts with Step 3 of Algorithm GreedySP (S, i). Definition 7 For each XIj , [ [ let XI′ j = XIj − {XIk ∪ XJk }, and let XJ′ j = XJj − {XIk ∪ XJk } − XIj k<j k<j Let |SPj | be the number of stacking pairs represented by SPj . Let |Ij | and |Jj | be the numbers of indexes in the intervals Ij and Jj , respectively. Lemma 4.3 Let N be the number of stacking pairs computed by Algorithm GreedySP (S, i) and N ∗ be the maximum number of stacking pairs that can be formed by S. If for all j, we have |SPj | ≥ 1r × |(XI′ j ∪ XJ′ j )|, then N ≥ 1r × N ∗ . S S Proof. By Definition 7, k {XIk ∪ XJk } = k {XI′ k ∪ XJ′ k }. Then by Fact 4.1, N = P S 1 1 ∗ j |SPj |. Thus, N ≥ r × | k {XIk ∪ XJk }|. By Lemma 4.2, N ≥ r × N . Lemma 4.4 For each SPj computed by GreedySP (S, i), we have |SPj | ≥ 13 ×|(XI′ j ∪XJ′ j )|. Proof. There are three cases as follows. Case 1: SPj is computed by GreedySP (S, i) in Step 1. Note that SPj = (sp , . . . , sp+i ; sq−i , . . . , sq ) is the leftmost i consecutive stacking pairs, i.e., p is the smallest possible. By definition, |XI′ j |, |XJ′ j | ≤ i+2. We further claim that |XI′ j | ≤ i+1. Then |SPj |/|XI′ j ∪XJ′ j | ≥ i/((i + 1) + (i + 2)) ≥ 1/3 (as i ≥ 3). We prove the claim by contradiction. Assume that |XI′ j | = i + 2. That is, for some integer t, F has i+2 consecutive stacking pairs (sp−1 , . . . , sp+i+1 ; st−i−1 , . . . , st+1 ). Furthermore, none of the bases sp−1 , . . . , sp+i+1 , st−i−1 , . . . , st+1 are marked before SPj is chosen; otherwise, suppose one such base, says sa , is marked when the algorithm chooses SPℓ for ℓ < j, then an stacking pair adjacent to sa does not belong to XI′ j and they belong to XI′ ℓ or XJ′ ℓ instead. Therefore, (sp−1 , . . . , sp+i−1 ; st−i+1 , . . . , st+1 ) is the leftmost i consecutive stacking pairs formed by unmarked bases before SPj is chosen. As SPj is not the leftmost i consecutive stacking pairs, this contradicts the selection criteria of SPj . The claim follows. Case 2: SPj is computed by GreedySP (S, i) in Step 2. Let |SPj | = k ≥ 2. Let SPj = (sp , . . . , sp+k ; sq−k , . . . , sq ). By definition, |XI′ j |, |XJ′ j | ≤ k + 2. We claim that |XI′ j |, |XJ′ j | ≤ k + 1. Then |SPj |/|XI′ j ∪ XJ′ j | ≥ k/((k + 1) + (k + 1)), which is at least 1/3 as k ≥ 2. To show that |XI′ j | ≤ k + 1 by contradiction, assume |XI′ j | = k + 2. Thus, for some integer t, there exist k + 2 consecutive stacking pairs (sp−1 , . . . , sp+k+1 ; st−k−1 , . . . , st+1 ). Similarly to case 1, we can show that none of the bases sp−1 , . . . , sp+k+1 , st−k−1 , . . . , st+1 are marked before SPj is chosen. Thus, GreedySP (S, i) should select some k + 1 or k + 2 consecutive stacking pairs instead of the chosen k consecutive stacking pairs, reaching a contradiction. Similarly, we can show |XJ′ j | ≤ k + 1. Case 3: SPj is computed by GreedySP (S, i) in Step 3. SPj is the leftmost stacking pair when it is chosen. Let SPj = (sp , sp+1 ; sq−1 , sq ). By the same approach as in Case 2, we can show |XI′ j |, |XJ′ j | ≤ 2. We further claim |XI′ j | ≤ 1. Then |SPj |/|XI′ j ∪XJ′ j | ≥ 1/(1+2) = 1/3. 9 To verify |XI′ j | ≤ 1, we consider all possible cases with |XI′ j | = 2 while there are no two consecutive stacking pairs. The only possible case is that for some integers r, t, both (sp−1 , sp ; sr−1 , sr ) and (sp , sp+1 ; st−1 , st ) belong to XI′ j . Then, SPj cannot be the leftmost stacking pair formed by unmarked bases, contradicting the selection criteria of SPj . Theorem 4.5 Let S be an RNA sequence. Let N ∗ be the maximum number of stacking pairs that can be formed by any secondary structure of S. Let N be the number of stacking ∗ pairs output by GreedySP (S, i). Then, N ≥ N3 . Proof. By Lemmas 4.3 and 4.4, the result follows. We remark that by setting i = 3 in GreedySP (S, i), we can already achieve the approximation ratio of 1/3. The following theorem gives the time and space complexity of the algorithm. Theorem 4.6 Given an RNA sequence S of length n and a constant k, Algorithm GreedySP (S, k) can be implemented in O(n) time and O(n) space. Proof. Recall that the bases of an RNA sequence are chosen from the alphabet {A, U, G, C}. If k is a constant, there are only constant number of different patterns of consecutive stacking pairs that we must consider. For any 1 ≤ j ≤ k, there are only 4j different strings that can be formed by the four characters {A, U, G, C}. So, the locations of the occurrences of these possible strings in the RNA sequence can be recorded in an array of linked lists indexed by the pattern of the string using O(n) time preprocessing. There are at most 4j linked lists for any fixed j and there are at most n entries in these linked lists. In total, there are at most kn entries in all linked lists for all possible values of j. Now, we fix a constant j. To locate all j consecutive stacking pairs, we scan the RNA sequence from left to right. For each substring of j consecutive characters, we look up the array to see whether we can form j consecutive stacking pairs. By simple bookkeeping, we can keep track which bases have been used already. Each entry in the linked lists will only be scanned at most once, so the whole procedure takes only O(n) time. Since k is a constant, we can repeat the whole procedure for k different values of j, and the total time complexity is still O(n) time. 5 NP-completeness In this section, we show that it is NP-hard to find a planar secondary structure with the largest number of stacking pairs. We consider the following decision problem. Given an RNA sequence S and an integer h, we wish to determine whether the largest possible number of stacking pairs in a planar secondary structure of S, denoted sp(S), is at least h. Below we show that this decision problem is NP-complete by reducing the tripartite matching problem [2] to it, which is defined as follows. Given three node sets X, Y , and Z with the same cardinality n and an edge set E ⊆ X × Y × Z of size m, the tripartite matching problem is to determine whether E contains 10 a perfect matching, i.e., a set of n edges which touches every node of X, Y , and Z exactly once. The remainder of this section is organized as follows. Section 5.1 shows how we construct in polynomial time an RNA sequence SE and an integer h from a given instance (X, Y, Z, E) of the tripartite matching problem, where h depends on n and m. Section 5.2 shows that if E contains a perfect matching, then sp(SE ) ≥ h. Section 5.3 is the non-trivial part, showing that if E does not contain a perfect matching, then sp(SE ) < h. Combining these three sections, we can conclude that it is NP-hard to maximize the number of stacking pairs for planar RNA secondary structures. 5.1 Construction of the RNA sequence SE Consider any instance (X, Y, Z, E) of the tripartite matching problem. We construct an RNA sequence SE and an integer h as follows. Let X = {x1 , · · · , xn }, Y = {y1 , · · · , yn }, and Z = {z1 , · · · , zn }. Furthermore, let E = {e1 , e2 , · · · , em }, where each edge ej = (xpj , yqj , zrj ). Recall that an RNA sequence contains characters chosen from the alphabet {A, U, G, C}. Below we denote Ai , where i is any positive integer, as the sequence of i A’s. Furthermore, A+ means a sequence of one or more A’s. Let d = max{6n, 4(m + 1)} + 1. Define the following four RNA sequences for every positive integer k < d. • δ(k) is the sequence U d Ak GU d Ad−k , and δ(k) is the sequence U d−k Ad GU k Ad . • π(k) is the sequence C 2d+2k AGC 4d−2k , and π(k) is the sequence G4d−2k AG2d+2k . Fragments: Note that the sequences δ(k) and δ(k) are each composed of two substrings in the form of U + A+ , separated by a character G. Each of these two substrings is called a fragment. Similarly, the two substrings of the form C + separated by AG in π(k) and the two substrings of the form G+ separated by the character A in π(k) are also called fragments. Node Encoding: Each node in the three node sets X, Y , and Z is associated with a unique sequence. For 1 ≤ i ≤ n, let hxi i, hyi i, hzi i denote the sequences δ(i), δ(n + i), δ(2n+i), respectively. Intuitively, hxi i is the encoding of the node xi , and similarly hyi i and hzi i are for the nodes yi and zi , respectively. Furthermore, define hxi i = δ(i), hyi i = δ(n + i), and hzi i = δ(2n + i). The node set X is associated with two sequences X = hx1 iGhx2 iG · · · Ghxn i and X = hxn iGhxn−1 iG · · · Ghx1 i. Let X − xi = hx1 iG · · · Ghxi−1 iGhxi+1 iG · · · hxn i and X − xi = hxn iG · · · Ghxi+1 iGhxi−1 iG · · · Ghx1 i, where xi is any node in X. Similarly, the node sets Y and Z are associated with sequences Y, Y, and Z, Z, respectively. Edge Encoding: For each edge ej (where 1 ≤ j ≤ m), we define four delimiter sequences, namely, Vj = π(j), Wj = π(m + 1 + j), Vj = π(j), and Wj = π(m + 1 + j). Assume that ej = (xpj , yqj , zrj ). Then ej is encoded by the sequence Sj defined as AG Vj AG Wj AG X G Y G Z G (Z − zrj ) G (Y − yqj ) G (X − xpj ) Vj A Wj . 11 Let Sm+1 be a special sequence defined as AG Vm+1 AG Wm+1 AG Z G Y G X Vm+1 A Wm+1 . In the following discussion, each Sj is referred to as a region. Finally, we define SE to be the sequence Sm+1 Sm · · · S1 . Let σ = 3n(3d − 2) + 6d − 1 and let h = mσ + n(6d − 4) + 12d − 5. Note that SE has O((n + m)3 ) characters and can be constructed in O(|SE |) time. In Sections 5.2 and 5.3, we show that sp(SE ) ≥ h if and only if E contains a perfect matching. 5.2 Correctness of the if-part This section shows that if E has a perfect matching, we can construct a planar secondary structure for SE containing at least h stacking pairs. Therefore, sp(SE ) ≥ h. First of all, we establish several basic steps for constructing stacking pairs on SE . • δ(i) or δ(i) itself can form d − 1 stacking pairs, while δ(i) and δ(i) together can form 3d − 2 stacking pairs. • π(i) and π(i) together can form 6d − 2 stacking pairs. • For any i 6= j, π(i) and π(j) together can form 6d − 3 stacking pairs. Lemma 5.1 If E has a perfect matching, then sp(SE ) ≥ h. Proof. Let M = {ej1 , ej2 , . . . , ejn } be a perfect matching. Without loss of generality, we assume that 1 ≤ j1 < j2 < . . . < jn ≤ m. Define jn+1 = m + 1. To obtain a planar secondary structure for SE with at least h stacking pairs, we consider the regions one by one. There are three cases. Case 1: We consider any region Sj such that ej 6∈ M . Our goal is to show that σ = 3n(3d − 2) + 6d − 1 stacking pairs can be formed within Sj . Note that there are (m − n) edges not in M . Thus, we can obtain a total of (m − n)σ stacking pairs in this case. Details are as follows. Assume that ej = (xpj , yqj , zrj ). • 6d − 2 stacking pairs can be formed between Vj and Vj , and between Wj and Wj . • 3d − 2 stacking pairs can be formed between hxi i and hxi i for all i 6= pj , and between hyi i and hyi i for all i 6= qj , and between hzi i and hzi i for all i 6= rj . • hxpj i, hyqj i, and hzrj i can each form d − 1 stacking pairs. The total number of stacking pairs that can be formed within Sj is 2(6d − 2) + 3(n − 1)(3d − 2) + 3(d − 1) = 3n(3d − 2) + 6d − 1 = σ. Case 2: We consider the edges ej1 , ej2 , . . . , ejn in M . Our goal is to show that each corresponding region accounts for σ + 6d − 4 stacking pairs. Thus, we obtain a total of nσ + n(6d − 4) stacking pairs in this case. Details are as follows. Unlike Case 1, each region Sjk , where 1 ≤ k ≤ n, may have some of its bases paired with that of Sjk+1 . • 6d − 3 stacking pairs can be formed between Wjk in Sjk and Wjk+1 in Sjk+1 . • 6d − 2 stacking pairs can be formed between Vjk in Sjk and Vjk in Sjk . 12 • 3d − 2 stacking pairs can be paired between hxi i in Sjk and hxi i in Sjk for any i 6= pj1 , . . . , pjk , and between hyi i in Sjk and hyi i in Sjk for any i 6= qj1 , . . . , qjk , and between hzi i in Sjk and hzi i in Sjk for any i 6= rj1 , . . . , rjk . • 3d − 2 stacking pairs can be paired between hxi i in Sjk and hxi i in Sjk+1 for any i = pj1 , . . . , pjk , and between hyi i in Sjk and hyi i in Sjk+1 for any i = qj1 , . . . , qjk , and between hzi i in Sjk+1 and hzi i in Sjk+1 for any i = rj1 , . . . , rjk . The total number of stacking pairs charged to Sjk is 6d−3+6d−2+3n(3d−2) = σ +6d−4. Case 3: We consider Sm+1 . We can form 6d − 2 stacking pairs between Vm+1 and Vm+1 , and 6d − 3 stacking pairs between Wm+1 and Wj1 . The number of such stacking pairs is 12d − 5. Combining the three cases, the number of stacking pairs that can be formed on SE is (m − n)σ + n(σ + 6d − 4) + 12d − 5, which is exactly h. Notice that no two stacking pairs formed cross each other. Thus, sp(SE ) ≥ h. 5.3 Correctness of the only-if part This section shows that if E has no perfect matching, then sp(SE )< h. We first give the framework of the proof in Section 5.3.1. Then, some basic definitions and concepts are presented in Section 5.3.2. The proof of the only-if part is given in Section 5.3.3. 5.3.1 Framework of the proof Let OPT be a secondary structure of SE with the maximum number of stacking pairs. Let #OPT be the number of stacking pairs in OPT. That is, #OPT = sp(SE ). In this section, we will establish an upper bound for #OPT. Recall that we only consider Watson-Crick base pairs, i.e., A − U and C − G pairs. We define a conjugate of a substring in SE as follows. Conjugates: For every substring R = s1 s2 . . . sk of SE , the conjugate of R is R̂ = sˆk . . . sˆ1 , where  = U , Û = A, Ĉ = G, and Ĝ = C. For example, AA’s conjugate is U U and U A’s conjugate is U A. To form a stacking pair, two adjacent bases must be paired with another two adjacent bases. So, we concentrate on the possible patterns of adjacent bases in SE . 2-substrings: In SE , any two adjacent characters are referred to as a 2-substring. By construction, SE has only ten different types of 2-substrings: U U , AA, U A, GG, CC, GC, AG, GA, GU , and CA-substrings. A 2-substring can only form a stacking pair with its conjugate. If they actually form a stacking pair in OP T , they are said to be paired. Since the conjugates of AG, GA, GU , and CA-substrings do not exist in SE , there is no stacking pair in SE which involves these 2-substrings. We only need to consider AA, U U , U A, GG, CC, GC-substrings. Table 1 shows the numbers of occurrences of these 2-substrings in Sj (1 ≤ j ≤ m + 1) and the total occurrences of these substrings in SE . 13 Substring (t) AA UU UA GG CC GC Total number of Sj (j = 1, 2, . . . , m) Sm+1 3n(d − 2) + (3n − 3)(2d − 2) 3n(2d − 2) 3n(2d − 2) + (3n − 3)(d − 2) 3n(d − 2) 2(6n − 3) 6n 2(6d − 2) 2(6d − 2) 2(6d − 2) 2(6d − 2) 4 4 occurrences of t in SE m(3n(d − 2) + (3n − 3)(2d − 2)) + 3n(2d − 2) m(3n(2d − 2) + (3n − 3)(d − 2)) + 3n(d − 2) 2m(6n − 3) + 6n 2(m + 1)(6d − 2) 2(m + 1)(6d − 2) 4m + 4 Table 1: Number of occurrences of different 2-substrings Let #AA denote the number of occurrences of AA-substrings in SE . We use the # notation for other types of 2-subtrings in SE similarly. The following fact gives a straightforward upper bound for #OPT. Fact 5.2 #OPT ≤ min{#AA, #U U } + min{#GG, #CC} + #U A/2 + #GC/2 = h + n + 1 + (2m + 2). Note that OPT may not pair all AA-subtrings with U U -substrings. Let ♦AA be the number of AA-substrings that are not paired in OPT. Again, we use the ♦ notaion for other types of 2-substrings. Fact 5.2 can be strengthened as follows. Fact 5.3 #OPT ≤ min{#AA−♦AA, #U U −♦U U }+min{#GG−♦GG, #CC −♦CC}+ (#U A − ♦U A)/2 + (#GC − ♦GC)/2. The upper bound given in Fact 5.3 forms the basis of our proof for showing that #OPT < h. In the following sections, we consider the possible structure of OPT. For each possible case, we show that the lower bounds for some ♦ values, such as ♦AA and ♦CC, are sufficiently large so that OPT can be shown to be less than h. In particular, in one of the cases, we must make use of the fact that E does not have a perfect matching in order to prove the lower bound for ♦AA, ♦U A, and ♦U U . We give some basic definitions and concepts in Section 5.3.2. The lower bounds and the proof are given in Section 5.3.3. 5.3.2 Definitions and concepts In this section, we give some definitions and concepts which are useful in deriving lower bounds for ♦ values. We first classify each region Sj in SE as either open or closed with respect to OPT. Then, extending the definitions of fragments and conjugates, we introduce conjugate fragments and delimiter fragments. Finally, we present a property of delimiter fragments in open regions. Open and closed regions: With respect to OPT, a region Sj in SE is said to be an open region if some U U , AA, or U A-substrings in Sj are paired with some 2-substrings outside Sj ; otherwise, it is a closed region. Lemma 5.4 If Sm+1 is a closed region, then #OPT < h. 14 Proof. Sm+1 has 3nd more AA-substrings than U U -substrings. If Sm+1 is a closed region, these 3nd AA-substrings are not paired by OPT. Thus, ♦AA ≥ 3nd. By Fact 5.3, #OPT < h + (n + 1) + (2m + 2) − 3nd < h. Recall that SE is a sequence composed of δ’s, δ’s, π’s, and π’s. Each δ(k) (respectively δ(k)) consists of two substrings of the form U + A+ , each of these substrings is called a fragment. Furthermore, each π(k) (resp. π(k)) consists of two substrings of the form C + (respectively G+ ), each of these subtrings is also called a fragment. Conjugate fragments and delimiter fragments: Consider any fragment F in SE . Another fragment F ′ in SE is called a conjugate fragment of F if F ′ is the conjugate of F . Note that if F is a fragment of a certian δ(k) (resp. π(k)), then F ′ appears only in some δ(k) (respectively π(k)), and vice versa. By construction, if F is a fragment of some delimiter sequence Vj or Wj , then F has a unique conjugate fragment in SE , which is located in Vj or Wj , respectively. However, if F is a fragment of some non-delimiter sequence, says, hxi i, then for every instance of hxi i in SE , F contains one conjugate fragment in hxi i. A fragment F is said to be paired with its conjugate fragment F ′ by OPT if OPT includes all the pairs of bases between F and F ′ . For 1 ≤ j ≤ m + 1, the fragment F in Vj or Wj is called a delimiter fragment. Note that the delimiter fragment F should be of the form C 2d+k for 2d > k > 0. The following lemma shows a property of delimiter fragments in open regions. Lemma 5.5 If Sj is an open region, then both delimiter fragments of either Vj or Wj must not pair with their conjugate fragments in OPT. Proof. We prove the statement by contradiction. Suppose one fragment of Vj and one fragment of Wj are paired with their conjugate fragments. Let (sx , sx+1 ; sy−1 , sy ) and (sx′ , sx′ +1 ; sy′ −1 , sy′ ) be some particular stacking pairs in Vj and Wj , respectively. Since Sj is an open region, we can identify a stacking pair (sx′′ , sx′′ +1 ; sy′′ −1 , sy′′ ) where sx′′ sx′′ +1 and sy′′ −1 sy′′ are 2-substrings within and outside Sj , respectively. Note that these three stacking pairs form an interleaving block. By Lemma 2.1, OPT is not planar, reaching a contradiction. 5.3.3 Proof of the only-if part By Lemma 5.4, it suffices to assume that Sm+1 is an open region. Before we give the proof of the only-if part, let us consider the following lemma. Lemma 5.6 Let α be the number of delimiter fragments that are not paired with their conjugate fragments. Then, ♦CC + ♦GG ≥ α + (#GC − ♦GC). Proof. By construction, a GC-substring must be next to the left end of a delimiter fragment F , which is of the form C + . No other GC-substrings can exist. If this GC-substring is paired, the leftmost CC-substring of F must not be paired as there is no GGC pattern in SE . Thus, F must be one of the α delimiter fragments that are not paired with their conjugate fragments. Based on this observation, we classify the α delimiter fragments into 15 two groups: (1) (#GC − ♦GC)’s delimiter fragments whose GC-substrings at the left end are paired; and (2) α − (#GC − ♦GC)’s delimiter fragments whose GC-substrings at the left end are not paired. For each delimiter fragment F = C 2d+k in group (1), since the GC-substring on the left of F is paired, the leftmost CC-substring of F must not be paired by OPT. For the remaining 2d + k − 2 CC-substrings, we either find a CC-substring which is not paired by OPT; or these 2d + k − 2 CC-substrings are paired to GG-substrings in some fragment ′ F ′ = G2d+k with 2d > k′ > k, and thus, some GG-substring of F ′ is not paired. Therefore, each delimiter fragment in group (1) introduces either (i) two unpaired CC-substrings or (ii) one unpaired CC-substring and one unpaired GG-substring. Hence, the total number of unpaired CC and GG-substrings due to delimiter fragments in group (1) ≥ 2(#GC −♦GC). For each delimiter fragment F = C 2d+k in group (2), consider the CC-substrings in F . With a similar argument, we can show that each delimiter fragment in group (2) introduces either (i) one unpaired CC-substring or (ii) one unpaired GG-substring. Hence, the total number of unpaired CC and GG-substrings due to delimiter fragments in group (2) ≥ α − (#GC − ♦GC). In total, we have ♦CC + ♦GG ≥ α + (#GC − ♦GC). Now, we state a lemma which shows the lower bounds for some ♦ values in terms of the number of open regions in OPT. Lemma 5.7 Let ℓ ≥ 1 be the number of open regions in OPT. (1) If Sm+1 is an open region, then ♦U U ≥ 3(m + 1 − ℓ)d. (2) max{♦CC, ♦GG} ≥ ℓ + (#GC − ♦GC)/2. (3) If ℓ = n + 1, Sm+1 is an open region, and E does not have a perfect matching, then either (a) ♦U U ≥ 3(m − n)d + 1, (b) ♦AA ≥ 1, or (c) ♦U A ≥ 2. Proof. Statement 1. Within each closed region Sj where j 6= m + 1, 3d’s U U -substrings cannot paired in OPT. As there are m + 1 − ℓ such closed regions, 3(m + 1 − ℓ)d U U -substrings are not paired in OPT. Thus, ♦U U ≥ 3(m + 1 − ℓ)d. Statement 2. By Lemma 5.5, we can identify 2ℓ fragments in Vj and Wj of all open regions which are not paired with their conjugate fragments. Then, by Lemma 5.6, we have ♦CC + ♦GG ≥ 2ℓ + (#GC − ♦GC). Thus, max{♦CC, ♦GG} ≥ ℓ + (#GC − ♦GC)/2. Statement 3. By a similar argument to the proof for Statement 1, within the m + 1 − ℓ = m − n closed regions, 3(m − n)d U U -substrings are not paired in OPT. For the ℓ = n + 1 open regions, one of them must be Sm+1 . Let Sj1 , . . . , Sjn be the remaining n open regions. Recall that ej1 , . . . , ejn are the corresponding edges of these n open regions. Since these n edges cannot form a perfect matching, some node, says xk , is adjacent to these n edges more than once. Thus, within Sj1 , . . . , Sjn , Sm+1 , we have more hxk i than hxk i. Therefore, at least two of the fragments in all hxk i are not paired with their conjugate fragments. 16 Let F be one of such fragments. Note that F is of the form U d Ak . Since F is not paired with its conjugate fragment, one of the following three cases occurs in OPT: Case 1: An U U -substring of F is not paired. Case 2: An AA-substring of F is not paired. Case 3: All U U -substrings and AA-substrings F are paired. In this case, U d of F is paired ′ with Ad of a fragment F ′ = U k Ad ; and Ak of F is paired with some substring U k of some fragment F ′′ . As F ′ and F ′′ are not the same fragment, the U A-substrings of both F and F ′ are not paired. In summary, we have either (1) ♦U U ≥ 3(m−n)d+1, or (2) ♦AA ≥ 1, or (3) ♦U A ≥ 2. Based on Lemma 5.7, we prove the only-if part by a case analysis in the following lemma. Lemma 5.8 If E does not have a prefect matching, then #OPT < h. Proof. Recall that if Sm+1 is a closed region, then #OPT < h. Now, suppose that Sm+1 is an open region. We show #OPT < h in three cases ℓ < n + 1, ℓ > n + 1 and ℓ = n + 1. Case 1: ℓ < n + 1. By Lemma 5.7 (1), ♦U U ≥ 3(m + 1 − ℓ)d. By Fact 5.3, we can conclude that #OPT = h + n + 1 + (2m + 2) − 3(n + 1 − ℓ)d ≤ h + n + 1 + (2m + 2) − 3d < h. Case 2: ℓ > n + 1. By Lemma 5.7 (2), max{♦CC, ♦GG} ≥ ℓ + (#GC − ♦GC)/2. By Fact 5.3, #OPT ≤ h + n + 1 − ℓ, which is smaller than h because ℓ > n + 1. Case 3: ℓ = n + 1. By Lemma 5.7 (3), either (a) ♦U U ≥ 3(m − n)d + 1, or (b) ♦AA ≥ 1, or (c) ♦U A ≥ 2. By Fact 5.3, #OPT ≤ h + n − max{♦CC, ♦GG} + (#GC − ♦GC)/2. By Lemma 5.7 (2), we have #OPT < h. We conclude that if E does not have a prefect matching, then #OPT < h. Equivalently, if #OPT ≥ h, then E has a prefect matching. 6 Conclusions In this paper, we have studied the problem of predicting RNA secondary structures that allow arbitrary pseudoknots with a simple free energy function that is minimized when the number of stacking pairs is maximized. We have proved that this problem is NP-hard if the secondary structure is required to be planar. We conjecture that the problem is also NP-hard for the general case. We have also given two approximation algorithms for this problem with worst-case approximation ratios of 1/2 and 1/3 for planar and general secondary structures, respectively. It would be of interest to improve these approximation ratios. Another direction is to study the problem using energy function that is minimized when the number of base pairs is maximized. It is known that this problem can be solved in cubic time if the secondary structure can be non-planar [7]. However, the computational complexity of the problem is still open if the secondary structure is required to be planar. We conjecture that the problem becomes NP-hard under this additional condition. We 17 would like to point out that the observation that have enabled us to visualize the planarity of stacking pairs on a rectangular grid does not hold in case of maximizing base pairs. References [1] T. Akutsu. Dynamic programming algorithms for RNA secondary structure prediction with pseudoknots. Discrete Applied Mathematics, 104(1-3):45–62, 2000. [2] M. Garey and D. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. Freeman, New York, NY, 1979. [3] R. Lyngsø, M. Zuker, and C. Pedersen. Internal loops in RNA secondary structure prediction. In Proceedings of the 3rd Annual International Conference on Computational Molecular Biology, pages 260–267, Lyon, France, 1999. [4] R. B. Lyngsø and C. N. S. Pedersen. RNA pseudoknot prediction in energy based models. Journal of Computational Biology, 7(3/4):409–428, 2000. [5] R. B. Lyngsø, M. Zuker, and C. N. S. Pedersen. Fast evaluation of internal loops in RNA secondary structure prediction. Bioinformatics, 15(6):440–445, 1999. [6] J. Meidanis and J. Setubal. Introduction to Computational Molecular Biology. International Thomson Publishing, New York, 1997. [7] R. Nussinov, G. Pieczenik, J.R. Griggs, and D.J. Kleitman. Algorithms for loop matchings. SIAM Journal on Applied Mathematics, 35(1):68–82, 1978. [8] E. Rivas and S. R. Eddy. A dynamic programming algorithm for RNA structure prediction including pseudoknots. Journal of Molecular Biology, 285(5):2053–2068, 1999. [9] M. Tompa. Lecture notes on biological sequence analysis. Technical Report #200006-01, Department of Computer Science and Engineering, University of Washington, Seattle, 2000. [10] Y. Uemura, A. Hasegawa, S. Kobayashi, and T. Yokomori. Tree adjoining grammars for RNA structure prediction. Theoretical Computer Science, 210(2):277–303, 1999. [11] M. S. Waterman. Introduction to Computational Biology: Maps, Sequences and Genomes. Chapman & Hall, New York, NY, 1995. [12] M. Zuker. The use of dynamic algorithms in RNA secondary structure prediction. In M. S. Waterman, editor, Mathematical Methods for DNA Sequences, pages 159–184. CRC Press Inc., Boca Raton, FL, 1989. [13] M. Zuker and D. Sankoff. RNA secondary structures and their prediction. Bulletin of Mathematical Biology, 46(4):591–621, 1984. 18
5cs.CE
Estimating Linear and Quadratic forms via Indirect Observations arXiv:1612.01508v5 [math.ST] 13 Apr 2018 Anatoli Juditsky ∗ Arkadi Nemirovski † Abstract In this paper, we further develop the approach, originating in [26], to “computation-friendly” statistical estimation via Convex Programming.Our focus is on estimating a linear or quadratic form of an unknown “signal,” known to belong to a given convex compact set, via noisy indirect observations of the signal. Classical theoretical results on the subject deal with precisely stated statistical models and aim at designing statistical inferences and quantifying their performance in a closed analytic form. In contrast to this traditional (highly instructive) descriptive framework, the approach we promote here can be qualified as operational – the estimation routines and their risks are not available “in a closed form,” but are yielded by an efficient computation. All we know in advance is that under favorable circumstances the risk of the resulting estimate, whether high or low, is provably near-optimal under the circumstances. As a compensation for the lack of “explanatory power,” this approach is applicable to a much wider family of observation schemes than those where “closed form descriptive analysis” is possible. We discuss applications of this approach to classical problems of estimating linear forms of parameters of sub-Gaussian distribution and quadratic forms of partameters of Gaussian and discrete distributions. The performance of the constructed estimates is illustrated by computation experiments in which we compare the risks of the constructed estimates with (numerical) lower bounds for corresponding minimax risks for randomly sampled estimation problems. 1 Introduction This paper can be considered as a follow-up to the paper [27] dealing with hypothesis testing for simple families – families of distributions specified in terms of upper bounds on their momentgenerating functions. In what follows, we work with simple families of distributions, but our focus is on estimation of linear or quadratic forms of the unknown “signal” (partly) parameterizing the distribution in question. To give an impression of our approach and results, let us consider the subGaussian case, where one is given a random observation ω drawn from a sub-Gaussian distribution P on Rd : T Eω∼P {eh ω } ≤ µT h + 12 hT Θh ∀h ∈ Rd , with sub-Gaussianity parameters µ ∈ Rd , Θ = ΘT ∈ Rd×d affinely parameterized by “signal” x ∈ Rm . The goal is, given observation ω “stemming” from unknown signal x known to belong to a given convex compact set X ⊂ Rm , to recover the value at x of a given linear form g(·) : Rm → R. The estimate gb we build is affine function of observation; the coefficients of the function, same as an upper bound on the -risk of the estimate on X 1 stem from an optimal solution to an explicit convex optimization ∗ LJK, Université Grenoble Alpes, 700 Avenue Centrale 38041 Domaine Universitaire de Saint-Martin-d’Hères, France, anatoli.juditsky@univ-grenoble-alpes.fr † Georgia Institute of Technology, Atlanta, Georgia 30332, USA, nemirovs@isye.gatech.edu The first author was supported by the LabEx PERSYVAL-Lab (ANR-11-LABX-0025) and the PGMO grant 2016-2032H. Research of the second author was supported by NSF grants CCF-1523768 and CMMI-1262063. 1 For the time being, given  ∈ (0, 1), -risk of an estimate on X is defined as the worst-case, over x ∈ X, width of (1 − )-confidence interval yielded by the estimate. 1 problem and thus can be specified in a computationally efficient fashion. Moreover, under mild structural assumptions on the affine mapping x 7→ (µ, Θ) the resulting estimate is provably nearoptimal in the minimax sense (see Section 4 for details). The latter statement is an extension of the fundamental result of D. Donoho [10] on near-optimality of affine recovery of a linear form of signal in Gaussian observation scheme. This paper contributes to a long line of research on estimating linear (see, e.g., [36, 24, 16, 35, 29, 26, 7] and references therein) and quadratic ([21, 25, 1, 17, 14, 6, 15, 30, 18, 23, 32, 31, 28, 8] among others) functionals of parameters of probability distributions via observations drawn from these distributions. In the majority of cited papers, the objective is to provide “closed analytical form” lower risk bounds for problems at hand and upper risk bounds for the proposed estimates, in good cases matching the lower bounds. This paradigm can be referred to as “descriptive;” it relies upon analytical risk analysis and estimate design and possesses strong explanation power. It, however, imposes severe restrictions on the structure of the statistical model, restrictions making the estimation problem amenable to complete analytical treatment. There exists another, “operational,” line of research, initiated by D. Donoho in [10]. The spirit of the operational approach is perfectly well illustrated by the main result of [10] stating that when recovering the linear form of unknown signal x known to belong to a given convex compact set X via indirect Gaussian observation ω = Ax + ξ, ξ ∼ N (0, I), the worstcase, over x ∈ X, risk of an affine in ω estimate yielded by optimal solution to an explicit convex optimization problem is within the factor 1.2 of the minimax optimal risk. Subsequent “operational” literature is of similar spirit: both the recommended estimate and its risk are given by an efficient computation (typically, stem from solutions to explicit convex optimization problems); in addition, in good situations we know in advance that the resulting risk, whether large or small, is nearly minimax optimal. The explanation power of operational results is almost nonexisting; as a compensation, the scope of operational results is usually much wider than the one of analytical results. For example, the just cited result of D. Donoho imposes no restrictions on A and X, except for convexity and compactness of X; in contrast, all known to us analytical results on the same problem subject (A, X) to severe structural restrictions. In terms of the outlined “descriptive – operational” dichotomy, our paper is operational. For instance, in the problem of estimating linear functional of signal x affinely parameterising the parameters µ, Θ of sub-Gaussian distribution we started with, we allow for quite general affine mapping x → (µ, Θ) and for general enough signal set X, the only restrictions on X being convexity and compactness. Technically, the approach we use in this paper combines the machinery developed in [19, 27] and the Cramer-type techniques for upper-bounding the risk of an affine estimate developed in [26].2 On the other hand, this approach can also be viewed as “computation-friendly” extension of theoretical results on “Cramer tests” supplied by [3, 2, 4, 5] in conjunction with techniques of [13, 14, 11, 12, 10, 8], which exploits the most attractive, in our opinion, feature of this line of research – potential applicability to a wide variety of observation schemes and (convex) signal sets X. The rest of the paper is organized as follows. In Section 2 we, following [27], describe the families of distributions we are working with. We present the estimate construction and study its general properties in Section 3. Then in Section 4 we discuss applications to estimating linear forms of subGaussian distributions. In Section 5 we apply the proposed construction to estimating quadratic forms of parameters of Gaussian and discrete distributions. To illustrate the performance of the proposed approach we describe results of some preliminary numerical experiments in which we compare the bounds on the risk of estimates supplied by our machinery with (numerically computed) lower bounds on the minimax risk. To streamline the presentation, all proofs are collected in the appendix. 2 ω + To handle the case of estimates quadratic in observation, we treat them as affine functions of “quadratic lifting” = [ω; 1][ω; 1]T of the actual observation ω. 2 Notation. In what follows, Rn and Sn stand for the spaces of real n-dimensional vectors and real symmetric n × n matrices, respectively; both spaces are equipped with the standard inner products, xT y, resp., Tr(XY ). Relation A  B (A  B) means that A, B are symmetric matrices of the same size such that A−B is positive semidefinite (resp., positive definite). We denote Sn+ = {S ∈ Sn : S  0} and Sn++ = int Sn+ = {S ∈ Sn : S  0}. We use “MATLAB notation:” [X1 ; ...; Xk ] means vertical concatenation of matrices X1 , ..., Xk of the same width, and [X1 , ..., Xk ] means horizontal concatenation of matrices X1 , ..., Xk of the same height. In particular, for reals x1 , ..., xk , [x1 ; ...; xk ] is a k-dimensional column vector with entries x1 , ..., xk . For probability distributions P1 , ..., PK , P1 × ... × PK is the product distribution on the direct product of the corresponding probability spaces; when P1 = ... = PK , we denote P1 × ... × PK by P K or [P ]K . Given positive integer d, θ ∈ Rd , Θ ∈ Sd+ , we denote by SG(θ, Θ) the family of all sub-Gaussian, with parameters (θ, Θ), probability distributions, that is, the family of all Borel probability distributions P on Rd such that  1 ∀f ∈ Rd : ln Eζ∼P {exp{f T ζ}} ≤ f T θ + f T Θf. 2 We use shorthand notation ω ∼ SG(θ, Θ) to express the fact that the probability distribution of random vector ω belongs to the family SG(θ, Θ). 2 Simple families of probability distributions Let • F, 0 ∈ int F, be a closed convex set in Ω = Rm symmetric w.r.t. the origin, • M be a closed convex set in some Rn , • Φ(h; µ) : F × M → R be a continuous function convex in h ∈ F and concave in µ ∈ M. Following [27], we refer to F, M, Φ(·, ·) satisfying the above restrictions as to regular data. Regular data F, M, Φ(·, ·) define the family S = S[F, M, Φ] of Borel probability distributions P on Ω such that ∃µ ∈ M : ∀h ∈ F : ln T Ω exp{h ω}P (dω) R  ≤ Φ(h; µ). (1) We say that distributions satisfying (1) are simple. Given regular data F, M, Φ(·, ·), we refer to S[F, M, Φ] as to simple family of distributions associated with the data F, M, Φ. Standard examples of simple families are supplied by “good observation schemes,” as defined in [26, 19], and include the families of Gaussian, Poisson and discrete distributions. For other instructive examples and an algorithmic “calculus” of simple families, the reader is referred to [27]. We present here three examples of simple families which we use in the sequel. 2.1 Sub-Gaussian distributions Let F = Ω = Rd , M be a closed convex subset of the set Gd = {µ = (θ, Θ) : θ ∈ Rd , Θ ∈ Sd+ }, and let Φ(h; θ, Θ) = θT h + 12 hT Θh. 3 In this case, S[F, M, Φ] contains all sub-Gaussian distributions P on Rm with sub-Gaussianity parameters from M: (θ, Θ) ∈ M ⇒ SG(θ, Θ) ⊂ S[F, M, Φ]. (2) In particular, S[F, M, Φ] contains all Gaussian distributions N (θ, Θ) with (θ, Θ) ∈ M. 2.2 Quadratically lifted Gaussian observations Let V be a nonempty convex compact subset of Sd+ . This set gives rise to the family PV of distributions of quadratic liftings [ζ; 1][ζ; 1]T of random vectors ζ ∼ N (θ, Θ) with θ ∈ Rd and Θ ∈ V. Our goal now is to build regular data such that the associated simple family of distributions contains PV . To this end we select Θ∗ ∈ Sd++ and δ ≥ 0 such that for all Θ ∈ V one has −1/2 Θ  Θ∗ , and kΘ1/2 Θ∗ − Ik ≤ δ, (3) where k · k is the spectral norm; under these restrictions, the smaller are Θ∗ and δ, the better. Observe −1/2 −1/2 that for all Θ ∈ V, we have 0  Θ∗ ΘΘ∗  I. Hence −1/2 2 kΘ1/2 Θ∗ −1/2 k = kΘ∗ −1/2 Θ1/2 k2 = kΘ∗ −1/2 Θ1/2 [Θ∗ −1/2 Θ1/2 ]T k = kΘ∗ −1/2 ΘΘ∗ k ≤ 1, and we lose nothing when assuming from now on that δ ∈ [0, 2]. The required regular data are given by the following Proposition 2.1 In the just described situation, let γ ∈ (0, 1), −1 Z + = {Z ∈ Sd+1 : Zd+1,d+1 = 1}, Hγ = {H ∈ Sd : −γΘ−1 ∗  H  γΘ∗ } and let F = Rd × Hγ , M+ = V × Z + . We set Φ(h, H; Θ, Z) = Υ(H, Θ) + Γ(h, H, Z), Υ(H, Θ) = − 21 + Γ(h, H; Z) = (4) 1/2 1/2 Θ∗ HΘ∗ ) ln Det(I − δ(2 + δ) 1/2 1/2 1/2 kΘ∗ HΘ∗ k) 2(1 −   H 1 T 2 Tr Z h h + 1 2 Tr([Θ − Θ∗ ]H) 1/2 kΘ∗ HΘ∗ k2F  + [H, h] T [Θ−1 ∗ −1 − H]  [H, h] . Then (i) F, M+ , Φ form a regular data, and for every (θ, Θ) ∈ Rd × V it holds for all (h, H) ∈ F:  n T 1 T o  ln Eζ∼N (θ,Θ) eh ζ+ 2 ζ Hζ ≤ Φ h, H; Θ, [θ; 1][θ; 1]T . (5) (ii) Besides this, function Φ(h, H; Θ, Z) is coercive in the convex argument: whenever (Θ, Z) ∈ M+ , (hi , Hi ) ∈ F and k(hi , Hi )k → ∞ as i → ∞, we have Φ(hi , Hi ; Θ, Z) → ∞. For proof, see Appendix A.1. 4 2.3 Quadratically lifted discrete observations Consider a random variable ζ ∈ Rd taking values ei , i = 1, ..., d, where ei are standard basic orths in Rd .3 We identify the probability distribution Pµ of such variable with a point µ = [µ1 ; ...; µd ] from P the d-dimensional probabilistic simplex ∆d = {ν ∈ Rd+ : di=1 νi = 1} where µi = Prob{ζ = ei }. Let now ζ K = (ζ1 , ..., ζK ) with ζk drawn independently across k from Pµ , and let ω[ζ K ] = 2 K(K − 1) X ωij [ζ K ], ωij [ζ K ] = 12 [ζi ζjT + ζj ζiT ], 1 ≤ i < j ≤ K. (6) 1≤j<j≤K We are about to point our regular data such that the associated simple family of distributions contains the distributions of the “quadratic lifts” ω[ζ K ] of random vectors ζ K . Proposition 2.2 Let F = Sd ,     X ∆d = Z ∈ Sd : Zij ≥ 0 ∀i, j, Zij = 1 .   (7) i,j and let Z d be a set of all positive semidefinite matrices from ∆d . Denote   m X Φ(H; Z) = ln  Zij exp{Hij } : Sd × ∆d → R, (8) i,j=1 so that Φ(·; ·) is convex-concave on Sd × ∆d . We set ΦM (H; Z) = M Φ(H/M ; Z), M ∈ Z+ . Then for M = M (K) = bK/2c,    ln Eζ K ∼PµK exp{Tr(Hω[ζ K ])} ≤ ΦM (H; µµT ). (9) In other words, the simple family S[F, Z d , ΦbK/2c ] contains distributions of all random variables ω[ζ K ] with ζ ∼ Pµ , µ ∈ ∆d . For proof, see Appendix A.2. 3 Estimating linear forms 3.1 Situation and goal Consider the situation as follows: given are Euclidean spaces EF , EM , EX along with • regular data F ⊂ EF , M ⊂ EM , Φ(·; ·) : F × M → R, • a nonempty set X contained in a convex compact set X ⊂ EX , • an affine mapping x 7→ A(x) : EX → EM such that A(X ) ⊂ M, 3 This is nothing more than a convenient way of thinking of a discrete random variable taking values in a d-element set. 5 • a vector g ∈ EX and a constant c specifying the linear form G(x) = hg, xi + c : EX → R 4 , • a tolerance  ∈ (0, 1). Let P be the family of all Borel probability distributions on EF . Given a random observation ω ∼ P (·) (10) where P ∈ P is associated with unknown signal x known to belong to X, “association” meaning that Z  hf,ωi ∀f ∈ F : ln e P (dω) ≤ Φ(f ; A(x)), (11) EF we want to recover the quantity G(x). Given ρ > 0, we call an estimate – a Borel function gb(·) : EF → R – (ρ, )-accurate, if for all pairs x ∈ X, P ∈ P satisfying (11) it holds Probω∼P {|b g (ω) − G(x)| > ρ} ≤ . If ρ∗ is the infimum of those ρ for which estimate gb is (ρ, )-accurate, then clearly gb is (ρ∗ , )-accurate. We refer to ρ∗ as the -risk of the estimate gb w.r.t. the data G(·), X, and (A, F, M, Φ):  Risk (b g (·)|G, X, A, F, M, Φ) = min ρ : ∀(x, P ) ∈ X × P :  (12) Prob {ω : |b g (ω) − G(x)| > ρ} ≤  ω∼P  R hf,ωi ln e P (dω) ≤ Φ(f ; A(x)) ∀f ∈ F When G, X, A, F, M, Φ are clear from the context, we shorten Risk (b g (·)|G, X, A, F, M, Φ) to Risk (b g (·)). In the setting of this section, we are about to build, in a computationally efficient fashion, an affine estimate gb(ω) = hf∗ , ωi + κ along with ρ∗ such that the estimate is (ρ∗ , )-accurate. 3.2 The construction Let us set F + = {(f, α) : f ∈ EF , α > 0, f /α ∈ F} so that F + is a nonempty convex set in EF × R+ , and let Ψ+ (f, α) = sup [αΦ(f /α, A(x)) − G(x)] : F + → R, x∈X Ψ− (f, β) = sup [βΦ(−f /β, A(x)) + G(x)] : F + → R, x∈X so that Ψ± are convex real-valued functions on F + (recall that Φ is convex-concave and continuous on F × M, while A(X ) is a compact subset of M). These functions give rise to convex functions b ± : EF → R given by Ψ b + (f ) := inf α {Ψ+ (f, α) + α ln(2/) : α > 0, (f, α) ∈ F + } , Ψ b − (f ) := inf α {Ψ− (f, α) + α ln(2/) : α > 0, (f, α) ∈ F + } Ψ and to convex optimization problem n b ) := Opt = min Ψ(f f 1 2 h io b + (f ) + Ψ b − (f ) , Ψ (13) With our approach, a “presumably good” estimate of G(x) and its risk are given by an optimal (or nearly so) solution to the latter problem. The corresponding result is as follows: 4 from now on, hu, vi denotes the inner product of vectors u, v belonging to a Euclidean space; what is this space, it always will be clear from the context. 6 Proposition 3.1 In the situation of Section 3.1, let Φ satisfy the relation Φ(0; µ) ≥ 0 ∀µ ∈ M. (14) Then  b + (f ) := inf Ψ+ (f, α) + α ln(2/) : α > 0, (f, α) ∈ F + Ψ α = max inf x∈X α>0,(f,α)∈F + [αΦ(f /α, A(x)) − G(x) + α ln(2/)] , (15)  b − (f ) := inf Ψ− (f, α) + α ln(2/) : α > 0, (f, α) ∈ F + Ψ α = max inf x∈X α>0,(f,α)∈F + [αΦ(−f /α, A(x)) + G(x) + α ln(2/)] , (16) b ± (·) are convex real-valued. Furthermore, a feasible solution f¯, κ̄, ρ̄ to the system and the functions Ψ of convex constraints b + (f ) ≤ ρ − κ, Ψ b − (f ) ≤ ρ + κ (17) Ψ in variables f , ρ, κ induces estimate gb(ω) = hf¯, ωi + κ̄, (18) Risk (b g (·)|G, X, A, F, M, Φ) ≤ ρ̄. (19) of G(x), x ∈ X, with -risk at most ρ̄: Relation (17) (and thus – the risk bound (19)) clearly holds true when f¯ is a candidate solution to problem (13) and h i b − (f¯) − Ψ b + (f¯) . b f¯), κ̄ = 1 Ψ ρ̄ = Ψ( 2 As a result, by properly selecting f¯ we can make (an upper bound on) the -risk of estimate (18) arbitrarily close to Opt, and equal to Opt when optimization problem (13) is solvable. For proof, see Appendix A.3. 3.3 Estimation from repeated observations Assume that in the situation described in Section 3.1 we have access to K observations ω1 , ..., ωK sampled, independently of each other, from a probability distribution P , and are allowed to build our estimate based on these K observations rather than on a single observation. We can immediately reduce this new situation to the previous one simply by redefining the data. Specifically, given F ⊂ EF , M ⊂ EM , Φ(·; ·) : F × M → R, X ⊂ X ⊂ EX , A(·), G(x) = hg, xi + c, see Section 3.1, and a positive integer K, let us replace F ⊂ EF with F K := |F × {z ... × F} ⊂ EFK := EF × ... × EF , and replace | {z } K K P K Φ(·, ·) : F × M → R with ΦK (f K = (f1 , ..., fK ); µ) = K i=1 Φ(fi ; µ) : F × M → R. It is immediately seen that the updated data satisfy all requirements imposed on the data in Section 3.1. Furthermore, for all f K = (f1 , ..., fK ) ∈ F K , whenever a Borel probability distribution P on EF and x ∈ X satisfy (11), the distribution P K of K-element i.i.d. sample ω K = (ω1 , ..., ωK ) drawn from P and x are linked by the relation !  Z X Z hf K ,ω K i K K ln e P (dω ) = ln ehfi ,ωi i P (dωi ) ≤ ΦK (f K ; A(x)). (20) EFK EF i 7 Applying to our new data the construction from Section 3.2, we arrive at “repeated observations” version of Proposition 3.1. Note that the resulting convex constraints/objectives are symmetric w.r.t. permutations of the components f1 , ..., fK of f K , implying that we lose nothing when restricting ourselves with collections f K with equal to each other components; it is convenient to denote the common value of these components f /K. With these observations, Proposition 3.1 becomes the statements as follows (we use the assumptions and the notation from the previous section): Proposition 3.2 In the situation described in Section 3.1, let Φ satisfy the relation (14), and let a b ± : EF → R, positive integer K be given. Then functions Ψ  b + (f ) := inf α Ψ+ (f, α) + K −1 α ln(2/) : α > 0, (f, α) ∈ F + Ψ   = maxx∈X inf α>0,(f,α)∈F + αΦ(f /α, A(x)) − G(x) + K −1 α ln(2/) ,  b − (f ) := inf α Ψ− (f, α) + K −1 α ln(2/) : α > 0, (f, α) ∈ F + Ψ   = maxx∈X inf α>0,(f,α)∈F + αΦ(−f /α, A(x)) + G(x) + K −1 α ln(2/) are convex and real valued. Furthermore, let f¯, κ̄, ρ̄ be a feasible solution to the system of convex constraints b + (f ) ≤ ρ − κ, Ψ b − (f ) ≤ ρ + κ (21) Ψ in variables f , ρ, κ. Then, setting gb(ω K ) =   1 XK f¯, ωi + κ̄, i=1 K (22) we get an estimate of G(x), x ∈ X, via independent K-repeated observations ωi ∼ P, i = 1, ..., K with -risk at most ρ̄, meaning that whenever a Borel probability distribution P is associated with x ∈ X in the sense of (11), one has  ProbωK ∼P K ω K : |b g (ω K ) − G(x)| > ρ̄ ≤ . Relation (21) clearly holds true when f¯ is a candidate solution to the convex optimization problem n h io b ) := 1 Ψ b + (f ) + Ψ b − (f ) Opt = min Ψ(f (23) 2 f and b f¯), κ̄ = ρ̄ = Ψ( 1 2 h i b − (f¯) − Ψ b + (f¯) . Ψ As a result, properly selecting f¯, we can make (an upper bound on) the -risk of estimate gb(·) arbitrarily close to Opt, and equal to Opt when optimization problem (23) is solvable. From now on, if otherwise is not explicitly stated, we deal with K-repeated observations; to get back to single-observation case, it suffices to set K = 1. 8 4 Application: estimating linear form of parameters of sub-Gaussian distributions 4.1 Situation We are about to apply construction form Section 3 in the situation where our observation is subGaussian with parameters affinely parameterized by signal x, and our goal is to recover a linear function of x. Specifically, consider the situation described in Section 3, with the data as follows: • F = EF = Rd , M = EM = Rd × Sd+ , Φ(h; µ, M ) = hT µ + 21 hT M h : Rd × (Rd × Sd+ ) → R (so that S[F, M, Φ] is the family of all sub-Gaussian distributions on Rd ); • X = X ⊂ EX = Rnx is a nonempty convex compact set, and • A(x) = (Ax+a, M (x)), where A is d×nx matrix, and M (x) is affinely depending on x symmetric d × d matrix such that M (x) is  0 when x ∈ X, • G(x) is an affine function on EX . Same as in Section 3, our goal is to recover the value of a given linear function G(y) = g T y + c at unknown signal x ∈ X via K-repeated observation ω K = (ω1 , ..., ωK ) with ωi drawn, independently across i, from a distribution P which is associated with x, which now means “is sub-Gaussian with parameters (Ax + a, M (x)).” We refer to Gaussian case as to the special case of the just described problem, where the distribution P associated with signal x is exactly N (Ax + a, M (x)). In the case in question Φ(0; µ, M ) = 0, so that (14) takes place, and the left hand sides in the constraints (21) are  b + (f ) = supx∈X inf α>0 f T [Ax + a] + 1 f T M (x)f + K −1 α ln(2/) − G(x) Ψ 2α n o 1/2 −1 T = maxx∈X 2K ln(2/)f M (x)f + f T [Ax + a] − G(x) ,  b − (f ) = supx∈X inf α>0 −f T [Ax + a] + 1 f T M (x)f + K −1 α ln(2/) + G(x) Ψ 2α n o 1/2 = maxx∈X 2K −1 ln(2/)f T M (x)f − f T [Ax + a] + G(x) . Thus, system (21) reads n o 1/2 2K −1 ln(2/)f T M (x)f + f T Ax − G(x) ≤ ρ − κ, x∈X n o   1/2 −aT f + max 2K −1 ln(2/)f T M (x)f − f T Ax + G(x) ≤ ρ + κ. aT f + max x∈X We arrive at the following version of Proposition 3.2: Proposition 4.1 In the situation described above, given  ∈ (0, 1), let f¯ be a feasible solution to the convex optimization problem h io n b + (f ) + Ψ b − (f ) b ) := 1 Ψ (24) Opt = min Ψ(f 2 f ∈Rd where n o 1/2 2K −1 ln(2/)f T M (x)f + f T Ax − G(x) + aT f, x∈X n o 1/2 b Ψ− (f ) = max 2K −1 ln(2/)f T M (x)f − f T Ay + G(y) − aT f. b + (f ) = max Ψ y∈X 9 Let us set κ̄ = 1 2 i h b − (f¯) − Ψ b + (f¯) , ρ̄ = Ψ( b f¯). Ψ Then the -risk of the affine estimate K 1 X ¯T gb(ω ) = f ωi + κ̄, K K i=1 taken w.r.t. the data listed in the beginning of this section, is at most ρ̄. T It is immediately seen that optimization problem (24) is solvable, provided that Ker(M (x)) = {0}, x∈X and an optimal solution f∗ to the problem, taken along with i h b − (f∗ ) − Ψ b + (f∗ ) , κ∗ = 12 Ψ (25) yields the affine estimate gb∗ (ω) = K 1 X T f∗ ωi + κ∗ K i=1 with -risk, w.r.t. the data listed in the beginning of this section, at most Opt. Consistency. We can easily answer the natural question “when the proposed estimation scheme is consistent”, meaning that for every  ∈ (0, 1), it allows to achieve arbitrarily small -risk, provided that K is large enough. Specifically, if we denote G(x) = g T x + c, from Proposition 4.1 it is immediately seen that a sufficient condition for consistency is the existence of f¯ ∈ Rd such that f¯T Ax = g T x for all x ∈ X − X , or, equivalently, that g is orthogonal to the intersection of the kernel of A with the linear span of X − X . Indeed, under this assumption, for every fixed  ∈ (0, 1) we clearly have b f¯) = 0, implying that limK→∞ Opt = 0, with Ψ b and Opt given by (24). The condition in limK→∞ Φ( question is necessary for consistency as well, since when the condition is violated, we have Ax0 = Ax00 for properly selected x0 , x00 ∈ X with G(x0 ) 6= G(x00 ), making low risk recovery of G(x), x ∈ X , impossible already in the case of zero noise observations (i.e., those where the observation stemming from signal x ∈ X is identically equal to Ax + a)5 . Direct product case. Further simplifications are possible in the direct product case, where, in addition to what was assumed in the beginning of Section 4, • EX = EU × EV and X = U × V , with convex compact sets U ⊂ EU = Rnu and V ⊂ EV = Rnv , • A(x = (u, v)) = [Au + a, M (v)] : U × V → Rd × Sd , with M (v)  0 for v ∈ V , • G(x = (u, v)) = g T u + c depends solely on u, and It is immediately seen that in the direct product case problem (24) reads      −1 1/2 T T T 1 Opt = min 2 φU (A f − g) + φU (−A f + g) + max 2K ln(2/)f M (v)f , v∈V f ∈Rd 5 (26) Note that in the Gaussian case with M (x) depending on x the above condition is, in general, not necessary for consistency, since a nontrivial information on x (and thus on G(x)) can, in principle, be extracted from the covariance matrix M (x) which can be estimated from observations. 10 where φU (h) = max uT h. u∈U T Assuming v∈V Ker(M (v)) = {0}, the problem is solvable, and its optimal solution f∗ gives rise to the affine estimate 1 X T gb∗ (ω K ) = f∗ ωi + κ∗ , κ∗ = 12 [φU (−AT f∗ + g) − φU (AT f∗ − g)] − aT f∗ − c, K i with -risk ≤ Opt. Near-optimality. In addition to the assumption that we are in the direct product case, assume for the sake of simplicity, that M (v)  0 whenever v ∈ V . In this case (24) reads n  1/2 o Opt = min max Θ(f, v) := 21 [φU (AT f − g) + φU (−AT f + g)] + 2K −1 ln(2/)f T M (v)f , f v∈V whence, taking into account that Θ(f, v) clearly is convex in f and concave in v, while V is a convex compact set, by Sion-Kakutani Theorem we get also    1/2 Opt = max Opt(v) = min 21 [φU (AT f − g) + φU (−AT f + g)] + 2K −1 ln(2/)f T M (v)f . (27) v∈V f Now consider the problem of recovering g T u from observation ωi , 1 ≤ i ≤ K, independently of each other sampled from N (Au + a, M (v)), where unknown u is known to belong to U and v ∈ V is known. Let ρ (v) be the minimax -risk of the recovery: n o ρ (v) = inf ρ : ProbωK ∼[N (Au+a,M (v))]K {ω K : |b g (ω K ) − g T u| > ρ} ≤  ∀u ∈ U , g b(·) where inf is taken over all Borel functions gb(·) : RKd → R. Invoking [26, Proposition 4.1], it is immediately seen that whenever  < 21 , one has qN (1 − ) ρ (v) ≥ p Opt(v) 2 ln(2/) where qN (s) is the s-quantile of the standard normal distribution. Since the family of all sub-Gaussian, with parameters (Au+a, M (v)), u ∈ U , v ∈ V , distributions on Rd contains all Gaussian distributions N (Au + a, M (v)) induced by (u, v) ∈ U × V , we arrive at the following conclusion: Proposition 4.2 In the just described situation, the minimax optimal -risk Riskopt g (·)),  (K) = inf Risk (b g b(·) of recovering g T u from K-repeated i.i.d. sub-Gaussian, with parameters (Au+a, M (v)), (u, v) ∈ U ×V , random observations is within a moderate factor of the upper bound Opt on the -risk, taken w.r.t. the same data, of the affine estimate gb∗ (·) yielded by an optimal solution to (26). Namely, p 2 ln(2/) Opt ≤ Riskopt  qN (1 − ) √ 2 ln(2/) with the “near-optimality factor” qN (1−) → 1 as  → 0.6 6 It is worth mentioning that in a more general setting of “good observation schemes,” described in [26], the -risk 11 4.2 Numerical illustration In this section we consider the problem of estimating a linear form of signal x known to belong to a given convex compact subset X via indirect observations Ax affected by sub-Gaussian “relative noise.” Specifically, our observation is ω ∼ SG(Ax, M (x)) where n X  x ∈ X = x ∈ Rn : 0 ≤ xj ≤ j −α , 1 ≤ j ≤ n , M (x) = σ 2 xj Θj . (28) j=1 Here A ∈ Rd×n and Θj ∈ Sd+ , j = 1, ..., n, are given matrices. In other words, we are in the situation where small signal results in low observation noise. The linear form to be recovered from observation ω is G(x) = g T x. The entities g, A, {Θj }nj=1 and reals α ≥ 0 (“degree of smoothness”), σ > 0 (“noise intensity”) are parameters of the estimation problem we intend to process. Parameters g, A, Θj are generated as follows: • g ≥ 0 is selected at random and then normalized to have max g T x = 2; x∈X • we consider the case of n > d (“deficient observations”); the d nonzero singular values of A i−1 were set to θ− d−1 , 1 ≤ i ≤ d, where “condition number” θ ≥ 1 is a parameter; the orthonormal systems U and V of the first d left and, respectively, right singular vectors of A were drawn at random from rotationally invariant distributions; • positive semidefinite d × d matrices Θj are orthogonal projectors on randomly selected subspaces in Rd of dimension bd/2c; • in all experiments, we deal with single-observation case K = 1. Note that X possesses ≥-largest point x̄, whence M (x)  M (x̄) whenever x ∈ X; as a result, subGaussian distributions with matrix parameter M (x), x ∈ X, can be thought also to have matrix parameter M (x̄). One of the goals of the present experiment is to compare the risk of the affine estimate in the above model to its performance in the “envelope model” ω ∼ SG(Ax, M (x̄)), where the fact that small signals result in low-noise observations is ignored. We present in Figure 1 the results of the experiment in which for a given set of parameters d, n, α, θ and σ we generate 100 random estimation problems – collections {g, A, Θj , j ≤ d}. For each problem we compute (= 0.01)-risks of two affine in ω estimates of g T x as yielded by optimal solution to (24): the first – for the problem described above (the left boxplot in each group), and the second – for the aforementioned “direct product envelope” of the problem, where the mapping c(x) := M (x̄) (the right boxplot). Note the “noise amplification” x 7→ M (x) is replaced with x 7→ M effect (the risk is about 20 times the level σ of the observation noise) and significant variability of risk across the experiments. Seemingly, both these phenomena are due to deficient observation model (n > d) combined with “random interplay” between the directions of coordinate axes in Rm (along these directions, X becomes more and more thin) and the orientation of the kernel of A. Opt of the affine estimate constructed following the rules in Section 3.3 satisfies the bound Opt ≤ 2 ln(2/)  Riskopt  1 ln 4 where Riskopt is the corresponding minimax risk.  12 Figure 1: Empirical distribution of the 0.01-risk of affine estimation over 100 estimation problems. [d = 32, n = 48, α = 2, θ = 2] for σ = 0.01 and σ = 0.05. In each group, distribution of risks for the problem with ω ∼ SG(Ax, M (x)) on the left, for the problem with ω ∼ SG(Ax, M (x̄)) – on the right. 5 Quadratic lifting and estimating quadratic forms In this section we apply the approach in Section 3 to the situation where, given an i.i.d. sample ζ K = [ζ1 ; ...; ζK ], ζi ∈ Rd , with distribution Px of ζi depending on an unknown “signal” x ∈ X, our goal is to estimate a quadratic functional q(x) = xT Qx + cT x of the signal. We consider two situations – the Gaussian case, where Px is a Gaussian distribution with parameters affinely depending on x, and discrete case where Px is a discrete distribution corresponding to the probabilistic vector Ax, A being a given stochastic matrix. Our estimation strategy is to apply the techniques developed in Section 3 to quadratic liftings ω of actual observations ζ (e.g., ωi = (ζi , ζi ζiT ) in the Gaussian case), so that the resulting estimates are affine functions of ω’s. We first focus on implementing this program in the Gaussian case. 5.1 Estimating quadratic forms, Gaussian case In this section we focus on the problem as follows. Given are • a nonempty bounded set U ⊂ Rm and a nonempty convex compact set V ⊂ Rk , • an affine mapping v 7→ M (v) : Rk → Sd which maps V onto convex compact subset V of Sd+ ; • an affine mapping u 7→ A[u; 1] : Rm → Ω = Rd , where A is a given d × (m + 1) matrix, • a “functional of interest” F (u, v) = [u; 1]T Q[u; 1] + q T v : Rm × Rk → R, (29) where Q and q are known (m + 1) × (m + 1) symmetric matrix and k-dimensional vector, respectively. • a tolerance  ∈ (0, 1). 13 We observe an i.i.d. sample ζ K = [ζ1 ; ...; ζK ], ζi ∈ Rd , with Gaussian distribution Pu,v of ζi depending on an unknown “signal” (u, v) known to belong to U × V : Pu,v = N (A[u; 1], M (v)). Our goal is to estimate F (u, v) from observation ζ K . The -risk Risk (b g ) of a candidate estimate gb(·) – a Borel real-valued function on RKd – is defined as the smallest ρ such that g (ζ K ) − F (u, v)| > ρ} ≤ . ∀((u, v) ∈ U × V ) : Probζ K ∼Pu,v K {|b 5.1.1 Construction Our course of actions is as follows. • We specify convex compact subset Z ⊂ Sm+1 such that ∀u ∈ U : [u; 1][u; 1]T ∈ Z ⊂ Z + = {Z ∈ Sm+1 : Zm+1,m+1 = 1}, + (30) matrix Θ∗ ∈ Sd and real δ ∈ [0, 2] such that Θ∗  0 and −1/2 ∀Θ ∈ V : Θ  Θ∗ and kΘ1/2 Θ∗ − Ik ≤ δ; (cf. section 2.2). • We set x(u, v) = (v, [u; 1][u; 1]T ), and X = {(v, [u; 1][u; 1]T ) : u ∈ U, v ∈ V }, so that X ⊂ X := V × Z ⊂ EX := RK × Sm+1 . We select γ ∈ (0, 1) and set Hγ −1 d d d = {H ∈ Sd : −γΘ−1 ∗  H  γΘ∗ }, F = R × Hγ ⊂ EF = R × S , M = V × BZB T ⊂ EM = Sd × Sd+1 , B = [A; eTm+1 ] (31) where em+1 being the (m + 1)-th canonic basis vector of Rm+1 . • When adding to the above entities function Φ(·; ·)), as defined in (5), we conclude by Proposition 2.1 that M, F and Φ(·; ·) form a regular data such that for all (u, v) ∈ U × V and (h, H) ∈ F,    ln Eζ∼Pu,v exp{h(h, H), (ζ, ζζ T )i} ≤ Φ h, H; M (v), B[u; 1][u; 1]T B T (32) where the inner product h·, ·i on EF is defined as h(h, H), (g, G)i = hT g + 21 Tr(HG), so that h(h, H), (ζ, ζζ T )i = hT ζ + 12 ζ T Hζ. Observe that A(x = (v, [u; 1][u; 1]T )) = (M (v), BZB T ) is an affine mapping which maps X into | {z } Z M, and G(x) : EX → R, G(x) = Tr(QZ) + q T v = [u; 1]T Q[u; 1] + q T v is a linear functional on EX . As a result of the above steps, we get at our disposal entities EX , EM , EF , F, M, Φ, X, X , A(·), G(·) and  participating in the setup described in Section 3.1, and it is immediately seen that these entities meet all the requirements imposed by this setup. The bottom line is that the estimation problem stated in the beginning of this section reduces to the problem considered in Section 3. 14 5.1.2 The result When applying to the resulting data Proposition 3.2 (which is legitimate, since Φ in (5) clearly satisfies (14)), we arrive at the result as follows: Proposition 5.1 In the just described situation, let us set   T − G(v, Z) + b + (h, H) = max Ψ inf αΦ αh , H α ; M (v), BZB (v,Z)∈V ×Z b − (h, H) = Ψ max (v,Z)∈V ×Z α>0, −1 −γαΘ−1 ∗ HγαΘ∗ inf α>0, −1 −γαΘ−1 ∗ HγαΘ∗  T αΦ − αh , − H α ; M (v), BZB  α K ln( 2 ) , + G(v, Z) + α K ln( 2 ) . (33) d d b so that the functions Ψ± (h, H) : R × S → R are convex. Furthermore, whenever h̄, H̄, ρ̄, κ̄ form a feasible solution to the system of convex constraints b + (h, H) ≤ ρ − κ, Ψ b − (h, H) ≤ ρ + κ Ψ (34) in variables (h, H) ∈ Rd × Sd , ρ ∈ R, κ ∈ R, setting gb(ζ K K  1 X T := (ζ1 , ..., ζK )) = h ζi + 21 ζiT Hζi + κ̄, K (35) i=1 we get an estimate of the functional of interest F (u, v) = [u; 1]T Q[u; 1] + q T v via K independent observations ζi ∼ N (A[u; 1], M (v)), i = 1, ..., K, with -risk not exceeding ρ̄:  ∀(u, v) ∈ U × V : Probζ K ∼[N (A[u;1],M (v))]K |F (u, v) − gb(ζ K )| > ρ̄ ≤ . In particular, setting for (h, H) ∈ Rd × Sd h i b + (h, H) + Ψ b − (h, H) , κ̄ = ρ̄ = 12 Ψ 1 2 h i b − (h, H) − Ψ b + (h, H) , Ψ (36) (37) we obtain an estimate (35) with -risk not exceeding ρ̄. For proof, see Section A.4. Remark 5.1 In the situation described in the beginning of this section, let a set W ⊂ U ×V be given, and assume we are interested in recovering functional of interest (29) at points (u, v) ∈ W only. When reducing the “domain of interest” to W , we hopefully can reduce the -risk of recovery. Assuming that we can point out a convex compact set W ⊂ V × Z such that (u, v) ∈ W ⇒ (v, [u; 1][u; 1]T ) ∈ W. it can be straightforwardly verified that in this case the conclusion of Proposition 5.1 remains valid when the set V × Z in (33) is replaced with W, and the set U × V in (36) is replaced with W . This modification enlarges the feasible set of (34) and thus reduces the attainable risk bound. 15 Discussion. When estimating quadratic forms from K-repeated observations ζ K = [ζ1 ; ...; ζK ] with i.i.d. ζi we applied “literally” the construction of Section 3.3, thus restricting ourselves with estimates affine in quadratic liftings ωi = (ζi , ζi ζiT ) of ζi ’s. As an alternative to such “basic” approach, let us consider estimates which are affine in the “full” quadratic lifting ω = (ζ K , ζ K [ζ K ]T ) of ζ K , thus extending the family of candidate estimates (what is affine in ω1 , ..., ωK , is affine in ω, but not vice versa, unless K = 1). Note that this alternative is covered by our approach – all we need, is to replace the original components d, M (·), V, A of the setup of this section with their extensions d+ = Kd, M + (v) = Diag{M (v), ..., M (v)}, | {z } K V + = M + (V ) = {Θ = Diag{M (v), ..., M (v)}, v ∈ V }, A+ = [A; ...; A], and set K to 1. It is easily seen that such modification can only reduce the risk of the resulting estimates, the price being the increase in design dimension (and thus in computational complexity) of the optimization problems yielding the estimates. To illustrate the difference between two approaches, consider the situation (to be revisited in Section 5.2) where we are interested to recover the energy uT u of a signal u ∈ Rm from observation ζ = u + ξ, ξ ∼ N (0, Θ) (38) where Θ is (unknown) diagonal matrix with diagonal entries from the range [0, σ 2 ], and a priori information about u is that kuk2 ≤ R for some known R. Assume that (cf. Section 5.2.2) m ≥ 16 ln(2/), where  ∈ (0, 1) is a given reliability tolerance and that R2 ≥ mσ 2 . Under these assumptions one can easily verify that in the single-observation case the -risks of both the “plug-in” estimate ζ T ζ and of the estimate yielded by the proposed approach p are, up to absolute constant factors, the same as the optimal -risk, namely, O(1)R, R = σ 2 m + σR ln(2/). Now let us look at the case K = 2 where we observe two independent copies, ζ1 and ζ2 , of observation (38). Here the -risks of the “naive” plug-in estimate 21 [ζiT ζ1 + ζ2T ζ2 ], and of the estimate obtained by applying our “basic” approach with K = 2 are just by absolute constant factors better than in the single-observation case – both these risks still are O(1)R. In contrast to this, an “intelligent” plug-in 2-observation estimate ζ1T ζ2 has risk √ p O(1)σ(R + σ m) ln(2/) whenever R ≥ 0, which is much smaller than R when m  ln(2/σ) and p R ln(2/)  σm. It is easily seen that with the outlined alternative implementation, our approach √ p also results in estimate with “correct” -risk O(1)σ(R + σ m) ln(2/). 5.1.3 Consistency We are about to present a simple sufficient condition for the estimator suggested by Proposition 5.1 to be consistent, in the sense of Section 4. Specifically, assume that A.1. V = {v̄} is a singleton such that M (v̄)  0, which allows to satisfy (3) with Θ∗ = M (v̄) and δ = 0, same as allows to assume w.l.o.g. that F (u, v) = [u; 1]T Q[u; 1], G(x = (v, Z)) = Tr(QZ); A.2. the first m columns of the d × (m + 1) matrix A are linearly independent. The consistency of our estimation procedure is given by the following simple statement: Proposition 5.2 In the just described situation and under assumptions A.1–2, given  ∈ (0, 1), consider the estimate K 1 X T [h̄ ζi + 12 ζiT H̄ζi ] + κK , gbK (ζ K ) = K i=1 16 where κK = 1 2 h i b − (h̄, H̄) − Ψ b + (h̄, H̄) Ψ b± = Ψ bK and Ψ bK, (·) goes to 0 as K → ∞. ± are given by (33). Then the -risk of g For proof, see Section A.5. 5.2 5.2.1 Numerical illustration, direct observations The problem Our first illustration is deliberately selected to be extremely simple: given direct noisy observation ζ =u+ξ of unknown signal u ∈ Rm known to belong to a given set U , we want to recover the “energy” uT u of u; what we are interested in, is the quadratic in ζ estimate with as small -risk on U as possible; here  ∈ (0, 1) is a given design parameter. Note that we are in the situation where the dimension d of the observation is equal to the dimension m of the signal underlying observation. The details of our setup are as follows: • U is the “spherical layer” U = {u ∈ Rm : r2 ≤ uT u ≤ R2 }, where r, R, 0 ≤ r < R < ∞ are given. As a result, the “main ingredient” of constructions in Section 5.1 – the convex compact subset Z of Z + containing all matrices [u; 1][u; 1]T , u ∈ U , see (30), can be specified as  Z = Z ∈ Sm+1 : Zm+1,m+1 = 1, 1 + r2 ≤ Tr(Z) ≤ 1 + R2 ; + • ξ ∼ N (0, Θ), with matrix Θ known to be diagonal with diagonal entries satisfying θσ 2 ≤ Θii ≤ σ 2 , 1 ≤ i ≤ d = m, with known θ ∈ [0, 1] and σ 2 > 0. In terms the setup of Section 5.1, we are in the case where V = {v ∈ Rm : θσ 2 ≤ vi ≤ σ 2 , i ≤ m}, and M (v) = Diag{v1 , ..., vm }; • the functional of interest is F (u, v) = uT u, i.e., is given by (29) with Q = Im and q = 0. 5.2.2 Processing the problem It is easily seen that in the situation in question the construction in Section 5.1 boils down to the following: 1. We lose nothing when restricting ourselves with estimates of the form η gb(ζ) = ζ T ζ + κ, 2 with properly selected scalars η and κ; (39) 2. η and κ are supplied by the convex optimization problem (with just 3 variables α+ , α− , η) n h i o b + , α− , η) = 1 Ψ b + (α+ , η) + Ψ b − (α− , η) : σ 2 |η| < α± , min Ψ(α (40) 2 α± ,η where b + (α+ , η) = − mα+ ln(1 − σ 2 η/α+ ) + m σ 2 (1 − θ) max[−η, 0] + Ψ 2 2i i hh α+ η + max − 1 t + α+ ln(2/) 2(α+ −σ 2 η) mδ(2+δ)σ 4 η 2 2(α+ −σ 2 |η|) r2 ≤t≤R2 b − (α− , η) = − mα− ln(1 + σ 2 η/α− ) + m σ 2 (1 − θ) max[η, 0] + Ψ 2 2 i i hh η + max − 2(α−α−+σ + 1 t + α− ln(2/), 2 η) r2 ≤t≤R2 17 mδ(2+δ)σ 4 η 2 2(α− −σ 2 |η|) with δ = 1 − quantity √ θ. Specifically, the η-component of a feasible solution to (40) augmented by the i 1 hb b + (α+ , η) Ψ− (α− , η) − Ψ 2 b + , α− , η); yields estimate (39) with -risk on U not exceeding Ψ(α κ= The “energy estimation” problem where ξ ∼ N (0, σ 2 Im ) with σ 2 known to belong to a given range is well studied in the literature. Available results investigate analytically the interplay between the dimension m of signal, the range of noise intensity σ 2 and the parameters R, r,  and offer provably optimal, up to absolute constant factors, estimates. For example, consider the case with r = 0, and θ = 0, and assume for the sake of definiteness that R2 ≥ σ 2 m (otherwise already the trivial – identically zero – estimate is near optimal) and that we are in “high dimensional regime,” i.e., m ≥ 16 ln(2/). It p is well known that in this case the optimal -risk, up to absolute constant factor, is σ 2 m + σR ln(2/) and is achieved, again, up to absolute constant factor, at the “plug-in” estimate x b(ζ) = ζ T ζ. It is easily seen that under the circumstances similar risk bound holds true for the estimate (39) yielded by the optimal solution to (40). A nice property of the proposed approach is that (40) automatically takes care of the parameters and results in estimates with seemingly near-optimal performance, as is witnessed by the numerical results we present below. 5.2.3 Numerical results In the experiments we are reporting on, we compute, for different sets of parameters m, r, R and θ (σ = 1 in all experiments) the 0.01-risk attainable by the proposed estimators in the Gaussian case – the optimal values of the problem (40), along with “suboptimality ratios” of such risks to the lower bounds on the best possible under circumstances 0.01-risks. To compute these lower bounds we use the following construction. Consider the problem of estimating kuk22 , u ∈ U = {u : r ≤ kuk2 ≤ R} given observation ω = N (u, ϑIm ), with ϑ ∈ [θ, 1]. Same as in Section 4, the optimal -risk Riskopt  for this problem is defined as the infimum of the -risk over all estimates. Now let us select somehow the r1 , r2 , r ≤ r1 < r2 ≤ R, and σ1 , σ2 , θ ≤ σ1 , σ2 ≤ 1, and let P1 and P2 be two distributions of observations as follows: Pχ is the distribution of random vector ω = η + ξ, where η and ξ are independent, η is uniformly distributed over the sphere kηk2 = rχ , and ξ ∼ N (0, σχ2 Im ), χ = 1, 2. It is immediately seen that if there is no test which can decide on the hypotheses H1 : ω ∼ P1 , and H2 : ω ∼ P2 via observation ω with total risk ≤ 2 (defined as the sum, r2 −r2 over our two hypotheses, of probabilities to reject the hypothesis when it is true), the quantity 2 2 1 is a lower bound on the optimal -risk Riskopt  . In other words, denoting by pχ (·) the density of Pχ , we have Z r22 − r12 0.02 < min[p1 (ω), p2 (ω)]dω ⇒ Riskopt . 0.01 ≥ 2 Rd Now, the densities pχ are spherically symmetric, whence, denoting by qχ (·) the univariate density of the energy ω T ω of observation ω ∼ Pχ , we have Z Z ∞ min[p1 (ω), p2 (ω)]dω = min[q1 (s), q2 (s)]ds, Rd 0 and we conclude that Z 0.02 < 0 ∞ min[q1 (s), q2 (s)]ds ⇒ Riskopt 0.01 ≥ 18 r22 − r12 . 2 (41) On a closest inspection, qχ is the convolution of two univariate densities representable by explicit computation-friendly formulas, implying that given r1 , r2 , σ1 , σ2 , we can check numerically whether r2 −r2 the premise in (41) indeed takes place; whenever this is the case, the quantity 2 2 1 is a lower bound on Riskopt 0.01 . In our experiments, we used a simple search strategy (not described here) aimed at crude maximizing this bound in r1 , r2 , σ1 , σ2 and used the resulting lower bounds on Riskopt 0.01 to compute 7 the suboptimality ratios. In Figures 2–4 we present some typical simulation results illustrating dependence of risks on problem dimension m (Figure 2), on ratio r/R (Figure 3), and on parameter θ (Figure 4). Different curves in each plot correspond to different values of the parameter R varying in {16, 32, 64, 128, 256, 512}, other parameters being fixed. We believe that quite moderate values of the optimality ratios presented in the figures (these results are typical for a much larger series of experiments we have conducted) attest a rather good performance of the proposed apparatus. 1.5 1.45 1.4 1.35 103 1.3 1.25 1.2 1.15 1.1 10 1.05 2 1 102 103 102 103 Figure 2: Estimation risks as functions of problem dimension m and R ∈ {16, 32, 64, 128, 256, 512} (different curves); other parameters: r/R = 0.5, and θ = 1.0. Left plot: estimation risks; right plot: suboptimality ratios. 5.3 5.3.1 Numerical illustration, indirect observations The problem The estimation problem we address in this section is as follows. Our observations are ζ = P u + ξ, (42) where • P is a given d × m matrix, with m > d (“under-determined observations”), • u ∈ Rm is a signal known to belong to a given compact set U , • ξ ∼ N (0, Θ) is the observation noise; Θ is positive semidefinite d × d matrix known to belong to a given convex compact set V ⊂ Sd+ . 7 The reader should not be surprised by the “singular numerical spectrum” of optimality ratios: our lower bounding scheme was restricted to identify actual optimality ratios among the candidate values 1.05i , i = 1, 2, ... 19 1.6 1.5 103 1.4 1.3 102 1.2 1.1 101 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 1 0.1 0.9 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Figure 3: Estimation risks as functions of the ratio r/R and R ∈ {16, 32, 64, 128, 256, 512} (different curves); other parameters: m = 512, and θ = 1.0. Left plot: estimation risks; right plot: suboptimality ratios. 2.6 2.4 2.2 103 2 1.8 1.6 1.4 102 0.1 1.2 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Figure 4: Estimation risks as functions of θ and R ∈ {16, 32, 64, 128, 256, 512} (different curves); other parameters: m = 512, and r/R = 0.5. Left plot: estimation risks; right plot: suboptimality ratios. Our goal is to estimate the energy F (u) = kuk22 m of the signal given a single observation (42). In our experiment, the data is specified as follows: 1. We assume that u ∈ Rm is a discretization of a smooth function x(t) of continuous argument t ∈ [0; 1]: ui = x( mi ), 1 ≤ i ≤ m, and use in the role of U ellipsoid {u ∈ Rm : kSuk22 ≤ 1} with S selected U a natural discrete-time version of the Sobolev-type ball {x : [x(0)]2 + R 1 00 to make 0 2 2 [x (0)] + 0 [x (t)] dt ≤ 1}. 2. d × m matrix P is of the form U DV T , where U and V are randomly selected d × d and m × m orthogonal matrices, and the d diagonal entries in diagonal d × m matrix D are of the form i−1 ϑ− d−1 , 1 ≤ i ≤ d; the “condition number” ϑ of P is a design parameter. 20 3. The set V of allowed values of the “covariance” matrices Θ is the set of all diagonal d×d matrices with diagonal entries varying in [0, σ 2 ], with the “noise intensity” σ being a design parameter. 5.3.2 Processing the problem Our estimating problem clearly is covered by the setups considered in Section 5.1. In terms of these setups, we specify Θ∗ as σ 2 Id , V as V, and M (v) as the identity mapping of Sd onto itself; the mapping u 7→ A[u; 1] becomes the mapping u 7→ P u, while the set Z (which should be a convex compact subset of the set {Z ∈ Sd+1 : Zd+1,d+1 = 1} containing all matrices of the form [u; 1][u; 1]T , u ∈ U ) becomes + the set  Z = {Z ∈ Sd+1 : Zd+1,d+1 = 1, Tr ZDiag{S T S, 0} ≤ m}. + As suggested by Proposition 5.1, linear in “lifted observation” ω = (ζ, ζζ T ) estimates of F (u) = stem from the optimal solution (h∗ , H∗ ) to the convex optimization problem b + (h, H) + Ψ b − (h, H)], Opt = min 12 [Ψ h,H 1 2 m kuk2 (43) b ± (·) given by (33) as applied with K = 1. The resulting estimate is with Ψ b − (h∗ , H∗ ) − Ψ b + (h∗ , H∗ )] ζ 7→ hT∗ ζ + 21 ζ T H∗ ζ + κ, κ = 21 [Ψ (44) and the -risk of the estimate is (upper-bounded by) Opt. Problem (43) is a well-structured convex-concave saddle point problem and as such is beyond the “immediate scope” of the standard Convex Programming software toolboxes primarily aimed at solving well-structured convex minimization problems. However, applying conic duality, one can easily eliminate in (33) the inner maxima over v, Z ro arrive at the reformulation which can be solved numerically by CVX [20], and this is how (43) was processed in our experiments. 5.3.3 Numerical results To quantify the performance of the proposed approach, we present, along with the upper risk bounds, simple lower bounds on the best -risk achievable under the circumstances. The origin of these lower bounds is as follows. Let w ∈ U with t(w) = kP wk2 , and let ρ = 2σqN (1 − ) where qN (·) is the standard normal quantile: Probξ∼N (0,1) {ξ ≤ qN (p)} = p ∀p ∈ (0, 1). Then for θ(w) = max[1 − ρ/t(w), 0], we have w0 := θ(w)w ∈ U , and kP w − P w0 k2 ≤ ρ. The latter, due to the origin of ρ, implies that there is no test which decides on the hypotheses u = w and u = w0 via observation P u + ξ, ξ ∼ N (0, σ 2 Id ), with risk < . As an immediate consequence, the quantity 1 φ(w) := [kwk22 − kw0 k22 ] = kwk22 [1 − θ2 (w)]/2 2 is a lower bound on the -risk, on U , of a whatever estimate of kuk22 . We can now try to maximize the resulting lower risk bound over U , thus arriving at the lower bound  LwBnd = max 21 kwk22 (1 − θ2 (w)) . w∈U On a closest inspection, the latter problem is not a convex one, which does not prevent us from building its suboptimal solution. 21 Note that in our experiments even with fixed design parameters d, m, θ, σ, we still deal with families of estimation problems differing from each other by their “sensing matrices” P ; orientation of the system of right singular vectors of P with respect to the axes of U is random, so that these matrices varies essentially from simulation to simulation, which affects significantly the attainable estimation risks. We display in Figure 5 typical results of our experiments. We see that the (theoretical upper bounds on the) -risks of our estimates, while varying significantly with the parameters of the experiment, all the time stay within a moderate factor from the lower risk bounds. (a) (b) Figure 5: Empirical distribution of the 0.01-risk over 20 random estimation problems, σ = 0.025. (a): upper risk bound Opt as in (43); (b) corresponding suboptimality ratios. 5.4 Estimation of quadratic functionals of a discrete distribution In this section we consider the situation as follows: we are given an d × m “sensing matrix” P A which is stochastic – with columns belonging to the probabilistic simplex ∆d = {v ∈ Rd : v ≥ 0, i vi = 1}, and a nonempty closed subset U of ∆m , along with a K-repeated observation ζ K = (ζ1 , ..., ζK ) with ζi , 1 ≤ i ≤ K, drawn independently across i from the discrete distribution µ = Au∗ , where u∗ is an unknown probabilistic vector (“signal”) known to belong to U . We always assume that K ≥ 2. We treat a discrete distribution on d-point set as a distribution Pµ on the d vertices e1 , ..., ed of ∆d , so that possible values of ζi are basic orths e1 , ..., ed in Rd with Probζ∼µ (ζ = ej ) = µj . Our goal is to recover from observation ζ K the value at u∗ of a given quadratic form F (u) = uT Qu + 2q T u. 5.4.1 Construction Observe that for u ∈ ∆m , we have u = [uuT ]1m , where 1m is the all-ones vector in Rm . This observation allows to rewrite F (u) as a homogeneous quadratic form: F (u) = uT Q̄u, Q̄ = Q + [q1Tm + 1m q T ]. Our goal is to construct an estimate gb(ζ K ) of F (u), specifically, estimate of the form gb(ζ K ) = Tr(hω[ζ K ]) + κ 22 (45) where ω[ζ K ] is the “quadratic lifting” of observation ζ K (cf. (6)): ω[ζ K ] = 2 K(K − 1) X ωij [ζ K ], ωij [ζ K ] = 12 [ζi ζjT + ζj ζiT ], 1 ≤ i < j ≤ K, 1≤j<j≤M and h ∈ Sm and κ ∈ R are the parameters of the estimate. To this end • we set x(u) = uuT , with X = {uuT : u ∈ U }, and specify a convex compact subset X of the intersection of the “symmetric matrix simplex” ∆m ⊂ Sm (see (7)) and the cone Sm + of positive m d semidefinite matrices such that X ⊂ X ⊂ EX := S . We put F = EF := S , and M = ∆d , thus AX AT ⊂ M ⊂ EM := Sd . • By Proposition 2.2, F, M and Φ(·; ·), as defined in (8), form a regular data such that setting M = bK/2c, for all u ∈ U and h ∈ Sd it holds    K ]i} T AT ln E exp{hh, ω[ζ ≤ Φ h; Auu M ζ∼P u h P  i (46) −1 h } : Sd × ∆d → R . ΦM (h; Z) = M ln Z exp{M ij ij i,j where hh, wi = Tr(hw) is the Frobenius inner product on Sd . Observe that for x ∈ EX , x 7→ A(x) = AxAT is an affine mapping from X into M, and setting G(x) = hQ̄, xi : EX → R, we get a linear functional on EX such that we ensure that G(uuT ) = hQ̄, uuT i = F (u). The relation Φ(0, z) = 0 ∀z ∈ M being obvious, Proposition 2.2 combines with Proposition 3.1 to yield the following result. Proposition 5.3 In the situation in question, given  ∈ (0, 1), let M = M (K) = bK/2c, and let   Ψ+ (h, α) = max αΦM (h/α, AxAT ) − Tr(Q̄x) : Sd × {α > 0} → R, x∈X   Ψ− (h, α) = max αΦM (−h/α, AxAT ) + Tr(Q̄x) : Sd × {α > 0} → R x∈X b + (h) := Ψ = = b − (h) := Ψ = = inf {Ψ+ (h, α) + α ln(2/)}   max inf αΦM (h/α, AxAT ) − Tr(Q̄x) + α ln(2/) x∈X α>0   β max inf βΦ1 (h/β, AxAT ) − Tr(Q̄x) + ln(2/) x∈X β>0 M α>0 inf {Ψ− (h, α) + α ln(2/)}   max inf αΦM (−h/α, AxAT ) + Tr(Q̄x) + α ln(2/) x∈X α>0   β max inf βΦ1 (−h/β, AxAT ) + Tr(Q̄x) + ln(2/) x∈X β>0 M [β = M α], α>0 [β = M α]. b ± are real valued and convex on Sm , and every candidate solution h̄ to the convex The functions Ψ optimization problem h io n b + (h) + Ψ b − (h) , b Opt = min Ψ(h) := 12 Ψ (47) h 23 induces the estimate gbh̄ (ζ K ) = Tr(h̄ω[ζ K ]) + κ(h̄), κ(h) = b − (h) − Ψ b + (h) Ψ , 2 b h̄): of the functional of interest (45) via observation ζ K with -risk on U not exceeding ρ̄ = Ψ( ∀(u ∈ U ) : Probζ K ∼PuK {|F (u) − gbh̄ (ζ K )| > ρ̄} ≤ . 5.4.2 Numerical illustration To illustrate the above construction, consider the following problem: we observe independent across k ≤ K realizations ζk of discrete random variable ζ taking values 1, ..., d. The distribution p ∈ ∆d of ζ is linearly parameterized by “signal” u which itself is a probability distribution on “discrete square” Ω = Ξ × Ξ, Ξ = {1, ..., m}: X pi = Ap,rs urs , 1 ≤ i ≤ d. 1≤r,s≤m P Here Ai,rs ≥ 0 are known coefficients such that i Ai,rs = 1 for all (r, s) ∈ Ω. Now, given two sets I ⊂ Ξ and J ⊂ Ξ, consider the events I = I × Ξ ⊂ Ω and J = Ξ × J ⊂ Ω. Our objective is to quantify the deviation of these events, the probability distribution on Ω being u, from independence, specifically, to estimate, via observations ζ1 , ..., ζK , the quantity X  X  X FIJ (x) = urs − urs urs (r,s)∈I×J (r,s)∈I×Ξ (r,s)∈Ξ×J which is a quadratic function of u. In the experiments we report below, this estimation was carried out via a straightforward implementation of the construction presented earlier in this section. Our setup was as follows: 1. We use d = m2 . d×d column-stochastic “sensing matrix” A 8 corresponding to the “mixed-noise observations” [33, 34] is generated according to A = θId + (1 − θ)D, with column-stochastic d × d matrix D, θ ∈ [0, 1] being our control parameter. D was selected at random, by normalizing columns of a d×d matrix with independent entries drawn from the uniform distribution on [0, 1]; 2. We set X = {x ∈ Sd : xrs,r0 s0 ≥ 0 ∀r, s, r0 , s0 ≤ m, x  0, X xrs,r0 s0 = 1} 1≤r,s,r0 ,s0 ≤m which is the simplest convex outer approximation of the set {uuT : u ∈ ∆d }. 3. We use I = J = {1, 2, 3} ⊂ Ξ = {1, 2, ..., 8},  = 0.01, m = 8 (i.e., d = 64). We present in Figure 6 the results of experiments for θ taking values in {0.00, 0.25, 0.50, 0, 75, 1.00}. Other things being equal, the smaller θ, the larger is the condition number cond(A) of the sensing matrix, and thus the larger is the (upper bound on the) risk of our estimate – the optimal value of (47). Note that the variation of Fij over X is exactly 1/2, so the maximal risk is ≤ 1/4. It is worthy to note that simple (if compared, e.g., to much more involved results of [22]) bounds in Proposition 2.2 for Laplace functional of order-2 U -statistics distribution result in fairly good approximations of the risk of our estimate (cf. the boxplots of empirical distributions of the estimation error in the right plot of Figure 6). 8 we identify the m × m “discrete square” Ω with {1, ..., d}, which allows to treat a probability distribution u on Ω as a vector from ∆d . 24 0.3 0.25 0.25 0.2 0.2 0.15 0.15 0.1 0.1 0.05 0 100 101 102 0.05 102 103 (a) 103 104 105 (b) Figure 6: Estimation of “independence defect.” (a): Upper risk bound (value Opt in (47)) of linear estimate as a function of condition number cond(A); data for K = 2 · 103 , 2 · 104 and 2 · 105 . (b): risk of linear estimation as function of K along with boxplots of empirical error distributions for 100 simulations (θ = 0.1, cond(A) = 39.2). References [1] P. J. Bickel and Y. Ritov. Estimating integrated squared density derivatives: sharp best order of convergence estimates. Sankhyā: The Indian Journal of Statistics, Series A, pages 381–393, 1988. [2] L. Birgé. Vitesses maximales de décroissance des erreurs et tests optimaux associés. Zeitschrift für Wahrscheinlichkeitstheorie und verwandte Gebiete, 55(3):261–273, 1981. [3] L. Birgé. Sur un théorème de minimax et son application aux tests. Probab. Math. Stat., 3:259– 282, 1982. [4] L. Birgé. Approximation dans les espaces métriques et théorie de l’estimation. Zeitschrift für Wahrscheinlichkeitstheorie und verwandte Gebiete, 65(2):181–237, 1983. [5] L. Birgé. Model selection via testing: an alternative to (penalized) maximum likelihood estimators. In Annales de l’Institut Henri Poincare (B) Probability and Statistics, volume 42, pages 273–325. Elsevier, 2006. [6] L. Birgé and P. Massart. Estimation of integral functionals of a density. The Annals of Statistics, pages 11–29, 1995. [7] C. Butucea and F. Comte. Adaptive estimation of linear functionals in the convolution model and applications. Bernoulli, 15(1):69–98, 2009. [8] C. Butucea and K. Meziani. Quadratic functional estimation in inverse problems. Statistical Methodology, 8(1):31–41, 2011. [9] Y. Cao, A. Nemirovski, Y. Xie, V. Guigues, and A. Juditsky. Change detection via affine and quadratic detectors. Electronic Journal of Statistics, 12(1):1–57, 2018. 25 [10] D. L. Donoho. Statistical estimation and optimal recovery. The Annals of Statistics, 22(1):238– 270, 1994. [11] D. L. Donoho and R. C. Liu. Geometrizing rates of convergence, ii. The Annals of Statistics, pages 633–667, 1991. [12] D. L. Donoho and R. C. Liu. Geometrizing rates of convergence, iii. The Annals of Statistics, pages 668–701, 1991. [13] D. L. Donoho, R. C. Liu, and B. MacGibbon. Minimax risk over hyperrectangles, and implications. The Annals of Statistics, pages 1416–1437, 1990. [14] D. L. Donoho and M. Nussbaum. Minimax quadratic estimation of a quadratic functional. Journal of Complexity, 6(3):290–323, 1990. [15] S. Efromovich and M. Low. On optimal adaptive estimation of a quadratic functional. The Annals of Statistics, 24(3):1106–1125, 1996. [16] S. Efromovich and M. G. Low. Adaptive estimates of linear functionals. Probability theory and related fields, 98(2):261–275, 1994. [17] J. Fan. On the estimation of quadratic functionals. The Annals of Statistics, pages 1273–1294, 1991. [18] G. Gayraud and K. Tribouley. Wavelet methods to estimate an integrated quadratic functional: Adaptivity and asymptotic law. Statistics & probability letters, 44(2):109–122, 1999. [19] A. Goldenshluger, A. Juditsky, and A. Nemirovski. Hypothesis testing by convex optimization. Electronic Journal of Statistics, 9(2):1645–1712, 2015. [20] M. Grant and S. Boyd. The CVX Users Guide. Release 2.1, 2014. http://web.cvxr.com/cvx/ doc/CVX.pdf. [21] R. Z. Hasminskii and I. A. Ibragimov. Some estimation problems for stochastic differential equations. In Stochastic Differential Systems Filtering and Control, pages 1–12. Springer, 1980. [22] C. Houdré and P. Reynaud-Bouret. Exponential inequalities, with constants, for u-statistics of order two. In Stochastic inequalities and applications, pages 55–69. Springer, 2003. [23] L.-S. Huang and J. Fan. Nonparametric estimation of quadratic regression functionals. Bernoulli, 5(5):927–949, 1999. [24] I. A. Ibragimov and R. Z. Khas minskii. Estimation of linear functionals in gaussian noise. Theory of Probability & Its Applications, 32(1):30–39, 1988. [25] I. A. Ibragimov, A. S. Nemirovskii, and R. Khas minskii. Some problems on nonparametric estimation in gaussian white noise. Theory of Probability & Its Applications, 31(3):391–406, 1987. [26] A. Juditsky and A. Nemirovski. Nonparametric estimation by convex programming. The Annals of Statistics, 37(5a):2278–2300, 2009. [27] A. Juditsky and A. Nemirovski. Hypothesis testing via affine detectors. Electronic journal of statistics, 10(2):2204–2242, 2016. 26 [28] J. Klemelä. Sharp adaptive estimation of quadratic functionals. Probability theory and related fields, 134(4):539–564, 2006. [29] J. Klemela and A. B. Tsybakov. Sharp adaptive estimation of linear functionals. Annals of statistics, pages 1567–1600, 2001. [30] B. Laurent. Estimation of integral functionals of a density and its derivatives. Bernoulli, 3(2):181– 211, 1997. [31] B. Laurent. Adaptive estimation of a quadratic functional of a density by model selection. ESAIM: Probability and Statistics, 9:1–18, 2005. [32] B. Laurent and P. Massart. Adaptive estimation of a quadratic functional by model selection. Annals of Statistics, pages 1302–1338, 2000. [33] O. Lepski. Some new ideas in nonparametric estimation. arXiv preprint arXiv:1603.03934, 2016. [34] O. Lepski and T. Willer. Estimation in the convolution structure density model. part i: oracle inequalities. arXiv preprint arXiv:1704.04418, 2017. [35] O. V. Lepski and V. G. Spokoiny. Optimal pointwise adaptive methods in nonparametric estimation. The Annals of Statistics, pages 2512–2546, 1997. [36] B. Y. Levit. Conditional estimation of linear functionals. 11(4):39–54, 1975. A Problemy Peredachi Informatsii, Proofs From now on, we use the notation Z(u) = uuT . A.1 Proof of Proposition 2.1 Proposition 2.1 is nothing but [9, Proposition 4.1.(i)]; to make the paper self-contained, we reproduce the proof below. We start with proving item (i) of Proposition. 10 . For any θ, h ∈ Rd , Θ ∈ Sd+ and H ∈ Sd such that −I ≺ Θ1/2 HΘ1/2 ≺ I we have   Ψ(h, H; θ, Θ) := ln Eζ∼N (θ,Θ) exp{hT ζ + 21 ζ T Hζ}  n o = ln Eξ∼N (0,I) exp{hT [θ + Θ1/2 ξ] + 21 [θ + Θ1/2 ξ]T H[θ + Θ1/2 ξ] = − 12 ln Det(I − Θ1/2 HΘ1/2 ) + hT θ + 21 θT Hθ + 12 [Hθ + h]T Θ1/2 [I − Θ1/2 HΘ1/2 ]−1 Θ1/2 [Hθ + h]  H h  = − 12 ln Det(I − Θ1/2 HΘ1/2 ) + 21 [θ; 1]T [θ; 1] hT h i + 21 [θ; 1]T [H, h]T Θ1/2 [I − Θ1/2 HΘ1/2 ]−1 Θ1/2 [H, h] [θ; 1]. 27 (48) −1 Observe that for H ∈ Hγ we have Θ1/2 [I − Θ1/2 HΘ1/2 ]−1 Θ1/2 = [Θ−1 − H]−1  [Θ−1 ∗ − H] , so that (48) implies that for all θ ∈ Rd , Θ ∈ V, and (h, H) ∈ F,    H h T −1 −1 1/2 1/2 T 1 1 Ψ(h, H; θ, Θ) ≤ − 2 ln Det(I − Θ HΘ ) + 2 [θ; 1] + [H, h] [Θ∗ − H] [H, h] [θ; 1] hT {z } | P [H,h] = − 12 ln Det(I − Θ1/2 HΘ1/2 ) + 21 Tr(P [H, h]Z([θ; 1])) = − 12 ln Det(I − Θ1/2 HΘ1/2 ) + Γ(h, H; Z([θ; 1])). (49) 20 . We need the following Lemma A.1 Let Θ∗ be a d × d symmetric positive definite matrix, let δ ∈ [0, 2], and let V be a closed convex subset of Sd+ such that −1/2 Θ ∈ V ⇒ {Θ  Θ∗ } & {kΘ1/2 Θ∗ − Ik ≤ δ} (50) −1 o (cf. (3)). Let also Ho := {H ∈ Sd : −Θ−1 ∗ ≺ H ≺ Θ∗ }. Then for all (H, Θ) ∈ H × V, − 21 ln Det(I − Θ1/2 HΘ1/2 ) ≤ Υ(H; Θ), (51) where 1/2 1/2 1/2 Υ(H; Θ) = − 21 ln Det(I − Θ∗ HΘ∗ ) + 21 Tr([Θ − Θ∗ ]H) + 1/2 δ(2 + δ)kΘ∗ HΘ∗ k2F 1/2 1/2 2(1 − kΘ∗ HΘ∗ k) (here k · k is the spectral, and k · kF - the Frobenius norm of a matrix). In addition, Υ(H, Θ) is continuous function on Ho × V which is convex in H ∈ H o and concave (in fact, affine) in Θ ∈ V Proof. For H ∈ Ho and Θ ∈ V fixed we have −1/2 1/2 1/2 −1/2 kΘ1/2 HΘ1/2 k = k[Θ1/2 Θ∗ ][Θ∗ HΘ∗ ][Θ1/2 Θ∗ ]T k −1/2 1/2 1/2 1/2 1/2 ≤ kΘ1/2 Θ∗ k2 kΘ∗ HΘ∗ k ≤ kΘ∗ HΘ∗ k =: d(H) −1/2 with d(H) < 1 for H ∈ Ho (we have used the fact that 0  Θ  Θ∗ implies kΘ1/2 Θ∗ that kABkF ≤ kAkkBkF , a similar computation yields 1/2 1/2 kΘ1/2 HΘ1/2 kF ≤ kΘ∗ HΘ∗ kF =: D(H) k ≤ 1). Noting (52) Besides this, setting F (X) = − ln Det(X) : int Sd+ → R and equipping Sd with the Frobenius inner 1/2 1/2 product, we have ∇F (X) = −X −1 , so that with R0 = Θ∗ HΘ∗ , R1 = Θ1/2 HΘ1/2 , and ∆ = R1 −R0 , we have for properly selected λ ∈ (0, 1) and Rλ = λR0 + (1 − λ)R1 : F (I − R1 ) = F (I − R0 − ∆) = F (I − R0 ) + h∇F (I − Rλ ), −∆i = F (I − R0 ) + h(I − Rλ )−1 , ∆i = F (I − R0 ) + hI, ∆i + h(I − Rλ )−1 − I, ∆i. We conclude that F (I − R1 ) ≤ F (I − R0 ) + Tr(∆) + kI − (I − Rλ )−1 kF k∆kF . 28 (53) Denoting by µi the eigenvalues of Rλ and noting that kRλ k ≤ max[kR0 k, kR1 k] = d(H) we get |µi | ≤ d(H). Therefore, the eigenvalues νi = 1 − 1 µi =− 1 − µi 1 − µi of I − (I − Rλ )−1 satisfy |νi | ≤ |µi |/(1 − µi ) ≤ |µi |/(1 − d(H)), whence kI − (I − Rλ )−1 kF ≤ kRλ kF /(1 − d(H)). Noting that kRλ kF ≤ max[kR0 kF , kR1 kF ] ≤ D(H), see (52), we conclude that kI − (I − Rλ )−1 kF ≤ D(H)/(1 − d(H)), and when substituting into (53) we get F (I − R1 ) ≤ F (I − R0 ) + Tr(∆) + D(H)k∆kF /(1 − d(H)). −1/2 Furthermore, because by (3) the matrix D = Θ1/2 Θ∗ 1/2 (54) − I satisfies kDk ≤ δ, 1/2 1/2 ∆ = |Θ1/2 HΘ HΘ = (I + D)R0 (I + DT ) − R0 = DR0 + R0 DT + DR0 DT . {z }−Θ | ∗ {z ∗ } R1 R0 Consequently, k∆kF ≤ kDR0 kF + kR0 DT kF + kDR0 DT kF ≤ [2kDk + kDk2 ]kR0 kF ≤ δ(2 + δ)kR0 kF = δ(2 + δ)D(H). This combines with (54) and the relation 1/2 1/2 Tr(∆) = Tr(Θ1/2 HΘ1/2 − Θ∗ HΘ∗ ) = Tr([Θ − Θ∗ ]H) to yield F (I − R1 ) ≤ F (I − R0 ) + Tr([Θ − Θ∗ ]H) + δ(2 + δ) 1/2 1/2 kΘ∗ HΘ∗ k2F , 1 − d(H) and we arrive at (51). It remains to prove that Υ(H; Θ) is convex-concave and continuous on Ho × V. The only component of this claim which is not completely evident is convexity of the function in H ∈ Ho . To see that it is indeed the case, note that ln Det(·) is concave on the interior of the u2 semidefinite cone, function f (u, v) = 1−v is convex and nondecreasing in u, v in the convex domain 1/2 Π = {(u, v) : u ≥ 0, v < 1}, and the function 1/2 1/2 1/2 1/2 kΘ∗ HΘ∗ k2F 1/2 1/2 1−kΘ∗ HΘ∗ k 1/2 is obtained from f by convex substitution of variables H 7→ (kΘ∗ HΘ∗ kF , kΘ∗ HΘ∗ k) mapping Ho into Π.  30 . Combining (51), (49), (5) and the origin of Ψ, see (48), we conclude that for all (θ, Θ) ∈ Rd × V and (h, H) ∈ F = Rd × Hγ ),   ln Eζ∼N (θ,Θ) exp{hT ζ + 21 ζ T Hζ} ≤ Φ(h, H; Θ, Z([θ; 1])). To complete the proof of (i), all we need is to verify the claim that F, M+ , Φ is regular data, which boils down to checking that Φ : F × M+ → R is continuous and convex-concave. Let us verify 29 convexity-concavity and continuity. Recalling that Υ(H; Θ) : F × V → R indeed is convex-concave and continuous, the verification in question reduces to checking that Γ(h, H; Z) is convex-concave and continuous on (Rd × Hγ ) × Z + . Continuity and concavity in Z being evident, all we need to prove is that whenever Z ∈ Z + , the function ΓZ (h, H) := Γ(h, H; Z) is convex in (h, H) ∈ F = Rd × Hγ . By the Schur Complement Lemma, we have       H h   T [H, h] G− 0 , hT G := {(h, H, G) : G  P [H, h]} = (h, H, G) :    [H, h] Θ−1 − H ∗ implying that G is convex. Now, since Z  0 due to Z ∈ Z + ⊂ Sm+1 , we have + {(h, H, τ ) : (h, H) ∈ Hγ , τ ≥ ΓZ (h, H)} = {(h, H, τ ) : (h, H) ∈ Hγ , ∃G : G  P [H, h], 2τ ≥ Tr(ZG)}, and because G is convex, so is the epigraph of ΓZ , as claimed. Item (i) of Proposition 2.1 is proved. 40 . It remains to verify item (ii) of Proposition 2.1 stating that Φ is coercive in h, H. Let Θ ∈ V, Z ∈ Z + , and (hi , Hi ) ∈ Rd ×Hγ with k(hi , Hi )k → ∞ as i → ∞, and let us prove that Φ(hi , Hi ; Θ, Z) → ∞. Looking at the expression for Φ(hi , Hi ; Θ, Z), it is immediately seen that all terms in this expression, except for the terms coming from Γ(hi , Hi ; Z), remain bounded as i grows, so that all we need to verify is that Γ(hi , Hi ; Z) → ∞ as i → ∞. Observe that the sequence {Hi }i is bounded due to Hi ∈ Hγ , implying that khi k2 → ∞ as i → ∞. Denoting by e the last basic orth of Rd+1 and taking into −1 satisfy αI  [Θ−1 − H ]−1  βI for some positive α, β due account that the matrices [Θ−1 i d d ∗ − Hi ] ∗ to Hi ∈ Hγ , observe that      T Hi hi T −1 −1 −1 + [Hi , hi ] [Θ∗ − Hi ] [Hi , hi ] = hTi [Θ−1 ∗ − Hi ] hi ee + Ri , T hi | {z } {z } | αi khi k2 2 Pi where αi ≥ α > 0 and kRi kF ≤ C(1 + khi k2 ). As a result, Γ(hi , Hi ; Z) ≥ Tr(ZPi ) = Tr(Z[αi khi k22 eeT + Ri ]) ≥ αi khi k22 Tr(ZeeT ) −kZkF kRi kF ≥ αkhi k22 − C(1 + khi k2 )kZkF , | {z } =Zm+1,m+1 =1 and the concluding quantity tends to ∞ as i → ∞ due to khi k2 → ∞, i → ∞. A.2  Proof of Proposition 2.2 Continuity and convexity-concavity of Φ and ΦM are obvious. Let us verify relations (9). Let us fix µ ∈ ∆d , and let and ζ K ∼ PµK . Let us denote SK the set of all permutations σ of {1, ..., K}, and let ω σ [ζ K ] = M 1 X ωσ2k−1 σ2k [ζ K ], σ ∈ SK . M k=1 By the symmetry argument we clearly have M X X σ∈SK k=1 ωσ2k−1 σ2k [ζ K ] = N X 1≤i6=j≤K 30 ζi ζjT = 2N X 1≤i<j≤K ωij [ζ K ], where N is the number of permutations σ ∈ SK such that a particular pair (i, j), 1 ≤ i 6= j ≤ K is met among the pairs (σ2k−1 , σ2k ), 1 ≤ k ≤ M . Comparing the total number of ωij -terms in the left and the right hand sides of the latter equality, we get Card(SK )M = N K(K − 1), which combines with the equality itself to imply that 2 K(K − 1) X 1≤i<j≤K ωij [ζ K ] = M X 1 X 1 ωσ2k−1 σ2k [ζ K ] = Card(SK ) M σ∈SK k=1 X 1 ω σ [ζ K ]. Card(SK ) (55) σ∈SK Let σid be the identity permutation of 1, ..., K. Due to (55) we have       X  1 Eζ K ∼PµK exp{Tr(Hω[ζ K ])} = Eζ K ∼PµK exp Tr(Hω σ [ζ K ])  Card(SK )   σ∈SK [by the Hölder inequality] ≤ Y h   Eζ K ∼PµK exp Tr(Hω σ [ζ K ]) i1/Card(SK ) σ∈SK  [because ω σ [ζ K ] are equally distributed ∀σ] = Eζ K ∼PµK exp{Tr(Hω σid [ζ K ])} (M  ) Y 1 [by definition of ω σid [·]] = Eζ K ∼PµK exp Tr(Hω2k−1,2k [ζ K ]) M k=1 iM h  . (56) [since ζ1 , ..., ζK are i.i.d.] = Eζ 2 ∼Pµ2 exp{Tr((H/M )ω12 [ζ 2 ])} The distribution of the random variable ω12 [ζ 2 ] = 12 [ζ1 ζ2T + ζ2 ζ1T ], ζ 2 ∼ Pµ2 , clearly is PZ[µ] , so that      ln Eζ 2 ∼Pµ2 exp{Tr((H/M )ω12 [ζ 2 ])} = ln EW ∼PZ[µ] {exp{Tr((H/M )W )}}   d X −1 = ln  eM Hij µi µj  = Φ(H/M ; Z(µ)). i,j=1 The latter relation combines with (56) to imply (9). A.3  Proof of Proposition 3.1 Let us first verify the identities (15) and (16). The function Θ(f, α; x) = αΦ(f /α, A(x)) − G(x) + α ln(2/) : F + × X → R is convex-concave and continuous, and X is compact. Hence, by Sion-Kakutani Theorem, b + (f ) := inf α {Ψ+ (f, α) + α ln(2/) : α > 0, (f, α) ∈ F + } Ψ = inf α>0,(f,α)∈F + maxx∈X Θ(f, α; x) = supx∈X inf α>0,(f,α)∈F + Θ(f, α; x) = supx∈X inf α>0,(f,α)∈F + [αΦ(f /α, A(x)) − G(x) + α ln(2/)] , b + is as required in (15). As we know, Ψ+ (f, α) is a real-valued continuous function on F + , so that Ψ convex on EF , provided that the function is real-valued. Now, let x̄ ∈ X , and let ψ be a subgradient of φ(f ) = Φ(f ; A(x̄)) taken at f = 0. For f ∈ EF and all α > 0 such that (f, α) ∈ F + we have Ψ+ (f, α) ≥ αΦ(f /α; A(x̄)) − G(x̄) + α ln(2/) ≥ α[Φ(0; A(x̄)) + hψ, f /αi] − G(x̄) + α ln(2/) ≥ hψ, f i − G(x̄) 31 (we have used (14)). Therefore, Ψ+ (f, α) is below bounded on the set {α > 0 : f /α ∈ F}. In addition, b + is real-valued and this set is nonempty, since F contains a neighbourhood of the origin. Thus, Ψ b convex on EF . Verification of (16) and of the fact that Ψ− (f ) is a real-valued convex function on EF is completely similar. Now, given a feasible solution (f¯, κ̄, ρ̄) to (17), let us select somehow ρe > ρ̄. Taking into account b ± , we can find ᾱ and β̄ such that the definition of Ψ (f¯, ᾱ) ∈ F + and Ψ+ (f¯, ᾱ) + ᾱ ln(2/) ≤ ρe − κ̄, (f¯, β̄) ∈ F + and Ψ− (f¯, β̄) + β̄ ln(2/) ≤ ρe + κ̄, implying that the collection (f¯, ᾱ, β̄, κ̄, ρe) is a feasible solution to (57). We need the following statement. Lemma A.2 Given  ∈ (0, 1), let f¯, ᾱ, β̄, κ̄, ρe be a feasible solution to the system of convex constraints (a) (b) (f, α) ∈ F + , α ln(/2) ≥ Ψ+ (f, α) − ρ + κ, (f, β) ∈ F + , β ln(/2) ≥ Ψ− (f, β) − ρ − κ, (57) in variables f , α, β, ρ, κ. Then the -risk of the estimate gb(ω) = hf¯, ωi + κ̄, is at most ρe. Proof. Let  ∈ (0, 1), f¯, ᾱ, β̄, κ̄, ρe satisfy the premise of Lemma, and let x ∈ X, P satisfy (11). We have Z  G(x)+e ρ−κ̄ G(x)+e ρ−κ̄ ¯ hf¯,ωi/ᾱ ᾱ ᾱ Probω∼P {b g (ω) > G(x) + ρe} ≤ e P (dω) e− ≤ eΦ(f /ᾱ,A(x)) e− . Thus ᾱ ln (Probω∼P {b g (ω) > G(x) + ρe}) ≤ ᾱΦ(f¯/ᾱ, A(x)) − G(x) − ρe + κ̄ [by definition of Ψ+ and due to x ∈ X] ≤ Ψ+ (f¯, ᾱ) − ρe + κ̄ [by (57.a)] ≤ ᾱ ln(/2), and we conclude that Probω∼P {b g (ω) > G(x) + ρe} ≤ /2. Similarly, Z Probω∼P {b g (ω) < G(x) − ρe} ≤ −hf¯,ωi/β̄ e  − P (dω) e −G(x)+e ρ+κ̄ β̄ ¯ ≤ eΦ(−f /β̄,A(x)) e G(x)−e ρ−κ̄ β̄ , whence β̄ ln (Probω∼P {b g (ω) < G(x) − ρe}) ≤ β̄Φ(−f¯/β̄, A(x)) + G(x) − ρe − κ̄ [by definition of Ψ− and due to x ∈ X] ≤ Ψ− (f¯, β̄) − ρe − κ̄ [by (57.b)] ≤ β̄ ln(/2), so that Probω∼P {b g (ω) < G(x) − ρe} ≤ /2.  When invoking Lemma A.2, we get Probω∼P {ω : |b g (ω) − G(x)| > ρe} ≤  for all (x ∈ X, P ∈ P) satisfying (11). Since ρe can be selected arbitrarily close to ρ̄, gb(·) indeed is a (ρ̄, )-accurate estimate.  32 A.4 Proof of Proposition 5.1 Under the premise of the proposition, let us fix u ∈ U , v ∈ V , so that x := (v, Z(u) := [u; 1][u; 1]T ) ∈ X. Denoting by P = Pu,v the distribution of ω := (ζ, ζζ T ) with ζ ∼ N (A[u; 1], M (v)), and invoking (5), we see that for just defined (x, P ), relation (11) takes place. Applying Proposition 3.2, we conclude that  Probζ K ∼[N (A[u;1],M (v))]K |b g (ζ K ) − G(x)| > ρ̄ ≤ . It remains to note that by construction it holds G (x = (v, Z([u; 1]))) = q T v+Tr(QZ([u; 1])) = q T v+Tr(Q[u; 1][u; 1]T ) = q T v+[u; 1]T Q[u, 1] = F (u, v). The “in particular” part of proposition is immediate – with ρ and κ given by (37), h, H, ρ, κ clearly satisfy (34).  A.5 Proof of Proposition 5.2 10 . By A.2, the columns of (d + 1) × (m + 1) matrix B, see (31), are linearly independent, so that we can find (m + 1) × (d + 1) matrix C such that CB = Im+1 . Let us define (h̄, H̄) ∈ Rd × Sd from the relation   H̄ h̄ = 2[C T QC]o , (58) T h̄ where for (d + 1) × (d + 1) matrix S, S o is the matrix obtained from S by replacing the entry Sd+1,d+1 with zero. 20 . Let us fix  ∈ (0, 1). Setting ρK = 1 2 h i bK bK Ψ + (h̄, H̄) + Ψ− (h̄, H̄) and invoking Proposition 5.1, all we need to prove is that in the case of A.1-2 one has h i K bK b lim sup Ψ ( h̄, H̄) + Ψ ( h̄, H̄) ≤ 0. + − (59) K→∞ To this end note that in our current situation, (5) and (33) simplify to   Φ(h, H; Z) = ln Det(I − + + [H, h] − H] [H, h] B , {z } P [H,h]     K −1 −1 −1 b , Ψ+ (h, H) = inf max αΦ(h/α, H/α; Z) − Tr(QZ) + K α ln(2/) : α > 0, −γαΘ∗  H  γαΘ∗ α  Z∈Z    K −1 −1 −1 b Ψ− (h, H) = inf max αΦ(−h/α, −H/α; Z) + Tr(QZ) + K α ln(2/) : α > 0, −γαΘ∗  H  γαΘ∗ . 1/2 1/2 Θ∗ HΘ∗ ) − 12 α    H T Z B hT | 1 2 Tr Z∈Z 33 h  T [Θ−1 ∗ −1 Hence, h   i K bK b Ψ ( h̄, H̄) + Ψ ( h̄, H̄) ≤ inf max αΦ(h̄/α, H̄/α; Z1 ) − Tr(QZ1 ) + Φ(−h̄/α, −H̄/α; Z2 ) + Tr(QZ2 ) + − α Z1 ,Z2 ∈Z   −1 +2K −1 α ln(2/) : α > 0, −γαΘ−1  H̄  γαΘ ∗ ∗    1/2 1/2 = inf max − 21 α ln Det I − [Θ∗ H̄Θ∗ ]2 /α2 + 2K −1 α ln(2/) + Tr(Q[Z2 − Z1 ]) α Z1 ,Z2 ∈Z     −1 + 12 αTr Z1 P [H̄/α, h̄/α] + αTr Z2 P [−H̄/α, −h̄/α] : α > 0, −γαΘ−1  H̄  γαΘ ∗ ∗    1/2 1/2 = inf max − 12 α ln Det I − [Θ∗ H̄Θ∗ ]2 /α2 + 2K −1 α ln(2/) α Z1 ,Z2 ∈Z    H̄ h̄ −1 + Tr(Q[Z2 − Z1 ]) + 12 Tr([Z1 − Z2 ]B T [H̄, h̄]B B) + 12 Tr Z1 B T [H̄, h̄]T [αΘ−1 ∗ − H̄] T h̄ {z } | T [Z1 ,Z2 ]   1 T T −1 −1 −1 −1 + 2 Tr Z2 B [H̄, h̄] [αΘ∗ + H̄] [H̄, h̄]B : α > 0, −γαΘ∗  H̄  γαΘ∗ (60) By (58) we have 21 B T  H̄ h̄T h̄  B = B T [C T QC + J]B, where the only nonzero entry, if any, in the (d + 1) × (d + 1) matrix J is Jd+1,d+1 . Due to the structure of B, see (31), we conclude that the only nonzero element, if any, in J¯ = B T JB is J¯m+1,m+1 , and that 1 T 2B  H̄ h̄T h̄  B = (CB)T Q(CB) + J¯ = Q + J¯ (recall that CB = Im+1 ). Now, whenever Z ∈ Z, one has Zm+1,m+1 = 1, whence 1 2 Tr([Z1 − Z2 ]B T  H̄ h̄T h̄  ¯ = Tr([Z1 − Z2 ]Q), B) = Tr([Z1 − Z2 ]Q) + Tr([Z1 − Z2 ]J) implying that the quantity T [Z1 , Z2 ] in (60) is zero, provided Z1 , Z2 ∈ Z. Consequently, (60) becomes h i b K (h̄, H̄) + Ψ b K (h̄, H̄) Ψ + −  ≤ inf max α Z1 ,Z2 ∈Z   1/2 1/2 − 21 α ln Det I − [Θ∗ H̄Θ∗ ]2 /α2 + 2K −1 α ln(2/)  −1 [H̄, h̄]T B + 21 Tr Z1 B T [H̄, h][αΘ−1 ∗ − H̄]  −1 −1 + 12 Tr Z2 B T [H̄, h̄]T [αΘ−1 [H̄, h̄]B : α > 0, −γαΘ−1 ∗ + H̄] ∗  H̄  γαΘ∗ (61) Now, for appropriately selected independent of K real c > 0 we have for α ≥ c:   1/2 1/2 − 21 α ln Det I − [Θ∗ H̄Θ∗ ]2 /α2 ≤ c/α, and 1 2 Tr  1  −1 T T −1 −1 Z1 B T [H̄, h̄]T [αΘ−1 ∗ − H̄] [H̄, h̄]B + 2 Tr Z2 B [H̄, h̄] [αΘ∗ + H̄] [H̄, h̄]B ≤ c/α for all Z1 , Z2 ∈ Z (recall that Z is bounded). Consequently, given ω > 0, we can find α = αω > 0 large enough to ensure that −1 −γαω Θ−1 and 2c/αω ≤ ω, ∗  H̄  γαω Θ∗ which combines with (61) to imply that h i K bK b Ψ ( h̄, H̄) + Ψ ( h̄, H̄) ≤ ω + 2K −1 αω ln(2/), + − and (59) follows.  34
10math.ST
arXiv:1603.06160v2 [math.OC] 4 Apr 2016 Stochastic Variance Reduction for Nonconvex Optimization Sashank J. Reddi sjakkamr@cs.cmu.edu Carnegie Mellon University Ahmed Hefny ahefny@cs.cmu.edu Carnegie Mellon University Suvrit Sra suvrit@mit.edu Massachusetts Institute of Technology Barnabás Póczós bapoczos@cs.cmu.edu Carnegie Mellon University Alex Smola alex@smola.org Carnegie Mellon University Original circulated date: 5th February, 2016. Abstract We study nonconvex finite-sum problems and analyze stochastic variance reduced gradient (Svrg) methods for them. Svrg and related methods have recently surged into prominence for convex optimization given their edge over stochastic gradient descent (Sgd); but their theoretical analysis almost exclusively assumes convexity. In contrast, we prove non-asymptotic rates of convergence (to stationary points) of Svrg for nonconvex optimization, and show that it is provably faster than Sgd and gradient descent. We also analyze a subclass of nonconvex problems on which Svrg attains linear convergence to the global optimum. We extend our analysis to mini-batch variants of Svrg, showing (theoretical) linear speedup due to mini-batching in parallel settings. 1 Introduction We study nonconvex finite-sum problems of the form n min f (x) := x∈Rd 1X fi (x), n i=1 (1) where neither f nor the individual fi (i ∈ [n]) are necessarily convex; just Lipschitz smooth (i.e., Lipschitz continuous gradients). We use Fn to denote all functions of the form (1). We optimize such functions in the Incremental First-order Oracle (IFO) framework (Agarwal & Bottou, 2014) defined below. Definition 1. For f ∈ Fn , an IFO takes an index i ∈ [n] and a point x ∈ Rd , and returns the pair (fi (x), ∇fi (x)). 1 Algorithm Sgd GradientDescent Svrg Msvrg Nonconvex  O 1/2 Convex  O 1/2 Gradient Dominated  O 1/2 O (n/) O (n/)  √ O n + ( n/)   √ O min 1/2 , n/ O (nτ log(1/))  O n + (n2/3 /)   O min 1/2 , n2/3 /  O (n + n2/3 τ ) log(1/) − Fixed Step Size? × √ √ × Table 1: Table comparing the IFO complexity of different algorithms discussed in the paper. The complexity is measured in terms of the number of oracle calls required to achieve an -accurate solution (see Definition 2). Here, by fixed step size, we mean that the step size of the algorithm is fixed and does not dependent on  (or alternatively T , the total number of iterations). The complexity of gradient dominated functions refers to the number of IFO calls required to obtain -accurate solution for a τ -gradient dominated function (see Section 2 for the definition). For Sgd, we are not aware of any specific results for gradient dominated functions. Also, [f (x0 ) − f (x∗ )] and kx0 − x∗ k (where x0 is the initial point and x∗ is an optimal solution to (1)) are assumed to be constant for a clean comparison. The results marked in red are the contributions of this paper. IFO based complexity analysis was introduced to study lower bounds for finite-sum problems. Algorithms that use IFOs are favored in large-scale applications as they require only a small amount first-order information at each iteration. Two fundamental models in machine learning that profit from IFO algorithms are (i) empirical risk minimization, which typically uses convex finite-sum models; and (ii) deep learning, which uses nonconvex ones. The prototypical IFO algorithm, stochastic gradient descent (Sgd)1 has witnessed tremendous progress in the recent years. By now a variety of accelerated, parallel, and faster converging versions are known. Among these, of particular importance are variance reduced (VR) stochastic methods (Schmidt et al., 2013; Johnson & Zhang, 2013; Defazio et al., 2014a), which have delivered exciting progress such as linear convergence rates (for strongly convex functions) as opposed to sublinear rates of ordinary Sgd (Robbins & Monro, 1951; Nemirovski et al., 2009). Similar (but not same) benefits of VR methods can also be seen in smooth convex functions. The Svrg algorithm of (Johnson & Zhang, 2013) is particularly attractive here because of its low storage requirement in comparison to the algorithms in (Schmidt et al., 2013; Defazio et al., 2014a). Despite the meteoric rise of VR methods, their analysis for general nonconvex problems is largely missing. Johnson & Zhang (2013) remark on convergence of Svrg when f ∈ Fn is locally strongly convex and provide compelling experimental results (Fig. 4 in (Johnson & Zhang, 2013)). However, problems encountered in practice are typically not even locally convex, let alone strongly convex. The current analysis of Svrg does not extend to nonconvex functions as it relies heavily on convexity for controlling the variance. Given the dominance of stochastic gradient methods in optimizing deep neural nets and other large nonconvex models, theoretical investigation of faster nonconvex stochastic methods is much needed. Convex VR methods are known to enjoy the faster convergence rate of GradientDescent but with a much weaker dependence on n, without compromising the rate like Sgd. However, it is not clear if these benefits carry beyond convex problems, prompting the central question of this paper: For nonconvex functions in Fn , can one achieve convergence rates faster than both Sgd and GradientDescent using an IFO? If so, then how does the rate depend on n and on the number of iterations performed by the algorithm? Perhaps surprisingly, we provide an affirmative answer to this question by showing that a careful selection of parameters in Svrg leads to faster convergence than both Sgd and GradientDescent. 1 We use ‘incremental gradient’ and ‘stochastic gradient’ interchangeably, though we are only interested in finite-sum problems. 2 To our knowledge, ours is the first work to improve convergence rates of Sgd and GradientDescent for IFO-based nonconvex optimization. Main Contributions. We summarize our main contributions below and also list the key results in Table 1. • We analyze nonconvex stochastic variance reduced gradient (Svrg), and prove that it has faster rates of convergence than GradientDescent and ordinary Sgd. We show that Svrg is faster than GradientDescent by a factor of n1/3 (see Table 1). • We provide new theoretical insights into the interplay between step-size, iteration complexity and convergence of nonconvex Svrg (see Corollary 2). • For an interesting nonconvex subclass of Fn called gradient dominated functions (Polyak, 1963; Nesterov & Polyak, 2006), we propose a variant of Svrg that attains a global linear rate of convergence. We improve upon many prior results for this subclass of functions (see Section 3.1). To the best of our knowledge, ours is the first work that shows a stochastic method with linear convergence for gradient dominated functions. • We analyze mini-batch nonconvex Svrg and show that it provably benefits from mini-batching. Specifically, we show theoretical linear speedups in parallel settings for large mini-batch sizes. By using a mini-batch of size b (< n2/3 ), we show that mini-batch nonconvex Svrg is faster by a factor of b (Theorem 7). We are not aware of any prior work on mini-batch first-order stochastic methods that shows linear speedup in parallel settings for nonconvex optimization. • Our analysis yields as a byproduct a direct convergence analysis for Svrg for smooth convex functions (Section 4). • We examine a variant of Svrg (called Msvrg) that has faster rates than both GradientDescent and Sgd. 1.1 Related Work Convex. Bertsekas (2011) surveys several incremental gradient methods for convex problems. A key reference for stochastic convex optimization (for min Ez [F (x, z)]) is (Nemirovski et al., 2009). Faster rates of convergence are attained for problems in Fn by VR methods, see e.g., (Defazio et al., 2014a; Johnson & Zhang, 2013; Schmidt et al., 2013; Konečný et al., 2015; Shalev-Shwartz & Zhang, 2013; Defazio et al., 2014b). Asynchronous VR frameworks are developed in (Reddi et al., 2015). Agarwal & Bottou (2014); Lan & Zhou (2015) study lower-bounds for convex finite-sum problems. ShalevShwartz (2015) prove linear convergence of stochastic dual coordinate ascent when the individual fi (i ∈ [n]) are nonconvex but f is strongly convex. They do not study the general nonconvex case. Moreover, even in their special setting our results improve upon theirs for the high condition number regime. Nonconvex. Sgd dates at least to the seminal work (Robbins & Monro, 1951); and since then it has been developed in several directions (Poljak & Tsypkin, 1973; Ljung, 1977; Bottou, 1991; Kushner & Clark, 2012). In the (nonsmooth) finite-sum setting, Sra (2012) considers proximal splitting methods, and analyzes asymptotic convergence with nonvanishing gradient errors. Hong (2014) studies a distributed nonconvex incremental ADMM algorithm. These works, however, only prove expected convergence to stationary points and often lack analysis of rates. The first nonasymptotic convergence rate analysis for Sgd is in (Ghadimi & Lan, 2013), who show that Sgd ensures k∇f k2 ≤  in O(1/2 ) iterations. A similar rate for parallel and distributed Sgd was shown recently in (Lian et al., 2015). GradientDescent is known to ensure k∇f k2 ≤  in O(1/) iterations (Nesterov, 2003, Chap. 1.2.3). The first analysis of nonconvex Svrg seems to be due to Shamir (2014), who considers the special problem of computing a few leading eigenvectors (e.g., for PCA); see also the follow up work (Shamir, 2015). Finally, we note another interesting example, stochastic optimization of locally quasi-convex functions (Hazan et al., 2015), wherein actually a O(1/2 ) convergence in function value is shown. 3 2 Background & Problem Setup We say f is L-smooth if there is a constant L such that k∇f (x) − ∇f (y)k ≤ Lkx − yk, ∀ x, y ∈ Rd . Throughout, we assume that the functions fi in (1) are L-smooth, so that k∇fi (x) − ∇fi (y)k ≤ Lkx − yk for all i ∈ [n]. Such an assumption is very common in the analysis of first-order methods. Here the Lipschitz constant L is assumed to be independent of n. A function f is called λ-strongly convex if there is λ ≥ 0 such that f (x) ≥ f (y) + h∇f (y), x − yi + λ2 kx − yk2 ∀x, y ∈ Rd . The quantity κ := L/λ is called the condition number of f , whenever f is L-smooth and λ-strongly convex. We say f is non-strongly convex when f is 0-strongly convex. We also recall the class of gradient dominated functions (Polyak, 1963; Nesterov & Polyak, 2006), where a function f is called τ -gradient dominated if for any x ∈ Rd f (x) − f (x∗ ) ≤ τ k∇f (x)k2 , (2) where x∗ is a global minimizer of f . Note that such a function f need not be convex; it is also easy to show that a λ-strongly convex function is 1/2λ-gradient dominated. We analyze convergence rates for the above classes of functions. Following Nesterov (2003); Ghadimi & Lan (2013) we use k∇f (x)k2 ≤  to judge when is iterate x approximately stationary. Contrast this with Sgd for convex f , where one uses [f (x) − f (x∗ )] or kx − x∗ k2 as a convergence criterion. Unfortunately, such criteria cannot be used for nonconvex functions due to the hardness of the problem. While the quantities k∇f (x)k2 and f (x) − f (x∗ ) or kx − x∗ k2 are not comparable in general (see (Ghadimi & Lan, 2013)), they are typically assumed to be of similar magnitude. Throughout our analysis, we do not assume n to be constant, and report dependence on it in our results. For our analysis, we need the following definition. Definition 2. A point x is called -accurate if k∇f (x)k2 ≤ . A stochastic iterative algorithm is said to achieve -accuracy in t iterations if E[k∇f (xt )k2 ] ≤ , where the expectation is over the stochasticity of the algorithm. We introduce one more definition useful in the analysis of Sgd methods for bounding the variance. Definition 3. We say f ∈ Fn has a σ-bounded gradient if k∇fi (x)k ≤ σ for all i ∈ [n] and x ∈ Rd . 2.1 Nonconvex SGD: Convergence Rate Stochastic gradient descent (Sgd) is one of the simplest algorithms for solving (1); Algorithm 1 lists its pseudocode. By using a uniformly randomly chosen (with replacement) index it from [n], Sgd Algorithm 1 SGD −1 Input: x0 ∈ Rd , Step-size sequence: {ηt > 0}Tt=0 for t = 0 to T − 1 do Uniformly randomly pick it from {1, . . . , n} xt+1 = xt − ηt ∇fit (x) end for uses an unbiased estimate of the gradient at each iteration. Under appropriate conditions, Ghadimi & Lan (2013) establish convergence rate of Sgd to a stationary point of f . Their results include the following theorem. 4 q √ 0 )−f (x∗ )) Theorem 1. Suppose f has σ-bounded gradient; let ηt = η = c/ T where c = 2(f (x Lσ , and 2 ∗ x is an optimal solution to (1). Then, the iterates of Algorithm 1 satisfy r 2(f (x0 ) − f (x∗ ))L t 2 σ. min E[k∇f (x )k ] ≤ 0≤t≤T −1 T For completeness we present a proof in the appendix. Note that our choice of step size η requires √ knowing the total number of iterations T in advance. A more practical approach is to use a ηt ∝ 1/ t or 1/t. A bound on IFO calls made by Algorithm 1 follows as a corollary of Theorem 1. Corollary 1. Suppose function f has σ-bounded gradient, then the IFO complexity of Algorithm 1 to obtain an -accurate solution is O(1/2 ). √ As seen in Theorem 1, Sgd has a convergence rate of O(1/ T ). This rate is not improvable in general even when the function is (non-strongly) convex (Nemirovski & Yudin, 1983). This barrier is due to the variance introduced by the stochasticity of the gradients, and it is not clear if better rates can be obtained Sgd even for convex f ∈ Fn . 3 Nonconvex SVRG We now turn our focus to variance reduced methods. We use Svrg (Johnson & Zhang, 2013), an algorithm recently shown to be very effective for reducing variance in convex problems. As a result, it has gained considerable interest in both machine learning and optimization communities. We seek to understand its benefits for nonconvex optimization. For reference, Algorithm 2 presents Svrg’s pseudocode. Observe that Algorithm 2 operates in epochs. At the end of epoch s, a full gradient is calculated at the point x̃s , requiring n calls to the IFO. Within its inner loop Svrg performs m stochastic updates. The total number of IFO calls for each epoch is thus Θ(m + n). For m = 1, the algorithm reduces to the classic GradientDescent algorithm. Suppose m is chosen to be O(n) (typically used in practice), then the total IFO calls per epoch is Θ(n). To enable a fair comparison with Sgd, we assume that the total number of inner iterations across all epochs in Algorithm 2 is T . Also note a simple but important implementation detail: as written, Algorithm 2 requires storing all the iterates xs+1 (0 ≤ t ≤ m). This storage can be avoided by keeping a running average with respect to t the probability distribution {pi }m i=0 . Algorithm 2 attains linear convergence for strongly convex f (Johnson & Zhang, 2013); for nonstrongly convex functions, rates faster than Sgd can be shown by using an indirect perturbation argument—see e.g., (Konečný & Richtárik, 2013; Xiao & Zhang, 2014). We first state an intermediate result for the iterates of nonconvex Svrg. To ease exposition, we define  ct+1 ηt Γt = η t − − ηt2 L − 2ct+1 ηt2 , (3) βt for some parameters ct+1 and βt (to be defined shortly). Our first main result is the following theorem that provides convergence rate of Algorithm 2. Theorem 2. Let f ∈ Fn . Let cm = 0, ηt = η > 0, βt = β > 0, and ct = ct+1 (1 + ηβ + 2η 2 L2 ) + η 2 L3 such that Γt > 0 for 0 ≤ t ≤ m − 1. Define the quantity γn := mint Γt . Further, let pi = 0 for 0 ≤ i < m and pm = 1, and let T be a multiple of m. Then for the output xa of Algorithm 2 we have E[k∇f (xa )k2 ] ≤ where x∗ is an optimal solution to (1). 5 f (x0 ) − f (x∗ ) , T γn m−1 Algorithm 2 SVRG x0 , T, m, {pi }m i=0 , {ηi }i=0  1: Input: x̃0 = x0m = x0 ∈ Rd , epoch length m, step sizes {ηi > 0}m−1 i=0 , S = dT /me, discrete probability distribution {pi }m i=0 2: for s = 0 to S − 1 do 3: xs+1 = xsmP 0 s+1 s 4: g = n1 n i=1 ∇fi (x̃ ) 5: for t = 0 to m − 1 do 6: Uniformly randomly pick it from {1, . . . , n} 7: vts+1 = ∇fit (xs+1 ) − ∇fit (x̃s ) + g s+1 t s+1 s+1 8: xt+1 = xt − ηt vts+1 9: end forP s+1 10: x̃s+1 = m i=0 pi xi 11: end for S−1 12: Output: Iterate xa chosen uniformly random from {{xs+1 }m−1 t t=0 }s=0 . Furthermore, we can also show that nonconvex Svrg exhibits expected descent (in objective) after every epoch. The condition that T is a multiple of m is solely for convenience and can be removed by slight modification of the theorem statement. Note that the value γn above can depend on n. To obtain an explicit dependence, we simplify it using specific choices for η and β, as formalized below. Theorem 3. Suppose f ∈ Fn . Let η = µ0 /(Lnα ) (0 < µ0 < 1 and 0 < α ≤ 1), β = L/nα/2 , m = bn3α/2 /(3µ0 )c and T is some multiple of m. Then there exists universal constants µ0 , ν > 0 such that we have the following: γn ≥ Lnν α in Theorem 2 and Lnα [f (x0 ) − f (x∗ )] , Tν where x∗ is an optimal solution to the problem in (1) and xa is the output of Algorithm 2. E[k∇f (xa )k2 ] ≤ By rewriting the above result in terms IFO calls, we get the following general corollary for nonconvex Svrg. Corollary 2. Suppose f ∈ Fn . Then the IFO complexity of Algorithm 2 (with parameters from Theorem 3) for achieving an -accurate solution is: (  α O n + (n1− 2 /) , if α < 2/3, IFO calls = O (n + (nα /)) , if α ≥ 2/3. Corollary 2 shows the interplay between step size and the IFO complexity. We observe that the number of IFO calls is minimized in Corollary 2 when α = 2/3. This gives rise to the following key results of the paper. Corollary 3. Suppose f ∈ Fn . Let η = µ1 /(Ln2/3 ) (0 < µ1 < 1), β = L/n1/3 , m = bn/(3µ1 )c and T is some multiple of m. Then there exists universal constants µ1 , ν1 > 0 such that we have the 1 in Theorem 2 and following: γn ≥ Lnν2/3 E[k∇f (xa )k2 ] ≤ Ln2/3 [f (x0 ) − f (x∗ )] , T ν1 where x∗ is an optimal solution to the problem in (1) and xa is the output of Algorithm 2. Corollary 4. If f ∈ Fn , then the IFO complexity of Algorithm 2 (with parameters in Corollary 3) to obtain an -accurate solution is O(n + (n2/3 /)). √ Note the rate of O(1/T ) in the above results, as opposed to slower O(1/ T ) rate of Sgd (Theorem 1). For a more comprehensive comparison of the rates, refer to Section 6. 6 m−1 Algorithm 3 GD-SVRG x0 , K, T, m, {pi }m i=0 , {ηi }i=0  m Input: x0 ∈ Rd , K, epoch length m, step sizes {ηi > 0}m−1 i=0 , discrete probability distribution {pi }i=0 for k = 0 to K do m−1 xk = SVRG(xk−1 , T, m, {pi }m i=0 , {ηi }i=0 ) end for Output: xK 3.1 Gradient Dominated Functions Before ending our discussion on convergence of nonconvex Svrg, we prove a linear convergence rate for the class of τ -gradient dominated functions (2). For ease of exposition, assume that τ > n1/3 , a property analogous to the “high condition number regime” for strongly convex functions typical in machine learning. Note that gradient dominated functions can be nonconvex. Theorem 4. Suppose f is τ -gradient dominated where τ > n1/3 . Then, the iterates of Algorithm 3 with T = d2Lτ n2/3 /ν1 e, m = bn/(3µ1 )c, ηt = µ1 /(Ln2/3 ) for all 0 ≤ t ≤ m − 1 and pm = 1 and pi = 0 for all 0 ≤ i < m satisfy E[k∇f (xk )k2 ] ≤ 2−k [k∇f (x0 )k2 ]. Here µ1 and ν1 are the constants used in Corollary 3. In fact, for τ -gradient dominated functions we can prove a stronger result of global linear convergence. Theorem 5. If f is τ -gradient dominated (τ > n1/3 ), then with T = d2Lτ n2/3 /ν1 e, m = bn/(3µ1 )c, ηt = µ1 /(Ln2/3 ) for 0 ≤ t ≤ m − 1 and pm = 1 and pi = 0 for all 0 ≤ i < m, the iterates of Algorithm 3 satisfy E[f (xk ) − f (x∗ )] ≤ 2−k [f (x0 ) − f (x∗ )]. Here µ1 , ν1 are as in Corollary 3; x∗ is an optimal solution. An immediate consequence is the following. Corollary 5. If f is τ -gradient dominated, the IFO complexity of Algorithm 3 (with parameters from Theorem 4) to compute an -accurate solution is O((n + τ n2/3 ) log(1/)). Note that GradientDescent can also achieve linear convergence rate for gradient dominated functions (Polyak, 1963). However, GradientDescent requires O(n + nτ log(1/)) IFO calls to obtain an -accurate solution as opposed to O(n + n2/3 τ log(1/)) for Svrg. Similar (but not the same) gains can be seen for Svrg for strongly convex functions (Johnson & Zhang, 2013). Also notice that we did not assume anything except smoothness on the individual functions fi in the above results. In particular, the following corollary is also an immediate consequence. Corollary 6. If f is λ-strongly convex and the functions {fi }ni=1 are possibly nonconvex, then the number of IFO calls made by Algorithm 3 (with parameters from Theorem 4) to compute an -accurate solution is O((n + n2/3 κ) log(1/)). Recall that here κ denotes the condition number L/λ for a λ-strongly convex function. Corollary 6 follows from Corollary 5 upon noting that λ-strongly convex function is 1/2λ-gradient dominated. Theorem 5 generalizes the linear convergence result in (Johnson & Zhang, 2013) since it allows nonconvex fi . Observe that Corollary 6 also applies when fi is strongly convex for all i ∈ [n], though in this case a more refined result can be proved (Johnson & Zhang, 2013). Finally, we note that our result also improves on a recent result on Sdca in the setting of Corollary 6 when the condition number κ is reasonably large – a case that typically arises in machine 7 learning. More precisely, for l2 -regularized empirical loss minimization, Shalev-Shwartz (2015) show that Sdca requires O((n + κ2 ) log(1/) iterations when the fi ’s are possibly nonconvex but their sum f is strongly convex. In comparison, we show that Algorithm 3 requires O((n + n2/3 κ) log(1/)) iterations, which is an improvement over Sdca when κ > n2/3 . 4 Convex Case In the previous section, we showed nonconvex Svrg converges to a stationary point at the rate O(n2/3 /T ). A natural question is whether this rate can be improved if we assume convexity? We provide an affirmative answer. For non-strongly convex functions, this yields a direct analysis (i.e., not based on strongly convex perturbations) for Svrg. While we state our results in terms of stationarity gap k∇f (x)k2 for the ease of comparison, our analysis also provides rates with respect to the optimality gap [f (x) − f (x∗ )] (see the proof of Theorem 6 in the appendix). Theorem 6. If fi is convex for all i ∈ [n], pi = 1/m for 0 ≤ i ≤ m − 1, and pm = 0, then for Algorithm 2, we have Lkx0 − x∗ k2 + 4mL2 η 2 [f (x0 ) − f (x∗ )] , T η(1 − 4Lη) E[k∇f (xa )k2 ] ≤ where x∗ is optimal for (1) and xa is the output of Algorithm 2. We now state corollaries of this theorem that explicitly show the dependence on n in the convergence rates. √ Corollary 7. If m = n and η = 1/(8L n) in Theorem 6, then we have the following bound: E[k∇f (xa )k2 ] ≤ √ L n(16Lkx0 − x∗ k2 + [f (x0 ) − f (x∗ )]) , T where x∗ is optimal for (1) and xa is the output of Algorithm 2. The above result uses a step size that depends on n. For the convex case, we can also use step sizes independent of n. The following corollary states the associated result. Corollary 8. If m = n and η = 1/(8L) in Theorem 6, then we have the following bound: E[k∇f (xa )k2 ] ≤ L(16Lkx0 − x∗ k2 + n[f (x0 ) − f (x∗ )]) , T where x∗ is optimal for (1) and xa is the output of Algorithm 2. We can rewrite these corollaries in terms of IFO complexity to get the following corollaries. Corollary 9. If fi is convex for all i ∈ [n], then the IFO complexity √ of Algorithm 2 (with parameters from Corollary 7) to compute an -accurate solution is O(n + ( n/)). Corollary 10. If fi is convex for all i ∈ [n], then the IFO complexity of Algorithm 2 (with parameters from Corollary 8) to compute -accurate solution is O(n/). These results follow from Corollary 7 and Corollary 8 and noting that for m = O(n) the total IFO calls made by Algorithm 2 is O(n). It is instructive to quantitatively compare Corollary 9 and Corollary10. With a step size independent of n, the convergence rate of Svrg √ has a dependence that is in the order of n (Corollary 8). But this dependence can be reduced to n by either carefully selecting a step size that diminishes with n (Corollary 7) or by using a good initial point x0 obtained by, say, running O(n) iterations of Sgd. We emphasize that the convergence rate for convex case can be improved significantly by slightly modifying the algorithm (either by adding an appropriate strongly convex perturbation (Xiao & Zhang, 2014) or by using a choice of m that changes with epoch (Zhu & Yuan, 2015)). However, it is not clear if these strategies provide any theoretical gains for the general nonconvex case. 8 5 Mini-batch Nonconvex SVRG In this section, we study the mini-batch version of Algorithm 2. Mini-batching is a popular strategy, especially in multicore and distributed settings as it greatly helps one exploit parallelism and reduce the communication costs. The pseudocode for mini-batch nonconvex Svrg (Algorithm 4) is provided in the supplement due to lack of space. The key difference between the mini-batch Svrg and Algorithm 2 lies in lines 6 to 8. To use mini-batches we replace line 6 with sampling (with replacement) a mini-batch It ⊂ [n] of size b; lines 7 to 8 are replaced with the following updates: X  ∇fit (xs+1 ) − ∇fit (x̃s ) + g s+1 , us+1 = |I1t | t t it ∈It s+1 xs+1 − ηt us+1 t t+1 = xt When b = 1, this reduces to Algorithm 2. Mini-batch is typically used to reduce the variance of the stochastic gradient and increase the parallelism. Lemma 4 (in Section G of the appendix) shows the reduction in the variance of stochastic gradients with mini-batch size b. Using this lemma, one can derive the mini-batch equivalents of Lemma 1, Theorem 2 and Theorem 3. However, for the sake of brevity, we directly state the following main result for mini-batch Svrg. Theorem 7. Let γ n denote the following quantity: γ n := min 0≤t≤m−1 2 η− 2 ct+1 η β 2  − η 2 L − 2ct+1 η 2 . 3 where cm = 0, ct = ct+1 (1 + ηβ + 2η L /b) + ηt L /b for 0 ≤ t ≤ m − 1. Suppose η = µ2 b/(Ln2/3 ) (0 < µ2 < 1), β = L/n1/3 , m = bn/(3bµ2 )c and T is some multiple of m. Then for the mini-batch version of Algorithm 2 with mini-batch size b < n2/3 , there exists universal constants µ2 , ν2 > 0 such ν2 b that we have the following: γ n ≥ Ln 2/3 and E[k∇f (xa )k2 ] ≤ Ln2/3 [f (x0 ) − f (x∗ )] , bT ν2 where x∗ is optimal for (1). It is important to√compare this result with mini-batched Sgd. For a batch size of b, Sgd obtains a rate of O(1/ bT√) (Dekel et al., 2012) (obtainable by a simple modification of Theorem 1). Specifically, Sgd has a 1/ b dependence on the batch size. In contrast, Theorem 7 shows that Svrg has a much better dependence of 1/b on the batch size. Hence, compared to Sgd, Svrg allows more efficient mini-batching. More formally, in terms of IFO queries we have the following result. Corollary 11. If f ∈ Fn , then the IFO complexity of the mini-batch version of Algorithm 2 (with parameters from Theorem 7 and mini-batch size b < n2/3 ) to obtain an -accurate solution is O(n + (n2/3 /)). Corollary 11 shows an interesting property of mini-batch Svrg. First, note that b IFO calls are required for calculating the gradient on a mini-batch of size b. Hence, Svrg does not gain on IFO complexity by using mini-batches. However, if the b gradients are calculated in parallel, then this leads to a theoretical linear speedup in multicore and distributed settings. In contrast, Sgd does not yield an efficient mini-batch strategy as it requires O(b1/2 /2 ) IFO calls for achieving an -accurate solution (Li et al., 2014). Thus, the performance of Sgd degrades with mini-batching. 6 Comparison of the convergence rates In this section, we give a comprehensive comparison of results obtained in this paper. In particular, we compare key aspects of the convergence rates for Sgd, GradientDescent, and Svrg. The comparison is based on IFO complexity to achieve an -accurate solution. 9 Dependence on n: The number of IFO calls of Svrg and GradientDescent depend explicitly on n. In contrast, the number of oracle calls of Sgd is independent of n (Theorem 1). However, this comes at the expense of worse dependence on . The number of IFO calls in GradientDescent is proportional to n. But for Svrg this dependence reduces to n1/2 for convex (Corollary 7) and n2/3 for nonconvex (Corollary 3) problems. Whether this difference in dependence on n is due to nonconvexity or just an artifact of our analysis is an interesting open problem. Dependence on : The dependence on  (or alternatively T ) follows from the convergence rates of the algorithms. Sgd is seen to depend as O(1/2 ) on , regardless of convexity or nonconvexity. In contrast, for both convex and nonconvex settings, Svrg and GradientDescent converge as O(1/). Furthermore, for gradient dominated functions, Svrg and GradientDescent have global linear convergence. This speedup in convergence over Sgd is especially significant when medium to high accuracy solutions are required (i.e.,  is small). Assumptions used in analysis: It is important to understand the assumptions used in deriving the convergence rates. All algorithms assume Lipschitz continuous gradients. However, Sgd requires two additional subtle but important assumptions: σ-bounded gradients and advance knowledge of T (since its step sizes depend on T ). On the other hand, both Svrg and GradientDescent do not require these assumptions, and thus, are more flexible. Step size / learning rates: It is valuable to compare the step sizes used by the algorithms. The step sizes of Sgd shrink as the number of iterations T increases—an undesirable property. On the other hand, the step sizes of Svrg and GradientDescent are independent of T . Hence, both these algorithms can be executed with a fixed step size. However, Svrg uses step sizes that depend on n (see Corollary 3 and Corollary 7). A step size independent of n can be used for Svrg for convex f , albeit at cost of worse dependence on n (Corollary 8). GradientDescent does not have this issue as its step size is independent of both n and T . Dependence on initial point and mini-batch: Svrg is more sensitive to the initial point in comparison to Sgd. This can be seen by comparing Corollary 3 (of Svrg) to Theorem 1 (of Sgd). Hence, it is important to use a good initial point for Svrg. Similarly, a good mini-batch can be beneficial to Svrg. Moreover, mini-batches not only provides parallelism but also good theoretical guarantees (see Theorem 7). In contrast, the performance gain in Sgd with mini-batches is not very pronounced (see Section 5). 7 Best of two worlds We have seen in the previous section that Svrg combines the benefits of both GradientDescent and Sgd. We now show that these benefits of Svrg can be made more pronounced by an appropriate step size under additional assumptions. In this case, the IFO complexity of Svrg is lower than those of Sgd and GradientDescent. This variant of Svrg (Msvrg) chooses a step size based on the total number of iterations T (or alternatively ). For our discussion below, we assume that T > n. √ Theorem 8. Let f ∈ Fn have σ-bounded gradients. Let ηt = ηq = max{c/ T , µ1/(Ln2/3 )} (µ1 is the f (x0 )−f (x∗ ) universal constant from Corollary 3), m = bn/(3µ1 )c, and c = . Further, let T be a 2Lσ 2 multiple of m, pm = 1, and pi = 0 for 0 ≤ i < m. Then, the output xa of Algorithm 2 satisfies E[k∇f (xa )k2 ] r n 2(f (x0 ) − f (x∗ ))L Ln2/3 [f (x0 ) − f (x∗ )] o ≤ ν̄ min 2 σ, , T T ν1 where ν̄ is a universal constant, ν1 is the universal constant from Corollary 3 and x∗ is an optimal solution to (1). Corollary 12. If f ∈ Fn has σ-bounded gradients, the IFO complexity of Algorithm 2 (with parameters from Theorem 8) to achieve an -accurate solution is O(min{1/2 , n2/3 /}). 10 SGD SVRG 10 -1 k∇f(x t )k 2 1.55 10 -2 10 -3 1.50 10 -4 100 200 300 # grad / n 0.380 10 -50 400 SGD SVRG 0.375 0.370 0.365 0.360 0.355 0.350 0 50 100 150 200 # grad / n 250 10 -1 10 -2 10 -3 10 -4 10 -5 10 -6 10 -7 10 -8 10 -90 100 200 300 # grad / n 300 400 0.54 0.52 0.50 0.48 0.46 0.44 0.42 0.40 0.380 SGD SVRG 100 200 300 # grad / n 1.9 SGD SVRG 50 100 150 200 # grad / n 250 300 400 SGD SVRG 1.8 Training loss 1.45 0 SGD SVRG 10 0 k∇f(x t )k 2 Training loss 1.60 Training loss 10 1 Test Error 1.65 1.7 1.6 1.5 1.40 50 100 150 200 # grad / n 250 300 Figure 1: Neural network results for CIFAR-10, MNIST and STL-10 datasets. The top row represents the results for CIFAR-10 dataset. The bottom left and middle figures represent the results for MNIST dataset. The bottom right figure represents the result for STL-10. An almost identical reasoning can be applied when f is convex to get the bounds specified in Table 1. Hence, we omit the details and directly state the following result. Corollary 13. Suppose fi is convex for i ∈ [n] and √ f has σ-bounded gradients, then the IFO √ complexity of Algorithm 2 (with step size η = max{1/(L T ), 1/(8L n)}, m √ = n and pi = 1/m for 0 ≤ i ≤ m − 1 and pm = 0) to achieve an -accurate solution is O(min{1/2 , n/}). Msvrg has a convergence rate faster than those of both Sgd and Svrg, though this benefit is not without cost. Msvrg, in contrast to Svrg, uses the additional assumption of σ-bounded gradients. Furthermore, its step size is not fixed since it depends on the number of iterations T . While it is often difficult in practice to compute the step size of Msvrg (Theorem 8), it is typical to try multiple step sizes and choose the one with the best results. 8 Experiments We present our empirical results in this section. For our experiments, we study the problem of multiclass classification using neural networks. This is a typical nonconvex problem encountered in machine learning. Experimental Setup. We train neural networks with one fully-connected hidden layer of 100 nodes and 10 softmax output nodes. We use `2 -regularization for training. We use CIFAR-102 , MNIST3 , and STL-104 datasets for our experiments. These datasets are standard in the neural networks literature. The `2 regularization is 1e-3 for CIFAR-10 and MNIST, and 1e-2 for STL-10. The features in the datasets are normalized to the interval [0, 1]. All the datasets come with a predefined split into training and test datasets. We compare Sgd (the de-facto algorithm for training neural networks) against nonconvex Svrg. The step size (or learning rate) is critical for Sgd. We set the learning rate of Sgd using the popular t−inverse schedule ηt = η0 (1 + η 0 bt/nc)−1 , where η0 and η 0 are chosen so that Sgd gives the best 2 www.cs.toronto.edu/ ~kriz/cifar.html 3 http://yann.lecun.com/exdb/mnist/ 4 https://cs.stanford.edu/ ~acoates/stl10/ 11 performance on the training loss. In our experiments, we also use η 0 = 0; this results in a fixed step size for Sgd. For Svrg, we use a fixed step size as suggested by our analysis. Again, the step size is chosen so that Svrg gives the best performance on the training loss. Initialization & mini-batching. Initialization is critical to training of neural networks. We use the p normalized initialization in (Glorot & Bengio, 2010) where parameters are chosen uniformly p from [− 6/(ni + no ), 6/(ni + no )] where ni and no are the number of input and output layers of the neural network, respectively. For Svrg, we use n iterations of Sgd for CIFAR-10 and MINST and 2n iterations of Sgd for STL-10 before running Algorithm 2. Such initialization is standard for variance reduced schemes even for convex problems (Johnson & Zhang, 2013; Schmidt et al., 2013). As noted earlier in Section 6, Svrg is more sensitive than Sgd to the initial point, so such an initialization is typically helpful. We use mini-batches of size 10 in our experiments. Sgd with mini-batches is common in training neural networks. Note that mini-batch training is especially beneficial for Svrg, as shown by our analysis in Section 5. Along the lines of theoretical analysis provided by Theorem 7, we use an epoch size m = n/10 in our experiments. Results. We report objective function (training loss), test error (classification error on the test set), and k∇f (xt )k2 (convergence criterion throughout our analysis) for the datasets. For all the algorithms, we compare these criteria against the number of effective passes through the data, i.e., IFO calls divided by n. This includes the cost of calculating the full gradient at the end of each epoch of Svrg. Due to the Sgd initialization in Svrg and mini-batching, the Svrg plots start from x-axis value of 10 for CIFAR-10 and MNIST and 20 for STL-10. Figure 1 shows the results for our experiment. It can be seen that the k∇f (xt )k2 for Svrg is lower compared to Sgd, suggesting faster convergence to a stationary point. Furthermore, the training loss is also lower compared to Sgd in all the datasets. Notably, the test error for CIFAR-10 is lower for Svrg, indicating better generalization; we did not notice substantial difference in test error for MNIST and STL-10 (see Section H in the appendix). Overall, these results on a network with one hidden layer are promising; it will be interesting to study Svrg for deep neural networks in the future. 9 Discussion In this paper, we examined a VR scheme for nonconvex optimization. We showed that by employing VR in stochastic methods, one can perform better than both Sgd and GradientDescent in the context of nonconvex optimization. When the function f in (1) is gradient dominated, we proposed a variant of Svrg that has linear convergence to the global minimum. Our analysis shows that Svrg has a number of interesting properties that include convergence with fixed step size, descent property after every epoch; a property that need not hold for Sgd. We also showed that Svrg, in contrast to Sgd, enjoys efficient mini-batching, attaining speedups linear in the size of the minibatches in parallel settings. Our analysis also reveals that the initial point and use of mini-batches are important to Svrg. Before concluding the paper, we would like to discuss the implications of our work and few caveats. One should exercise some caution while interpreting the results in the paper. All our theoretical results are based on the stationarity gap. In general, this does not necessarily translate to optimality gap or low training loss and test error. One criticism against VR schemes in nonconvex optimization is the general wisdom that variance in the stochastic gradients of Sgd can actually help it escape local minimum and saddle points. In fact, Ge et al. (2015) add additional noise to the stochastic gradient in order to escape saddle points. However, one can reap the benefit of VR schemes even in such scenarios. For example, one can envision an algorithm which uses Sgd as an exploration tool to obtain a good initial point and then uses a VR algorithm as an exploitation tool to quickly converge to a good local minimum. In either case, we believe variance reduction can be used as an important tool alongside other tools like momentum, adaptive learning rates for faster and better nonconvex optimization. 12 References Agarwal, Alekh and Bottou, Leon. arXiv:1410.0723, 2014. A lower bound for the optimization of finite sums. Bertsekas, Dimitri P. Incremental gradient, subgradient, and proximal methods for convex optimization: A survey. In S. Sra, S. Nowozin, S. Wright (ed.), Optimization for Machine Learning. MIT Press, 2011. Bottou, Léon. Stochastic gradient learning in neural networks. Proceedings of Neuro-Nımes, 91(8), 1991. Defazio, Aaron, Bach, Francis, and Lacoste-Julien, Simon. SAGA: A fast incremental gradient method with support for non-strongly convex composite objectives. In NIPS 27, pp. 1646–1654, 2014a. Defazio, Aaron J, Caetano, Tibério S, and Domke, Justin. Finito: A faster, permutable incremental gradient method for big data problems. arXiv:1407.2710, 2014b. Dekel, Ofer, Gilad-Bachrach, Ran, Shamir, Ohad, and Xiao, Lin. Optimal distributed online prediction using mini-batches. The Journal of Machine Learning Research, 13(1):165–202, January 2012. ISSN 1532-4435. Ge, Rong, Huang, Furong, Jin, Chi, and Yuan, Yang. Escaping from saddle points - online stochastic gradient for tensor decomposition. In Proceedings of The 28th Conference on Learning Theory, COLT 2015, pp. 797–842, 2015. Ghadimi, Saeed and Lan, Guanghui. Stochastic first- and zeroth-order methods for nonconvex stochastic programming. SIAM Journal on Optimization, 23(4):2341–2368, 2013. doi: 10.1137/ 120880811. Glorot, Xavier and Bengio, Yoshua. Understanding the difficulty of training deep feedforward neural networks. In In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS10), 2010. Hazan, Elad, Levy, Kfir, and Shalev-Shwartz, Shai. Beyond convexity: Stochastic quasi-convex optimization. In Advances in Neural Information Processing Systems, pp. 1585–1593, 2015. Hong, Mingyi. A distributed, asynchronous and incremental algorithm for nonconvex optimization: An admm based approach. arXiv preprint arXiv:1412.6058, 2014. Johnson, Rie and Zhang, Tong. Accelerating stochastic gradient descent using predictive variance reduction. In NIPS 26, pp. 315–323, 2013. Konečný, Jakub and Richtárik, Peter. Semi-Stochastic Gradient Descent Methods. arXiv:1312.1666, 2013. Konečný, Jakub, Liu, Jie, Richtárik, Peter, and Takáč, Martin. Mini-Batch Semi-Stochastic Gradient Descent in the Proximal Setting. arXiv:1504.04407, 2015. Kushner, Harold Joseph and Clark, Dean S. Stochastic approximation methods for constrained and unconstrained systems, volume 26. Springer Science & Business Media, 2012. Lan, Guanghui and Zhou, Yi. arXiv:1507.02000, 2015. An optimal randomized incremental gradient method. Li, Mu, Zhang, Tong, Chen, Yuqiang, and Smola, Alexander J. Efficient mini-batch training for stochastic optimization. In Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’14, pp. 661–670. ACM, 2014. Lian, Xiangru, Huang, Yijun, Li, Yuncheng, and Liu, Ji. Asynchronous Parallel Stochastic Gradient for Nonconvex Optimization. In NIPS, 2015. Ljung, Lennart. Analysis of recursive stochastic algorithms. Automatic Control, IEEE Transactions on, 22(4):551–575, 1977. 13 Nemirovski, A., Juditsky, A., Lan, G., and Shapiro, A. Robust stochastic approximation approach to stochastic programming. SIAM Journal on Optimization, 19(4):1574–1609, 2009. Nemirovski, Arkadi and Yudin, D. Problem Complexity and Method Efficiency in Optimization. John Wiley and Sons, 1983. Nesterov, Yurii. Introductory Lectures On Convex Optimization: A Basic Course. Springer, 2003. Nesterov, Yurii and Polyak, Boris T. Cubic regularization of newton method and its global performance. Mathematical Programming, 108(1):177–205, 2006. Poljak, BT and Tsypkin, Ya Z. Pseudogradient adaptation and training algorithms. Automation and Remote Control, 34:45–67, 1973. Polyak, B.T. Gradient methods for the minimisation of functionals. USSR Computational Mathematics and Mathematical Physics, 3(4):864–878, January 1963. Reddi, Sashank, Hefny, Ahmed, Sra, Suvrit, Poczos, Barnabas, and Smola, Alex J. On variance reduction in stochastic gradient descent and its asynchronous variants. In NIPS 28, pp. 2629– 2637, 2015. Robbins, H. and Monro, S. A stochastic approximation method. Annals of Mathematical Statistics, 22:400–407, 1951. Schmidt, Mark W., Roux, Nicolas Le, and Bach, Francis R. Minimizing Finite Sums with the Stochastic Average Gradient. arXiv:1309.2388, 2013. Shalev-Shwartz, Shai. SDCA without duality. CoRR, abs/1502.06177, 2015. Shalev-Shwartz, Shai and Zhang, Tong. Stochastic dual coordinate ascent methods for regularized loss. The Journal of Machine Learning Research, 14(1):567–599, 2013. Shamir, Ohad. A stochastic PCA and SVD algorithm with an exponential convergence rate. arXiv:1409.2848, 2014. Shamir, Ohad. Fast stochastic algorithms for SVD and PCA: Convergence properties and convexity. arXiv:1507.08788, 2015. Sra, Suvrit. Scalable nonconvex inexact proximal splitting. In NIPS, pp. 530–538, 2012. Xiao, Lin and Zhang, Tong. A proximal stochastic gradient method with progressive variance reduction. SIAM Journal on Optimization, 24(4):2057–2075, 2014. Zhu, Zeyuan Allen and Yuan, Yang. Univr: A universal variance reduction framework for proximal stochastic gradient method. CoRR, abs/1506.01972, 2015. Appendix A Nonconvex SGD: Convergence Rate Proof of Theorem 1 q √ 0 )−f (x∗ )) , and Theorem. Suppose f has σ-bounded gradient; let ηt = η = c/ T where c = 2(f (x Lσ 2 x∗ is an optimal solution to (1). Then, the iterates of Algorithm 1 satisfy q 0 (x∗ ))L min E[k∇f (xt )k2 ] ≤ 2(f (x )−f σ. T 0≤t≤T −1 Proof. We include the proof here for completeness. Please refer to (Ghadimi & Lan, 2013) for a more general result. 14 The iterates of Algorithm 1 satisfy the following bound: E[f (xt+1 )] ≤ E[f (xt ) + ∇f (xt ), xt+1 − xt + t+1 L 2 kx − xt k2 ] t t (4) 2 ≤ E[f (x )] − ηt E[k∇f (x )k ] + ≤ E[f (xt )] − ηt E[k∇f (xt )k2 ] + Lηt2 t 2 2 E[k∇fit (x )k ] Lηt2 2 2 σ . (5) The first inequality follows from Lipschitz continuity of ∇f . The second inequality follows from the update in Algorithm 1 and since Eit [∇fit (xt )] = ∇f (xt ) (unbiasedness of the stochastic gradient). The last step uses our assumption on gradient boundedness. Rearranging Equation (5) we obtain E[k∇f (xt )k2 ] ≤ t 1 ηt E[f (x ) − f (xt+1 )] + Lηt 2 2 σ . (6) Summing Equation (6) from t = 0 to T − 1 and using that ηt is constant η we obtain min E[k∇f (xt )k2 ] ≤ t ≤ ≤ ≤ 1 T XT −1 t=0 E[kf (xt )k2 ] Lη 2 0 T 1 T η E[f (x ) − f (x )] + 2 σ Lη 2 0 ∗ 1 T η (f (x ) − f (x )) + 2 σ √1 T   f (x0 ) − f (x∗ ) + 1 c Lc 2 2 σ  . The first step holds because the minimum is less than the average. The second and third steps ∗ T are obtained from Equation √ (6) and the fact that f (x ) ≤ f (x ), respectively. The final inequality follows upon using η = c/ T . By setting r 2(f (x0 ) − f (x∗ )) c= Lσ 2 in the above inequality, we get the desired result. B Nonconvex SVRG In this section, we provide the proofs of the results for nonconvex Svrg. We first start with few useful lemmas and then proceed towards the main results. Lemma 1. For ct , ct+1 , βt > 0, suppose we have ct = ct+1 (1 + ηt βt + 2ηt2 L2 ) + ηt2 L3 . Let ηt , βt and ct+1 be chosen such that Γt > 0 (in Equation (3)). The iterate xs+1 in Algorithm 2 t satisfy the bound: E[k∇f (xs+1 )k2 ] ≤ t s+1 Rts+1 − Rt+1 , Γt where Rts+1 := E[f (xs+1 ) + ct kxs+1 − x̃s k2 ] for 0 ≤ s ≤ S − 1. t t Proof. Since f is L-smooth we have s+1 s+1 E[f (xs+1 ) + h∇f (xs+1 ), xs+1 i t t+1 )] ≤ E[f (xt t+1 − xt + s+1 L 2 kxt+1 15 − xs+1 k2 ]. t Using the Svrg update in Algorithm 2 and its unbiasedness, the right hand side above is further upper bounded by E[f (xs+1 ) − ηt k∇f (xs+1 )k2 + t t Lηt2 s+1 2 k ]. 2 kvt (7) Consider now the Lyapunov function Rts+1 := E[f (xs+1 ) + ct kxs+1 − x̃s k2 ]. t t For bounding it we will require the following: s+1 s+1 s 2 E[kxs+1 + xs+1 − x̃s k2 ] t t+1 − x̃ k ] = E[kxt+1 − xt s+1 2 = E[kxs+1 k + kxs+1 − x̃s k2 t t+1 − xt s+1 + 2hxs+1 , xs+1 − x̃s i] t t+1 − xt = E[ηt2 kvts+1 k2 + kxs+1 − x̃s k2 ] t − 2ηt E[h∇f (xs+1 ), xs+1 − x̃s i] t t ≤ E[ηt2 kvts+1 k2 + kxs+1 − x̃s k2 ] t i h )k2 + 21 βt kxs+1 − x̃s k2 . + 2ηt E 2β1 t k∇f (xs+1 t t (8) The second equality follows from the unbiasedness of the update of Svrg. The last inequality follows from a simple application of Cauchy-Schwarz and Young’s inequality. Plugging Equation (7) and s+1 Equation (8) into Rt+1 , we obtain the following bound: Lηt2 s+1 2 k ] 2 kvt s+1 s 2 ct+1 kxt − x̃ k ] s+1 Rt+1 ≤ E[f (xs+1 ) − ηt k∇f (xs+1 )k2 + t t + E[ct+1 ηt2 kvts+1 k2 + h i s+1 2 s 2 1 )k + + 2ct+1 ηt E 2β1 t k∇f (xs+1 β kx − x̃ k t t t 2   ct+1 ηt s+1 2 s+1 k∇f (xt )k ≤ E[f (xt ) − ηt − βt  2  Lη + 2 t + ct+1 ηt2 E[kvts+1 k2 ]   + (ct+1 + ct+1 ηt βt ) E kxs+1 − x̃s k2 . t (9) To further bound this quantity, we use Lemma 3 to bound E[kvts+1 k2 ], so that upon substituting it in Equation (9), we see that s+1 Rt+1 ≤ E[f (xs+1 )] t   ηt 2 2 − η L − 2c η E[k∇f (xs+1 )k2 ] − ηt − ct+1 t+1 t t t βt      + ct+1 1 + ηt βt + 2ηt2 L2 + ηt2 L3 E kxs+1 − x̃s k2 t  ηt ≤ Rts+1 − ηt − ct+1 − ηt2 L − 2ct+1 ηt2 E[k∇f (xs+1 )k2 ]. t βt The second inequality follows from the definition of ct and Rts+1 , thus concluding the proof. Proof of Theorem 2 Theorem. Let f ∈ Fn . Let cm = 0, ηt = η > 0, βt = β > 0, and ct = ct+1 (1 + ηβ + 2η 2 L2 ) + η 2 L3 such that Γt > 0 for 0 ≤ t ≤ m − 1. Define the quantity γn := mint Γt . Further, let pi = 0 for 16 0 ≤ i < m and pm = 1, and let T be a multiple of m. Then for the output xa of Algorithm 2 we have E[k∇f (xa )k2 ] ≤ f (x0 ) − f (x∗ ) , T γn where x∗ is an optimal solution to (1). Proof. Since ηt = η for t ∈ {0, . . . , m − 1}, using Lemma 1 and telescoping the sum, we obtain Xm−1 t=0 E[k∇f (xs+1 )k2 ] ≤ t s+1 R0s+1 − Rm . γn This inequality in turn implies that Xm−1 t=0 E[k∇f (xs+1 )k2 ] ≤ t E[f (x̃s ) − f (x̃s+1 )] , γn (10) s+1 s+1 )] (since cm = 0, pm = 1, and pi = 0 for i < m), = E[f (xs+1 where we used that Rm m )] = E[f (x̃ s+1 s+1 s s and that R0 = E[f (x̃ )] (since x0 = x̃ , as pm = 1 and pi = 0 for i < m). Now sum over all epochs to obtain S−1 m−1 1 XX f (x0 ) − f (x∗ ) E[k∇f (xs+1 )k2 ] ≤ . t T s=0 t=0 T γn (11) The above inequality used the fact that x̃0 = x0 . Using the above inequality and the definition of xa in Algorithm 2, we obtain the desired result. Proof of Theorem 3 Theorem. Suppose f ∈ Fn . Let η = µ0 /(Lnα ) (0 < µ0 < 1 and 0 < α ≤ 1), β = L/nα/2 , m = bn3α/2 /(3µ0 )c and T is some multiple of m. Then there exists universal constants µ0 , ν > 0 such that we have the following: γn ≥ Lnν α in Theorem 2 and E[k∇f (xa )k2 ] ≤ Lnα [f (x0 ) − f (x∗ )] , Tν where x∗ is an optimal solution to the problem in (1) and xa is the output of Algorithm 2. µ2 L m Proof. For our analysis, we will require an upper bound on c0 . We observe that c0 = n02α (1+θ)θ −1 where θ = 2η 2 L2 + ηβ. This is obtained using the relation ct = ct+1 (1 + ηβ + 2η 2 L2 ) + η 2 L3 and the fact that cm = 0. Using the specified values of β and η we have θ = 2η 2 L2 + ηβ = µ0 3µ0 2µ20 + 3α/2 ≤ 3α/2 . n2α n n The above inequality follows since µ0 ≤ 1 and n ≥ 1. Using the above bound on θ, we get c0 = ≤ µ20 L (1 + θ)m − 1 µ0 L((1 + θ)m − 1) = n2α θ 2µ0 + nα/2 µ0 L((1 + 3µ0 bn3α/2/3µ0 c ) n3α/2 2µ0 + nα/2 ≤ n−α/2 (µ0 L(e − 1)), 17 − 1) (12) wherein the second inequality follows upon noting that (1+ 1l )l is increasing for l > 0 and liml→∞ (1+ 1 l l ) = e (here e is the Euler’s number). Now we can lower bound γn , as  η − η 2 L − 2ct+1 η 2 γn = min η − ct+1 β t  ν ≥ η − cβ0 η − η 2 L − 2c0 η 2 ≥ , Lnα where ν is a constant independent of n. The first inequality holds since ct decreases with t. The second inequality holds since (a) c0 /β is upper bounded by a constant independent of n as c0 /β ≤ µ0 (e − 1) (follows from Equation (12)), (b) η 2 L ≤ µ0 η and (c) 2c0 η 2 ≤ 2µ20 (e − 1)η (follows from Equation (12)). By choosing µ0 (independent of n) appropriately, one can ensure that γn ≥ ν/(Lnα ) for some universal constant ν. For example, choosing µ0 = 1/4, we have γn ≥ ν/(Lnα ) with ν = 1/40. Substituting the above lower bound in Equation (11), we obtain the desired result. Proof of Corollary 2 Corollary. Suppose f ∈ Fn . Then the IFO complexity of Algorithm 2 (with parameters from Theorem 3) for achieving an -accurate solution is: (  α O n + (n1− 2 /) , if α < 2/3, IFO calls = O (n + (nα /)) , if α ≥ 2/3. Proof. This result follows from Theorem 3 and the fact that m = bn3α/2 /(3µ0 )c. Suppose α < 2/3, then m = o(n). However, n IFO calls are invested in calculating the average gradient at the end of each epoch. In other words, computation of average gradient requires n IFO calls for every m α  iterations of the algorithm. Using this relationship, we get O n + (n1− 2 /) in this case. On the other hand, when α ≥ 2/3, the total number of IFO calls made by Algorithm 2 in each epoch is Ω(n) since m = bn3α/2 /(3µ0 )c. Hence, the oracle callsrequired for calculating the average gradient (per epoch) is of lower order, leading to O n + (nα /) IFO calls. C GD-SVRG Proof of Theorem 4 Theorem. Suppose f is τ -gradient dominated where τ > n1/3 . Then, the iterates of Algorithm 3 with T = d2Lτ n2/3 /ν1 e, m = bn/(3µ1 )c, ηt = µ1 /(Ln2/3 ) for all 0 ≤ t ≤ m − 1 and pm = 1 and pi = 0 for all 0 ≤ i < m satisfy E[k∇f (xk )k2 ] ≤ 2−k [k∇f (x0 )k2 ]. Here µ1 and ν1 are the constants used in Corollary 3. Proof. Corollary 3 shows that the iterates of Algorithm 3 satisfy E[k∇f (xk )k2 ] ≤ Ln2/3 E[f (xk−1 ) − f (x∗ )] . T ν1 Substituting the specified value of T in the above inequality, we have  1 E[k∇f (xk )k2 ] ≤ E[f (xk−1 ) − f (x∗ )] 2τ ≤ 12 E[k∇f (xk−1 )k2 ]. The second inequality follows from τ -gradient dominance of the function f . 18 Proof of Theorem 5 Theorem. If f is τ -gradient dominated (τ > n1/3 ), then with T = d2Lτ n2/3 /ν1 e, m = bn/(3µ1 )c, ηt = µ1 /(Ln2/3 ) for 0 ≤ t ≤ m − 1 and pm = 1 and pi = 0 for all 0 ≤ i < m, the iterates of Algorithm 3 satisfy E[f (xk ) − f (x∗ )] ≤ 2−k [f (x0 ) − f (x∗ )]. Here µ1 , ν1 are as in Corollary 3; x∗ is an optimal solution. Proof. The proof mimics that of Theorem 4; now we have the following condition on the iterates of Algorithm 3: E[k∇f (xk )k2 ] ≤ E[f (xk−1 ) − f (x∗ )] . 2τ (13) However, f is τ -gradient dominated, so E[k∇f (xk )k2 ] ≥ E[f (xk ) − f (x∗ )]/τ , which combined with Equation (13) concludes the proof. D Convex SVRG: Convergence Rate Proof of Theorem 6 Theorem. If fi is convex for all i ∈ [n], pi = 1/m for 0 ≤ i ≤ m − 1, and pm = 0, then for Algorithm 2, we have E[k∇f (xa )k2 ] ≤ Lkx0 − x∗ k2 + 4mL2 η 2 [f (x0 ) − f (x∗ )] , T η(1 − 4Lη) where x∗ is optimal for (1) and xa is the output of Algorithm 2. Proof. Consider the following sequence of inequalities: s+1 ∗ 2 E[kxs+1 − ηvts+1 − x∗ k2 ] t+1 − x k ] = E[kxt ≤ E[kxs+1 − x∗ k2 ] + η 2 E[kvts+1 k2 ] t − 2ηE[hvts+1 , xs+1 − x∗ i] t ≤ E[kxs+1 − x∗ k2 ] + η 2 E[kvts+1 k2 ] t − 2ηE[f (xs+1 ) − f (x∗ )] t ≤ E[kxs+1 − x∗ k2 ] − 2η(1 − 2Lη)E[f (xs+1 ) − f (x∗ )] t t + 4Lη 2 E[f (x̃s ) − f (x∗ )] = E[kxs+1 − x∗ k2 ] − 2η(1 − 4Lη)E[f (xs+1 ) − f (x∗ )] t t + 4Lη 2 E[f (x̃s ) − f (x∗ )] − 4Lη 2 E[f (xs+1 ) − f (x∗ )]. t The second inequality uses unbiasedness of the Svrg update and convexity of f . The third inequality follows from Lemma 6. Defining the Lyapunov function P s := E[kxsm − x∗ k2 ] + 4mLη 2 E[f (x̃s ) − f (x∗ )], and summing the above inequality over t, we get 2η(1 − 4Lη) m−1 X E[f (xs+1 ) − f (x∗ )] ≤ P s − P s+1 . t t=0 19 Algorithm 4 Mini-batch SVRG 1: Input: x̃0 = x0m = x0 ∈ Rd , epoch length m, step sizes {ηi > 0}m−1 i=0 , S = dT /me, discrete probability distribution {pi }m i=0 , mini-batch size b 2: for s = 0 to S − 1 do 3: xs+1 = xsmP 0 s+1 s 4: g = n1 n i=1 ∇fi (x̃ ) 5: for t = 0 to m − 1 do 6: Choose a P mini-batch (uniformly random with replacement) It ⊂ [n] of size b s+1 1 7: us+1 = ) − ∇fit (x̃s )) + g s+1 t it ∈It (∇fit (xt b s+1 8: xs+1 − ηt us+1 t t+1 = xt 9: end forP s+1 10: x̃s+1 = m i=0 pi xi 11: end for S−1 12: Output: Iterate xa chosen uniformly random from {{xs+1 }m−1 t t=0 }s=0 . This due is to the fact that ∗ 2 2 s+1 P s+1 = E[kxs+1 ) − f (x∗ )] m − x k ] + 4mLη E[f (x̃ ∗ 2 2 = E[kxs+1 m − x k ] + 4Lη m−1 X E[f (xs+1 ) − f (x∗ )]. t t=0 The above equality uses the fact that pm = 0 and pi = 1/m for 0 ≤ i < m. Summing over all epochs and telescoping we then obtain −1 E[f (xa ) − f (x∗ )] ≤ P 0 2T η(1 − 4Lη) . The inequality also uses the definition of xa given in Alg 2. On this inequality we use Lemma 5, which yields E[k∇f (xa )k2 ] ≤ 2LE[f (xa ) − f (x∗ )] ≤ Lkx0 − x∗ k2 + 4mL2 η 2 [f (x0 ) − f (x∗ )] . T η(1 − 4Lη) It is easy to see that we can obtain convergence rates for E[f (xa ) − f (x∗ )] from the above reasoning. This leads to a direct analysis of Svrg for convex functions. E Minibatch Nonconvex SVRG Proof of Theorem 7 The proofs essentially follow along the lines of Lemma 1, Theorem 2 and Theorem 3 with the added complexity of mini-batch. We first prove few intermediate results before proceeding to the proof of Theorem 7. Lemma 2. Suppose we have s+1 Rt := E[f (xs+1 ) + ct kxs+1 − x̃s k2 ], t t ct = ct+1 (1 + ηt βt + 20 2ηt2 L2 η 2 L3 )+ t , b b for 0 ≤ s ≤ S − 1 and 0 ≤ t ≤ m − 1 and the parameters ηt , βt and ct+1 are chosen such that   ct+1 ηt − ηt2 L − 2ct+1 ηt2 ≥ 0. ηt − βt Then the iterates xs+1 in the mini-batch version of Algorithm 2 i.e., Algorithm 4 with mini-batch t size b satisfy the bound: s+1 E[k∇f (xs+1 )k2 ] ≤  t Rt ηt − ct+1 ηt βt s+1 − Rt+1 − ηt2 L − 2ct+1 ηt2 , Proof. Using essentially the same argument as the proof of Lemma. 1 until Equation (9), we have   s+1 ηt Rt+1 ≤ E[f (xs+1 ) − ηt − ct+1 k∇f (xs+1 )k2 t t βt  2  Lη + 2 t + ct+1 ηt2 E[kus+1 k2 ] t   − x̃s k2 . (14) + (ct+1 + ct+1 ηt βt ) E kxs+1 t We use Lemma 4 in order to bound E[kus+1 k2 ] in the above inequality. Substituting it in Equat tion (14), we see that s+1 Rt+1 ≤ E[f (xs+1 )] t   ct+1 ηt − ηt − βt − ηt2 L − 2ct+1 ηt2 E[k∇f (xs+1 )k2 ] t h i   2η 2 L2  η 2 L3 + tb E kxs+1 + ct+1 1 + ηt βt + tb − x̃s k2 t  s+1 ηt − ηt2 L − 2ct+1 ηt2 E[k∇f (xs+1 )k2 ]. ≤ Rt − ηt − ct+1 t βt s+1 The second inequality follows from the definition of ct and Rt , thus concluding the proof. Our intermediate key result is the following theorem that provides convergence rate of mini-batch Svrg. Theorem 9. Let γ n denote the following quantity: γ n := min 0≤t≤m−1 η− ct+1 η β  − η 2 L − 2ct+1 η 2 . 2η 2 L2 η 2 L3 Suppose ηt = η and βt = β for all t ∈ {0, . . . , m − 1}, cm = 0, ct = ct+1 (1 + ηt βt + tb ) + tb for t ∈ {0, . . . , m − 1} and γ n > 0. Further, let pm = 1 and pi = 0 for 0 ≤ i < m. Then for the output xa of mini-batch version of Algorithm 2 with mini-batch size b, we have E[k∇f (xa )k2 ] ≤ f (x0 ) − f (x∗ ) , T γn where x∗ is an optimal solution to (1). Proof. Since ηt = η for t ∈ {0, . . . , m − 1}, using Lemma 2 and telescoping the sum, we obtain Xm−1 t=0 s+1 E[k∇f (xs+1 )k2 ] ≤ t 21 R0 s+1 − Rm . γn This inequality in turn implies that Xm−1 t=0 E[k∇f (xs+1 )k2 ] ≤ t E[f (x̃s ) − f (x̃s+1 )] , γn s+1 s+1 where we used that Rm = E[f (xs+1 )] (since cm = 0, pm = 1, and pi = 0 for i < m), m )] = E[f (x̃ s+1 s+1 s s and that R0 = E[f (x̃ )] (since x0 = x̃ , as pm = 1 and pi = 0 for i < m). Now sum over all epochs and using the fact that x̃0 = x0 , we get the desired result. We now present the proof of Theorem 7 using the above results. Theorem. Let γ n denote the following quantity: γ n := min 0≤t≤m−1 2 ct+1 η β η− 2 2  − η 2 L − 2ct+1 η 2 . 3 where cm = 0, ct = ct+1 (1 + ηβ + 2η L /b) + ηt L /b for 0 ≤ t ≤ m − 1. Suppose η = µ2 b/(Ln2/3 ) (0 < µ2 < 1), β = L/n1/3 , m = bn/(3bµ2 )c and T is some multiple of m. Then for the mini-batch version of Algorithm 2 with mini-batch size b < n2/3 , there exists universal constants µ2 , ν2 > 0 such ν2 b that we have the following: γ n ≥ Ln 2/3 and E[k∇f (xa )k2 ] ≤ Ln2/3 [f (x0 ) − f (x∗ )] , bT ν2 where x∗ is optimal for (1). Proof of Theorem 7. We first observe that using the specified values of β and η we obtain θ := 2η 2 L2 2µ22 b µ2 b 3µ2 b + ηβ = 4/3 ≤ . + b n n n The above inequality follows since µ2 ≤ 1 and n ≥ 1. For our analysis, we will require the following bound on c0 : c0 = µ22 b2 L (1 + θ)m − 1 µ2 bL((1 + θ)m − 1) = bn4/3 2bµ2 + bn1/3 θ ≤ n−1/3 (µ2 L(e − 1)), (15) 2η 2 L2 η 2 L3 wherein the first equality holds due to the relation ct = ct+1 (1 + ηt βt + tb ) + tb , and the inequality follows upon again noting that (1 + 1/l)l is increasing for l > 0 and liml→∞ (1 + 1l )l = e. Now we can lower bound γ n , as  η γ n = min η − ct+1 − η 2 L − 2ct+1 η 2 β t ≥ η− c0 η β  bν2 − η 2 L − 2c0 η 2 ≥ , Ln2/3 where ν2 is a constant independent of n. The first inequality holds since ct decreases with t. The second one holds since (a) c0 /β is upper bounded by a constant independent of n as c0 /β ≤ µ2 (e−1) (due to Equation (15)), (b) η 2 L ≤ µ2 η (as b < n2/3 ) and (c) 2c0 η 2 ≤ 2µ22 (e − 1)η (again due to Equation (15) and the fact b < n2/3 ). By choosing an appropriately small constant µ2 (independent of n), one can ensure that γ n ≥ bν2 /(Ln2/3 ) for some universal constant ν2 . For example, choosing µ2 = 1/4, we have γ n ≥ bν2 /(Ln2/3 ) with ν2 = 1/40. Substituting the above lower bound in Theorem 9, we get the desired result. 22 F MSVRG: Convergence Rate Proof of Theorem 8 √ Theorem. Let f ∈ Fn have σ-bounded gradients. Let ηt = η q = max{c/ T , µ1/(Ln2/3 )} (µ1 is the f (x0 )−f (x∗ ) universal constant from Corollary 3), m = bn/(3µ1 )c, and c = . Further, let T be a 2Lσ 2 multiple of m, pm = 1, and pi = 0 for 0 ≤ i < m. Then, the output xa of Algorithm 2 satisfies E[k∇f (xa )k2 ] r n 2(f (x0 ) − f (x∗ ))L Ln2/3 [f (x0 ) − f (x∗ )] o ≤ ν̄ min 2 σ, , T T ν1 where ν̄ is a universal constant, ν1 is the universal constant from Corollary 3 and x∗ is an optimal solution to (1). √ Proof. First, we observe that the step size η is chosen to be max{c/ T , µ1 /(Ln2/3 )} where r f (x0 ) − f (x∗ ) . c= 2Lσ 2 Suppose η = √ µ1 /(Ln2/3 ), we obtain the convergence rate in Corollary 3. Now, lets consider the case where η = c/ T . In this case, we have the following bound: E[kvts+1 k2 ] = E[k∇fit (xs+1 ) − ∇fit (x̃s ) + ∇f (x̃s )k2 ] t  ≤ 2 E[k∇fit (xs+1 )k2 + k∇fit (x̃s ) − ∇f (x̃s )k2 ] t  ≤ 2 E[k∇fit (xs+1 )k2 + k∇fit (x̃s )k2 ] t ≤ 4σ 2 . The first inequality follows from Lemma 7 with r = 2. The second inequality follows from (a) σ-bounded gradient property of f and (b) the fact that for a random variable ζ, E[kζ − E[ζ]k2 ] ≤ E[kζk2 ]. The rest of the proof is along exactly the lines as in Theorem 1. This provides a convergence √ rate similar to Theorem 1. More specifically, using step size c/ T , we get r 2(f (x0 ) − f (x∗ ))L 2 σ. (16) E[kf (xa )k ] ≤ 2 T √ The only thing that remains to be proved is that with the√step size choice of max{c/ T , µ1 /(Ln2/3 )}, the minimum of two bounds hold. Consider the case c/ T > µ1 /(Ln2/3 ). In this case, we have the following: q 0 √ (x∗ ))L 2 2(f (x )−f σ 2ν1 σ 2LT T p = Ln2/3 [f (x0 )−f (x∗ )] 2/3 f (x0 ) − f (x∗ ) Ln T ν1   2ν1 µ1 ≤ 2ν1 /µ1 ≤ ν̄ := max , , µ1 2ν1 √ where ν1 is the constant in Corollary 3. This inequality holds since c/ T > µ1 /(Ln2/3 ). Rearranging the above inequality, we have r 2(f (x0 ) − f (x∗ ))L ν̄Ln2/3 [f (x0 ) − f (x∗ )] 2 σ≤ T T 23 in this case. Note√that the left hand side of the above inequality √ is precisely the bound obtained by using step size c/ T (see Equation (16)). Similarly, when c/ T ≤ µ1 /(Ln2/3 ), the inequality holds in the other direction. Using these two observations, we have the desired result. G Key Lemmatta Lemma 3. For the intermediate iterates vts+1 computed by Algorithm 2, we have the following: E[kvts+1 k2 ] ≤ 2E[k∇f (xs+1 )k2 ] + 2L2 E[kxs+1 − x̃s k2 ]. t t Proof. The proof simply follows from the proof of Lemma 4 with It = {it }. We now present a result to bound the variance of mini-batch Svrg. Lemma 4. Let us+1 be computed by the mini-batch version of Algorithm 2 i.e., Algorithm 4 with t mini-batch size b. Then, E[kus+1 k2 ] ≤ 2E[k∇f (xs+1 )k2 ] + t t s+1 2L2 b E[kxt − x̃s k2 ]. Proof. For the ease of exposition, we use the following notation: ζts+1 =  1 X ∇fit (xs+1 ) − ∇fit (x̃s ) . t |It | it ∈It We use the definition of us+1 to get t E[kus+1 k2 ] = E[kζts+1 + ∇f (x̃s )k2 ] t = E[kζts+1 + ∇f (x̃s ) − ∇f (xs+1 ) + ∇f (xs+1 )k2 ] t t ≤ 2E[k∇f (xs+1 )k2 ] + 2E[kζts+1 − E[ζts+1 ]k2 ] t  X  2 = 2E[k∇f (xs+1 )k2 ] + 2 E  ∇fit (xs+1 ) − ∇fit (x̃s ) − E[ζts+1 ] t t b 2   it ∈It The first inequality follows from Lemma 7 (with r = 2) and the fact that E[ζts+1 ] = ∇f (xs+1 )− t ∇f (x̃s ). From the above inequality, we get E[kus+1 k2 ] t 2 ) − ∇fit (x̃s )k2 ] ≤ 2E[k∇f (xs+1 )k2 ] + E[k∇fit (xs+1 t t b 2L2 ≤ 2E[k∇f (xs+1 )k2 ] + E[kxs+1 − x̃s k2 ] t t b The first inequality follows from the fact that the indices it are drawn uniformly randomly and independently from {1, . . . , n} and noting that for a random variable ζ, E[kζ − E[ζ]k2 ] ≤ E[kζk2 ]. The last inequality follows from L-smoothness of fit . H Experiments Figure 2 shows the remaining plots for MNIST and STL-10 datasets. As seen in the plots, there is no significant difference in the test error of Svrg and Sgd for these datasets. 24 10 1 0.70 SGD SVRG 10 0 10 -1 10 -2 10 -3 50 100 150 200 # grad / n 250 300 SGD SVRG 0.68 Test Error SGD SVRG k∇f(x t )k 2 Test Error 0.060 0.058 0.056 0.054 0.052 0.050 0.048 0.046 0.044 0 0.66 0.64 0.62 0.60 10 -40 50 100 150 200 # grad / n 250 300 0.580 50 100 150 200 # grad / n 250 300 Figure 2: Neural network results for MNIST and STL-10. The leftmost result is for MNIST. The remaining two plots are of STL-10. I Other Lemmas We need Lemma 5 for our results in the convex case. Lemma 5 (Johnson & Zhang (2013)). Let g : Rd → R be convex with L-Lipschitz continuous gradient. Then, k∇g(x) − ∇g(y)k2 ≤ 2L[g(x) − g(y) − h∇g(y), x − yi], for all x, y ∈ Rd . Proof. Consider h(x) := g(x) − g(y) − h∇g(y), x − yi for arbitrary y ∈ Rd . Observe that ∇h is also L-Lipschitz continuous. Note that h(x) ≥ 0 (since h(y) = 0 and ∇h(y) = 0, or alternatively since h defines a Bregman divergence), from which it follows that 0 ≤ min[h(x − ρ∇h(x))] ρ ≤ min[h(x) − ρk∇h(x)k2 + ρ = h(x) − Lρ2 2 2 k∇h(x)k ] 2 1 2L k∇h(x)k . Rewriting in terms of g we obtain the required result. Lemma 6 bounds the variance of Svrg for the convex case. Please refer to (Johnson & Zhang, 2013) for more details. Lemma 6 ((Johnson & Zhang, 2013)). Suppose fi is convex for all i ∈ [n]. For the updates in Algorithm 2 we have the following inequality: E[kvts+1 k2 ] ≤ 4L[f (xs+1 ) − f (x∗ ) + f (x̃s − f (x∗ )]. t Proof. The proof follows upon observing the following: s 2 E[kvts+1 k2 = E[k∇fit (xs+1 ) − ∇fit (xs+1 t 0 ) + ∇f (x̃ )k ] ≤ 2E[k∇fit (xs+1 ) − ∇fit (x∗ )k2 ] t + 2E[k∇fit (x̃s ) − ∇fit (x∗ ) − (∇f (x̃s ) − ∇f (x∗ ))k2 ] ≤ 2E[k∇fit (xs+1 ) − ∇fit (x∗ )k2 ] t + 2E[k∇fit (x̃s ) − ∇fit (x∗ )k2 ] ≤ 4L[f (xs+1 − f (x∗ ) + f (x̃s ) − f (x∗ )]. t The first inequality follows from Cauchy-Schwarz and Young inequality; the second one from E[kξ − E[ξ]k2 ] ≤ E[kξk2 ], and the third one from Lemma 5. 25 Lemma 7. For random variables z1 , . . . , zr , we have     E kz1 + ... + zr k2 ≤ rE kz1 k2 + ... + kzr k2 . 26
9cs.NE
arXiv:1205.3952v1 [cs.MS] 17 May 2012 Automating embedded analysis capabilities and managing software complexity in multiphysics simulation part II: application to partial differential equations Roger P. Pawlowski, Eric T. Phipps, Andrew G. Salinger∗, Steven J. Owen, Christopher M. Siefert, and Matthew L. Staten, Sandia National Laboratories† April 17, 2018 Keywords: Generic programming, templating, operator overloading, automatic differentiation, partial differential equations, finite element analysis, optimization, uncertainty quantification. Abstract A template-based generic programming approach was presented in a previous paper [19] that separates the development effort of programming a physical model from that of computing additional quantities, such as derivatives, needed for embedded analysis algorithms. In this paper, we describe the implementation details for using the template-based generic programming approach for simulation and analysis of partial differential equations (PDEs). We detail several of the hurdles that we have encountered, and some of the software infrastructure developed to overcome them. We end with a demonstration where we present shape optimization and uncertainty quantification results for a 3D PDE application. 1 Introduction Computational science has the potential to provide much more than numerical solutions to a set of equations. The set of analysis opportunities beyond simulation include parameter studies, stability analysis, optimization, and uncertainty quantification. These capabilities demand more from the application code than required for a single simulation, typically in the form of extra derivative information. In addition, computational design and analysis will often entail modification of the governing equations, such as refinement of a model or a hierarchy of fidelities. In our previous paper [19], we described the template-based generic programming (TBGP) approach. That paper provides the conceptual framework upon which this paper builds, and thus is a prerequisite for the work described here. We showed how graph-based assembly and templatebased automatic differentiation technology can work together to deliver a flexible assembly engine, ∗ Corresponding author. Sandia National Laboratories, Numerical Analysis and Applications Department, PO Box 5800 MS-1318, Albuquerque, New Mexico, 87185, USA. Tel: +1(505)845-3523, Fax: +1(505)845-7442, agsalin@sandia.gov. † Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary of Lockheed Martin Corporation, for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-AC04-94AL85000. 1 where model equations can be rapidly composed from basic building blocks and where only the residual needs to be explicitly programmed. The approach is based on templating of the low-level scalar operations within a simulation and instantiation of this template code on various data types to effect the code transformations needed for embedded analysis through operator overloading. Often application of operator overloading in this manner is assumed to introduce significant runtime overhead into the simulation, however we have demonstrated [19] that careful implementation of the overloaded operators [20] (using techniques such as expression templates [28]) can completely eliminate this overhead. This results in a single templated code base that must be developed, tested, and maintained,1 that when combined with appropriate seeding and extracting of these speciallydesigned overloaded data types (see [19] and Section 3 for definitions of these terms), allows all manner of additional quantities to be generated with no additional software development time. In this paper, we extend the description of this approach to the simulation and analysis of partial differential equations (PDEs). As discussed in the previous paper [19], a number of projects have implemented embedded analysis capabilities that leverage a domain specific language. Specifically for finite elements, the FEniCS [14, 15], Life/FEEL++ [17, 22] and Sundance [16] projects have demonstrated this capability with respect to derivative evlauation. PDEs provide additional challenges with regards to data structures and scalability to large systems. In this paper, we deal specifically with a Galerkin finite element approach, though the approach will follow directly to other element-based assemblies, and by analogy to stencil-based assemblies. In Section 2 we discuss where the template-based approach begins and ends, and how it relates to the global and local (element-based) data structures. In Section 3 we present many details of the template-based approach for finite element assembly, in particular the seed, compute, and extract phases. Section 4 addresses some more advanced issues that we have dealt with in our codes that use this approach. Specifically, this includes the infrastructure for exposing model parameters, as needed for continuation, bifurcation, optimization and uncertainty quantification, approaches for dealing with a templated code stack, and approaches for dealing with code that can not be templated. Finally, in Section 5 we demonstrate the whole process on an example PDE application: the sliding electromagnetic contact problem. We show results for shape optimization and embedded uncertainty quantification. Critical to the main message of this paper is the fact that the infrastructure for computing the extra quantities needed for these analysis capabilities has been implemented independently from the work of implementing the PDE model. This infrastructure includes the seed and extract phases for the template-based approach. It also includes all of the solver libraries that have been implemented in the Trilinos framework [11], such as the linear, nonlinear, transient, optimization, and UQ solvers. Once in place, application codes for new PDEs can be readily generated, born with analytic derivatives and embedded analysis capabilities. The novel interface exposed to computational scientists by allowing for templated data types to be passed through the equation assembly has tremendous potential. While this interface has been exploited for derivatives, operation counting, and polynomial propagation, we expect that developers will find innovative ways to exploit this interface beyond what we currently imagine. 1 We note that transforming a legacy implementation to use templates in this manner does involve significant effort (and thus we would consider this approach most appropriate for new development efforts), however the transformations necessary are just type specifications in function and variable declarations. 2 2 Approach for Finite Element Codes In the first paper in this series, we explained the template-based generic programming approach and included an illustrative demonstration on how it can be applied to an ODE problem. In this section, we present the basic details on how this approach is used in the context of PDE applications. Some of our implementation details are restricted to discretization strategies with element-based assembly kernels, such as finite element (FEM) and control volume finite element (CVFEM) methods. Some details of the approach would need to be adapted for stencil-based discretizations, such as finite difference methods or integral equations, or for discontinuous-Galerkin methods. Extending the approach from ODEs to PDEs gives rise to many issues. The core design principle is still the same, that the evaluation of the equations is separated into three phases: seed, compute, and extract. The seed and extract phases need to be specialized for each template type, where extra information in the data types (such as derivative information) must be initialized and retrieved. The compute phase, where the equations are implemented, can be written on a fully generic fashion. There are also issues with regard to data structures, sparse matrices, parallelism, the use of discretization libraries, and the potential dependency on libraries for property data. These issues will be addressed in the following sections. 2.1 Element-Based Assembly A primary issue that arises when using the template-based generic programming (TBGP) approach for PDEs is the sparsity of the derivative dependencies. The automatic differentiation approach to computing the Jacobian matrix using the Sacado package requires all relevant variables to be a Sacado::FAD (forward automatic differentiation) data type, which includes a dense array of partial derivatives with respect to the independent variables in the problem. As problem sizes can easily extend into to the millions and beyond, yet nonzero entries per row stay bounded at O(100), it is not feasible to adopt the same approach. A second issue is the requirement for the ability to run the codes on distributed-memory parallel architectures. Adding message-passing layers within the AD infrastructure would also be challenging. These two issues are circumvented by invoking the template-based generic programming at a local level. For FEM methods, this is the single element. The entire PDE assembly phase is performed by summing contributions over individual elements. Within each element, it is typically not a bad assumption that the local Jacobian (often referred to as the element stiffness matrix) is dense. So, for Jacobian matrices, the AD is performed at the element level, where the array of partial derivatives is sized to be the number of degrees of freedom in an element. The dense contributions to each row of the matrix is subsequently scattered to the global sparse matrix structure. Similarly, other quantities that can be computed with the template-based generic programming approach can also be calculated element by element, and summed into a global data structure.2 The choice of implementing the template-based generic programming at a local level also nullifies the second issue to do with distributed memory parallelism. In a typical distributed memory implementation, information from neighboring elements (often called ghost, overlap, or halo data) is pre-fetched. The templating infrastructure and seed-compute-extract loop falls below the messagepassing layer. In our implementation, no communication is performed within the templated code. 2 Note that most AD tools including Sacado compute the residual along with the Jacobian allowing these quantities to be computed simultaneously. In general evaluation of the nth derivative also involves simultaneous evaluation of derivatives of order 0 up to n − 1 as well. 3 Table 1: Embedded analysis algorithms require a variety of quantities to be computed in the PDE assembly. This table shows a list of linear algebra quantities that can be computed, as well as the required inputs. In this table: x is the solution vector, ẋ is the time derivative of x, v is one or more vectors chosen by the analysis algorithm, p is one or more system parameters for continuation/optimization, ξ is one or more random variables, f is the residual vector of the discretized PDE system, and F is the stochastic expansion of the residual vector. Evaluation Residual Steady Jacobian Transient Jacobian (β = Directional Derivative Sensitivity dẋ dx ) Hessian·Vector Stochastic Galerkin Residual Stochastic Galerkin Jacobian Input Vector(s) x x x,ẋ x,v x Other Input p p p, β p p x,v x(ξ) x(ξ) p ξ ξ Output Vector f Output Matrix df dx df dx · df dp β ddfẋ + df dx v d2 f dx2 ·v F dF dx We note that the local element-based approach is not the only solution to these problems. Through the use of sparse derivative arrays or graph-based compression techniques (see [10] for an overview of both of these approaches and references to the relevant literature) automatic differentiation can be applied directly at the global level. Furthermore, message passing libraries for distributed memory parallelism can be augmented to support communication of derivative quantities. However, due to the extra level of indirection introduced, the use of sparse derivative arrays can significantly degrade performance. Moreover compression techniques require first computing the derivative sparsity pattern and then solving an NP-hard optimization problem to compress the sparse derivative into a (nearly) dense one. In practice only approximate solutions to this optimization problem can be attained. However the solution to this problem is in fact known a priori, it is precisely equivalent to the local element-based approach (assuming the element derivative is dense). Thus we have found the local element-based approach to be significantly simpler than a global one, particularly so as PDE discretization software tools that support templated data types have been developed, such as the Intrepid package in Trilinos. 2.2 Data Structures The purpose of the PDE assembly engine is to fill linear algebra objects – primarily vectors and sparse matrices. These are the data structures used by the solvers and analysis algorithms. For instance, a Newton based solver will need a residual vector and a Jacobian matrix; a matrix-free algorithm will need a Jacobian-vector directional derivative; an explicit time integration algorithm will need the forcing vector f (x); polynomial chaos propagation [8, 9, 29, 30] creates a vector of vectors of polynomial coefficients; a sensitivity solve computes multiple vectors (or a single multivector or dense column matrix) of derivatives with respect to a handful of design parameters. The input to the PDE assembly is also vectors: the solution vector x, a vector of design parameters p, and coefficient vectors for polynomial expansions of parameters ξ. 4 It is critical to note that the TBGP machinery is NOT applied to the linear algebra structures used by the solvers and analysis algorithms. None of the operator-overloading or expression templating infrastructure comes into play at this level. The TBGP is applied locally on a single element in the assembly process used to fill the linear algebra data structures. For example, in our Trilinos-based implementations the vectors and matrices are objects from the Epetra or Tpetra libraries. These are convenient because of their built-in support for distributed-memory parallelism and their compatibility with all the solvers in Trilinos (both linear solvers and analysis algorithms). However, none of the subsequent implementation of the TBGP code is dependent on this choice. Inside the PDE assembly for finite element codes, it is natural to have element-based storage layout. All of the computations of the discretized PDE equations operate on multi-dimensional arrays (MDArrays) of data which can be accesses with local element-level indexing (local nodes, local quadrature points, local equation number, etc.). The current MDArray domain model is specified and implemented in the Shards package in Trilinos [7]. While the TBGP computations occur locally within an element, the assembly of element contributions to the linear algebra objects is done on local blocks of elements called “worksets”. A workset is a homogeneous set of elements that share the same local bookkeeping and material information. While all the computations within each element in a workset are independent, the ability to loop over a workset amortizes the overhead of function calls and gives flexibility to obtain speedups through vectorization, cache utilization, threading, and compute-node based parallelism. By restricting a workset of elements to be homogeneous, we can avoid excessive conditional (“if”) tests or indirect addressing within the workset loops. The number of elements in a workset, Ne , can be chosen based on a number of criteria including runtime performance optimization or memory limitations. The other dimensions of the MDArrays can include number of local nodes Nn , number of quadrature points Nq , number of local equations or unknowns Neq , and number of spatial dimensions Nd . For instance, a nodal basis function MDArray has dimensions [Ne , Nn , Nq ], while the gradient of the solution vector evaluated at quadrature points is dimensioned [Ne , Nq , Neq , Nd ]. All of the MDArrays are templated on the Scalar data type, called ScalarT in our code examples. Depending on what specific Scalar type they are instantiated with, they will not only hold the value, but can also hold other information such as the derivatives (in the case of Jacobian evaluations), sensitivities, or polynomial chaos coefficients. At this point, we hope the reader has an understanding of the template-based generic programming approach from the previous paper, with the seed-extract-compute paradigm. This current Section 2 has motivated the application of the TBGP approach at the local or element level, and has defined the distinction between global linear algebra objects (matrices and vectors that span the mesh and typically are of double data type) and MDArrays (element-based data structures of quantities that are templated on the Scalar type). With this foundation, the main concept in this paper can be now presented in the following Section 3. 3 Template Based Element Assembly The template-based generic programming approach requires a seed phase where the Scalar data types are initialized appropriately. As described above in Section 2, there are different data structures that need to exist in the solution phase from the assembly phase. Notably, a gather routine is needed to pull in global information (such as the solution vector from the nonlinear solver) to 5 the local element data structures (such as the solution values at local nodes in an element). In our design, we perform the gather and seed operations in the same routine. When we pull global data into a local data storage, we not only copy it into local storage, but also seed the Scalar data types as needed. The seeding is dependent on the Scalar data type, so the gather operation must be template specialized code. For example, for a Jacobian evaluation, the partial derivative array associated with the solution vector is seeded with the identity matrix. The inverse is also true. At the end of the PDE assembly there are element-based contributions to the global residual vector and, depending on the Scalar type, information for the Jacobian, polynomial chaos expansion, or other evaluation types contained in the data structure as well. These quantities need to be extracted from these data structures as well as scattered back from the local to global data storage containers. We combine the scatter and extract operations into a single step, which again require template-specialized code. For the Jacobian example, the derivative array associated with the residual entries are rows of the element stiffness matrix. The compute phase operates solely on local MDArray data structures with data templated on the Scalar type. This phase can be written entirely on the generic template type. We have attempted to capture this concept schematically in Figure 1. The Gather/Seed phase must take global data and, depending on the template type, seed the local arrays appropriately. The compute phase, broken into five distinct evaluations in this cartoon (the blue boxes), performs the element level finite element calculations for the specific PDEs, and is written just on the generic template type. (The uniqueness of the Gather Coordinates box will be addressed later in Section 4.5.) The Scatter/Extract phase takes the results of the assembly and loads the data into the appropriate global quantities, as dictated by the specific evaluation type. The execution of the phases is initiated by the application code and handled by the Phalanx package [18] by traversing the evaluation kernels in the directed acyclic graph. More details on the three phases for a typical finite element assembly will be described in the subsequent sections. 3.1 Finite Element Assembly Process under TBGP Framing the finite element assembly process in terms of the template-based generic programming concept is best explained by example. Here we apply the Galerkin finite element method to a generic scalar multidimensional conservation equation (see, for example, [6]) u̇ + ∇ · Q + s = 0, (1) where u is the unknown being solved for (i.e. the degree of freedom) and u̇ its time derivative. The flux Q and source term s are functions of u, time, and position. While the exact form of the flux is not important, we comment that if the flux is strongly convecting, then additonal terms such as SUPG [4, 12] may be required to damp non-physical oscillations. To simplify the analysis, we ignore such terms here. This is valid for systems where convection is not dominant such as low Reynolds number flows or heat conduction in a solid. Equation (1) is put into variational form which, after integration by parts and ignoring boundary contributions for the sake of simplicity, yields the residual equations Z  i  i Ru = φ u̇ − ∇φi · Q + φi s dΩ. (2) Ω 6 Figure 1: A schematic of the template based generic programming model for PDEs. The Gather (Seed) evaluator takes global data and copies it into local storage, seeding any embedded data types in template specialized codes. The Scatter (extract) phase does the inverse. The Compute phase can be written on the generic template type, operating on local data. In (2), Ω is the domain over which the problem is solved and φi are the finite element basis functions. The unknown, its time derivative, and its spatial derivative are computed using u= Nu X φi ui , u̇ = i=1 Nu X φi u̇i (3) i=1 N u X ∂u ∂φi i = u, ∂xj ∂xj (4) i=1 where ui are the unknown coefficients of the discretization of u, xj is the coordinate direction, and Nu is the number of basis functions. The integrations in (2) are performed using numerical quadrature, Nq NE X X  i  R̂ui = φ u̇ − ∇φi · Q + φi s wq |j| = 0, (5) e=1 q=1 where NE is the total number of elements in the domain, Nq is the number of quadrature points in an element for the integration order, |j| is the determinant of the Jacobian of transformation from 7 the physical space to the element reference space, and wq the quadrature weights. With the finite element assembly algorithm defined by (5), the process can be redefined in terms of the gather-compute-scatter operations. The assembly algorithm in (5) loops over the elements in the domain and sums the partial contributions to form the residual equations, R̂ui . The complete set of residual equations constitute the global residual, f . Reformulating in terms of the workset concept, the assembly process for evaluating a residual is defined as, f (x) = Nw X k=1 fk = Nw X SkT R̄ui k (Gk x). (6) k=1 Here Nw is the number of worksets and fk is the partial residual associated with the finite element contributions for the elements in workset k. Gk is the gather operation that maps the global solution vector, x, to the local solution vector for workset k. As mentioned above, in the software implementation, the gather routine also performs the seeding of scalar types. SkT is the scatter operation that maps the local element residual for elements of workset k into the global residual contribution, fk = SkT R̄ui k . As noted above, in the software implementation, the extraction process occurs during the scatter. R̄ui k are the element residual contributions to R̂ui that come from the elements in workset k as a function of the local workset solution vector Gk x, R̄ui k = Nq Ne X X   φi u̇ − ∇φi · Q + φi s wq |j| = 0. (7) e=1 q=1 Ne is the number of elements in workset k. The important point to note is that while all of the code written above was used for evaluating a residual, the bulk of the code can now be reused for other evaluation types such as Jacobians, parameter sensitivities, stochastic residuals, etc. This is accomplished merely by writing an additional specialization for the gather, Gk , and scatter, SkT , operations only. All of the code for the residual evaluation, R̄ui k , is written once for a generic template argument for the scalar type and is reused for each evaluation type. In the following sections, we now show examples and further explain each of the assembly steps. 3.2 Seed & Gather Phase: Template Specialization In this first phase, the approach is to do the gather operation, Gk , (pulling quantities from a global vector) and the seed phase (initializing the template type for the desired embedded operation) in the same block of code. In this example, which is an adaptation of working code, the Phalanx evaluator called GatherSolution is where this operation occurs, and within the evaluateFields method in particular. As described in the previous paper [19], the Trilinos package Phalanx [18] is used to build the governing equations, where separate pieces of the computation are broken into Phalanx evaluator objects. The field to be evaluated is called local x, the solution vector at the local nodes of each element. It depends on global x, which is the solution vector in the vector data layout. In Figure 2, the GatherSolution class is specialized to the Residual evaluation type. This routine simply copies the values from one data structure to another with the use of a bookkeeping function ConnectivityMap. In Figure 3, the code for the GatherSolution class specialized to the Jacobian evaluation type is shown. In addition to the gather operation to load the value of x into the 8 void GatherSolution<EvaluationType::Residual>:: evaluateFields() { // NOTE:: local_x is a 2D MDArray of dimension (numberOfElements,numberOfLocalNodes) // of data type: double for (int elem=0; elem < numberOfElements; elem++) for (int node=0; node < numberOfLocalNodes; node++) local_x(elem,node) = global_x(ConnectivityMap(elem,node)); } Figure 2: Seed and Gather code for Residual evaluation. The ConnectivityMap function is the degree of freedom, or connectivity map, that gets the global ID from the element number and local node number. The Seed phase is trivial, just a copy of the value. local data structure, there is also a seed phase to initialize the partial derivatives with the identity matrix. Here, the independent variables are defined by initializing the partial derivative array of the Sacado::FAD automatic differentiation data type. Two nested loops over the local nodes are dxi used to set dx to 1.0 when i = j and to 0.0 otherwise. j As the number of output quantities to be produced by the finite element assembly increases (such as those defined by the rows in Table 1), so does the number of template specialized implementations of the GatherSolution object need to be written. The syntax here is dependent on the implementation in the Sacado package in Trilinos, but the concept of seeding automatic differentiation calculations is general. 3.3 Compute Phase: Generic Template The compute phase that computes the local contributions, R̄ui k , for a PDE application operates on data that exists in the local element-based data structures. This code is written entirely on the generic evaluation template type EvalT. One must just write the code needed to evaluate the residual equation, but using the ScalarT data type corresponding to the evaluation type EvalT instead of raw double data type (as shown in Section 7.1 of [19]). The overloaded data type, together with specializations in the Seed and Extract phases, enable the same code to compute all manner of quantities such as the outputs in Table 1. In this section we give two examples of the evaluateFields method of a Phalanx evaluator class. The first is shown in Figure 4 which calculates a source term in a heat equation, s = α + βu2 , (8) where s is the source term from Equation 1, α and β are parameters in this model, and u is the solution field. The code presupposes that the field u has been computed in another evaluator and is an MDArray over elements and quadrature points. The factors α and β in this example are scalar values that do not vary over the domain. (We will discuss later in Section 4.1 how to expose α and β as parameters for design or analysis.) Note again that this code is templated on the generic EvalT evaluation type, and only one implementation is needed. For general PDE codes, it is common, and efficient, to use discretization libraries to perform common operations. For a finite element code, this includes basis function calculations, calculating the transformation between reference and physical elements, and supplying quadrature schemes. 9 void GatherSolution<EvaluationType::Jacobian>:: evaluateFields() { // NOTE:: local_x is a 2D MDArray of dimension (numberOfElements,numberOfLocalNodes) // of data type: Sacado::FAD with allocated space for // numberOfLocalNodes partial derivatives. for (int elem=0; elem < numberOfElements; elem++) { for (int node=0; node < numberOfLocalNodes; node++) { local_x(elem,node).val() = global_x(ConnectivityMap(elem,node)); // Loop over all nodes again, and Seed dx/dx=I for (int wrt_node=0; wrt_node < numberOfLocalNodes; wrt_node++) { if (node == wrt_node) local_x(elem,node).dx(wrt_node) = 1.0; else local_x(elem,node).dx(wrt_node) = 0.0; } } } } Figure 3: Seed and Gather Code for Jacobian evaluation. The Gather operation is the same as the Residual calculation. The Seed phase involves local x, which is now an automatic differentiation data type. The method local x.val() accesses the value, and local x.dx(i) accessing the ith partial derivative. The example here assumes one equation and one unknown per local node. To the extent that these operations occur within the seed-compute-extract loop, they must support templating for the TBGP approach to work. In Trilinos, the Intrepid discretization library [3] serves all these roles, and was written to be templated on the generic ScalarT data type. Figure 5 shows an example evaluator method for the final assembly of the residual equation for a heat balance. This code uses the Integrate method of the Intrepid finite element library to accumulate the summations over quadrature points of each of the four terms. The integrals are from the variational formulation of the PDEs, where the terms are matched with the Galerkin basis functions (adapted from equation (2) but using common notation for heat transfer): Z Z Z i i f= (Q · ∇φ ) dΩ + (sφ ) dΩ + (Ṫ φi ) dΩ (9) Ω Ω Ω where φi are the basis functions. The three terms on the right hand side correspond to the diffusive, source, and accumulation terms. The source term s in this equation can be a function of the solution, a function of the position, or a simple constant. The dependencies must be defined in the source term evaluator. However, these dependencies do not need to be described in the heat equation residual. This same piece of code will accurately propagate any derivatives that were seeded in the gather phase, and accumulated in the source term evaluator. We should also note that it is possible to write template-specialized code for the compute phase. If, for instance, one would like to hand-code the Jacobian fill for efficiency, or to leave out terms for a preconditioner, once could simply write a function: HeatEquationResidual<EvaluationType::Jacobian>::evaluateFields() 10 void SourceTerm<EvalT>:: evaluateFields() { // NOTE:: This evaluator depends on properties "alpha" and "beta" // and scalar quantity "u" to compute the scalar source "s" for (int elem=0; elem < numberOfElements; elem++) { for (int qp=0; qp < numberOfQuadPoints; qp++) { source(elem,qp) += alpha + beta * u(elem,qp) * u(elem,qp); } } } Figure 4: Example of an evaluation kernel from the Compute phase. Note that the code is templated on the Generic EvalT evaluation type. This code will propagate the auxiliary information contained in EvalT::ScalarT data type for any of the embedded capabilities. No template specialization is needed. void HeatEquationResidual<EvalT>:: evaluateFields() { // NOTE:: This evaluator depends on several precomputed fields, // flux, source, Tdot (time derivative), // wBF (Basis Function with quadrature and transformation weights) // and wGradBF (gradient of Basis Functions with weights). // The result is the TResidual field, the element contribution // to the heat equation residual. typedef Intrepid::FunctionSpaceTools FST; FST::integrate<ScalarT>(TResidual, flux, wGradBF); FST::integrate<ScalarT>(TResidual, source, wBF); FST::integrate<ScalarT>(TResidual, Tdot, wBF); } Figure 5: Evaluator for the final assembly of the heat equations. The terms correspond to those in Eq. 9, in order. The variable TResidual is being accumulated in each step. All variables are MDArrays. Depending on the template parameter EvalT and the corresponding data type ScalarT, this same block of code is used for accumulating the residual, Jacobian, or any of the output quantities listed in Table 1. 11 void ScatterResidual<EvaluationType::Residual>:: evaluateFields() { // NOTE:: local_f is a 2D MDArray of dimension (numberOfElements,numberOfLocalNodes) // of data type: double for (int elem=0; elem < numberOfElements; elem++) for (int node=0; node < numberOfLocalNodes; node++) global_f(ConnectivityMap(elem,node)) = local_f(elem,node); } Figure 6: Extract and Scatter Code for Residual evaluation. The ConnectivityMap function is also called the degree of freedom map, and gets the global ID from the element number and local node number. The Extract phase is trivial for this Evaluation type, just a copy of the value. where the generic template type EvalT is replaced by the template specialized evaluation type of Jacobian. 3.4 Extract & Scatter Phase: Template Specialization This section closely mimics Section 3.2, but with the transpose operations. Here, each local element’s contributions to the finite element residual is scattered into the global data structure. At the same time, if additional information is stored in the templated data types, it is extracted and scattered into the global linear algebra objects. In this example, the evaluator object called ScatterResidual is where this operation occurs, and within the evaluateFields method in particular. The culmination of all the compute steps above have resulted in the computation of the field local f, which represents the local element’s contribution, R̄ui k , to the global residual vector, but may also contain additional information in the ScalarT data type. In Figure 6, the ScatterResidual class is specialized to the Residual evaluation type. This routine simply copies the values from the element data structure to the global data structure with the use of the same bookkeeping function ConnectivityMap that was used in Section 3.2. In Figure 7, the code for the ScatterResidual class specialized to the Jacobian evaluation type is shown. Here, the local, dense, stiffness matrix is extracted from the Sacado::FAD automatic dfi differentiation data type. Two nested loops over the local nodes are used to extract dx and load j them into the global sparse matrix. A set of template specialized implementations of the ScatterResidual object need to be written to match those in the GatherSolution class. Just two are shown here. These implementations are specific to the interface to the global data structures being used, which here are encapsulated in the ConnectivityMap() and AddSparseMatrixEntry() methods. A central point to this paper, and the concept of template-based generic programming, is that the implementations in the Seed & Gather and the Extract & Scatter sections can be written agnostic to the physics being solved. While the work of correctly programming these two phases for all evaluation types is not at all trivial, the development effort is completely orthogonal to the work of adding terms to PDEs. Once a code is set up with implementations for a new evaluation type, it is there for any PDEs assembled in the compute phase. We note that while the examples shown here are trivial, the design of the assembly engine is 12 void ScatterResidual<EvaluationType::Jacobian>:: evaluateFields() { // NOTE:: local_f is a 2D MDArray of dimension (numberOfElements,numberOfLocalNodes) // of data type: Sacado::FAD with allocated space for // numberOfLocalNodes partial derivatives. for (int elem=0; elem < numberOfElements; elem++) { for (int node=0; node < numberOfLocalNodes; node++) { int row=ConnectivityMap(elem,node); for (int wrt_node=0; wrt_node < numberOfLocalNodes; wrt_node++) { int col=ConnectivityMap(elem,wrt_node); double val = local_f(elem,node).dx(wrt_node); //Extract df_i/dx_j AddSparseMatrixEntry(row,col,val); } } } } Figure 7: Extract and Scatter Code for Jacobian evaluation. The Extract phase involves local f, which is now an Automatic Differentiation data type. The method dx(i) on this data type accesses the ith partial derivative. A (fictitious) method called AddSparseMatrixEntry(int row, int col, int df value) shows how this Jacobian information is scattered into the global and sparse dx storage. very general and allows for complex multiphsyics problems. In particular, unknowns are not all bound to the same basis. Fully-coupled mixed basis problems have been demonstrated with the Phalanx assembly engine. The design of each evaluator in the graph is completely controlled by the user, thus allowing for any algorithm local to the workset to be implemented. We further note that for all of the evaluation routines above, the loops were explicitly written in the evaluator. In general, this is not ideal since it is likely to be repeated across multiple evaluators and can introduce additional points for error. These loops could be eliminated using utility functions or expression templates [28]. This will be a future area of research. Furthermore, optimizing the ordering of the nested loops and the corresponding data layouts of the field data and embedded scalar types are also areas of future research. Finally, we note that during the design of the Phalanx package, great care was given to designing the library so that users with little C++ template experiience could easily add new physics. We feel this has been extremely successful in that there exists over 10 distinct physics applications using the TBGP packages in Trilinos. The drawback, however, is that the initial setup of the TBGP process requires a programmer with a strong background with templates. In contrast, DSL-based codes such as Sundance [16] and FEniCS [14, 15] automate the entire assembly process for users lowering the barrier for adoption. We feel that the extra work in setting up the TBGP machinery is worth the effort as we have very quickly extended the embedded analysis support to new types such as the stochastic galerkin methods. 13 4 Extensions to TBGP for Finite Element Code Design The basic implementation details for template-based generic programming approach for finite element code were described in the previous section. As we have implemented this approach in application codes, we have run across many issues, and implemented solutions to them. Some of the most important of these are described in the following sections. 4.1 Infrastructure for Exposing Parameters/Properties One of the main selling points of the template-based generic programming approach is the ability to perform design and analysis involving system parameters. Continuation, sensitivity analysis, optimization, and UQ all require that model parameters be manipulated by the analysis algorithms. These parameters are model specific, and commonly include a value of a boundary condition, a dimensionless group such as the Reynolds number, a model parameter such as an Arrhenius rate coefficient, or a shape parameter such as the radius of some cylindrical part. In this section we briefly describe our infrastructure for exposing parameters. Infrastructure for dealing with parameters should try to meet the following design requirements: a simple interface for model developers to expose new parameters, integration into the templatebase approach so derivatives with respect to parameters are captured, and seamless exposure of the parameters to design algorithms such as optimization and UQ. The approach that has been successful in our codes has been to use the ParameterLibrary class in the Sacado package of Trilinos. This utility stores the available parameters by string name and value, and can handle the multiple data types needed by the template-based approach. The developer can register parameters in the parameter library, identified by strings, by simply calling the register method during the construction phase. To expose the α and β parameters in the above Example 4 by labels “Alpha” and “Beta”, the constructor for the SourceTerm evaluator simply needs to add the lines: parameterLibrary.registerParameter("Alpha",this); parameterLibrary.registerParameter("Beta",this); assuming that a parameterLibrary object is in scope. At the end of the problem construction, the parameter library can be queried for a list of registered parameters, and will include these two in addition to those registered elsewhere. The analysis algorithms can then manipulate the values of these parameters in the ParameterLibrary. There is a choice of using a push or a pull paradigm: when the value is changed in the parameter library, is it immediately pushed to the evaluator where it will eventually be used, or is it up to the model to pull the parameter values from the parameter library when needed. We have chosen the push approach, since with this choice there is no performance penalty for exposing numerous parameters as potential design variables. Parameters are only pushed to one location, so parameters that are used in multiple evaluators must have a root evaluator where they are registered and other evaluators must have a dependency on that one. Any evaluator class that registers a parameter must inherit from an abstract ParameterAccessor class, which has a single method called ScalarT& getValue(std::string name). Any parameter that gets registered with the ParameterLibrary needs to send a pointer to a ParameterAccessor class, so the parameter library can push new values of the parameter when manipulated by an 14 ScalarT& SourceTerm<EvalT>::getValue(std::string name) { if (name=="Alpha") return alpha; elseif (name=="Beta") return beta; } Figure 8: Example implementation of getValue method, which provides a hook for analysis algorithms to manipulate design parameters. analysis algorithm. In the example above, this is handled by the this argument in the registration call. For this example, the getValue method can be simply implemented as shown in Figure 8, assuming parameters alpha and beta are member data of generic template type ScalarT. Sensitivities of the residual equation with respect to parameters are calculated with automatic differentiation when evaluated with the Tangent evaluation type. Like the Jacobian evaluation type, the associated Scalar data type is a Sacado::FAD type. However, the length of the derivative array is the number of parameters, and the seed and extract phases require different specializations. 4.2 Shape Optimization: A Second Scalar Type Quantities in the PDE assembly that might have nonzero partial derivatives with respect to an independent variable (whether it be a parameter or part of the solution vector) must be a have a templated data type. In this way, derivatives can be propagated using the object overloading approach. Constants (such as π) can be hardwired to the RealType data type to avoid the expense of propagating partial derivatives that we know are zero. For the bulk of our calculations, the coordinates of the nodes in our finite element mesh are fixed. All the quantities that are solely a function of the coordinates, such as the basis function gradients and the mapping from an element to the reference element, can be set to RealType. However, when we began to do shape optimization, the coordinates of the node could now have nonzero derivatives with respect to the shape parameter in the Tangent (sensitivity) evaluation. To simply make all quantities that are dependent on the coordinates to be the ScalarT type would trigger an excessive amount of computations, particularly for the Jacobian calculations, where the chain rule would be propagating zeroes through a large part of the finite element assembly. The solution was to create a second generic data type, MeshScalarT, for all the quantities that have non-zero derivatives with respect to the coordinates, but have no dependency on the solution vector. The Traits class defined in the previous paper is extended to include MeshScalarT as well as ScalarT as follows. struct UserTraits : public PHX::TraitsBase { // Scalar Types typedef double RealType; typedef Sacado::FAD FadType; // Evaluation Types with default scalar type struct Residual { typedef RealType ScalarT; typedef RealType MeshScalarT;}; 15 struct Jacobian { typedef FadType ScalarT; typedef RealType MeshScalarT;}; struct Tangent { typedef FadType ScalarT; typedef FadType MeshScalarT;}; . . . } If, in the future we decide to do a moving mesh problem, such as thermo-elasticity, where the coordinate vector for the heat equation does depend on the current displacement field as calculated in the elasticity equation, then the Jacobian evaluation could be switched in this traits class to have typedef FadType MeshScalarT. Automatically, the code would calculate the accurate Jacobian for the fully coupled moving mesh formulation. While it can be complicated to pick the correct data type for all quantities with this approach, the Sacado implementation of these data types has a useful feature. The code will not compile if you attempt to assign a derivative data type to a real type. The casting away of derivative information must be done explicitly, and can not be done by accident. This is illustrated in the following code fragment, as annotated by the comments. RealType r=1.0; FadType f=2.5; f = r; //Allowed. All derivatives set to zero. r = f; //Compiler will report an error. 4.3 Template Infrastructure Template-based generic programming places a number of additional requirements on the code base. Building and manipulating the objects can be intrusive. Additionally the compile times can be excessive as more and more template types are added to the infrastructure. Here we address these issues. 4.3.1 Extensible Infrastructure The infrastructure for a template-based assembly process must be designed for extensibility. The addition of new evaluation types and/or scalar types should be minimally invasive to the code. To support this requirement, a template manager class has been developed to automate the construction and manipulation of a templated class given a list of template types. A template manager instantiates a particular class for each template type using a user supplied factory for the class. The instantiated objects are stored in a std::vector inside the manager. To be stored as a vector, the class being instantiated must inherit from a non-templated base class. Once the objects are instantiated, the template manager provides functionality similar to a std::vector. It can return iterators to the base class objects. It allows for random access based on a template type using templated accessor methods, returning an object of either the base or derived class. The list of types a template manager must build is fixed at compile time through the use of template metaprogramming techniques [1] implemented in the Boost MPL library [5] and Sacado [21]. These types are defined in a “traits” class. This object is discussed in detail in [19]. 16 We note that the template manager described here is a simplified version of the tuple manipulation tools supplied by the Boost Fusion library [5]. In the future, we plan to transition our code to using the Fusion library. 4.3.2 Compile Time Efficiency For each class templated on an evaluation type, the compiler must build the object code for each of the template types. This can result in extremely long compile times even for very minor code changes. For that reason explicit template instantiation is highly recommended for all classes that are templated on an evaluation type. In our experience, not all compilers can support explicit instantiation. Therefore both the inclusion model and explicit template instantiation are supported in our objects (see Chapter 6 of [27] for more details) . The downside to such a system is that for each class that implements explicit instantiation, the declaration and definition must be split into separate header files and a third (file.cpp) file must also be added to the code base. 4.4 Incorporating Non-Templated Third-Party Code In some situations, third-party code may provide non-template based implementations of some analysis evaluations. For example, it is straightforward to differentiate some Fortran codes with source transformation tools such as ADIFOR [2] to provide analytic evaluations for first and higher derivatives. However clearly the resulting derivative code does not use the template-based procedure or the Sacado operator overloading library. Similarly some third-party libraries have hand-coded derivatives. In either case, some mechanism is necessary to translate the derivative evaluation governed by Sacado into one that is provided by the third-party library. Providing such a translation is a relatively straightforward procedure using the template specialization techniques already discussed. Briefly, a Phalanx evaluator should be written that wraps the third-party code into the Phalanx evaluation hierarchy. This evaluator can then be specialized for each evaluation type that the third-party library provides a mechanism for evaluating. This specialization extracts the requisite information from the corresponding scalar type (e.g., derivative values) and copies them into whatever data structure is specified by the library for evaluating those quantities. In some situations, the layout of the data in the given scalar type matches the layout required by the library, in which case a copy is not necessary (e.g., Sacado provides a forward AD data type with a layout that matches the layout required by ADIFOR, in which case a pointer to the derivative values is all that needs to be extracted). However this is not always the case, so in some situations a copy is necessary. Such an approach will work for all evaluation types that the third-party library provides some mechanism for evaluating. However clearly situations can arise where the library provides no mechanism for certain evaluation types. In this case the specializations must be written in such a way as to generate the required information non-intrusively. For example, if the library does not provide derivatives, these can be approximated through a finite-differencing scheme. In a Jacobian evaluation for example, the Jacobian specialization for the evaluator for this library would make several calls to the library for each perturbation of the input data for the library, combine these derivatives with those from the inputs (dependent fields) for the evaluator (using the chain rule) and place them in the derivative arrays corresponding to the outputs (evaluated fields) of the evaluator. Similarly polynomial chaos expansions of non-templated code can be computed through 17 non-intrusive spectral projection [23]. 4.5 Mesh Morphing and Importing Coordinate Derivatives The shape optimization capability that will be demonstrated in Section 5 requires sensitivities of the residual equation with respect to shape parameters. Our implementation uses an external library for moving the mesh coordinates as a function of shape parameters, a.k.a. mesh morphing. This is an active research area, and a paper has just been prepared detailing six different approaches on a variety of applications [26]. Briefly, the desired capability is for the application code to be able to manipulate shape parameters, such as a length or curvature of part of a solid model, and for the mesh morphing utility to provide a mesh that conforms to that geometry. To avoid changes in data structures and discontinuities in an objective function calculation, it is desirable for the mesh topology, or connectivity, to stay fixed. The algorithm must find a balance between maintaining good mesh quality and preserving the grading of the original mesh, such as anisotropy in the mesh designed to capture a boundary layer. Large shape changes that require remeshing are beyond the scope of this work, and would need to be accommodated by remeshing and restarting the optimization run. A variety of mesh morphing algorithms have been developed and investigated. At one end of the spectrum is the smoothing approach, where the surface nodes are moved to accommodate the new shape parameters and the resulting mesh is smoothed until the elements regain acceptable quality. At the other end of the spectrum is the FEMWARP algorithm [25], where a finite element projection is used to warp the mesh, requiring a global linear solve to determine the new node locations. In this paper, we have used a weighted residual method, where the new node coordinates are based on how boundary nodes in their neighborhood have moved. We chose to always morph the mesh from the original meshed configuration to the chosen configuration, even if an intermediate mesh was already computed at nearby shape parameters, so that the new mesh was uniquely defined by the shape parameters. Since the mesh morphing algorithm is not a local calculation on each element but operates across the entire mesh at one time, the derivatives cannot be calculated within a Phalanx evaluator using the template-based approach, nor using the methods described in Section 4.4. Our approach for calculating sensitivities of the residual vector f with respect to shape parameters p is to use the chain rule, ∂f ∂f ∂X = . (10) ∂p ∂X ∂p where X is the coordinate vector. Outside of the seed-compute-extract section of templated code, we pre-calculate the mesh sensitivities ∂X ∂p with a finite difference algorithm around the mesh morphing algorithm. This multi-vector is fed into the residual calculation as global data. As part of the typical assembly, there is a gatherCoordinates evaluator that takes the coordinate vector from the mesh database and gathers it into the local element-based MDArray data structure. For shape sensitivities, the coordinate vector is a Sacado::FAD data type, and the gather operation not only imports the values of the coordinates, but also seeds the derivative components from the pre-calculated ∂X ∂p vectors. This is shown schematically in Figure 1, where the GatherCoordinates box is shown to have a template specialized version for shape optimization in addition to a generic implementation for all other evaluation types. When the rest of the ∂f calculation proceeds, the directional derivative of ∂X in the direction of ∂X ∂p is computed. The same 18 implementation for extracting described in Section 4.1. 5 ∂f ∂p works for this case as when p is a set of model parameters as Demonstration: Sliding Electromagnetic Contact The template-based generic programming approach is demonstrated here on a prototype 3D PDE application: the sliding electromagnetic contact problem. The geometry of this problem is shown in Figure 9, where, for the nominal design, this 2D geometry is simply extruded into the third dimension. A slider (light blue) is situated between two conductors (green and yellow) with some given shapes of the contact pads (thin red and blue regions). When a potential difference (ψ) over the device is prescribed, an electrical current flows through system in the general direction of the dashed red line. The electrical current generates a magnetic field that in turn propels the slider forward. In addition, the current generates heat. Figure 9: A front view of the geometry for the sliding electromagnetic contact application. The imposed gradient in potential ψ causes electric current, Joule heating, and a magnetic field that propels the slider (which is not currently modeled). The design problem to be investigated is to find the shape of the slider, with a given volume, that minimizes the maximum temperature achieved inside of it. 5.1 Governing Equations and Objective Function In this demonstration, we simplify the system by decoupling the magnetics, and solve a quasi-steady model where the slider velocity v is given. The model is then reduced to two coupled PDEs. The 19 first is a potential equation for the electric potential ψ. The second is a heat balance that accounts for conduction, convection, and Joule heating source term that depends on the current ∇ψ: − ∇ · σ∇ψ = 0, −∇ · κ∇T − v · ∇T (11) 2 = σ(∇ψ) . (12) The electrical conductivity, σ, varies as a function of the local temperature field based on a simplified version of Knoepfel’s model [13], σ(T ) = σ0 /[1 + β(T − T0 )], (13) where σ0 can take different values in the slider, the conductor, and in the pads (σ0p ). This dependency results in a coupled pair of equations. By choosing the frame of reference that stays with the slider, we impose a fixed convective velocity v0 in the beams, and v = 0 in the slider. The Dirichlet boundary conditions for the potential and temperature are shown in Figure 9, with all others being natural boundary conditions. Since these equations and geometry are symmetric about the mid plane (a vertical line in this figure), we only solve for half of the geometry and impose ψ = 0.5 along this axis. This PDE model was implemented using Phalanx evaluators. By specifying the dependencies with the evaluators, such as σ(T ), the evaluation tree is automatically constructed. The full graph for this problem is shown in Figure 10. As with the ODE example in the previous paper [19], only the Gather and Scatter functions need to be written with template specialization for the Seed and Extract phases. All the intermediate Compute quantities can be written once on a generic evaluation type. As an example of how to interpret this graph: the oval marked Tq computes the temperature field at the quadrature points using the Basis Functions and Tn , the Temperature field at the nodes (implementing Equation 3); Tq is subsequently used to compute κ and σ in another evaluator (which implements Equation 13). The objective function g, which is to be minimized by the design problem, is simply g(ψ, T ) = kT k∞ . (14) The design parameters p modify the shape of the slider. Its shape is fixed to match the rectangular pads at each end, and its volume is fixed to be that of the rectangular box between them. In between, the shape is allowed to vary parabolically. For a one-parameter optimization problem, the matched parabolic profiles of the top and bottom of the slider are free to vary by a single maximum deflection parameter. Because of the symmetry of the problem, this defines the parabola. For two-parameter optimization problem, these two parabolas are allowed to vary independently and a third, the bulge of the slider out of the plane of the figure, is adjusted so that the volume constraint is met. 5.2 Gradient-based Optimization The optimization problem is solved using a gradient-based optimization algorithm from the Dakota framework. Dakota can be built as part of Trilinos using the build system and adaptors in the TriKota package. The goal is to minimize the objective function g(p) from Equation 14 as a function of the shape parameters p. In addition, the problem is constrained so that the discretized PDEs are 20 Figure 10: The dependency graph for the Phalanx evaluators that build the thermo-electric equation set is shown. Each box represents a separate class. The quantities at the bottom must be computed before those above. Derivatives are automatically propagated by the chain rule using the Sacado Automatic Differentiation data types. Here X is the coordinate vector, T the temperature, and ψ the potential, and subscript n and q indicating to node and quadrature point data. satisfied, f (x) = 0 where f represents the finite element residuals for the equation set specified in Equations 11–12 and the solution vector x is the combined vector of the discretized potential and temperature fields. The shape parameters do not appear explicitly in the objective function, or even in the governing equations (11–12), but instead effect the geometry of the problem. They appear in the discretization, and can be written as f (x, X(p))), where X is the vector of coordinates of nodes in the mesh. In addition to the objective function g(p), the gradient-based algorithm depends on the reduced gradient of the objective function with respect to the parameters. The formula for this term can be expanded as, dg ∂g ∂g T ∂f −1 ∂f dX = − . (15) dp ∂p ∂x ∂x ∂X dp Each of these terms is computed in a different way. Starting at the end, the multi-vector Xp = dX dp is computed with finite differences around the mesh morphing algorithm, as described in Section 4.5. 21 The sensitivity of the residual vector with respect to the shape parameters is the directional deriva∂f tive ∂X in the direction Xp . This is computed using Automatic Differentiation using the infrastructure described in Section 4.5, where the Sacado automatic derivative data type for the coordinate vector X is seeded with the derivative vectors Xp . The result is a multi-vector fp . The Jacobian matrix ∂f ∂x is computed with automatic differentiation. All the Sacado data types are allocated with derivative arrays of length 16, which is the number of independent variables in a hexahedral element with trilinear basis functions and two degrees of freedom per node. The local ∂xi element solution vector x is seeded with ∂x = 1 when i = j. The action of the inverse of the j Jacobian on fp is performed with a preconditioned iterative linear solver using the Belos and Ifpack packages in Trilinos. ∂g The gradient of the objective function ∂x is computed by hand, since g is the max operator on the half of x corresponding to the temperature unknown. The non-differentiability of the max operator with respect to changes in parameter can in general be an issue. However, no problems were encountered in this application since the location of the maximum did nor move significantly over itrations. Finally, the term ∂g ∂p was identically zero because the parameters did not appear explicitly in the objective function. First, a one-parameter optimization problem was run to find the parabolic deflection of the top and bottom of the slider that minimized the maximum temperature. In addition to the gradientbased optimization algorithm described above, a continuation run was performed using the LOCA package [24] in Trilinos. The results are shown in Figure 11. The continuation run shows the smooth response surface for a wide range if deflections, both positive and negative. The optimization iteration rapidly converges to the minimum. The optimum occurs for a small positive value of the deflection parameter, corresponding to a shape that is slightly arched upwards but rather near the nominal shape of a rectangular box. Figure 11: Results for a continuation run with LOCA and a minimization run using Dakota, for a one-parameter shape optimization problem. A two-parameter optimization run was also performed, where the top and bottom parabolas were freed to vary independently, and the bulge of the slider was adjusted to conserve the volume of the mesh. Figure 12 shows the initial configuration, with a rather arched bottom surface, and 22 nearly flat upper surfaces, and a moderate bulge. The optimal shape is shown in Figure 13. As with the one-parameter case, the optimal shape was found to be close to a rectangular box. The temperature contouring of the two figures, which share a color map, shows a noticeable reduction in the temperature at the optimal shape. Figure 12: Initial mesh configuration and steady-state temperature profiles for the two-parameter optimization problem. The deflections of the top and bottom surface of the slider are varied independently, and the deflection (bulge) out of the plane is chosen to constrain the volume to that of a rectangular brick. 5.3 UQ Results In addition to optimization runs, embedded uncertainty quantification was performed on the same model. The ScalarT data type for the stochastic Galerkin residual evaluation hold polynomial coefficients for the expansion of all quantities with a spectral basis. By nesting the stochastic Galerkin and Automatic Differentiation data types, a Jacobian for the stochastic Galerkin expansions can also be calculated. The Seed and Extract phases of this computation, as well as the subsequent nonlinear solve of the stochastic FEM system required significant development. However, with the template-based generic programming approach, this work is completely orthogonal to the implementation of the PDEs. So, there was no additional coding needed to perform embedded UQ for this application over that needed for the residuals for the governing equations (11–12). As a demonstration, we chose the electrical conductivity in the pad σ0p as the uncertain variable. The pad region is the thin rectangular region at the edge of the slider with fixed shape. In this run, σ0p was chosen to be a uniform distribution within 15 of the nominal value of 35, σ0p = [35.0P0 (ξ) + 15.0P1 (ξ)]. 23 (16) Figure 13: Final configuration and color map for the two-parameter optimization problem. The maximum temperature was significantly decreased. Here, the P variables are Legendre polynomials. The computation was run with degree-3 polynomial basis. A Newton iteration was performed on the nonlinear system from the discretized 4D domain (3D FEM in space + 1 Stochastic Dimension with a spectral basis). The resulting probability distribution on the maximum temperature unknown was computed to be TM ax = 25.87P0 (ξ) + 0.61P1 (ξ) − 0.17P2 (ξ) + 0.04P3 (ξ). (17) Figure 14 shows the mean temperature profile for this distribution. Figure 15 show the variation of the temperature with respect to this parameter. (Note the reduced range of the color bar.) The results show that the variation of the electrical conductivity in the pad region has a large effect on the temperature in the middle of the slider (which has a large dependence on the total current), and not in the pad region itself (which is strongly controlled by the convective cooling from the beam due to the moving frame of reference). 6 Conclusions In this paper, we have related our experience in using the template-based generic programming (TBGP) approach for PDEs in a finite element code. We have used this approach at a local element level, where the dependencies for Jacobian evaluations are small and dense. By combining the Gather phase of a finite element calculation with the Seed phase of the TBGP approach, and the Scatter with Extract, the infrastructure for TBGP is well contained. Once this infrastructure is in place, transformational analysis capabilities such as optimization and embedded UQ are immediately available for any new PDE modes that are implemented. 24 Figure 14: The results of an embedded uncertainty quantification using Stokhos. The electrical conductivity in the thin pad region is given as a distribution. In this figure, the temperature profile for the mean solution is shown. We have also presented some of the implementation details in our approach. This includes infrastructure for dealing with parameters, for dealing with a templated code stack, and dealing with non-templated code. We demonstrated this approach on an example sliding electromagnetic contact problem, which is a pair of coupled nonlinear steady-state equations. We performed optimization algorithms with embedded gradients, and also embedded Stochastic Finite Element calculations. As this paper is to appear in a special issue along with other Trilinos capabilities, we would like to mention explicitly which Trilinos packages (underlined) were used in these calculations. This paper centered on the use of Phalanx assembly engine, Sacado for automatic differentiation, and Stokhos for embedded UQ. For linear algebra, we used the Epetra data structures, Ifpack preconditioners, and Belos iterative solver. The linear algebra was accessed through the Stratimikos linear algebra strategy layer using the Thyra abstraction layer. The STK Mesh package was used for the parallel mesh database, and the STK IO packages, together with Ioss, Exodus, and SEACAS were used for IO and partitioning of the mesh. The Intrepid package was used for the finite element discretization, operating on multidimensional arrays from the Shards package. The utility packages Teuchos was used for parameter list specification and reference-counted memory management. The Piro package managed the solver and analysis algorithms, and makes heavy use of the EpetraExt Model Evaluator abstraction. Piro in turn calls the NOX nonlinear solver, the LOCA library of continuation algorithms, the TriKota interface to the Dakota optimization algorithms, and Stokhos for presenting the stochastic Galerkin system as a single nonlinear problem. These results also relied on several products outside of Trilinos, including the Cubit mesh generator and associated mesh morphing software, the Dakota framework, ParaView visualization package and 25 Figure 15: The variation in the temperature field is shown, for the same embedded uncertainty quantification calculation as the previous figure. netcdf mesh I/O library. Acknowledgements This work was funded by the US Department of Energy through the NNSA Advanced Scientific Computing and Office of Science Advanced Scientific Computing Research programs. References [1] D. Abrahams and A. Gurtovoy. C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond. Addison-Wesley, 2004. [2] C. H. Bischof, A. Carle, P. Khademi, and A. Mauer. ADIFOR 2.0: Automatic differentiation of Fortran 77 programs. IEEE Computational Science & Engineering, 3(3):18–32, 1996. [3] P. Bochev, H. Edwards, R. Kirby, K. Peterson, and D. Ridzal. Solving pdes with intrepid. Scientific Programming, In print., 2012. [4] A. N. Brooks and T. Hughes. Streamline upwind/petrov-galerkin formulations for convection dominated flows with particular emphasis on the incompressible Navier-stokes equations. Comp. Meth. Appl. Mech. and Eng., 32:199–259, 1982. [5] B. Dawes and D. Abrahams. http://www.boost.org, 2011. 26 [6] J. Donea and A. Huerta. Finite Element Methhods for Flow Problems. Wiley, 2003. [7] H. C. Edwards. http://trilinos.sandia.gov/packages/shards/, 2011. [8] R. Ghanem and P. D. Spanos. Polynomial chaos in stochastic finite elements. Journal of Applied Mechanics, 57, Jan 1990. [9] R. G. Ghanem and P. D. Spanos. Stochastic finite elements: a spectral approach. SpringerVerlag, New York, 1991. ISBN 0-387-97456-3. [10] A. Griewank. Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation. Number 19 in Frontiers in Appl. Math. SIAM, Philadelphia, PA, 2000. ISBN 0–89871– 451–6. [11] M. A. Heroux, R. A. Bartlett, V. E. Howle, R. J. Hoekstra, J. J. Hu, T. G. Kolda, R. B. Lehoucq, K. R. Long, R. P. Pawlowski, E. T. Phipps, A. G. Salinger, H. K. Thornquist, R. S. Tuminaro, J. M. Willenbring, A. B. Williams, and K. S. Stanley. An overview of the Trilinos package. ACM Trans. Math. Softw., 31(3), 2005. http://trilinos.sandia.gov/. [12] T. Hughes and A. N. Brooks. A multidimensional upwind scheme with no cross-wind diffusion. in T.J.R. Hughes (ed.), Finite Element Methods for Convection Dominated Flows, AMD Vol. 34, ASME, New York 19-35, 1979. [13] H. Knoepfel. Pulsed high magnetic fields: Physical Effects and Generation Methods Concerning Pulsed Fields Up to the Megaoersted Level. North-Holland Publishing Company, Amsterdam, 1970. [14] A. Logg. Automating the finite element method. Arch. Comput. Methods Eng., 14(2):93–138, 2007. [15] A. Logg, K.-A. Mardal, G. N. Wells, et al. Automated Solution of Differential Equations by the Finite Element Method. Springer, 2012. ISBN 978-3-642-23098-1. [16] K. Long, R. Kirby, and B. van Bloemen Waanders. Unified embedded parallel finite element computations via software-based frechet differentiation. SIAM J. Sci. Comput., 32(6):3323– 3351, 2010. [17] L. O. of a Unified C++ Implementation of the Finite, D. Spectral Element Methods in 1D, and 3D. In Applied Parallel Computing. State of the Art in Scientific Computing, volume 4699 of Lecture Notes in Computer Science, pages 712–721. Springer, 2007. [18] R. P. Pawlowski. http://trilinos.sandia.gov/packages/phalanx/, 2011. [19] R. P. Pawlowski, E. T. Phipps, and A. G. Salinger. Automating embedded analysis capabilities and managing software complexity in multiphysics simulation part I: template-based generic programming. Scientific Programming, 2011. In press. [20] E. Phipps and R. Pawlowski. Efficient expression templates for operator overloading-based automatic differentiation. In S. Forth, P. Hovland, E.Phipps, J. Utke, and A. Walther, editors, Recent Advances in Algorithmic Differentiation. Springer, 2012. 27 [21] E. T. Phipps. http://trilinos.sandia.gov/packages/sacado/, 2011. [22] C. Prud’Homme. A domain specific embedded language in C++ for automatic differentiation, projection, integration and variational formulations. Scientific Programming, 14(2):81–110, 2006. [23] M. Reagan, H. Najm, R. Ghanem, and O. Knio. Uncertainty quantification in reacting-flow simulations through non-intrusive spectral projection. Combustion and Flame, 132(3):545–555, Jan 2003. doi: 10.1016/S0010-2180(02)00503-5. [24] A. G. Salinger, E. A. Burroughs, R. P. Pawlowski, E. T. Phipps, and L. A. Romero. Bifurcation tracking algorithms and software for large scale applications. Int J Bifurcat Chaos, 15(3):1015– 1032, 2005. [25] S. M. Shontz and S. A. Vavasis. Analysis of and workarounds for element rever- sal for a finite element-based algorithm for warping triangular and tetrahedral meshes. BIT Numerical Mathematics, 50:863–884, 2010. [26] M. L. Staten, S. J. Owen, S. M. Shontz, A. G. Salinger, and T. S. Coffey. A comparison of mesh morphing methods for 3D shape optimization. Proceedings of the 20th International Meshing Rountable, Oct. 23–26 2011. Submitted. [27] D. Vandevoorde and N. M. Josuttis. C++ Templates, The Complete Guide. Addison-Wesley, 2003. [28] T. Veldhuizen. Expression templates. C++ Report, 7(5):26–31, 1995. [29] N. Wiener. The homogeneous chaos. Am J Math, 60:897–936, Jan 1938. [30] D. Xiu and G. Karniadakis. The wiener-askey polynomial chaos for stochastic differential equations. Siam J Sci Comput, 24(2):619–644, Jan 2002. 28
5cs.CE
Faster algorithms for SVP and CVP in the ℓ∞ norm Divesh Aggarwal ∗ Priyanka Mukhopadhyay † arXiv:1801.02358v1 [cs.DS] 8 Jan 2018 January 9, 2018 Abstract Blomer and Naewe [BN09] modified the randomized sieving algorithm of Ajtai, Kumar and Sivakumar [AKS01] to solve the shortest vector problem (SVP). The algorithm starts with N = 2O(n) randomly chosen vectors in the lattice and employs a sieving procedure to iteratively obtain shorter vectors in the lattice. The running time of the sieving procedure is quadratic in N. We study this problem for the special but important case of the ℓ∞ norm. We give a new sieving procedure that runs in time linear in N , thereby significantly improving the running time of the algorithm for SVP in the ℓ∞ norm. As in [AKS02, BN09], we also extend this algorithm to obtain significantly faster algorithms for approximate versions of the shortest vector problem and the closest vector problem (CVP) in the ℓ∞ norm. We also show that the heuristic sieving algorithms of Nguyen and Vidick [NV08] and Wang et.al. [WLTB11] can also be analyzed in the ℓ∞ norm. The main technical contribution in this part is to calculate the expected volume of intersection of a unit ball centred at origin and another ball of a different radius centred at a uniformly random point on the boundary of the unit ball. This might be of independent interest. 1 Introduction A lattice L is the set of all integer combinations of linearly independent vectors b1 , . . . , bn ∈ Rd , n X zi bi : zi ∈ Z} . L = L(b1 , . . . , bn ) := { i=1 We call n the rank of the lattice, and d the dimension of the lattice. The matrix B = (b1 , . . . , bn ) is called a basis of L, and we write L(B) for the lattice generated by B. A lattice is said to be full-rank if n = d. In this work, we will only consider full-rank lattices unless otherwise stated. The two most important computational problems on lattices are the Shortest Vector Problem (SVP) and the Closest Vector Problem (CVP). Given a basis for a lattice L ⊆ Rd , SVP asks us to compute a non-zero vector in L of minimal length, and CVP asks us to compute a lattice vector at ∗ Centre for Quantum Technologies and School of Computing, National University of Singapore, Singapore (dcsdiva@nus.edu.sg). † Centre for Quantum Technologies, National University of Singapore, Singapore (mukhopadhyay.priyanka@gmail.com). 1 a minimum distance to a target vector t. Typically the length/distance is defined in terms of the ℓp norm for some p ∈ [1, ∞], such that kxkp := (|x1 |p + |x2 |p + · · · + |xd |p ) for 1 ≤ p < ∞ , and kxk∞ := max |xi | . 1≤i≤d The most popular of these, and the most well studied is the Euclidean norm, which corresponds to p = 2. Starting with the seminal work of [LLL82], algorithms for solving these problems either exactly or approximately have been studied intensely. Such algorithms have found applications in factoring polynomials over rationals [LLL82], integer programming [LJ83, Kan87, DPV11], cryptanalysis [Odl90, JS98, NS01], checking the solvability by radicals [LM83], and solving low-density subset-sum problems [CJL+ 92]. More recently, many powerful cryptographic primitives have been constructed whose security is based on the worst-case hardness of these or related lattice problems [Ajt96, MR07, Gen09, Reg09b, BV11, BLP+ 13, BV14]. Ducas et al. [DLL+ 17] have proposed a signature scheme based on the Module-LWE / ModuleSIS problem in the ℓ∞ norm.For the security of their cryptosystem, the authors choose parameters under the assumption that SVP in the ℓ∞ norm for an appropriate dimension is infeasible. Due to lack of sufficient work on the complexity analysis of SVP in the ℓ∞ norm, they choose parameters based on the best known algorithms for SVP in the ℓ2 norm (which are variants of the algorithm from [NV08]. The rationale for this is that SVP in ℓ∞ norm is likely harder than in the ℓ2 norm. Our results in this paper show that this assumption by Ducas et al. [DLL+ 17] is correct, and perhaps too generous. In particular, we show that the time and space complexity of the ℓ∞ version of [NV08] is at least (4/3)n , which is significantly larger than the best known algorithms for SVP in the ℓ2 norm. The closest vector problem in the ℓ∞ norm is particularly important since it is equivalent to the integer programming problem [EHN11]. The focus of this work is to study the complexity of the closest vector problem and the shortest vector problem in the ℓ∞ norm. Given the importance of these problems, their complexity is quite well studied. 1.1 1.1.1 Prior Work. Algorithms in the Euclidean Norm. The fastest known algorithms for solving these problems run in time 2cn , where n is the rank of the lattice and c is some constant. The first algorithm to solve SVP in time exponential in the dimension of the lattice was given by Ajtai, Kumar, and Sivakumar [AKS01] who devised a method based on “randomized sieving,” whereby exponentially many randomly generated lattice vectors are iteratively combined to create shorter and shorter vectors, eventually resulting in the shortest vector in the lattice. A sequence of works [NV08, MV10, PS09, LWXZ11, ADRS15, ASD17] have given improvements of their sieving technique thereby improving the constant in the exponent. The current fastest provable algorithm for exact SVP runs in time 2n+o(n) [ADRS15], and the fastest algorithm that gives a constant approximation runs in time 20.802n+o(n) [LWXZ11]. There are heuristic algorithms that run in time (3/2)n/2 [NV08, WLTB11, Laa14, BDGL16]. The CVP is considered a harder problem than SVP since there is a simple dimension and approximation-factor preserving reduction from SVP to CVP [GMSS99]. Based on a technique due 2 to Kannan [Kan87], Ajtai, Kumar, and Sivakumar [AKS02] gave a sieving based algorithm that gives a 1 + α approximation of CVP in time (2 + 1/α)O(n) . Later exact exponential time algorithms for CVP were discovered [MV13, ADSD15]. The current fastest algorithm for CVP runs in time 2n+o(n) and is due to [ADSD15]. 1.1.2 Algorithms in Other ℓp Norms. [AJ08, BN09] generalized the AKS algorithm [AKS01] to give exact algorithms for SVP that run in time 2O(n) . They in fact gave exact algorithm for a more general problem called the subspace avoidance problem SAP. In particular, [BN09] showed that several lattice problems, in particular the (approximate) SVP and the (approximate) CVP, are easily reducible to (approximate) SAP. Thus [BN09] give 1 + ε approximation algorithms for CVP for all ℓp norms that run in time (2 + 1/ε)O(n) . For the special case when p = ∞, Eisenbrand et al [EHN11] gave a 2O(n) · (log(1/ε))n algorithm for (1 + ε)-approx CVP. 1.1.3 Hardness Results. The first NP hardness result for CVP in all ℓp norms and SVP in the ℓ∞ norm was given by Van Emde Boas [vEB81]. Subsequent results [ABSS93, DKRS03] have shown NP hardness of approximating CVP up to a factor of nc/ log log n for all ℓp norms. Also, hardness of SVP with similar approximating factor have been obtained under plausible but stronger complexity assumptions [CN98, Mic01, Kho05, HR12]. Very recently, [BGSD17] showed that for almost all p ≥ 1, CVP in the ℓp norm cannot be solved in 2n(1−ε) time under the strong exponential time hypothesis [IP99]. A similar hardness result has also been obtained for SVP in the ℓ∞ norm. 1.2 1.2.1 Our contribution. Provable Algorithms. We modify the sieving algorithm by [AKS01, AKS02] for SVP and approximate CVP for the ℓ∞ norm that results in substantial improvement over prior results. Before describing our idea, we give a brief description of the sieving procedure of [AKS01, AKS02]. The algorithm starts by randomly generating a set S of N ∈ 2O(n) vector pairs such that the vector difference for each such pair is a lattice vector of length at most 2O(n) . It then runs a sieving procedure (usually) a polynomial number of times. In the ith iteration the algorithm maintains and updates a list of “centre pairs” C, which is initialized to be the empty set. (The second vector in each centre pair is usually referred to as “centre”.) Then for each vector y such that (e, y) ∈ S, the algorithm checks whether there is some c such that (ec , c) ∈ C and it is at a distance of at most βi (say) from y. If there exists such a centre pair, then the vector pair (e, y) is replaced in S by (e, y − c + ec ), otherwise it is deleted from S and added to C. This results in Ni−1 − |C| lattice vectors which are shorter than those at the beginning of a sieving iteration, where Ni−1 is the number of lattice vectors at the end of i − 1 sieving iterations. Thus, continuing in this manner, we eventually obtain the shortest vector. A crucial step in this algorithm is to find a vector c that is close to y. This problem is called the nearest neighbor search (NNS) problem and has been well studied especially in the context of heuristic algorithms for SVP [BDGL16, IM98, Laa15, LdW15, MBL15]. A trivial bound on the running time for this is |S|·|C|, but the aforementioned heuristic algorithms have spent considerable effort trying to improve this bound under reasonable heuristic assumptions. Since they require 3 heuristic assumptions, such improved algorithms for the NNS have not been used to improve the provable algorithms for SVP. We make a simple but powerful observation that for the special case of the ℓ∞ norm, if we partition the ambient space [−R, R]n into ([−R, −R + βi ), [−R + βi , −R + 2βi ), . . .)n , then it is easy to see that each such partition will contain at most one centre. Thus, to find a centre at distance βi from a given vector y, we only need to find the partition in which y belongs, and then check whether this partition contains a centre. This can be easily done by checking the interval in which each co-ordinate of y belongs. This drastically improves the running time for the sieving procedure in the SVP algorithm from |S| · |C| to |S| · n. This idea can also be used to obtain significantly faster approximation algorithms for both SVP and CVP. It must be noted here that the prior provable algorithms using AKS sieve lacked an explicit value of the constant in the exponent for both space and time complexity. And they used a quadratic sieve. Our modified sieving procedure is linear in the size of the input list and thus yields a better space-time trade-off compared to the prior algorithms. In order to get the best possible running time, we optimize several steps specialized to the case of ℓ∞ norm in the analysis of the algorithms. See Theorems 3.2, 4.1, and 4.2 for explicit running times and a detailed description. Just to emphasise that our results are nearly the best possible using these techniques, notice that for a large enough constant τ , we obtain a running time (and space) close to 3n for τ -approximate SVP. To put things in context, the best algorithm [WLW15] for a constant approx SVP in the ℓ2 norm runs in time 20.802n and space 20.401n . Their algorithm crucially uses the fact that 20.401n is the best known upper bound for the kissing number of the lattice (which is the number of shortest vectors in the lattice) in ℓ2 norm. However, for the ℓ∞ norm, the kissing number is 3n for Zn . So, if we would analyze the algorithm from [WLW15] for the ℓ∞ norm (without our improvement), we would obtain a space complexity 3n , but time complexity 9n . 1.2.2 Heuristic Algorithms. In each sieving step of the algorithm from [AKS01], the length of the lattice vectors reduce by a constant factor. It seems like if we continue to reduce the length of the lattice vectors until we get vectors of length λ1 (where λ1 is the length of the shortest vector), we should obtain the shortest vector during the sieving procedure. However, there is a risk that all vectors output by this sieving procedure are copies of the zero vector and this is the reason that the AKS algorithm [AKS01] needs to start with much more vectors in order to provably argue that we obtain the shortest vector. Nguyen and Vidick [NV08] observed that this view is perhaps too pessimistic in practice, and that the randomness in the initial set of vectors should ensure that the basic sieving procedure should output the shortest vector for most (if not all) lattices. The main ingredient to analyze the space and time complexity of their algorithm is to compute the expected number of centres necessary so that any point in S is at a distance of at most βi from one of the centres. (Note that in this heuristic setting, unlike the AKS algorithm, S stores lattice vectors instead of vector pairs.) This number is roughly the reciprocal of the fraction of the ball B of radius Ri−1 centred at the origin covered by a ball of radius βi centred at a uniformly random point in B. Here Ri−1 is the maximum length of a lattice vector in S after i − 1 sieving iterations. In this work, we show that the heuristic algorithm of [NV08] can also be analyzed for the ℓ∞ norm under similar assumptions. The main technical contribution in order to analyze the time and space complexity of this algorithm is to compute the expected fraction of an ℓ∞ ball B (∞) of radius Ri−1 centered at the origin covered by an ℓ∞ ball of radius βi centered at a uniformly random point 4 in B (∞) . In order to improve the running time of the NV sieve [NV08], a modified two-level sieve was introduced by Wang et al. [WLTB11]. Here they first partition the lattice into sets of vectors of larger norm and then within each set they carry out a sieving procedure similar to [NV08]. We have analyzed this in the ℓ∞ norm and obtain algorithms significantly faster than the provable algorithms. In particular, our two-level sieve algorithm runs in time 20.62n . We would like to mention here that our result does not contradict the near 2n lower bound for SVP obtained by [BGSD17] under the strong exponential time hypothesis. The reason for this is that the lattice obtained in the reduction in [BGSD17] is not a full-rank lattice, and has a dimension significantly larger than the rank n of the lattice. 1.3 Organization of the paper In Section 2 we give some basic definitions and results used in this paper. In Section 3 we introduce our sieving procedure and apply it to provably solve exact SVP(∞) . In Section 4 we describe approximate algorithms for SVP(∞) and CVP(∞) using our sieving technique. Some results which are used in the analysis have been given in Section 2.3, but the reader can look at these when referenced. In Section 5 we talk about heuristic sieving algorithms for SVP(∞) . 2 2.1 Preliminaries Notations We write ln for natural logarithm and log for logarithm to the base 2. The dimension may vary and will be specified. We use bold lower case letters (e.g. vn ) for vectors and bold upper case letters for matrices (e.g. Mm×n ). We may drop the dimension in the superscript whenever it is clear from the context. Sometimes we represent a matrix as a vector of column (vectors) (e.g., Mm×n = [m1 m2 . . . mn ] where each mi isPan m−length vector). The ith co-ordinate of v is denoted by vi or (v)i . Given a vector x = ni=1 xi mi with xi ∈ Q, the representation size of x with respect to M is the maximum of n and the binary lengths of the numerators and denominators of the coefficients xi . For any set of vectors S = {s1 , . . . sn } and a (well-defined) norm, let kSk = maxni=1 ksi k. |A| denotes volume of A if it is a geometric body and cardinality if it is a set. 2.2 ℓp norm P 1/p n p Definition 2.1 (ℓp norm). The ℓp norm of a vector v ∈ Rn is defined by kvkp = |v | i=1 i for 1 ≤ p < ∞ and kvk∞ = max{|vi | : i = 1, . . . n} for p = ∞. √ Fact 2.1. For x ∈ Rn kxkp ≤ kxk2 ≤ nkxkp for p ≥ 2 and √1n kxkp ≤ kxk2 ≤ kxkp for 1 ≤ p < 2. Definition 2.2 (Ball). A ball is the set of all points within a fixed distance or radius (defined by a metric) from a fixed point or centre. More precisely, we define the (closed) ball centered at x ∈ Rn (p) with radius r as Bn (x, r) = {y ∈ Rn : ky − xkp ≤ r}. 5 (p) (p) The boundary of Bn (x, r) is the set bd(Bn (x, r)) = {y ∈ Rn : ky − xkp = r}. We may drop the first argument when the ball is centered at the origin 0 and drop both the arguments for unit ball centered at origin. (p) (p) (p) Let Bn (x, r1 , r2 ) = Bn (x, r2 ) \ Bn (x, r1 ) = {y ∈ Rn : r1 < ky − xkp ≤ r2 }. We drop the first argument if the spherical shell or corona is centered at origin. (p) (p) Fact 2.2. |Bn (x, c · r)| = cn · |Bn (x, r)| for all c > 0. The algorithm of Dyer, Frieze and Kannan [DFK91] selects almost uniformly a point in any convex body in polynomial time, if a membership oracle is given [GG00]. For the sake of simplicity we will ignore the implementation detail and assume that we are able to uniformly select a point (p) in Bn (x, r) in polynomial time. Definition 2.3. A lattice L is a discrete additive subgroup of Rd . Each lattice has a basis B = [b1 , b2 , . . . bn ], where bi ∈ Rd and L = L(B) = n nX i=1 x i bi : x i ∈ Z for 1≤i≤n o For algorithmic purposes we can assume that L ⊆ Qd . We call n the rank of L and d as the dimension. If d = n the lattice is said to be full-rank. Though our results can be generalized to arbitrary lattices, in the rest of the paper we only consider full rank lattices. Definition 2.4. For any lattice basis B we define the fundamental parallelepiped as : P(B) = {Bx : x ∈ [0, 1)n } If y ∈ P(B) then kykp ≤ nkBkp as can be easily seen by triangle inequality. For any z ∈ Rn there exists a unique y ∈ P(B) such that z − y ∈ L(B). This vector is denoted by y ≡ z mod B and it can be computed in polynomial time given B and z. Definition 2.5. For i ∈ [n], the ith successive minimum is defined as the smallest real number r such that L contains i linearly independent vectors of length at most r : (p) λi (L) = inf{r : dim(span(L ∩ Bn(p) (r))) ≥ i} Thus the first successive minimum of a lattice is the length of the shortest non-zero vector in the lattice: (p) λ1 (L) = min{kvkp : v ∈ L \ {0}} We consider the following lattice problems. In all the problems defined below c ≥ 1 is some arbitrary approximation factor (usually specified as subscript), which can be a constant or a function of any parameter of the lattice (usually rank). For exact versions of the problems (i.e. c = 1) we drop the subscript. (p) Definition 2.6 (Shortest Vector Problem (SVPc )). Given a lattice L, find a vector v ∈ L\{0} such that kvkp ≤ ckukp for any other u ∈ L \ {0}. 6 (p) Definition 2.7 (Closest Vector Problem (CVPc )). Given a lattice L with rank n and a target vector t ∈ Rn , find v ∈ L such that kv − tkp ≤ ckw − tkp for all other w ∈ L. (p) Lemma 2.1. The LLL algorithm [LLL82] can be used to solve SVP2n−1 in polynomial time. (p) Proof. Let L is a lattice and λ1 (L) is the length of the shortest vector. It has been shown in [BN09] that the LLL algorithm [LLL82] can be used to obtain an estimate (2) f f1 (L) ≤ 2n−1 λ(2) (L). λ1 (L) of the length of the shortest vector satisfying λ1 (L) ≤ λ 1 Using Fact 2.1 we get √ (p) (2) f1 (L) ≤ 2n−1 λ(2) (L) ≤ 2n−1 nλ(p) (L) λ1 (L) ≤ λ1 (L) ≤ λ 1 1 and 1 (p) n−1 (2) f √ λ1(p) (L) ≤ λ(2) λ1 (L) ≤ 2n−1 λ1 (L) 1 (L) ≤ λ1 (L) ≤ 2 n [For p ≥ 2] [For p < 2] Hence the result follows. (p) The following result shows that in order to solve SVP1+ǫ , it is sufficient to consider the case (p) when 2 ≤ λ1 (L) < 3. This is done by appropriately scaling the lattice. Lemma 2.2 (Lemma 4.1 in [BN09]). For all ℓp norms, if there is an algorithm A that for all (p) (p) lattices L with 2 ≤ λ1 (L) < 3 solves SVP1+ǫ in time T = T (n, b, ǫ), then there is an algorithm A′ (p) that solves SVP1+ǫ for all lattices in time O(nT + n4 b). 2.3 Volume estimates in the infinity norm In this section we prove some results about volume of intersection of balls which will be used in our analysis later. The reader may skip this section and look at it when referenced.  j kn (∞) 2R Lemma 2.3. Let L is a lattice and R ∈ R>0 . Then |Bn (R) ∩ L| ≤ 1 + (∞) . λ1 Proof. Note that for any non-negative integers i1 , . . . , in , the region (∞) [−R+i1 λ1 (∞) , −R+(i1 +1)λ1 (∞) ) × [−R+i2 λ1 (∞) , −R+(i2 +1)λ1 (∞) ) × · · · × [−R+in λ1 (∞) , −R+(in +1)λ1 contains at most one lattice jpoint.k The values of ij for any j ∈ [n] such that this region intersects (∞) with Bn (R) are {0, 1, . . . , 2R (∞) }. The result follows. λ1 (∞) In the following lemma we derive the expected volume of intersection of Bn (∞) assuming the centre r is uniformly distributed in Bn (γ, 1). (∞) (∞) (∞) Lemma 2.4. Let Vr = |Bn (r, γ) ∩ Bn |, where r ∈ Bn (γ, 1). Then h i  n−1 h limγ→1 Er∼ B (∞) (γ,1) Vr = 32 and hence limγ→1 Er∼ B (∞) (γ,1) U (∞) (r, γ) with Bn n U 7 n Vr (∞) Bn i =  n−1 3 4 , ) Proof. Vr is a hyperrectangle or an n-orthotope and therefore its volume is the product of its edges. (∞) Let Ei is the event when maxnj=1 |rj | = |ri |. Since r ∼U Bn (γ, 1) so due to symmetry, Pr[Ei ] = n1 for all i. Thus Er [Vr ] = n X i=1 Pr[Ei ]Er [Vr |Ei ] = Er [Vr |E1 ] (∞) Since r ∈ Bn (γ, 1), so r1 ∈ [−1, −γ) ∪ (γ, 1]. Let Zi is the variable denoting the length of the hyperrectangle in the direction of the ith co-ordinate. Then n Y 1 Eri ∼U [−r1 ,r1 ] [Zi |Z1 , E1 ] lim Er1 ∼U (γ,1] [Z1 |E1 ] γ→1 2 lim Er [Vr |E1 ] = γ→1 i=2 n Y 1 Eri ∼U [r1 ,−r1 ] [Zi |Z1 , E1 ] lim Er1 ∼U [−1,−γ) [Z1 |E1 ] γ→1 2 + i=2 (∞) (∞) Now Vr = Bn (r, γ) ∩ Bn = {y : ky − rk∞ ≤ γ and kyk∞ ≤ 1} = {y : max{−γ + ri , −1} ≤ yi ≤ min{γ + ri , 1} ∀i}. If r1 ∈ (γ, 1] then −γ + r1 ≤ y1 ≤ 1 and thus Er1 ∼U (γ,1] [Z1 |E1 ] = Er1 ∼U (γ,1] [1 + γ − r1 ]. Now let us consider Eri ∼U [−r1 ,r1 ] [Zi |Z1 , E1 ]. (Note this expression is same for all i = 2, . . . n). Eri ∼U [−r1 ,r1 ] [Zi |Z1 ] = Pr[ri ∈ [−r1 , −1 + γ]]Eri ∼U [−r1 ,−1+γ] [Zi |Z1 ] + Pr[ri ∈ [−1 + γ, 1 − γ]]Eri ∼U [−1+γ,1−γ] [Zi |Z1 ] + Pr[ri ∈ [1 − γ, r1 ]]Eri ∼U [1−γ,r1 ] [Zi |Z1 ]  −1 + γ + r  h i 1 = Eri ∼U [−r1 ,−1+γ] (γ + ri ) − (−1) 2r1 h i 1 − γ  Eri ∼U [−1+γ,1−γ] (γ + ri ) − (−γ + ri ) + r1 r − 1 + γ  h i 1 + Eri ∼U [1−γ,r1 ] 1 − (−γ + ri ) 2r1  −1 + γ + r h −1 + γ − r1 i  1 − γ  1 + 1+γ+ 2γ = 2r1 2 r1  r − 1 + γ h 1 − γ + r1 i 1 1+γ − + 2r1 2 i 1 − γ   r + γ − 1 h 1 1 + 3γ − r1 + 2γ = 2r1 r1 r  (1 − γ)2 1 = − +γ+1− 2 2r1 8 So Qn lim Er1 ∼U (γ,1] [Z1 |E1 ] Eri ∼U [−r1,r1 ] [Zi |Z1 , E1 ] i=2 γ→1 ih  r  h (1 − γ)2 in−1 1 lim Er1 ∼U (γ,1] 1 + γ − r1 − +γ+1− γ→1 2 2r1 h 1 + γ ih 1 + γ (1 − γ)2 ln |γ| in−1 − +1+γ − = lim 1 + γ − γ→1 2 4 2(1 − γ)  3 n−1 = 2  n−1 Q Similarly limγ→1 Er1 ∼U [−1,−γ) [Z1 |E1 ] ni=2 Eri ∼U [r1 ,−r1 ] [Zi |Z1 , E1 ] = 32 . Thus  3 n−1 lim Er [Vr ] = γ→1 2 = and the theorem follows. Next we deduce a similar result except that now we consider the volume of intersection of a “big” ball of radius γ1 > 1 with the unit ball, when the big ball is centred at a uniformly distributed (∞) point on the corona Bn (γ2 , 1) (γ2 < 1). (∞) Lemma 2.5. Let Vr = |Bn (∞) (r, γ1 ) ∩ Bn lim Er∼ γ2 →1 (∞) (γ2 U Bn (∞) |, where r ∈ Bn (γ2 , 1). Then in−1 h h i 0.5 + γ = γ V 1 1 r ,1) and hence Ωn (γ1 ) = lim Er∼ γ2 →1 (∞) (γ2 ,1) U Bn h V i r (∞) Bn h γ1 i n ≈ 0.25 + 2 Proof. The proof is similar to Lemma 2.4 and we use similar notations. (∞) Here r ∼U Bn (γ2 , 1), so r1 ∈ [−1, −γ2 ) ∪ (γ2 , 1] and Vr = {y : max(−γ1 + ri , −1) ≤ yi ≤ min(γ1 + ri , 1)}. n Y 1 lim Er [Vr |E1 ] = lim Er1 ∼U (γ2 ,1] [Z1 |E1 ] Eri ∼U [−r1 ,r1 ] [Zi |Z1 , E1 ] γ2 →1 γ2 →1 2 i=2 n Y 1 + lim Er1 ∼U [−1,−γ2 ) [Z1 |E1 ] Eri ∼U [r1 ,−r1 ] [Zi |Z1 , E1 ] γ2 →1 2 i=2 If r1 ∈ (γ2 , 1] then −γ1 + r1 ≤ y1 ≤ 1 and thus Er1 ∼U (γ2 ,1] [Z1 ] = Er1 ∼U (γ2 ,1] [1 + γ1 − r1 ]. Eri ∼U [−r1 ,r1 ] [Zi |Z1 ] = Pr[ri ∈ [−r1 , 1 − γ1 ]]Eri ∼U [−r1 ,1−γ1 ] [Zi |Z1 ] + Pr[ri ∈ [1 − γ1 , −1 + γ1 ]]Eri ∼U [1−γ1 ,−1+γ1 ] [Zi |Z1 ] + Pr[ri ∈ [−1 + γ1 , r1 ]]Eri ∼U [−1+γ1 ,r1 ] [Zi |Z1 ] = (1 + γ1 ) − r1 (γ1 − 1)2 − 2 2r1 9 So lim Er1 ∼U (γ2 ,1] [Z1 |E1 ] γ2 →1 n Y i=2 Eri ∼U [−r1 ,r1 ] [Zi |Z1 , E1 ] ih h r1 (γ1 − 1)2 in−1 − lim Er1 ∼U (γ2 ,1] 1 + γ1 − r1 (1 + γ1 ) − γ2 →1 2 2r1 h ih 1 + γ2 1 + γ2 (γ1 − 1)2 ln |γ2 | in−1 (1 + γ1 ) − = lim (1 + γ1 ) − − γ2 →1 2 4 2 1 − γ2 h 1 + γ2 (γ1 − 1)2 ln |γ2 | in−1 1 + γ2 ih (1 + γ1 ) − ≥ lim (1 + γ1 ) − − γ2 →1 2 4 2 1 − γ1 in−1 h = γ1 0.5 + γ1 = We can also bound the above expression as lim Er1 ∼U (γ2 ,1] [Z1 |E1 ] γ2 →1 n Y i=2 Eri ∼U [−r1 ,r1 ] [Zi |Z1 , E1 ] h 1 + γ2 (γ2 − 1)2 ln |γ2 | in−1 1 + γ2 ih (1 + γ1 ) − − lim (1 + γ1 ) − γ2 →1 2 4 2 1 − γ2 in−1 h = γ1 0.5 + γ1 ≤ in−1 h Q Thus we can conclude that limγ2 →1 Er1 ∼U (γ2 ,1] [Z1 |E1 ] ni=2 Eri ∼U [−r1 ,r1 ] [Zi |Z1 , E1 ] = γ1 0.5+γ1 in−1 h Q Similarly limγ2 →1 Er1 ∼U [−1,−γ2 ) [Z1 |E1 ] ni=2 Eri ∼U [r1 ,−r1 ] [Zi |Z1 , E1 ] = γ1 0.5 + γ1 in−1 h and the lemma follows. Hence limγ2 →1 Er [Vr ] = γ1 0.5 + γ1 The following result gives a bound on the size of intersection of two balls of a given radius in the ℓ∞ norm. Lemma 2.6. Let v = (v1 , v2 , . . . , vn ) ∈ Rn , and let a > 0 be such that 2a ≥ kvk∞ . Let D = (∞) (∞) Bn (0, a) ∩ Bn (v, a). Then, n Y (2a − |vi |) . |D| = i=1 Proof. It is easy to see that the intersection of two balls in the ℓ∞ norm, i.e., hyperrectangles, is also a hyperrectangle. For all i, the length of the i-th side of this hyperrectangle is 2a − |vi |. The result follows. 3 A faster algorithm for SVP(∞) In this section we present an algorithm for SVP(∞) that uses the framework of AKS algorithm [AKS01] but uses a different sieving procedure that yields a faster running time. Using Lemma 2.1, (∞) (∞) (∞) we can obtain an estimate λ∗ of λ1 (L) such that λ1 (L) ≤ λ∗ ≤ 2n · λ1 (L). Thus, if we try 10 polynomially many different values of λ = (1 + 1/n)−i λ∗ , for i ≥ 0, then for one of them, we have (∞) (∞) λ1 (L) ≤ λ ≤ (1 + 1/n) · λ1 (L) For the rest of this section, we assume that we know a guess λ of the length of the shortest vector in L, which is correct upto a factor 1 + 1/n. (∞) AKS algorithm initially samples uniformly a lot of perturbation vectors, e ∈ Bn (d), where d ∈ R>0 and for each such perturbation vector, maintains a vector y close to the lattice, (y is such (∞) (∞) that y − e ∈ L). Thus, initially we have a set S of many such pairs (e, y) ∈ Bn (d) × Bn (R′ ) for some R′ ∈ 2O(n) . The desired situation is that after a polynomial number of such sieving iterations (∞) (∞) we are left with a set of vector pairs (e′′ , y′′ ) such that y′′ − e′′ ∈ L ∩ Bn (O(λ1 (L))). Finally we take pair-wise differences of the lattice vectors corresponding to the remaining vector pairs and output the one with the smallest non-zero norm. It was shown in [AKS01] that with overwhelming probability, this is the shortest vector in the lattice. One of the main and usually the most expensive step in this algorithm is the sieving procedure, (∞) (∞) where given a list of vector pairs (e, y) ∈ Bn (d) × Bn (R) in each iteration, it outputs a list of (∞) (∞) vector pairs (e′ , y′ ) ∈ Bn (d) × Bn (γR) where γ ∈ R(0,1) . In each sieving iteration, a number of vector pairs (usually exponential in n) are identified as “centre pairs”. The second element of each such centre pair is referred to as “centre”. By a well-defined map each of the remaining vector pair is associated to a “centre pair” such that after certain operations (like subtraction) on the vectors, we get a pair with vector difference yielding a lattice vector of norm less than R. If we start an iteration with say N ′ vector pairs and identify |C| number of centre pairs, then the output consists of N ′ − |C| vector pairs. In the original AKS algorithm [AKS01] and most of its variants, the running time of this sieving procedure, which is the dominant part of the total running time of the algorithm, is roughly quadratic in the number of sampled vectors. To reduce the running time in ℓ∞ norm we use a different sieving approach. Below we give a brief description of the sieving procedure (Algorithm 3). The details can be found in Algorithm 1 and its two sub-routines, Algorithm 2 and Algorithm k j 3. We partition the interval [−R, R] into ℓ = 1 + γ2 intervals of length γR. The intervals are [−R, −R + γR), [−R + γR, −R + 2γR), . . . [−R + (ℓ − 1)γR, R]. (Note that  thejlast kinterval may be n smaller than the rest.) The ball [−R, R]n can thus be partitioned into 1 + γ2 regions, such that no two vectors in a region are at a distance greater than γR in the ℓ∞ norm. A list C of pairs is maintained where the first entry of each pair is an n−tuple or array and the second one, initialized as emptyset, is for storing a centre pair. We can think of this n− tuple as an index and call it the “index-tuple”. The intuition is the following. We want to associate a vector pair (e, y) to a centre pair (ec , c) such that ky − ck∞ ≤ γR. Note that if |yi − ci | ≤ γR for each i = 1, . . . , n, then this condition is satisfied. Since −R ≤ yi ≤ R for each y, so we partitioned [−R, R] into intervals of length γR. Given y we map it to its index-tuple Iy in linear time. This index-tuple Iy is such that Iy [i] ∈ [ℓ] (for i = 1, . . . n) and indicates the interval in which yi belong. We can access C[Iy ] (say) in constant time. For each (e, y) in the list S, if there exists a (ec , c) ∈ C[Iy ], i.e. Iy = Ic (implying ky − ck∞ ≤ γR) then we add (e, y − c + ec ) to the output list S ′ . Else we add vector pair (e, y) to C[Iy ] as a centre pair. Finally we return S ′ . Lemma 3.1. Let γ ∈ R(0,1) and R ∈ R>0 . The number of centre pairs in Algorithm 3 always 11 Algorithm 1: An exact algorithm for SVP(∞) Input: (i) A basis B = [b1 , . . . bn ] of a lattice L, (ii) 0 < γ < 1, (iii) ξ > 1/2, (iv) (∞) λ ≈ λ1 (L) ,(v) N ∈ N Output: A shortest vector of L 1 S ←∅ ; 2 for i = 1 to N do 3 (ei , yi ) ← Sample(B, ξλ) using Algorithm 2 ; 4 S ← S ∪ {(ei , yi )} ; 5 end 6 R ← n maxi kbi k∞ ;  l m ξ nR(1−γ) 7 for j = 1 to k = logγ 8 S ← sieve(S, γ, R, ξ) using Algorithm 3 ; R ← γR + ξλ ; end Compute the non-zero vector v0 in {(yi − ei ) − (yj − ej ) : (ei , yi ), (ej , yj ) ∈ S} with the smallest ℓ∞ norm ; return v0 ; 9 10 11 12 do Algorithm 2: Sample Input: (i) A basis B = [b1 , . . . bn ] of a lattice L, (ii) d ∈ R>0 (∞) Output: A pair (e, y) ∈ Bn (0, d) × P(B) such that y − e ∈ L (∞) 1 e ←uniform Bn (0, d) ; 2 y ← e mod P(B) ; 3 return (e, y) ; 12 Algorithm 3: A faster sieve for ℓ∞ norm 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 (∞) (∞) Input: (i) Set S = {(ei , yi ) : i ∈ I} ⊆ Bn (ξλ) × Bn (R) such that ∀i ∈ I, yi − ei ∈ L, (ii) A triplet (γ, R, ξ) (∞) (∞) Output: A set S ′ = {(e′ i , y′ i ) : i ∈ I ′ } ⊆ Bn (ξλ) × Bn (γR + ξλ) such that ∀i ∈ I ′ , y′ i − e′ i ∈ L R ← max(e,y)∈S kyk∞ ; j k ℓ = 1 + γ2 ; S′ ← ∅ ; S S S C ← ℓi1 =1 ℓi2 =1 . . . ℓin =1 {((i1 , i2 , . . . in ), ∅)} ; for (e, y) ∈ S do if kyk∞ ≤ γR then S ′ ← S ′ ∪ {(e, y)} ; else I←∅; for i = 1, . . . n do Find the integer j such that (j − 1) ≤ I[i] = j ; end if ∃(ec , c) ∈SC[I] then S ′ ← S ′ {(e, y − c + ec )} ; else S C[I] ← C[I] {(e, y)} ; end end end return S ′ ; 13 yi +R γR <j ;  j k satisfies |C| ≤ 2cc n where cc = log 1 + γ2 . Proof. For each of the n co-ordinates we partitioned the range [−R, R] into j k intervals of length γR, i.e. [−R, −R + γR), [−R + γR, −R + 2γR), . . .. There can be ℓ = 1 + γ2 such intervals in each  j kn and co-ordinate. Thus in C the number of n−tuples, i.e. the index set is of cardinality 1 + γ2 hence the theorem follows. Claim 3.1. The following two invariants are maintained in Algorithm 1: 1. ∀(e, y) ∈ S, y − e ∈ L. 2. ∀(e, y) ∈ S, ||y||∞ ≤ R. Proof. 1. The first invariant is maintained at the beginning of the sieving iterations in Algorithm 1 due to the choice of y at step 2 of Algorithm 2. Since each centre pair (ec , c) once belonged to S, so c − ec ∈ L. Thus at step 15 of the sieving procedure (Algorithm 3) we have (e − y) + (c − ec ) ∈ L. 2. The second P invariant is maintained at step 3 of Algorithm 1 because y ∈ P(B) and hence kyk∞ ≤ ni=1 kbi k∞ ≤ n maxi kbi k∞ = R. We claim that this invariant is also maintained in each iteration of the sieving procedure. Consider a pair (e, y) ∈ S and let Iy is its index-tuple. Let (ec , c) is its associated centre pair. By Algorithm 3 we have Iy = Ic , i.e. |yi − ci | ≤ γR (for i = 1, . . . n). So ky − ck∞ ≤ γR and hence ky − c + ec k∞ ≤ ky − ck∞ + kec k∞ ≤ γR + ξλ The claim follows by re-assignment of variable R at step 9 in Algorithm 1. In the following lemma, we bound the length of the remaining lattice vectors after all the sieving iterations are over. Lemma 3.2. At the end of k iterations in Algorithm 1 the length of lattice vectors ky − ek∞ ≤ ξ(2−γ)λ γξ ′ 1−γ + n(1−γ) =: R .     ξ ξ ≤ k ≤ logγ nR(1−γ) + 1. Proof. Let Rk is the value of R after k iterations, where logγ nR(1−γ) Then Rk = γ k R + k X γ k−1 ξλ i=1 1 − γk ξλ 1−γ i ξ ξλ h ξγ 1− + n(1 − γ) 1 − γ nR(1 − γ) = γkR + ≤ 14 Thus after k iterations, kyk∞ ≤ Rk and hence after k iterations ky − ek∞ ≤ kyk∞ + (k − ek∞ ) ≤ Rk + ξλ i ξ ξλ h ξγ 2−γ− + ≤ n(1 − γ) 1 − γ nR(1 − γ) ξλ(2 − γ) ξγ + ≤ n(1 − γ) 1−γ (2 − γ)ξλ γξ = + 1−γ n(1 − γ) (∞) Using Lemma 2.3 and assuming λ ≈ λ1 we get an upper bound on the number of j klattice 2ξ(2−γ) c n+o(n) vectors of length at most i.e. L| ≤ 2 b , where cb = log 1 + . 1−γ The above lemma along with the invariants imply that at the beginning of step 11 in Algorithm 1 we have “short” lattice vectors, i.e. vectors with norm bounded by R′ . We want to start with “sufficient number” of vector pairs so that we do not end up with all zero vectors at the end of the sieving iterations. For this we work with the following conceptual modification proposed by Regev [Reg09a]. (∞) (∞) (∞) Let u ∈ L such that kuk∞ = λ1 (L) ≈ λ (where 2 < λ1 (L) ≤ 3), D1 = Bn (ξλ) ∩ (∞) (∞) (∞) (∞) Bn (−u, ξλ) and D2 = Bn (ξλ) ∩ Bn (u, ξλ). Define a bijection σ on Bn (ξλ) that maps D1 (∞) to D2 , D2 \ D1 to D1 \ D2 and Bn (ξλ) \ (D1 ∪ D2 ) to itself :   e + u if e ∈ D1 σ(e) = e − u if e ∈ D2 \ D1   e else R′ , (∞) |Bn (R′ ) ∩ For the analysis of the algorithm, we assume that for each perturbation vector e chosen by our algorithm, we replace e by σ(e) with probability 1/2 and it remains unchanged with probability 1/2. We call this procedure tossing the vector e. Further, we assume that this replacement of the perturbation vectors happens at the step where for the first time this has any effect on the algorithm. In particular, at step 17 in Algorithm 3, after we have identified a centre pair (ec , c) we apply σ on ec with probability 1/2. Then at the beginning of step 11 in Algorithm 1 we apply σ to e for all pairs (e, y) ∈ S. The distribution of y remains unchanged by this procedure because y ≡ e mod P(B) and y − e ∈ L. A somewhat more detailed explanation of this can be found in the following result of [BN09]. Lemma 3.3 (Theorem 4.5 in [BN09] (re-stated)). The modification outlined above does not change the output distribution of the actual procedure. Note that since this is just a conceptual modification intended for ease in analysis, we should not be concerned with the actual running time of this modified procedure. Even the fact that we need a shortest vector to begin the mapping σ does not matter. The following lemma will help us estimate the number of vector pairs to sample at the beginning of the algorithm. 15 Lemma 3.4 (Lemma 4.7 in [BN09]). Let N ∈ N and q denote the probability that a random (∞) point in Bn (ξλ) is contained in D1 ∪ D2 . If N points x1 , . . . xN are chosen uniformly at random (∞) 4 , there are at least qN in Bn (ξλ), then with probability larger than 1 − qN 2 points xi ∈ {x1 , . . . xN } with the property xi ∈ D1 ∪ D2 . From Lemma 2.6, we have   1 where cs = − log 1 − 2ξ q ≥ 2−cs n Thus with probability at least 1 − iterations such that ei ∈ D1 ∪ D2 . 4 qN we have at least 2−cs n N pairs (ei , yi ) before the sieving Lemma 3.5. If N ≥ 2q (k|C| + 2cb n + 1), then with probability at least 1/2 Algorithm 1 outputs a shortest non-zero vector in L with respect to ℓ∞ norm. Proof. Of the N vector pairs (e, y) sampled at step 3 of Algorithm 1, we consider those such that e ∈ (D1 ∪ D2 ). We have already seen there are at least qN 2 such pairs with probability at least 4 . We remove |C| vector pairs in each of the k sieve iterations. So at step 11 of Algorithm 1 1 − qN we have N ′ ≥ 2cb n + 1 pairs (e, y) to process. By Lemma 3.2 each of them is contained within a ball of radius R′ which can have at most 2cb n lattice vectors. So there exists at least one lattice vector w for which the perturbation is in D1 ∪ D2 and it appears twice in S at the beginning of step 11. With probability 1/2 it remains w or with the same probability it becomes either w + u or w − u. Thus after taking pair-wise difference at step 11 with probability at least 1/2 we find the shortest vector. Theorem 3.1. Let γ ∈ (0, 1), and let ξ > 1/2. Given a full rank lattice L ⊂ Qn there is a randomized algorithm for SVP(∞) with success probability at least 1/2, space complexity at most 2cspace n+o(n) and running time  at most 2ctime n+o(n) , where j k  cspace  = cs + max(c c , cb )j and ctime k = max(cspace , 2cb ), where cc = log 1 + 2 γ , cs = − log 1 − 1 2ξ and cb = log 1 + 2ξ(2−γ) 1−γ . Proof. If we start with N pairs (as stated in Lemma 3.5) then the space complexity is at most 2cspace n+o(n) with cspace = cs + max(cc , cb ). n In each j kiteration of the sieving Algorithm 3 it takes ℓ time to initialize and index C, where ℓ = 1 + γ2 . For each vector pair (e, y) ∈ S it takes time at most n to calculate its index-tuple Iy . So, the time taken to process each vector pair is at most (n + 1). Thus total time taken per iteration of Algorithm 3 is at most N (n + 1) + ℓn , which is at most 2cspace n+o(n) and there are at most poly(n) such iterations. If N ′ ≥ 2cb n + 1, then the time complexity for the computation of the pairwise differences is at most (N ′ )2 ∈ 22cb n+o(n) . So the overall time complexity is at most 2ctime n+o(n) where ctime = max(cspace , 2cb ). 3.1 Improvement using the birthday paradox We can get a better running time and space complexity if we use the birthday paradox to decrease the number of sampled vectors but get at least two vector pairs corresponding to the same lattice 16 vector after the sieving iterations [PS09]. For this we have to ensure that the vectors are independent and identically distributed before step 11 of Algorithm 1. So we incorporate the following modification. cb Assume we start with N ≥ 2q (n3 k|C| + n2 2 n ) sampled pairs. After the initial sampling, for  3  each of the k sieving iterations we fix Ω 2nq |C| pairs to be used as centre pairs in the following way. Let R = maxi∈[N ] kyi k∞ . We maintain k lists C1 , C2 , . . . Ck of pairs, where each list is similar to what has been already described before. For the ith list we partition the range [−Ri , Ri ] where i−1 Ri = γ i−1 R + ξλ 1−γ 1−γ , into intervals of length γRi . For each (e, y) ∈ S we first calculate kyk∞ to check in which list it can potentially belong, say C ′ . Then we map it to its index-tuple Iy , as has already been described before. We add (e, y) to C ′ [Iy ] if it was empty before, else we subtract vectors as in step 15 of Algorithm 3. Now using an analysis similar to [HPS11] we get the following improvement in the running time. Theorem 3.2. Let γ ∈ (0, 1), and let ξ > 1/2. Given a full rank lattice L ⊂ Qn there is a randomized algorithm for SVP(∞) with success probability at least 1/2, space complexity at most cb ctime n+o(n) , where c 2cspace n+o(n) and running timeat most time = space   = cs + max(c  c , 2j) and ck j k2 max(cspace , cb ), where cc = log 1 + 2 γ , cs = − log 1 − 1 2ξ and cb = log 1 + In particular for γ = 0.67 and ξ = 0.868 the algorithm runs in time sponding space requirement of at most 22.82n+o(n) . 4 22.82n+o(n) 2ξ(2−γ) 1−γ . with a corre- Faster Approximation Algorithms 4.1 Algorithm for Approximate SVP Notice that Algorithm 1, at the end of the sieving procedure, obtains lattice vectors of length at most R′ = ξ(2−γ)λ + O(λ/n). So, as long as we can ensure that one of the vectors obtained at 1−γ the end of the sieving procedure is non-zero, we obtain a τ = ξ(2−γ) 1−γ + o(1)-approximation of the shortest vector. Consider a new algorithm A that is identical to Algorithm 1, except that Step 11 is replaced by the following: • Find a non-zero vector v0 in {(yi − ei ) : (ei , yi ) ∈ S}. We now show that if we start with sufficiently many vectors, we must obtain a non-zero vector. Lemma 4.1. If N ≥ 2q (k|C| + 1), then with probability at least 1/2 Algorithm A outputs a non-zero vector in L of length at most ξ(2−γ)λ 1−γ + O(λ/n) with respect to ℓ∞ norm. Proof. Of the N vector pairs (e, y) sampled at step 3 of Algorithm A, we consider those such that e ∈ (D1 ∪ D2 ). We have already seen there are at least qN 2 such pairs. We remove |C| vector pairs in each of the k sieve iterations. So at step 11 of Algorithm 1 we have N ′ ≥ 1 pairs (e, y) to process. With probability 1/2, e, and hence w = y − e is replaced by either w + u or w − u. Thus, the probability that this vector is the zero vector is at most 1/2. We thus obtain the following: 17 Theorem 4.1. Let γ ∈ (0, 1) and ξ > 1/2. Given a full rank lattice L ⊂ Qn there is a randomized (∞) with success probability at least 1/2, algorithm that, for τ = ξ(2−γ) 1−γ + o(1), approximates SVP j k   1 space and time complexity 2(cs +cc )n+o(n) , where cc = log 1 + γ2 , and cs = − log 1 − 2ξ . In n  τ . particular, for γ = 2/3 + o(1), ξ = τ /4, the algorithm runs in time 3n · τ −2 4.2 Algorithm for Approximate CVP Given a lattice L and a target vector t, let d denote the distance of the closest vector in L to t. Just as in Section 3, we assume that we know the value of d within a factor of 1 + 1/n. We can get rid of this assumption by using Babai’s [Bab86] algorithm to guess the value of d within a factor of 2n , and then run our algorithm for polynomially many values of d each within a factor 1 + 1/n of the previous one. For τ > 0 define the following (n + 1)−dimensional lattice L′   L′ = L {(v, 0) : v ∈ L} ∪ {(t, τ d/2)} . Let z∗ ∈ L be the lattice vector closest to t. Then u = (z∗ − t, −τ d/2) ∈ L′ \ (L − kt, 0) for some k ∈ Z. (∞) We sample N vector pairs (e, y) ∈ Bn (ξd) × P(B′ ) using Algorithm 2 where B′ = [(b1 , 0), . . . , (bn , 0), (t, τ d/2)] is a basis for L′ . Next we run a number of iterations of the ξd + o(1). Further sieving Algorithm 3 to get a number of vector pairs such that kyk∞ ≤ R = 1−γ details can be found in Algorithm 4. Note that in the algorithm v|[n] is the n−dimensional vector v′ obtained by restricting v to the first n co-ordinates (with   respect to the computational basis). ξ From Lemma 3.2 we have seen that after ⌈logγ nR0 (1−γ) ⌉ iterations (where R0 = n·maxi kbi k∞ ) i h ξd ξγ ξ . Thus after the sieving iterations the set S ′ consists of vector pairs + 1−γ R ≤ n(1−γ) 1 − nR0 (1−γ) ξd such that the corresponding lattice vector v has kvk∞ ≤ 1−γ + ξd + c = ξ(2−γ)d 1−γ + o(1). In order to ensure that our sieving algorithm doesn’t return vectors from (L, 0) − (kt, kτ d/2) for some k such that |k| ≥ 2, we choose our parameters as follows. ξ< (1 − γ)τ − o(1) 2−γ Then every vector has kvk∞ < τ d and so either v = ±(z′ − t, 0) or v = ±(z − t, −τ d/2) for some lattice vector z, z′ ∈ L. We need to argue that we must have at least some vectors in L′ \ (L ± t, 0) after the sieving iterations. To do so, we again use the tossing argument from Section 3. Let z∗ ∈ L be the lattice (∞) (∞) vector closest to t. Then let u = (z∗ −t, −τ d/2) ∈ L′ \(L±t, 0). Let D1 = Bn (ξd)∩Bn (−u, ξd) (∞) (∞) and D2 = Bn (ξd) ∩ Bn (u, ξd). From Lemma 2.6, we have that the probability q that a random perturbation vector is in D1 ∪D2 is bounded as     1 τ −cs n where cs = − log 1 − q ≥ 2 · 1− 4ξ 2ξ Thus, as long as ξ > max(1/2, τ /4) , 18 Algorithm 4: Approximate algorithm for CVP(∞) Input: (i) A basis B = [b1 , . . . bn ] of a lattice L, (ii) Target vector t, (iii) Approximation ′ ′ factor τ , (iv) 0 < γ < 1, (v) ξ such that 21 max(1, τ /2) < ξ < (1−γ)τ 2−γ − c where c is a small constant, (vi)α > 0, (vii) N ∈ N Output: A 2τ −approximate closest vector to t in L 1 d ← (1 + α) ; 2 T ← ∅; S ′′ ← ∅ ; 3 while d ≤ n · maxi kbi k∞ do 4 S, S ′ ← ∅ ; 5 B′ → [(b1 , 0), . . . , (bn , 0), (t, τ d/2)] ; 6 L′ → L (B′ ) ; 7 M → span({(v, 0) : v ∈ L}) ; 8 for i = 1 to N do 9 (ei , yi ) ← Sample(B′ , ξd) using Algorithm 2 ; 10 S ← S ∪ {(ei , yi )} ; 11 end 12 R ← n maxi kbi k∞ ; ξd do 13 while R > 1−γ 14 S ← sieve(S, γ, R, ξ) using Algorithm 3 ; 15 R ← γR + ξd ; 16 end 17 S ′ ← {y − e : (e, y) ∈ S} ; 18 Compute w ∈ S ′ such that kw|[n] k∞ = min{kv′ |[n] k∞ : v′ ∈ S ′ and (v′ )n+1 6= 0} ; 19 T → T ∪ {w} ; 20 d → d(1 + α) ; 21 end 22 Let v0 be any vector in T such that kv0 |[n] k∞ = min{kw|[n] k∞ : w ∈ T } ; ′ ←v | 23 v0 0 [n] ; 24 if (v0 )n+1 = −τ d/2 then 25 return v0′ + t ; 26 else 27 return v0′ − t ; 28 end 19 we have at least 2−cs n+o(n) N pairs (ei , yi ) before the sieving iterations such that ei ∈ D1 ∪ D2 . Thus, using the same argument as in Section 4.1, we obtain the following: Theorem 4.2. Let γ ∈ (0, 1), and for any τ > 1 let ξ > max(1/2, τ /4). Given a full rank lattice (∞) with L ⊂ Qn there is a randomized algorithm that, for τ = ξ(2−γ) 1−γ + o(1), approximates CVP  j k (c +c )n+o(n) success probability at least 1/2, space and time complexity 2 s c , where cc = log 1 + γ2   1 . In particular, for γ = 1/2 + o(1) and ξ = τ /3, the algorithm runs in time and cs = − log 1 − 2ξ  n 4n · 2τ2τ−3 . 5 Heuristic algorithm for SVP(∞) Nguyen and Vidick [NV08] introduced a heuristic variant of the AKS sieving algorithm. We have used it to solve SVP(∞) . The basic framework is similar to AKS, except that here we do not work with perturbation (∞) vectors. We start with a set S of uniformly sampled lattice vectors of norm 2O(n) λ1 (L). These are iteratively fed into a sieving procedure (Algorithm 6) which when provided with a list of lattice vectors of norm, say R, will return a list of lattice vectors of norm at most γR. In each iteration of the sieve a number of vectors are identified as “centres”. If a vector is within distance γR from a centre, we subtract it from the centre and add the resultant to the output list. The iterations continue till the list S of vectors currently under consideration is empty. The size of S can decrease either due to elimination of zero vectors at steps 5 and 10 of Algorithm 5 or due to removal of “centres” in Algorithm 6. After a linear number of iterations we expect to be left with a list of very short vectors and then we output the one with the minimum norm. In order to have the shortest vector (or a proper approximation of it) with a good probability, we have to ensure that we do not end up with a list of all zero-vectors (indicating an end of the sieving iterations) “too soon” (say, after sub-linear number of iterations). We make the following assumption about the distribution of vectors at any stage of the algorithm. (∞) Heuristic 1. At any stage of the algorithm the vectors in S∩Bn (∞) in Bn (γR, R) = {x ∈ Rn : γR < kxk∞ ≤ R}. (γR, R) are uniformly distributed Now after each sieving iteration we get a zero vector if there is a “collision” of a vector with a “centre” vector. With the above assumption we can have following estimate about the expected number of collisions. Lemma 5.1 ([NV08]). Let p vectors are randomly chosen with replacement from a set of cardinality N . Then the expected number of different vectors picked is N − N (1 − N1 )p . So the expected number of vectors lost through collisions is p − N + N (1 − N1 )p . √ This number is negligible for p << N . Since the expected number of lattice points inside a (∞) (∞) ball of radius R/λ1 is O(Rn ), the effect of collisions remain negligible till R/λ1 < |S|2/n . It (∞) can be shown that it is sufficient to take |S| ≈ (4/3)n , which gives R/λ1 ≈ 16/9. So collisions (∞) are expected to become significant only when we already have a good estimate of λ1 , and even then collisions will imply we had a good proportion of lattice vectors in the previous iteration and 20 Algorithm 5: SVP algorithm in ℓ∞ norm using Lattice sieve [NV08] Input: (i) A basis B = [b1 , . . . bn ] of a lattice L, (ii) Sieve factor 1/2 < γ < 1, (iii) Number N. Output: A short non-zero vector of L. 1 S ←∅ ; 2 for j = 1 to N do 3 S ← S ∪ sampling(B) using Klein’s algorithm [Kle00] ; 4 end 5 Remove all zero vectors from S ; 6 S0 ← S ; 7 while S 6= ∅ do 8 S0 ← S ; 9 S ← latticeSieve(S, γ) using Algorithm 6 ; 10 Remove all zero vectors from S ; 11 end 12 Compute v0 ∈ S0 such that kv0 k∞ = minv∈S0 kvk∞ ; 13 return v0 ; Algorithm 6: Lattice sieve (∞) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Input: (i) A subset S ⊆ Bn (R) ∩ L, (ii) Sieve factor 1/2 < γ < 1. (∞) Output: A subset S ′ ⊆ Bn (γR) ∩ L. R ← maxv∈S kvk∞ ; C ← ∅, S′ ← ∅ ; for v ∈ S do if kvk∞ ≤ γR then S ′ ← S ′ ∪ {v} ; else if ∃c ∈ C such that kv − ck∞ ≤ γR then S ′ ← S ′ ∪ {v − c} ; else C ← C ∪ {v} ; end end end return S ′ ; 21 thus with good probability we expect to get the shortest vector or a constant approximation of it at step 12 of Algorithm 5. Here we would like to make some comments about the initial sampling of lattice vectors at step 3 of Algorithm 5. Due to our assumption (Heuristic 1) we have to ensure that the lattice points (∞) are uniformly distributed in the spherical shell or corona Bn (γR, R) at this stage, too. As in [NV08] we can use Klein’s randomized variant [Kle00] of Babai’s nearest plane algorithm [Bab86]. Intuitively, what we have to ensure is that the sampled points should not be biased towards a single direction. Gentry et al. [GPV08] gave a detailed analysis of Klein’s algorithm and proved the following: Theorem 5.1 p ([Kle00, GPV08]). Let B = [b1 , . . . , bn ] be any basis of an n-dimensional lattice L and s ≥ kBk2 · ln(2n + 4)/π. There exists a randomized polynomial time algorithm whose output distribution is within√negligible statistical distance of the restriction to L of a Gaussian centered at 0 and with variance 2πs, i.e. with density proportional to ρ(v) = exp(−πkvk22 /s2 ). Using Fact 2.1, exp(−nπkvk2p /s2 ) ≤ ρ(v) ≤ exp(−πkvk2p /s2 ) [For p ≥ 2] exp(−πkvk2p /s2 ) ≤ ρ(v) ≤ exp(−πkvk2p /ns2 ) [For p < 2] and Assuming kBkp ∈ 2O(n) λ(p) (L) we can conclude that the above algorithm can be used to uniformly sample lattice points of norm at most 2O(n) λ(p) (L) at step 3 of Algorithm 5, for all p ≥ 1. We will now analyze the complexity of Algorithm 5. For this the crucial part is to assess the number of centres (or |C|), which is done in the following lemma. −n (n + 1), where kC = 43 . Lemma 5.2. Let 1/2 < γ < 1 and NC = kC (∞) S ⊂ Bn (γR, R) such that |S| = N and its points are picked independently at random with uniform (∞) distribution from Bn (γR, R). If NC < N < 2n+1 , then for any C ⊆ S with uniformly distributed points and cardinality at least NC we have the following : For any v ∈ S, with high probability ∃c ∈ C such that kv − ck∞ ≤ γR. Proof. Assuming Heuristic 1 holds during every iteration of the sieve, the expected fraction of (∞) Bn (γR, R) that is not covered by NC balls of radius γ centered at randomly chosen points of (∞) n from Lemma 2.4 . Bn (γR, R) is (1 − Ω(γ))NC , where Ω(γ) = kC Now NC log(1 − Ω(γ)) ≤ −NC Ω(γ) ≤ −(n + 1) < − log N Thus the expected fraction of the corona covered by NC balls is at least (1 − 2−(n+1) ). So the expected number of uncovered points is less than 1. Since this number is an integer, it is 0 with probability at least 1/2. 22 Theorem 5.2. The expected space complexity and running time of Algorithm 5 is at most  2n+o(n) 20.415n+o(n) and 43 = 20.83n+o(n) respectively.  n+o(n) 4 3 n where k is as defined Proof. Let NC = expected number of centers in each iteration = poly(n)kC C in Lemma 5.2. Thus each time the lattice sieve is invoked, i.e. in steps 7-11 of Algorithm 5, we expect size of n , provided it satisfies Heuristic 1. S to decrease by aproximately kC (∞) We can use the LLL algorithm (Lemma 2.1) to obtain an estimate of λ1 (L) with approxima(∞) tion factor 2n−1 . So we can start with vectors of norm 2O(n) λ1 (L). In each iteration of lattice  n+o(n) n+o(n) = 34 sieve the norm of the vectors decrease by a factor γ. If we start with N = kC vectors, then after a linear number of iterations we expect to be left with some short vectors. Since the running time of the lattice sieve is quadratic, the expected running time of the  2n+o(n) . algorithm is at most 34 5.1 Heuristic two-level sieving algorithm for SVP(∞) In order to improve the running time, which is mostly dictated by the number of “centres”,Wang et al. [WLTB11] introduced a two-level sieving procedure that improves upon the NV sieve for large n. Here in the first level we identify a set of “centres” C1 and to each c ∈ C1 we associate vectors within a distance γ1 R from it. Now within each such γ1 R radius “big ball” we have another set of vectors C2c , which we call the “second-level centre” . From each c′ ∈ C2c we subtract those vectors (∞) which are in Bn (c′ , γ2 R) and add the resultant to the output list. We have analysed this two-level sieve (Algorithm 7) in the ℓ∞ norm and also found similar improvement in the running time. To analyze the complexity of Algorithm 5 with the two-level sieving procedure (Algorithm 7) we need to count the number of centres in first level i.e. |C1 | = NC1 , which is given in Lemma 5.3. For each c ∈ C1 we count the number of “second-level centres” i.e. NC2c = |C2c |. h i √ γ1 −n (n + 1), where k = 0.25 + Lemma 5.3. Let 1/2 < γ2 < 1 < γ1 < 2γ2 and NC1 = kC C 1 2 . 1 (∞) S ⊂ Bn (γ2 R, R) such that |S| = N and its points are picked independently at random with (∞) uniform distribution from Bn (γ2 R, R). If NC1 < N < 2n+1 , then for any C1 ⊆ S with uniformly distributed points and cardinality at least NC1 we have the following : ∀v ∈ S with high probability ∃c ∈ C1 such that kv − ck∞ ≤ γ1 R. Proof. The proof is similar to Lemma 5.2. (∞) (∞) (∞) (∞) Now we cover Bn ∩ Bn (r, γ1 ), where r ∈ Bn (γ2 , 1), with smaller balls Bn (q, γ2 ), where (∞) (∞) (∞) (∞) q ∈ Bn (γ2 , 1) ∩ Bn (r, γ1 ). Let Vq = |Bn (q, γ2 ) ∩ Bn |. We can apply Lemma 2.4 to conclude that h i  3 n lim Eq∼ B (∞) (γ ,1) Vq ≈ 2 U n γ2 →1 2 23 = Algorithm 7: Two-level heuristic sieve (∞) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Input: (i) A subset S ⊆ Bn (R) ∩ L, (ii) Sieve factors 1/2 < γ2 < 1 < γ1 < (∞) Output: A subset S ′ ⊆ Bn (γ2 R) ∩ L. R ← maxv∈S kvk∞ ; C1 ← ∅, C2 ← ∅, S ′ ← ∅ ; for v ∈ S do if kvk∞ ≤ γ2 R then S ′ ← S ′ ∪ {v} ; else if ∃c ∈ C1 such that kv − ck∞ ≤ γ1 R then if ∃c′ ∈ C2c such that kv − c′ k∞ ≤ γ2 R then S ′ ← S ′ ∪ {v − c′ } ; else C2c ← C2c ∪ {v} ; end else C1 ← C1 ∪ {v}, C2 ← C2 ∪ {C2v = {v}} ; end end end return S ′ ; and Ω′n (γ1 , γ2 ) = lim Eq∼ γ2 →1 (∞) Hence the fraction of Bn (∞) ∩ Bn (∞) (γ2 ,1) U Bn (∞) (r, γ1 ) covered by Bn Ωn (γ1 , γ2 ) = h V i q (∞) Bn ≈ √ 2γ2 .  3 n 4 (q, γ2 ) is Ω′n (γ1 , γ2 ) h 3 in ≈ Ωn (γ1 ) 1 + 2γ1 Using similar arguments of Lemma 5.2 (or Lemma 5.3) we can estimate the number of centres at second level. In the following lemma we bound the number of centres within each γ1 R radius “big ball” centred at some point c (say). h i √ −n 3 Lemma 5.4. Let 1/2 < γ2 < 1 < γ1 < 2γ2 and NC2c = kC c (n + 1), where kC c = 1+2γ1 . 2 2 T (∞) (∞) (∞) S ⊂ Bn (γ2 R, R) Bn (c, γ1 R),where c ∈ Bn (γ2 R, R), such that |S| = N and its points are picked independently at random with uniform distribution. If NC2c < N < 2n+1 , then for any C2c ⊆ S with uniformly distributed points and cardinality at least NC2c we have the following : ∀v ∈ S with high probability ∃c′ ∈ C2c such that kv − c′ k∞ ≤ γ2 R. Finally we can analyze the complexity of the above algorithm. Theorem 5.3. The space complexity of Algorithm 5 using two-level sieve (Algorithm 7) is N = poly(n)NC1 NC2c where NC1 and NC2c are as defined in Lemma 5.3 and 5.4 respectively. 24 Also the time complexity is at most N (NC1 + NC2c ). The optimal value is attained when γ1 = 1.2321 yielding a time complexity of at most 20.62n+o(n) . The space complexity is at most 20.415n+o(n) . −n −n k c. Proof. The expected number of centres in any iteration of Algorithm 7 is NC1 NC2c = poly(n)kC 1 C (∞) 2 We can use the LLL algorithm (Lemma 2.1) to obtain 2n−1 approximation of λ1 (L). Thus (∞) we can initially sample N = poly(n)NC1 NC2c vectors of norm 2O(n) λ1 (L). Assuming the heuristic holds, in each iteration of the sieve the norm of the vectors decrease by a factor γ2 and also the expected size of S decreases by NC1 NC2c . So after a polynomial number of sieve iterations we expect (∞) to be left with some vectors of norm O(λ1 (L)).  n+o(n) So space complexity is at most 43 ≈ 20.415n+o(n) . Now in each sieve iteration each vector is compared with at most NC1 + NC2c centres. Thus the expected running time is at most T = poly(n)N (NC1 + NC2c ). n  i  n h 1+2γ1 4 + . The optimal value Plugging in the expressions we get T = poly(n) 34 1+2γ1 3 is attained when 20.62n+o(n) . 4 1+2γ1 = 1+2γ1 3 , yielding γ1 = √ 12−1 2 = 1.2321. At this value T ≈ 1.5396n+o(n) = Acknowledgement References [ABSS93] Sanjeev Arora, László Babai, Jacques Stern, and Z Sweedyk. The hardness of approximate optima in lattices, codes, and systems of linear equations. In Foundations of Computer Science, 1993. Proceedings., 34th Annual Symposium on, pages 724–733. IEEE, 1993. [ADRS15] Divesh Aggarwal, Daniel Dadush, Oded Regev, and Noah Stephens-Davidowitz. Solving the Shortest Vector Problem in 2n time via discrete Gaussian sampling. In STOC, 2015. Full version available at http://arxiv.org/abs/1412.7994. [ADSD15] Divesh Aggarwal, Daniel Dadush, and Noah Stephens-Davidowitz. Solving the closest vector problem in 2ˆ n time–the discrete gaussian strikes again! In Foundations of Computer Science (FOCS), 2015 IEEE 56th Annual Symposium on, pages 563–582. IEEE, 2015. [AJ08] Vikraman Arvind and Pushkar S Joglekar. Some sieving algorithms for lattice problems. In LIPIcs-Leibniz International Proceedings in Informatics, volume 2. Schloss DagstuhlLeibniz-Zentrum für Informatik, 2008. [Ajt96] Miklós Ajtai. Generating hard instances of lattice problems. In Proceedings of the twenty-eighth annual ACM symposium on Theory of computing, pages 99–108. ACM, 1996. 25 [AKS01] Miklós Ajtai, Ravi Kumar, and D. Sivakumar. A sieve algorithm for the shortest lattice vector problem. In STOC, pages 601–610, 2001. [AKS02] Miklós Ajtai, Ravi Kumar, and D. Sivakumar. Sampling short lattice vectors and the closest lattice vector problem. In CCC, pages 41–45, 2002. [ASD17] Divesh Aggarwal and Noah Stephens-Davidowitz. Just take the average! an embarrassingly simple 2n -time algorithm for svp (and cvp). arXiv preprint arXiv:1709.01535, 2017. [Bab86] L. Babai. On Lovász’ lattice reduction and the nearest lattice point problem. Combinatorica, 6(1):1–13, 1986. [BDGL16] Anja Becker, Léo Ducas, Nicolas Gama, and Thijs Laarhoven. New directions in nearest neighbor searching with applications to lattice sieving. In Proceedings of the TwentySeventh Annual ACM-SIAM Symposium on Discrete Algorithms, pages 10–24. Society for Industrial and Applied Mathematics, 2016. [BGSD17] Huck Bennett, Alexander Golovnev, and Noah Stephens-Davidowitz. On the quantitative hardness of cvp. arXiv preprint arXiv:1704.03928, 2017. [BLP+ 13] Zvika Brakerski, Adeline Langlois, Chris Peikert, Oded Regev, and Damien Stehlé. Classical hardness of learning with errors. In STOC, pages 575–584, 2013. [BN09] Johannes Blömer and Stefanie Naewe. Sampling methods for shortest vectors, closest vectors and successive minima. Theoretical Computer Science, 410(18):1648–1665, 2009. [BV11] Zvika Brakerski and Vinod Vaikuntanathan. Efficient fully homomorphic encryption from (standard) LWE. In FOCS, pages 97–106. IEEE, 2011. [BV14] Zvika Brakerski and Vinod Vaikuntanathan. Lattice-based FHE as secure as PKE. In ITCS, pages 1–12, 2014. [CJL+ 92] Matthijs J Coster, Antoine Joux, Brian A LaMacchia, Andrew M Odlyzko, Claus-Peter Schnorr, and Jacques Stern. Improved low-density subset sum algorithms. computational complexity, 2(2):111–128, 1992. [CN98] J-Y Cai and Ajay Nerurkar. Approximating the SVP to within a factor (1 + 1/ dimε ) is NP-hard under randomized conditions. In Computational Complexity, 1998. Proceedings. Thirteenth Annual IEEE Conference on, pages 46–55. IEEE, 1998. [DFK91] Martin Dyer, Alan Frieze, and Ravi Kannan. A random polynomial-time algorithm for approximating the volume of convex bodies. Journal of the ACM (JACM), 38(1):1–17, 1991. [DKRS03] Irit Dinur, Guy Kindler, Ran Raz, and Shmuel Safra. Approximating CVP to within almost-polynomial factors is NP-hard. Combinatorica, 23(2):205–243, 2003. [DLL+ 17] Léo Ducas, Tancrède Lepoint, Vadim Lyubashevsky, Peter Schwabe, Gregor Seiler, and Damien Stehlé. Crystals–dilithium: Digital signatures from module lattices. Technical report, IACR Cryptology ePrint Archive, 2017: 633, 2017. 26 [DPV11] Daniel Dadush, Chris Peikert, and Santosh Vempala. Enumerative lattice algorithms in any norm via M-ellipsoid coverings. In Foundations of Computer Science (FOCS), 2011 IEEE 52nd Annual Symposium on, pages 580–589. IEEE, 2011. [EHN11] Friedrich Eisenbrand, Nicolai Hähnle, and Martin Niemeier. Covering cubes and the closest vector problem. In Proceedings of the twenty-seventh annual symposium on Computational geometry, pages 417–423. ACM, 2011. [Gen09] Craig Gentry. Fully homomorphic encryption using ideal lattices. In STOC’09— Proceedings of the 2009 ACM International Symposium on Theory of Computing, pages 169–178. ACM, New York, 2009. [GG00] Oded Goldreich and Shafi Goldwasser. On the limits of nonapproximability of lattice problems. Journal of Computer and System Sciences, 60(3):540–563, 2000. [GMSS99] O. Goldreich, D. Micciancio, S. Safra, and J.-P. Seifert. Approximating shortest lattice vectors is not harder than approximating closest lattice vectors. Information Processing Letters, 71(2):55 – 61, 1999. [GPV08] Craig Gentry, Chris Peikert, and Vinod Vaikuntanathan. Trapdoors for hard lattices and new cryptographic constructions. In Proceedings of the fortieth annual ACM symposium on Theory of computing, pages 197–206. ACM, 2008. [HPS11] Guillaume Hanrot, Xavier Pujol, and Damien Stehlé. Algorithms for the shortest and closest lattice vector problems. In International Conference on Coding and Cryptology, pages 159–190. Springer, 2011. [HR12] Ishay Haviv and Oded Regev. Tensor-based hardness of the shortest vector problem to within almost polynomial factors. Theory of Computing, 8(23):513–531, 2012. Preliminary version in STOC’07. [IM98] Piotr Indyk and Rajeev Motwani. Approximate nearest neighbors: towards removing the curse of dimensionality. In Proceedings of the thirtieth annual ACM symposium on Theory of computing, pages 604–613. ACM, 1998. [IP99] Russell Impagliazzo and Ramamohan Paturi. Complexity of k-sat. In Computational Complexity, 1999. Proceedings. Fourteenth Annual IEEE Conference on, pages 237–240. IEEE, 1999. [JS98] Antoine Joux and Jacques Stern. Lattice reduction: A toolbox for the cryptanalyst. Journal of Cryptology, 11(3):161–185, 1998. [Kan87] Ravi Kannan. Minkowski’s convex body theorem and integer programming. Mathematics of Operations Research, 12(3):pp. 415–440, 1987. [Kho05] Subhash Khot. Hardness of approximating the shortest vector problem in lattices. Journal of the ACM, 52(5):789–808, September 2005. Preliminary version in FOCS’04. [Kle00] Philip Klein. Finding the closest lattice vector when it’s unusually close. In Proceedings of the eleventh annual ACM-SIAM symposium on Discrete algorithms, pages 937–941. Society for Industrial and Applied Mathematics, 2000. 27 [Laa14] Thijs Laarhoven. Sieving for shortest vectors in lattices using angular locality-sensitive hashing. IACR Cryptology ePrint Archive, 2014:744, 2014. [Laa15] Thijs Laarhoven. Sieving for shortest vectors in lattices using angular locality-sensitive hashing. In Annual Cryptology Conference, pages 3–22. Springer, 2015. [LdW15] Thijs Laarhoven and Benne de Weger. Faster sieving for shortest lattice vectors using spherical locality-sensitive hashing. In International Conference on Cryptology and Information Security in Latin America, pages 101–118. Springer, 2015. [LJ83] Hendrik W Lenstra Jr. Integer programming with a fixed number of variables. Mathematics of operations research, 8(4):538–548, 1983. [LLL82] A. K. Lenstra, H. W. Lenstra, Jr., and L. Lovász. Factoring polynomials with rational coefficients. Math. Ann., 261(4):515–534, 1982. [LM83] Susan Landau and Gary Lee Miller. Solvability by radicals is in polynomial time. In Proceedings of the fifteenth annual ACM symposium on Theory of computing, pages 140–151. ACM, 1983. [LWXZ11] Mingjie Liu, Xiaoyun Wang, Guangwu Xu, and Xuexin Zheng. Shortest lattice vectors in the presence of gaps. IACR Cryptology ePrint Archive, 2011:139, 2011. [MBL15] Artur Mariano, Christian Bischof, and Thijs Laarhoven. Parallel (probable) lock-free hash sieve: a practical sieving algorithm for the svp. In Parallel Processing (ICPP), 2015 44th International Conference on, pages 590–599. IEEE, 2015. [Mic01] Daniele Micciancio. The shortest vector problem is NP-hard to approximate to within some constant. SIAM Journal on Computing, 30(6):2008–2035, March 2001. Preliminary version in FOCS 1998. [MR07] Daniele Micciancio and Oded Regev. Worst-case to average-case reductions based on Gaussian measures. SIAM Journal on Computing, 37(1):267–302, 2007. [MV10] Daniele Micciancio and Panagiotis Voulgaris. Faster exponential time algorithms for the shortest vector problem. In SODA, pages 1468–1480, 2010. [MV13] Daniele Micciancio and Panagiotis Voulgaris. A deterministic single exponential time algorithm for most lattice problems based on Voronoi cell computations. SIAM Journal on Computing, 42(3):1364–1391, 2013. [NS01] Phong Q Nguyen and Jacques Stern. The two faces of lattices in cryptology. In Cryptography and lattices, pages 146–180. Springer, 2001. [NV08] Phong Q Nguyen and Thomas Vidick. Sieve algorithms for the shortest vector problem are practical. Journal of Mathematical Cryptology, 2(2):181–207, 2008. [Odl90] Andrew M Odlyzko. The rise and fall of knapsack cryptosystems. Cryptology and computational number theory, 42:75–88, 1990. 28 [PS09] Xavier Pujol and Damien Stehlé. Solving the shortest lattice vector problem in time 22.465n . IACR Cryptology ePrint Archive, 2009:605, 2009. [Reg09a] Oded Regev. Lecture notes on lattices in computer science. 2009. [Reg09b] Oded Regev. On lattices, learning with errors, random linear codes, and cryptography. Journal of the ACM, 56(6):Art. 34, 40, 2009. [vEB81] Peter van Emde Boas. Another np-complete partition problem and the complexity of computing short vectors in a lattice. Technical report, 1981. [WLTB11] Xiaoyun Wang, Mingjie Liu, Chengliang Tian, and Jingguo Bi. Improved nguyen-vidick heuristic sieve algorithm for shortest vector problem. In Proceedings of the 6th ACM Symposium on Information, Computer and Communications Security, pages 1–9. ACM, 2011. [WLW15] Wei Wei, Mingjie Liu, and Xiaoyun Wang. Finding shortest lattice vectors in the presence of gaps. In Topics in Cryptology - CT-RSA 2015, The Cryptographer’s Track at the RSA Conference 2015, San Francisco, CA, USA, April 20-24, 2015. Proceedings, pages 239–257, 2015. 29
8cs.DS
ON THE TABLE OF MARKS OF A DIRECT PRODUCT OF FINITE GROUPS. arXiv:1704.03433v3 [math.GR] 6 Feb 2018 BRENDAN MASTERSON AND GÖTZ PFEIFFER Abstract. We present a method for computing the table of marks of a direct product of finite groups. In contrast to the character table of a direct product of two finite groups, its table of marks is not simply the Kronecker product of the tables of marks of the two groups. Based on a decomposition of the inclusion order on the subgroup lattice of a direct product as a relation product of three smaller partial orders, we describe the table of marks of the direct product essentially as a matrix product of three class incidence matrices. Each of these matrices is in turn described as a sparse block diagonal matrix. As an application, we use a variant of this matrix product to construct a ghost ring and a mark homomorphism for the rational double Burnside algebra of the symmetric group S3 . 1. Introduction The table of marks of a finite group G was first introduced by William Burnside in his book Theory of groups of finite order [5]. This table characterizes the actions of G on transitive G-sets, which are in bijection to the conjugacy classes of subgroups of G. Thus the table of marks provides a complete classification of the permutation representations of a finite group G up to equivalence. The Burnside ring B(G) of G is the Grothendieck ring of the category of finite G-sets. The table of marks of G arises as the matrix of the mark homomorphism from B(G) to the free Z-module Zr , where r is the number of conjugacy classes of subgroups of G. Like the character table, the table of marks is an important invariant of the group G. By a classical theorem of Dress [6], G is solvable if and only if the prime ideal spectrum of B(G) is connected, i.e., if B(G) has no nontrivial idempotents, a property that can easily be derived from the table of marks of G. The table of marks of a finite group G can be determined by counting inclusions between conjugacy classes of subgroups of G [13]. For this, the subgroup lattice of G needs to be known. As the cost of complete knowledge of the subgroups of G increases drastically with the order of G (or rather the number of prime factors of that order), this approach is limited to small groups. Alternative methods for the computation of a table of marks have been developed which avoid excessive computations with the subgroup lattice of G. This includes a method for computing the table of marks of G from the tables of marks of its maximal subgroups [13], and a method for computing the table of marks of a cyclic extension of G from the table of marks of G [12]. The purpose of this article is to develop tools for the computation of the table of marks of a direct product of finite groups G1 and G2 . The obvious idea here is to relate the subgroup lattice of G1 × G2 to the subgroup lattice of G1 and G2 , and to compute the table of marks of G1 × G2 using this relationship. Many properties of G1 × G2 can be derived from the properties of G1 and G2 with little or no effort at all. Conjugacy classes Date: February 7, 2018. 2010 Mathematics Subject Classification. 19A22; 06A11. Key words and phrases. Burnside ring, Table of marks, Subgroup lattice, Double Burnside ring, Ghost ring, Mark homomorphism. 1 2 BRENDAN MASTERSON AND GÖTZ PFEIFFER of elements of G1 × G2 , for example, are simply pairs of conjugacy classes of G1 and G2 . And the character table of G1 × G2 is simply the Kronecker product of the character tables of G1 and G2 . However the relationship between the table of marks of G1 × G2 and the tables of marks of G1 and G2 is much more intricate. A flavour of the complexity to be expected is already given by a classical result known as Goursat’s Lemma (Lemma 2.1), according to which the subgroups of a direct product of finite groups G1 and G2 correspond to isomorphisms between sections of G1 and G2 . This article presents the first general and systematic study of the subgroup lattice of a direct product of finite groups beyond Goursat’s Lemma. Only very special cases of such subgroup lattices have been considered so far, e.g., by Schmidt [15] and Zacher [16]. In view of Goursat’s Lemma, it seems appropriate to first develop some theory for sections in finite groups. Here, a section of a finite group G is a pair (P, K) of subgroups P, K of G such that K is a normal subgroup of P. We study sections by first defining a partial order 6 on the set of sections of G as componentwise inclusion of subgroups: (P ′ , K ′ ) 6 (P, K) if P ′ 6 P and K ′ 6 K. Now, if (P ′ , K ′ ) 6 (P, K), the canonical homomorphism P ′ /K ′ → P/K decomposes as a product of three maps: an epimorhism, an isomorphism and a monomorphism. We show that this induces a decomposition of the partial order 6 as a product of three partial orders, which we denote by 6K , 6P/K , and 6P for reasons that will become clear in Section 3. Thus 6 = 6K ◦ 6P/K ◦ 6P , and this decomposition of the partial order is compatible with the conjugation action of G on the set of its sections. The description of subgroups of G1 × G2 in terms of sections of G1 and G2 allows us to transfer the decomposition of the partial orders on the sections to the set of subgroups of G1 × G2 . We will show in Section 5 that, for subgroups L 6 M of G1 × G2 , there exist unique intermediary subgroups L ′ and M ′ such that L 6P L ′ 6P/K M ′ 6K M, where the partial orders 6P , 6P/K and 6K on the set of subgroups of G1 × G2 are defined in terms of the corresponding relations on the sections of G1 and G2 . This gives a decomposition of the partial order 6 on subgroups into three partial orders which is compatible with the conjugation action of G1 × G2 . In Section 6, we will show as one of our main results that this yields a corresponding decomposition of the table of marks of G as a matrix product of three class incidence matrices. Individually, each of these class incidence matrices has a block diagonal structure which is significantly easier to compute than the subgroup lattice of G1 × G2 . The rest of this paper is arranged as follows: In Section 2 we collect some useful known results. In Section 3 we study the sections of a finite group G and discuss properties of the lattice of sections, partially ordered componentwise. We show how a decomposition of this partial order as a relation product of three partial orders leads to a corresponding decomposition of the class incidence matrix of the sections of G as a matrix product. This section concludes with a brief discussion of an interesting variant 6 ′ of the partial order on sections, and its class incidence matrix. Section 4 considers isomorphisms from sections of G to a particular group U as subgroups of G × U. We determine the structure of the set of all such isomorphisms as a (G, Aut(U))-biset. In Section 5, we study subgroups of G1 × G2 as pairs of such isomorphisms, one from a section of G1 into U, and one from G2 . This allows us to determine the structure of the set of all such subgroups as a (G1 × G2 , Aut(U))-biset. We also derive a decomposition of the subgroup inclusion order of G1 × G2 as a relation product of three partial orders from the corresponding ON THE TABLE OF MARKS OF A DIRECT PRODUCT OF FINITE GROUPS. 3 decomposition of the partial orders of sections from Section 3. In Section 6 we develop methods for computing the individual class incidence matrices for each of the partial orders on subgroups and use these matrices to compute the table of marks of G1 × G2 , essentially as their product. Finally, in Section 7 we present an application of the theory. The double Burnside ring B(G, G) of a finite group G is defined as the Grothendieck ring of transitive (G, G)-bisets and, where addition is defined as disjoint union and multiplication is tensor product. The double Burnside ring is currently at the centre of much research and is an important invariant of the group G, see e.g. [1, 2, 4, 14]. Here we study the particular case of G = S3 , and use our partial orders to construct an explicit ghost ring and mark homomorphism for QB(G, G), in the sense of Boltje and Danz [1]. Acknowledgement: Much of the work in this article is based on the first author’s PhD thesis (see [11]). This research was supported by the College of Science, National University of Ireland, Galway. 2. Preliminaries 2.1. Notation. We denote the symmetric group of degree n by Sn , the alternating group of degree n by An , and a cyclic group of order n simply by n. We use various forms of composition in this paper. Group homomorphisms act from the right and are composed accordingly: the product of φ : G1 → G2 and ψ : G2 → G3 is φ · ψ : G1 → G3 , defined by aφ·ψ = (aφ )ψ , for a ∈ G1 , where Gi is a group, i = 1, 2, 3. The relation product of relations R ⊆ X × Y and S ⊆ Y × Z is the relation S ◦ R = {(x, z) : (x, y) ∈ R and (y, z) ∈ S for some y ∈ Y} ⊆ X × Z, where X, Y, Z are sets. In section 2.2, the product L ∗ M of subgroups L 6 G1 × G2 and M 6 G2 × G3 will be defined as (Mop ◦ Lop )op , where Rop = {(y, x) : (x, y) ∈ R} denotes the opposite of R. 2.2. Subgroups as Relations. The following classical result describes subgroups of a direct product as isomorphisms between section quotients. Here, a section of a finite group G is a pair (P, K) of subgroups of G so that K E P. Lemma 2.1 (Goursat’s Lemma, [7]). Let G1 , G2 be groups. There is a bijective correspondence between the subgroups of the direct product G1 × G2 and the isomorphisms of the form θ : P1 /K1 → P2 /K2 , where (Pi , Ki) is a section of Gi , i = 1, 2. Proof. Let L 6 G1 × G2 and let Pi 6 Gi be the projection of L onto Gi , i = 1, 2. Then L is a binary relation from P1 to P2 . Writing a1 La2 for (a1 , a2 ) ∈ L, it is easy to see that {{a2 ∈ P2 : a1 La2 } : a1 ∈ P1 } is a partition of P2 into cosets of the normal subgroup K2 = {a2 ∈ G2 : 1La2 } of P2 . Similarly, the sets {a1 ∈ P1 : a1 La2 }, a2 ∈ P2 , are cosets of a normal subgroup K1 of P1 . The relation L thus is difunctional, i.e., it establishes a bijection θ between the section quotients P1 /K1 and P2 /K2 , which in fact is a group homomorphism. Conversely, any isomorphism θ : P1 /K1 → P2 /K2 between sections (Pi , Ki) of Gi , i = 1, 2, yields a relation {(a1 , a2) ∈ G1 × G2 : (a1 K1 )θ = a2 K2 }, which in fact is a subgroup of G1 × G2 .  If a subgroup L corresponds to an isomorphism θ : P1 /K1 → P2 /K2 , then we write pi (L) for Pi and ki (L) for Ki , i = 1, 2. We call the sections (Pi , Ki) the Goursat sections of L and the isomorphism type of Pi /Ki the Goursat type of L. Finally, L is called the graph of θ and, conversely, θ is the Goursat isomorphism of L. The next lemma, illustrated in Fig. 1, can be derived from Lemma 2.1, see e.g. [9]. 4 BRENDAN MASTERSON AND GÖTZ PFEIFFER P1 P2 P1′ P2′ P1 ∩ P2 K1′ K2′ (K1 ∩ P2 )(P1 ∩ K2 ) K1 K2 K1 ∩ P2 K2 ∩ P1 Figure 1. Butterfly Lemma Lemma 2.2 (Butterfly Lemma, [8, 11.3]). Let (P1 , K2 ) and (P2 , K2 ) be sections of G. Set Pi′ := (P1 ∩ P2 )Ki for i = 1, 2, K1′ := (P1 ∩ K2 )K1 , and K2′ := (P2 ∩ K1 )K2 . Then P1 ∩ P2 = P1′ ∩ P2′ , (K1 ∩ P2 )(P1 ∩ K2 ) = K1′ ∩ K2′ and the canonical map φi : (P1′ ∩ P2′ )/(K1′ ∩ K2′ ) → Pi′ /Ki′ is an isomorphism, i = 1, 2. We refer to the section (P1′ ∩P2′ , K1′ ∩K2′ ) as the Butterfly meet of (P1 , K1 ) and (P2 , K2 ). Let G1 , G2 , G3 be finite groups. The product L ∗ M of subgroups L 6 G1 × G2 and M 6 G2 × G3 is defined as L ∗ M = {(g1 , g3 ) ∈ G1 × G3 : (g1 , g2 ) ∈ L and (g2 , g3) ∈ M for some g2 ∈ G2 }. Then L ∗ M ⊆ G1 × G3 is in fact a subgroup. Thanks to [2], we obtain the Goursat isomorphism of L∗M by composing Goursat isomorphisms θ ′ and ψ ′ , as follows. Suppose that L is the graph of the isomorphism θ : P0 /K0 → P1 /K1 , and that M is the graph of ψ : P2 /K2 → P3 /K3 . With both (P1 , K1) and (P2 , K2) being sections of G2 , let subgroups Pi′ , Ki′ , and isomorphisms φi : (P1′ ∩P2′ )/(K1′ ∩K2′ ) → Pi′ /Ki′ , i = 1, 2, be as in the Butterfly Lemma 2.2. Let ψ : P2′ /K2′ → P3′ /K3′ be the isomorphism obtained by restricting ψ to P2′ /K2′ , defined by (pK2′ )ψ = (pK2′ )ψ for p ∈ P2′ . Moreover, let θ : P0′ /K0′ → P1′ /K1′ be the co-restriction of θ to P1′ /K1′ , defined by (pK0′ )θ = (pK0′ )θ for p ∈ P0′ . Then the graph of ′ ′ ′ ′ ′ ′ θ ′ := θ · φ−1 1 : P0 /K0 → (P1 ∩ P2 )/(K1 ∩ K2 ) is a subgroup of G1 × G2 (although not necessarily of L), the graph of ψ ′ := φ2 · ψ : (P1′ ∩ P2′ )/(K1′ ∩ K2′ ) → P3′ /K3′ is a subgroup of G2 × G3 . Lemma 2.3. With the above notation, L ∗ M is the graph of the composite isomorphism θ ′ · ψ ′ : P0′ /K0′ → P3′ /K3′ . We use the subgroup product and its Goursat isomorphism in the proof of Theorem 6.5. 2.3. Bisets and Biset Products. The action of a direct product G1 × G2 on a set X is sometimes more conveniently described as the two groups Gi acting on the same set X, one from the left and one from the right. ON THE TABLE OF MARKS OF A DIRECT PRODUCT OF FINITE GROUPS. 5 Definition 2.4 ([3, 2.3.1]). Let G1 and G2 be groups. Then a (G1 , G2 )-biset X is a left G1 -set and a right G2 -set, such that the actions commute, i.e., (g1 x)g2 = g1 (xg2 ), gi ∈ Gi , x ∈ X. Under suitable conditions, bisets can be composed, as follows. Definition 2.5. Let G1 , G2 and G3 be groups. If X is a (G1 , G2 )-biset and Y a (G2 , G3 )biset, the tensor product of X and Y is the (G1 , G3 )-biset X ×G2 Y := (X × Y)/G2 of G2 -orbits on the set X × Y under the action given by (x, y).g = (x.g, g−1 .y), g ∈ G2 . The tensor product of bisets will be used in Section 5 to describe certain sets of subgroups of G1 × G2 . It also provides the multiplication in the double Burnside ring of a group G, which is the subject of Section 7.1. 2.4. Action on Pairs. We will also need to deal with one group acting on two sets. The following parametrization of the orbits of a group acting on a set of pairs is well-known. Lemma 2.6. Let G be a finite group, acting on finite sets X and Y, and suppose that Z ⊆ X × Y is a G-invariant set of pairs. Then a Z/G = {[x, y]G : [x]Gy ∈ Zy/Gy }, [y]G ∈Y/G where Zy = {x ∈ X : (x, y) ∈ Z} for y ∈ Y. The G-orbits of pairs in Z are thus represented by pairs (x, y), where the y represent the orbits of G on Y and, for a fixed y, the x represent the orbits of the stabilizer of y on the set Zy of all x ∈ X that are Z-related to y. Proof. Note that Z= a Z ∩ (X × [y]G ) [y]G ∈Y/G is a disjoint union of G-invariant intersections Z ∩ (X × [y]G ), whence Z/G is the corresponding disjoint union of orbit spaces (Z ∩ (X × [y]G ))/G. By [12, Lemma 2.1] , for each y ∈ Y, the map [x]Gy 7→ [x, y]G is a bijection between X/Gy and (X×[y]G )/G. Hence, for every y ∈ Y, there is a bijection between Zy/Gy and (Z ∩ (X × [y]G ))/G,  2.5. Class Incidence Matrices. Let (X, 6) be a finite partially ordered set (poset) with incidence matrix  1, if y 6 x, A(6) = (axy)x,y∈X , where axy = 0, else. This incidence matrix A(6) is lower triangular, if the order of rows and columns of A(6) extends the partial order 6. Suppose further that ≡ is an equivalence relation on X. Then ≡ partitions X into classes X/≡ = {[x] : x ∈ T }, for a transversal T ⊆ X. We say that the partial order 6 is compatible with the equivalence relation ≡ if, for all classes [x], [y], the number axy := #{x ′ ≡ x : y 6 x ′ } 6 BRENDAN MASTERSON AND GÖTZ PFEIFFER does not depend on the choice of the representatives x, y ∈ X, i.e., if axy = axy ′ for y ′ ≡ y. In that case, we define the class incidence matrix of the partial order 6 to be the matrix A(6) = (axy )x,y∈T , whose rows and columns are labelled by the chosen transversal T . Matrix multiplication relates the matrices A(6) and A(6) in the following way. Lemma 2.7. Define a row summing matrix R(≡) = (rxy )x∈T, y∈X and a column picking matrix C(≡) = (cxy )x∈X,y∈T with entries   1, if x ≡ y, 1, if x = y, rxy = cxy = 0, else, 0, else. Then (i) R(≡) · C(≡) = I, the identity matrix on T . (ii) R(≡) · A(6) = A(6) · R(≡). (iii) A(6) = R(≡) · A(6) · C(≡), P Proof. (i) For each x, z ∈ T , y∈X rxy cyz = rxz . (ii) For each x ∈ T , z ∈ X, the x, z-entry of both matrices is equal to axy , where y ∈ T represents the class z ∈ X. (iii) follows from (ii) and (i).  Remark 2.8. Examples of compatible posets are provided by group actions. Suppose that a finite group G acts on a poset (X, 6) in such a way that x 6 y =⇒ x.a 6 y.a for all x, y ∈ X and all a ∈ G. Then X is called a G-poset. The partial order 6 is compatible with the partition of X into G-orbits since {x ′ ≡ x : y 6 x ′ }.a = {x ′ ≡ x : y.a 6 x ′ }, for all x, y ∈ X. We write R(G) and C(G) for R(≡) and C(≡) if the equivalence ≡ is given by a G-action. Remark 2.9. More generally, any square matrix A with rows and columns indexed by a set X with an equivalence relation ≡, after choosing a transversal of the equivalence classes, yields a product R(≡) · A · C(≡). We say that the matrix A is compatible with the equivalence if this product does not depend on the choice of transversal. If the equivalence on X is induced by the action of a group G then the matrix A = (axy )x,y∈X is compatible if ax.g,y.g = axy for all g ∈ G. Such matrices are the subject of Proposition 4.7 and Theorem 6.5. 2.6. The Burnside Ring and the Table of Marks. The Burnside ring B(G) of a finite group G is the Grothendieck ring of the category of finite G-sets, that is the free abelian group with basis consisting of the isomorphism classes [X] of transitive G-sets X, with disjoint union as addition and the Cartesian product as multiplication. Multiplication of transitive G-sets is described by Mackey’s formula [10, Lemma 1.2.11] X [G/A] · [G/B] = [G/(Ad ∩ B)]. ` d AdB=G The rational Burnside algebra QB(G) = Q ⊗Z B(G) is isomorphic to a direct sum of r copies of Q, one for each conjugacy class of subgroups of G, with products of basis elements determined by the above formula. ON THE TABLE OF MARKS OF A DIRECT PRODUCT OF FINITE GROUPS. 7 The mark of a subgroup H of G on a G-set X is its number of fixed points, |XH | = #{x ∈ X : x.h = x for all h ∈ H}. Obviously, |XH1 | = |XH2 | whenever H1 and H2 are conjugate subgroups of G. The map βG : B(G) → Zr assigns to [X] ∈ B(G) the vector (|XH1 |, . . . , |XHr |) ∈ Zr , where (H1 , . . . , Hr ) is a transversal of the conjugacy classes of subgroups of G. In this context, the ring Zr with componentwise addition and multiplication, is called the ghost ring of G. We have βG ([X ∐ Y]) = βG ([X]) + βG ([Y]), βG ([X × Y]) = βG ([X]) · βG ([Y]), where the latter product is componentwise multiplication in Zr . Thus βG is a homomorphism of rings, called the mark homomorphism of G. The table of marks M(G) of G is the r × r-matrix with rows βG ([G/Hi ]), i = 1, . . . , r, the mark vectors of all transitive G-sets, up to isomorphism. Regarding βG as a linear map from QB(G) to Qr , the table of marks is the matrix of βG relative to the natural basis ([G/Hi]) of QB(G) and the standard basis of Qr . As |(G/H)K | = |NG (H) : H| #{Hg > K : g ∈ G} for subgroups H, K 6 G, the table of marks provides a compact description of the subgroup lattice of G. In fact M(G) = D · A(6), where D is the diagonal matrix with entries |NG (Hi ) : Hi | and A(6) is the class incidence matrix of the group G acting on its lattice of subgroups by conjugation. Example 2.10. Let G = S3 . Then G has 4 conjugacy classes of subgroups and       M(G) =  G/1 G/2 G/3 G/G 6 3 2 1 . 1 . 1 . . 2 1 . . . 1 = 6 . . . . 1 . . . . 2 . . . . 1 · 1 3 1 1 . 1 . 1 . . 1 1 . . . 1 . 3. Sections Let G be a finite group. We denote by SG the set of subgroups of G, and by SG /G := {[H]G : H 6 G} the set of conjugacy classes of subgroups of G. A section of G is a pair (P, K) of subgroups of G where K E P. We call P the top group and K the bottom group of the section (P, K). We refer to the quotient group P/K as the quotient of the section (P, K). The isomorphism type of a section is the isomorphism type of its quotient and the size of a section is the size its quotient. We denote the set of sections of G by QG := {(P, K) : K E P 6 G} . The group G acts on the set of pairs QG by conjugation. In Sections 3.1 and 3.2, we classify the orbits of this action and describe the automorphisms induced by the stabilizer of a section on its quotient. The partial order on SG induces a partial order on the pairs in QG . In Section 3.3, we show that this partial order is in fact a lattice, and how it can be decomposed as a product of three smaller partial order relations. In Section 3.4,we determine the class incidence matrix of QG and show that the decomposition of the partial order on QG corresponds to a decomposition of the class incidence matrix of QG as a matrix product of three class incidence matrices. In Section 3.5, we use the smaller partial orders to define a new partial order on QG that is consistent with the notion of size of a section. 8 BRENDAN MASTERSON AND GÖTZ PFEIFFER 3.1. Conjugacy Classes of Sections. A finite group G naturally acts on its sections through componentwise conjugation via (P, K)g := (Pg , Kg ), where (P, K) ∈ QG and g ∈ G. We write [P, K]G for the conjugacy class of a section (P, K) in G, and denote the set of all conjugacy classes of sections of G by QG /G := {[P, K]G : (P, K) ∈ QG } . The conjugacy classes of sections can be parametrized in different ways in terms of simpler actions, as follows. Proposition 3.1. Let G and SG be as above. EP (i) For P 6 G, let SEP G = {K ∈ SG : K E P}. Then (SG , 6) is an NG (P)-poset and a QG /G = {[P, K]G : [K] ∈ SEP G /NG (P)}. [P]∈SG /G KE (ii) For K 6 G, let SKE G = {P ∈ SG : K E P}. Then (SG , 6) is an NG (K)-poset and a QG /G = {[P, K]G : [K] ∈ SKE G /NG (K)}. [K]∈SG /G Proof. (i) Note that QG ⊆ SG × SG is a G-invariant set of pairs. As the stabilizer of K ∈ SG is NG (K), the result follows with Lemma 2.6. (ii) Follows in a similar way.  We write U ⊑ G for a finite group U which is isomorphic to a subquotient of G. We denote by QG (U) the set of sections of G with isomorphism type U, and by ∼ U}. QG (U)/G := {[P, K] ∈ QG /G : P/K = G its G-conjugacy classes. Naturally, QG /G = a QG (U)/G. U⊑G Each of the above three partitions of QG /G will be used in the sequel. 3.2. Section Automizers. The automizer of a subgroup H in G is the quotient group of the section (NG (H), CG(H)). The automizer of H is isomorphic to the subgroup of Aut(H) induced by the conjugation action of G. Analogously, we define the automizer of a section as a section whose quotient is isomorphic to the subgroup of automorphisms induced by conjugation by G. Definition 3.2. Let (P, K) ∈ QG and set N = NG (K). Using the natural homomorphism φ : N → N/K, n 7→ n = nK, we let P := φ(P) = P/K and N := φ(N) = N/K. We define the section normalizer of (P, K) to be the inverse image NG (P, K) := φ−1 (NN (P)), the section centralizer to be CG (P, K) := φ−1 (CN (P)), and the section automizer to be the section AG (P, K) := (NG (P, K), CG (P, K)). Moreover, we denote by AutG (P, K) the subgroup of Aut(P/K) of automorphisms induced by conjugation by G, see Fig. 2. ON THE TABLE OF MARKS OF A DIRECT PRODUCT OF FINITE GROUPS. 9 Aut(P/K) NG (P, K) NN (P) AutG (P, K) P CG (P, K) P CN (P) Inn(P/K) CN (P) 1 P P CG (P, K) P ∩ CG (P, K) P ∩ CN (P) K 1 Figure 2. The section (P, K) and its automorphisms The following properties of these groups are obvious. Lemma 3.3. Let (P, K) be a section in QG . Then (i) NG (P, K) = NG (P) ∩ NG (K). (ii) CG (P, K) is the set of all g ∈ NG (P, K) which induce the identity automorphism on P/K. (iii) Inn(G) 6 AutG (P, K) 6 Aut(P/K). 3.3. The Sections Lattice. Subgroup inclusion induces a partial order on the set QG of sections of G which inherits the lattice property from the subgroup lattice, as follows. Definition 3.4. QG is a poset, with partial order 6 defined componentwise, i.e., (P ′ , K ′ ) 6 (P, K) if P ′ 6 P and K ′ 6 K, for sections (P ′ , K ′ ) and (P, K) of G. For subgroups A, B 6 G, we write A ∨ B = hA, Bi for the join of A and B in the subgroup lattice of G, and hhAiiB for the normal closure of A in B. Proposition 3.5. The poset (QG , 6) is a lattice with componentwise meet, i.e., (P1 , K1 ) ∩ (P2 , K2 ) = (P1 ∩ P2 , K1 ∩ K2 ), and join given by (P1 , K1) ∨ (P2 , K2 ) = (P1 ∨ P2 , hhK1 ∨ K2 iiP1 ∨P2 ), for sections (P1 , K1) and (P2 , K2 ) of G. Proof. Clearly, K1 ∩ K2 is a normal subgroup of P1 ∩ P2 , and the section (P1 ∩ P2 , K1 ∩ K2 ) is the unique greatest lower bound of the sections (P1 , K1 ) and (P2 , K2 ) in QG . It is also easy to see that the least section (P, K) of G with P > P1 ∨P2 and K > K1 ∨K2 has P = P1 ∨ P2 and K = hhK1 ∨ K2 iiP .  Theorem 3.6. Let (P ′ , K ′ ) 6 (P, K) be sections of a finite group G. Then (i) (P ′ , K ∩ P ′ ) is the largest section between (P ′ , K ′ ) and (P, K) with top group P ′ ; (ii) (P ′ K, K) is the smallest section between (P ′ , K ′ ) and (P, K) with bottom group K; (iii) the map p(K ∩ P ′ ) 7→ pK, p ∈ P ′ is an isomorphism between the section quotients of (P ′ , K ∩ P ′ ) and (P ′ K, K). 10 BRENDAN MASTERSON AND GÖTZ PFEIFFER P P ′K P′ K K∩P ′ K′ Figure 3. (P ′ , K ′ ) 6 (P, K) Proof. If (P ′ , K ′ ) 6 (P, K) then there is a canonical homomorphism from P ′ /K ′ to P/K, given by (K ′ p)φ = Kp for p ∈ P ′ . According to the homomorphism theorem, φ can be decomposed into a surjective, bijective and an injective part, that is φ = φ1 φ2 φ3 , where φ1 : P ′ /K ′ → P ′ /K ∩ P ′ , φ2 : P ′ /K ∩ P ′ → P ′ K/K, φ3 : P ′ K/K → P/K are uniquely determined, see Fig. 3  Motivated by the above result we define the following three partial orders on QG . Definition 3.7. Let (P ′ , K ′ ) 6 (P, K). Then we write (i) (P ′ , K ′ ) 6P (P, K) if P ′ = P, i.e., if the sections have the same top groups; (ii) (P ′ , K ′ ) 6K (P, K) if K ′ = K, i.e., if the sections have the same bottom groups; (iii) (P ′ , K ′ ) 6P/K (P, K) if the map pK ′ 7→ pK, p ∈ P, is an isomorphism. We can now reformulate Theorem 3.6 in terms of these three relations. Corollary 3.8. The partial order 6 on QG is a product of three relations, i.e., 6 = 6K ◦ 6P/K ◦ 6P . Let A(6) denote the incidence matrix for the partial order 6. Then the stronger property A(6) = A(6K ) · A(6P/K ) · A(6P ) also holds. Proof. By Theorem 3.6, for (P ′ , K ′ ) 6 (P, K) there exists unique intermediate sections S, S ′ ∈ QG such that (P ′ , K ′ ) 6P S ′ 6P/K S 6K (P, K).  Remark 3.9. Note that, by the Correspondence Theorem, there is a bijective correspondence between the subgroups of P/K and the sections (P ′ , K ′ ) of G with (P ′ , K ′ ) 6K (P, K). Similarly, there is a bijective correspondence between the normal subgroups (and hence the factor groups) of P/K and the sections (P ′ , K ′ ) of G with (P, K) 6P (P ′ , K ′ ). 3.4. Class Incidence Matrices. We denote the class incidence matrix of the G-poset (QG , 6) by A(6). Note that the set QG of sections of G is also a G-poset with respect to any of the partial orders from Definition 3.7, with respective class incidence matrices A(6P ), A(6K ) and A(6P/K ). Theorem 3.10. With this notation, A(6) = A(6K ) · A(6P/K ) · A(6P ). ON THE TABLE OF MARKS OF A DIRECT PRODUCT OF FINITE GROUPS. 11 Proof. Set R = R(G) and C = C(G). From Lemma 2.7(iii) we have that A(6) = R · A(6 ) · C. By Corollary 3.8 A(6) = A(6K ) · A(6P/K ) · A(6P ). Lemma 2.7(ii) then gives A(6) = R · A(6K ) · A(6P/K ) · A(6P ) · C = A(6K ) · R · A(6P/K ) · A(6P ) · C = A(6K ) · A(6P/K ) · R · A(6P ) · C = A(6K ) · A(6P/K ) · A(6P ).  Each of the classes incidence matrices A(6P ), A(6K ) and A(6P/K ) is a direct sum of smaller class incidence matrices, as the following results show. Theorem 3.11. For P 6 G, denote the class incidence matrix of the NG (P)-poset SEP G by AP (6). Then M A(6P ) = AP (6). [P]∈SG /G Proof. Let (P, K) ∈ QG . By Proposition 3.1, the G-conjugacy classes containing a section with top group P are represented by sections (P, K ′ ), where K ′ runs over a transversal of ′ the NG (P)-orbits of SEP G . In order to count the G-conjugates of (P, K ) above (P, K) in ′ g the 6P -order, it now suffices to note that (P, K) 6 (P, K ) for some g ∈ G if and only if K 6 (K ′ )g for some g ∈ NG (P).  Example 3.12. Let G = S3 . Then A(6P ) = (1, 1) (2, 1) (2, 2) (3, 1) (3, 3) (G, 1) (G, 3) (G, G) 1 · · · · · · · (1, 1) · 1 1 · · · · · (2, 1) · · 1 · · · · · (2, 2) · · · 1 1 · · · (3, 1) · · · · 1 · · · (3, 3) · · · · · 1 1 1 (G, 1) · · · · · · · · · · · · 1 · 1 1 (G, 3) (G, G) Theorem 3.13. For K 6 G, denote the class incidence matrix of the NG (K)-poset SKE G by AK (6). Then M A(6K ) = AK (6). [K]∈SG /G Proof. Similar to the proof of Theorem 3.11.  Example 3.14. Let G = S3 . Then A(6K ) = (1, 1) (2, 1) (3, 1) (G, 1) (2, 2) (3, 3) (G, 3) (G, G) 1 3 1 1 · · · · (1, 1) · 1 · 1 · · · · (2, 1) · · 1 1 · · · · (3, 1) Lemma 3.15. We have A(6P/K ) = · · · 1 · · · · (G, 1) M · · · · 1 · · · (2, 2) · · · · · 1 1 · (3, 3) · · · · · · 1 · (G, 3) · · · · · · · 1 (G, G) AU (6P/K ) U⊑G where, for U ⊑ G, AU (6P/K ) is the class incidence matrix of the G-poset (QG (U), 6P/K ). 12 BRENDAN MASTERSON AND GÖTZ PFEIFFER ∼ P/K. Proof. (P ′ , K ′ ) 6P/K (P, K) implies P ′ /K ′ =  Example 3.16. Let G = S3 . Then A(6P/K ) = (1, 1) (2, 2) (3, 3) (G, G) (2, 1) (G, 3) (3, 1) (G, 1) 1 3 1 1 · · · · (1, 1) · 1 · 1 · · · · (2, 2) · · 1 1 · · · · (3, 3) · · · 1 · · · · (G, G) · · · · 1 1 · · (2, 1) · · · · · 1 · · (G, 3) · · · · · · 1 · (3, 1) · · · · · · · 1 (G, 1) The class incidence matrix A(6) of the G-poset (QG , 6) is the product of this matrix and the class incidence matrices in Examples 3.14 and 3.12, according to Theorem 3.10: A(6) = (1, 1) (2, 2) (3, 3) (G, G) (2, 1) (G, 3) (3, 1) (G, 1) 1 3 1 1 3 1 1 1 (1, 1) · 1 · 1 · · · · (2, 2) · · 1 1 · 1 · · (3, 3) · · · 1 · · · · (G, G) · 1 · 1 1 1 · 1 (2, 1) · · · 1 · 1 · · (G, 3) · · 1 1 · 1 1 1 (3, 1) · · · 1 · 1 · 1 (G, 1) 3.5. The Sections Lattice Revisited. The partial order 6 = 6K ◦ 6P/K ◦ 6P on QG is not compatible with section size as (P ′ , K ′ ) 6P (P, K) implies |P ′ /K ′ | > |P/K|. It turns out that, by effectively replacing the partial order 6P by its opposite >P , one obtains from 6 a new partial order 6 ′ , which is compatible with section size. Proposition 3.17. Define a relation 6 ′ on QG by (P ′ , K ′ ) 6 ′ (P, K) if P ′ 6 P and K ∩ P ′ 6 K ′ for sections (P ′ , K ′ ) and (P, K) of G. Then (QG , 6 ′ ) is a G-poset. Proof. The relation 6 ′ is clearly reflexive and antisymmetric on QG , and compatible with the action of G. Hence it only remains to be shown that this relation is transitive. Let (P ′′ , K ′′ ), (P ′ , K ′ ) and (P, K) be sections of G, such that (P ′′ , K ′′ ) 6 ′ (P ′ , K ′ ) and (P ′ , K ′ ) 6 ′ (P, K). In order to show that (P ′′ , K ′′ ) 6 ′ (P, K), we need P ′′ 6 P (which is clear), and K ∩ P ′′ 6 K ′′ . Intersecting both sides of K ∩ P ′ 6 K ′ with P ′′ gives K ∩ P ′′ 6 K ′ ∩ P ′′ 6 K ′′ , as desired.  Example 3.18. Let us denote the three subgroups of order 2 of the Klein 4-group G = 22 by 21 , 22 and 23 . Then (21 , 1) 6 ′ (G, 22 ), (G, 23) and (G, G) 6 ′ (G, 22 ), (G, 23). As the sections (G, 22 ), (G, 23) have no unique infimum the poset (QG , 6 ′ ) is not a lattice. Proposition 3.19. Let (P ′ , K ′ ) and (P, K) be sections of a finite group G, such that (P ′ , K ′ ) 6 ′ (P, K). Then, there are uniquely determined sections of G, (P, K) > ′ (P1 , K1) > ′ (P2 , K2 ) > ′ (P ′ , K ′ ) such that (i) (P1 , K1) 6K (P, K), (ii) (P ′ , K ′ ) >P (P2 , K2 ), (iii) (P2 , K2) 6P/K (P1 , K1 ). Proof. By definition, (P ′ , K ′ ) 6 ′ (P, K) implies P ′ 6 P and K ∩ P ′ 6 K ′ , where K ′ E P ′ and K E P. Then, by the second isomorphism theorem, K ∩ P ′ is a normal subgroup of P ′ , P ′ K is a subgroup of P such that K E P ′ K and (P ′ K)/K is isomorphic to P ′ /(K ∩ P ′ ). ON THE TABLE OF MARKS OF A DIRECT PRODUCT OF FINITE GROUPS. 13 P P ′K P′ K ′K K′ K K∩P ′ Figure 4. (P ′ , K ′ ) 6 ′ (P, K) Hence (P1 , K1) = (P ′ K, K) and (P2 , K2) = (P ′ , K ∩ P ′ ) have the desired properties, see Fig. 4.  Corollary 3.20. The partial order 6 ′ on QG is a product of three relations, i.e., 6 ′ = 6K ◦ 6P/K ◦ >P . Moreover, A(6 ′ ) = A(6K ) · A(6P/K ) · A(>P ) and A(6 ′ ) = A(6K ) · A(6P/K ) · A(>P ). Example 3.21. Let G = S3 . Then A(6 ′ ) = (1, 1) (2, 2) (3, 3) (G, G) (2, 1) (G, 3) (3, 1) (G, 1) 1 3 1 1 3 1 1 1 (1, 1) · 1 · 1 1 1 · 1 (2, 2) · · 1 1 · 1 1 1 (3, 3) · · · 1 · 1 · 1 (G, G) · · · · 1 1 · 1 (2, 1) · · · · · 1 · 1 (G, 3) · · · · · · 1 1 (3, 1) · · · · · · · 1 (G, 1) In contrast to the class incidence matrix A(6) in Example 3.16, the matrix A(6 ′ ) is lower triangular when rows and columns are sorted by section size. Moreover, (P, K) 6 ′ (G, 1), for all sections (P, K) of G. Remark 3.22. Whenever (P ′ , K ′ ) 6 ′ (P, K), there is a canonical isomorphism ψ : P ′ /K ′ → P ′ K/K ′ K. Let θ : P1 /K1 → P2 /K2 be the Goursat isomorphism of a subgroup of G1 × G2 and suppose that (P ′ , K ′ ) 6 ′ (P1 , K1 ). The canonical isomorphism determines a unique restriction of θ to a Goursat isomorphism θ1′ : P ′ /K ′ → P2′ /K2′ . Similarly, for each section (P ′ , K ′ ) 6 ′ (P2 , K2 ), there is a unique co-restriction of θ to a Goursat isomorphism θ2′ : P1′ /K1′ → P ′ /K ′ . As the Butterfly meet (P ′ , K ′ ) of sections (P1 , K1 ) and (P2 , K2) of a group G satisfies (P ′ , K ′ ) 6 ′ (P1 , Ki), i = 1, 2, by Lemma 2.3, the product of subgroups with Goursat isomorphisms θ : P0 /K0 → P1 /K1 and ψ : P2 /K2 → P3 /K3 is the composition of the restriction of θ and the co-restriction of ψ to the Butterfly meet of (P1 , K1 ) and (P2 , K2). 4. Morphisms Let U be a finite group. A U-morphism of G is an isomorphism θ : P/K → U between a section (P, K) of G and the group U. The set MG (U) := {θ : P/K → U | (P, K) ∈ QG (U)} of all U-morphisms of G forms a (G, Aut(U))-biset. In Section 4.1, we describe the set MG (U)/G of G-classes of U-morphisms as an Out(U)-set. The identification of MG (U) 14 BRENDAN MASTERSON AND GÖTZ PFEIFFER with certain subgroups of G × U in Section 4.2 induces a partial order on MG (U). In Section 4.3, we compute the class incidence matrix of this partial order. 4.1. Classes of U-Morphisms. Each U-morphism θ : P/K → U of G induces an isomorphism between the automorphism groups Aut(P/K) and Aut(U). We define the automizer of θ as an isomorphism between the quotient of the automizer AG (P, K) of the section (P, K) and the corresponding subgroup of Aut(U). Definition 4.1. Given a U-morphism θ : (P, K) → U, denote P̃ = NG (P, K) and K̃ = CG (P, K) and let Aθ 6 Aut(U) be the image of AutG (P/K) in Aut(U). The automizer of the U-morphism θ is the Aθ -morphism AG (θ) : P̃/K̃ → Aθ , that, for n ∈ P̃, maps the coset nK̃ to the automorphism θ−1 γn θ of U corresponding to conjugation by n on P/K. Moreover, denote by Oθ := Aθ /Inn(U) 6 Out(U), the group of outer automorphisms of U induced via θ, noting that Inn(U) 6 Aθ . a a The group G acts on MG (U) via θa = γ−1 a θ, where γa : P/K → P /K is the conjugation map induced by a ∈ G. We denote by [θ]G := {θa : a ∈ G} the G-orbit of the U-morphism θ and by MG (U)/G := {[θ]G : θ ∈ MG (U)} the set of G-classes of U-morphisms. For a section (P, K) ∈ QG (U), denote by MP,K G (U) the set of U-morphisms with domain P/K. Under the action (θ, α) 7→ θα, for θ ∈ MG (U) and α ∈ Aut(U), the set MG (U) decomposes into regular Aut(U)-orbits MP,K G (U), one for each section (P, K) ∈ QG (U). As the action of Aut(U) commutes with that of G, it induces an Aut(U)-action ([θ]G , α) 7→ [θα]G on the set MG (U)/G of G-classes. This action can be used to classify the G-classes of U-morphisms as follows. Proposition 4.2. Let U ⊑ G. (i) As Aut(U)-set, MG (U)/G is the disjoint union of transitive Aut(U)-sets P,K MP,K G (U)/G := {[θ]G : θ ∈ MG (U)}, one for each G-class of sections [P, K]G ∈ QG (U)/G. (ii) Let θ : P/K → U be a U-morphism of G. Then MP,K G (U)/G = {[θα]G : α ∈ Dθ }, where Dθ is a transversal of the right cosets Aθ α of Aθ in Aut(U). Note that, by an abuse of notation, MP,K G (U)/G is the set of full G-orbits of the UP,K morphisms in MP,K (U), although M (U) is not a G-set in general. G G Proof. Let X = MG (U) and let Y = QG (U). Then X can be identified with the Ginvariant subset Z of X × Y consisting of those pairs (θ, (P, K)) where θ has domain P/K. By Lemma 2.6, Z/G is the disjoint union of Aut(U)-orbits MP,K G (U)/G, one for each G-class [P, K]G of sections of G. ON THE TABLE OF MARKS OF A DIRECT PRODUCT OF FINITE GROUPS. 15 Now let θ : P/K → U be a U-morphism. The stabilizer of the section (P, K) in G is its normalizer NG (P, K). The automizer AG (θ) transforms this action into the subgroup Aθ of Aut(U). As Aut(U) acts regularly on MP,K G (U), the Aθ -orbits on this set correspond to the cosets of Aθ in Aut(U) and {[θ]G : θ ∈ MP,K  G (U)} = {[θα]G : α ∈ Dθ }. As Inn(U) 6 Aθ for all θ ∈ MG (U), the Aut(U)-action on MG (U)/G can be regarded as an Out(U)-action. Thus, for each section (P, K) of G, the set MP,K G (U)/G is isomorphic to Out(U)/Oθ as Out(U)-set. ∼ S3 Example 4.3. Let G = A4 and U = 22 . Then QG (U) = {(22 , 1)}, and Aut(U) = 2 ∼ makes two orbits on the U-morphisms of the form θ : 2 /1 → U, as Aθ = 3. 4.2. Comparing Morphisms. By Goursat’s Lemma (Lemma 2.1), a U-morphism θ : P/K → U corresponds to the subgroup L = {(p, (pK)θ) : p ∈ P} 6 G × U. We call L the graph of θ. The partial order on the subgroups of G × U induces a natural partial order on MG (U), as follows: if θ and θ ′ are U-morphisms with graphs L and L ′ then we define θ ′ 6 θ : ⇐⇒ L ′ 6 L. This partial order on MG (U) is closely related to the order 6P/K on QG (U). Proposition 4.4. Let θ : P/K → U and θ ′ : P ′ /K ′ → U be U-morphisms of G. Then θ ′ 6 θ ⇐⇒ (P ′ , K ′ ) 6P/K (P, K) and θ ′ = φθ, where φ : P ′ /K ′ → P/K is the homomorphism defined by (pK ′ )φ = pK for p ∈ P ′ . ′ Proof. Let L = {(p, (pK)θ) : p ∈ P} be the graph of θ and let L ′ = {(p, (pK ′ )θ ) : p ∈ P ′ } be that of θ ′ . Assume first that L ′ 6 L. This clearly implies P ′ 6 P and K ′ 6 K. Moreover, for ′ ′ any p ∈ P ′ , if (p, (pK ′ )θ ) ∈ L ′ 6 L then (pK ′ )θ = (pK)θ = (pK ′ )φθ as (p, (pK)θ) is the unique element in L with first component p. Hence θ ′ = φθ. Now φ = θ ′ θ−1 is an isomorphism, whence (P ′ , K ′ ) 6P/K (P, K). ′ Conversely, if (P ′ , K ′ ) 6 (P, K) and θ ′ = φθ then clearly (p, (pK ′)θ ) = (p, (pK ′ )φθ ) = (p, (pK)θ) ∈ L for all p ∈ P ′ , whence L ′ 6 L.  More generally, for finite groups U, U ′ ⊆ G, suppose that sections (P, K) ∈ QG (U) and (P ′ , K ′ ) ∈ QG (U ′ ) are such that (P ′ , K ′ ) 6 (P, K) with canonical homomorphism φ : P ′ /K ′ → P/K. If θ : P/K → U and θ ′ : P ′/K ′ → U ′ are isomorphisms then the composition λ := (θ ′ )−1 φθ obviously is a homomorphism from U ′ to U, see Fig. 5. P/K θ φ P ′/K ′ U λ θ′ U′ Figure 5. λ : U ′ → U 16 BRENDAN MASTERSON AND GÖTZ PFEIFFER In case U = U ′ , the previous lemma says that θ ′ 6 θ if and only if λ = idU . If U 6= U ′ then θ and θ ′ are incomparable. However, there are the following connections to the partial orders on QG . Lemma 4.5. Let θ : P/K → U be a U-morphism. Then θ induces (i) an order preserving bijection between the sections (P ′ , K ′ ) of G with (P ′ , K ′ ) 6K (P, K) and the subgroups of U; (ii) an order preserving bijection between the sections (P ′ , K ′ ) of G with (P ′ , K ′ ) >P (P, K) and the normal subgroups of U. Proof. This is an immediate consequence of Remark 3.9 on the Correspondence Theorem.  4.3. The Partial Order of Morphism Classes. The partial order 6 on MG (U) is compatible in the sense of Section 2.5 with the conjugation action of G, and hence yields a class incidence matrix  ′ AG U (6) = a(θ, θ ) [θ],[θ ′]∈MG (U)/G , where, for θ, θ ′ ∈ MG (U), a(θ, θ ′ ) = #{θa > θ ′ : a ∈ G}. This matrix is a submatrix of the class incidence matrix of the subgroup lattice of G × U, corresponding to the classes of subgroups which occur as graphs of U-morphisms. Proposition 4.6. Suppose that θ, θ ′ ∈ MG (U) have graphs L, L ′ 6 G × U. Then a(θ, θ ′ ) = #{L(a,u) > L ′ : (a, u) ∈ G × U}. Proof. The result follows if we can show that the (G × U)-orbit of L is not larger than its G-orbit. For this, let u ∈ U. Then (p, u) ∈ L for some p ∈ P and hence L(p,u) = L. −1 But then L(1,u) = L(p ,1) .  As, for θ, θ ′ ∈ MG (U) and α ∈ Aut(U), we have θ ′ 6 θ ⇐⇒ θ ′ α 6 θα, the matrix AG U (6) is compatible (in the sense of Section 2.5) with the action of Out(U) on MG (U)/G. In fact, this relates it to the class incidence matrix AU (6P/K ) of QG (U) as follows. Proposition 4.7. With the row summing and column picking matrices corresponding to the Out(U)-orbits on MG (U)/G, we have AU (6P/K ) = R(Out(U)) · AG U (6) · C(Out(U)). Proof. By Proposition 4.2(i), the union of the classes [θα]G, α ∈ Aut(U), is the set of all U-morphisms of the form (P/K)a → U for some a ∈ G. This set contains, for each conjugate (P/K)a with (P/K)a >P/K P ′ /K ′ , exactly one U-morphism above θ ′ : P ′ /K ′ → U, by Proposition 4.4.  Example 4.8. Let G = A5 and U = 3. Then MG (U)/G consists of three classes, one with (P, K) = (3, 1) and two with (P, K) = (A4 , 22 ), permuted by Out(U). We have 1   1 ·     1  1 1 · · G AU (6) = 1 1 , AU (6P/K ) = · 1 1 · 1 1 · · 1 = . 1 · 1 1 · 1 · · 2 1 ON THE TABLE OF MARKS OF A DIRECT PRODUCT OF FINITE GROUPS. 17 5. Subgroups of a Direct Product From now on, let G1 and G2 be finite groups. In this section we describe the subgroups and the conjugacy classes of subgroups of the direct product G1 × G2 in terms of properties of the groups G1 and G2 . By Goursat’s Lemma 2.1, the subgroups of G1 × G2 correspond to isomorphisms between sections of G1 and G2 . Any such isomorphism arises as composition of two U-morphisms, for a suitable finite group U. This motivates the study of subgroups of G1 × G2 as pairs of U-morphisms. 5.1. Pairs of Morphisms. Let U be a finite group. We call L = (θ : P1 /K1 → P2 /K2 ) a ∼ U, i = 1, 2, and we denote U-subgroup of G1 × G2 if U is its Goursat type, i.e., if Pi /Ki = by SG1 ×G2 (U) the set of all U-subgroups of G1 × G2 . Given morphisms θi : Pi /Ki → U in MGi (U), i = 1, 2, composition yields an isomorphism θ = θ1 θ−1 2 : P1 /K1 → P2 /K2 with whose graph is a U-subgroup L 6 G1 ×G2 . Hence there is a map Π : MG1 (U)×MG2 (U) → SG1 ×G2 (U) defined by Π(θ1 , θ2 ) = θ1 θ−1 2 . In fact, the (G1 , G2 )-biset SG1 ×G2 (U) is the tensor product of the (G1 , Aut(U))-biset MG1 (U) and the opposite of the (G2 , Aut(U))-biset MG2 (U). Proposition 5.1. SG1 ×G2 (U) = MG1 (U) ×Aut(U) MG2 (U)op . Proof. For any U-subgroup L = (θ : P1 /K1 → P2 /K2 ) there exist θi ∈ MGi (U), i = 1, 2, such that θ = Π(θ1 , θ2 ). Moreover, for θi , θi′ ∈ MGi (U), we have Π(θ1 , θ2 ) = Π(θ1′ , θ2′ ) ′ −1  if and only if θ1′ θ−1 1 = θ2 θ2 in Aut(U). It will be convenient to express the order of a U-subgroup in terms of U. Lemma 5.2. Let L = (θ : P1 /K1 → P2 /K2 ) be a U-subgroup of G1 × G2 . Then |L| = |K1 ||K2 ||U| = |P1 ||P2 |/|U|. 5.2. Comparing Subgroups. Let U, U ′ be finite groups. We now describe and analyze the partial order of subgroups of G1 × G2 in terms of pairs of morphisms. Proposition 5.3. Let (θi : Pi /Ki → U) ∈ MGi (U) and (θi′ : Pi′ /Ki′ → U ′ ) ∈ MGi (U ′ ), i = 1, 2, be morphisms, let θ = Π(θ1 , θ2 ), θ ′ = Π(θ1′ , θ2′ ) with corresponding subgroups L, L ′ of G1 × G2 . Then L ′ 6 L if and only if (i) (Pi′ , Ki′ ) 6 (Pi , Ki) as sections of Gi , i = 1, 2; and (ii) λ1 = λ2 , where λi = (θi′ )−1 φi θi , and φi : Pi′ /Ki′ → Pi /Ki is the homomorphism defined by (Ki′ p)φi = Ki p, for p ∈ Pi′ , i = 1, 2. P1 /K1 θ1 U φ1 P1′ /K1′ θ1′ U U λ1 λ2 ′ ′ U Figure 6. L ′ 6 L θ2 P2 /K2 φ2 θ2′ P2′ /K2′ 18 BRENDAN MASTERSON AND GÖTZ PFEIFFER ′ ′ Proof. Write L ′ = {(p1′ , p2′ ) ∈ P1′ × P2′ : (p1′ K1′ )θ1 = (p2′ K2′ )θ2 } and L = {(p1 , p2 ) ∈ P1 × P2 : (p1 K1 )θ1 = (p2 K2 )θ2 }. Then L ′ 6 L if and only if (Pi′ , Ki′ ) 6 (Pi , Ki), i = 1, 2, and, for pi ∈ Pi′ , we have (p1 K1 )θ1 = (p2 K2 )θ2 . But if pi ∈ Pi′ then ′ (pi Ki )θi = (pi Ki′ )φi θi = (piKi′ )θi λi . So (p1 K1 )θ1 = (p2 K2 )θ2 if and only if λ1 = λ2 , see Fig. 6.  Corollary 5.4. With the notation of Proposition 5.3, L ′ 6 L if and only if (i) (Pi′ , Ki′ ) 6 (Pi , Ki) as sections of Gi , i = 1, 2; (ii) φ1 θ = θ ′ φ2 The partial orders on sections introduced in Definition 3.7 give rise to relations on the subgroups of G1 × G2 , as follows. Definition 5.5. Let L = (θ : P1 /K1 → P2 /K2 ) and L ′ = (θ ′ : P1′ /K1′ → P2′ /K2′ ) be subgroups of G1 × G2 and suppose that L ′ 6 L. We write (i) L ′ 6P L, if (Pi′ , Ki′ ) 6P (Pi , Ki), i = 1, 2, i.e., if both sections of L ′ and L have the same top groups; (ii) L ′ 6K L, if (Pi′ , Ki′ ) 6K (Pi , Ki ), i = 1, 2, i.e., if both sections of L ′ and L have the same bottom groups; (iii) L ′ 6P/K L, if (Pi′ , Ki′ ) 6P/K (Pi , Ki), i = 1, 2, i.e., if the canonical homomorphisms φi : Pi′ /Ki′ → Pi /Ki are isomorphisms. All three relations are obviously partial orders. Moreover, they decompose the partial order 6 on the subgroups of G1 × G2 , in analogy to Corollary 3.8. Theorem 5.6. Let L = (θ : P1 /K1 → P2 /K2 ) and L ′ = (θ ′ : P1′ /K1′ → P2′ /K2′ ) be such that ′ L ′ 6 L. Define a map θ̂ ′ : P1′ /(P1′ ∩ K1 ) → P2′ /(P2′ ∩ K2 ) by (p1 (P1′ ∩ K1 ))θ̂ = p2 (P2′ ∩ K2 ), ′ whenever pi ∈ Pi′ are such that (p1 P1′ )θ = p2 P2′ , and a map θ̃ : P1′ K1 /K1 → P2′ K2 /K2 by (p1 K1 )θ̃ = p2 K2 whenever pi ∈ Pi′ are such that (p1 K1 )θ = p2 K2 . Then (i) θ̂ ′ and θ̃ are isomorphisms with corresponding graphs Lθ̂ ′ and Lθ̃ 6 G1 × G2 . (ii) Lθ̂ ′ and Lθ̃ are the unique subgroups of G1 × G2 with L ′ 6P Lθ̂ ′ 6P/K Lθ̃ 6K L. Proof. Denote by φi : Pi′ /Ki′ → Pi /Ki the canonical homomorphism, i = 1, 2. Then, as in the proof of Theorem 3.6, φi is the product of an epimorphism φi1 : Pi′ /Ki′ → (Pi′ /Ki′ )/ ker φi , an isomorphism φi2 : (Pi′ /Ki′ )/ ker φi → im φi , and a monomorphism φi3 : im φi → Pi /Ki . By Corollary 5.4, φ1 θ = θ ′ φ2 . It follows that (im φ1 )θ = im φ2 ′ and (ker φ1 )θ = ker φ2 . Thus θ restricts to an isomorphism θ̃ from im φ1 to im φ2 , and θ ′ induces an isomorphism θ̂ ′ from (P1′ /K1′ )/ ker φ1 to (P2′ /K2′ )/ ker φ2 , and the following diagram commutes. ∼ P ′ /(P ′ ∩ Ki ).  By Proposition 3.6, im φi = Pi′ Ki /Ki and (Pi′ /Ki′ )/ ker φi = i i Corollary 5.7. The partial order 6 on SG1 ×G2 is a product of three relations: 6 = 6K ◦ 6P/K ◦ 6P . Moreover, if A(R) denotes the incidence matrix of the relation R, the stronger property A(6) = A(6K ) · A(6P/K ) · A(6P ) also holds. Proof. Like Corollary 3.8, this follows from the uniqueness of the intermediate subgroups in Theorem 5.6.  ON THE TABLE OF MARKS OF A DIRECT PRODUCT OF FINITE GROUPS. θ P1 /K1 P2 /K2 φ13 φ23 im φ1 θ̃ φ12 φ1 (P1′ /K1′ )/ ker φ1 im φ2 φ22 θ̂ ′ φ2 (P2′ /K2′ )/ ker φ2 φ11 P1′ /K1′ 19 φ21 θ′ P2′ /K2′ Figure 7. θ ′ 6 θ̂ ′ 6 θ̃ 6 θ Lemma 5.8. Let (θi : Pi /Ki → U) ∈ MGi (U), i = 1, 2 and L = Π(θ1 , θ2 ). Then (i) the set {L ′ 6 G1 ×G2 : L ′ 6K L} is in an order preserving bijective correspondence with the subgroups of U; (ii) the set {L ′ 6 G1 ×G2 : L 6P L ′ } is in an order preserving bijective correspondence with the quotients of U; (iii) the set {L ′ : L ′ 6P/K L} is in an order preserving bijective correspondence with {(P1′ , K1′ ) : (P1′ , K1′ ) 6P/K (P1 , K1 )} × {(P2′ , K2′ ) : (P2′ , K2′ ) 6P/K (P2 , K2)}; (iv) the set {L ′ : L 6P/K L ′ } is in an order preserving bijective correspondence with {(P1′ , K1′ ) : (P1′ , K1′ ) >P/K (P1 , K1 )} × {(P2′ , K2′ ) : (P2′ , K2′ ) >P/K (P2 , K2)}. Proof. This follows from Lemma 4.5 on the correspondences induced by a U-morphism, together with Proposition 4.4 and Theorem 5.6.  5.3. Classes of Subgroups. The conjugacy classes of U-subgroups of G1 × G2 can be described as Aut(U)-orbits of pairs of classes of U-morphisms. Theorem 5.9. Let U ⊑ Gi , i = 1, 2. (i) SG1 ×G2 (U)/(G1 × G2 ) is the disjoint union of sets MPG11,K1 (U)/G1 ×Aut(U) (MPG22,K2 (U)/G2 )op , one for each pair of section classes [Pi , Ki ]Gi ∈ QGi (U)/Gi . (ii) Let θi : Pi /Ki → U be U-morphisms of Gi , i = 1, 2. Then MPG11,K1 (U)/G1 ×Aut(U) (MPG22,K2 (U)/G2 )op = {[θ1 dθ−1 2 ]G1 ×G2 : d ∈ Dθ1 ,θ2 }, where Dθ1,θ2 is a transversal of the (Aθ1 , Aθ2 )-double cosets in Aut(U). Proof. (i) As SG1 ×G2 (U) = MG1 (U) ×Aut(U) MG2 (U), the (G1 × G2 )-conjugacy classes of U-subgroups of G1 × G2 are Aut(U)-orbits on the direct product MG1 (U)/G1 × MG2 (U)/G2 . By Proposition 4.2(i), this direct product is the disjoint union of Aut(U)invariant direct products MPG11,K1 (U)/G1 ×MPG22,K2 (U)/G2 , one for each choice of Gi -classes of sections [Pi , Ki]Gi ∈ QGi (U)/Gi , i = 1, 2. (ii) Let αi ∈ Aut(U), i = 1, 2. Note first that the image of [θ1 α1 ]G1 × [θ2 α2 ]G2 under Π is a (G1 × G2 )-conjugacy class of U-subgroups and that each (G1 × G2 )-class is of this form. We show that the classes in MPG11,K1 (U)/G1 × MPG22,K2 (U)/G2 correspond to the 20 BRENDAN MASTERSON AND GÖTZ PFEIFFER (Aθ1 , Aθ2 )-double cosets in Aut(U). For this, let αi′ ∈ Aut(U), i = 1, 2, and assume that Π([θ1 α1 ]G1 , [θ2 α2 ]G2 ) = Π([θ1 α1′ ]G1 , [θ2 α2′ ]G2 ). By Proposition 4.2(ii), this is the case if −1 −1 ′ ′ −1 ′ ′ −1 and only if θ1 Aθ1 α1 α−1 Aθ2 θ−1 2 Aθ2 θ2 = θ1 Aθ1 α1 (α2 ) 2 , i.e., if α1 α2 and α1 (α2 ) lie in the same (Aθ1 , Aθ2 )-double coset.  Example 5.10. Let G = S3 . For each U-morphism θ : P/K → U, we have Oθ = Out(U). Therefore, by Theorem 5.9, there exists exactly one conjugacy class of subgroups for each pair of classes of isomorphic sections (P1 , K1 ), (P2 , K2 ). A transversal {L1 , . . . , L22 } of the 22 conjugacy classes of subgroups of G × G can be labelled by pairs of sections as follows. (1, 1) (2, 2) (3, 3) (G, G) (1, 1) (2, 2) (3, 3) (G, G) L1 L2 L3 L4 L5 L6 L7 L8 L9 L10 L11 L12 L13 L14 L15 L16 (2, 1) (G, 3) (3, 1) (G, 1) (2, 1) L17 L18 (G, 3) L19 L20 (3, 1) L21 (G, 1) L22 Here, a subgroup Li in row (P1 , K1 ) and column (P2 , K2 ) has a Goursat isomorphism of the form P1 /K1 → P2 /K2 . The normalizer of a subgroup θ = Π(θ1 , θ2 ) of G1 × G2 , described as a quotient of two U-morphisms θi , can be described as the quotient of the automizers of the two U-morphisms. Theorem 5.11. Let U ⊑ Gi and let θi ∈ MGi (U), for i = 1, 2. Then NG1 ×G2 (Π(θ1 , θ2 )) = AG1 (θ1 ) ∗ AG2 (θ2 )op Proof. For i = 1, 2, suppose that θi : Pi /Ki → U and let (P̃i , K̃i) = AGi (Pi , Ki). Then AGi (θi ) : P̃i /K̃i → Aθi 6 Aut(U) is the automizer of θi . Let θ = Π(θ1 , θ2 ) = θ1 θ−1 2 . Then, on the one hand, NG1 ×G2 (θ) = {(a1 , a2 ) ∈ G1 × G2 : γ−1 a1 θγa2 = θ} consists of those elements (a1 , a2 ) ∈ P̃1 ×P̃2 which induce automorphisms αi = θ−1 i γai θi = −1 −1 −1 AGi (θi ) ∈ Aut(U) such that θ1 α1 α2 θ2 = θ1 θ2 , i.e., α1 = α2 . (ai K̃i ) On the other hand, by the Lemma 2.3, AG1 (θ1 ) ∗ AG2 (θ2 )op = Π(θ̃1′ (θ̃2′ )) where, for i = 1, 2, θ̃i′ : P̃i′ /K̃i → Ũ is the restriction of the isomorphism AGi (θi ) to the preimage P̃i′ /K̃i of Ũ = Aθ1 ∩ Aθ2 in P̃i /K̃i . Hence, as a subgroup of G1 × G2 , the product AG1 (θ1 ) ∗ AG2 (θ2 )op consists of those elements (a1 , a2 ) ∈ P̃1′ × P̃2′ with (a1 K̃1 )AG1 (θ1 ) = (a2 K̃2 )AG2 (θ2 ) . It follows that AG1 (θ1 ) ∗ AG2 (θ2 )op = NG1 ×G2 (θ), as desired.  As an immediate consequence, we can determine the normalizer index of a subgroup of G1 × G2 in terms of U-morphisms. Corollary 5.12. Let L = Π(θ1 , θ2 ) 6 G1 × G2 , for θi : Pi /Ki → U, i = 1, 2. Then |NG1 ×G2 (L) : L| = |CN1 (P1 )| |CN2 (P2 )| |Oθ1 ∩ Oθ2 | |Z(U)|−1 , where Ni = NGi (Ki)/Ki and Pi = Pi /Ki , i = 1, 2. Proof. By Lemma 5.2, |L| = |K1 | |K2 | |U|. With the notation from the preceding proof, |NG1 ×G2 (L)| = |K̃1 | |K̃2 | |Ũ|. Thus |NG1 ×G2 (L) : L| = |K̃1 | |K̃2 | |Ũ| . |K1 | |K2 | |U| ON THE TABLE OF MARKS OF A DIRECT PRODUCT OF FINITE GROUPS. 21 But |K̃i : Ki | = |CNi (Pi )|, i = 1, 2, by Definition 3.2. Moreover, |Ũ| = |Aθ1 ∩ Aθ2 | = |Inn(U)| |Oθ1 ∩ Oθ2 | and |U| = |Inn(U)| |Z(U)|.  6. Table of Marks We are now in a position to assemble the table of marks of G1 × G2 from a collection of smaller class incidence matrices. Theorem 6.1. Let G1 and G2 be finite groups. Then the table of marks of G1 × G2 is M(G1 × G2 ) = D · A(6K ) · A(6P/K ) · A(6P ), where D is the diagonal matrix with entries |NG1 ×G2 (L) : L|, for L running over a transversal of the conjugacy classes of subgroups of G1 × G2 . Proof. The proof is similar to that of Theorem 3.10 in combination with Corollary 5.4.  In the remainder of this section, we determine the block diagonal structure of each of the matrices A(6K ), A(6P/K ) and A(6P ) of G1 × G2 . 6.1. The class incidence matrix of the (G1 × G2 )-poset (SG1 ×G2 , 6K ) is a block diagonal matrix, with one block for each pair ([K1 ], [K2]) of conjugacy classes [Ki] of subgroups of Gi , i = 1, 2. Theorem 6.2. For Ki 6 Gi , i = 1, 2, denote by AK1 ,K2 the class incidence matrix of NG1 (K1 ) × NG2 (K2 ) acting on the subposet of (SG1 ×G2 , 6) consisting of those subgroups L with bottom groups ki (L) = Ki , i = 1, 2. Then M AK1 ,K2 . A(6K ) = [Ki ]∈SGi /Gi i=1,2 Proof. Let X = SG1 ×G2 and Y = SG1 × SG2 . We identify X with Z ⊆ X × Y, where Z := {(x, y) : (k1 (x), k2 (x)) = y}. Then Lemma 2.6 yields a partition of the conjugacy classes of subgroups of G1 × G2 indexed by [Ki] ∈ SGi /Gi , i = 1, 2. The stabilizer of y = (K1 , K2 ) ∈ Y is NG1 (K1 ) × NG2 (K2 ) and Zy = {x ∈ X : (k1 (x), k2 (x)) = y}. Let L 6 G1 × G2 be such that ki (L) = Ki, i = 1, 2. In order to count the (G1 × G2 )conjugates of a subgroup L ′ 6 G1 × G2 with bottom groups ki (L ′ ) = Ki , i = 1, 2, above L in the 6K -order, it suffices to note that L 6K (L ′ )g for some g ∈ G1 × G2 if and only if L 6K (L ′ )g for some g ∈ NG1 (K1 ) × NG2 (K2 ). Finally by the definition of 6K there are no incidences between subgroups with different Ki , giving the block diagonal structure.  Example 6.3. Let G1 = G2 = S3 . Then A(6K ) is the block sum of the matrices AK1 ,K2 in the table below, with rows and columns labelled by the conjugacy classes of subgroups K of S3 . Within AK1 ,K2 , the row label of a subgroup of the form P1 /K1 → P2 /K2 is just P1 → P2 , for brevity. The column labels are identical and have been omitted. K 1 2 3 S3 1 1→1 1 · · 2→2 9 1 · 2 · 1 3→3 S3 → S3 6 2 3 2→1 1 3→1 1 · S3 → 2 3 1 S3 → 1 1 2 · · · 1 3 1→2 1 2→2 1 3→2 S3 → 2 1 1 1→3 2 → S3 2→3 S3 1 3 · 1 1 3→3 1 · S3 → S3 1 1 S3 → 3 1 1 → S3 1 2 → S3 1 3 → S3 1 S3 → S3 1 22 BRENDAN MASTERSON AND GÖTZ PFEIFFER 6.2. The class incidence matrix of the (G1 ×G2 )-poset (SG1 ×G2 , 6P/K ) is a block diagonal matrix, with one block for each group U ⊆ Gi , i = 1, 2, up to isomorphism. Definition 6.4. For a finite group G and finite G-sets X1 and X2 , let Ai be a square matrix with rows and columns labelled by Xi , i = 1, 2. The action of G on X1 × X2 permutes the rows and columns of the Kronecker product A1 ⊗ A2 . If the matrices A1 and A2 are compatible with the G-action then so is their Kronecker product, and we define A1 ⊗G A2 := R(G) · (A1 ⊗ A2 ) · C(G), where the row summing and column picking matrices R(G) and C(G) have been constructed as in Lemma 2.7, with respect to the G-orbits on X1 × X2 . i For U ⊑ Gi , consider the class incidence matrices Ai = AG U (6) of the Gi -posets MGi (U), i = 1, 2, from Section 4.3. By Proposition 4.7, these matrices, and hence A1 ⊗ A2 , are compatible with the action of Out(U) on their rows and columns. Theorem 6.5. We have A(6P/K ) = M G2 1 AG U (6) ⊗Out(U) AU (6), U⊑G1 ,G2 i where, for U ⊑ Gi , AG U (6) is the class incidence matrix of the Gi -poset MGi (U), i = 1, 2. Proof. Let L ′ = (θ ′ : P1′ /K1′ → P2′ /K2′ ) be a subgroup of G1 ×G2 with Goursat type U and select U-morphisms θ1′ and θ2′ such that Π(θ1′ , θ2′ ) = θ ′ . By Lemma 5.8 (iv) the subgroups L of G1 × G2 with L >P/K L ′ correspond to pairs of sections (Pi , Ki) >P/K (Pi′ , Ki′ ), ′ ′ ′ i = 1, 2. For each such section (Pi , Ki), set θi = φ−1 i θi , where φi : Pi /Ki → Pi /Ki is the canonical isomorphism. By Proposition 4.4, θi : Pi /Ki → U is the unique U-morphism Pi ,Ki (U) with θi′ 6 θi . The number of conjugates Lx of a subgroup L of G1 × G2 in MG i with Lx >P/K L ′ is thus equal to the number of pairs (θ1 , θ2 ) ∈ MG1 (U) × MG2 (U) with θi′ 6 θi such that Π(θ1 , θ2 ) is a conjugate of L in G1 × G2 . Pi ,Ki (U) then, by Theorem 5.9, the set of all pairs of UIf L = Π(θ1 , θ2 ) for θi ∈ MG i morphisms mapping to a conjugate of L under Π is the Out(U)-orbit of [θ1 ]G1 × [θ2 ]G2 in MPG11,K1 (U)/G1 × MPG22,K2 (U)/G2 . The number of Gi -conjugates of θi above θi′ is given by i the entry a(θi , θi′ ) of the class incidence matrix AG U . By Proposition 4.2, the Aut(U)-set Pi ,Ki MGi (U)/Gi is isomorphic to Aut(U)/Aθi . Hence #{Lx >P/K L ′ : x ∈ G1 × G2 } = X a(θ1 α, θ1′ ) a(θ2 α, θ2′ ), α∈Tθ1 ,θ2 where Tθ1 ,θ2 is a transversal of the right cosets of Aθ1 ∩ Aθ2 in Aut(U). As Tθ1 ,θ2 can also be used to represent the right cosets of Oθ1 ∩ Oθ2 in Out(U), the same number appears G2 1 as the L, L ′ -entry of the matrix AG  U (6) ⊗Out(U) AU (6). Example 6.6. Let G1 = G2 = S3 . Then A(6P/K ) is the block sum of the following G2 1 matrices AG U (6) ⊗Out(U) AU (6). As Out(U) here acts trivially, the matrices are simply the Kronecker squares of the matrices AG U (6) in Example 3.16. The column labels are ON THE TABLE OF MARKS OF A DIRECT PRODUCT OF FINITE GROUPS. 23 identical to the row labels and have been omitted. G2 1 U AG U (6) ⊗Out(U) AU (6) 1 1/1 → 1/1 1/1 → 2/2 1/1 → 3/3 1/1 → S3 /S3 2/2 → 1/1 2/2 → 2/2 2/2 → 3/3 2/2 → S3 /S3 3/3 → 1/1 3/3 → 2/2 3/3 → 3/3 3/3 → S3 /S3 S3 /S3 → 1/1 S3 /S3 → 2/2 S3 /S3 → 3/3 S3 /S3 → S3 /S3 2 3 S3 1 3 1 1 3 9 3 3 1 3 1 1 1 3 1 1 · 1 · 1 · 3 · 3 · 1 · 1 · 1 · 1 · · · · · · · · · · 1 · · · · 1 1 · · · · · 1 · · · · 3 1 · 3 · 1 · 1 3 3 1 1 1 · · · · · · · · · · 1 · · · · 1 1 · · · · · 1 · · · · 3 1 · 1 · 1 · 1 1 1 1 1 1 2/1 → 2/1 1 1 2/1 → S3 /3 S3 /3 → 2/1 1 S3 /3 → S3 /3 1 3/1 → 3/1 · · · · · · · 1 · · · · · · · 1 · · · · · · · · 1 3 1 1 1 3 1 1 · · 1 · · 1 1 1 1 S3 /1 → S3 /1 · · · · · · · · · 1 · 1 · 1 · 1 · · · · · · · · · · 1 1 · · 1 1 · · · · · · · · · · · 1 · · · 1 · · · · · · · · · · · · 1 3 1 1 · · · · · · · · · · · · · 1 · 1 · · · · · · · · · · · · · · 1 1 · · · · · · · · · · · · · · · 1 · · · 1 1 Example 6.7. Continuing Example 4.8 for G = A5 and U = 3, we have  1 1   22 1· 1 G 1 1 AG , AG U (6) = U (6) ⊗Out(U) AU (6) =   2 1 1 1 2 1 1 · 1 1 · 1 illustrating the effect of a non-trivial Out(U)-action.  , 6.3. The class incidence matrix of the (G1 × G2 )-poset (SG1 ×G2 , 6P ) is a block diagonal matrix, with one block for each pair ([P1 ], [P2 ]) of conjugacy classes [Pi ] of subgroups of Gi , i = 1, 2. Theorem 6.8. For Pi 6 Gi , i = 1, 2, denote by AP1 ,P2 the class incidence matrix of NG1 (P1 ) × NG2 (P2 ) acting on the sub poset of (SG1 ×G2 , 6) consisting of those subgroups L with pi (L) = Pi , i = 1, 2. Then M AP1 ,P2 , A(6P ) = Pi ∈SGi /Gi , i=1,2 Proof. Similar to the proof of Theorem 6.2, with X = SG1 ×G2 , Y = SG1 ×SG2 Z = {(x, y) : (p1 (x), p2 (x)) = y} ⊆ X × Y.  Example 6.9. Again we let G1 = G2 = S3 . Then A(6P ) is the block sum of the matrices AP1 ,P2 in the table below, with rows and columns labelled by the conjugacy classes of subgroups P of S3 . Similar to Example 6.3, within AP1 ,P2 , the row label of a subgroup of the form P1 /K1 → P2 /K2 is just K1 → K2 , for brevity. The column labels are identical and have been omitted. P 1 2 3 S3 1→1 1 1→2 1 1→3 1 1 → S3 1 1 1→1 1 · 1→3 1 · 2→1 1 2→3 1 2 2→2 1 1 2 → S3 1 1 3 3→1 S3 S3 → 1 1 1 3→2 3→1 S3 → 2 1→1 3→3 1 1 1 · 1 S3 → 3 1 1 · 1 1 3 → S3 1→1 3→3 S3 → S3 1 1 1 1 · 1 1 · · 1 24 BRENDAN MASTERSON AND GÖTZ PFEIFFER Example 6.10. Combining the matrices from Examples 6.3, 6.6 and 6.9 according to Theorem 6.1, yields the table of marks M of S3 × S3 with rows and columns sorted by section size, as in Example 6.6:                   M=                36 18 12 6 18 9 6 3 12 6 4 2 6 3 2 1 18 6 6 2 12 6 · 6 · 6 · 3 · 3 · 2 · 2 · 1 · 1 · · · · · · · · 12 6 · · 6 3 · · 4 2 · · 2 1 · 6 · 2 · · · · · 6 · · · 3 · · · 2 · · · 1 · · · · · · · · · · 6 3 2 1 · · · · 6 3 2 1 · · · · · · · · · · · 1 · 1 · · · · · 1 · 1 · · · · · · · · · · · · 2 1 · · · · · · 2 1 · · · · · · · · · · · · · · · · · · · · 1 · · 12 · 6 · 4 · 2 · 6 · 3 · 2 1 1 · · · · · 6 · 2 · · · · · · · · · · · · · 2 · 2 · 1 · 1 · · · · · · · · · · · · · · · · · · · · · · · · · · 4 · 2 2 · · · · 2 · 1 1 · · · · · · 2 · · · · · · · · · · · · · · · · · 6 3 2 1 · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 1 · · 2 1 1 · · · · · · · · · · · · · · · · · · · · · · · · · · · 1 · · · · · · · · · · · 1 · 1 · · · · · 1 · 1 2 2 2 2 · 2 · · · · · · · 1 · · · · · · · 1 · 2 · 2 · · · · · · · · · · · · · · · · · · · · · · · · · · · · 1 · · · 1 1 · · · · 2 · 2 2 · · · · · · · · · · · · · · 4 2 · · 2 1 · · · 2 6 3 · · · · · · · · · · · · · · · 1 · · · 2 · 1                                 7. The Double Burnside Algebra of S3 As an application of the ideas from previous sections we now construct a mark homomorphism for the rational double Burnside algebra of G = S3 . 7.1. The Double Burnside Ring. Let G, H and K be finite groups. The Grothendieck group of the category of finite (G, H)-bisets is denoted by B(G, H). If (G, H)-bisets are identified with G × H-sets, then the abelian group B(G, H) is identified with the Burnside group B(G × H), and hence the transitive bisets [G × H/L], where L runs through a transversal of the conjugacy classes of subgroups of G × H, form a Z-basis of B(G, H). There is a bi-additive map from B(G, H) × B(H, K) to B(G, K) given by ([X], [Y]) 7→ [X] ·H [Y] = [X ×H Y]. Multiplication of transitive bisets is described by the following Mackey-formula. Proposition 7.1 ([3, 2.3.24]). Let L 6 G×H and M 6 H×K. Let X ⊆ H be a transversal of the (p2 (L), p1(M))-double cosets in H. Then X [(G × H)/L] ·H [(H × K)/M] = [(G × K)/(L(1,x) ∗ M)] x∈X With this multiplication, in particular, B(G, G) is a ring, the double Burnside ring of G. The rational double Burnside algebra QB(G, G) = Q ⊗Z B(G, G) is known to be semisimple, if and only if G is cyclic [3, Proposition 6.1.7]. Little more is known about the structure of QB(G, G) in general. ON THE TABLE OF MARKS OF A DIRECT PRODUCT OF FINITE GROUPS. 25 7.2. A Mark Homomorphism for the Double Burnside Ring of S3 . For the ordinary Burnside ring B(G), the table of marks of G is the matrix of the mark isomorphism βG : QB(G) → Qr between the rational Burnside algebra and its ghost algebra. It is an open question, whether there exist equivalent constructions of ghost algebras and mark homomorphims for the double Burnside ring. Boltje and Danz [2] have investigated the role of the table of marks of the direct product G × G in this context. Here, we use the decomposition of the table of marks of G × G from Theorem 6.1 and the idea of transposing the 6P part from Section 3.5 in order to build a satisfying ghost algebra for the group G = S3 . For this purpose, we first set up a labelling of the natural basis of QB(G, G) as follows. Set I = {1, . . . , 22}. Let {Li : i ∈ I} be the conjugacy class representatives from Example 5.10. Then the rational Burnside algebra QB(G, G) has a Q-basis consisting of elements bi = [G × G/Li ], i ∈ I, and multiplication defined by 7.1. By Theorem 6.1, the table of marks M of G × G is a matrix product M = D0 · A(6K ) · A(6P/K ) · A(6P ), of a diagonal matrix D0 with entries |NG×G (Li) : Li |, i ∈ I, and three class incidence matrices. For our purpose, we now modify this product and set M′ = 1 6 D0 · A(6K ) · A(6P/K ) · D1 · A(>P ) · D2 , where D1 = diag(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 6, 6, 6, 6, 1, 1, 6, 6, 1, 1), D2 = diag(1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 2, 6), are diagonal matrices. The resulting matrix is                  ′ M =                6 3 . 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 . 2 . . . . . . . . . . . . . . . . . . . 1 1 1 1 . . . . . . . . . . . . . . . . . . 3 3/2 . . . . . 3 3/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1/2 1/2 1 . 1 . 1 . 1 . . . . . . . . . . . . . . 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 . . . . . . . . . . . . . . 2 . . . . . . . 4 . . . . . . . . . . . . . 1 . . . . . 2 2/3 . . . . . . . . . . . . . 4/3 . 2/3 2/3 2/3 2/3 . . . . . . . . . . . . . . . . . . . . 1/3 . 2/3 . 2/3 . 1/3 1/3 1/3 1/3 . . . . . . . . 4/3 1 . . . 3 . . . 2 . . . 6 . . . . . . . . . 1/2 1/6 . . 3/2 1/2 . . 1 1/3 . . 3 1 . . . . . . . . 1/3 . 1/3 . . 2/3 . 2/3 . 1/6 1/6 1/6 1/2 1 1/2 . 1/6 1 1/2 1/2 1/3 1/3 1/3 1/3 2 1 . 2 1 1 . 1 . . . . . . . . . . . . . 3 . . . . 1 . . . . . . . . . . 1 . . . . 1 . 1 . . 1 . 1 . . . . . . . . 1 1 . . . . 1 1/3 . . . . . 1 1 . . . 1 2 2/3 . . . 1/3 . . 2/3 . . . 2 . 2 . . . 2 1 1 . 1 2 2 . 2 . . . . 2 . . . . . . . . . 2 . . . . . . . . . 2 . 1 . . . . 1 . . . . 1 . . . . . 1 . . . 1 1                                  ′ The matrix M ′ = (mij ) is obviously invertible, hence there are unique elements cj ∈ QB(G, G), j ∈ I, such that X ′ bi = mij cj , j∈I forming a new Q-basis of QB(G, G). 26 BRENDAN MASTERSON AND GÖTZ PFEIFFER ′ Theorem 7.2. Let G = S3 . Then the linear map βG×G : QB(G, G) → Q8×8 defined by   . . . . x1 x2 x3 x4  x5 x6 x7 x8 . . . .     x9 x10 x11 x12 . . . .    X   .  . . x . . . . 22 ′ , βG×G xi ci =   . . . . x17 x18 . .    i∈I   . . . . . x . . 22    . . . . . . x21 .  x13 x14 x15 x16 x19 x20 . x22 where ci ∈ QB(G, G) are defined as above, and xi ∈ Q, i ∈ I, is an injective homomorphism of algebras. Proof. This claim is validated by an explicit calculation, whose details we omit. The general strategy is as follows. For i ∈ I, let Ci be the matrix of ci in the right regular representation of QB(G, G) (computed with the help of the Mackey formula in Proposition 7.1). Let ≡ be the equivalence relation on I corresponding to the kernel of the map that sends the conjugacy class of a subgroup L = (P/K → P ′ /K ′ ) to the conjugacy class of the section P ′ /K ′ . Then ≡ partitions I as {{1, 5, 9, 13}, {2, 6, 10, 14}, {3, 7, 11, 15}, {4, 8, 12, 16}, {17, 19}, {18, 20}, {21}, {22}}. It turns out that all transposed matrices CTi are compatible with the equivalence ≡ in the sense of Section 2.5. Hence, after choosing a transversal of ≡, and using the corresponding row summing and column picking matrices R(≡) and C(≡), the map β ′ defined by β ′ (ci ) = C(≡)T · Ci · R(≡)T , i ∈ I, ′ is independent of the choice of transversal. In fact, β ′ = βG×G . By Lemma 2.7, β ′ (ci ck ) = C(≡)T · Ci · Ck · R(≡)T = β ′ (ci) · C(≡)T · Ck · R(≡)T = β ′ (ci ) · β ′ (ck ), ′ for i, k ∈ I, showing that βG×G = β ′ is a homomorphism. Injectivity follows from a dimension count.  It might be worth pointing out that the equivalence ≡, and hence the notion of compatibility and the map β ′ depend on the basis used for the matrices of the right regular representation. In the case G = S3 , the natural basis {bi } of QB(G, G) also yields compatible matrices, but the corresponding map β ′ is not injective. A base change under the table of marks of G × G gives matrices which are not compatible. Changing basis under the matrix product D0 · A(6K ) · A(6P/K ) · A(>P ) yields compatible matrices and ′ an injective homomorphism like M ′ does. Our matrices βG×G (ci ) have the added benefit of being normalized and extremely sparse, exposing other representation theoretic properties of the algebra QB(G, G), such as the following. Corollary 7.3. Let G = S3 and denote by J the Jacobsen radical of the rational Burnside algebra QB(G, G). (i) With ci as above, {ci : i = 4, 8, 12, 13, 14, 15, 16, 18, 19, 20} is a basis of J. ∼ Q3×3 ⊕ Q ⊕ Q ⊕ Q. (ii) QB(G, G)/J = ′ The map βG×G : QB(G, G) → Q8×8 can be regarded as a mark homomorphism for the double Burnside ring of G = S3 . It assigns to each (G, G)-biset a square matrix of rational marks. For example, for b20 = [(G × G)/L20 ] = 13 c1 + 31 c3 + c6 + c8 + 23 c9 + 32 c11 + 2c14 + 2c16 + c17 + c18 + 2c19 + 2c20 ON THE TABLE OF MARKS OF A DIRECT PRODUCT OF FINITE GROUPS. 27 we have      ′ βG×G (b20 ) =      1/3 . 2/3 . . . . . . 1 . . . . . 2 1/3 . 2/3 . . . . . . . . 1 . . . . . . . . . 1 1 . . . . . . 2 2 2 . . . . . . . . . . . . . . . .      ,     and the image of b22 = [G × G/G] = c1 + c6 + c11 + c17 + c21 + c22 is the identity matrix. While the case G = S3 provides only a small example, and the above construction involves some ad hoc measures, we expect that for many if not all finite groups G a mark homomorphism for the rational double Burnside algebra QB(G, G) can be constructed in a similar way. This will be the subject of future research. References [1] Robert Boltje and Susanne Danz, A ghost ring for the left-free double Burnside ring and an application to fusion systems, Adv. Math. 229 (2012), no. 3, 1688–1733. MR 2871154 [2] , A ghost algebra of the double Burnside algebra in characteristic zero, J. Pure and Appl. Algebra 217 (2013), no. 4, 608–635. MR 2983839 [3] Serge Bouc, Biset functors for finite groups, Lecture Notes in Mathematics, vol. 1990, SpringerVerlag, Berlin, 2010. MR 2598185 [4] Serge Bouc, Radu Stancu, and Jacques Thévenaz, Simple biset functors and double Burnside ring, J. Pure Appl. Algebra 217 (2013), no. 3, 546–566. MR 2974230 [5] William Burnside, Theory of groups of finite order, 2 ed., Cambridge University Press, Cambridge, 1911. MR 0069818 [6] Andreas Dress, A characterisation of solvable groups, Math. Z. 110 (1969), no. 3, 213 – 217. MR 0248239 [7] Édouard Goursat, Sur les substitutions orthogonales et les divisions régulières de l’espace, Ann. Sci. École Norm. Sup. 6 (1889), 9–102. [8] Bertram Huppert, Endliche Gruppen I, Die Grundlehren der Mathematischen Wissenschaften, Band 134, Springer-Verlag, Berlin-New York, 1967. MR 0224703 [9] Joachim Lambek, Goursat’s theorem and the Zassenhaus lemma, Canad. J. Math. 10 (1958), 45–56. MR 0098138 [10] Klaus Lux and Herbert Pahlings, Representations of groups: A computational approach, Cambridge University Press, Cambridge, 2010. MR 2680716 [11] Brendan Masterson, On the table of marks of a direct product of finite groups, Ph.D. thesis, National University of Ireland, Galway, 2016. [12] Liam Naughton and Götz Pfeiffer, Computing the table of marks of a cyclic extension, Math. Comp. 81 (2012), no. 280, 2419–2438. MR 2945164 [13] Götz Pfeiffer, The subgroups of M24 or How to compute the table of marks of a finite group, Experiment. Math. 6 (1997), no. 3, 247–270. MR 1481593 [14] Kári Ragnarsson and Radu Stancu, Saturated fusion systems as idempotents in the double Burnside ring, Geom. Topol. 17 (2013), no. 2, 839–904. MR 3070516 [15] Roland Schmidt, Untergruppenverbände direkter Produkte von Gruppen, Arch. Math. (Basel) 30 (1978), no. 3, 229–235. MR 0491982 [16] Giovanni Zacher, On the lattice of subgroups of the Cartesian square of a simple group, Rend. Sem. Mat. Univ. Padova 64 (1981), 235–241. MR 636640 28 BRENDAN MASTERSON AND GÖTZ PFEIFFER B.M.: Department of Design Engineering and Mathematics, Middlesex University, London, The Boroughs, London NW4 4BT, United Kingdom E-mail address: b.masterson@mdx.ac.uk G.P.: School of Mathematics, Statistics and Applied Mathematics, National University of Ireland, Galway, University Road, Galway, Ireland E-mail address: goetz.pfeiffer@nuigalway.ie
4math.GR
arXiv:1804.03206v1 [math.ST] 9 Apr 2018 Merging joint distributions via causal model classes with low VC dimension Dominik Janzing dominik.janzing@tuebingen.mpg.de Max Planck Institute for Intelligent Systems Max-Planck-Ring 4 72076 Tübingen, Germany April 9, 2018 Abstract If X, Y, Z denote sets of random variables, two different data sources may contain samples from PX,Y and PY,Z , respectively. We argue that causal inference can help inferring properties of the ‘unobserved joint distributions’ PX,Y,Z or PX,Z . The properties may be conditional independences (as in ‘integrative causal inference’) or also quantitative statements about dependences. More generally, we define a learning scenario where the input is a subset of variables and the label is some statistical property of that subset. Sets of jointly observed variables define the training points, while unobserved sets are possible test points. To solve this learning task, we infer, as an intermediate step, a causal model from the observations that then entails properties of unobserved sets. Accordingly, we can define the VC dimension of a class of causal models and derive generalization bounds for the predictions. Here, causal inference becomes more modest and better accessible to empirical tests than usual: rather than trying to find a causal hypothesis that is ‘true’ (which is a problematic term when it is unclear how to define interventions) a causal hypothesis is useful whenever it correctly predicts statistical properties of unobserved joint distributions. Within such a ‘pragmatic’ application of causal inference, some popular heuristic approaches become justified in retrospect. It is, for instance, allowed to infer DAGs from partial correlations instead of conditional independences if the DAGs are only used to predict partial correlations. I hypothesize that our pragmatic view on causality may even cover the usual meaning in terms of interventions and sketch why predicting the impact of interventions can sometimes also be phrased as a task of the above type. 1 Introduction The difficulty of inferring causal relations from purely observational data lies in the fact that the observations drawn from a joint distribution PX with X := {X1 , . . . , Xn } are supposed to imply statements about how the system behaves under interventions (Pearl, 2000; Spirtes et al., 1993). More specificly, one may be interested in the new joint distribution obtained by setting a subset X̃ ⊂ X of the variables to some specific values, which induces a different joint distribution. If the task of causal inference is phrased this way, it actually lies outside the typical domain of statistics. It thus requires assumptions that link statistics to causaliy 1 to render the task feasible under certain limitations. For instance, one can infer the causal directed acyclic graph (DAG) up to its Markov equivalence class from the observed conditional statistical independences (Spirtes et al., 1993; Pearl, 2000). Moreover, on can also distinguish DAGs in the same Markov equivalence class when certain model assumptions such as linear models with non-Gaussian noise (Kano and Shimizu, 2003) or non-linear additive noise (Hoyer et al., 2009) are made. Relevance of causal information without reference to interventions The goal of causal inference need not necessarily consist in predicting the impact of interventions. Instead, causal information could help for transferring knowledge accross data sets with different distributions (Schölkopf et al., 2012). The underlying idea is a modularity assumption (Peters et al., 2017) according to which only some conditional distribiutions in a causal Bayesian network may change and others remain fixed. Among many other tasks for which causal information could help, we should particularly emphasize so-called ‘integrative causal inference’ (Tsamardinos et al., 2012), which is the work that is closest to the present paper. Tsamardinos et al. (2012) use causal inference to combine knowledge from different data sets. The idea reads as follows: Given some data sets D1 , . . . , Dk containing observations from different, but overlapping sets S1 , . . . , Sk ⊂ {X1 , . . . , Xn } of variables. Then causal inference algorithms are applied independently to S1 , . . . , Sk . Afterwards, a joint causal model is constructed that entails independences of some other subsets of variables of which no joint observations are available (by slightly abusing terminology, we will refer to sets of variables that have not been observed together as ‘unobserved sets of variables’, but keep in mind that although they have not been observed jointly, they usually have been observed individually as part of some other observed set). To explain the idea more explicitly, we sketch Example 1 from Tsamardinos et al. (2012), which combines knowledge from just two data sets. D1 contains the variables X, Y, W for which one observes X ⊥ ⊥ W |Y and no further (conditional or unconditional) independences. The data set D2 contains the variables X, W, Z, where one observes X ⊥ ⊥ Q |Z as the only independence. Then one constructs the set of all Maximal Ancestral Graphs (MAGs)1 on the set X, Y, Z, W that is consistent with the observed pattern of independences. As a result, the MAG implies that X 6⊥ ⊥ Y , given any other subset of variables, although X and Y have never been observed together. From a higher-level perspective, the inference procedure thus reads: statistical properties of observed subsets ↓ causal models consistent with those ↓ statistical properties of unobserved subsets (1) In contrast to Tsamardinos et al. (2012), the term ‘statistical properties’ need not necessarily refer to conditional independences. On the one hand, there is meanwhile a broad variety of new approaches that infer causal directions from statistical properties other than conditional independences e.g., Kano and Shimizu (2003); Sun et al. (2006); Hoyer et al. (2009); 1 MAGs define a class of graphical causal models that is closed under marginalization and conditioning on subsets of variables Richardson and Spirtes (2002). 2 Zhang and Hyvärinen (2009); Daniusis et al. (2010); Janzing et al. (2009); Mooij et al. (2011); Peters et al. (2010); Mooij et al. (2016). On the other hand, the causal model inferred from the observations may entail statistical properties other than conditional independences – subject to the model assumptions on which the above-mentioned inference procedures rely. Regardless of what kind of statistical properties are meant, the scheme in (1) describes a sense in which a causal model that can be tested within the usual i.i.d. scenario. This way, a causal model entails statements that can be empirically tested without referring to an interventional scenario. Consequently, we drop the ambitious demand of finding ‘the true’ causal model and replace it with the more modest goal of finding causal models that properly predict unseen joint distributions. After reinterpreting causal inference this way, it also becomes directly accessible to statistical learning theory: assume we have a found a causal model that is consistent with the statistical properties of a large number of observed subsets, we can hope that it also correctly predicts properties of unobserved subsets provided that the causal model has been taken from a sufficiently ‘small’ class (to avoid overfitting). This ‘radical empirical’ point of view can be developed even further: rather than asking whether some statistical property like statistical independence is ‘true’, we only ask whether the test at hand rejects or accepts it.2 Hence we can replace the term ‘statistical properties’ in the scheme (1) with ’test results’. This point of view may also justify several common pragmatic solutions of the following issues: Linear causal models for non-linear relations Our perspective justifies to apply multivariate Gaussian causal models to data sets that are clearly non-Gaussian: Assume a hypothetical causal graph is inferred from the conditional independence pattern obtained via partial correlation tests (which is correct only for multivariate Gaussians), as done by common causal inference software TETRAD. Even if one knows that the graph only represents partial correlations correctly, but not conditional independences, it may predict well partial correlations of unseen variable sets. This way, the linear causal model can be helpful when the goal is only to predict linear statistics. This is good news particularly because general conditional independence tests remain a difficult issue, see, for instance, Zhang et al. (2011), for a recent proposal. Tuning of confidence levels There is also another heuristic solution of a difficult question in causal inference that can be justified: Inferring causal DAGs based on causal Markov condition and causal faithfulness (Spirtes et al., 1993) relies on setting the confidence levels for accepting conditional dependence. In practice, one will usually adjust the level such that enough independences are accepted and enough are rejected for the sample size at hand, otherwise inference is impossible. This is problematic, however, from the perspective of the common justification of causal faithfulness: if one rejects causal hypotheses with accidental conditional independences because they occur ‘with measure zero’ (Meek, 1995), it becomes questionable to set the confidence level high enough just because one wants ot get some independences accepted.3 Here we argue as follows instead: Assume we are given any arbitrary confidence level as threshold for the conditional independence tests. Further assume we have found a DAG G 2 Asking whether two variables are ’in fact’ statistically independent does not make sense for an empirical sample unless the sample is thought to be part of an infinite sample which is ridiculous in our finite world. 3 For a detailed discussion of how causal conclusions of several causal inference algorithms may repeatedly change after increasing the sample size see (Kelly and Mayo-Wilson, 2010). 3 from a sufficiently small model class that is consistent with all the outcomes ’reject/accept’ of the conditional independence tests on a large number of subsets S1 , . . . , Sk . It is then justified to assume that G will correctly predict the outcomes of this test for unobserved variable sets S˜1 , . . . , S̃l ⊂ S1 ∪ · · · ∪ Sk . Methodological justification of causal faithfulness In our learning scenarios, DAGs are used to predict for some choice of variables Xj1 , Xj2 , . . . , Xjk whether ⊥ Xj2 |Xj3 , . . . , Xjk . Xj1 ⊥ Without faithfulness, the DAG can only entail independence, but never entail dependence. Rather than stating that ’unfaithful distributions are unlikely’ we need faithfulness simply to obtain a definite prediction in the first place. The paper is structured as follows. Section 2 explains why causal models sometimes entail strong statements regarding the composition of data sets. This motivates to use causal inference as an intermediate step when the actual task is to predict properties of unobserved joint distributions. Section 3 formalizes our scenario as a standard prediction task where the input is a subset (or an ordered tuple) of variables, for which we want to test some statistical property. The output is a statistical property of that subset (or tuple). This way, each observed variable set defines a training point for inferring the causal model while the unobserved variable sets are the test instances. Accordingly, classes of causal models define function classes, as described in Section 4, whose richness can be measured via VC dimension. By starightforward application of VC learning theory, Section 5 derives error bounds for the predicted statistical properties and discusses how they can be used as guidance for constructing causal hypotheses from not-too-rich classes of hypotheses. In Section 6 we argue that our use of causal models is linked to the usual interpretation of causality in terms of interventions, which raises philosophical questions of whether the empirical content of causality reduces to providing rules on how to merge probability distributions. 2 Why causal models are particularly helpful It is not obvious why inferring properties of unobserved joimnt distributions from observed ones should take the ‘detour’ via causal models visualized in (1). One could also define a class of statistical models (that is, a class of joint distributions without nay causal interpretation) that is sufficiently small to yield definite predictions for the desired properties. The below example, however, suggests that causal models typically entail particularly strong predictions regarding properties of the joint distribution. This is, among other reasons, because causal models on subsets of variables sometimes imply a simple joint causal model. To make this point, consider the following toy example. Example 1 (merging two cause-effect pairs to a chain). Assume we are given variables X, Y, Z where we observed PX,Y and PY,Z . The extension to PX,Y,Z is heavily underdetermined. Now assume that we have the additional causal information that X causes Y and Y causes Z (see Figure 1, left), in the sense that both pairs are causally sufficient. In other words, neither X and Y nor Y and Z have a common cause. This information can be the result of some bivariate causal inference algorithm that is able to exclude confunding. Given that there is, for instance, an additive noise model from Y to Z (Kano and Shimizu, 2003; Hoyer et al., 2009), 4 X Y     Y Z     ⇒ X Y Z ⇒ X⊥ ⊥ Z |Y PX,Y,Z = PX,Y PZ|Y Figure 1: Simplest example where causal information allows to ‘glue’ two distributions two a unique joint distribution. a confounder is unlikely because it would typically destroy the independence of the additive noise term. Entire causal structure: We can then infer the entire causal structure to be the causal chain X → Y → Z for the following reasons. First we show that X, Y, Z is a causally sufficient set of variables: A common cause of X and Z would be a common cause of Y and Z, too. The pair (X, Y ) and (Y, Z) both have no common causes by assumption. One checks easily that no DAG with 3 arrows leaves all 3 pairs unconfounded. Checking all DAGs on X, Y, Z with 2 arrows that have a path from X to Y and from Y to Z, we end up with the causal chain in Figure 1, middle, as the only option. Resulting joint distribution: This implies X ⊥ ⊥ Z |Y. Therefore, PX,Y,Z = PX,Y PZ|Y . Note that our presentation of Example 1 neglected a subtle issue. There are several different notions of what it means that X causes Y in a causally sufficient way: We have above used the purely graphical criterion asking whether there is some variable Z having directed paths to X and Y . An alternative option for defining that X influences Y in a do(X=x) causally sufficient way would be to demand that PY = PY |X=x . This condition is called ‘interventional sufficiency’ in Peters et al. (2017), a condition that is testable by interventions on X without referring to a larger background DAG in which X and Y are embedded. This condition, however, is weaker than the graphical one and not sufficient for the above argument. This is because one could add the link X → Z to the chain X → Y → Z and still observe that do(Y =y) PZ = PZ|Y =y , as detailed by Example 9.2 in Peters et al. (2017). Therefore, we stick to the graphical criterion of causal sufficiency and justify this by the fact that for ‘generic’ parameter values it coincides with interventional sufficiency (which would actually be the more reasonable criterion). Causal marginal problem vs. probabilistic marginal problem Given marginal distributions PS1 , . . . , PSk on sets of variables, the problem of existence and uniqueness of the joint distribution PS1 ∪···∪Sk (consistent with the marginals) is usually referred to as marginal problem (Vorob’ev, 1962; Kellerer, 1964). Here we will call it the probabilistic marginal problem. Motivated by this terminology, we informally inroduce the causal marginal problem as follows. Given distributions PS1 , . . . , PSk together with causal models M1 , . . . , Mk , is there a unique joint distribution PS1 ∪···∪Sk with causal model M (consistent with the marginal model). The definition is informal because we have not specified our notion of ‘causal model’. Neither did we specify marginalization of causal models. For DAGs, marginalization requires the more general graphical model class MAGs (Richardson and Spirtes, 2002) already mentioned above, while marginalization of sructural equations require structural equations with 5 dependent noise terms (Rubenstein et al., 2017). Without formalizing this claim, Example 1 suggests that the causal marginal problem may have a unique solution even when the (probabilistic) marginal problem doesn’t (Janzing, 2016). The procedure for constructing the joint distribution in Example 1 can be described by the following special case of the scheme in (1): statistical properties of observed subsets ↓ causal model for observed subsets ↓ joint causal model ↓ statistical properties of unobserved subsets (2) Whether or not the joint causal model is inferred by first inferring ‘marginal’ causal models for whether it is directly inferred from statistical properties of marginal disributions will be irrelevant in our further discussion. In Example 1, the detour over marginal causal models has been particularly simple. 3 The formal setting Below we will usually refer to some given set of variables S := {Xj1 , . . . , Xjk } whose subsets are considered. Whenever this cannot cause any confusion, we will not carefully distinguish between the set S and the vector X := (Xj1 , . . . , Xjk ) and also use the term ’joint distribution PS ’ although the order of variables certainly matters. 3.1 Statistical properties Statistical properties are the crucial concept of this work. On the one hand, they are used to infer causal structure. On the other hand, causal structure is used to predict them. Definition 1 (statistical property). A statistical property Q with range Y is given by a function Q : PY1 ,...,Yk → Y where PY1 ,...,Yk denotes the joint distribution of k variables under consideration and Y some output space. Often we will consider binary or real-valued properties, that is Y = {0, 1}, Y = {−1, +1}, or Y = R, respectively. By slightly abusing terminology, the term ‘statistical property’ will sometimes refer to the value in Y that is the output of Q or to the function Q itself. This will, hopefully, cause no confusion. Here, Q may be defined for fixed size k or for general k. Moreover, we will consider properties that depend on the ordering of the variables Y1 , . . . , Yk , those that do not depend on it, or those that are invariant under some permutations k variables. This will be clear from the context. We will be refer to k tuples for which part of the order matters as ‘partly ordered tuples’. To given an impression about the variety of statistical properties we conclude the section with a list of examples. We start with an example for a binary property that does not refer to an ordering: 6 Example 2 (statistical independence).  1 Q(PY1 ,...,Yk ) = 0 for Yj jointly independent otherwise The following binary property allows for some permutations of variables: Example 3 (conditional independence).  1 for Q(PY1 ,...,Yk ) = 0 otherwise Y1 ⊥ ⊥ Y2 |Y3 , . . . , Yk To emphasize that our causal models are not only used to predict conditional independences but also other statistical properties we also mention linear additive noise models Kano and Shimizu (2003): Example 4 (existence of linear additive noise models). Q(PY1 ,...,Yk ) = 1 if and only if there is a matrix A with entries Aij , that is lower triangular after permutation of basis vectors, such that X Yi = Aij Yj + Nj , (3) j<i where N1 , . . . , Nk are jointly independent noise variables. If no such additive linear model exists, we set Q(PY1 ,...,Yk ) = 0. Lower triangularity means that there is a DAG such that A has non-zero entries Aij whenever there is an arrow from j to i. Here, the entire order of variables matters. Then (3) is a linear structural equation. Whenever the noise variables Nj are non-Gaussian, linear additive noise models allow for the unique identification of the causal DAG (Kano and Shimizu, 2003) if one assumes that the true generating process has been linear. Then, Q(PY1 ,...,Yk ) = 1 holds for those orderings of variables that are compatible with the true DAG. This way, we have a statistical propery that is directly linked to the causal structure (subject to a strong assumption, of course). The following simple binary property will also play a role later: Example 5 (sign of correlations). Whether a pair of random variables is positively or negatively correlated defines a simple binary property in a scenario where all variables are correlated:  1 if cov(Y1 , Y2 ) > 0 Q(PY1 ,Y2 ) = −1 if cov(Y1 , Y2 ) < 0 Finally, we mention a statistical property that is not binary but positive-semidefinite matrix-valued: Example 6 (covariances and correlations). For k variables Y1 , . . . , Yk let Y be the set of positive semi-definite matrices. Then define Q : PY1 ,...,Yk 7→ ΣY1 ,...,Yk , where ΣY1 ,...,Yn denotes the joint covariance matrix of Y1 , . . . , Yn . For k = 2, one can also get a real-valued property by focusing on the off-diagonal term. One may then define a map Q Q(PY1 ,Y2 ) := cov(Y1 , Y2 ), or alternatively, if one prefers correlations, define Q(PY1 ,Y2 ) := corr(Y1 , Y2 ). 7 3.2 Statistical and causal models The idea of this paper is that causal models are used to predict statistical properties, but a priori, the models need not be causal. One can use Bayesian networks, for instance, to encode conditional statistical independences with or without interpreting the arrows as formalizing causal influence. For the formalism introduced in this section it does not matter whether one interprets the models as causal or not. Example 1, however, suggested that model classes that come with a causal semantics are particularly intuitive regarding the statistical properties they predict. We now introduce our notion of models: Definition 2 (models for a statistical property). Given a set S := {X1 , . . . , Xn } of variables and some statistical property Q, a model M for Q is a class of joint distributions PX1 ,...,Xn that coincide regarding the output of Q, that is, Q(PY1 ,...,Yn ) = Q(PY0 1 ,...,Yn ) ∀PY1 ,...,Yn , PY0 1 ,...,Yn ∈ M, where Y1 , . . . , Yk ∈ S. Accordingly, the property QM predicted by the model M is given by a function (Y1 , . . . , Yk ) 7→ QM [(Y1 , . . . , Yk )] := Q(PY1 ,...,Yn ), for all PX1 ,...,Xn in M , where (Y1 , . . . , Yk ) runs over all allowed input (partly ordered) tuples of Q. Formally, the ‘partly ordered tuples’ are equivalence classes in S k , where equivalence corresponds to irrelevant reorderings of the tuple. To avoid cumbersome formalism, we will just refer to them as ‘the allowed inputs’. Later, such a model will be, for instance, a DAG G and the property Q formalizes all conditional independences that hold for the respective Markov equivalence class. To understand the above terminology, note that Q receives a distribution as input and the output of Q tells us the respective property of the distribution (e.g. whether independence holds). In contrast, QM receives a set of nodes (variables) of the DAG as inputs and tells us the property entailed by M . The goal will be to find a model M for which QM and Q coincide for the majority of observed tuples of variables. Our most prominent example reads: Example 7 (DAG as model for conditional independences). Let G be a DAG with nodes S := {X1 , . . . , Xn } and Q be the set of conditional independences as in Example 3. Then, let QG be the function on k-tuples from S defined by QG [(Y1 , . . . , Yk )] := 0 if and only if the Markov condition implies Y1 ⊥ ⊥ Y2 |Y3 . . . , Yk , and QG [(Y1 , . . . , Yk )] := 1 otherwise. Note that QG (.) = 1 does not mean that the Markov condition implies dependence, it only says that it does not imply independence. However, if we think of G as a causal DAG, the common assumption of causal faithfulness (Spirtes et al., 1993) states that all dependences that are allowed by the Markov condition occur in reality. Adopting this assumption, we will 8 therefore interpret QG as a function that predicts dependence or independence, instead of making no prediction otherwise. We also mention a particularly simple class of DAGs that will appear as an interesting example later: Example 8 (DAGs consisting of a single colliderfree path). Let G be the set of DAGs that consist of a single colliderfree path Xπ(1) − Xπ(2) − Xπ(3) − · · · − Xπ(n) , where the directions of the arrows are such that there is no variable with two arrowheads. Colliderfree paths have the important property that any dependence between two non-adjacent nodes is screened off by any variable that lies between the two nodes, that is, Xj ⊥ ⊥ Xk | Xl , whenever Xl lies between Xj and Xk . If one assumes, in addition, that the joint distribution is Gaussian, then the partial correlation between Xj and Xk , given Xl , vanishes. Then one can show that the correlation coefficient of any two nodes is given by the product of pairwise correlations along the path: π −1 (k)−1 corr(Xj , Xk ) = Y π −1 (k)−1 corr(Xπ(i) , Xπ(i+1) ) =: i=π −1 (j) Y ri . (4) i=π −1 (j) This follows easily by induction because corr(X, Z) = corr(X, Y )corr(Y, Z) for any three variables X, Y, Z with X ⊥ ⊥ Z |Y . Therefore, such a DAG, together with all the correlations between adjacent nodes, predicts all pairwise correlations. We therefore specify our model by M := (π, r), that is, the ordering of nodes and correlations of adjacent nodes. The following example shows that a DAG can entail also properties that are more sophisticated than just conditional independences and correlations: Example 9 (DAGs and linear non-Gaussian additive noise). Let G be a DAG with nodes S := {X1 , . . . , Xn } and Q be the linear additive noise property in Example 4. Let QG be the function on k-tuples from S defined by QG ((Y1 , . . . , Yk )) := 1 if and only if the following two conditions hold: (1) Y1 , . . . , Yk is a causally sufficient subset from S in G and, that is, no two different Yi , Yj have a common ancestor in G (2) the ordering Y1 , . . . , Yk is consistent with G, that is, Yj is not ancestor of Yi in G for any i < j. Example 4 predicts from the graphical structure whether the joint distribution of some subset of variables admits a linear additive noise model. The idea is the following. Assuming that the entire joint distribution of all n variables has been generated by a linear additive noise model (Kano and Shimizu, 2003), any k-tuple (Y1 , . . . , Yk ) also admits a linear additive noise model provided that (1) and (2) hold. This is because marginalizations of linear additive noise 9 models remain linear additive noise models whenever one does not marginalize over common ancestors.4 Hence, conditions (1) and (2) are clearly sufficient. For generic parameter values of the underlying linear model the two conditions are also necessary because linear non-Gaussian models render causal directions uniquely identifiable and also admit the detection of hidden common causes (Hoyer et al., 2008). 3.3 Testing properties on data So far we have introduced statistical properties as mathematical properties of distributions. In real-world applications, however, we want to predict the outcome of a test on empirical data. The task is no longer to predict whether some set of variables is ‘really’ conditionally independent, we just want to predict whether the statistical test at hand accepts independence. Whether or not the test is appropriate for the respective mathematical property Q is not relevant for the generalization bounds derived later. If one infers DAGs, for instance, by partial correlations and uses these DAGs only to infer partial correlations, it does not matter that non-linear relations actually prohibit to replace conditional independences with partial correlations. The reader may get confused by these remarks because now there seems to be no requirement on the tests at all if it is not supposed to be a good test for the mathematical property Q. This is a difficult question. One can say, however, that for a test that is entirely unrelated to some property Q we have no guidance what outcomes of our test a causal hypothesis should predict. The fact that partial correlations, despite all their limitations, approximate conditional independence, does provide some justification for expecting vanishing partial correlations in many cases where there is d-separation in the causal DAG. We first specify the information provided by a data set. Definition 3 (data set). Each data set Dj is an lj × kj matrix of observations, where lj denotes the sample size and kj the number of variables. Further, the dataset contains a kj tuple of values from {1, . . . , n} specifying the kj variables Y1 , . . . , Ykj ⊂ {X1 , . . . , Xn } the samples refer to. To check whether the variables under consideration in fact satisfy the property predicted by the model we need some statistical test (in the case of binary properties) or an estimator (in the case of real-valued or other properties). Let us say that we are given some test / estimator for a property Q, formally defined as follows: Definition 4 (statistical test / estimator for Q). A test (respective estimator for non-binary properties) for the statistical property Q with range Y is a map QT : D 7→ QT (D) ∈ Y, where D is a data set that involves the observed instances of Y1 , . . . , Yn , where (Y1 , . . . , Yk ) is a partly ordered tuple that defines an allowed input of Q. QT (D) is thought to indicate the outcome of the test or the estimated value, respectively. 3.4 Phrasing the task as standard prediction problem Our learning problem now reads: given the data sets D1 , . . . , Dl with the k-tuples S1 , . . . , Sl of variables, find a model M such that QM (Sj ) = QT (Dj ) for all data sets j = 1, . . . , l or, less 4 Note that the class of non-linear additive noise models (Hoyer et al., 2009) is not closed under marginalization. 10 demanding, for most of the data sets. However, more importantly, we would like to choose M such that QM (Sj ) = QT (Dl+1 ) will also hold for a future data set Dl+1 . The problem of constructing a causal model now becomes a standard learning problem where the training as well as the test examples are data sets. Note that also Lopez-Paz et al. (2015) phrased a causal inference problem as standard learning problem. There, the task was to classify two variables as ‘cause’ and ‘effect’ after getting a large number of cause-effect pairs as training examples. Here, however, the data sets refer to observations from different subsets of variables that are actually assumed to follow a joint distribution over the union of all variables occuring in any of the data sets. Having phrased our problem as a standard prediction scenario whose inputs are subsets of variables, we now introduce the usual notion of empirical error on the training data accordingly: Definition 5 (empirical error). Let Q be a statistical property, QT a statistical test, and D := {D1 , . . . , Dk } a collection of data sets referring to the variable tuples S1 , . . . , Sk . Then the empirical training error of model M is defined by k 1X L(M ) := |QT (Dj ) − QM (SDj )|. k j=1 Finding a model M for which the training error is small does not guarantee, however, that the error will also be small for future test data. If M has been chosen from a ‘too rich’ class of models, the small training error may be a result of overfitting. Fortunately we have phrased our learning problem in a way that the richness of a class of causal models can be quantified by standard concepts from statistical learning theory. This will be discussed in the following section. 4 Capacity of classes of causal models We have formally phrased our problem as a prediction problem where the task is to predict the outcome in Y of QT for some test T applied to an unobserved variable set. We now assume that we are given a class of models M defining statistical properties (QM )M ∈M that are supposed to predict the outcomes of QT . 4.1 Binary properties Given some binary statistical property, we can straightforwardly apply the notion of VCdimension Vapnik (1998) to classes M and define: Definition 6 (VC dimension of a model class for binary properties). Let S := {X1 , . . . , Xn } a set of variables and Q be a binary property. Let M be a class of models for Q, that is, each M ∈ M defines a map QM : (Y1 , . . . , Yk ) 7→ QM [(Y1 , . . . , Yk )] ∈ {0, 1}. Then the VC dimension of M is the largest number h such that there are h allowed inputs S1 , . . . , Sh for QM such that the restriction of all M ∈ M to S1 , . . . , Sh runs over all 2h possible binary functions. 11 Since our model classes are thought to be given by causal hypotheses the following class is our most important example although we will later further restrict the class to get stronger generalization bounds: Lemma 1 (VC dimension of conditional independences entailed by DAGs). Let G be the set of DAGs with nodes X1 , . . . , Xn . For every G ∈ G, we define QG as in Example 7. Then the VC dimension h of (QG )G∈G satisfies h ≤ n log2 n + n(n − 1)/2 ∈ O(n2 ). (5) Proof. The number Nn of DAGs on n labeled nodes can easily be upper bounded by the number of orderings times the number of choices to draw an edge or not. This yields Nn < n!2n(n−1)/2 . Using Stirling’s formula we obtain  n n √ n! < e1/(12n) 2πn < nn , e and thus Nn < nn 2n(n−1)/2 . Since the VC dimension of a class cannot be larger than the binary logarithm of the number of elements it contains, (5) easily follows. Note that the number of possible conditional independence tests of the form Y1 ⊥ ⊥ Y2 |Y3 already grows faster than the VC dimension, namely with the third power. Therefore, the class of DAGs is sufficiently restrictive since it is not able to explain all possible patterns of conditional (in)dependences even when one conditions on one variable only. Nevertheless, the set of all DAGs may be too large for the number of data sets at hand. We therefore mention the following more restrictive class given by so-called polytrees, that is, DAGs whose skeleton is a tree (hence they contain no undirected cycles). Lemma 2 (VC dimension of cond. independences entailed by polytrees). Let G be the set of polyntrees with nodes X1 , . . . , Xn . For every G ∈ G, we define QG as in Example 7. Then the VC dimension h of (QG )G∈G satisfies h ≤ n − 1. (6) Proof. According to Cayley’s formula, the number of trees with n nodes reads nn−2 Aigner and Ziegler (1998). The number of Markov equivalence classes of polytrees can be bounded from above by 2n−1 − n + 1 Radhakrishnan et al. (2017). Again, the bound follows by taking the logarithm. We will later use the following result: Lemma 3 (VC dimension of sign of correlations along a path). Consider the set of DAGs on X1 , . . . , Xn that consist of a single colliderfree path as in Example 8. The sign of pairwise correlations is the determined by the permutation π that aligns the graph and the sign of correlations of all adjacent pairs. We thus parameterize a model by M := (π, s) where the vector s := (s1 , . . . , sn ) denotes the signs of adjacent nodes. The full model class M is obtained when π runs over the entire group of permutations and s over all combinations in {−, 1 + 1}n . Let Q be the property indicating the sign of the correlation of any two variables as in Example 5. Then the VC dimension of (QM )M ∈M is at most n. 12 Proof. Defining π −1 (j)−1 sj := Y sign(corr(Xπ(i) , Xπ(i+1) )) i=1 we obtain sign(corr(Xi , Xj )) = si sj , due to (4). Therefore, the signs of all can be computed from s1 , . . . , sn . Since there are 2n possible assignments for these values, G thus induces 2n functions and thus the VC dimension is at most n. 4.2 Real-valued statistical properties We also want to obtain quantitative statements about the strength of dependences and therefore consider also the correlation as an example of a real-valued property. Lemma 4 (correlations along a path). Let M be the model class whose elements M are colliderfree paths where the correlations of adjacent nodes are specified, see Example 8. As already explained, this specification determines uniquely all pairwise correlations and we can thus define the model induced property QM [(Xj , Xk )] := corrM (Xj , Xk ), where the term on the right hand side denotes the correlation determined by the model M := (π, r) as introduced in Example 8. Then the VC dimension of (QM )M ∈M is in O(n). Proof. We assume, for simplicity, that all correlations are non-zero. To specify the absolute value of the correlation between adjacent nodes we define the parameters βi := log |corrM (Xπ(i−1) , Xπ(i) )|. To specify the sign of those correlations we define the binary values  1 for corrM (Xπ(i−1) , Xπ(i) ) < 0 gi := , 0 otherwise for all i ≥ 2. It will be convenient to introduce the parameters αj := j X βi , i=2 which are cumulative versions of the ‘adjacent log correlations’ βi . Likewise, we introduce the binaries ! j X sj := gi mod 2, i=2 which indicate whether the number of negative correlations along the chain from its beginning is odd or even. 13 This way, the correlations between any two nodes can be computed from α and s: sπ−1 (j) +sπ−1 (k) |απ−1 (j) −απ−1 (k) | corrM (Xj , Xk ) = (−1) e . For technical reasons we define corr formally as a function of ordered pairs of variables although it is actually symmetric in j and k. We are interested in the VC dimension of the family F := (fM )M ∈M of real-valued functions defined by fM (j, k) := corrM (Xj , Xk ) =: ρM i,j . Its VC-dimension is defined as the VC dimension of the set of classifiers C := (cγM )M,γ with  1 for ρM γ j,k ≥ γ , cM (j, k) := 0 otherwise To estimate the VC dimension of C we compose it from classifiers whose VC dimension is easier to estimate. We first define the family of classifiers given by C > := (c>θ α )α∈R− ,θ∈R with  1 for απ−1 (j) − απ−1 (k) ≥ θ >θ cα (j, k) := . 0 otherwise Likewise, we define C < := (c<θ α )α∈R− ,θ∈R with  1 for απ−1 (j) − απ−1 (k) < θ <θ cα (j, k) := . 0 otherwise The VC dimensions pf C > and C < are at most n+1 because they are given by linear functions on the space of all possible α ∈ Rn (Vapnik, 1995), Section 3.6, Example 1. Further, we define a set of classifiers that classify only according to the sign of the correlations: M S := (cM + ) ∪ (c− ), where cM + (j, k) :=  1 0 if ρM j,k ≥ 0 . otherwise  1 0 if ρM j,k < 0 . otherwise Likewise, we set cM − (j, k) := Since both components of S have VC dimension n at most, the VC dimension of S is in O(n). For γ > 0, ρM j,k ≥ γ is equivalent to (ρM j,k ≥ 0) ∧ (απ −1 (j) − απ −1 (k) ≥ log γ) ∧ (απ −1 (k) − απ −1 (j) ≥ log γ). Therefore, cγM ∈ S u C > u C < , for all γ > 0, where u denotes the intersection of ‘concept classes’ (van der Wart and Wellner, 2009) given by C1 u C2 := (c1 ∩ c2 )c1 ∈C1 ,c2 ∈C2 . 14 Likewise, the union of concept classes is given by C1 t C2 := (c1 ∪ c2 )c1 ∈C1 ,c2 ∈C2 , as opposed to the set-theoretic unions and intersections. For γ < 0, ρM j,k ≥ γ is equivalent to  (ρM j,k ≥ 0) ∨ (aπ −1 (j) − απ −1 (k) ≥ log |γ|) ∧ (απ −1 (k) − απ −1 (j) ≥ log |γ|) . Hence, cγM ∈ S t [C > u C < ], for all γ < 0. We then obtain: C ⊂ (S u C > u C < ) ∪ (S t [C > u C < ]). Hence, C is a finite union and intersection of concept classes and set theoertic union, each having VC dimension in O(n). Therefore, C has VC dimension in O(n) (van der Wart and Wellner, 2009). 5 Generalization bounds 5.1 Binary properties After we have seen that in our scenario causal models like DAGs define classifiers in the sense of standard learning scenarios, we can use the usual VC bounds like Theorem 6.7 in Vapnik (2006) to guarantee generalization to future data sets. To this end, we need to assume that the data sets are sampled from some distribution of data sets, an assumption that will be discussed at the end of this section. Theorem 5 (VC generalization bound). Let QT be a statistical test for some statistical binary property and M be a model class with VC dimension h defining some model-induced property QM . Given k data sets D1 , . . . , Dk sampled from distribution PD . Then s  k η h ln 2k 1X h + 1 − ln 9 E [|QT (D) − QM (D)|] ≤ |QT (Dj ) − QM (SDj )| + 2 (7) k k j=1 with probability 1 − η. It thus suffices to increase the number of data sets slightly faster than the VC dimension. To illustrate how to apply Theorem 5 we recall the class of polytrees in Lemma 2. An interesting property of polytrees is that every pair of non-adjacent nodes can already be rendered conditional independent by one appropriate intermediate node. This is because there is always at most one (undirected) path connecting them. Moreover, for any two nodes X, Y that are not too close together in the DAG, there is a realistic chance that some randomly chosen Z satisfies X ⊥ ⊥ Y |Z. Therefore, we consider the following scenario: 1. Draw k triples (Y1 , Y2 , Y3 ) uniformly at random and check whether Y1 ⊥ ⊥ Y2 |Y3 . 2. Search for a polytree G that is consistent with the k observed (in)dependences. 15 5e+05 4e+05 3e+05 2e+05 1e+05 0e+00 number of independence tests * * * * * * * * * * * * ** * * ** * * ** * * ** * ** ** * ** ** * * ** *** * * **** *** **************** ** * ** ** * ** ** * ** ** ** * ********************** **** ** ** **** ** ** * ** * ** * ** * ** ** * ******** ***** ************** **************** ** ************** 0 20 40 60 80 100 number of nodes Figure 2: The red curce shows how the number of tests required by the VC bound grows with the number of variables, while the blue one shows how the number of possible tests grows. 3. Predict conditional independences for unobserved triples via G Since the number of points in the training set should increase slightly faster than the VC dimension (which is O(n), see Lemma 2), we know that a small fraction of the possible independence tests (which grows with third power) is already sufficient to predict conditional further independences. The red curve in Figure 2 provides a rough estimate of how k needs to grow if we want √ to ensure that the term . in (7) is below 0.1 for η = 0.1. The blue curve shows how the number of possible tests grows, which significantly exceeds the required ones after n = 40. For more than 100 variables, only a fraction of about 1/4 of the possible tests is needed to predict that also the remaining ones will hold with high probability. While conditional independences have been used for causal inference already since decades, more recently it became popular to use other properties of distributions to infer causal DAGs. In particular, several methods have been proposed that distinguish between cause and effect from bivariate distributions, e.g., Kano and Shimizu (2003); Hoyer et al. (2009); Zhang and Hyvärinen (2009); Daniusis et al. (2010); Peters et al. (2011); Lopez-Paz et al. (2015); Mooij et al. (2016). It is tempting to do multivariate causal inference by finding DAGs that are consistent with the bivariate causal direction test. This motivates the following example. 16 Lemma 6 (bivariate directionality test on DAGs). Let G be the class of DAGs on n nodes for which there is a directed path between all pairs of nodes. Define a model-induced property QG by  1 iff there is a directed path from Xi to Xj QG (Xi , Xj ) := −1 iff there is a directed path from Xj to Xi The VC-dimension of (QG )G∈G is at most n − 1. Proof. The VC dimension is the maximal number h of pairs of variables for which the causal directions can be oriented in all 2h possible ways. If we take n or more pairs, the undirected graph defined by connecting each pair contains a cycle (X1 , X2 ), (X2 , X3 ), . . . , (Xl−1 , Xl ), (Xl , X1 ), with l ≤ n. Then, however, not all 2l causal directions are possible because X1 → X2 → · · · Xl → X1 would be a directed cycle. This result can be used to infer causal directions for pairs that have not been observed together: 1. Apply the bivariate causality test QT to k randomly chosen ordered pairs, where k needs to grow slightly faster than n. 2. Search for a DAG G ∈ G that is consistent with a last fraction of the outcomes. 3. Infer the outcome of further bivariate causality tests from G. It is remarkable that the generalization bound holds regardless of how bivariate causality is tested and whether one understands which statistical features are used to infer the causal direction. Solely the fact that a causal hypothesis from a class of low VC dimension matches the majority of the bivariate tests ensures that it generalizes well to future tests. 5.2 Real-valued properties The VC bounds in Subsection 5.1 referred to binary statistical properties. To consider also real-valuedd properties note that the VC dimension of class of real-valued functions (fλ )λ∈Λ with f : X → R is defined as the VC dimension of the set of binary functions, see Section 3.6 Vapnik (1995):  fλ−1 ((−∞, r]) λ∈Λ,r∈R . By combining (3.15) with (3.14) and (3.23) in Vapnik (1995) we obtain: Theorem 7 (VC bound for real-valued statistical properties). Let (QM )M ∈M be a class of [A, B]-valued model-induced properties with VC dimension h. Given k data sets D1 , . . . , Dk sampled from some distribution PD . Then s  k X h ln hk + 1 − ln η4 1 E[|QT (D) − QM (D)|] ≤ |QT (Dj ) − QM (SDj )| + (B − A) k k j=1 with probability at least 1 − η. 17 This bound can easily be applied to the prediction of correlations via collider-free paths: Due to Lemma 3, we then have h ∈ O(n). Since correlations are in [−1, 1], we can set 2 for B − A. Interpretation of the i.i.d. setting in learning theory In practical applications, the scenario is usually somehow different because one does not choose ‘observed’ and ‘unobserved’ subsets randomly. Instead, the observed sets are defined by the available data sets. One may object that the above considerations are therefore inapplicable. There is no formal argument against this objection. However, there may be reasons to believe that the observed variable sets at hand are not substantially different from the unobserved ones whose properties are supposed to be predicted, apart from the fact that they are observed. Based on this belief, one may still use the above generalization bounds as guidance on the richness of the class of causal hypotheses that is allowed to obtain good generalization properties. 6 Predicting impact of interventions by merging distributions We have argued that causal hypotheses provide strong guidance on how to merge probability distributions and thus become empirically testable without resorting to interventions. One may wonder whether this view on causality is completely disconnected to interventions. Here I argue that it is not. In some sense, estimating the impact of an intervention can also be phrased as the problem of inferring properties of unobserved joint distributions. Assume we want to test whether the causal hypothesis X → Y is true. We would then check how the distribution of Y changes under randomized interventions on X. Let us formally introduce a variable FX (Pearl, 2000) that can attain all possible values x of X (indicating to which value x is set to) or the value idle (if no intervention is made). Whether X influences Y is then equivalent to FX 6⊥ ⊥ Y. (8) If we demand that this causal relation is unconfounded (as is usually intended by the notation X → Y ), we have to test the condition PY |FX =x = PY |X=x . (9) Before the intervention is made, both conditions (8) and (9) refer to the unobserved distribution PY,FX . Inferring whether X → Y is true from PX,Y thus amounts to inferring the unobserved distribution PY,FX from PX,Y plus the additional background knowledge regarding the statistical and causal relation between FX and X (which is just based on the knowledge that the action we made has been in fact the desired intervention). In applications it can be a non-trivial question why some action can be considered an intervention on a target variable at hand (for instance in complex gene-gene interactions). If one assumes that it is based on purely observational data (maybe earlier in the past), we have reduced the problem of predicting the impact of interventions entirely to the problem of merging joint distributions. 7 Conclusions We have described different scenarios where causal models can be used to infer statistical properties of joint distributions of variables that have never been observed together. If the 18 causal models are taken from a class of sufficiently low VC dimension, this can be justified by generalization bounds from statistical learning theory. This opens a new pragmatic and context-dependent perspective on causality where the essential empirical content of a causal model may consist in its prediction regarding how to merge distributions from overlapping data sets. Such a pragmatic use of causal concepts may be helpful for domains where the interventional definition of causality raises difficult questions (if one claims that the age of a person causally influences his/her income, as assumed in Mooij et al. (2016), it is unclear what it means to intervene on the variable ’Age’). We have, moreover, argued that our pragmatic view of causal models is related to the usual concept of causality in terms of interventions. It is even possible that this view on causality could also be relevant for foundational questions of physics, where the language of causal models plays an increasing role recently (Leifer and Spekkens, 2013; Chaves et al., 2015; Ried et al., 2015; Wood and Spekkens, 2015; Janzing et al., 2016). References M. Aigner and G. Ziegler. Proofs from THE BOOK. Springer, Berlin, 1998. R. Chaves, C. Majenz, and D. Gross. Information–theoretic implications of quantum causal structures. Nat Commun, 6:5766, 01 2015. P. Daniusis, D. Janzing, J. M. Mooij, J. Zscheischler, B. Steudel, K. Zhang, and B. Schölkopf. Inferring deterministic causal relations. In Proceedings of the 26th Annual Conference on Uncertainty in Artificial Intelligence (UAI), pages 143–150. AUAI Press, 2010. P. Hoyer, S. Shimizu, A. Kerminen, and M. Palviainen. Estimation of causal effects using linear non-gaussian causal models with hidden variables. International Journal of Approximate Reasoning, 49(2):362 – 378, 2008. P. Hoyer, D. Janzing, J. Mooij, J. Peters, and B. Schölkopf. Nonlinear causal discovery with additive noise models. In D. Koller, D. Schuurmans, Y. Bengio, and L. Bottou, editors, Proceedings of the conference Neural Information Processing Systems (NIPS) 2008, Vancouver, Canada, 2009. MIT Press. D. Janzing. From the probabilistic marginal problem to the causal marginal problem. talk in the open problem session of the workshop ‘Causation: Foundation to Application’ of the Conference on Uncertainty in Artificial Intelligence (UAI), 2016. people.hss.caltech. edu/~fde/UAI2016WS/talks/Dominik.pdf. D. Janzing, X. Sun, and B. Schölkopf. Distinguishing cause and effect via second order exponential models. http://arxiv.org/abs/0910.5561, 2009. D. Janzing, R. Chaves, and B. Schölkopf. Algorithmic independence of initial condition and dynamical law in thermodynamics and causal inference. New Journal of Physics, 18 (093052):1–13, 2016. Y. Kano and S. Shimizu. Causal inference using nonnormality. In Proceedings of the International Symposium on Science of Modeling, the 30th Anniversary of the Information Criterion, pages 261–270, Tokyo, Japan, 2003. 19 H. Kellerer. Maßtheoretische Marginalprobleme. Math. Ann., 153:168–198, 1964. in German. K. Kelly and C. Mayo-Wilson. Causal conclusions that flip repeatedly. In P. Grünwald and P. Spirtes, editors, Proceedings of the Conference on Uncertainty in Artificial Intelligence (UAI 2010). AUAI Press, 2010. M. Leifer and R. Spekkens. Towards a formulation of quantum theory as a causally neutral theory of bayesian inference. Phys Rev, A(88):052130, 2013. D. Lopez-Paz, K. Muandet, B. Schölkopf, and I. Tolstikhin. Towards a learning theory of cause-effect inference. In Proceedings of the 32nd International Conference on Machine Learning, volume 37 of JMLR Workshop and Conference Proceedings, page 14521461. JMLR, 2015. C. Meek. Causal inference and causal explanation with background knowledge. In Proceedings of the 11th Conference on Uncertainty in Artificial Intelligence, pages 403–441, San Francisco, CA, 1995. Morgan Kaufmann. J. Mooij, O. Stegle, D. Janzing, K. Zhang, and B. Schölkopf. Probabilistic latent variable models for distinguishing between cause and effect. In Advances in Neural Information Processing Systems 23 (NIPS*2010), pages 1687–1695, 2011. J. Mooij, J. Peters, D. Janzing, J. Zscheischler, and B. Schölkopf. Distinguishing cause from effect using observational data: methods and benchmarks. Journal of Machine Learning Research, 17(32):1–102, 2016. J. Pearl. Causality: Models, reasoning, and inference. Cambridge University Press, 2000. J. Peters, D. Janzing, and B. Schölkopf. Identifying cause and effect on discrete data using additive noise models. In Proceedings of The Thirteenth International Conference on Artificial Intelligence and Statistics (AISTATS), JMLR: W&CP 9,, Chia Laguna, Sardinia, Italy, 2010. J. Peters, D. Janzing, and B. Schölkopf. Causal inference on discrete data using additive noise models. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(12): 2436–2450, 2011. J. Peters, D. Janzing, and B. Schölkopf. Elements of Causal Inference – Foundations and Learning Algorithms. MIT Press, 2017. A. Radhakrishnan, L. Solus, and C. Uhler. Counting Markov equivalence classes for DAG models on trees. ArXiv e-prints, 2017. T. Richardson and P. Spirtes. Ancestral graph Markov models. The Annals of Statistics, 30 (4):962–1030, 2002. K. Ried, M. Agnew, L. Vermeyden, D. Janzing, R. Spekkens, and K. Resch. A quantum advantage for inferring causal structure. Nature Physics, 11(5):414–420, 05 2015. P. K. Rubenstein, S. Weichwald, S. Bongers, J. M. Mooij, D. Janzing, M. Grosse-Wentrup, and B. Schölkopf. Causal consistency of structural equation models. In Proceedings of the Thirty-Third Conference on Uncertainty in Artificial Intelligence (UAI 2017), 2017. 20 B. Schölkopf, D. Janzing, J. Peters, E. Sgouritsa, K. Zhang, and J. Mooij. On causal and anticausal learning. In L. J. and J. Pineau, editors, Proceedings of the 29th International Conference on Machine Learning (ICML), pages 1255–1262. ACM, 2012. P. Spirtes, C. Glymour, and R. Scheines. Causation, Prediction, and Search (Lecture notes in statistics). Springer-Verlag, New York, NY, 1993. X. Sun, D. Janzing, and B. Schölkopf. Causal inference by choosing graphs with most plausible Markov kernels. In Proceedings of the 9th International Symposium on Artificial Intelligence and Mathematics, pages 1–11, Fort Lauderdale, FL, 2006. TETRAD. The tetrad homepage. http://www.phil.cmu.edu/projects/tetrad/. I. Tsamardinos, S. Triantafillou, and V. Lagani. Towards integrative causal analysis of heterogeneous data sets and studies. J. Mach. Learn. Res., 13(1):1097–1157, 2012. A. van der Wart and J. Wellner. A note on bounds for VC dimensions. Inst Math Stat Collect, 5:103–107, 2009. V. Vapnik. The nature of statistical learning theory. Springer, New York, 1995. V. Vapnik. Statistical learning theory. John Wileys & Sons, New York, 1998. V. Vapnik. Estimation of Dependences Based on Empirical Data. Statistics for Engineering and Information Science. Springer Verlag, New York, 2nd edition, 2006. N. Vorob’ev. Consistent families of measures and their extensions. Theory Probab. Appl, 7 (2):147–163, 1962. C. Wood and R. Spekkens. The lesson of causal discovery algorithms for quantum correlations: causal explanations of Bell-inequality violations require fine-tuning. New Journal of Physics, 17(3):033002, 2015. K. Zhang and A. Hyvärinen. On the identifiability of the post-nonlinear causal model. In Proceedings of the 25th Conference on Uncertainty in Artificial Intelligence, Montreal, Canada, 2009. K. Zhang, P. Peters, D. Janzing, and B. Schölkopf. Kernel-based conditional independence test and application in causal discovery. In Proceedings of the 27th Conference on Uncertainty in Artificial Intelligence (UAI 2011), 2011. http://uai.sis.pitt.edu/papers/11/ p804-zhang.pdf. 21
10math.ST
Faster STR-IC-LCS computation via RLE Keita Kuboi Yuta Fujishige Shunsuke Inenaga Hideo Bannai Masayuki Takeda Department of Informatics, Kyushu University, Japan {keita.kuboi,yuta.fujishige,inenaga,bannai,takeda}@inf.kyushu-u.ac.jp arXiv:1703.04954v1 [cs.DS] 15 Mar 2017 Abstract The constrained LCS problem asks one to find a longest common subsequence of two input strings A and B with some constraints. The STR-IC-LCS problem is a variant of the constrained LCS problem, where the solution must include a given constraint string C as a substring. Given two strings A and B of respective lengths M and N , and a constraint string C of length at most min{M, N }, the best known algorithm for the STR-IC-LCS problem, proposed by Deorowicz (Inf. Process. Lett., 11:423–426, 2012), runs in O(M N ) time. In this work, we present an O(mN + nM )-time solution to the STR-IC-LCS problem, where m and n denote the sizes of the run-length encodings of A and B, respectively. Since m ≤ M and n ≤ N always hold, our algorithm is always as fast as Deorowicz’s algorithm, and is faster when input strings are compressible via RLE. 1 Introduction Longest common subsequence (LCS) is one of the most basic measures of similarity between strings, and there is a vast amount of literature concerning its efficient computation. An LCS of two strings A and B of lengths M and N , respectively, is a longest string that is a subsequence of both A and B. There is a well known O(M N ) time and space dynamic programming (DP) algorithm [15] to compute an LCS between two strings. LCS has applications in bioinformatics [10, 16], file comparisons [9, 8], pattern recognition [13], etc. Recently, several variants of the problem which try to find a longest common subsequence that satisfy some constraints have been considered. In 2003, Tsai [14] proposed the constrained LCS (CLCS) problem, where, given strings A, B with respective lengths M, N , and a constraint string C of length K, the problem is to find a longest string that contains C as a subsequence and is also a common subsequence of A and B. Tsai gave an O(M 2 N 2 K) time solution, which was improved in 2004 by Chin et al. to O(M N K) time [6]. Variants of the constrained LCS problem called SEQ-IC-LCS, SEQ-EC-LCS, STR-IC-LCS, and STR-EC-LCS, were considered by Chen and Chao in 2011 [5]. Each problem considers as input, three strings A, B and C, and the problem is to find a longest string that includes (IC) or excludes (EC) C as a subsequence (SEQ) or substring (STR) and is a common subsequence of A and B (i.e., CLCS is equivalent to the SEQ-IC-LCS problem). The best solution for each of the problems is shown in Table 1. Table 1: Time complexities of best known solutions to various constrained LCS problems. Problem DP solution DP solution using RLE SEQ-IC-LCS O(M N K) [6] O(M + N + K min{mN, nM }) [12] SEQ-EC-LCS O(M N K) [5] STR-IC-LCS O(M N ) [7] O(mN + nM ) [this work] STR-EC-LCS O(M N K) [17] - In order to speed up the LCS computation, one direction of research that has received much attention is to apply compression, namely, run-length encoding (RLE) of strings. Bunke and Csirik [4] were one of the first to consider such a scenario, and proposed an O(mN + nM ) time algorithm. Here, m, n are the sizes of the RLE of the input strings of lengths M and N , respectively. Notice that since RLE can be computed in linear time, and m ≤ M and n ≤ N , the algorithm is always asymptotically faster than the standard O(N M ) time dynamic programming algorithm, especially when the strings are compressible by RLE. Furthermore, Ahsan et al. proposed an algorithm which runs in O((m + n) + R log log(mn) + R log log(M + N )) time [1], where R is the total number of pairs of runs of the same character in the two 1 RLE strings, i.e. R ∈ O(mn), and the algorithm can be much faster when the strings are compressible by RLE. For the constrained LCS problems, RLE based solutions for only the SEQ-IC-LCS problem have been proposed. In 2012, an O(K(mN + nM )) time algorithm was proposed by Ann et al. [2]. Later, in 2015, Liu et al. proposed a faster O(M + N + K min{mN, nM }) time algorithm [12]. In this paper, we present the first RLE based solution for the STR-IC-LCS problem that runs in O(mN + nM ) time. Again, since RLE can be computed in linear time, and m ≤ M and n ≤ N , the proposed algorithm is always asymptotically faster than the best known solution for the STR-IC-LCS problem by Deorowicz [7], which runs in O(M N ) time. A common criticism against RLE based solutions is a claim that, although they are theoretically interesting, since most strings “in the real world” are not compressible by RLE, their applicability is limited and they are only useful in extreme artificial cases. We believe that this is not entirely true. There can be cases where RLE is a natural encoding of the data, for example, in music, a melody can be expressed as a string of pitches and their duration. Furthermore, in the data mining community, there exist popular preprocessing schemes for analyzing various types of time series data, which convert the time series to strings over a fairly small alphabet as an approximation of the original data, after which various analyses are conducted (e.g. SAX (Symbolic Aggregate approXimation) [11], clipped bit representation [3], etc.). These conversions are likely to produce strings which are compressible by RLE (and in fact, shown to be effective in [3]), indicating that RLE based solutions may have a wider range of application than commonly perceived. 2 Preliminaries Let Σ be the finite set of characters, and Σ∗ be the set of strings. For any string A, let |A| be the length of A. For any 1 ≤ i ≤ i0 ≤ |A|, let A[i] be the ith character of A and let A[i..i0 ] = A[i] · · · A[i0 ] denote a substring of A. Especially, A[1..i0 ] denotes a prefix of A, and A[i..|A|] denotes a suffix of A. A string Z is a subsequence of A if Z can be obtained from A by removing zero or more characters. For two string A and B, a string Z is a longest common subsequence (LCS) of A, B, if Z is a longest string that is a subsequence of both A and B. For any 1 ≤ i ≤ |A| and 1 ≤ j ≤ |B|, let Lpref (i, j) denote the length of an LCS of A[1..i], B[1..j], and let Lsuf (i, j) denote the length of an LCS of A[i..|A|], B[j..|B|]. The LCS problem is to compute the length of an LCS of given two strings A and B. A well known solution is dynamic programming, which computes in O(M N ) time, a table (which we will call DP table) of size O(M N ) that stores values of Lpref (i, j) for all 1 ≤ i ≤ M , 1 ≤ j ≤ N . The DP table for Lsuf (i, j) can be computed similarly. For two strings A, B and a constraint string C, a string Z is an STR-IC-LCS of A, B, C, if Z is a longest string that includes C as a substring and also is a subsequence of both A and B. The STR-IC-LCS problem is to compute the length of an STR-IC-LCS of any given three strings A, B and C. For example, if A = abacab, B = babcaba, C = bb, then abcab and bacab are LCSs of A, B, and abb is an STR-IC-LCS of A, B, C. The run-length encoding (RLE) of a string A is a kind of compressed representation of A where each maximal run of the same character is represented by a pair of the character and the length of the run. Let RLE (A) denote the RLE of a string A. The size of RLE (A) is the number of the runs in A, and is denoted by |RLE (A)|. By definition, |RLE (A)| is always less than or equal to |A|. In the next section, we consider the STR-IC-LCS problem of strings A, B and constraint string C. Let |A| = M , |B| = N , |C| = K, |RLE (A)| = m and |RLE (B)| = n. We assume that K ≤ min(M, N ) and |RLE (C)| ≤ min(m, n), since in such case there can be no solution. We also assume that K > 0, because in that case the problem becomes the normal LCS problem of A, B. 3 Algorithm In this section, we will first introduce a slightly modified version of Deorowicz’s O(M N )-time algorithm for the STR-IC-LCS problem [7], and then propose our O(mN + nM )-time algorithm which is based on his dynamic programming approach but uses RLE. 3.1 Deorowicz’s O(M N ) Algorithm We first define the notion of minimal C-intervals of a string. 2 Definition 1. For any strings A and C, an interval [s, f ] is a minimal C-interval of A if • C is a subsequence of A[s..f ], and • C is not a subsequence of A[s + 1..f ] or A[s..f − 1]. Deorowicz’s algorithm is based on Lemma 2, which is used implicitly in [7]. Lemma 2 (implicit in [7]). If Z is an STR-IC-LCS of A, B, C, then there exist minimal C-intervals [s, f ], [s0 , f 0 ] (1 ≤ s ≤ f ≤ M , 1 ≤ s0 ≤ f 0 ≤ N ) respectively of A and B, such that Z = XCY , where X is an LCS of A[1..s − 1] and B[1..s0 − 1] and Y is an LCS of A[f + 1..M ] and B[f 0 + 1..N ]. Proof. From the definition of STR-IC-LCS, C is a substring of Z, and therefore, there exist (possibly empty) strings X, Y such that Z = XCY . Also, since Z is a common subsequence of A and B, there exist monotonically increasing sequences i1 , . . . , i|Z| and j1 , . . . , j|Z| such that Z = A[i1 ] · · · A[i|Z| ] = B[j1 ] · · · B[j|Z| ], and C = A[i|X|+1 ] · · · A[i|X|+K ] = B[j|X|+1 ] · · · B[j|X|+K ]. Now, since C is a subsequence of A[i|X|+1 ..i|X|+K ] and B[j|X|+1 ..j|X|+K ] there exist minimal Cintervals [s, f ], [s0 , f 0 ] respectively of A and B that satisfy i|X|+1 ≤ s ≤ f ≤ i|X|+K and j|X|+1 ≤ s0 ≤ f 0 ≤ j|X|+K . Let X 0 be an LCS of A[1..s − 1] and B[1..s0 − 1], and Y 0 an LCS of A[f + 1..M ] and B[f 0 + 1..N ]. Since X must be a common subsequence of A[1..s − 1] and B[1..s0 − 1], and Y a common subsequence of A[f + 1..M ] and B[f 0 + 1..N ], we have |X 0 | ≥ |X| and |Y 0 | ≥ |Y |. However, we cannot have that |X 0 | > |X| or |Y 0 | > |Y | since otherwise, X 0 CY 0 would be a string longer than Z that contains C as a substring, and is a common subsequence of A, B, contradicting that Z is an STR-IC-LCS of A, B, C. Thus, |X| = |X 0 | and |Y | = |Y 0 | implying that X is also an LCS of A[1..s − 1], B[1..s0 − 1], and Y is also an LCS of A[f + 1..M ], B[f 0 + 1..N ], proving the lemma. The algorithm consists of the following two steps, whose correctness follows from Lemma 2. Step 1 Compute all minimal C-intervals of A and B. Step 2 For all pairs of a minimal C-interval [s, f ] of A and a minimal C-interval [s0 , f 0 ] of B, compute the length of an LCS of the corresponding prefixes of A and B (i.e., Lpref (s − 1, s0 − 1)) and that of the corresponding suffixes of A and B (i.e., Lsuf (f + 1, f 0 + 1)). The largest sum of LCS lengths plus |C| (i.e., Lpref (s − 1, s0 − 1) + Lsuf (f + 1, f 0 + 1) + |C|) is the length of an STR-IC-LCS. The steps can be executed in the following running times. For Step 1, there are respectively at most M and N minimal C-intervals of A and B, which can be enumerated in O(M K) and O(N K) time. For Step 2, we precompute, in O(M N ) time, two dynamic programming tables which respectively contain the values of Lpref (i, j) and Lsuf (i, j) for each 1 ≤ i ≤ M and 1 ≤ j ≤ N . Using these tables, the value Lpref (s − 1, s0 − 1) + Lsuf (f + 1, f 0 + 1) + |C| can be computed in constant time for any [s, f ] and [s0 , f 0 ]. There are O(M N ) possible pairs of minimal C-intervals, so Step 2 can be done in O(M N ) time. In total, since K ≤ M, K ≤ N , the STR-IC-LCS problem can be solved in O(M N ) time. We note that in the original presentation of Deorowicz’s algorithm, right-minimal C-intervals, that is, intervals [s, f ] where C is a subsequence of A[s..f ] but not of A[s..f − 1] are computed, instead of minimal C-intervals as defined in Definition 1. Although the number of considered intervals changes, this does not influence the asymptotic complexities in the non-RLE case. However, as we will see in Lemma 4 of Section 3.2, this is an essential difference for the RLE case, since, when |RLE (C)| > 1, the number of minimal C-intervals of A and B can be bounded by O(m) and O(n), but the number of right-minimal C-intervals of A and B cannot, and are only bounded by O(M ) and O(N ). 3.2 Our Algorithm via RLE In this subsection, we propose an efficient algorithm based on Deorowicz’s algorithm explained in Subsection 3.1, extended to strings expressed in RLE. There are two main cases to consider: when |RLE (C)| = 1, i.e., when C consists of only one type of character, and when |RLE (C)| > 1, i.e., when C contains at least two different characters. 3.2.1 Case |RLE (C)| > 1 Theorem 3. Let A, B, C be any strings and let |A| = M , |B| = N , |RLE (A)| = m and |RLE (B)| = n. If |RLE (C)| > 1, we can compute the length of an STR-IC-LCS of A, B, C in O(mN + nM ) time. 3 For Step 1, we execute the following procedure to enumerate all minimal C-intervals of A and B. Let s0 = 0. First, find the right minimal C-interval starting at s0 + 1, i.e., the smallest position f1 such that C is a subsequence of A[s0 + 1..f1 ]. Next, starting from position f1 of A, search backwards to find the left minimal C-interval ending at f1 , i.e., the largest position s1 such that C is a subsequence of A[s1 ..f1 ]. The process is then repeated, i.e., find the smallest position f2 such that C is a subsequence of A[s1 + 1..f2 ], and then search backwards to find the largest position s2 such that C is a subsequence of A[s2 ..f2 ], and so on. It is easy to see that the intervals [s1 , f1 ], [s2 , f2 ], . . . obtained by repeating this procedure until reaching the end of A are all the minimal C-intervals of A, since each interval that is found is distinct, and there cannot exist another minimal C-interval between those found by the procedure. The same is done for B. For non-RLE strings, this takes O((M + N )K) time. The Lemma below shows that the procedure can be implemented more efficiently using RLE. Lemma 4. Let A and C be strings where |A| = M , |RLE (A)| = m and |C| = K. If |RLE (C)| > 1, the number of minimal C-intervals of A is O(m) and can be enumerated in O(M + mK) time. Proof. Because |RLE (C)| > 1, it is easy to see from the backward search in the procedure described above, that for any minimal C-interval of A, there is a unique run of A such that the last character of the first run of C corresponds to the last character of that run. Therefore, the number of minimal C-intervals of A is O(m). Kk Mm 1 1 We can compute RLE (A) = aM and RLE (C) = cK in O(M + K) time. What 1 · · · am 1 · · · ck remains is to show that the forward/backward search procedure described above to compute all minimal C-intervals of A can be implemented in O(mK) time. The pseudo-code of the algorithm described is shown in Algorithm 1. In the forward search, we scan RLE (A) to find a right minimal C-interval by greedily matching the runs of RLE (C) to RLE (A). We maintain the character cq and exponent rest of the first run crest of q M RLE (C 0 ), where C 0 is the suffix of C that is not yet matched. When comparing a run ap p of RLE (A) M and crest , if the characters are different (i.e., ap 6= cq ), we know that the entire run ap p will not match q and thus we can consider the next run of A. Suppose the characters are the same. Then, if Mp < rest, M Mp+1 the entire run ap p of A is matched, and we can consider the next run ap+1 of A. Also, rest can be updated accordingly in constant time by simple arithmetic. Furthermore, since cq = ap 6= ap+1 , we can in Mp+2 fact skip to the next run ap+2 . If Mp ≥ rest, the entire run crest is matched, and we consider the next q K M M q+1 p+1 run cq+1 in C. Also, since ap = cq = 6 cq+1 , we can skip the rest of ap p and consider the next run ap+1 of A. Thus, we spend only constant time for each run of A that is scanned in the forward search. The same holds for the backward search. To finish the proof, we show that the total number of times that each run of A is scanned in the procedure is bounded by O(K), i.e., the number of minimal C-intervals of A that intersects with a given M M run ap p of A is O(K). Since |RLE (C)| > 1, a minimal C-interval cannot be contained in ap p . Thus, for Mp a minimal C-interval to intersect with the run ap , it must cross either the left boundary of the run, or the right boundary of the run. For a minimal C-interval to cross the left boundary of the run, it must be Mp−1 1 that for some non-empty strings u, v such that C = uv, u occurs as a subsequence in aM 1 · · · ap−1 and M m v occurs as a subsequence in ap p · · · aM m . The minimal C-interval corresponds to the union of the left minimal u-interval ending at the left boundary of the run and the right minimal v-interval starting at the left boundary of the run and is thus unique for u, v. Similar arguments also hold for minimal C-intervals M that cross the right boundary of ap p . Since there are only K − 1 choices for u, v, the claim holds, thus proving the Lemma. In Deorowicz’s algorithm, two DP tables were computed for Step 2, which took O(M N ) time. For our algorithm, we use a compressed representation of the DP table for A and B, proposed by Bunke and Csirik [4], instead of the normal DP table. We note that Bunke and Csirik actually solved the edit distance problem when the cost is 1 for insertion and deletion, and 2 for substitution, but this easily translates to LCS: Lpref (i, j) = (i + j − ED pref (i, j))/2, where ED pref (i, j) denotes the edit distance with such costs, between A[1..i] and B[1..j]. Mm 1 Definition 5 ([4]). Let A, B be strings of length M , N respectively, where RLE (A) = aM 1 · · · am N1 Nn and RLE (B) = b1 · · · bn . The compressed DP table (cDP table) of A, B is an O(mN + nM )-space compressed representation of the DP table of A, B which holds only the values of the DP table for (M1..p , j) and (i, N1..q ), where, 1 ≤ i ≤ M , 1 ≤ j ≤ N , 1 ≤ p ≤ m, 1 ≤ q ≤ n, M1..p = M1 + · · · + Mp , N1..q = N1 + · · · + Nq . 4 Algorithm 1: computing all minimal C-intervals of A Input: strings A and C Output: all minimal C-intervals [s1 , f1 ], . . . , [sl , fl ] of A Kk K1 Mm 1 // RLE (A) = aM 1 · · · am , RLE (C) = c1 · · · ck // M1..p = M1 + · · · + Mp // p, q : index of run in A, C respectively K // rest : number of rest of searching characters of cq q // l : number of minimal C-intervals in A 1 p ← 1; q ← 1; rest ← K1 ; l ← 0; 2 while true do 3 while p ≤ m and q ≤ k do // forward search 4 if ap 6= cq then p ← p + 1; 5 ; 6 else 7 if Mp ≥ rest then 8 q ← q + 1; 9 if q > k then l ← l + 1; fl ← M1..p−1 + rest; 10 ; 11 else p ← p + 1; rest ← Kq ; 12 ; 13 else rest ← rest − Mp ; p ← p + 2; 14 ; 33 if p > m then break; ; p ← p − 1; if rest = Kk then q ← q − 1; rest ← Kk−1 ; ; else q ← k; rest ← Kk − rest; ; while q ≥ 1 do // backward search if ap 6= cq then p ← p − 1; ; else if Mp ≥ rest then q ← q + 1; if q < 1 then sl ← M1..p − rest + 1; ; else p ← p − 1; rest ← Kq ; ; else rest ← rest − Mp ; p ← p − 2; ; 34 p ← p + 1; q ← 1; rest ← K1 − rest + 1; 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 35 return [s1 , f1 ], . . . , [sl , fl ]; A b b b a a a a a a a 0 0 0 1 2 3 a 0 0 0 1 2 3 4 B b b 1 2 4 4 b 1 2 3 3 3 3 4 a 3 4 a 1 2 3 4 5 5 5 Figure 1: An example of a compressed Lpref DP table for strings A = bbbaaaa and B = aaaabbbaa. 5 Figure 1 illustrates the values stored in the cDP table for strings A = bbbaaaa, B = aaaabbbaa. Note that although the figure depicts a sparsely filled table of size M × N , the values are actually stored in two (completely filled) tables: one of size m × N , holding the values of (M1..p , j), and another of size M × n, holding the values of (i, N1..q ), for a total of O(mN + nM ) space. Below are results adapted from [4] we will use. Lemma 6 ([4, Theorem 7]). Let A and B be any strings where |A| = M , |B| = N , |RLE (A)| = m and |RLE (B)| = n. The compressed DP table of A and B can be computed in O(mN + nM ) time and space. Lemma 7 ([4, Lemma 3]). Let α ∈ Σ and let A and B be any strings where |A| = M and |B| = N . For any integer d ≥ 1, if A[M −d+1..M ] = B[N −d+1..N ] = αd , then Lpref (M, N ) = Lpref (M −d, N −d)+d. Lemma 8 ([4, Lemma 5]). Let α, β ∈ Σ, α 6= β and let A and B be any strings where |A| = M and 0 |B| = N . For any integers d ≥ 1 and d0 ≥ 1, if A[M − d + 1..M ] = αd and B[N − d0 + 1..N ] = β d then Lpref (M, N ) = max{Lpref (M − d, N ), Lpref (M, N − d0 )}. From Lemmas 7 and 8, we easily obtain the following Lemma 9. Lemma 9. Let A and B be any strings. Any entry of the DP table of A and B can be retrieved in O(1) time by using the compressed DP table of A and B. From Lemma 6, we can compute in O(mN + nM ) time, two cDP tables of A, B which respectively hold the values of Lpref (M1..p , j), Lpref (i, N1..q ) and Lsuf (M1..p , j), Lsuf (i, N1..q ), each of them taking O(mN + nM ) space. From Lemma 9, we can obtain Lpref (i, j), Lsuf (i, j) for any i and j in O(1) time. Actually, to make Lemma 9 work, we also need to be able to convert the indexes between DP and cDP in constant time, i.e., for any 1 ≤ p ≤ m, 1 ≤ q ≤ n, the values M1..p and N1..q , and for any 1 ≤ i ≤ M , 1 ≤ j ≤ N , the largest p, q such that M1..p ≤ i, N1..q ≤ j. This is easy to do by preparing some arrays in O(M + N ) time and space. Now we are ready to show the running time of our algorithm for the case |RLE (C)| > 1. We can compute RLE (A),RLE (B),RLE (C) from A, B, C in O(M + N + K) time. In Step 1, we have from Lemma 4, that the number of all minimal C-intervals of A, B are respectively O(m) and O(n), and can be computed in O(M + N + mK + nK) time. For the preprocessing of Step 2, we build the cDP tables holding the values of Lpref (i, j), Lsuf (i, j) for 1 ≤ i ≤ M , 1 ≤ j ≤ N , which can be computed in O(mN + nM ) time and space from Lemma 6. With these tables, we can obtain for any i, j, the values Lpref (i, j), Lsuf (i, j) in constant time from Lemma 9. Since there are O(mn) pairs of a minimal C-interval of A and a minimal C-interval of B, the total time for Step 2, i.e. computing Lpref and Lsuf for each of the pairs, is O(mn). Since n ≤ N, m ≤ M , and we can assume that K ≤ M, N , the total time is O(mN + nM ). Thus Theorem 3 holds. 3.2.2 Case |RLE (C)| = 1 Next, we consider the case where |RLE (C)| = 1, and C consists of only one run. Theorem 10. Let A, B, C be any strings and let |A| = M , |B| = N , |RLE (A)| = m and |RLE (B)| = n. If |RLE (C)| = 1, we can compute the length of an STR-IC-LCS of A, B, C in O(mN + nM ) time. For Step 1, we compute all minimal C-intervals of A and B by Lemma 11. Note the difference from Lemma 4 in the case of |RLE (C)| > 1. Lemma 11. If |RLE (C)| = 1, the number of minimal C-intervals of A and B are O(M ) and O(N ), respectively, and these can be enumerated in O(M ) and O(N ) time, respectively. Proof. Let α ∈ Σ, C = αK , and let Mα be the number of times that α occurs in A. Then the number of minimal C-intervals of A is Mα − K + 1 ∈ O(M ). The minimal C-intervals can be enumerated in O(M ) time by checking all positions of α in A. The same applies to B. From Lemma 11, we can see that the number of pairs of minimal C-intervals of A and B can be Θ(M N ), and we cannot afford to consider all of those pairs for Step 2. We overcome this problem as follows. Let U = {[s1 , f1 ], . . . , [sl , fl ]} be the set of all minimal C-intervals of A. Consider the partition G(1), . . . , G(g) of U which are the equivalence classes induced by the following equivalence relation on U : For any 1 ≤ p ≤ q ≤ m and [sx , fx ], [sy , fy ] ∈ U , [sx , fx ] ≡ [sy , fy ] ⇐⇒ M1..p−1 < sx , sy ≤ M1..p and M1..q−1 < fx , fy ≤ M1..q , 6 (1) where, M1..0 = 0. In other words, [sx , fx ] and [sy , fy ] are in the same equivalence class if they start in the same run, and end in the same run. Noticing that minimal C-intervals cannot be completely contained in another, we can assume that for 1 ≤ h < h0 ≤ g, [sx , fx ] ∈ G(h) and [sy , fy ] ∈ G(h0 ), we have sx < sy and fx < fy . Lemma 12. Let G(1), . . . , G(g) be the partition of the set U of all minimal C-intervals of A induced by the equivalence relation (1). Then, g ∈ O(m). Proof. Let 1 ≤ x < y ≤ l and 2 ≤ h ≤ g. For any [sx , fx ] ∈ G(h − 1) and [sy , fy ] ∈ G(h), let 1 ≤ p ≤ q ≤ m satisfy M1..p−1 < sx ≤ M1..p , M1..q−1 < fx ≤ M1..q . Since the intervals are not equivalent, either M1..p < sy or M1..q < fy must hold. Thus, g ∈ O(m). Equivalently for B, we consider the set U 0 = {[s01 , f10 ], . . . , [s0l0 , fl00 ]} of all minimal C-intervals of B, and the partition G0 (1), . . . , G0 (g 0 ) of U 0 based on the analogous equivalence relation, where g 0 ∈ O(n). For some h, let [sx , fx ], [sy , fy ] be the minimal C-intervals in G(h) with the smallest and largest start positions. Since by definition, A[sx ] = · · · = A[sy ] = A[fx ] = · · · = A[fy ], we have G(h) = {[sx + i, fx + i], [sx + 1, fx + 1], . . . , [sy , fy ]}. The same can be said for G0 (h0 ) of B. From this observation, we can show the following Lemma 13. Lemma 13. For any 1 ≤ h ≤ g and 1 ≤ h0 ≤ g 0 , let [s, f ], [s+d, f +d] ∈ G(h) and [s0 , f 0 ], [s0 +d, f 0 +d] ∈ G0 (h0 ), for some positive integer d. Then, Lpref (s − 1, s0 − 1) + Lsuf (f + 1, f 0 + 1) = Lpref (s + d − 1, s0 + d − 1) + Lsuf (f + d + 1, f 0 + d + 1). Proof. Since A[s..s + d] = A[f..f + d] = B[s0 ..s0 + d] = B[f 0 ..f 0 + d] = C[1]d , we have from Lemma 7, Lpref (s+d−1, s0 +d−1) = Lpref (s−1, s0 −1)+d, and Lsuf (f +1, f 0 +1) = Lsuf (f +d+1, f 0 +d+1)+d. From Lemma 13, we can see that for any G(h), G0 (h0 ) (1 ≤ h ≤ g, 1 ≤ h0 ≤ g 0 ), we do not need to compute Lpref (s − 1, s0 − 1) + Lsuf (f + 1, f 0 + 1) for all pairs of [s, f ] ∈ G(h) and [s0 , f 0 ] ∈ G0 (h0 ). Let Gmin (h) and G0min (h0 ) be the minimal C-intervals respectively in G(h) and G0 (h0 ) with the smallest starting position. Then, we only need to consider the combination of Gmin (h) with each of [s0 , f 0 ] ∈ G0 (h0 ), and the combination of each of [s, f ] ∈ G(h) with G0min (h0 ). Therefore, of all combinations of minimal C-intervals in U and U 0 , we only need to consider for all 1 ≤ h ≤ g and 1 ≤ h0 ≤ g 0 , the combination of Gmin (h) with each of U 0 , and each of U with G0min (h0 ). The number of such combinations is clearly O(mN + nM ). For example, consider RLE (A) = a5 b3 a4 b2 a1 , RLE (B) = a1 b3 a7 b3 , RLE (C) = a5 . For the minimal C-intervals of A, we have G(1) = {[1, 5]}, G(2) = {[2, 9], [3, 10], [4, 11], [5, 12]}, G(3) = {[9, 15]}. For the minimal C-intervals of B, we have G0 (1) = {[1, 8]}, G0 (2) = {[5, 9], [6, 10], [7, 11]}. Also, Gmin (2) = [2, 9], G0min (2) = [5, 9]. Figure 2 shows the lengths of the LCS of prefixes and suffixes for each combination between minimal C-intervals in G(2) and G0 (2). The gray part is the values that are referred to. The values denoted inside parentheses are not stored in the cDP table, but each of them can be computed in O(1) time from Lemma 9. Figure 3 shows the sum of the LCS of prefixes and suffixes corresponding to the gray part. Due to Lemma 13, the values along the diagonal are equal. Thus, for the combinations of minimal C-intervals in G(2), G0 (2), we only need to consider the six combinations: ([2, 9], [5, 9]),([2, 9], [6, 10]),([2, 9], [7, 11]),([3, 10], [5, 9]),([4, 11], [5, 9]),([5, 12], [5, 9]). Now, we are ready to show the running time of our algorithm for the case |RLE (C)| = 1. We can compute RLE (A), RLE (B), RLE (C) from A, B, C in O(M + N + K) time. There are respectively O(M ) and O(N ) minimal C-intervals of A and B, and each of them can be assigned to one of the O(m) and O(n) equivalence classes G, G0 , in total of O(M + N ) time. The preprocessing for the cDP table is the same as for the case of |RLE (C)| > 1, which can be done in O(mN + nM ) time. By Lemma 13, we can reduce the number of combinations of minimal C-intervals to consider to O(mN + nM ). Finally, from Lemma 9, the LCS lengths for each combination can be computed in O(1) using the cDP table. Therefore, the total running time is O(mN + nM ), proving Theorem 10. From Theorems 3 and 10, the following Theorem 14 holds. The pseudo-code for our proposed algorithm is shown in Algorithm 2 (written in Appendix). Theorem 14. Let A, B, C be any strings and let |A| = M , |B| = N , |RLE (A)| = m and |RLE (B)| = n. We can compute the length of an STR-IC-LCS of A, B, C in O(mN + nM ) time. Although we only showed how to compute the length of an STR-IC-LCS, we note that the algorithm can be modified so as to obtain a RLE of an STR-IC-LCS in O(m + n) time, provided that RLE (C) 7 Figure 2: An example depicting the LCSs of corresponding prefixes (left) and suffixes (right) of all combinations of G(2) and G0 (2) for strings RLE (A) = a5 b3 a4 b2 a1 , RLE (B) = a1 b3 a7 b3 , and RLE (C) = a5 . The values denoted inside parentheses are not stored in the cDP table, but each of them can be computed in O(1) time. A a a a a a b .. . a 1 1 1 1 1 1 .. . b 1 b 1 b 1 1 1 1 1 2 .. . B a (1) (2) (2) (2) 2 B a (1) (2) (3) (3) 3 a 4 ··· ··· A ··· .. . a a a b b a a a a ··· 2 (4) (4) (3) 2 (3) (3) (3) 2 ··· 1 1 1 b .. . 2 2 2 2 1 0 b b 2 1 0 0 Figure 3: Sum of the lengths of LCSs of corresponding prefixes and suffixes shown in Figure 2. Values along the diagonal are equal (each value is equal to the value to its upper left/lower right). 5 4 3 5 5 4 4 5 5 3 4 5 is precomputed, simply by storing the minimal C-intervals [s, f ], [s0 , f 0 ], respectively of A and B, that maximizes Lpref (s − 1, s0 − 1) + Lsuf (f + 1, f 0 + 1) + |C|. From Lemmas 7 and 8, we can simulate a standard back-tracking of the DP table for obtaining LCSs with the cDP table to obtain RLE of the LCSs in O(m + n) time. Finally an RLE of STR-IC-LCS can be obtained by combining the three RLE strings (the two LCSs with RLE (C) in the middle), appropriately merging the boundary runs if necessary. 4 Conclusion In this work, we proposed a new algorithm to solve the STR-IC-LCS problem using RLE representation. We can compute the length of an STR-IC-LCS of strings A, B, C in O(mN + nM ) time and space using this algorithm, where |A| = M , |B| = N , |RLE(A)| = m and |RLE(B)| = n. This result is better than Deorowicz’s O(M N ) time and space [7], which doesn’t use RLE. If we want to know not only the length but also an STR-IC-LCS of A, B, C, we can retrieve it in O(m + n) time. 8 References [1] Shegufta Bakht Ahsan, Syeda Persia Aziz, and M. Sohel Rahman. Longest common subsequence problem for run-length-encoded strings. JCP, 9(8):1769–1775, 2014. [2] Hsing-Yen Ann, Chang-Biau Yang, Chiou-Ting Tseng, and Chiou-Yi Hor. Fast algorithms for computing the constrained LCS of run-length encoded strings. Theor. Comput. Sci., 432:1–9, 2012. [3] Anthony Bagnall, Chotirat “Ann” Ratanamahatana, Eamonn Keogh, Stefano Lonardi, and Gareth Janacek. A bit level representation for time series data mining with shape based similarity. Data Mining and Knowledge Discovery, 13(1):11–40, 2006. [4] Horst Bunke and János Csirik. An improved algorithm for computing the edit distance of run-length coded strings. Inf. Process. Lett., 54(2):93–96, 1995. [5] Yi-Ching Chen and Kun-Mao Chao. On the generalized constrained longest common subsequence problems. J. Comb. Optim., 21(3):383–392, 2011. [6] Francis Y. L. Chin, Alfredo De Santis, Anna Lisa Ferrara, N. L. Ho, and S. K. Kim. A simple algorithm for the constrained sequence problems. Inf. Process. Lett., 90(4):175–179, 2004. [7] Sebastian Deorowicz. Quadratic-time algorithm for a string constrained LCS problem. Inf. Process. Lett., 112(11):423–426, 2012. [8] Paul Heckel. A technique for isolating differences between files. Communications of the ACM, 21(4):264–268, 1978. [9] James W. Hunt and Malcolm Douglas McIlroy. An algorithm for differential file comparison. Technical Report 41, Compt. Sci. Techn. Rep., 1976. [10] Dmitry Korkin and Lev Goldfarb. Multiple genome rearrangement: a general approach via the evolutionary genome graph. Bioinformatics, 18(suppl 1):S303–S311, 2002. [11] Jessica Lin, Eamonn Keogh, Li Wei, and Stefano Lonardi. Experiencing SAX: a novel symbolic representation of time series. Data Mining and Knowledge Discovery, 15(2):107–144, 2007. [12] Jia Jie Liu, Yue-Li Wang, and Yu-shan Chiu. Constrained longest common subsequences with run-length-encoded strings. Comput. J., 58(5):1074–1084, 2015. [13] Helman Stern, Merav Shmueli, and Sigal Berman. Most discriminating segment – longest common subsequence (MDSLCS) algorithm for dynamic hand gesture classification. Pattern Recognition Letters, 34(15):1980–1989, 2013. [14] Yin-Te Tsai. The constrained longest common subsequence problem. Inf. Process. Lett., 88(4):173–176, 2003. [15] Robert A. Wagner and Michael J. Fischer. The string-to-string correction problem. J. ACM, 21(1):168–173, 1974. [16] Congmao Wang and Dabing Zhang. A novel compression tool for efficient storage of genome resequencing data. Nucleic Acids Research, 39(7):e45, 2011. [17] Lei Wang, Xiaodong Wang, Yingjie Wu, and Daxin Zhu. A dynamic programming solution to a generalized LCS problem. Inf. Process. Lett., 113(19-21):723–728, 2013. 9 A Appendix Here, we show the pseudo-code for our proposed algorithm. 10 Algorithm 2: Proposed O(mN + M n) time algorithm for STR-IC-LCS Input: strings A, B and C Output: length of an STR-IC-LCS of A, B, C // [sx , fx ] : a minimal C-interval in A // [s0y , fy0 ] : a minimal C-interval in B // l, l0 : number of minimal C-intervals in A, B respectively // Gmin (h), G0min (h0 ) : minimum element in G(h), G0 (h0 ) respectively // g, g 0 : number of sets G, G0 respectively 1 Make compressed DP tables of A and B.; 2 if |RLE (C)| > 1 then 3 Compute all minimal C-intervals [s1 , f1 ], . . . , [sl , fl ] of A and [s01 , f10 ], . . . , [s0l0 , fl00 ] of B. (use Algorithm 1); 4 Lmax ← 0; 5 for x = 1 to l do 6 for y = 1 to l0 do 7 Lsum ← Lpref (sx − 1, s0y − 1) + Lsuf (fx + 1, fy0 + 1); 8 if Lmax < Lsum then Lmax ← Lsum ; 9 ; 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 else l ← 1 − K; g ← 1; Gmin (1) ← 1; for p = 1 to m do if ap = C[1] then for p0 = 1 to Mp do l ← l + 1; sl+K ← M1..p + p0 ; if l ≥ 1 then fl ← M1..p + p0 ; ; if l ≥ 2 then if sl−1 + 1 6= sl or fl−1 + 1 6= fl then g ← g + 1; Gmin (g) ← l; ; l0 ← 1 − K; g 0 ← 1; G0min (1) ← 1; for q = 1 to n do if bq = C[1] then for q 0 = 1 to Nq do l0 ← l0 + 1; s0l0 +K ← N1..q + q 0 ; if l0 ≥ 1 then fl00 ← N1..q + q 0 ; ; if l0 ≥ 2 then if s0l0 −1 + 1 6= s0l0 or fl00 −1 + 1 6= fl00 then g 0 ← g 0 + 1; G0min (g 0 ) ← l0 ; ; Gmin (g + 1) ← l + 1; G0min (g 0 + 1) ← l0 + 1; Lmax ← 0; for h = 1 to g do for h0 = 1 to g 0 do for x = Gmin (h) to Gmin (h + 1) − 1 do 0 Lsum ← Lpref (sx − 1, s0G0 (h0 ) − 1) + Lsuf (fx + 1, fG 0 0 + 1); min min (h ) if Lmax < Lsum then Lmax ← Lsum ; ; for y = G0min (h0 ) to G0min (h0 + 1) − 1 do Lsum ← Lpref (sGmin (h) − 1, s0y − 1) + Lsuf (fGmin (h) + 1, fy0 + 1); if Lmax < Lsum then Lmax ← Lsum ; ; return Lmax + K; 11
8cs.DS
arXiv:1306.6820v1 [math.AC] 28 Jun 2013 Eine Charakterisierung der Matlis-reflexiven Moduln Helmut Zöschinger Mathematisches Institut der Universität München Theresienstr. 39, D-80333 München, Germany E-mail: zoeschinger@mathematik.uni-muenchen.de Abstract Let (R, m) be a noetherian local ring, E the injective hull of k = R/m and M ◦ = HomR (M, E) the Matlis dual of the R-module M. If the canonical monomorphism ϕ : M → M ◦◦ is surjective, M is known to be called (Matlis-)reflexive. With the help of the Bass numbers µ(p, M) = dimκ(p) (HomR (R/p, M)p ) of M with respect to p we show: M is reflexive if and only if µ(p, M) = µ(p, M ◦◦ ) for all p ∈ Spec(R). From this it follows for every R-module M: If there exists a monomorphism M ◦◦ ֒→ M or an epimorphism M ։ M ◦◦ , then M is already reflexive. Key Words: Matlis-reflexive modules, Bass numbers, associated prime ideals, torsion modules, cotorsion modules. Mathematics Subject Classification (2010): 13B35, 13C11, 13E10. 1 Der Rang eines Moduls Stets sei R noethersch und lokal. Für jeden R-Modul M heißt µi (p, M) := dimκ(p) (ExtiR (R/p, M)p ) (i ≥ 0, p ∈ Spec(R)) die i-te Bass-Zahl von M bezüglich p (siehe [1, p.200]), und weil wir sie im folgenden nur für i = 0 brauchen, schreiben wir statt µ0 (p, M) kurz µ(p, M). Ist R ein Integritätsring mit Quotientenkörper K, so ist µ(0, M) = dimK (K ⊗R M) offenbar der Rang von M. Ist R beliebig, wird M[p] := AnnM (p) zu einem Modul über dem Integritätsring R/p und es folgt µ(p, M) = RangR/p (M[p]). Insbesondere ist µ(p, M) = 0 äquivalent mit p ∈ / Ass(M). Allgemeiner gilt mit einem großen Untermodul ` U von M, U ∼ = (R/q)(Iq ) (q ∈ Spec(R)), daß µ(p, M) = µ(p, U) = |Ip | ist. 1 Satz 1.1 Ist M ein R-Modul und ϕ : M → M ◦◦ die kanonische Einbettung, so gilt für jedes Primideal p: µ(p, M) = µ(p, M ◦◦ ) ⇐⇒ p ∈ / Ass(Kok ϕ). Beweis. 1.Schritt Sei R ein Integritätsring und M ein R-Modul mit Rang(M) = Rang(M ◦◦ ). Dann ist Rang(M) endlich. Zum Beweis wähle man einen freien Untermodul U von M mit M/U torsion, so daß aus Rang(U) = Rang(M) auch Rang(U) = Rang(U ◦◦ ) folgt. Mit U ∼ = R(I) ist E (I) → U ◦ , also auch R̂I → U ◦◦ ein zerfallender Monomorphismus, insbesondere Rang(R(I) ) = Rang(RI ). Daraus folgt die Endlichkeit von I: Mit S = R(I) und P = RI ist auch P/S flach, so daß es nach [2, Theorem 7.10] einen freien Zwischenmodul S ⊂ F ⊂ P gibt mit F rein in P, F + mP = P. Klar ist Rang(S) = dimk (k (I) ), andererseits Rang(F ) = dimk (F/mF ) = dimk (P/mP ) = dimk (k I ), so daß aus Rang(S) = Rang(F ) mit Erdös-Kaplansky die Behauptung folgt. 2.Schritt Sei R ein Integritätsring und M ein beliebiger R-Modul. Dann gilt: Rang(M) = Rang(M ◦◦ ) ⇐⇒ Kok ϕ ist torsion. Der Beweis folgt unmittelbar aus der Gleichung Rang(M ◦◦ ) = Rang(M)+ Rang(Kok ϕ), denn bei ”⇒” sind nach dem ersten Schritt alle Kardinalzahlen endlich, also Rang(Kok ϕ) = 0, und ”⇐” ist klar. 3.Schritt Sind jetzt R und M beliebig, gibt es zu jedem Primideal p nach [5, Lemma 1.4] ein kommutatives Diagramm 0 −→ M[p] −→ M[p]  −→ Kok(ϕM [p] ) −→ 0 k µ ↓ ν ↓ 0 −→ M[p] −→ (M ◦◦ )[p] −→ (Kok ϕ)[p] −→ 0 mit exakten Zeilen, in dem µ, also auch ν ein Isomorphismus ist (wobei  das Matlis-Duale über dem lokalen Ring R/p sei). Genau dann ist jetzt µ(p, M) = µ(p, M ◦◦ ), wenn M[p] und M[p]  denselben Rang über R/p haben, d.h. nach dem zweiten Schritt Kok(ϕM [p] ) über R/p torsion ist, d.h. (Kok ϕ)[p] über R/p torsion ist, d.h. p ∈ / Ass(Kok ϕ).  Folgerung 1.2 Genau dann ist M reflexiv, wenn µ(p, M) = µ(p, M ◦◦ ) gilt für alle Primideale p. Folgerung 1.3 Gibt es einen Monomorphismus M ◦◦ ֒→ M oder einen Epimorphismus M ։ M ◦◦ , so ist M bereits reflexiv. 2 Beweis. Bei der ersten Folgerung ist Kok ϕ = 0 äquivalent mit der rechten Seite. Bei der zweiten gilt für jeden Monomorphismus f : X ֒→ M, daß µ(p, X) ≤ µ(p, M) ist für alle p, bei X = M ◦◦ also µ(p, M ◦◦ ) = µ(p, M) wie gewünscht. Ist aber g : M ։ M ◦◦ ein Epimorphismus, wird g ◦ : M ◦◦◦ → M ◦ ein Monomorphismus, so daß nach eben M ◦ reflexiv ist, also auch M.  Bemerkung 1.4 In einigen Spezialfällen läßt sich sofort entscheiden, wann ein Primideal p die Bedingung im Satz erfüllt: (1) Für alle p ∈ / Ass(M ◦◦ ) gilt µ(p, M) = µ(p, M ◦◦ ) (denn beide Seiten sind Null). (2) Ist M = E n mit n ≥ 1, gilt µ(p, M) = µ(p, M ◦◦ ) genau dann, wenn R/p vollständig ist (denn die Reflexivität von M[m] liefert Ass(Kok ϕ) = Ass(M ◦◦ )\{m}, und bekanntlich · ist Ass(M ◦◦ ) = Koass(R̂) = {m} ∪ {p ∈ Spec(R) | R/p ist unvollständig}). (3) Ist M = E (I) mit I unendlich, gibt es überhaupt kein Primideal p mit µ(p, M) = µ(p, M ◦◦ ) (denn auch M[p] ist nicht reflexiv, also nach Beispiel 1 im 2.Abschnitt Rang(M[p]) < Rang(M[p]  ) über R/p). 2 Starke (Ko–)Torsionsmoduln Ist R ein Integritätsring, so ist die Klasse C aller R-Moduln M mit Rang(M) = Rang(M ◦◦ ) nach dem 2.Schritt in (1.1) gegenüber Untermoduln, Faktormoduln und Gruppenerweiterungen abgeschlossen. Ein torsionsfreier R-Modul M gehört genau dann zu C, wenn Kok ϕ = 0, d.h. M reflexiv ist — siehe die genauere Beschreibung in (2.3). Ein Torsionsmodul M gehört genau dann zu C, wenn M ◦◦ torsion ist — und T dafür haben wir keine explizi◦◦ te Beschreibung. Nur wenn M sogar stark torsion, d.h. Ass(M ◦◦ ) 6= 0 ist (siehe [5, p.126], können wir die Struktur von M angeben: Satz 2.1 Ist R ein Integritätsring, kein Körper, so sind für einen R-Modul M äquivalent: (i) M ◦◦ ist stark torsion. (ii) D(M) ist artinsch und reflexiv, M/D(M) ist beschränkt. Ass(M ◦◦ ) = Koass(M ◦ ) ist nach Voraussetzung T Beweis. ◦ (i → ii) Wegen Koass(M ) 6= 0, d.h. M ◦ im Sinne von [5, p.126] stark kotorsion, so daß nach dem dortigen Satz 2.3 in der exakten Folge 0 −→ T (M ◦ ) ⊂ M ◦ −→ M ◦ /T (M ◦ ) −→ 0 das erste Glied beschränkt und das dritte endlich erzeugt ist. Für den divisiblen Anteil D(M) ist dann D(M)◦ torsionsfrei, als Faktormodul von M ◦ /T (M ◦ ) also endlich erzeugt und reflexiv (sogar rein-injektiv), also D(M) selbst artinsch und reflexiv. In der exakten Folge 0 −→ [M ◦ /T (M ◦ )]◦ −→ M ◦◦ −→ [T (M ◦ )]◦ −→ 0 3 ist dann das erste Glied artinsch und das dritte beschränkt, also r · M ◦◦ artinsch für ein 0 6= r ∈ R. Es folgt r · M artinsch, r · M/D(r · M) beschränkt, also auch M/D(M) beschränkt wie behauptet. (ii → i) Zu D = D(M) gibt es nach Voraussetzung ein 0 6= r ∈ m mit r · M/D = 0. ◦◦ Für jedes p ∈ Ass(M ) gilt dann p ∈ Ass(D ◦◦ ) oder p ∈ Ass((M/D)◦◦ ), p = m oder T r ∈ p, also r ∈ Ass(M ◦◦ ) wie verlangt.  Bemerkung 2.2 Ist R ein Integritätsring und M ◦◦ nur torsion, so können wir wenigstens zeigen: (1) Stets ist D(M) artinsch. (2) Ist R ein unvollständiger Nagataring, so ist M sogar beschränkt. (3) Besitzt Koass(M ◦ ) eine endliche finale Teilmenge, d.h. ist M ◦ gut im Sinne von [5, p.133], so ist M ◦◦ bereits stark torsion. Beispiel 1 Ist R ein Integritätsring, M injektiv und Rang(M) = Rang(M ◦◦ ), so ist M bereits reflexiv. Beweis. T (M) ist abgeschlossen, also direkter Summand in M, und in M = T (M) ⊕ M1 ist dann M1 ∈ C, M1 torsionsfrei, also M1 reflexiv. Sei jetzt gleich M injektiv und torsion: Nach Voraussetzung ist M ◦◦ torsion, außerdem M ◦ flach, also gut, so daß M ◦◦ sogar stark torsion ist und mit (2.1) die Behauptung folgt.  Beispiel 2 Ist R ein diskreter Bewertungsring, so gilt für jeden R-Modul M: Rang (M) = Rang (M ◦◦ ) ⇐⇒ M = M1 ⊕ M2 mit M1 reflexiv, M2 beschränkt. Beweis. Nur ′′ ⇒′′ ist zu zeigen, und weil über R jeder Modul gut ist, ist T (M)◦◦ sogar stark torsion, also nach (2.1) D(T (M)) artinsch und reflexiv, T (M)/D(T (M)) beschränkt. Damit ist T (M) = D(T (M)) ⊕ M2 rein-injektiv, M = T (M) ⊕ M3 , also M = M1 ⊕ M2 mit M1 = D(T (M)) ⊕ M3 reflexiv und M2 beschränkt.  Sei R wieder beliebig und M reflexiv. Dann folgt aus der Bijektion L(M) → L(M ◦ ), U 7→ AnnM ◦ (U), daß für jeden Untermodul U von M die Menge {V ⊂ M| V + U = M} ein minimales Element V0 besitzt, ein sogenanntes (Additions-)Komplement von U in M. Allein aus dieser Komplementeigenschaft folgt sehr viel für die Struktur von M: Satz 2.3 Ist R ein Integritätsring mit Quotientenkörper K 6= R und M ein komplementierter R-Modul, so gilt M = M1 + M2 + D(M), wobei M1 beschränkt, M2 endlich erzeugt und D(M) von der Form D1 ⊕ D2 ist mit D1 artinsch, D2 ∼ = K n (n ≥ 0). Beweis. Sei P (M) der größte radikalvolle Untermodul von M. Weil dann jeder Zwischenmodul P (M) ⊂ U ⊂ M, mit M/U radikalvoll, ein Komplement in M besitzt, 4 folgt bereits U = M, d.h. M/P (M) ist koatomar. Ein Komplement V0 von P (M) in M ist dann ebenfalls koatomar, also von der Form V0 = V1 + M2 mit M2 endlich erzeugt, me V1 = 0 für ein e ≥ 1. Weil auch P (M) komplementiert ist [4, Lemma 2.6], besitzt P (M)/D(M) wie eben keine teilbaren Faktormoduln, ist also kotorsion. Nach [3, Theorem 2.4] ist nun P (M) minimax, ein Komplement W0 von D(M) in P (M) also sogar stark kotorsion, außerdem radikalvoll, d.h. nach [5, Satz 2.3] schon beschränkt. Damit ist auch M1 = W0 + V1 beschränkt und M = M1 + M2 + D(M). Bleibt D(M) zu zerlegen: Auch D1 = T (D(M)) ist minimax, besitzt also einen endlich erzeugten Untermodul X, so daß D1 /X artinsch ist, und aus X ⊂ D1 [r] mit 0 6= r ∈ R folgt, daß auch D1 /D1 [r] ∼ = rD1 , also D1 selbst artinsch ist. Weil D(M)/D1 teilbar, torsionsfrei und minimax ist, also isomorph zu K n (≥ 0), ist D1 als reiner, artinscher Untermodul von D(M) sogar direkter Summand, D(M) = D1 ⊕ D2 und D2 ∼ = K n wie gewünscht.  Bemerkung 2.4 Seien R und M wie in Satz 2.3. Falls dim(R) ≥ 2, ist bekanntlich K als R-Modul nicht minimax, also D2 = 0 und daher D(M) selbst artinsch. Literatur [1] M.Brodmann and R.Y.Sharp: Local Cohomology, An Algebraic Introduction with Geometric Applications: Cambridge Univ. Press (1998) [2] H.Matsumura: Commutative Ring Theory: Cambridge Univ. Press (1986) [3] P.Rudlof: On the structure of couniform and complemented modules: J. Pure Appl. Algebra 74 (1991) 281-305 [4] H.Zöschinger: Gelfandringe und koabgeschlossene Untermoduln: Bayer. Akad. Wiss. Math.-Naturw. Kl., S.B. 3 (1982) 43-70 [5] H.Zöschinger: Starke Kotorsionsmoduln: Arch. Math. 81 (2003) 126-141 5
0math.AC
Flying Insect Classification with Inexpensive Sensors Yanping Chen Department of Computer Science & Engineering, University of California, Riverside ychen053@ucr.edu Adena Why Department of Entomology, University of California, Riverside awhy001@ucr.edu Gustavo Batista University of São Paulo - USP gbatista@icmc.usp.br Agenor Mafra-Neto ISCA Technologies president@iscatech.com Eamonn Keogh Department of Computer Science & Engineering, University of California, Riverside eamonn@cs.ucr.edu Abstract The ability to use inexpensive, noninvasive sensors to accurately classify flying insects would have significant implications for entomological research, and allow for the development of many useful applications in vector control for both medical and agricultural entomology. Given this, the last sixty years have seen many research efforts on this task. To date, however, none of this research has had a lasting impact. In this work, we explain this lack of progress. We attribute the stagnation on this problem to several factors, including the use of acoustic sensing devices, the overreliance on the single feature of wingbeat frequency, and the attempts to learn complex models with relatively little data. In contrast, we show that pseudo-acoustic optical sensors can produce vastly superior data, that we can exploit additional features, both intrinsic and extrinsic to the insect’s flight behavior, and that a Bayesian classification approach allows us to efficiently learn classification models that are very robust to overfitting. We demonstrate our findings with large scale experiments that dwarf all previous works combined, as measured by the number of insects and the number of species considered. Keywords Automate Insect classification, Insect flight sound, Insect wingbeat, Bayesian classifier, Flight activity circadian rhythm Introduction The idea of automatically classifying insects using the incidental sound of their flight (as opposed to deliberate insect sounds produced by stridulation (Hao et al. 2012)) dates back to the very dawn of computers and commercially available audio recording equipment. In 1945 1 , three researchers at the Cornell University Medical College, Kahn, Celestin and Offenhauser, used equipment donated by Oliver E. Buckley (then President of the Bell Telephone Laboratories) to record and analyze mosquito sounds (Kahn et al. 1945). The authors later wrote, “It is the authors’ considered opinion that the intensive application of such apparatus will make possible the precise, rapid, and simple observation of natural phenomena related to the sounds of disease-carrying mosquitoes and should lead to the more effective control of such mosquitoes and of the diseases that they transmit.” (Kahn and Offenhauser 1949). In retrospect, given the importance of insects in human affairs, it seems astonishing that more progress on this problem has not been made in the intervening decades. 1 An even earlier paper (Reed et al. 1941) makes a similar suggestion. However, these authors determined the wingbeat frequencies manually, aided by a stroboscope. There have been sporadic efforts at flying insect classification from audio features (Sawedal and Hall 1979; Schaefer and Bent 1984; Unwin and Ellington 1979; Moore et al. 1986), especially in the last decade (Moore and Miller 2002; Repasky et al. 2006); however, little real progress seems to have been made. By “lack of progress” we do not mean to suggest that these pioneering research efforts have not been fruitful. However, we would like to have automatic classification to become as simple, inexpensive, and ubiquitous as current mechanical traps such as sticky traps or interception traps (Capinera 2008), but with all the advantages offered by a digital device: higher accuracy, very low cost, real-time monitoring ability, and the ability to collect additional information (time of capture2, etc.). We feel that the lack of progress in this pursuit can be attributed to three related factors: 1. Most efforts to collect data have used acoustic microphones (Reed et al. 1942; Belton et al. 1979; Mankin et al. 2006; Raman et al. 2007). Sound attenuates according to an inverse squared law. For example, if an insect flies just three times further away from the microphone, the sound intensity (informally, the loudness) drops to one ninth. Any attempt to mitigate this by using a more sensitive microphone invariably results in extreme sensitivity to wind noise and to ambient noise in the environment. Moreover, the difficulty of collecting data with such devices seems to have led some researchers to obtain data in unnatural conditions. For example, nocturnal insects have been forced to fly by tapping and prodding them under bright halogen lights; insects have been recorded in confined spaces or under extreme temperatures (Belton et al. 1979; Moore and Miller 2002). In some cases, insects were tethered with string to confine them within the range of the microphone (Reed et al. 1942). It is hard to imagine that such insect handling could result in data which would generalize to insects in natural conditions. 2. Unsurprisingly, the difficultly of obtaining data noted above has meant that many researchers have attempted to build classification models with very limited data, as few as 300 instances (Moore 1991) or less. However, it is known that for building 2 A commercially available rotator bottle trap made by BioQuip® (2850) does allow researchers to measure the time of arrival at a granularity of hours. However, as we shall show in Section Additional Feature: Circadian Rhythm of Flight Activity, we can measure the time of arrival at a sub-second granularity and exploit this to improve classification accuracy. classification models, more data is better (Halevy et al. 2009; Banko and Brill 2001; Shotton et al. 2013). 3. Compounding the poor quality data issue and the sparse data issue above is the fact that many researchers have attempted to learn very complicated classification models 3 , especially neural networks (Moore et al. 1986; Moore and Miller 2002; Li et al. 2009). However, neural networks have many parameters/settings, including the interconnection pattern between different layers of neurons, the learning process for updating the weights of the interconnections, the activation function that converts a neuron’s weighted input to its output activation, etc. Learning these on say a spam/email classification problem with millions of training data is not very difficult (Zhan et al. 2005), but attempting to learn them on an insect classification problem with a mere twenty examples is a recipe for overfitting (cf. Figure 3). It is difficult to overstate how optimistic the results of neural network experiments can be unless rigorous protocols are followed (Prechelt 1995). In this work, we will demonstrate that we have largely solved all these problems. We show that we can use optical sensors to record the “sound” of insect flight from meters away, with complete invariance to wind noise and ambient sounds. We demonstrate that these sensors have allowed us to record on the order of millions of labeled training instances, far more data than all previous efforts combined, and thus allow us to avoid the overfitting that has plagued previous research efforts. We introduce a principled method to incorporate additional information into the classification model. This additional information can be as quotidian and as easy-to-obtain as the time-of-day, yet still produce significant gains in accuracy. Finally, we demonstrate that the enormous amounts of data we collected allow us to take advantage of “The unreasonable effectiveness of data” (Halevy et al. 2009) to produce simple, accurate and robust classifiers. In summary, we believe that flying insect classification has moved beyond the dubious claims created in the research lab and is now ready for real-world deployment. The sensors 3 While there is a formal framework to define the complexity of a classification model (i.e. the VC dimension (Vapnik and Chervonenkis 1971)), informally we can think of a complicated or complex model as one that requires many parameters to be set or learned. and software we present in this work will provide researchers worldwide robust tools to accelerate their research. Background and Related Work The vast majority of attempts to classify insects by their flight sounds have explicitly or implicitly used just the wingbeat frequency (Reed et al. 1942; Sotavalta 1947; Sawedal and Hall 1979; Schaefer and Bent 1984; Unwin and Ellington 1979; Moore et al. 1986; Moore 1991). However, such an approach is limited to applications in which the insects to be discriminated have very different frequencies. Consider Figure 1.I which shows a histogram created from measuring the wingbeat frequencies of three (sexed) species of insects, Culex stigmatosoma (female), Aedes aegypti (female), and Culex tarsalis (male) (We defer details of how the data was collected until later in the paper). Ae. aegypti. ♀ I Cx. stigmatosoma. ♀ 0 200 Cx. tarsalis. ♂ 400 600 Ae. aegypti. ♀ II Cx. stigmatosoma. ♀ 0 800 200 Cx. tarsalis. ♂ 400 600 800 Figure 1: I) Histograms of wingbeat frequencies of three species of insects, Cx. stigmatosoma ♀, Ae. aegypti. ♀, and Cx. tarsalis. ♂. Each histogram is derived based on 1,000 wingbeat sound snippets. II) Gaussian curves that fit the wingbeat frequency histograms It is visually obvious that if asked to separate Cx. stigmatosoma ♀ from Cx. tarsalis ♂, the wingbeat frequency could produce an accurate classification, as the two species have very different frequencies with minimal overlap. To see this, we can compute the optimal Bayes error rate (Fukunaga 1990), which is a strict lower bound to the actual error rate obtained by any classifier that considers only this feature. Here, the Bayes error rate is half the overlapping area under both curves divided by the total area under the two curves. Because there is only a tiny overlap between the wingbeat frequency distributions of the two species, the Bayes error rate is correspondingly small, 0.57% if we use the raw histograms and 1.08% if we use the derived Gaussians. However, if the task is to separate Cx. stigmatosoma. ♀ from Ae. aegypti. ♀, the wingbeat frequency will not do as well, as the frequencies of these two species overlap greatly. In this case, the Bayes error rate is much larger, 24.90% if we use the raw histograms and 30.95% if we use the derived Gaussians. This problem can only get worse if we consider more species, as there will be increasing overlap among the wingbeat frequencies. This phenomenon can be understood as a real-value version of the Pigeonhole principle (Grimaldi 1989). As a concrete example, assume we limit our attention to just mosquitoes. There are more than 3,500 species of mosquitoes described worldwide. Assume the range of the mosquito wingbeat frequency is between 100 Hz and 1,000 Hz. If each species takes up an integer wingbeat frequency, then at least 2,600 species must share a same wingbeat frequency with another species, as there are only 900 possible frequency values. The actual overlap rate will be even higher because the typical wingbeat frequency for a species is a distribution peaking at some value rather than just a single integer value, as shown in Figure 1.I. Given this, it is unsurprising that some doubt the utility of wingbeat sounds to classify the insects. However, we will show that the analysis above is pessimistic. Insect flight sounds can allow much higher classification rates than the above suggests because:  There is more information in the flight sound signal than just the wingbeat frequency. By analogy, humans have no problem distinguishing between Middle C on a piano and Middle C on a saxophone, even though both are the same 261.62 Hz fundamental frequency. The Bayes error rate to classify the three species in Figure 1.I using just the wingbeat frequency is 19.13%; however, as we shall see below in the section titled Flying Insect Classification, that by using the additional features from the signal, we can obtain an error rate of 12.43%. We believe that our experiments are the first explicit demonstration that there is actionable information in the signal beyond the wingbeat frequency.  We can augment the wingbeat sounds with additional cheap-to-obtain features that can help to improve the classification performance. For example, many species may have different flight activity circadian rhythms. As we shall see below in the section titled Additional Feature: Circadian Rhythm of Flight Activity, simply incorporating the timeof-intercept information can significantly improve the performance of the classification. The ability to allow the incorporation of auxiliary features is one of the reasons we argue that the Bayesian classifier is ideal for this task (cf. Section Flying Insect Classification), as it can gracefully incorporate evidence from multiple sources and in multiple formats. One of the meta-features that the Bayesian classifier can incorporate is the prior probability of seeing a particular insect. In some cases, we may be able to further improve the accuracy of classification by adjusting these prior probabilities with some on-site intervention. For example, we may use attractants or repellants, or we may construct the sensors with mechanical barriers that limit entry for large insects, or fans that discourage weak flyers, etc. We leave such considerations to future work. Materials and Methods Insect Colony and Rearing Six species of insects were studied in this work: Cx. tarsalis, Cx. stigmatosoma, Ae. aegypti, Culex quinquefasciatus, Musca domestica and Drosophila simulans. All adult insects were reared from laboratory colonies derived from wild individuals collected at various locations. Cx. tarsalis colony was derived from wild individuals collected at the Eastern Municipal Water District’s demonstration constructed treatment wetland (San Jacinto, CA) in 2001. Cx. quinquefasciatus colony was derived from wild individuals collected in southern California in 1990 (Georghiou and Wirth 1997). Cx. stigmatosoma colony was derived from wild individuals collected at the University of California, Riverside, Aquatic Research Facility in Riverside, CA in 2012. Ae. aegypti colony was started in 2000 with eggs from Thailand (Van Dam and Walton 2008). Musca domestica colony was derived from wild individuals collected in San Jacinto, CA in 2009, and Drosophila simulans colony were derived from wild individuals caught in Riverside, CA in 2011. The larvae of Cx. tarsalis, Cx. quinquefasciatus, Cx. stigmatosoma and Ae. aegypti were reared in enamel pans under standard laboratory conditions (27°C, 16:8 h light:dark [LD] cycle with 1 hour dusk/dawn periods) and fed ad libitum on a mixture of ground rodent chow and Brewer’s yeast (3:1, v:v). Musca domestica larvae were kept under standard laboratory conditions (12:12 h light:dark [LD] cycle, 26°C, 40% RH) and reared in a mixture of water, bran meal, alfalfa, yeast, and powdered milk. Drosophila simulans larvae were fed ad libitum on a mixture of rotting fruit. Mosquito pupae were collected into 300-mL cups (Solo Cup Co., Chicago IL) and placed into experimental chambers. Alternatively, adults were aspirated into experimental chambers within 1 week of emergence. The adult mosquitoes were allowed to feed ad libitum on a 10% sucrose and water mixture; food was replaced weekly. Cotton towels were moistened, twice a week, and placed on top of the experimental chambers and a 300-ml cup of tap water (Solo Cup Co., Chicago IL) was kept in the chamber at all times to maintain a higher level of humidity within the cage. Musca domestica adults were fed ad libitum on a mixture of sugar and low-fat dried milk, with free access to water. Drosophila simulans adults were fed ad libitum on a mixture of rotting fruit. Experimental chambers consisted of Kritter Keepers (Lee’s Aquarium and Pet Products, San Marcos, CA) that were modified to include the sensor apparatus as well as a sleeve (Bug Dorm sleeve, Bioquip, Rancho Dominguez, CA) attached to a piece of PVC piping to allow access to the insects. Two different sizes of experimental chambers were used, the larger 67 cm L x 22 cm W x 24.75 cm H, and the smaller 30 cm L x 20 cm W x 20 cm H. The lids of the experimental chambers were modified with a piece of mesh cloth affixed to the inside in order to prevent escape of the insects, as shown in Figure 2.I. Experimental chambers were maintained on a 16:8 h light:dark [LD] cycle, 20.5-22°C and 30-50% RH for the duration of the experiment. Each experimental chamber contained 20 to 40 individuals of a same species, in order to capture as many flying sounds as possible while limiting the possibility of capturing more than one insect-generated sound at a same time. I II Insect handling portal Phototransistor array Lid Circuit board Laser source Laser beam Power supply Recording device Figure 2: I) One of the cages used to gather data for this project. II) A logical version of the setup with the components annotated Instruments to Record Flying Sounds We used the sensor described in (Batista 2011) to capture the insect flying sounds. The logic design of the sensor consists of a phototransistor array which is connected to an electronic board, and a laser line pointing at the phototransistor array. When an insect flies across the laser beam, its wings partially occlude the light, causing small light fluctuations. The light fluctuations are captured by the phototransistor array as changes in current, and the signal is filtered and amplified by the custom designed electronic board. The physical version of the sensor is shown in Figure 2.I. The output of the electronic board feeds into a digital sound recorder (Zoom H2 Handy Recorder) and is recorded as audio data in the MP3 format. Each MP3 file is 6 hours long, and a new file starts recording immediately after a file has recorded for 6 hours, so the data is continuous. The length of the MP3 file is limited by the device firmware rather than the disk space. The MP3 standard is a lossy format and optimized for human perception of speech and music. However, most flying insects produce sounds that are well within the range of human hearing and careful comparisons to lossless recordings suggest that we lose no exploitable (or indeed, detectable) information. Sensor Data Processing We downloaded the MP3 sound files to a PC twice a week and used a detection algorithm to automatically extract the brief insect flight sounds from the raw recording data. The detection algorithm used a sliding window to “slide” through the raw data. At each data point, a classifier/detector is used to decide whether the audio segment contains an insect flying sound. It is important to note that the classifier used at this stage is solving the relatively simple two-class task, differentiating between insect|non-insect. We will discuss the more sophisticated classifier, which attempts to differentiate species and sex, in the next section. The classifier/detector used for the insect|non-insect problem is a nearest neighbor classifier based on the frequency spectrum. For ground truth data, we used ten flying sounds extracted from early experiments as the training data for the insect sounds, and ten segments of raw recording background noise as the training data for the non-insect sounds. The number of training data was limited to ten, because more training data would slow down the algorithm while fewer data would not represent variability observed. Note that the training data for background sounds can be different from minute to minute. This is because while the frequency spectrum of the background sound has little variance within a short time interval, it can change greatly and unpredictably in the long run. This variability (called concept drift in the machine learning community (Tsymbal 2004; Widmer and Kubat 1996)) may be due to the effects of temperature change on the electronics and the slow decline of battery output power etc. Fortunately, given the high signal-to-noise ratio in the audio, the high variation of the non-insect sounds does not cause a significant problem. Figure 5.I shows an example of a one-second audio clip containing a flying insect generated by our sensor. As we can see, the signal of insects flying across the laser is well distinguished from the background signal, as the amplitude is much higher and the range of frequency is quite different from that of background sound. The length of the sliding window in the detection algorithm was set to be 100 ms, which is about the average length of a flying sound. Each detected insect sound is saved into a onesecond long WAV format audio file by centering the insect flying signal and padding with zeros elsewhere. This makes all flying sounds the same length and simplifies the future archiving and processing of the data. Note that we converted the audio format from MP3 to WAV at this stage. This is simply because we publicly release all our data so that the community can confirm and extend our results. Because the vast majority of the signal processing community uses Matlab, and Matlab provides native functions for working with WAV files, this is the obvious choice for an archiving format. Figure 5.II shows the saved audio of the insect sound shown in Figure 5.I. Flying sounds detected in the raw recordings may be contaminated by the background noise, such as the 60 Hz noise from the American domestic electricity, which “bleeds” into the recording due to the inadequate filtering in power transformers. To obtain a cleaner signal, we applied the spectral subtraction technique (Boll 1979; Ephraim and Malah 1984) to each detected flying sound to reduce noise. Flying Insect Classification In the section above, we showed how a simple nearest neighbor classifier can detect the sound of insects, and pass the sound snippet on for further inspection. Here, we discuss algorithms to actually classify the snippets down to species (and in some cases, sex) level. While there are a host of classification algorithms in the literature (decision trees, neural networks, nearest neighbor, etc.), the Bayes classifier is optimal in minimizing the probability of misclassification (Devroye 1996), under the assumption of independence of features. The Bayes classifier is a simple probabilistic classifier that predicts class membership probabilities based on Bayes’ theorem. In addition to its excellent classification performance, the Bayesian classifier has several properties that make it extremely useful in practice and particularly suitable to the task at hand. 1. The Bayes classifier is undemanding in both CPU and memory requirements. Any devices to be deployed in the field in large quantities will typically be small devices with limited resources, such as limited memory, CPU power and battery life. The Bayesian classifier (once constructed offline in the lab) requires time and space resources that are just linear in the number of features. 2. The Bayes classifier is very easy to implement. Unlike neural networks (Moore and Miller 2002; Li et al. 2009), the Bayes classifier does not have many parameters that must be carefully tuned. In addition, the model is fast to build, and it requires only a small amount of training data to estimate the distribution parameters necessary for accurate classification, such as the means and variances of Gaussian distributions. 3. Unlike other classification methods that are essentially “black box”, the Bayesian classifier allows for the graceful introduction of user knowledge. For example, if we have external (to the training data set) knowledge that given the particular location of a deployed insect sensor we should expect to be twice as likely to encounter a Cx. tarsalis as an Ae. aegypti, we can “tell” the algorithm this, and the algorithm can use this information to improve its accuracy. This means that in some cases, we can augment our classifier with information gleaned from the text of journal papers or simply the experiences of field technicians. In Section A Tentative Additional Feature: Geographic Distribution, we give a concrete example of this. 4. The Bayesian classifier simplifies the task flagging anomalies. Most classifiers must make a classification decision, even if the object being classified is vastly different to anything observed in the training phase. In contrast, we can slightly modify the Bayesian classifier to produce an “Unknown” classification. One or two such classifications per day could be ignored, but a spate of them could be investigated in case it is indicative of an infestation of a completely unexpected invasive species. 5. When there are multiple features used for classification, we need to consider the possibility of missing values, which happens when some features are not observed. For example, as we discuss below, we use time-of-intercept as a feature. However, a dead clock battery could deny us this feature even when the rest of the system is working perfectly. Missing values are a problem for any learner and may cause serious difficulties. However, the Bayesian classifier can trivially handle this problem, simply by dynamically ignoring the feature in question at classification time. Because of the considerations listed above, we argue that the Bayesian classifier is the best for our problem at hand. Note that our decision to use Bayesian classifier, while informed by the above advantages, was also informed by an extensive empirical comparison of the accuracy achievable by other methods, given that in some situations accuracy trumps all other considerations. While we omit exhaustive results for brevity, in Figure 3 we show a comparison with the neural network classifier, as it is the most frequently used technique in the literature (Moore and Miller 2002). We considered only the frequency spectrum of wingbeat snippets for the three species discussed in Figure 1. The training data was randomly sampled from a pool of 1,500 objects, and the test data was a completely disjoint set of 1,500 objects, and we tested over 1,000 random resamplings. For the neural network, we used a single hidden layer of size ten, which seemed to be approximately the default parameters in the literature. 0.9 0.8 Mean performance of Bayesian Classifier Mean performance of Neural Network 0.7 0.6 Worst performance of Bayesian Classifier Worst performance of Neural Network 0.5 0.4 0.3 0.2 5 10 20 30 40 50 Number of items in the training set Figure 3: A comparison of the mean and worst performance of the Bayesian versus Neural Networks Classifiers for datasets ranging in size from five to fifty. The results show that while the neural network classifier eventually converges on the performance of the Bayesian classifier, it is significantly worse for smaller datasets. Moreover, for any dataset size in the range examined, it can occasionally produce pathologically poor results, doing worse than the default rate of 33.3%. Note that our concern about performance on small datasets is only apparently in conflict with our claim that our sensors can produce massive datasets. In some cases, when dealing with new insect species, it may be necessary to bootstrap the modeling of the species by using just a handful of annotated examples to find more (unannotated) examples in the archives, a process known as semi-supervised learning (Chen et al. 2013). The intuition behind Bayesian classification is to find the mostly likely class given the data observed. The probability that an observed data X belongs to a class 𝐶i , 𝑃(𝐶i |𝑋) , is computed using the Bayes rule as: 𝑃(𝐶i |𝑋) = 𝑃(𝐶𝑖 )𝑃(𝑋|𝐶𝑖 ) 𝑃(𝑋) where 𝑃(𝐶i ) is a prior probability of class 𝐶i , that can be estimated from frequencies in the database; 𝑃(𝑋|𝐶𝑖 ) is the probability of observing the data X in class 𝐶i ; and 𝑃(𝑋) is the probability of occurrence of the observed data X. The probability 𝑃(𝑋) is usually unknown, but since it does not depend on the class, it is usually understood as a normalization factor, and thus, only the numerator is considered for classification. The probability 𝑃(𝐶i |𝑋)is proportional to the numerator: 𝑃(𝐶i |𝑋) ∝ 𝑃(𝐶𝑖 )𝑃(𝑋|𝐶𝑖 ) (1) The 𝑃(𝐶i |𝑋) is called the posterior probability. The Bayesian classifier assigns the data to the class 𝐶̂ which has the highest posterior probability, that is, 𝐶̂ = argmax 𝑃(𝐶𝑖 |𝑋) 𝐶𝑖 ∈𝐶 (2) Where 𝐶 is the set of classes, i.e. {C1 = Cx. stigmatosoma, C2 = Ae. aegypti, ... ,Cn = An. gambiae} A Bayesian classifier can be represented using a graph called Bayesian network. The Bayesian network that uses a single feature for classification is shown in Figure 4. The direction of the arrow in the graph encodes the fact that the probability of an insect to be a member of class C depends on the value of the feature F1 observed (i.e., wingbeat-frequency, time-of-intercept, etc). C F1 Figure 4: A Bayesian network that uses a single feature for classification When the classifier is based on a single feature F1 , the posterior probability that an observed data 𝑓1 belongs to a class 𝐶𝑖 is calculated as: 𝑃(𝐶𝑖 |F1 = 𝑓1 ) ∝ 𝑃(𝐶𝑖 )𝑃(F1 = 𝑓1 |𝐶𝑖 ) (3) Where 𝑃(F1 = 𝑓1 |𝐶𝑖 ) is the class-conditioned probability of observing feature 𝑓1 in class 𝐶𝑖 . For insect classification, the primary data we observed are the flight sounds, as illustrated in Figure 5.I. The flying sound signal is the non-zero amplitude section (red/bold) in the center of the audio, and can be represented by a sequence S = <s1,s2,…sN>, where si is the signal sampled in the instance i and N is the total number of samples of the signal. This sequence contains a lot of acoustic information, and features can be extracted from it. I 0.6 A mosquito flying across the laser, Our sensor captured the flying sound Background noise 0.4 0.2 0 -0.2 -0.4 -0.6 II 4000 8000 0.6 0.2 16000 The flying signal is extracted and centered 0 paddings elsewhere to make each sound one-second long 0.4 12000 0 -0.2 -0.4 -0.6 III 4000 8000 Wingbeat frequency at 354Hz 0.01 0.005 12000 16000 Single-Sided Amplitude Spectrum of the Flying Sound Harmonics 0 0 400 800 1200 1600 2000 Figure 5: I) An example of a one-second audio clip containing a flying sound generated by the sensor. The sound was produced by a female Cx. stigmatosoma. The insect sound is highlighted in red/bold. II) The insect sound that is cleaned and saved into a one-second long audio clip by centering the insect signal and padding with 0s elsewhere. III) The frequency spectrum of the insect sound obtained using DFT The most obvious feature to extract from the sound snippet is the wingbeat frequency. To compute the wingbeat frequency, we first transform the audio signal into a frequency spectrum using the Discrete Fourier Transform (DFT) (Bracewell and Bracewell 1986). As shown in Figure 5.III, the frequency spectrum of the sound in Figure 5.II has a peak in the fundamental frequency at 354 Hz, and some harmonics in integer multiples of the fundamental frequency. The highest peak represents the frequency of interest, i.e., the insect wingbeat frequency. The class-conditioned wingbeat frequency distribution is a univariate density function that can be easily estimated using a histogram. Figure 1.I shows a wingbeat frequency histogram plot for three species of insects (each for a single sex only). We can observe that the histogram for each species is well modeled by Gaussian distribution. Hence, we fit a Gaussian for each distribution and estimated the means and variances using the frequency data. The fitted Gaussian distributions are shown in Figure 1.II. Note that as hinted at in the introduction, the Bayesian classifier does not have to use the idealized Gaussian distribution; it could use the raw histograms to estimate the probabilities instead. However, using the Gaussian distributions is computationally cheaper at classification time and helps guard against overfitting. With these class-conditioned distributions, we can calculate the class-conditioned probability of observing the flying sound from a class, given the wingbeat frequency. For example, suppose the class of the insect shown in Figure 5.I is unknown, but we have measured its wingbeat frequency to be 354 Hz. Further suppose that we have previously measured the mean and standard deviation of female Cx. stigmatosoma wingbeat frequency to be 365 and 41, respectively. We can then calculate the probability of observing this wingbeat frequency from a female Cx. stigmatosoma insect using the Gaussian distribution function: 𝑃(𝑤𝑖𝑛𝑔𝑏𝑒𝑎𝑡 = 354 Hz|female 𝐶𝑥. 𝑠𝑡𝑖𝑔𝑚𝑎𝑡𝑜𝑠𝑜𝑚𝑎 ) = 1 41√2𝜋 𝑒 − (354−365)2 2×412 We can calculate the probabilities for the other classes in a similar way, and predict the unknown insect as the most likely class using equation (2). In this example, the prior probability is equal for each class, and the unknown insect is about 2.1 times more likely to be a female Cx. stigmatosoma than be a female Ae. aegypti (the second most likely class), and thus is (in this case, correctly) classified as a female Cx. stigmatosoma. Note that the wingbeat frequency is a scalar, and learning the class-conditioned density functions for a low-dimensional feature (typically no more than 3 dimensions) is easy, because they can either be fitted using some distribution models, such as the Gaussian distribution, or be approximated using a histogram which can be constructed with a small amount of training data. However, if a feature is high-dimensional, we need other multivariate density function estimation methods, because we usually do not have any idea of what distribution model should fit the distributions of the high-dimensional features, and building a histogram of a high-dimensional feature requires a prohibitively large size of training dataset (the size of training dataset grows exponentially with the increase of dimensionality). The literature has offered some multivariate density function estimation methods for highdimensional variables, such as the Parzen–Rosenblatt window method (Rosenblatt 1956; Parzen 1962) and the k-Nearest-Neighbors (kNN) approach (Mack and Rosenblatt 1979). The kNN approach is very simple; it leads to an approximation of the optimal Bayes classifier, and hence, we use it in this work to estimate the class-conditioned density functions for high-dimensional features. The kNN approach does not require a training phase to learn the class-conditioned density function. It directly uses the training data to estimate the probability of observing an unknown data in a class. Specifically, given an observed data X, the kNN approach first searches the training data to find the top k nearest neighbors of X. It then computes the probability of observing X in class 𝐶i as the fraction of the top k nearest neighbors which are labeled as class 𝐶i , that is, 𝑃(𝑋|𝐶i ) = 𝑘𝐶𝑖 𝑘 (4) Where 𝑘 is a user-provided parameter specifying the number of nearest neighbors, and 𝑘𝐶𝑖 is the number of neighbors that are labeled as class 𝐶i among the top 𝑘 nearest neighbors. With equation (4), we can calculate the class-conditioned probability, and “plug” this into the Bayesian classifier. As an example, imagine that we use the entire spectrum as a feature for the insect sound (cf. Figure 5.II). Given an unknown insect, we first transform its flight sound into the spectrum representation, and then search the entire training data to find the top k nearest neighbors. Suppose we set 𝑘 = 8, and among the eight nearest neighbors, three of them belong to female Cx. stigmatosoma, one belongs to female Ae. aegypti, and four belong to male Cx. tarsalis. We can then calculate the conditional probability using equation (4) as 3 𝑃(X|female Cx. stigmatosoma) = 8 1 𝑃(𝑋|female 𝐴𝑒. 𝑎𝑒𝑔𝑦𝑝𝑡𝑖) = 8 4 𝑃(𝑋|male 𝐶𝑥. 𝑡𝑎𝑟𝑠𝑎𝑙𝑖𝑠) = 8 These conditional probabilities are then multiplied by the class prior probability to calculate the posterior probability, and the observed insect is predicted to be the class which has the highest posterior probability. As such, we are able to estimate the class-conditioned probability for features in any format, including the feature of distance returned from an opaque similarity function, and thus generalize the Bayesian classifier to subsume some of the advantages of the nearest neighbor classifier. Table 1 outlines the Bayesian classification algorithm using the nearest neighbor distance feature. The algorithm begins in Lines 1-3 by estimating the prior probability for each class. This is done by counting the number of occurrences of each class in the training data set. It then estimates the conditional probability for each unknown data using the kNN approach outlined above. Specifically, given an unknown insect sound, the algorithm first searches the entire training data to find the top k nearest neighbors using some distance measure (Lines 59); it then counts for each class the number of neighbors which belong to that class and calculates the class-conditioned probability using equation (1). With the prior probability and the class-conditioned probability known for each class, the algorithm calculates the posterior probability for each class (Lines 13, 15-18) and predicts the unknown data to belong to the class that has the highest posterior probability (Line 19). Table 1: The Bayesian Classification Algorithm Using a High-dimensional Feature Notation k: the number of nearest neighbors in kNN approach disfunc: a distance function to calculate the distance between two data C: a set of classes TRAIN: the training dataset TCi: number of training data that belong to class Ci for i = 1 : |C| 1 P(Ci) = TCi / |TRAIN|; //estimate prior probability 2 end 3 for each unknown data F1 4 for j =1: |TRAIN| 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 d(j) = disfunc(F1 , TRAINj); //the distance of F1 to each training data end [d, sort_index] = sort(d, ‘ascend’); //sort the distance in ascending order top_k = sort_index(1 to k); // find the top-k nearest neighbors for i = 1 : |C| kCi = number of data in top_k that are labeled as class Ci; P(F1 |Ci) = kCi / k; // calculate the conditional probability with kNN approach P(Ci|F1 ) = P(Ci) P(F1 |Ci); // calculate posterior probability end 𝑖=|𝐶| normalize_factor = ∑𝑖=1 P(𝐶𝑖 |F1 ) // normalize the posterior probability for i = 1 : |C| P(𝐶𝑖 |F1 ) = P(𝐶𝑖 |F1)/normalize_factor; end 𝐶̂ = argmax 𝑃(𝐶𝑖 |F1 ) // assign the unknown data F1 to the class 𝐶̂ 𝐶𝑖 ∈𝐶 end The algorithm outlined in Table 1 requires two inputs, including the parameter k. The goal is to choose a value of k that minimizes the probability estimation error. One way to do this is to use validation (Kohavi 1995). The idea is to keep part of the training data apart as validation data, and evaluate different values of k based on the estimation accuracy on the validation data. The value of k which achieves the best estimation accuracy is chosen and used in classification. This leaves only the question of which distance measure to use, that is, how to decide the distance between any two insect sounds. To find a good distance measure for the flying sounds, we turned to crowdsourcing by organizing a contest from July to November in 2012 (Chen et al. 2002) that asked participants to create the best distance measure for the insect sounds. More than fifteen teams worldwide participated in the contest and we received more than eighty submissions (a team is allowed to have multiple submissions and we evaluated each submission, but for the final score, only one submission was scored for a team). The result of the contest suggested that the best distance measure is a simple algorithm which computes the Euclidean distance between the frequency spectrums of the insect sounds. Building on our crowdsourcing efforts, we found that if we truncated the frequency spectrums to exclude data outside the range of possible wingbeat frequencies (cf. Table 2), we could further improve accuracy. Note that some of our crowdsourcing participants had somewhat similar, but less explicit, ideas. Our distance measure is further explained in Table 2. Given two flying sounds, we first transform each sound into frequency spectrums using DFT (Lines 1-2). The spectrums are then truncated to include only those corresponding to the frequency range from 100 to 2,000 (Lines 3-4); the frequency range is thus chosen, because according to entomological advice4, all other frequencies are unlikely to be the result of insect activity, and probably reflect noise in the sensor. We then compute the Euclidean distance between the two truncated spectrums (Line 5) and return it as the distance between the two flying sounds. Table 2: Our Distance Measure for two Insect Flight Sounds Notation: S1,S2: two sound sequences dis: the distance between the two sounds function dis = disfunc(S1,S2) spectrum1 = DFT(S1); 1 spectrum2 = DFT(S2); 2 truncateSpectrum1 = spectrum1(frequency range= [100, 2000]); 3 truncateSpectrum2 = spectrum2(frequency range= [100, 2000]); 4 5 dis = √∑(truncateSpectrum1 − truncateSpectrum2 )2 Our flying-sounds-based insect classification algorithm is obtained by ‘plugging’ the distance measure explained in Table 2 into the Bayesian classification framework outlined in Table 1. To demonstrate the effectiveness of the algorithm, we considered the data that was used to generate the plot in Figure 1. These data were randomly sampled from a dataset with over 100,000 sounds generated by our sensor. We sampled in total 3,000 flying sounds, 1,000 sounds for each species, so the prior probability for each class is one-third. Using our insect classification algorithm with k set to eight, which was selected based on the validation result, we achieved an error rate of 12.43% using leave-one-out. We then compared our algorithm to the optimal result possible using only the wingbeat frequency, which is the most commonly used approach in previous research efforts. The optimal Bayes error-rate to classify the insects using wingbeat frequency is 18.13%, which is the lower bound for any algorithm that uses just that feature. This means that using the truncated frequency spectrum is able to reduce the error rate by almost a third. To the best of our knowledge, this is the first explicit demonstration that there is exploitable information in the flight sounds beyond the wingbeat frequency. It is important to note that we do not claim that the distance measure we used in this work is optimal. There may be better measures, which could be discovered by additional research or 4 Many large insects, i.e. most members of Odonata and/or Lepidoptera, have wingbeat frequencies that are significantly slower than 100 Hz; our choice of truncation level reflects our special interest in Culicidae. by revisiting crowdsourcing, etc. Moreover, it is possible that there may be better distance measures if we are confining our attention to just Culicidae or just Tipulidae, etc. However, if and when a better distance measure is found, we can simply ‘plug’ the distance measure in the Bayesian classification framework to get a better classification performance. Additional Feature: Circadian Rhythm of Flight Activity In addition to the insect flight sounds, there are other features that can be used to reduce the error rate. The features can be very cheap to obtain, as simple as noting the time-of-intercept, yet the improvement can be significant. It has long been noted that different insects often have different circadian flight activity patterns (Taylor 1969), and thus the time when a flying sound is intercepted can be used to help classify insects. For example, house flies (Musca domestica) are more active in the daytime than at night, whereas Cx. tarsalis are more active at dawn and dusk. If an unknown insect sound is captured at noon, it is more probable to be produced by a house fly than by Cx. tarsalis based on this time-of-intercept information. Given an additional feature, we must consider how to incorporate it into the classification algorithm. One of the advantages of using the Bayesian classifier is that it offers a principled way to gracefully combine multiple features; thus, the solution is straightforward here. For simplicity, we temporarily assume the two features, the insect-sound and the time-ofintercept, are conditionally independent, i.e., they are independent given the class (we will revisit the reasonableness of this assumption later). With such an independence of feature assumption, the Bayesian classifier is called Naïve Bayesian classifier and is illustrated in Figure 6. The two arrows in the graph encode the fact that the probability of an unknown data to be in a class depends on the features F1 and F2, whereas the lack of arrows between F1 and F2 means the two features are independent. C F1 F2 Figure 6: A Bayesian network that uses two independent features for classification An observed object X now should include two values, 𝑓1 and 𝑓2 , and the posterior probability of X belonging to a class 𝐶𝑖 is calculated as P(𝐶𝑖 |𝑋) = P(𝐶𝑖 |F1 = 𝑓1 , F2 = 𝑓2 ). With the independence assumption, this probability is proportional to: P(𝐶𝑖 |F1 = 𝑓1 , F2 = 𝑓2 ) ∝ P(𝐶𝑖 )P(F1 = 𝑓1 |𝐶𝑖 )P(F2 = 𝑓2 |𝐶𝑖 ) (5) Where P(Fj = 𝑓𝑗 |Ci ) is the probability of observing the feature-value pair Fj = 𝑓𝑗 in class 𝐶𝑖 . For concreteness, the feature F1 in our algorithm is the insect sound, and F2 is the time when the sound was produced. In the previous section, we have shown how to calculate the class-conditioned probability of the insect-sound, 𝑃(F1 = 𝑓1 |𝐶𝑖 ), using the kNN estimation method and the prior probability 𝑃(𝐶𝑖 ). To incorporate our additional feature, we only need to calculate the class-conditioned probability 𝑃(F2 = 𝑓2 |𝐶𝑖 ). Note that the time-of-intercept is a scalar. As we discussed in the section above, learning the class-conditioned distributions of a one-dimensional feature can be easily done by constructing a histogram. This histogram of the time-of-intercept for a species is simply the insect’s flight activity circadian rhythm. In the literature, there have been many attempts to quantify these patterns for various insects. However, due to the difficulty in obtaining such data, most attempts were made by counting 1 if there is activity observed in a time period (such as a ten-minute window) and 0 otherwise (Taylor and Jones 1969; Rowland and Lindsay 1986). Without distinguishing the number of observations in each period, the resulting patterns have a course granularity. In contrast, by using our sensors we have been able to collect on the order of hundreds of thousands of observations per species, and count the exact number of observations at sub second granularity, producing what we believe are the “densest” circadian rhythms ever recorded. Figure 7 shows the flight activity circadian rhythms of Cx. stigmatosoma (female), Cx. tarsalis (male), and Ae. agypti (female). Those circadian rhythms were learned based on observations collected over one month. The results are consistent with the report in (Mian et al. 1990; Taylor and Jones 1969), but with a much finer temporal resolution (down to minutes). Note that although all three species are most active at dawn and dusk, Ae. aegypti females are significantly more active during daylight hours. 0.015 dusk dawn 0.001 Cx. stigmatosoma. ♀ Cx. tarsalis. ♂ 0.005 Ae. aegypti. ♀ 0 12 a.m. 3 a.m. 6 a.m. 9 a.m. 12 p.m. 3 p.m. 6 p.m. 9 p.m. 12 a.m. Figure 7: The flight activity circadian rhythms of Cx. stigmatosoma (female), Cx. tarsalis (male), and Ae. Aegypti (female), learned based on observations generated by our sensor that were collected over one month For the insects discussed in this work, we constructed circadian rhythms based on many hundreds of thousands of individual observations. However, it is obvious that as our sensors become more broadly used by the community, we cannot always expect to have such finegrained data. For example, there are approximately 3,500 mosquito species worldwide; it is unlikely that high quality circadian rhythms for all of them will be collected in the coming years. However, the absence of “gold standard” circadian rhythms should not hinder us from using this useful additional feature. Instead, we may consider using approximate rhythms. One such idea is to use the circadian rhythms of the most closely related insect species, taxonomically, for which we do have data. For example, suppose we do not have the circadian rhythm for Cx. stigmatosoma, we can use the rhythm of Cx. tarsalis as an approximation if the latter is available. In the cases where we do not have the circadian rhythms for any taxonomically-related insects, we can construct approximate rhythms simply based on text descriptions in the entomological literature. Some frequently encountered descriptions of periods when insects are active include diurnal, nocturnal, crepuscular, etc. Offline, we can build a dictionary of templates based on these descriptions. This process of converting text to probabilities is of course subjective; however, as we will show below, it does lead to improvements over using no time-of-day information. Our simple first attempt at this work is by quantifying different levels of activities with numbers from 1 to 3, representing, low, medium, and high activity5. For example, if an insect is described as diurnal and most active at dawn and dusk, we can use these three degrees to quantify the activities: highest degree at dawn and dusk, second in the daytime, and low activity during the night. The resulting template is shown in Figure 8.IV. Note that a circadian rhythm is a probability distribution that tells how likely we are to capture a certain insect species’ flights at a certain time, and thus each template is normalized such that the area under the template sums to one. In Figure 8.II, we show an approximate circadian rhythm for Cx. stigmatosoma that we constructed this way. We spend two minutes searching the web for an academic paper that describes Cx. stigmatosoma flight activity, discovering that according to (Mian et al. 1990), Cx. stigmatosoma is active at dawn and dusk (crepuscular). dawn dusk I diurnal II crepuscular III nocturne diurnal, most active at dawn and dusk IV 12AM 3AM 6AM 9AM 12PM 3PM 6PM 9PM 12PM Figure 8: Examples of approximation templates for insects’ flight activity circadian rhythm. No markings are shown on the Y-axis; all templates are normalized such that the area under the curve is one, and the smallest value is an epsilon greater than zero In the worst case, if we cannot glean any knowledge about the insect’s circadian rhythm (e.g. a newly-discovered species), we can simply use a constant line as an approximation. The constant line encodes no information about the activity hours of that insect, but it enables the incorporation of the more familiar insects’ circadian rhythms into the classifier to improve 5 The lowest level of flight activity we represent is low, but not zero. In a Bayesian classifier, we never want to assign zero probabilities to an event, unless we are sure it is logically impossible to occur. In practice, a technique called Laplacian correction is typically used to prevent any probability estimate from being exactly zero. performance. In the pathological case where all the circadian rhythms are approximated using a constant line, the classifier degenerates to a Bayesian classifier that does not use this additional feature. Given the above, we can almost always incorporate some of the circadian rhythm information into our classifier. Given a time-of-intercept observation, we can calculate the class-conditioned probability of observing the activity from a species simply by looking up the flight activity circadian rhythms of that species. For example, suppose an insect sound was detected at 6:00am, the probability of observing this activity from a Cx. tarsalis male is three times the probability of observing it from an Ae. aegypti female, according to the circadian rhythms shown in Figure 7. For concreteness, the insect classification algorithm that uses two features is outlined in Table 3. It is similar to the algorithm outlined in Table 1 that uses a single feature. Only five modifications are made. Table 3: The Insect Classification Algorithm Using two Features This algorithm is similar to the one outlined in Table 1. Only three modifications are needed, which are listed below. The modifications are highlighted in blue/bold. 1 Line 6: for each unknown data [𝐅𝟏 , 𝑭𝟐 ] 2 Line 13: P(Ci|𝐅𝟏 , 𝐅𝟐 ) = P(Ci) P(F1 |Ci) 𝐏(𝐅𝟐 |𝑪𝒊 ); // calculate the posterior probability 3 Line 15: normalize_factor = ∑i=1 𝐏(𝑪𝒊 |𝐅𝟏 , 𝐅𝟐 ) // normalize the posterior probability 4 Line 17: 𝐏(𝑪𝒊 |𝐅𝟏 , 𝐅𝟐 ) = 𝐏(𝑪𝒊 |𝐅𝟏 , 𝐅𝟐 )/normalize_factor; 5 Line 19: 𝐶̂ = argmax 𝐏(𝐂𝐢 |𝐅𝟏 , 𝐅𝟐 ) // assign the unknown data X to the class Ĉ i=|C| 𝐶𝑖 ∈𝐶 To demonstrate the benefit of incorporating the additional feature in classification, we again revisit the toy example in Figure 1. With the time-of-intercept feature incorporated and the accurate flight activity circadian rhythms learned using our sensor data, we achieve a classification accuracy of 95.23%. Recall that the classification accuracy using just the insect-sound is 87.57% (cf. the paragraph right below Table 2). Simply by incorporating this cheap-to-obtain feature, we reduce the classification error rate by about two-thirds, from 12.43% to only 4.77%. To test the effect of using proxies of the learned flight activity circadian rhythm, we imagine that we do not have the flight activity circadian rhythm for Cx. stigmatosoma female, and that we must use one of the approximate rhythms discussed above. The results are shown in Table 4. As we can see, even with a constant line approximation, the classification accuracy is 88.73%, slightly better than not using the time-of-intercept feature. This is because, although the algorithm has no knowledge about the circadian rhythm for Cx. stigmatosoma females, it does have knowledge of the other two species’ circadian rhythms. With the approximation created based on the text description, we achieve an accuracy of 90.80%, which is better than using the constant line. This is as we hoped, as the approximate rhythm carries some useful information about the insects’ activity pattern, even though it is at a very coarse granularity. An even better classification accuracy of 93.87% is achieved by using the circadian rhythm of Cx. tarsalis males as the approximation. As can be seen from Figure 7, the circadian rhythm of Cx. tarsalis males is quite close to that of Cx. stigmatosoma females. Table 4: Classification Performance using Different Approximations for Cx. stigmatosoma (female) Flight Activity Circadian Rhythm Flight activity circadian No rhythm constant line description using the learned rhythm approximations used approximation based taxonomically-related using our approximation insect’s rhythm sensor data Classification Accuracy 87.57% 88.73% 90.80% 93.87% 95.23% Note that the classification accuracy with any approximation is worse than that of using the accurate circadian rhythm (95.23% accuracy). This is not surprising, as the more accurate the estimated distribution is, the more accurate the classification will be. This reveals the great utility of our sensor: it allows the inexpensive collection of massive amounts of training data, which can be used to learn accurate distributions. A Tentative Additional Feature: Geographic Distribution In addition to the time-of-intercept, we can also use the location-of-intercept as an additional feature to reduce classification error rate. The location-of-intercept is also very cheap-toobtain. It is simply the location where the sensor is deployed. We must preempt a possible confusion on behalf of the reader. One application of our sensors is estimating the relative abundance of various species of insects at some particular location. However, we are suggesting here that we can use estimates of the relative abundance of the species of insects at that location to do this more accurately. This appears to be a “chicken and egg paradox.” However, there is no contradiction. The classifier is attempting to optimize the accuracy of its individual decisions about each particular insect observed, and knowing, even approximately, the expected prevalence of each species can improve accuracy. The location-of-intercept carries useful information for classification because insects are rarely evenly distributed at any spatial granularity we consider. For example, Cx. tarsalis is relatively rare east of the Mississippi River (Reisen 1993), whereas Aedes albopictus (the Asian tiger mosquito) has now become established in most states in that area (Novak 1992). If an insect is captured in some state east of the Mississippi River, it is more probable to be an Ae. albopictus than a Cx. tarsalis. At a finer spatial granularity, we may leverage knowledge such as “since this trap is next to a dairy farm (an animal manure source), we are five times more likely to see a Sylvicola fenestralis (Window Gnat), than an Anopheles punctipennis.” A Bayesian classifier that uses three features is illustrated in Figure 9. Here, we again assume that all the three features, insect-sound, time-of-intercept, and location-of-intercept, are independent. C F1 F2 F3 Figure 9: A Bayesian network that uses three independent features for classification Based on Figure 9, the probability of an observed object 𝑋 belonging to a class 𝐶𝑖 is calculated as: P(𝐶𝑖 |F1 = 𝑓1 , F2 = 𝑓2 , F3 = 𝑓3 ) ∝ P(𝐶𝑖 )P(F1 = 𝑓1 |𝐶𝑖 )P(F2 = 𝑓2 |𝐶𝑖 )P(F3 = 𝑓3 |𝐶𝑖 ) (6) Where 𝑃(F3 = 𝑓3 |𝐶𝑖 ) is the probability of observing an insect from class 𝐶𝑖 at location 𝑓3 . This probability reflects the geographic distribution of the insects. For classification, we do not need the true absolute densities of insect prevalence; we just need the ratio of densities for the different species at the observation location. This is because with the ratio of 𝑃(F3 = 𝑓3 |𝐶𝑖 ), we can calculate the ratio of the posterior probability P(𝐶𝑖 |F1 = 𝑓1 , F2 = 𝑓2 , F3 = 𝑓3 ) of each species, and predict an observation to belong to the species which has the highest posterior probability. In the case where we do need the actual posterior probability values, we can always calculate them from the posterior probability ratio, based on the constraint that the sum of all posterior probabilities over different classes should be one, as shown in Lines 15-18 in Table 1. To obtain the ratio of P(F3 = 𝑓3 |𝐶𝑖 ) at a given a location is simple. We can glean this information from the text of relevant journal papers or simply from the experiences of local field technicians. For example, suppose we deploy our insect sensor at a location where we should expect to be twice as likely to encounter Cx. tarsalis as Cx. stigmatosoma, the ratio of Cx. tarsalis to Cx. stigmatosoma is 2:1. In the case where we cannot glean any such knowledge about the local insect population, we can temporarily augment our sensor with various insect traps that physically capture insects (i.e. CDC trap for mosquitoes, “yellow sticky cards” traps for sharpshooters, etc.), and use these manually counted number of observations of each species to estimate the ratios. To demonstrate the utility of incorporating this location-of-intercept feature, we did a simple simulation experiment. Note that the insect-sound and time-of-intercept features are real data; only the location-of-intercept was simulated by assuming there are two species of insects, Cx. stigmatosoma (female) and Ae. aegypti (female), which are geographically distributed as shown in Figure 10. We further assumed our sensors are deployed at three different locations, S1, S2 and S3, where S2 is about the same distance from both centers, and S1 and S3 are each close to one of the centers. Here, we model the location distributions as Gaussian density “bumps” for simplicity; however, this is not a necessary assumption, but we can use any density distribution. Distribution of Cx. stigmatosoma ♀ Insect Sensor locations S1 S2 S3 Distribution of Ae. aegypti ♀ Figure 10: The assumptions of geographic distributions of each insect species and sensor locations in our simulation to demonstrate the effectiveness of using location-of-intercept feature in classification To simulate the data captured by the three sensors, we project ten thousand insect exemplars of each species onto the map according to the geographic distribution assumption. We then sample these insects that are within the capture range of the sensors, which is assumed to be a square region centering at the sensor, as shown in Figure 10. Each sampled insect is assumed to fly across our sensor once and have its data captured. In our experiment, we sampled 277 Cx. stigmatosoma females and 3 Ae. aegypti females at location S1, 24 and 44 at location S2, and 4 and 544 at location S3. Using just the frequency spectrum and the time-of-intercept to classify those sampled insects, we achieved an error rate of 5.41%. However, by incorporating the location-of-intercept, we reduced the error rate to 2.54%. This is impressive, as the location-of-intercept information is very cheap-to-obtain, yet it reduced the error rate by more than half. A General Framework for Adding Features In the previous two sections, we have shown how to extend our insect flight sound classifier to incorporate two additional features. However, there may be dozens of additional features that could help improve the classification performance. These potential features are so domain and application specific that we cannot give any more than a few representative examples here. It has long been known that some species of insects have a preferred height at which they fly. For example, (Njie et al. 2009) noted that Anopheline mosquitoes are much likely to be observed than culicine flying at a height two meters, which is the approximate height required to enter through the eave of a house. Here, we imagine using a height-ofintercept feature. By placing two of our sensors side-by-side at a known distance apart and observing the lag between the sensor observations, we can obtain an approximation of the speed at which the insect is flying (only an approximation, as the insect may fly at an angle to the light beam). This speed-of-intercept feature may help to discriminate between speedy members of the genus Culicoides, flying at 250cm/s and the relatively sluggish members of the family Culicidae which max out at about 120cm/s (Bidlingmayer et al. 1995). In this section, we generalize our classifier to a framework that is easily extendable to incorporate arbitrarily many such specialized features. If we compare Figure 4, Figure 6, and Figure 9, which show the Bayesian networks with an increasing number of features, we can see that adding a feature to the classifier is represented by adding a node to the Bayesian network. The Bayesian network that uses 𝑛 independent features for classification is shown in Figure 11. C F1 F2 F3 Fn Figure 11: The general Bayesian network that uses n features for classification, where n is a positive integer With 𝑛 independent features, the posterior probability that an observation belongs to a class 𝐶𝑖 is calculated as: 𝑛 P(𝐶𝑖 |F1 = 𝑓1 , F2 = 𝑓2 , … , Fn = 𝑓𝑛 ) ∝ P(𝐶𝑖 ) ∏ 𝑗=1 P(Fj = 𝑓𝑗 |𝐶𝑖 ) (7) Where P(Fj = 𝑓𝑗 |𝐶𝑖 ) is the probability of observing 𝑓𝑗 in class 𝐶𝑖 . Note that the posterior probability can be calculated incrementally as the number of features increases. That is, if we have used some features to classify the objects, and later on, we have discovered more useful features and would like to add those new features to the classifier to re-classify the objects, we do not have to re-compute the entire classification from scratch. Instead, we can keep the posterior probability obtained from the previous classification (based on the old features), update each posterior probability by multiplying it with the corresponding class-conditioned probability of the new features, and re-classify the objects using the new posterior probabilities. For example, suppose we first used the insect-sound and time-of-intercept to classify an observation 𝑋. The posterior probability of 𝑋 belonging to Ae. aegypti is 0.4 and that of belonging to Cx. tarsalis is 0.6. Later on, we find that location-of-intercept is useful and would like to incorporate this new feature to re-classify 𝑋. Suppose the probability of observing Ae. aegypti at the location where X was intercepted was 0.5, and the probability of observing a Cx. tarsalis at that location was 0.25. In that case, we can update the posterior probability of 𝑋 belonging to Ae. agypti as 0.4 × 0.5 = 0.2, and that of belonging to Cx. tarsalis as 0.5 × 0.25 = 0.125, and (in this case) re-predict 𝑋 to belong to Ae. agypti. The advantage of incremental calculation is that incorporating a new feature is fast; only a simple multiplication is required to calculate a posterior probability. In our discussions thus far, we have assumed that all the features are independent given the class. In practice, features are seldom independent given the class. However, as shown in (Domingos and Pazzani 1997), even when the independence assumption does not hold, the naïve Bayesian classifier may still be optimal in minimizing the misclassification error. Empirical evidence in recent years also showed that the Naïve Bayesian classifier works quite well even in the domains where clear feature dependences exist. In this work, we will not prove that the three features used are conditionally independent. However, as we shall show below, the independence assumption of the features used in our classifier should be reasonable for the Bayesian classifier to work well. Revisiting the Independent Assumption Recall that the naive Bayesian classifier is optimal only under the assumption that the features are independent (Domingos and Pazzani 1997). The majority of experiments in this work consider two features, frequency spectrum (insect-sound) and time-of-intercept. In order to test if these two features F1 and F2 are conditionally independent, we can check if they satisfy the constraint 𝑃(F1 |𝐶𝑖 ) ≅ 𝑃(F1|𝐶𝑖 , F2 ) Concretely, for our task, this constraint is P(𝑠𝑝𝑒𝑐𝑡𝑟𝑢𝑚) ≅ P(𝑠𝑝𝑒𝑐𝑡𝑟𝑢𝑚|𝑡𝑖𝑚𝑒) given a certain insect species. Or equivalently, the properties of frequency spectrum of a given species must be the same at any timestamp. If the spectrum was a scalar value (such as mass or length), we could use a standard test such as a Kolmogorov–Smirnov test to see if the properties observed at two different time windows are from the same distribution. However, the spectrums are vectors, and this complicates this issue greatly. Thus, to see if this constraint is satisfied, we did the following experiment which indirectly but forcefully tests the constraint. We sampled 1,000 insect sounds captured at dawn (between 5:00am-8:00am) and 1,000 sounds captured at dusk (between 8pm-11pm). All the sounds were generated by Ae. aegypti females. We then classified the sounds captured in different time periods using the frequency spectrum. Our hypothesis is that, if the distribution of frequency spectrum of a same species is the same at dawn and at dusk, then it should be impossible to distinguish between sounds captured in the two different periods, and thus the classification error rate would be around 50%. In our experiment, the sounds were sampled from a pool of 10,000 objects, and we averaged over ten samplings with replacement. The average classification error rate was 50.14%, which suggests that there is no perceptible difference in the frequency spectrum of the insect sounds captured at dawn or at dusk. Note that this experiment was conducted for insects observed under constant temperature and humidity in an insectary. It may not generalize to insects observed in the field. However, this experiment increases our confidence that the conditional independence assumption of the two features is at least reasonable. Nevertheless, it is clear that in our general framework, it is possible that users may wish to use features that clearly violate this assumption. For example, if the sensor was augmented to obtain insect mass (a generally useful feature), it is clear from basic principles of allometric scaling that the frequency spectrum feature would not be independent (Deakin 2010). The good news is that as shown in Figure 12, the Bayesian network can be generalized to encode the dependencies among the features. In the cases where there is clear dependence between some features, we can consider adding an arrow between the dependent features to represent this dependence. For example, suppose there is dependence between features F2 and F3 , we can add an arrow between them, as shown by the red arrow in Figure 12. The direction of the arrow represents causality. For example, an insect’s larger mass causes it to have a slower wingbeat. The only drawback to this augmented Bayesian classifier (Keogh and Pazzani 1999) is that more training data is required to learn the classification model if there are feature dependences, as more distribution parameters need to be estimated (e.g., the covariance matrix is required instead of just the standard deviation) . C F1 F2 F3 Fn Figure 12: The Bayesian network that uses n features for classification, with feature 𝐅𝟐 and 𝐅𝟑 being conditionally dependent A Case Study: Sexing Mosquitoes Sexing mosquitoes is required in some entomological applications. For example, Sterile Insect Technique, a method which eliminates large populations of breeding insects by releasing only sterile males into the wild, has to separate the male mosquitoes from the females before being released (Papathanos et al. 2009). Here, we conducted an experiment to see how well it is possible to distinguish female and male mosquitoes from a single species using our proposed classifier. In this experiment, we would like to distinguish male Ae. aegypti mosquitoes from females. The only feature used in this experiment is the frequency spectrum. We did not use the timeof-intercept, as there is no obvious difference between the flight activity circadian rhythms of the males and the females that belong to a same species (A recent paper offers evidence of minor, but measurable differences for the related species Anopheles gambiae (Rund et al. 2012); however, we ignore this possibility here for simplicity). The data used were randomly sampled from a pool of over 20,000 exemplars. We varied the number of exemplars from each sex from 100 to 1,000 and averaged over 100 runs, each time using random sampling with replacement. The average classification performance using leave-one-out cross validation is shown in Figure 13. 1 Average Accuracy 0.995 spectrum 0.99 0.985 0.98 wingbeat 0.975 0.97 0 100 200 300 400 500 600 700 800 900 1000 Number of each sex in training data Figure 13: The classification accuracy of sex discrimination of Ae. agypti mosquitoes with different numbers of training data using our proposed classifier and the wingbeat-frequency-only classifier. We can see that our classifier is quite accurate in sex separation. With 1,000 training data for each sex, we achieved a classification accuracy of 99.22% using just the truncated frequency spectrum. That is, if our classifier is used to separate 1,000 mosquitoes, we will make about eight misclassifications. Note that, as the amount of training data increases, the classification accuracy increases. This is an additional confirmation of the claim that more data improves classification (Halevy et al. 2009). We compared our classifier to the classifier using just the wingbeat frequency. As shown in Figure 13, our classifier consistently outperforms the wingbeat frequency classifier across the entire range of the number of training data. The classification accuracy using the wingbeat classifier was 97.47% if there are 1,000 training data for each sex. Recall that the accuracy using our proposed classifier was 99.22%. By using the frequency spectrum instead of the wingbeat frequency, we reduced the error rate by more than two-thirds, from 2.53% to 0.78%. It is important to recall that in this comparison, the data and the basic classifier were identical; thus, all the improvement can be attributed to the additional information available in the frequency spectrum beyond just the wingbeat frequency. This offers additional evidence for our claim that wingbeat frequency by itself is insufficient for accurate classification. In this experiment, we assume the cost of female misclassification (misclassifying a female as a male) is the same as the cost of male misclassification (misclassifying a male as a female). The confusion matrix of classifying 2,000 mosquitoes (equal size for each sex) with the same cost assumption from one experiment is shown in Table 5. I. Table 5: (I) The confusion matrix for sex discrimination of Ae. aegypti mosquitoes with the decision threshold for female being 0.5 (i.e., same cost assumption). (II) The confusion matrix of sexing the same mosquitoes with the decision threshold for female being 0.1 Predicted class I (Balanced cost) Actual female class male female male 993 7 5 995 Predicted class II (Asymmetric cost) female male Actual female 1,000 0 class male 22 978 However, there are cases in which the misclassification costs are asymmetric. For example, when the Sterile Insect Technique is applied to mosquito control, failing to release an occasional male mosquito because we mistakenly thought it was a female does not matter too much. In contrast, releasing a female into the wild is a more serious mistake, as it is only the females that pose a threat to human health. In the cases where we have to deal with asymmetric misclassification costs, we can change the decision boundary of our classifier to lower the number of high-cost misclassifications in a principled manner. Of course, there is no free lunch, and a reduction in the number of high-cost misclassifications will be accompanied by an increase in the number of low-cost misclassifications. In the previous experiment, with equal misclassification costs, an unknown insect is predicted to belong to the class that has the higher posterior probability. This is the equivalent of saying the threshold to predict an unknown insect as female is 0.5. That is, only when the posterior probability of belonging to the class of females is larger than 0.5 will an unknown insect be predicted as a female. Equivalently, we can replace Line 19 in Table 1 with the code in Table 6 by setting the threshold to 0.5. Table 6: The decision making policy for the sex separation experiment if ( P(𝑓𝑒𝑚𝑎𝑙𝑒|𝑋) ≥ threshold ) 𝑋 is a female else 𝑋 is a male end We can change the threshold to minimize the total cost when the costs of different misclassifications are different. In Sterile Insect Technique, the goal is to reduce the number of female misclassifications. This can be achieved by lowering the threshold required to predict an exemplar to be female. For example, we can set the threshold to be 0.1, so that if the probability of an unknown exemplar belonging to a female is no less than this value, it is predicted as a female. While changing the threshold may result in a lower overall accuracy, as more males will be misclassified as females, it reduces the number of females that are misclassified as male. By examining the experiment summarized in Table 5. I, we can predict that by setting the threshold to be 0.1, we reduce the female misclassification rate to 0.075%, with the male misclassification rate rising to 0.69%. We chose this threshold value because it gives us an approximately one in a thousand chance of releasing a female. However, any domain specific threshold value can be used; the practitioner simply needs to state her preference in one of two intuitive and equivalent ways: “What is the threshold that gives me a one in (some value) chance of misclassifying a female as a male” or “For my problem, misclassifying a male as a female is (some value) times worse than the other type of mistake, what should the threshold be?” (Elkan 2001). We applied our 0.1 threshold to the data which was used to produce the confusion matrix shown in Table 5.I and obtained the confusion matrix shown in Table 5.II. As we can see, of 2,000 insects in this experiment, twenty-two males, and zero females where misclassified, numbers in close agreement to theory. Experiment: Insect Classification with Increasing Number of Species When discussing our sensor/algorithm, we are invariably asked, “How accurate is it?” The answer to this depends on the insects to be classified. For example, if the classifier is used to distinguish Cx. stigmatosoma (female) from Cx. tarsalis (male), it can achieve near perfect accuracy as the two classes are radically different in their wingbeat sounds; whereas when it is used to separate Cx. stigmatosoma (female) from Ae. aegypti (female), the classification accuracy will be much lower, given that the two species have quite similar sounds, as hinted at in Figure 1. Therefore, a single absolute value for classification accuracy will not give the reader a good intuition about the performance of our system. Instead, in this section, rather than reporting our classifier’s accuracy on a fixed set of insects, we applied our classifier to datasets with an incrementally increasing number of species and therefore increasing classification difficulty. We began by classifying just two species of insects; then at each step, we added one more species (or a single sex of a sexually dimorphic species) and used our classifier to classify the increased number of species. We considered a total of ten classes of insects (different sexes from the same species counting as different classes), 5,000 exemplars in each class. Our classifier used both insect-sound (frequency spectrum) and time-of-intercept for classification. The classification accuracy measured at each step and the relevant class added is shown in Table 7. Note that the classification accuracy at each step is the accuracy of classifying all the species that come at and before that step. For example, the classification accuracy at the last step is the accuracy of classifying all ten classes of insects. Table 7: Classification accuracy with increasing number of classes Step Species Added Classification Classification Step Species Added N/A 6 Cx. quinquefasciatus ♂ 92.69% Accuracy Accuracy 1 Ae. aegypti ♂ 2 Musca domestica 98.99% 7 Cx. stigmatosoma ♀ 89.66% 3 Ae. aegypti ♀ 98.27% 8 Cx. tarsalis ♂ 83.54% 4 Cx. stigmatosoma ♂ 97.31% 9 Cx. quinquefasciatus♀ 81.04% 5 Cx. tarsalis ♀ 96.10% 10 Drosophila simulans 79.44% As we can see, our classifier achieves more than 96% accuracy when classifying no more than five species of insects, significantly higher than the default rate of 20% accuracy. Even when the number of classes considered increases to ten, the classification accuracy is never lower than 79%, again significantly higher than the default rate of 10%. Note that the ten classes are not easy to separate, even by human inspection. Among the ten species, eight of them are mosquitoes; six of them are from the same genus. The Utility of Automatic Insect Classification The reader may already appreciate the utility of automatic insect classification. However, for completeness, we give some examples of how the technology may be used.  Electrical Discharge Insect Control Systems EDICS (“bug zappers”) are insect traps that attract and then electrocute mosquitoes. They are very popular with consumers who are presumably gratified when hearing the characteristic buzz sound produced when an insect is electrocuted. While most commercial devices are sold as mosquito deterrents, studies have shown that as little as 0.22% of the insects killed are mosquitoes (Frick and Tallamy 1996). This is not surprising, since the attractant is typically just an ultraviolet light. Augmenting the traps with CO2 or other chemical attractants helps, but still allows the needless electrocution of beneficial insects. ISCA technologies (owned by author A. MN) is experimenting with building a “smart trap” that classifies insects as they approach the trap, selectively killing the target insects but blowing the non-target insects away with compressed air.  As noted above, Sterile Insect Technique has been used to reduce the populations of certain target insects, most notably with Screwworm flies (Cochliomyia hominovorax) and the Mediterranean fruit fly (Ceratitis capitata). The basic idea is to release sterile males into the wild to mate with wild females. Because the males are sterile, the females will lay eggs that are either unfertilized, or produce a smaller proportion of fertilized eggs, leading to population declines and eventual eradication in certain areas. (Benedict and Robinson 2003). Note that it is important not to release females, and sexing mosquitoes is notoriously difficult. Researchers at the University of Kentucky are experimenting with our sensors to create insectaries from which only male hatchlings can escape. The idea is to use a modified EDICS or a high powered laser that selectively turns on and off to allow males to pass through, but kills the females.  Much of the research on insect behavior with regard to color, odor, etc., is done by having human observers count insects as they move in dual choice olfactometer or on landing strips etc. For example, (Cooperband et al. 2013) notes, “Virgin female wasps were individually released downwind and the color on which they landed was recorded (by a human observer).” There are several problems with this: human time becomes a bottleneck in research; human error is a possibility; and for some host seeking insects, the presence of a human nearby may affect the outcome of the experiment (unless costly isolation techniques/equipment is used). We envision our sensor can be used to accelerate such research by making it significantly cheaper to conduct these types of experiments. Moreover, the unique abilities of our system will allow researchers to conduct experiments that are currently impossible. For example, a recent paper (Rund et al. 2012) attempted to see if there are sex-specific differences in the daily flight activity patterns of Anopheles gambiae mosquitoes. To do this, the authors placed individual sexed mosquitoes in small glass tubes to record their behavior. However, it is possible that both the small size of the glass tubes and the fact that the insects were in isolation affected the result. Moreover, even the act of physically sexing the mosquitoes may affect them due to metabolic stress etc. In contrast, by using our sensors, we can allow unsexed pupae to hatch out and the adults fly in cages with order of magnitude larger volumes. In this way, we can automatically and noninvasively sex them to produce sex-specific daily flight activity plots. Conclusion and Future Work In this work we have introduced a sensor/classification framework that allows the inexpensive and scalable classification of flying insects. We have shown experimentally that the accuracies achievable by our system are good enough to allow the development of commercial products and to be a useful tool for entomological research. To encourage the adoption and extension of our ideas, we are making all code, data, and sensor schematics freely available at the UCR Computational Entomology Page (Chen 2013). Moreover, within the limits of our budget, we will continue our practice of giving a complete system (as shown in Figure 2) to any research entomologist who requests one. Acknowledgements: We would like to thank the Vodafone Americas Foundation, the Bill and Melinda Gates Foundation and São Paulo Research Foundation (FAPESP) for funding this research, and the many faculties from the Department of Entomology at UCR that offered advice and expertise. References Banko M, Brill E (2001) Mitigating the paucity-of-data problem: Exploring the effect of training corpus size on classifier performance for natural language processing. Proceedings of the first international conference on Human language technology research (pp. 1-5). Association for Computational Linguistics. Batista GE, Keogh EJ, Mafra-Neto A, Rowton E (2011) SIGKDD demo: sensors and software to allow computational entomology, an emerging application of data mining. In Proceedings of the 17th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 761-764 Belton P, Costello RA (1979) Flight sounds of the females of some mosquitoes of Western Canada. Entomologia experimentalis et applicata, 26(1), 105-114. Benedict M, Robinson A (2003) The first releases of transgenic mosquitoes: an argument for the sterile insect technique. TRENDS in Parasitology, 19(8): 349-355. Accessed March 8, 2012. Bidlingmayer WL, Day JF, Evans DG (1995) Effect of wind velocity on suction trap catches of some Florida mosquitoes. Journal of the American Mosquito Control Association, 11(3), 295-301. Boll S (1979) Suppression of acoustic noise in speech using spectral subtraction. Acoustics, Speech and Signal Processing, IEEE Transactions on,27(2), 113-120. Bracewell RN, Bracewell RN (1986) The Fourier transform and its applications. New York: McGraw-Hill. Vol. 31999 Capinera, JL (2008). Encyclopedia of entomology. Springer. Epsky ND, Morrill WL, Mankin R (2005) Traps for capturing insects. In Encyclopedia of Entomology, pp. 2319-2329. Springer Netherlands. Chen Y (2013) Supporting Materials https://sites.google.com/site/insectclassification/ Chen Y, Hu B, Keogh E, Batista GE (2013) DTW-D: time series semi-supervised learning from a single example. In Proceedings of the 19th ACM SIGKDD international conference on Knowledge discovery and data mining. pp. 383-391 Chen Y, Keogh E, Batista G http://www.cs.ucr.edu/~eamonn/CE/contest.htm (2012) UCR Insect Classification Contest, Cooperband MF, Hartness A, Lelito JP, Cosse AA (2013) Landing surface color preferences of Spathius agrili (Hymenoptera: Braconidae), a parasitoid of emerald ash borer, Agrilus planipennis (Coleoptera: Buprestidae). Journal of Insect Behavior. 26(5):721-729. Deakin MA (2010) Formulae for insect wingbeat frequency. Journal of Insect Science,10(96):1 Devroye L (1996) A probabilistic theory of pattern recognition. Springer Vol. 31 Domingos P, Pazzani M (1997) On the optimality of the simple Bayesian classifier under zero-one loss. Machine learning, 29(2-3), 103-130. Elkan, C (2001) The foundations of cost-sensitive learning. In international joint conference on artificial intelligence, vol. 17, No. 1, pp. 973-978. LAWRENCE ERLBAUM ASSOCIATES LTD. Ephraim Y, Malah D (1984) Speech enhancement using a minimum-mean square error short-time spectral amplitude estimator. Acoustics, Speech and Signal Processing, IEEE Transactions on, 32(6), 1109-1121. Frick TB, Tallamy DW (1996) Density and diversity of non-target insects killed by suburban electric insect traps. Entomological News, 107, 77-82. Fukunaga K (1990) Introduction to statistical pattern recognition. Access Online via Elsevier. Grimaldi RP (1989) Discrete and Combinatoral Mathematics: An Applied Introduction 2nd Ed. AddisonWesley Longman Publishing Co., Inc. Halevy A, Norvig P, Pereira F (2009) The Unreasonable Effectiveness of Data, IEEE Intelligent Systems, v.24 n.2, p.8-12 Hao Y, Campana B and Keogh EJ (2012) Monitoring and Mining Animal Sounds in Visual Space. Journal of Insect Behavior: 1-28 Kahn MC, Celestin W, Offenhauser W (1945) Recording of sounds produced by certain disease-carrying mosquitoes. Science 101: 335–336 Kahn MC, Offenhauser W (1949) The identification of certain West African mosquitos by sound. Amer. J. trop. IVied. 29: 827--836 Keogh E, Pazzani M (1999) Learning augmented Bayesian classifiers: A comparison of distribution-based and classification-based approaches. In Proceedings of the seventh international workshop on artificial intelligence and statistics. pp. 225-230. Kohavi R (1995) A study of cross-validation and bootstrap for accuracy estimation and model selection. In IJCAI (Vol. 14, No. 2, pp. 1137-1145 Li Z, Zhou Z, Shen Z, Yao Q (2009) Automated identification of mosquito (diptera: Culicidae) wingbeat waveform by artificial neural network. Artificial Intelligence Applications and Innovations, 187/2009: 483–489 Mack YP, Rosenblatt M (1979) Multivariate k-nearest neighbor density estimates. Journal of Multivariate Analysis, 9(1), 1-15 Mankin RW, Machan R, Jones R (2006) Field testing of a prototype acoustic device for detection of Mediterranean fruit flies flying into a trap. Proc. 7th Int. Symp. Fruit Flies of Economic Importance, pp. 10-15 Mermelstein P (1976) Distance measures for speech recognition, psychological and instrumental, Pattern Recognition and Artificial Intelligence, 116, 374-388 Mian LS, Mulla MS, Axelrod H, Chaney JD, Dhillon MS (1990). Studies on the bioecological aspects of adult mosquitoes in the Prado Basin of southern California. Journal of the American Mosquito Control Association, 6(1), 64-71. Moore A (1991) Artificial neural network trained to identify mosquitoes in flight. Journal of insect behavior, 4(3), 391-396. Moore A, Miller RH (2002) Automated identification of optically sensed aphid (Homoptera: Aphidae) wingbeat waveforms. Ann. Entomol. Soc. Am. 95: 1–8. Moore A, Miller JR, Tabashnik BE, Gage SH (1986) Automated identification of flying insects by analysis of wingbeat frequencies. Journal of Economic Entomology. 79: 1703-1706 Njie M, Dilger E, Lindsay SW, Kirby MJ (2009) Importance of eaves to house entry by anopheline, but not culicine, mosquitoes. J Med Entomol, 46:505–510. Novak, R (1992) The asian tiger mosquito, Aedes albopictus. Wing Beats, Vol. 3(3):5. Papathanos PA, Bossin HC, Benedict MQ, Catteruccia F, Malcolm CA, Alphey L, Crisanti A (2009) Sex separation strategies: past experience and new approaches. Malar J, 8(Suppl 2) Parzen E (1962) On estimation of a probability density function and mode.The annals of mathematical statistics, 33(3), 1065-1076. Prechelt L(1995) A quantitative study of neural network learning algorithm evaluation practices. In proceedings of the 4th Int’l Conference on Artificial Neural Networks. pp. 223-227 Raman DR, Gerhardt RR, Wilkerson JB (2007) Detecting insect flight sounds in the field: Implications for acoustical counting of mosquitoes.Transactions of the ASABE, 50(4), 1481. Reed SC, Williams C M, Chadwick L E (1942) Frequency of wing-beat as a character for separating species races and geographic varieties of Drosophila. Genetics 27: 349-361. Reisen, W (1993) The western encephalitis mosquito, Culex tarsalis. Wing Beats, Vol. 4(2):16. Repasky KS, Shaw JA, Scheppele R, Melton C, Carsten JL, Spangler LH (2006) Optical detection of honeybees by use of wing-beat modulation of scattered laser light for locating explosives and land mines. Appl. Opt., 45: 1839–1843 Rosenblatt M (1956) Remarks on some nonparametric estimates of a density function. The Annals of Mathematical Statistics, 832-837. Rowland MW, Lindsay SW (1986). The circadian flight activity of Aedes aegypti parasitized with the filarial nematode Brugia pahangi.Physiological entomology, 11(3), 325-334. Rund SSC, Lee SJ, Bush BR, Duffield GE (2012) Strain- and sex-specific differences in daily flight activity and the circadian clock of Anopheles gambiae mosquitoes. Journal of Insect Physiology 58: 1609-19 Sawedal L, Hall R (1979) Flight tone as a taxonomic character in Chironomidae (Diptera). Entomol. Scand. Suppl. 10: 139-143. Schaefer GW, Bent GA (1984) An infra-red remote sensing system for the active detection and automatic determination of insect flight trajectories (IRADIT). Bull. Entomol. Res. 74: 261-278. Shotton J, Sharp T, Kipman A, Fitzgibbon A, Finocchio M, Blake A, Cook M, Moore R (2013). Real-time human pose recognition in parts from single depth images. Communications of the ACM, 56(1), 116-124. Sotavalta O (1947) The flight-tone (wing-stroke frequency) of insects (Contributions to the problem of insect flight 1.). Acta Entomol. Fenn. 4: 1-114. Taylor B (1969) Geographical range and circadian rhythm. Nature, 222, 296-297 Taylor B, Jones MDR (1969) The circadian rhythm of flight activity in the mosquito Aedes aegypti (L.): the phase-setting effects of light-on and light-off. Journal of Experimental Biology 51, no. 1 (1969): 59-70. Tsymbal A (2004) The problem of concept drift: definitions and related work. Computer Science Department, Trinity College Dublin. Unwin DM, Ellington CP (1979) An optical tachometer for measurement of the wing-beat frequency of freeflying insects. Journal of Experimental Biology, 82(1), 377-378. Vapnik VN, Chervonenkis AY (1971) On the uniform convergence of relative frequencies of events to their probabilities. Theory of Probability and Its Applications, 16(2), 264-280. Widmer G, Kubat M (1996) Learning in the presence of concept drift and hidden contexts. Machine learning, 23(1), 69-101. Zhan C, Lu X, Hou M, Zhou X (2005) A lvq-based neural network anti-spam email approach. ACM SIGOPS Oper Syst Rev 39(1):34–39 ISSN 0163-5980
5cs.CE
Polylogarithmic Approximation Algorithms for Weighted-F-Deletion Problems∗ Akanksha Agrawal† Daniel Lokshtanov‡ Pranabendu Misra§ Saket Saurabh¶ Meirav Zehavik Abstract arXiv:1707.04908v1 [cs.DS] 16 Jul 2017 Let F be a family of graphs. A canonical vertex deletion problem corresponding to F is defined as follows: given an n-vertex undirected graph G and a weight function w : V (G) → R, find a minimum weight subset S ⊆ V (G) such that G − S belongs to F. This is known as Weighted F Vertex Deletion problem. In this paper we devise a recursive scheme to obtain O(logO(1) n)-approximation algorithms for such problems, building upon the classic technique of finding balanced separators in a graph. Roughly speaking, our scheme applies to those problems, where an optimum solution S together with a well-structured set X, form a balanced separator of the input graph. In this paper, we obtain the first O(logO(1) n)approximation algorithms for the following vertex deletion problems. • We give an O(log2 n)-factor approximation algorithm for Weighted Chordal Vertex Deletion (WCVD), the vertex deletion problem to the family of chordal graphs. On the way to this algorithm, we also obtain a constant factor approximation algorithm for Multicut on chordal graphs. • We give an O(log3 n)-factor approximation algorithm for Weighted Distance Hereditary Vertex Deletion (WDHVD), also known as Weighted Rankwidth-1 Vertex Deletion (WR-1VD). This is the vertex deletion problem to the family of distance hereditary graphs, or equivalently, the family of graphs of rankwidth 1. Our methods also allow us to obtain in a clean fashion a O(log1.5 n)-approximation algorithm for the Weighted F Vertex Deletion problem when F is a minor closed family excluding at least one planar graph. For the unweighted version of the problem constant factor approximation algorithms are were known [Fomin et al., FOCS 2012], while for the weighted version considered here an O(log n log log n)-approximation algorithm follows from [Bansal et al. SODA 2017]. We believe that our recursive scheme can be applied to obtain O(logO(1) n)-approximation algorithms for many other problems as well. ∗ The research leading to these results received funding from the European Research Council under the European Unions Seventh Framework Programme (FP/2007-2013) / ERC Grant Agreement no. 306992. † University of Bergen, Bergen, Norway. akanksha.agrawal@uib.no. ‡ University of Bergen, Bergen, Norway. daniello@ii.uib.no. § Institute of Mathematical Sciences, Chennai, India. pranabendu@imsc.res.in. ¶ University of Bergen, Bergen, Norway. The Institute of Mathematical Sciences HBNI, Chennai, India. saket@imsc.res.in. k University of Bergen, Bergen, Norway. meirav.zehavi@uib.no. 1 Introduction Let F be a family of undirected graphs. Then a natural optimization problem is as follows. Weighted F Vertex Deletion Input: An undirected graph G and a weight function w : V (G) → R. Question: Find a minimum weight subset S ⊆ V (G) such that G − S belongs to F. The Weighted F Vertex Deletion problem captures a wide class of node (or vertex) deletion problems that have been studied from the 1970s. For example, when F is the family of independent sets, forests, bipartite graphs, planar graphs, and chordal graphs, then the corresponding vertex deletion problem corresponds to Weighted Vertex Cover, Weighted Feedback Vertex Set, Weighted Vertex Bipartization (also called Weighted Odd Cycle Transversal), Weighted Planar Vertex Deletion and Weighted Chordal Vertex Deletion, respectively. By a classic theorem of Lewis and Yannakakis [29], the decision version of the Weighted F Vertex Deletion problem—deciding whether there exists a set S weight at most k, such that removing S from G results in a graph with property Π—is NP-complete for every non-trivial hereditary property1 Π. Characterizing the graph properties, for which the corresponding vertex deletion problems can be approximated within a bounded factor in polynomial time, is a long standing open problem in approximation algorithms [43]. In spite of a long history of research, we are still far from a complete characterization. Constant factor approximation algorithms for Weighted Vertex Cover are known since 1970s [5, 32]. Lund and Yannakakis observed that the vertex deletion problem for any hereditary property with a “finite number of minimal forbidden induced subgraphs” can be approximated within a constant ratio [30]. They conjectured that for every nontrivial, hereditary property Π with an infinite forbidden set, the corresponding vertex deletion problem cannot be approximated within a constant ratio. However, it was later shown that Weighted Feedback Vertex Set, which doesn’t have a finite forbidden set, admits a constant factor approximation [2, 6], thus disproving their conjecture. On the other hand a result by Yannakakis [42] shows that, for a wide range of graph properties Π, approximating the minimum number of vertices to delete in order to obtain a connected graph with the property Π within a factor n1−ε is NP-hard. We refer to [42] for the precise list of graph properties to which this result applies to, but it is worth mentioning the list includes the class of acyclic graphs and the class of outerplanar graphs. In this paper, we explore the approximability of Weighted F Vertex Deletion for several different families F and design O(logO(1) n)-factor approximation algorithms for these problems. More precisely, our results are as follows. 1. Let F be a finite set of graphs that includes a planar graph. Let F = G (F ) be the family of graphs such that every graph H ∈ G (F ) does not contain a graph from F as a minor. The vertex deletion problem corresponding to F = G (F ) is known as the Weighted Planar F -Minor-Free Deletion (WPF -MFD). The WPF -MFD problem is a very generic problem and by selecting different sets of forbidden minors F , one can obtain various fundamental problems such as Weighted Vertex Cover, Weighted Feedback Vertex Set or Weighted Treewidth η-Deletion. Our first result is a randomized O(log1.5 n)-factor (deterministic O(log2 n)-factor) approximation algorithm for WPF -MFD, for any finite F that contains a planar graph. We remark that a different approximation algorithm for the same class of problems with a 1 A graph property Π is simply a family of graphs, and it is called non-trivial if there exists an infinite number of graphs that are in Π, as well as an infinite number of graphs that are not in Π. A non-trivial graph property Π is called hereditary if G ∈ Π implies that every induced subgraph of G is also in Π. 1 slightly better approximation ratio of O(log n log log n) follows from recent work of Bansal, Reichman, and Umboh [3] (see also the discussion following Theorem 1). Therefore, our first result should be interpreted as a clean and gentle introduction to our methods. 2. We give an O(log2 n)-factor approximation algorithm for Weighted Chordal Vertex Deletion (WCVD), the vertex deletion problem corresponding to the family of chordal graphs. On the way to this algorithm, we also obtain a constant factor approximation algorithm for Weighted Multicut in chordal graphs. 3. We give an O(log3 n)-factor approximation algorithm for Weighted Distance Hereditary Vertex Deletion (WDHVD). This is also known as the Weighted Rankwidth-1 Vertex Deletion (WR-1VD) problem. This is the vertex deletion problem corresponding to the family of distance hereditary graphs, or equivalently graphs of rankwidth 1. All our algorithms follow the same recursive scheme, that find “well structured balanced separators” in the graph by exploiting the properties of the family F. In the following, we first describe the methodology by which we design all these approximation algorithms. Then, we give a brief overview, consisting of known results and our contributions, for each problem we study. Our Methods. Multicommodity max-flow min-cut theorems are a classical technique in designing approximation algorithms, which was pioneered by Leighton and Rao in their seminal paper [28]. This approach can be viewed as using balanced vertex (or edge) separators2 in a graph to obtain a divide-and-conquer approximation algorithm. In a typical application, the optimum solution S, forms a balanced separator of the graph. Thus, the idea is to find an minimum cost balanced separator W of the graph and add it to the solution, and then recursively solve the problem on each of the connected components. This leads to an O(logO(1) n)-factor approximation algorithm for the problem in question. Our recursive scheme is a strengthening of this approach which exploits the structural properties of the family F. Here the optimum solution S ∗ need not be a balanced separator of the graph. Indeed, a balanced separator of the graph could be much larger than S ∗ . Rather, S ∗ along with a possibly large but well-structured subset of vertices X, forms a balanced separator of the graph. We then exploit the presence of such a balanced separator in the graph to compute an approximate solution. Consider a family F for which Weighted F Vertex Deletion is amenable to our approach, and let G be an instance of this problem. Let S be the approximate solution that we will compute. Our approximation algorithm has the following steps: 1. Find a well-structured set X, such that G − X has a balanced separator W which is not too costly. √ 2. Next, compute the balanced separator W of G − X using the known factor O( log n)approximation algorithm (or deterministic O(log n)-approximation algorithm) for Weighted Vertex Separators [12, 28]. Then add W into the solution set S and recursively solve the problem on each connected component of G − (X ∪ S). Let S1 , · · · , S` be the solutions returned by the recursive calls. We add S1 , · · · , S` to the solution S. 3. Finally, we add X back into the graph and consider the instance (G − S) ∪ X. Observe that, V (G − S) can be partitioned into V 0 ] X, where G[V 0 ] belongs to F and X is a well-structured set. We call such instances, the special case of Weighted F Vertex Deletion. We apply an approximation algorithm that exploits the structural properties of the special case to compute a solution. Now consider the problem of finding the structure X. One way is to enumerate all the candidates for X and then pick the one where G − X has a balanced vertex separator of least cost — this 2 A balanced vertex separator is a set of vertices W , such that every connected component of G − W contains at most half of the vertices of G. 2 separator plays the role of W . However, the number of candidates for X in a graph could be too many to enumerate in polynomial time. For example, in the case of Weighted Chordal Vertex Deletion, the set X will be a clique in the graph, and the number of maximal cliques n in a graph on n vertices could be as many as 3 3 [31]. Hence, we cannot enumerate and test every candidate structure in polynomial time. However, we can exploit certain structural properties of family F, to reduce the number of candidates for X in the graph. In our problems, we “tidy up” the graph by removing “short obstructions” that forbid the graph from belonging to the family F. Then one can obtain an upper bound on the number of candidate structures. In the above example, recall that a graph G is chordal if and only if there are no induced cycles of length 4 or more. It is known that a graph G without any induced cycle of length 4 has at most O(n2 ) maximal cliques [11]. Observe that, we can greedily compute a set of vertices which intersects all induced cycles of length 4 in the graph. Therefore, at the cost of factor 4 in the approximation ratio, we can ensure that the graph has only polynomially many maximal cliques. Hence, one can enumerate all maximal cliques in the remaining graph [41] to test for X. Next consider the task of solving an instance of the special case of the problem. We again apply a recursive scheme, but now with the advantage of a much more structured graph. By a careful modification of an LP solution to the instance, we eventually reduce it to instances of Weighted Multicut. In the above example, for Weighted Chordal Vertex Deletion we obtain instances of Weighted Multicut on a chordal graph. We follow this approach for all three problems that we study in this paper. We believe our recursive scheme can be applied to obtain O(logO(1) n)-approximation algorithms for Weighted F Vertex (Edge) Deletion corresponding to several other graph families F. Weighted Planar F -Minor-Free Deletion. Let F be a finite set of graphs containing a planar graph. Formally, Weighted Planar F -Minor-Free Deletion is defined as follows. Weighted Planar F -Minor-Free Deletion (WPF -MFD) Input: An undirected graph G and a weight function w : V (G) → R. Question: Find a minimum weight subset S ⊆ V (G) such that G − S does not contain any graph in F as a minor. The WPF -MFD problem is a very generic problem that encompasses several known problems. To explain the versatility of the problem, we require a few definitions. A graph H is called a minor of a graph G if we can obtain H from G by a sequence of vertex deletions, edge deletions and edge contractions, and a family of graphs F is called minor closed if G ∈ F implies that every minor of G is also in F. Given a graph family F, by ForbidMinor(F) we denote the family of graphs such that G ∈ F if and only if G does not contain any graph in ForbidMinor(F) as a minor. By the celebrated Graph Minor Theorem of Robertson and Seymour, every minor closed family F is characterized by a finite family of forbidden minors [39]. That is, ForbidMinor(F) has finite size. Indeed, the size of ForbidMinor(F) depends on the family F. Now for a finite collection of graphs F , as above, we may define the Weighted F -Minor-Free Deletion problem. And observe that, even though the definition of Weighted F -Minor-Free Deletion we only consider finite sized F , this problem actually encompasses deletion to every minor closed family of graphs. Let G be the set of all finite undirected graphs, and let L be the family of all finite subsets of G . Thus, every element F ∈ L is a finite set of graphs, and throughout the paper we assume that F is explicitly given. In this paper, we show that when F ∈ L contains at least one planar graph, then it is possible to obtain an O(logO(1) n)-factor approximation algorithm for WPF -MFD. The case where F contains a planar graph, while being considerably more restricted than the general case, already encompasses a number of the well-studied instances of WPF -MFD. For example, when F = {K2 }, a complete graph on two vertices, this is the Weighted Vertex 3 Cover problem. When F = {C3 }, a cycle on three vertices, this is the Weighted Feedback Vertex Set problem. Another fundamental problem, which is also a special case of WPF MFD, is Weighted Treewidth-η Vertex Deletion or Weighted η-Transversal. Here the task is to delete a minimum weight vertex subset to obtain a graph of treewidth at most η. Since any graph of treewidth η excludes a (η + 1) × (η + 1) grid as a minor, we have that the set F of forbidden minors of treewidth η graphs contains a planar graph. Treewidth-η Vertex Deletion plays an important role in generic efficient polynomial time approximation schemes based on Bidimensionality theory [16, 17]. Among other examples of Planar F -Minor-Free Deletion problems that can be found in the literature on approximation and parameterized algorithms, are the cases of F being {K2,3 , K4 }, {K4 }, {θc }, and {K3 , T2 }, which correspond to removing vertices to obtain an outerplanar graph, a series-parallel graph, a diamond graph, and a graph of pathwidth 1, respectively. Apart from the case of Weighted Vertex Cover [5, 32] and Weighted Feedback Vertex Set [2, 6], there was not much progress on approximability/non-approximability of WPF -MFD until the work of Fiorini, Joret, and Pietropaoli [13], which gave a constant factor approximation algorithm for the case of WPF -MFD where F is a diamond graph, i.e., a graph with two vertices and three parallel edges. In 2011, Fomin et al. [14] considered Planar F -Minor-Free Deletion (i.e. the unweighted version of WPF -MFD) in full generality and designed a randomized (deterministic) O(log1.5 n)-factor (O(log2 n)-factor) approximation algorithm for it. Later, Fomin et al. [15] gave a randomized constant factor approximation algorithm for Planar F -Minor-Free Deletion. Our algorithm for WPF -MFD extends this result to the weighted setting, at the cost of increasing the approximation factor to logO(1) n. Theorem 1. For every set F ∈ L , WPF -MFD admits a randomized (deterministic) O(log1.5 n)factor (O(log2 n)-factor) approximation algorithm. We mention that Theorem 1 is subsumed by a recent related result of Bansal, Reichman, and Umboh [3]. They studied the edge deletion version of the Treewidth-η Vertex Deletion problem, under the name Bounded Treewidth Interdiction Problem, and gave a bicriteria approximation algorithm. In particular, for a graph G and an integer η > 0, they gave a polynomial time algorithm that finds a subset of edges F 0 of G such that |F 0 | ≤ O((log n log log n)· opt) and the treewidth of G − F 0 is O(η log η). With some additional effort [4] their algorithm can be made to work for the Weighted Treewidth-η Vertex Deletion problem as well. In our setting where η is a fixed constant, this immediately implies a factor O(log n log log n) approximation algorithm for WPF -MFD.3 While the statement of Theorem 1 is subsumed by [3], the proof gives a simple and clean introduction to our methods. Weighted Chordal Vertex Deletion. Formally, the Weighted Chordal Vertex Deletion problem is defined as follows. Weighted Chordal Vertex Deletion (WCVD) Input: An undirected graph G and a weight function w : V (G) → R. Question: Find a minimum weight subset S ⊆ V (G) such that G − S is a chordal graph. The class of chordal graphs is a natural class of graphs that has been extensively studied from the viewpoints of Graph Theory and Algorithm Design. Many important problems that are NP-hard on general graphs, such as Independent Set, and Graph Coloring are solvable in polynomial time once restricted to the class of chordal graphs [21]. Recall that a graph is chordal if and only if it does not have any induced cycle of length 4 or more. Thus, Chordal Vertex Deletion (CVD) can be viewed as a natural variant of the classic Feedback Vertex Set 3 One can run their algorithm first and remove the solution output by their algorithm to obtain a graph of treewidth at most O(η log η). Then one can find an optimal solution using standard dynamic programming. 4 (FVS). Indeed, while the objective of FVS is to eliminate all cycles, the CVD problem only asks us to eliminate induced cycles of length 4 or more. Despite the apparent similarity between the objectives of these two problems, the design of approximation algorithms for WCVD is very challenging. In particular, chordal graphs can be dense—indeed, a clique is a chordal graph. As we cannot rely on the sparsity of output, our approach must deviate from those employed by approximation algorithms from FVS. That being said, chordal graphs still retain some properties that resemble those of trees, and these properties are utilized by our algorithm. Prior to our work, only two non-trivial approximation algorithms for CVD were known. The first one, by Jansen and Pilipczuk [25], is a deterministic O(opt2 log opt log n)-factor approximation algorithm, and the second one, by Agrawal et al. [1], is a deterministic O(opt log2 n)-factor √ approximation algorithm. The second result implies that CVD admits an O( n log n)-factor approximation algorithm.4 In this paper we obtain the first O(logO(1) n)-approximation algorithm for WCVD. Theorem 2. CVD admits a deterministic O(log2 n)-factor approximation algorithm. While this approximation algorithm follows our general scheme, it also requires us to incorporate several new ideas. In particular, to implement the third step of the scheme, we need to design a different O(log n)-factor approximation algorithm for the special case of WCVD where the vertex-set of the input graph G can be partitioned into two sets, X and V (G) \ X, such that G[X] is a clique and G[V (G) \ X] is a chordal graph. This approximation algorithm is again based on recursion, but it is more involved. At each recursive call, it carefully manipulates a fractional solution of a special form. Moreover, to ensure that its current problem instance is divided into two subinstances that are independent and simpler than their origin, we introduce multicut constraints. In addition to these constraints, we keep track of the complexity of the subinstances, which is measured via the cardinality of the maximum independent set in the graph. Our multicut constraints result in an instance of Weighted Multicut, which we ensure is on a chordal graph. Formally, the Weighted Multicut problem is defined as follows. Weighted Multicut Input: An undirected graph G, a weight function w : V (G) → R and a set T = {(s1 , t1 ), . . . , (sk , tk )} of k pairs of vertices of G. Question: Find a minimum weight subset S ⊆ V (G) such that for any pair (si , ti ) ∈ T , G − S does not have any path between si and ti . For Weighted Multicut on chordal graphs, no constant-factor approximation algorithm was previously known. We remark that Weighted Multicut is NP-hard on trees [19], and hence it is also NP-hard on chordal graphs. We design the first such algorithm, which our main algorithm employs as a black box. Theorem 3. Weighted Multicut admits a constant-factor approximation algorithm on chordal graphs. This algorithm is inspired by the work of Garg, Vazirani and Yannakakis on Weighted Multicut on trees [19]. Here, we carefully exploit the well-known characterization of the class of chordal graphs as the class of graphs that admit clique forests. We believe that this result is of independent interest. The algorithm by Garg, Vazirani and Yannakakis [19] is a classic primal-dual algorithm. A more recent algorithm, by Golovin, Nagarajan and Singh [20], uses total modularity to obtain a different algorithm for Multicut on trees. √ 4 If opt ≥ n/ log n, we output a greedy solution to the input graph, and otherwise we have that opt log2 n ≤ √ n log n, hence we call the O(opt log2 n)-factor approximation algorithm. 5 Weighted Distance Hereditary Vertex Deletion. We start by formally defining the Weighted Distance Hereditary Vertex Deletion problem. Weighted Distance Hereditary Vertex Deletion (WDHVD) Input: An undirected graph G and a weight function w : V (G) → R. Question: Find a minimum weight subset S ⊆ V (G) such that G − S is a distance hereditary graph. A graph G is a distance hereditary graph (also called a completely separable graph [22]) if the distances between vertices in every connected induced subgraph of G are the same as in the graph G. Distance hereditary graphs were named and first studied by Hworka [24]. However, an equivalent family of graphs was earlier studied by Olaru and Sachs [40] and shown to be perfect. It was later discovered that these graphs are precisely the graphs of rankwidth 1 [33]. Rankwidth is a graph parameter introduced by Oum and Seymour [36] to approximate yet another graph parameter called Cliquewidth. The notion of cliquewidth was defined by Courcelle and Olariu [9] as a measure of how “clique-like” the input graph is. This is similar to the notion of treewidth, which measures how “tree-like” the input graph is. One of the main motivations was that several NP-complete problems become tractable on the family of cliques (complete graphs), the assumption was that these algorithmic properties extend to “clique-like” graphs [8]. However, computing cliquewidth and the corresponding cliquewidth decomposition seems to be computationally intractable. This then motivated the notion of rankwidth, which is a graph parameter that approximates cliquewidth well while also being algorithmically tractable [36, 34]. For more information on cliquewidth and rankwidth, we refer to the surveys by Hlinený et al. [23] and Oum [35]. As algorithms for Treewidth-η Vertex Deletion are applied as subroutines to solve many graph problems, we believe that algorithms for Weighted Rankwidth-η Vertex Deletion (WR-ηVD) will be useful in this respect. In particular, Treewidth-η Vertex Deletion has been considered in designing efficient approximation, kernelization and fixed parameter tractable algorithms for WPF -MFD and its unweighted counterpart Planar F -Minor-Free Deletion [3, 14, 16, 17, 18]. Along similar lines, we believe that WR-ηVD and its unweighted counterpart will be useful in designing efficient approximation, kernelization and fixed parameter tractable algorithms for Weighted F Vertex Deletion where F is characterized by a finite family of forbidden vertex minors [33]. Recently, Kim and Kwon [26] designed an O(opt2 log n)-factor approximation algorithm for Distance Hereditary Vertex Deletion (DHVD). This result implies that DHVD admits an O(n2/3 log n)-factor approximation algorithm. In this paper, we take first step towards obtaining good approximation algorithm for WR-ηVD by designing a O(logO(1) n)-factor approximation algorithm for WDHVD. Theorem 4. WDHVD or WR-1VD admits an O(log3 n)-factor approximation algorithm. We note that several steps of our approximation algorithm for WR-1VD can be generalized for an approximation algorithm for WR-ηVD and thus we believe that our approach should yield an O(logO(1) n)-factor approximation algorithm for WR-ηVD. We leave that as an interesting open problem for the future. 2 Preliminaries For a positive integer k, we use [k] as a shorthand for {1, 2, . . . , k}. Given a function f : A → B and a subset A0 ⊆ A, we let f |A0 denote the function f restricted to the domain A0 . 6 Graphs. Given a graph G, we let V (G) and E(G) denote its vertex-set and edge-set, respectively. In this paper, we only consider undirected graphs. We let n = |V (G)| denote the number of vertices in the graph G, where G will be clear from context. The open neighborhood, or simply the neighborhood, of a vertex v ∈ V (G) is defined as NG (v) = {w | {v, w} ∈ E(G)}. The closed neighborhood of v is defined as NG [v] = NG (v)∪{v}. The degree of v is defined as dG (v) = |NG (v)|. We can extend the definition of the to a set of vertices as follows. Given S neighborhood of a vertexS a subset U ⊆ V (G), NG (U ) = u∈U NG (u) and NG [U ] = u∈U NG [u]. The induced subgraph G[U ] is the graph with vertex-set U and edge-set {{u, u0 } | u, u0 ∈ U, and {u, u0 } ∈ E(G)}. Moreover, we define G − U as the induced subgraph G[V (G) \ U ]. We omit subscripts when the graph G is clear from context. For graphs G and H, by G ∩ H, we denote the graph with vertex set as V (G) ∩ V (H) and edge set as E(G) ∩ E(H). An independent set in G is a set of vertices such that there is no edge in G between any pair of vertices in this set. The independence number of G, denoted by α(G), is defined as the cardinality of the largest independent set in G. A clique in G is a set of vertices such that there is an edge in G between every pair of vertices in this set. A path P = (x1 , x2 , . . . , x` ) in G is a subgraph of G where V (P ) = {x1 , x2 , . . . , x` } ⊆ V (G) and E(P ) = {{x1 , x2 }, {x2 , x3 }, . . . , {x`−1 , x` }} ⊆ E(G), where ` ∈ [n]. The vertices x1 and x` are called the endpoints of the path P and the remaining vertices in V (P ) are called the internal vertices of P . We also say that P is a path between x1 and x` or connects x1 and x` . A cycle C = (x1 , x2 , . . . , x` ) in G is a subgraph of G where V (C) = {x1 , x2 , . . . , x` } ⊆ V (G) and E(C) = {{x1 , x2 }, {x2 , x3 }, . . . , {x`−1 , x` }, {x` , x1 }} ⊆ E(G), i.e., it is a path with an additional edge between x1 and x` . The graph G is connected if there is a path between every pair of vertices in G, otherwise G is disconnected. A connected graph without any cycles is a tree, and a collection of trees is a forest. A maximal connected subgraph of G is called a connected P component of G. Given a function f : V (G) → R and a subset U ⊆ V (G), we denote f (U ) = v∈U f (v). Moreover, we say that a subset U ⊆ V (G) is a balanced separator for G if for each connected component C in G − U , it holds that |V (C)| ≤ 23 |V (G)|. We refer the reader to [10] for details on standard graph theoretic notations and terminologies that are not explicitly defined here. Forest Decompositions. A forest decomposition of a graph G is a pair (F, β) where F is forest, and β : V (T ) → 2V (G) is a function that satisfies the following: S (i) v∈V (F ) β(v) = V (G); (ii) for any edge {v, u} ∈ E(G), there is a node w ∈ V (F ) such that v, u ∈ β(w); (iii) for any v ∈ V (G), the collection of nodes Tv = {u ∈ V (F ) | v ∈ β(u)} is a subtree of F . For v ∈ V (F ), we call β(v) the bag of v, and for the sake of clarity of presentation, we sometimes use v and β(v) interchangeably. We refer to the vertices in V (F ) as nodes. A tree decomposition is a forest decomposition where F is a tree. For a graph G, by tw(G) we denote the minimum over all possible tree decompositions of G, the maximum size of a bag minus one in that tree decomposition. Minors. Given a graph G and an edge {u, v} ∈ E(G), the graph G/e denotes the graph obtained from G by contracting the edge {u, v}, that is, the vertices u, v are deleted from G and a new vertex uv ? is added to G which is adjacent to the all the neighbors of u, v previously in G (except for u, v). A graph H that is obtained by a sequence of edge contractions in G is said to be a contraction of G. A graph H is a minor of a G if H is the contraction of some subgraph of G. We say that a graph G is F -minor free when F is not a minor of G. Given a family F of graphs, we say that a graph G is F-minor free, if for all F ∈ F, F is not a minor of G. It is well known that if H is a minor of G, then tw(H) ≤ tw(G). A graph is planar if it is {K5 , K3,3 }-minor free [10]. Here, K5 is a clique on 5 vertices and K3,3 is a complete bipartite graph with both sides of bipartition having 3 vertices. 7 Chordal Graphs. Let G be a graph. For a cycle C on at least four vertices, we say that {u, v} ∈ E(G) is a chord of C if u, v ∈ V (C) but {u, v} ∈ / E(C). A cycle C is chordless if it contains at least four vertices and has no chords. The graph G is a chordal graph if it has no chordless cycle as an induced subgraph. A clique forest of G is a forest decomposition of G where every bag is a maximal clique. The following lemma shows that the class of chordal graphs is exactly the class of graphs which have a clique forest. Lemma 1 ([21]). A graph G is a chordal graph if and only if G has a clique forest. Moreover, a clique forest of a chordal graph can be constructed in polynomial time. Given a subset U ⊆ V (G), we say that U intersects a chordless cycle C in G if U ∩ V (C) 6= ∅. Observe that if U intersects every chordless cycle of G, then G − U is a chordal graph. 3 Approximation Algorithm for WPF -MFD In this section we prove Theorem 1. We can assume that the weight w(v) of each vertex v ∈ V (G) is positive, else we can insert v into any solution. Below we state a result from [37], which will be useful in our algorithm. Proposition 2 ([37]). Let F be a finite set of graphs such that F contains a planar graph. Then, any graph G that excludes any graph from F as a minor satisfies tw(G) ≤ c = c(F ). We let c = c(F ) to be the constant returned by Proposition 2. The approximation algorithm for WPF -MFD comprises of two components. The first component handles the special case where the vertex set of input graph G can be partitioned into two sets C and X such that |C| ≤ c + 1 and H = G[X] is an F -minor free graph. We note that there can be edges between vertices in C and vertices in H. We show that for these special instances, in polynomial time we can compute the size of the optimum solution and a set realizing it. The second component is a recursive algorithm that solves general instances of the problem. Here, we gradually disintegrate the general instance until it becomes an instance of the special type where we can resolve it in polynomial time. More precisely, for each guess of c + 1 sized subgraph M of G, we find a small separator S (using an approximation algorithm) that together with M breaks the input graph into two graphs significantly smaller than their origin. It first removes M ∪ S, and solves each of the two resulting subinstances by calling itself recursively; then, it inserts M back into the graph, and uses the solutions it obtained from the recursive calls to construct an instance of the special case which is then solved by the first component. 3.1 Constant sized graph + F -minor free graph We first handle the special case where the input graph G consists of a graph M of size at most c + 1 and an F -minor free graph H. We refer to this algorithm as Special-WP. More precisely, along with the input graph G and the weight function w, we are also given a graph M with at most c + 1 vertices and an F -minor free graph H such that V (G) = V (M ) ∪ V (H), where the vertex-sets V (M ) and V (H) are disjoint. Note that the edge-set E(G) may contain edges between vertices in M and vertices in H. We will show that such instances may be solved optimally in polynomial time. We start with the following easy observation. Observation 3. Let G be a graph with V (G) = X ] Y , such that |X| ≤ c + 1 and G[Y ] is an F -minor free graph. Then, the treewidth of G is at most 2c + 1. Lemma 4. Let G be a graph of treewidth t with a non-negative weight function w on the vertices, and let F be a finite family of graphs. Then, one can compute a minimum weight vertex set S such that G − S is F -minor free, in time f (q, t) · n, where n is the number of vertices in G and q is a constant that depends only on F . 8 Proof. This follows from the fact that finding such a set S is expressible as an MSO-optimization formula φ whose length, q, depends only on the family F [15]. Then, by Theorem 7 [7], we can compute an optimal sized set S in time f (q, t) · n. Now, we apply the above lemma to the graph G and the family F , and obtain a minimum weight set S such that G − S is F -minor free. 3.2 General Graphs We proceed to handle general instances by developing a d · log2 n-factor approximation algorithm for WPF -MFD, Gen-WP-APPROX, thus proving the correctness of Theorem 1. The exact value of the constant d will be determined later. Recursion. We define each call to our algorithm Gen-WP-APPROX to be of the form (G0 , w0 ), where (G0 , w0 ) is an instance of WPF -MFD such that G0 is an induced subgraph of G, and we denote n0 = |V (G0 )|. Goal. For each recursive call Gen-WP-APPROX(G0 , w0 ), we aim to prove the following. Lemma 5. Gen-WP-APPROX returns a solution that is at least opt and at most Moreover, it returns a subset U ⊆ V (G0 ) that realizes the solution. d 2 · log2 n0 · opt. At each recursive call, the size of the graph G0 becomes smaller. Thus, when we prove that Lemma 5 is true for the current call, we assume that the approximation factor is bounded by 2 d b · opt for any call where the size n b of the vertex-set of its graph is strictly smaller than n0 . 2 · log n Termination. In polynomial time we can test whether G0 has a minor F ∈ F [38]. Furthermore, for each M ⊆ V (G) of size at most c + 1, we can check if G − M has a minor F ∈ F . If G − M is F -minor free then we are in a special instance, where G − M is F minor free and M is a constant sized graph. We optimally resolve this instance in polynomial time using the algorithm Special-WP. Since we output an optimal sized solution in the base cases, we thus ensure that at the base case of our induction Lemma 5 holds. Recursive Call. For the analysis of a recursive call, let S ∗ denote a hypothetical set that realizes the optimal solution opt of the current instance (G0 , w0 ). Let (F, β) be a forest decomposition of G0 − S ∗ of width at most c, whose existence is guaranteed by Proposition 2. Using standard arguments on forests we have the following observation. Observation 6. There exists a node v ∈ V (F ) such that β(v) is a balanced separator for G0 −S ∗ . From Observation 6 we know that there exists a node v ∈ V (F ) such that β(v) is a balanced separator for G0 − S ∗ . This together with the fact that G0 − S ∗ has treewidth at most c results in the following observation. Observation 7. There exist a subset M ⊆ V (G0 ) of size at most c+1 and a subset S ⊆ V (G0 )\M of weight at most opt such that M ∪ S is a balanced separator for G0 . This gives us a polynomial time algorithm as stated in the following lemma. Lemma 8. There is a deterministic (randomized) algorithm which in polynomial-time finds M ⊆√V (G0 ) of size at most c + 1 and a subset S ⊆ V (G0 ) \ M of weight at most q · log n0 · opt (q ∗ · log n0 · opt) for some fixed constant q (q ∗ ) such that M ∪ S is a balanced separator for G0 . 9 0 ) of size at most c + 1 in time O(nc ). For Proof. Note that we can enumerate every M ⊆ V (G√ each such M , we can either run the randomized q ∗ · log n0 -factor approximation algorithm by Feige et al. [12] or the deterministic q · log n0 -factor approximation algorithm by Leighton and Rao [28] to find a balanced separator SM of G0 − M . Here, q and q ∗ are fixed constants. By Observation 7,√there is a set S in {SM : M ⊆ V (G0 ) and M ≤ c+1} such that w(S) ≤ q·log n0 ·opt (w(S) ≤ q ∗ · log n0 · opt). Thus, the desired output is a pair (M, S) where M is one of the vertex subset of size at most c + 1 such that SM = S. We call the algorithm in Lemma 8 to obtain a pair (M, S). Since M ∪ S is a balanced separator for G0 , we can partitionSthe set of connected components of G0 − (M ∪ S) into two sets, S A1 and A2 , such that for V1 = A∈A1 V (A) and V2 = A∈A2 V (A) it holds that n1 , n2 ≤ 23 n0 where n1 = |V1 | and n2 = |V2 |. We remark that we use different algorithms for finding a balanced separator in Lemma 8 based on whether we are looking for a randomized algorithm or a deterministic algorithm. Next, we define two inputs of (the general case of) WPF -MFD: I1 = (G0 [V1 ], w0 |V1 ) and I2 = (G0 [V2 ], w0 |V2 ). Let opt1 and opt2 denote the optimal solutions to I1 and I2 , respectively. Observe that since V1 ∩ V2 = ∅, it holds that opt1 + opt2 ≤ opt. We solve each of the subinstances by recursively calling algorithm Gen-WP-APPROX. By the inductive hypothesis, we thus obtain two sets, S1 and S2 , such that G0 [V1 ] − S1 and G0 [V2 ] − S2 are F -minor free graphs, and w0 (S1 ) ≤ d2 · log2 n1 · opt1 and w0 (S2 ) ≤ d2 · log2 n2 · opt2 . We proceed by defining an input of the special case of WPF -MFD: J = (G0 [(V1 ∪ V2 ∪ M ) \ (S1 ∪ S2 )], w0 |(V1 ∪V2 ∪M )\(S1 ∪S2 ) ). Observe that G0 [V1 \ S1 ] and G0 [V2 \ S2 ] are F -minor free graphs and there are no edges between vertices in V1 and vertices in V2 in G0 − M , and M is of constant size. Therefore, we resolve this instance by calling algorithm Special-WP. We thus b such that G0 [(V1 ∪ V2 ∪ M ) \ (S1 ∪ S2 ∪ S)] b is a F -minor graph, and w0 (S) b ≤ opt obtain a set, S, 0 (since |(V1 ∪ V2 ∪ M ) \ (S1 ∪ S2 )| ≤ n and the optimal solution of each of the special subinstances is at most opt). Observe that any obstruction in G0 − S is either completely contained in G0 [V1 ], or completely contained in G0 [V2 ], or it contains at least one vertex from M . This observation, along with b is a F -minor free graph, implies that G0 − T the fact that G0 [(V1 ∪ V2 ∪ M ) \ (S1 ∪ S2 ∪ S)] b Thus, it is now sufficient to show that is a F -minor free graph where T = S ∪ S1 ∪ S2 ∪ S. d 0 0 2 w (T ) ≤ 2 · (log n ) · opt. By the discussion above, we have that b w0 (T ) ≤ w0 (S) + w0 (S1 ) + w0 (S2 ) + w0 (S) d 0 2 ≤ q · log n · opt + 2 · ((log n1 ) · opt1 + (log n2 )2 · opt2 ) + opt Recall that n1 , n2 ≤ 32 n0 and opt1 + opt2 ≤ opt. Thus, we have that w0 (T ) < q · log n0 · opt + d2 · (log 23 n0 )2 · opt + opt < d2 · (log n0 )2 · opt + log n0 · opt · (q + 1 + d2 · (log 32 )2 − d 2 · 2 · log 32 ). · log2 n0 · opt, it is sufficient to ensure that 2 · (q + 1). q + 1 + d2 · (log 32 )2 − d2 · 2 · log 32 ≤ 0, which can be done by fixing d = 3 2 log 2 − (log 32 )2 √ If we use the O( log n)-factor approximation algorithm by Feige et al. [12] for finding a balance separator in Lemma 8, then we can do the analysis similar to the deterministic case and obtain a randomized factor-O(log1.5 n)approximation algorithm for WPF -MFD. Overall, we conclude that to ensure that w0 (T ) ≤ 10 d 2 4 Weighted Chordal Vertex Deletion on General Graphs In this section we prove Theorem 2. Clearly, we can assume that the weight w(v) of each vertex v ∈ V (G) is positive, else we can insert v into any solution. Roughly speaking, our approximation algorithm consists of two components. The first component handles the special case where the input graph G consists of a clique C and a chordal graph H. Here, we also assume that the input graph has no “short” chordless cycle. This component is comprised of a recursive algorithm that is based on the method of divide and conquer. The algorithm keeps track of a fractional solution x of a special form that it carefully manipulated at each recursive call, and which is used to analyze the approximation ratio. In particular, we ensure that x does not assign high values, and that it assigns 0 to vertices of the clique C as well as vertices of some other cliques. To divide a problem instance into two instances, we find a maximal clique M of the chordal graph H that breaks H into two “simpler” chordal graphs. The clique C remains intact at each recursive call, and the maximal clique M is also a part of both of the resulting instances. Thus, to ensure that we have simplified the problem, we measure the complexity of instances by examining the maximum size of an independent set of their graphs. Since the input graph has no “short” chordless cycle, the maximum depth of the recursion tree is bounded by O(log n). Moreover, to guarantee that we obtain instances that are independent, we incorporate multicut constraints while ensuring that we have sufficient “budget” to satisfy them. We ensure that these multicut constraints are associated with chordal graphs, which allows us to utilize the algorithm we design in Section 5. The second component is a recursive algorithm that solves general instances of the problem. Initially, it easily handles “short” chordless cycles. Then, it gradually disintegrates a general instance until it becomes an instance of the special form that can be solved using the first component. More precisely, given a problem instance, the algorithm divides it by finding a maximal clique M (using an exhaustive search which relies on the guarantee that G has no “short” chordless cycle) and a small separator S (using an approximation algorithm) that together break the input graph into two graphs significantly smaller than their origin. It first removes M ∪ S and solves each of the two resulting subinstances by calling itself recursively; then, it inserts M back into the graph, and uses the solutions it obtained from the recursive calls to construct an instance of the special case solved by the first component. 4.1 Clique+Chordal Graphs In this subsection we handle the special case where the input graph G consists of a clique C and a chordal graph H. More precisely, along with the input graph G and the weight function w, we are also given a clique C an a chordal graph H such that V (G) = V (C) ∪ V (H), where the vertex-sets V (C) and V (H) are disjoint. Here, we also assume that G has no chordless cycle on at most 48 vertices. Note that the edge-set E(G) may contain edges between vertices in C and vertices in H. We call this special case the Clique+Chordal special case. Our objective is to prove the following result. Lemma 9. The Clique+Chordal special case of WCVD admits an O(log n)-factor approximation algorithm. We assume that n ≥ 64,5 else the input instance can be solve by brute-force. Let c be a fixed constant (to be determined). In the rest of this subsection, we design a c · log n-factor approximation algorithm for the Clique+Chordal special case of WCVD. Recursion. Our approximation algorithm is a recursive algorithm. We call our algorithm CVD-APPROX, and define each call to be of the form (G0 , w0 , C, H 0 , x). Here, G0 is an induced 5 This assumption simplifies some of the calculations ahead. 11 subgraph of G such that V (C) ⊆ V (G0 ), and H 0 is an induced subgraph of H. The argument x is discussed below. We remark that we continue to use n to refer to the size of the vertex-set of the input graph G rather than the current graph G0 . Arguments. While the execution of our algorithm progresses, we keep track of two arguments: the size of a maximum independent set of the current graph G0 , denoted by α(G0 ), and a fractional solution x. Due to the special structure of G0 , the computation of α(G0 ) is simple: Observation 10. The measure α(G0 ) can be computed in polynomial time. Proof. Any maximum independent set of G0 consists of at most one vertex from C and an independent set of H 0 . It is well known that the computation of the size of a maximum independent set of a chordal graph can be performed in polynomial time [21]. Thus, we can compute α(H 0 ) in polynomial time. Next, we iterate over every vertex v ∈ V (C), and we b + 1 for the graph H b = H 0 \ NG0 (v) in polynomial time (since H b is a chordal compute αv = α(H) 0 graph). Overall, we return max{α(H ), maxv∈V (C) {αv }}. The necessity of tracking α(G0 ) stems from the fact that our recursive algorithm is based on the method of divide-and-conquer, and to ensure that when we divide the current instance into two instances we obtain two “simpler” instances, we need to argue that some aspect of these instances has indeed been simplified. Although this aspect cannot be the size of the instance (since the two instances can share many common vertices), we show that it can be the size of a maximum independent set. A fractional solution x is a function x : V (G0 ) → [0, ∞) such that for every chordless 0 cycle Q of that x(V (Q)) ≥ 1. An optimal fractional solution minimizes the weight PG it holds 0 w (x) = v∈V (G0 ) w0 (v) · x(v). Clearly, the solution to the instance (G0 , w0 ) of WCVD is at least as large as the weight of an optimal fractional solution. Although we initially compute an optimal fractional solution x (at the initialization phase that is described below), during the execution of our algorithm, we manipulate this solution so it may no longer be optimal. Prior to any call to CVD-APPROX with the exception of the first call, we ensure that x satisfies the following invariants: n+9 δ • Low-Value Invariant: For any v ∈ V (G0 ), it holds that x(v) < ( c·log c·log n ) · δ is the depth of the current recursive call in the recursion tree.6 1 c·log n . Here, • Zero-Clique Invariant: For any v ∈ V (C), it holds that x(v) = 0. Goal. The depth of the recursion tree will be bounded by q · log n for some fixed constant q. The correctness of this claim is proved when we explain how to perform a recursive call. For each recursive call CVD-APPROX (G0 , w0 , C, H 0 , x) with the exception of the first call, we aim to prove the following. Lemma 11. For any δ ∈ {1, 2, . . . , q · log n}, each recursive call to CVD-APPROX of depth δ ≥ 2 c·log n δ−1 returns a solution that is at least opt and at most ( c·log · c · log(α(G0 )) · w0 (x). Moreover, n+9 ) it returns a subset U ⊆ V (G0 ) that realizes the solution. At the initialization phase, we see that in order to prove Lemma 9, it is sufficient to prove Lemma 11. Initialization. Initially, the graphs G0 and H 0 are simply set to be the input graphs G and H, and the weight function w0 is simply set to be input weight function w. Moreover, we compute an optimal fractional solution x = xinit by using the ellipsoid method. Recall that the following claim holds. 6 The depth of the first call is defined to be 1. 12 Observation 12. The solution of the instance (G0 , w0 ) of WCVD is lower bounded by w0 (xinit ). Thus, to prove Lemma 9, it is sufficient to return a solution that is at least opt and at most c · log n · w0 (x). We would like to proceed by calling our algorithm recursively. For this purpose, we first need to ensure that x satisfies the low-value and zero-clique invariants, to which end we use the following notation. We let h(x) = {v ∈ V (G0 ) : x(v) ≥ 1/(c · log n)} denote the set of vertices to which x assigns high values. Moreover, given a clique M in G0 , we let (x \ M ) : V (G0 ) → [0, ∞) denote the function that assigns 0 to any vertex in M and (1 + 3 · max {x(u)})x(v) to any other vertex v ∈ V (G0 ). Now, to adjust x to be of the desired u∈V (G0 ) form both at this phase and at later recursive calls, we rely on the two following lemmata. 0 x) + b = G0 − h(x), w b = x|V (G) Lemma 13. Define G b = w0 |V (G) b and x b . Then, c · log n · w (b w0 (h(x)) ≤ c · log n · w0 (x). Proof. By the definition of h(x), it holds that w0 (b x) ≤ w0 (x) − w0 (b x) + w0 (h(x)) ≤ c · log n · w0 (x). 1 c·log n · w0 (h(x)). Thus, c · log n · 0 0 Thus, it is safe to update G0 to G0 − h(x), w0 to w0 |V (G) b , H to H − h(x) and x to x|V (G) b , 0 where we ensure that once we obtain a solution to the new instance, we add w (h(x)) to this solution and h(x) to the set realizing it. Lemma 14. Given a clique M in G0 , the function (x \ M ) is a valid fractional solution such that w0 (x \ M ) ≤ (1 + 3 · maxv∈V (G0 ) {x(v)})w0 (x). Proof. To prove that (x \ M ) is a valid fractional solution, let Q be some chordless cycle in G0 . We need to show that (x \ M )(V (Q)) ≥ 1. Since M is a clique, Q can contain at most two vertices from M . Thus, since x is a valid fractional solution, it holds that x(V (Q) \ V (M )) ≥ 1 − 2 · maxu∈V (G0 ) {x(u)}. By the definition (x \ M ), this fact implies that (x\M )(V (Q)) = (x\M )(V (Q)\V (M )) ≥ (1+3·maxu∈V (G0 ) {x(u)})(1−2·maxu∈V (G0 ) {x(u)}) ≥ 3 2 2 min{(1 + c·log n )(1 − c·log n ), 1} = min{1 + 1/(c · log n) − 6/((c · log n) ), 1} ≥ 1, where the last inequality relies on the assumption n ≥ 64. For the proof of the second part of the claim, note that w0 (x \ M ) = (1 + 3 · maxv∈V (G0 ) {x(v)}) w0 (x|V (G0 )\V (M ) ) ≤ (1 + 3 · maxv∈V (G0 ) {x(v)})w0 (x). Next, it is possible to call CVD-APPROX recursively with the fractional solution (x \ C). In the context of the low-value invariant, observe that indeed, for any v ∈ V (G0 ), it now holds that c·log n+9 δ 3 1 1 (x \ C)(v) = (1 + 3 · maxu∈V (G0 ) {x(u)})x(v) < (1 + c·log n ) · c·log n < ( c·log n ) · c·log n for δ = 1. n+9 δ 0 0 Similarly, by Lemma 14, w0 (x \ C) ≤ ( c·log c·log n ) · w (x) for δ = 1. It is also clear that α(G ) ≤ n. Thus, if Lemma 11 is true, we return a solution that is at least opt and at most c · log n · w(x) as desired. In other words, to prove Lemma 9, it is sufficient that we next focus only on the proof of Lemma 11. The proof of this lemma is done by induction. When we consider some recursive call, we assume that the solutions returned by the additional recursive calls that it performs, e such that α(G) e ≤ 3 α(G0 ), comply with the demands of the which are associated with graphs G 4 lemma. Termination. Once G0 becomes a chordal graph, we return 0 as our solution and ∅ as the set that realizes it. Clearly, we thus satisfy the demands of Lemma 11. In fact, we thus also ensure that the execution of our algorithm terminates once α(G0 ) < 24: Lemma 15. If α(G0 ) < 24, then G0 is a chordal graph. 13 C M G1 G2 Figure 1: Subinstances created by a recursive call Proof. Suppose, by way of contradiction, that G0 is not a chordal graph. Then, it contains a chordless cycle Q. Since G0 is an induced subgraph of G, where G is assumed to exclude any chordless cycle on at most 48 vertices, we have that |V (Q)| > 48. Note that if we traverse Q in some direction, and insert every second vertex on Q into a set, excluding the last vertex in case |V (Q)| is odd, we obtain an independent set. Thus, we have that α(G) ≥ 24, which is a contradiction. Thus, since we will ensure that each recursive calls is associated with a graph whose independence number is at most 3/4 the independence number of the current graph, we have the following observation. Observation 16. The maximum depth of the recursion tree is bounded by q · log n for some fixed constant q. Recursive Call. Since H 0 is a chordal graph, it admits a clique forest (Lemma 1). In particular, it contains only O(n) maximal cliques, and one can find the set of these maximal cliques in polynomial time [21]. By standard arguments on trees, we deduce that H 0 has a maximal clique b 1 and M such that after we remove M from G0 we obtain two (not necessarily connected) graphs, H 2 0 b 2 , such that α(H b 1 ), α(H b 2 ) ≤ α(H ), and that the clique M can be found in polynomial time. H 3 0 b 1 ) ∪ V (M ) ∪ V (C)], H1 = H 0 [V (H b 1 ) ∪ V (M )], G2 = G0 [V (H b 2 ) ∪ V (M ) ∪ V (C)] Let G1 = G [V (H 2 0 0 b and H2 = H [V (H2 ) ∪ V (M )], and observe that α(G1 ), α(G2 ) ≤ 3 α(G ) + 2 ≤ 34 α(G0 ). Here, the last inequality holds because α(G0 ) ≥ 24, else by Lemma 15, the execution should have already terminated. We proceed by replacing x by (x\M ). For the sake of clarity, we denote x∗ = (x\M ). By Lemmata 13 and 14, to prove Lemma 11, it is now sufficient to return a solution that is at least opt and c · log n + 9 δ 1 c · log n δ−1 at most (1/(1 + 3 · ( ) · )) · ( ) · log α(G0 ) · w(x∗ ), along with a c · log n c · log n c · log n + 9 c · log n + 9 δ set that realizes it. Moreover, for any v ∈ V (G0 ), it holds that x∗ (v) < (1 + 3 · ( ) c · log n 1 c · log n + 9 δ 1 )·( ) · · . Note that by Observation 16, by setting c ≥ 9q, we have c · log n c · log n c · log n c · log n + 9 δ c · log n + 9 δ 1 c · log n + 9 that ( ) ≤ e < 3, and therefore 1 + 3 · ( ) · ≤ . In c · log n c · log n c · log n c · log n particular, to prove Lemma 11, it is sufficient to return a solution that is at least opt and at c · log n δ most ( ) · log α(G0 ) · w(x∗ ). c · log n + 9 14 C M Q G2 G1 Figure 2: An illustration of a bad cycle Next, we define two subinstances, I1 = (G1 , w|V (G1 ) , C, H1 , x∗ |V (G1 ) ) and I2 = (G2 , w|V (G2 ) , C, H2 , x∗ |V (G2 ) ) (see Figure 1). We solve each of these subinstances by a recursive call to CVD-APPROX (by the above discussion, these calls are valid — we satisfy the low-value and zero-clique invariants). Thus, we obtain two solutions, s1 to I1 and s2 to I2 , and two sets that realize these solutions, S1 and S2 . By the inductive hypothesis, we have the following observations. Observation 17. S1 ∪ S2 intersects any chordless cycle in G0 that lies entirely in either G1 or G2 . c·log n δ ∗ Observation 18. Given i ∈ {1, 2}, si ≤ ( c·log n+9 ) · c · log(α(Gi )) · w(xi ). Moreover, since x∗ (V (C) ∪ V (M )) = 0, we also have the following observation. Observation 19. w(x∗1 ) + w(x∗2 ) = w(x∗ ). We say that a cycle of G0 is bad if it is a chordless cycle that belongs entirely to neither G1 nor G2 (see Figure 2). Next, we show how to intersect bad cycles. Bad Cycles. For any pair (v, u) of vertices v ∈ V (C) and u ∈ V (M ), we let P1 (v, u) denote the set of any (simple) path P1 between v and u whose internal vertices belong only to G1 and which does not contain a vertex v 0 ∈ C and a vertex u0 ∈ M such that {v 0 , u0 } ∈ E(G0 ). Symmetrically, we let P2 (v, u) denote the set of any path P2 between v and u whose internal vertices belong only to G2 and which does not contain a vertex v 0 ∈ C and a vertex u0 ∈ M such that {v 0 , u0 } ∈ E(G0 ). We note here that when {v, u} ∈ E(G0 ) then P1 (v, u) = P2 (v, u) = ∅. We first examine the relation between bad cycles and pairs (v, u) of vertices v ∈ V (C) and u ∈ V (M ). Lemma 20. For any bad cycle Q there exist a pair (v, u) of vertices v ∈ V (C), u ∈ V (M ), a path P1 ∈ P1 (v, u) such that V (P1 ) ⊆ V (Q), and a path P2 ∈ P2 (v, u) such that V (P2 ) ⊆ V (Q). Proof. Let Q be some bad cycle. By the definition of a bad cycle, Q must contain at least one vertex a from H1 \ V (M ) and at least one vertex b from H2 \ V (M ). Since C and M are cliques, Q can contain at most two vertices from C and at most two vertices from M , and if it contains two vertices from C (resp. M ), then these two vertices are neighbors. Moreover, since the set V (C) ∪ V (M ) contains all vertices common to G1 and G2 , Q must contain at least one vertex v ∈ V (C) and at least one vertex u ∈ V (M ) with {v, u} ∈ / E(G0 ). Overall, we conclude that the subpath of Q between v and u that contains a belongs to P1 (v, u), while the subpath of Q between v and u that contains b belongs to P2 (v, u). 15 In light Lemma 20, to intersect bad cycles, we now examine how the fractional solution x∗ handles pairs (v, u) of vertices v ∈ V (C) and u ∈ V (M ). Lemma 21. For each pair (v, u) of vertices v ∈ V (C) and u ∈ V (M ) with {v, u} ∈ / E(G0 ), there ∗ exists i ∈ {1, 2} such that for any path P ∈ Pi (v, u), x (V (P )) ≥ 1/2. Proof. Suppose, by way of contradiction, that the lemma is incorrect. Thus, there exist a pair (v, u) of vertices v ∈ V (C) and u ∈ V (M ) with {v, u} ∈ / E(G0 ), a path P1 ∈ P1 (v, u) such that ∗ x (V (P1 )) < 1/2, and a path P2 ∈ P2 (v, u) such that x∗ (V (P2 )) < 1/2. Since x∗ is a valid fractional solution, we deduce that G0 [V (P1 ) ∪ V (P2 )] does not contain any chordless cycle. Consider a shortest subpath Pb1 of P1 between a vertex a1 ∈ V (C) and a vertex b1 ∈ V (M ), and a shortest subpath Pb2 of P2 between a vertex a2 ∈ V (C) and a vertex b2 ∈ V (M ). Since neither P1 nor P2 contains any edge such that one of its endpoints belongs to V (C) while the other endpoint belongs to V (M ), we have that |V (Pb1 )|, |V (Pb2 )| ≥ 3. Furthermore, since vertices common in P1 and P2 must belong to V (C) ∪ V (M ), we have that Pb1 does not contain internal vertices that belong to Pb2 or adjacent to internal vertices on Pb2 . Overall, since C and M are cliques, we deduce that G0 [V (Pb1 ) ∪ V (Pb2 )] contains a chordless cycle. To see this, let a be the vertex closest to b2 on Pb2 that is a neighbor of a1 . Observe that a exists as a1 and a2 are neighbors, and a 6= b2 . Moreover, we assume without loss of generality that if a = a2 , then a2 has no neighbor on Pb1 apart from a1 . Now, let b be the vertex closest to a on the subpath of Pb2 between a and b2 that is a neighbor of b1 . If b = 6 b2 , then the vertex-sets of Pb1 and the subpath b of P1 between a and b together induce a chordless cycle. Else, let b0 be the vertex closest to a1 on Pb1 that is a neighbor of b2 . Then, the vertex-sets of the subpath of Pb1 between a1 and b0 and the subpath of Pb1 between a and b2 together induce a chordless cycle. Since G0 [V (Pb1 ) ∪ V (Pb2 )] is an induced subgraph of G0 [V (P1 ) ∪ V (P2 )], we have reached a contradiction. Given i ∈ {1, 2}, let 2x∗i denote the fractional solution that assigns to each vertex the value b 1 = G1 \ (V (C) ∪ V (M )) and G b 2 = G2 \ (V (C) ∪ V (M )). assigned by x∗i times 2. Moreover, let G b b Observe that G1 and G2 are chordal graphs. Now, for every pair (v, u) such that v ∈ V (C), u ∈ V (M ), we perform the following operation. We initialize T1 (v, u) = ∅. Next, we consider every pair (v 0 , u0 ) such that v 0 ∈ V (C), u0 ∈ V (M ), {v, v 0 } ∩ NG1 (u0 ) = ∅ and {u, u0 } ∩ NG1 (v 0 ) = ∅, b 1 ), b ∈ NG (u0 ) ∩ V (G b 1 ), G b 1 has a path between and insert each pair in {(a, b) : a ∈ NG1 (v 0 ) ∩ V (G 1 a and b} into T1 (v, u). We remark that the vertices in a pair in T1 (v, u) are not necessarily distinct. The definition of T2 (v, u) is symmetric to the one of T1 (v, u). The following lemma translates Lemma 21 into an algorithm. Lemma 22. For each pair (v, u) of vertices v ∈ V (C), u ∈ V (M ) and {v, u} ∈ / E(G0 ), one can compute (in polynomial time) an index i(v, u) ∈ {1, 2} such that for any path P ∈ Pi (v, u), 2x∗i (V (P )) ≥ 1. Proof. Let (v, u) be a pair of vertices such that v ∈ V (C), u ∈ V (M ) and {v, u} ∈ / E(G0 ). If there is i ∈ {1, 2} such that P ∈ Pi (v, u) = ∅, then we have trivially obtained the required index which is i(v, u) = i. Otherwise, we proceed as follows. For any index j ∈ {1, 2}, we perform the following procedure. For each pair (a, b) ∈ Ti (v, u), we use Dijkstra’s algorithm to b i where the weights are compute the minimum weight of a path between a and b in the graph G ∗ given by 2xi . In case for every pair (a, b) the minimum weight is at least 1, we have found the desired index i(v, u). Moreover, by Lemma 21 and since for all v 0 ∈ V (C) ∪ V (M ) it holds that x∗1 (v 0 ) = x∗2 (v 0 ) = 0, for at least one index j ∈ {1, 2}, the maximum weight among the minimum weights associated with the pairs (a, b) should be at least 1 (if this value is at least 1 for both indices, we arbitrarily decide to fix i(v, u) = 1). At this point, we need to rely on approximate solutions to Weighted Multicut in chordal graphs (in this context, we will employ the algorithm given by Theorem 5 in Section 5). Here, 16 a fractional solution y is a function y : V (G0 ) → [0, ∞) such that for every pair (si , ti ) ∈ T and any path P between si and Pti , it holds that y(V (P )) ≥ 1. An optimal fractional solution minimizes the weight w(y) = v∈V (G0 ) w(v) · y(v). Let fopt denote the weight of an optimal fractional solution. By first employing the algorithm given by Lemma 22, we next construct two instances b 1 , w1 , T1 ) and the second instance is of Weighted Multicut. The first instance is J1 = (G b 2 , w2 , T2 ), where the sets T1 and T2 are defined as follows. We initialize T1 = ∅. Now, J2 = (G for every pair (v, u) such that v ∈ V (C), u ∈ V (M ), i(v, u) = 1 and P1 (v, u) 6= ∅, we insert each pair in T1 (v, u) into T1 . The definition of T2 is symmetric to the one of T1 . By Lemma 22 and since for all v ∈ V (C) ∪ V (M ) it holds that x∗1 (v) = x∗2 (v) = 0, we deduce that 2x∗1 and 2x∗2 are valid solutions to J1 and J2 , respectively. Thus, by calling the algorithm given by Theorem 5 with each instance, we obtain a solution r1 to the first instance, along with a set R1 that realizes it, such that r1 ≤ 2d · w(x∗1 ), and we also obtain a solution r2 to the second instance, along with a set R2 that realizes it, such that r2 ≤ 2d · w(x∗2 ), for some fixed constant d. By Observation 17 and Lemma 20, we obtained a set S ∗ = S1 ∪ S2 ∪ R1 ∪ R2 for which we have the following observation. Observation 23. S ∗ intersects any chordless cycle in G0 , and it holds that w(S ∗ ) ≤ s1 + s2 + r1 + r2 . c·log n δ−1 Recall that to prove Lemma 11 we need to show that s1 + s2 + r1 + r2 ≤ ( c·log ·c· n+9 ) c·log n δ 0 0 log(α(G0 )) · w0 (x) and we have δ ≥ 2. Furthermore, we have ( c·log n+9 ) · c · log(α(G )) · w (x) ≤ c·log n δ−1 ( c·log · c · log(α(G0 )) · w0 (x). This together with Lemma 14 implies that it is enough n+9 ) c·log n δ 0 ∗ to show s1 + s2 + r1 + r2 ≤ ( c·log n+9 ) · c · log(α(G )) · w(x ). Recall that for any i ∈ {1, 2}, ri ≤ 2d · w(x∗i ). Thus, by Observation 18 and since for any i ∈ {1, 2}, α(Gi ) ≤ 34 α(G0 ), we have that w(S ∗ ) ≤ ( c · log n δ 3 ) · c · log( α(G0 )) · (w(x∗1 ) + w(x∗2 )) + 2d · (w(x∗1 ) + w(x∗2 )). c · log n + 9 4 By Observation 19, we further deduce that   c · log n δ 3 w∗ (S ∗ ) ≤ ( ) · c · log( α(G0 )) + 2d · w(x∗ ). c · log n + 9 4 c log n δ c log n δ 3 0 0 Now, it only remains to show that ( c log n+9 ) · c · log( 4 α(G )) + 2d ≤ ( c log n+9 ) · c · log α(G ), c log n δ 4 which is equivalent to 2d ≤ ( c log n+9 ) · c · log( 3 ). Recall that δ ≤ q · log n (Observation 16). Thus, c log n q·log n c log n q·log n it is sufficient that we show that 2d ≤ ( c log ·c·log( 43 ). However, the term ( c log n+9 ) n+9 ) 9q 9q is lower bounded by 1/e . In other words, it is sufficient that we fix c ≥ 2 · e · d · 1/ log( 43 ). 4.2 General Graphs In this subsection we handle general instances by developing a d · log2 n-factor approximation algorithm for WCVD, Gen-CVD-APPROX, thus proving the correctness of Theorem 2. The exact value of the constant d ≥ max{96, 2c} is determined later.7 This algorithm is based on recursion, and during its execution, we often encounter instances that are of the form of the Clique+Chordal special case of WCVD, which will be dealt with using the algorithm CVD-APPROX of Section 4.1. 7 Recall that c is the constant we fixed to ensure that the approximation ratio of CVD-APPROX is bounded by c · log n. 17 Recursion. We define each call to our algorithm Gen-CVD-APPROX to be of the form (G0 , w0 ), where (G0 , w0 ) is an instance of WCVD such that G0 is an induced subgraph of G, and we denote n0 = |V (G0 )|. We ensure that after the initialization phase, the graph G0 never contains chordless cycles on at most 48 vertices. We call this invariant the C48 -free invariant. In particular, this guarantee ensures that the graph G0 always contains only a small number of maximal cliques: Lemma 24 ([11, 41]). The number of maximal cliques of a graph G0 that has no chordless cycles on four vertices is bounded by O(n0 2 ), and they can be enumerated in polynomial time using a polynomial delay algorithm. Goal. For each recursive call Gen-CVD-APPROX(G0 , w0 ), we aim to prove the following. Lemma 25. Gen-CVD-APPROX returns a solution that is at least opt and at most Moreover, it returns a subset U ⊆ V (G0 ) that realizes the solution. 2 0 d 2 · log n · opt. At each recursive call, the size of the graph G0 becomes smaller. Thus, when we prove that Lemma 25 is true for the current call, we assume that the approximation factor is bounded by 2 d b · opt for any call where the size n b of the vertex-set of its graph is strictly smaller than n0 . 2 · log n Initialization. Initially, we set (G0 , w0 ) = (G, w). However, we need to ensure that the C48 -free invariant is satisfied. For this purpose, we update G0 as follows. First, we let C48 denote the set of all chordless cycles on at most 48 vertices of G0 . Clearly, C48 can be computed in polynomial time and it holds that |C48 | ≤ n48 . Now, we construct an instance of Weighted 48-Hitting Set, where the universe is V (G0 ), the family of 48-sets is C48 , and the weight function is w0 . Since each chordless cycle must be intersected, it is clear that the optimal solution to our Weighted 48-Hitting Set instance is at most opt. By using the standard c0 -approximation algorithm for Weighted c0 -Hitting Set [27], which is suitable for any fixed constant c0 , we obtain a set S ⊆ V (G0 ) that intersects all cycles in C48 and whose weight is at most 48 · opt. Having the set S, we remove its vertices from G0 . Now, the C48 -free invariant is satisfied, which implies that we can recursively call our algorithm. To the outputted solution, we add w(S) and S. If Lemma 25 is true, we obtain a solution that is at most d2 · log2 n · opt + 48 · opt ≤ d · log2 n · opt, which allows us to conclude the correctness of Theorem 2. We remark that during the execution of our algorithm, we only update G0 by removing vertices from it, and thus it will always be safe to assume that the C48 -free invariant is satisfied. Termination. Observe that due to Lemma 24, we can test in polynomial time whether G0 consists of a clique and a chordal graph: we examine each maximal clique of G0 , and check whether after its removal we obtain a chordal graph. Once G0 becomes such a graph that consists of a chordal graph and a clique, we solve the instance (G0 , w0 ) by calling algorithm CVD-APPROX. Since c · log n0 ≤ d2 · log2 n0 , we thus ensure that at the base case of our induction, Lemma 25 holds. Recursive Call. For the analysis of a recursive call, let S ∗ denote a hypothetical set that realizes the optimal solution opt of the current instance (G0 , w0 ). Moreover, let (F, β) be a clique forest of G0 − S ∗ , whose existence is guaranteed by Lemma 1. Using standard arguments on forests, we have the following observation. Observation 26. There exist a maximal clique M of G0 and a subset S ⊆ V (G0 ) \ M of weight at most opt such that M ∪ S is a balanced separator for G0 . The following lemma translates this observation into an algorithm. Lemma 27. There is a polynomial-time algorithm that finds a maximal clique M of G0 and a subset S ⊆ V (G0 ) \ M of weight at most q · log n0 · opt for some fixed constant q such that M ∪ S is a balanced separator for G0 . 18 Proof. We examine every maximal clique of G0 . By Lemma 24, we need only consider O(n0 2 ) maximal cliques, and these cliques can be enumerated in polynomial time. For each such clique M , we run the q · log n0 -factor approximation algorithm by Leighton and Rao [28] to find a balanced separator SM of G0 − M . Here, q is some fixed constant. We let S denote some set of minimum weight among the sets in {SM : M is a maximal clique of G0 }. By Observation 26, w(S) ≤ q · log n0 · opt. Thus, the desired output is a pair (M, S) where M is one of the examined maximal cliques such that SM = S. We call the algorithm in Lemma 27 to obtain a pair (M, S). Since M ∪ S is a balanced separator for G0 , we can partitionSthe set of connected components of G0 − (M ∪ S) into two sets, S A1 and A2 , such that for V1 = A∈A1 V (A) and V2 = A∈A2 V (A) it holds that n1 , n2 ≤ 23 n0 where n1 = |V1 | and n2 = |V2 |. We remark that we used the O(log n)-factor approximation algorithm by Leighton and Rao [28] in Lemma 27 to find the balanced separator instead of the √ O( log n)-factor approximation algorithm by Feige et al. [12], as the algorithm by Feige et al. is randomized. Next, we define two inputs of (the general case of) WCVD: I1 = (G0 [V1 ], w0 |V1 ) and I2 = 0 (G [V2 ], w0 |V2 ). Let opt1 and opt2 denote the optimal solutions to I1 and I2 , respectively. Observe that since V1 ∩ V2 = ∅, it holds that opt1 + opt2 ≤ opt. We solve each of the subinstances by recursively calling algorithm Gen-CVD-APPROX. By the inductive hypothesis, we thus obtain two sets, S1 and S2 , such that G0 [V1 ] − S1 and G0 [V2 ] − S2 are chordal graphs, and w0 (S1 ) ≤ d2 · log2 n1 · opt1 and w0 (S2 ) ≤ d2 · log2 n2 · opt2 . We proceed by defining an input of the Clique+Chordal special case of WCVD: J = 0 (G [(V1 ∪V2 ∪M )\(S1 ∪S2 )], w0 |(V1 ∪V2 ∪M )\(S1 ∪S2 ) ). Observe that since G0 [V1 ]−S1 and G0 [V2 ]−S2 are chordal graphs and M is a clique, this is indeed an instance of the Clique+Chordal special case of WCVD. We solve this instance by calling algorithm CVD-APPROX. We thus obtain a b such that G0 [(V1 ∪ V2 ∪ M ) − (S1 ∪ S2 ∪ S)] b is a chordal graphs, and w0 (S) b ≤ c · log n0 · opt set, S, 0 (since |(V1 ∪ V2 ∪ M ) \ (S1 ∪ S2 )| ≤ n and the optimal solution of each of the subinstances is at most opt). Observe that since M is a clique and there is no edge in E(G0 ) between a vertex in V1 and a vertex in V2 , any chordless cycle of G0 − (S ∪ S1 ∪ S2 ) entirely belongs to either G0 [(V1 ∪ M ) \ S1 ] b or G0 [(V2 ∪ M ) \ S2 ]. This observation, along with the fact that G0 [(V1 ∪ V2 ∪ M ) \ (S1 ∪ S2 ∪ S)] 0 b is a chordal graphs, implies that G − T is a chordal graphs where T = S ∪ S1 ∪ S2 ∪ S. Thus, it is now sufficient to show that w0 (T ) ≤ d2 · log2 n0 · opt. By the discussion above, we have that b w0 (T ) ≤ w0 (S) + w0 (S1 ) + w0 (S2 ) + w0 (S) 2 ≤ q · log n0 · opt + d2 · (log n1 · opt1 + log2 n2 · opt2 ) + c · log n0 · opt. Recall that n1 , n2 ≤ 23 n0 and opt1 + opt2 ≤ opt. Thus, we have that w0 (T ) ≤ q · log n0 · opt + d2 · (log2 32 n0 ) · opt + c · log n0 · opt ≤ d2 · log2 n0 · opt + (q + c − d2 log 23 ) · log n0 · opt. · log2 n0 · opt, it is sufficient to ensure 2 ≤ 0, which can be done by fixing d = · (q + c). log 32 Overall, we conclude that to ensure that w0 (T ) ≤ that q + c − 5 d 2 log 32 d 2 Weighted Multicut in Chordal Graphs In this section we prove Theorem 3. Let us denote c = 8. Recall that for Weighted Multicut, a fractional solution x is a function x : V (G) → [0, ∞) such that for every pair (s, t) ∈ T and any path P between s and t, it holds that x(V (P )) ≥ 1. An optimal fractional solution minimizes 19 P the weight w(x) = v∈V (G) w(v) · x(v). Let fopt denote the weight of an optimal fractional solution. Theorem 3 follows from the next result, whose proof is the focus of this section. Lemma 28. Given an instance of Weighted Multicut in chordal graphs, one can find (in polynomial time) a solution that is at least opt and at most 4c · fopt, along with a set that realizes it. Preprocessing. By using the ellipsoid method, we may next assume that we have optimal fractional solution x at hand. We say that x is nice if for all v ∈ V (G), there exists i ∈ {0} ∪ N such that x(v) = ni . Let h(x) = {v ∈ V (G) : x(v) ≥ 1/c} denote the set of vertices to which x assigns high values. b : V (G) → [0, ∞) as follows. For all v ∈ V (G), if x(v) < 1/2n Lemma 29. Define a function x b(v) = 0, and otherwise x b(v) is the smallest value of the form i/n, for some i ∈ N, that is then x b is a fractional solution such that w(b at least 2x(v). Then, x x) ≤ 4w(x). b is a fractional solution, consider some path P between s and t such that Proof. To show that x P b(V (P )) = v∈V (P )\`0 (x) x b(v) ≥ (s, t) ∈ T . Let `0 (x) = {v ∈ V (G) : x(v) < 1/2n}. We have that x P b(V (P )) ≥ 1, it is sufficient to show that 12 ≤ 2P v∈V (P )\`0 (x) x(v). Thus, to show that x P v∈V (P )\`0 (x) x(v). Since x is a fractional solution, it holds that x(V (P )) = v∈V (P )∩`0 (x) x(v) + P P 1 0 (x)|+ x(v) x(v). ≥ 1. Thus, 1 ≤ |V (P )∩` Since |V (P )∩`0 (x)| ≤ n, v∈V (P )\`0 (x) v∈V (P )\`0 (x) 2n P we conclude that 12 ≤ v∈V (P )\`0 (x) x(v). b(v) ≤ The second part of the claim follows from the observation that for all v ∈ V (G), x 4x(v). b. Our preprocessing step also relies on the following standard Accordingly, we update x to x lemma. b = G − h(x), w b = x|V (G) Lemma 30. Define G b = w|V (G) x) + w(h(x)) ≤ b and x b . Then, c · w(b c · w(x). Proof. By the definition of h(x), it holds that w(b x) ≤ w(x)− 1c w(h(x)). Thus, c·w(b x)+w(h(x)) ≤ 1 c · (w(x) − c · w(h(x))) + w(h(x)) = c · w(x). b w to w b, where we ensure that once we obtain a We thus further update G to G, b and x to x solution to the new instance, we add w(h(x)) to this solution and h(x) to the set realizing it. Overall, we may next focus only on the proof of the following lemma. Lemma 31. Let (G, w) be an instance of Weighted Multicut in chordal graphs, and x be a nice fractional solution such that h(x) = ∅. Then, one can find (in polynomial time) a solution that is at least opt and at most c · w(x), along with a set that realizes it. The Algorithm. Since G is a chordal graph, we can first construct in polynomial time a clique forest (F, β) of G (Lemma 1). Without loss of generality, we may assume that F is a tree, else G is not a connected graph and we can handle each of its connected components separately. Now, we arbitrarily root F at some node rF , and we arbitrarily choose a vertex rG ∈ β(rF ). We then use Dijkstra’s algorithm to compute (in polynomial time) for each vertex v ∈ V (G), the value d(v) = min x(V (P )), where P(v) is the set of paths in G between rG and v. P ∈P(v) We define n + 1 bins: for all i ∈ {0, 1, . . . , n}, the bin Bi contains every vertex v ∈ V (G) for which there exists j ∈ {0}∪N such that d(v)−x(v) < ( ni +2j) 1c ≤ d(v) (i.e., 0 ≤ d(v)−( ni +2j) 1c < 20 x(v)). Let Bi∗ , i∗ ∈ {0, 1, . . . , n}, be a bin that minimizes w(Bi∗ ). The output consists of w(Bi∗ ) and Bi∗ . br be the set that contains every vertex v ∈ V (G) Approximation Factor. Given r ∈ [0, 1], let B for which there exists j ∈ {0} ∪ N such that 0 ≤ d(v) − (r + 2j) 1c < x(v). We start with the following claim. br∗ ) ≤ c · w(x). Lemma 32. There exists r∗ ∈ [0, 1] such that w(B Proof. For any d ≥ 0, observe that there exists exactly one j ∈ {0} ∪ N for which there exists r ∈ [0, 1] such that 0 ≤ d − (r + 2j) 1c < 1c , and denote it by j(d). Suppose that we choose r ∈ [0, 1] uniformly at random. Consider some vertex v ∈ V (G). Then, since h(x) = ∅, the probability that there exists j ∈ {0} ∪ N such that 0 ≤ d(v) − (r + 2j) 1c < x(v) is equal to the probability that 0 ≤ d(v) − (r + 2j(d(v))) 1c < x(v). Now, the probability that 0 ≤ d(v) − (r + 2j(d(v))) 1c < x(v) br ) is c · P is equal to c · x(v). The expected weight w(B v∈V (G) x(v) · w(v) = c · w(x). Thus, there ∗ br∗ ) ≤ c · w(x). exists r ∈ [0, 1] such that w(B Now, the proof of the approximation factor follows from the next claim. br∗ . Lemma 33. There exists i ∈ {0, 1, . . . , n} such that Bi ⊆ B Proof. Let i be the smallest index in {0, 1, . . . , n} such that r∗ ≤ ni . Consider some vertex v ∈ Bi . Then, for some j ∈ {0} ∪ N, d(v) − x(v) < ( ni + 2j) 1c ≤ d(v). Since r∗ ≤ ni , we have that (r∗ + 2j) 1c ≤ d(v). Since x is nice, it holds that there exists t ∈ {0} ∪ N such that d(v) − x(v) = nt . Thus, for any p < n1 , it holds that d(v) − x(v) < ( ni + 2j − p) 1c . By the choice of i, ni − r∗ < n1 , br∗ . and therefore d(v) − x(v) < (r∗ + 2j) 1c , which implies that v ∈ B Feasibility. We need to prove that for any pair (s, t) ∈ T , G − Bi∗ does not have any path between s and t. Consider some path P = (v1 , v2 , · · · , v` ) between s and t. Here, v1 = s and v` = t. Suppose, by way of contradiction, that V (P ) ∩ Bi∗ = ∅. Then, for all vi ∈ V (P ), it holds ∗ that there is no j ∈ {0} ∪ N such that 0 ≤ d(vi ) − ( in + 2j) 1c < x(vi ). Let s ∈ V (F ) be the closest node to rF that satisfies β(s) ∩ V (P ) 6= ∅ (since F is a clique tree and P is a path, the node s is uniquely defined). Let vbi be some vertex in β(s) ∩ V (P ) 6= ∅. For the sake of clarity, let us denote the subpath of P between vbi and v` by Q = (u1 , u2 , · · · , ut ), where u1 = vbi and ut = v` . Let j ∗ be the smallest value in {0} ∪ N that satisfies d(u1 ) − x(u1 ) < ∗ ∗ ( in + 2j ∗ ) 1c . Note that d(u1 ) < ( in + 2j ∗ ) 1c . It is thus well defined to let p denote the largest ∗ index in [t] such that d(up ) < ( in + 2j ∗ ) 1c . ∗ First, suppose that p ∈ [t − 1]. We then have that ( in + 2j ∗ ) 1c ≤ d(up+1 ). For all 2 ≤ i ≤ t, it ∗ holds that d(ui ) ≤ d(ui−1 ) + x(ui ). We thus obtain that d(up+1 ) − x(up+1 ) ≤ d(up ) < ( in + 2j ∗ ) 1c . This statement implies that up+1 ∈ Bi∗ , which is a contradiction. ∗ Now, we suppose that p = t. Note that ( in + 2j ∗ − 2) 1c ≤ d(u1 ) − x(u1 ) (by the minimality ∗ of j ∗ ), and d(ut ) < ( in + 2j ∗ ) 1c . We get that d(ut ) < d(u1 ) − x(u1 ) + 2c . In other words, d(ut ) − d(u1 ) + x(u1 ) < 2c . Let des(s) denote the set S consisting of s and its descendants in F . Since F is a clique tree, we have that V (Q) ⊆ s0 ∈des(s) β(s0 ). Thus, any path from rG to ut that realizes d(ut ) contains a vertex from β(s). Since there exists a path from rG to ut that realizes d(ut ), we deduce that there exists a path, Pt , from rG to ut that realizes d(ut ) and contains a vertex x ∈ NG [u1 ]. Let Pt∗ denote the subpath of Pt between x and ut , and let P ∗ denote the path that starts at u1 and then traverses Pt∗ . Then, x(V (P ∗ )) ≤ x(u1 ) + x(V (Pt∗ )) = x(u1 ) + d(ut ) − d(x) + x(x). Note that d(u1 ) ≤ d(x) + x(u1 ), and therefore x(V (P ∗ )) ≤ x(u1 ) + d(ut ) − (d(u1 ) − x(u1 )) + x(x) = x(u1 ) + x(x) + (d(ut ) − d(u1 ) + x(u1 )). Since h(x) = ∅ and d(ut ) − d(u1 ) + x(u1 ) < 2c , we get that x(V (P ∗ )) < 4c . The symmetric analysis of 21 House Gem Domino Cycle on at least 5 vertices Figure 3: Obstruction set for distance hereditary graphs the subpath of P between u1 = vbi and v1 shows that there exists a path P ∗∗ between u1 and v1 such that x(V (P ∗∗ )) < 4c . Overall, we get that there exists a path, P 0 , between v1 = s and v` = u` = t such that x(V (P 0 )) < 8c . Since c ≥ 8, we reach a contradiction to the assumption that x is a fractional solution. 6 Distance-Hereditary Vertex Deletion In this section we prove Theorem 4. We start with preliminaries. Preliminaries. A graph G is distance hereditary if every connected induced subgraph H of G, for all u, v ∈ V (H) the number of vertices in shortest path between u and v in G is same as the number of vertices in shortest path between u and v in H. Another characterization of distance hereditary graphs is the graph not containing an induced sub-graph isomorphic to a house, a gem, a domino or an induced cycle on 5 or more vertices (refer Figure 3). We refer to a house, a gem, a domino or an induced cycle on at least 5 vertices as a DH-obstruction. A DH-obstruction on at most 48 vertices is a small DH-obstruction. A biclique is a graph G with vertex bipartition X, Y each of them being non-empty such that for each x ∈ X and y ∈ Y we have {x, y} ∈ E(G). We note here that, X and Y need not be independent sets in a biclique G. Clearly, we can assume that the weight w(v) of each vertex v ∈ V (G) is positive, else we can insert v into any solution. Our approximation algorithm for WDHVD comprises of two components. The first component handles the special case where the input graph G consists of a biclique C and a distance hereditary H. Here, we also assume that the input graph has no “small” DH-obstruction. We show that when input restricted to these special instances WDHVD admits an O(log2 n)-factor approximation algorithm. The second component is a recursive algorithm that solves general instances of the problem. Initially, it easily handles “small” DH-obstruction. Then, it gradually disintegrates a general instance until it becomes an instance of the special form that can be solved in polynomial time. More precisely, given a problem instance, the algorithm divides it by finding a maximal biclique M (using an exhaustive search which relies on the guarantee that G has no “small” DH-obstruction) and a small separator S (using an approximation algorithm) that together break the input graph into two graphs significantly smaller than their origin. 6.1 Biclique+ Distance Hereditary Graph In this subsection we handle the special case where the input graph G consists of a biclique C and a distance hereditary graph H. More precisely, along with the input graph G and the weight function w, we are also given a biclique C and a distance hereditary graph H such that V (G) = V (C) ∪ V (H), where the vertex-sets V (C) and V (H) are disjoint. Here, we also assume that G has no DH-obstruction on at most 48 vertices, which means that every DH-obstructionin G is a chordless cycle of strictly more than 48 vertices. Note that the edge-set E(G) may contain 22 edges between vertices in C and vertices in H. We call this special case the Biclique + Distance Hereditary special case. Our objective is to prove the following result. Lemma 34. The Biclique + Distance Hereditary special case of WDHVD admits an O(log2 n)factor approximation algorithm. We assume that n ≥ 212 , else the input instance can be solve by brute-force 8 . Let c be a fixed constant (to be determined later). In the rest of this subsection, we design a c · log n-factor approximation algorithm for the Biclique + Distance Hereditary special case of WDHVD. Recursion. Our approximation algorithm is a recursive algorithm. We call our algorithm DHD-APPROX, and define each call to be of the form (G0 , w0 , C, H 0 , x). Here, G0 is an induced subgraph of G such that V (C) ⊆ V (G0 ), and H 0 is an induced subgraph of H. The argument x is discussed below. We remark that we continue to use n to refer to the size of the vertex-set of the input graph G rather than the current graph G0 . Arguments. While the execution of our algorithm progresses, we keep track of two arguments: the number of vertices in the current distance hereditary graph H 0 that are assigned a non-zero value by x, which we denote by α(G0 ) and the fractional solution x. Observation 35. The measure α(G0 ) can be computed in polynomial time. A fractional solution x is a function x : V (G0 ) → [0, ∞) such that for every chordless cycle Q of G0 on at least 5 vertices it holds that x(V (Q)) ≥ 1. An optimal fractional solution P minimizes the weight w0 (x) = v∈V (G0 ) w0 (v) · x(v). Clearly, the solution to the instance (G0 , w0 ) of WDHVD is at least as large as the weight of an optimal fractional solution. Although we initially compute an optimal fractional solution x (at the initialization phase that is described below), during the execution of our algorithm, we manipulate this solution so it may no longer be optimal. Prior to any call to DHD-APPROX with the exception of the first call, we ensure that x satisfies the following invariants: • Low-Value Invariant: For any v ∈ V (G0 ), it holds that x(v) < 1/ log n. • Zero-Biclique Invariant: For any v ∈ V (C), it holds that x(v) = 0. We note that the Low-Value Invariant used here is simpler than the one used in Section 4.1 since it is enough for the purpose of this section. Goal. The depth of the recursion tree will be bounded by ∆ = O(log n), where the depth of initial call is 1. The correctness of this claim is proved when we explain how to perform a recursive call. For each recursive call to DHD-APPROX(G0 , w0 , C, H 0 , x), we aim to prove the following. Lemma 36. For any δ ∈ {1, 2, . . . , ∆}, each recursive call to DHD-APPROX of depth δ ≥ 2 n δ returns a solution that is at least opt and at most ( loglogn+4 ) · c · log n · log(α(G0 )) · w0 (x). Moreover, it returns a subset U ⊆ V (G0 ) that realizes the solution. At the initialization phase, we see that in order to prove Lemma 34, it is sufficient to prove Lemma 36. Initialization. Initially, the graphs G0 and H 0 are simply set to be the input graphs G and H, and the weight function w0 is simply set to be input weight function w. Moreover, we compute an optimal fractional solution x = xinit by using the ellipsoid method. Recall that the following claim holds. 8 This assumption simplifies some of the calculations ahead. 23 Observation 37. The solution of the instance (G0 , w0 ) of WDHVD is lower bounded by w0 (xinit ). Moreover, it holds that α(G0 ) ≤ n, and therefore to prove Lemma 34, it is sufficient to return a solution that is at least opt and at most c · log n · log(α(G)) · w(x) (along with a subset that realizes the solution). Part of the necessity of the stronger claim given by Lemma 36 will become clear at the end of the initialization phase. We would like to proceed by calling our algorithm recursively. For this purpose, we first need to ensure that x satisfies the low-value and zero-biclique invariants, to which end we use the following notation. We let h(x) = {v ∈ V (G0 ) : x(v) ≥ 1/ log n} denote the set of vertices to which x assigns high values. Note that we can assume for each v ∈ h(x), we have x(v) ≤ 1. Moreover, given a biclique M in G0 , we let (x \ M ) : V (G0 ) → [0, ∞) denote the function that assigns 0 to any vertex in M and (1 + log4 n )x(v) to any other vertex v ∈ V (G0 ). Now, to adjust x to be of the desired form both at this phase and at later recursive calls, we rely on the following lemmata. 0 b = G0 − h(x), w b b = x|V (G) Lemma 38. Define G b = w0 |V (G) b and x b . Then, c · log n · log(α(G)) · w0 (b x) + w0 (h(x)) ≤ c0 · log n · log(α(G)) · w0 (x), where c0 ≥ 1. b is an x) ≤ w0 (x) − log1 n · w0 (h(x)). Since G Proof. By the definition of h(x), it holds that w0 (b b ≤ α(G0 ). Thus, c0 · log n · log(α(G)) b · w0 (b induced subgraph of G0 , it also holds that α(G) x) + 1 0 0 0 0 0 0 0 w (h(x)) ≤ c ·log n·log(α(G ))·(w (x)− log n ·w (h(x)))+w (h(x)) ≤ c ·log n·log(α(G))·w0 (x). 0 0 Thus, it is safe to update G0 to G0 − h(x), w0 to w0 |V (G) b , H to H − h(x) and x to x|V (G) b , 0 where we ensure that once we obtain a solution to the new instance, we add w (h(x)) to this solution and h(x) to the set realizing it. Lemma 39. Let Q be a chordless cycle on at least 5 vertices and M be a biclique in G0 with vertex partitions as V (M ) = M1 ]M2 such that V (Q)∩V (M ) 6= ∅. Then there is a chordless cycle Q0 on at least 5 vertices that intersects M in at most 3 vertices such that E(Q0 \ M ) ⊆ E(Q \ M ). Furthermore, Q0 is of one of the following three types. • Q0 ∩ M is a single vertex • Q0 ∩ M is an edge in G[M ] • Q0 ∩ M is an induced path on 3 vertices in M . Proof. Observe that no chordless cycle on 5 or more vertices may contain two vertices from each of M1 and M2 , as that would imply a chord in it. Now, if the chordless cycle Q already satisfies the required conditions we output it as Q0 . First consider the case, when Q ∩ M contains exactly two vertices that don’t have an edge between them. Then the two vertices, say v1 , v2 , are both either in M1 or in M2 . Suppose that they are both in M1 and consider some vertex u ∈ M2 . Let P1 is the longer of the two path segments of Q between v1 and v2 , and note that it must length at least 3. Then observe that G0 [P1 ∪ {u, v1 , v2 }] contains a DH-obstruction, as v1 , v2 have different distances depending on if u is included in an induced subgraph or not. And further, it is easy to see that this DH-obstruction contains the induced path v1 , u, v2 . However, as all small obstructions have been removed from the graph, we have that Q0 is a chordless cycle in G0 on at least 5 vertices. Furthermore, Q0 ∩ M is the induced path (v1 , u, v2 ), in G0 and E(Q0 \ M ) ⊆ E(Q \ M ). Now consider the case when Q ∩ M contains exactly three vertices. Observe that it cannot contain two vertices of M1 and one vertex of M2 , or vice versa, as Q doesn’t satisfy the required conditions. Therefore, Q ∩ M contains exactly three vertices from M1 (or from M2 ), which 24 again don’t form an induced path of length 3. So there is an independent set of size 2 in Q ∩ M , and now, as before, we can again obtain the chordless cycle Q0 on at least 5 vertices with E(Q0 \ M ) ⊆ E(Q \ M ). Before we consider the other cases, we have the following claim. Claim 1. Let M be a biclique in G0 with vertex partition as V (M ) = M1 ] M2 . Then G0 [M ] has no induced P4 . Proof. Let P be any induced path of length 4 in G0 [M ]. Then, either V (P ) ⊆ M1 or V (P ) ⊆ M2 . Now consider any such path P in M1 and some vertex u ∈ M2 . Then G0 [P ∪ {u}] contains a DH-obstruction of size 5 which is a contradiction to the fact that G0 has no small obstructions. Next, let Q ∩ M contain 4 or more vertices. Note that in this case all these vertices are all either in M1 or in M2 since otherwise, Q would not be a chordless cycle in G0 on at least 5 vertices. Let us assume these vertices lie in M1 (other case is symmetric). Let v1 , v2 , v3 , · · · , v` ∈ M1 ∩ Q be the sequence of vertices obtained when we traverse Q starting from an arbitrary vertex, where ` ≥ 4. By Claim 1 they cannot form an induced path on 4 vertices, i.e. G0 [V (Q) ∩ M1 ] consists of at least two connected components. Without loss of generality we may assume that v1 and v` are in different components. Observe that the only possible edges between these vertices may be at most two of the edges (v1 , v2 ), (v2 , v3 ), and (v3 , v` ). Hence, we conclude that either v1 , v3 or v2 , v` are a distance of at least 3 in Q. Let us assume that v2 , v` are at distance 3 or more in Q, and the other case is symmetric and P23 , P3` be the paths not containing v1 in Q between v2 and v3 , and v3 and v` , respectively. Notice that for any u ∈ M2 the graph G0 [{u} ∪ V (P23 ) ∪ V (P3` )] contains a DH-obstruction. Since the graph is free of all small obstruction, this DH-obstruction, denoted Q̂, must be a chordless cycle on at least 5 vertices. Furthermore this obstruction can contain at most 2 vertices from {v2 , v3 , v` }, as otherwise there would be a chord in it. Hence Q̂ ∩ M contains strictly fewer vertices than Q ∩ M . Moreover, we have E(Q̂ \ M ) ⊆ E(Q \ M ). Now, by a recursive application of this lemma to Q̂, we obtain the required Q0 . A consequence of the above lemma is that, whenever M is a biclique in G0 , we may safely ignore any DH-obstructionthat intersects M in more than 3 vertices. This leads us to the following lemma. Lemma 40. Given a biclique M in G0 , the function (x \ M ) is a valid fractional solution such that w0 (x \ M ) ≤ (1 + log4 n )w0 (x). Proof. To prove that (x \ M ) is a valid fractional solution, let Q be some chordless cycle (not on 4 vertices) in G0 . We need to show that (x \ M )(V (Q)) ≥ 1. By our assumption Q can contain at most 3 vertices from M . Thus, since x is a valid fractional solution, it holds that x(V (Q) \ V (M )) ≥ 1 − log3 n . By the definition of (x \ M ), this fact implies that (x \ M )(V (Q)) = (x \ M )(V (Q) \ V (M )) ≥ (1 + log4 n )(1 − log3 n ) = 1 + log1 n − (log12n)2 ≥ 1, where the last inequality relies on the assumption n ≥ 212 . For the proof of the second part of the claim, note that w0 (x\M ) = (1+ log4 n ) w0 (x|V (G0 )\V (M ) ) ≤ (1 + log4 n )w0 (x). We call DHD-APPROX recursively with the fractional solution (x \ C), and by Lemma 40, \ C) ≤ (1 + log4 n )w0 (x). If Lemma 36 were true, we return a solution that is at least opt w0 (x n and at most ( loglogn+4 ) · c · log n · log(α(G)) · w(x \ M ) ≤ c · log n · log(α(G)) · w(x) as desired. In other words, to prove Lemma 34, it is sufficient that we next focus only on the proof of Lemma 36. The proof of this lemma is done by induction. When we consider some recursive call, we assume that the solutions returned by the additional recursive calls that it performs, which are e such that α(G) e ≤ 3 α(G0 ), complies with the conclusion of the lemma. associated with graphs G 4 25 Termination. Once G0 becomes a distance hereditary graph, we return 0 as our solution and ∅ as the set that realizes it. Clearly, we thus satisfy the demands of Lemma 36. In fact, we thus also ensure that the execution of our algorithm terminates once α(G0 ) < log n. Lemma 41. If α(G0 ) < log n, then G0 is a distance hereditary graph. Proof. Suppose that G0 is not a distance hereditary graph. Then, it contains an obstruction Q. Since x is a valid fractional solution, it holds that x(V (Q)) ≥ 1. But x satisfies the low-value invariant therefore, it holds that x(V (Q)) < |V (Q)|/ log n. These two observations imply that |V (Q)| > log n. Furthermore, at least log n of these vertices are assigned a non-zero value by x, i.e. α(G0 ) ≥ log n. Therefore, if α(G0 ) < log n, then G0 must be a distance hereditary graph. The fact that, the recursive calls are made onto graphs where the distance hereditary subgraph contains at most 3/4 the number of vertices in the current distance hereditary subgraph, we observe the following. Observation 42. The maximum depth of the recursion tree is bounded by q · log n for some fixed constant q. Recursive Call. Since H 0 is a distance hereditary graph, it has a rank-width-one decomposition (T , φ), where T is a binary tree and φ is a bijection from V (G0 ) to the leaves of T . Furthermore, rank-width of T is 1, which means that for any edge of the tree, by deleting it, we obtain a partition of the leaves in T . This partition induces a cut of the graph, where the set of edges crossing this cut forms a biclique M , with vertex partition as V (M ) = M1 ] M2 in the graph. By standard arguments on trees, we deduce that T has an edge that defines a partition such that after we remove the biclique edges between M1 and M2 from G0 we obtain two (not necessarily connected) graphs, H1 and H2 , such that |V (H1 )|, |V (H2 )| ≤ 43 |V (H 0 )| and M1 ⊆ H1 , M2 ⊆ H2 . Note that the bicliques M and C are vertex disjoint. We proceed by replacing the fractional solution x by (x \ M ). For the sake of clarity, we denote x∗ = (x \ M ). Let G1 = G0 [V (H1 ) ∪ V (C) ∪ V (M )], G2 = G0 [V (H2 ) ∪ V (C) ∪ V (M )]. We adjust the current instance by relying on Lemma 38 so that x∗ satisfies the low-value invariant (in the same manner as it is adjusted in the initialization phase). In particular, we remove h(x∗ ) from G0 ,H 0 , G1 , H1 , G2 and H2 , and we let (G∗ , w∗ , C, H ∗ , x∗ ), G∗1 , H1∗ G∗2 and H2∗ denote the resulting instance and graphs. Observe that, now we have α(G∗1 ), α(G∗2 ) ≤ 34 α(G0 ). n δ+1 We will return a solution that is at least opt and at most ( loglogn+4 ) · c · log n · log(α(G0 )) · w∗ (x∗ ), along with a set that realizes it.9 In the analysis we will argue this it is enough for our purposes. Next, we define two subinstances, I1∗ = (G∗1 , w∗ |V (G∗1 ) , C, H1∗ , x∗ |V (G∗1 ) ) and I2∗ = (G∗2 , w∗ |V (G∗2 ) , C, H2∗ , x∗ |V (G∗2 ) ). We solve each of these subinstances by a recursive call to DHD-APPROX, and thus we obtain two solutions of sizes, s∗1 to I1∗ and s∗2 to I2∗ , and two sets that realize these solutions, S1∗ and S2∗ . By the inductive hypothesis, we have the following observations. Observation 43. S1∗ ∪ S2∗ intersects any chordless cycle on at least 6 vertices in G∗ that lies entirely in either G∗1 or G∗2 . n δ+1 Observation 44. Given i ∈ {1, 2}, s∗i ≤ ( loglogn+4 ) · c · log n · log(α(G∗i )) · w(x∗i ). Moreover, since x∗ (V (C) ∪ V (M )) = 0, we also have the following observation. Observation 45. w∗ (x∗1 ) + w∗ (x∗2 ) = w∗ (x∗ ). 9 log n log n Here, the coefficient ( log )δ has been replaced by the smaller coefficient ( log )δ+1 . n+4 n+4 26 We say that a cycle in G∗ is bad if it is a chordless cycle not on four vertices that belongs entirely to neither G∗1 nor G∗2 . Next, we show how to intersect bad cycles. Bad Cycles. Let us recall the current state of the graph G0 . G0 is partitioned into a biclique C and a distance hereditary graph H 0 . Furthermore, there is a biclique M with vertex bipartition as M1 and M2 so that deleting the edges between M1 and M2 , gives a balanced partition of H 0 into H1 and H2 . Now, by Lemma 39, we may ignore any chordless cycle that intersects either of the two bicliques C and M in more than three vertices each, and this allows us to update our fractional feasible solution to x∗ = (x/M ). Then we recursively solve the instances G∗1 and G∗2 and remove the returned solution. Now consider the remaining graph, and any obstructions that are left. As the graph no longer contains small obstructions, it is clear that any remaining obstruction is a chordless cycle on at least 6 vertices and is a bad cycle. We first examine the relation between bad cycles and pairs (v, u) of vertices v ∈ V (C) and u ∈ V (M ). Lemma 46. If a bad cycle exists, then there must also be a bad cycle Q such that Q \ (M ∪ C) is a union of two internally vertex disjoint and non-adjacent path-segments, P1 and P2 such that, P1 ⊆ G1 and P2 ⊆ G2 , and each of them connect a pair of vertices in M × C. Proof. Let Q0 be a bad cycle. Let us recall that the input graph G0 can be partitioned into the biclique C and a distance hereditary graph H 0 . Hence Q0 ∩ C 6= ∅. Furthermore, if Q0 ∩ M = ∅, then Q0 is preserved in G0 − M . This means that Q0 is either present in G∗1 , or in G∗2 , and hence it cannot be a bad cycle, which is a contradiction. Hence Q0 ∩ M = 6 ∅ as well. Finally, Q0 contains 0 0 vertices from both H1 and H2 , which implies Q ∩ G1 and Q ∩ G2 are both non-empty as well. Now, by applying Lemma 39 to Q0 and C, we obtain a bad cycle Q̂ such that Q̂ ∩ C is either a single vertex, or an edge or an induced path of length three. Since, M ∩ C = ∅, we can again apply Lemma 39 to Q̂ and M , and obtain a bad cycle Q such that each of Q ∩ C and Q ∩ M is either a single vertex, or, an edge or an induced path of length three. Hence, Q − (V (M ) ∪ V (C)) is a pair of internally disjoint paths, whose endpoints are in M × C. Furthermore, one of these paths, denoted P1 , is contained in G1 , and the other, denoted P2 , is contained in G2 . The above lemma (Lemma 46) implies that it is safe to ignore all the bad cycles that don’t satisfy the conclusion of this lemma. We proceed to enumerate some helpful properties of those bad cycles that satisfy the above lemma. We call P1 , P2 the path segments of the bad cycle Q. Lemma 47. Suppose P1 , P2 are path segments of a bad cycle Q where P1 ⊆ G1 − S1∗ and P2 ⊆ G2 − S2∗ , where S1∗ and S2∗ are a solution to G∗1 and G∗2 , respectively. Then for any P10 which is an induced path in G1 − S1∗ with the same endpoints as P1 we have that Q0 = G0 [(Q ∩ (M ∪ C)) ∪ V (P10 ) ∪ V (P2 )] is also a bad cycle. Proof. Observe that, P1 and P10 are paths between the same endpoints in G1 − S1∗ , which is a distance hereditary graph. Therefore, P10 is an induced path of the same length as P1 . Furthermore, no vertex in P10 is adjacent to a vertex in Q − P1 . Hence Q0 is also a bad cycle. The above lemma allows us to reduce the problem of computing a solution that intersects all bad-cycles, to computing a solution for an instance of Weighted Multicut. More formally, let Q be a bad cycle with path segments P1 and P2 , the feasible fractional solution x∗ assigns a total value of at least 1 to the vertices in Q. As x∗ assigns 0 to every vertex in M ∪ C, we have that at least one of P1 or P2 is assigned a total value of at least 1/2. Suppose that it were P1 then 2x∗ assigns a total value 1 to P1 in G1 . This fractional solution is a solution to the Weighted Multicut problem defined on the pairs of vertices in C × M , which are separated by 2x∗ in G0 (whose description is given below). Given i ∈ {1, 2}, let 2x∗i denote the fractional solution that assigns to each vertex the value assigned by x∗i times 2. For a pair (v, u) of vertices such that v ∈ V (C) and u ∈ V (M ) we call 27 (v, u) an important pair if there is a bad cycle Q with path segments P1 and P2 that connects v and u. Let S1∗ and S2∗ be a solution to G∗1 and G∗2 , respectively (obtained recursively). For an important pair (v, u) we let P1 (v, u) denote the set of any (simple) path P1 between v and u whose internal vertices belong only to G1 − S1∗ and which does not contain any edge such that one of its endpoints belongs to V (C) while the other endpoint belongs to V (M ). Symmetrically, we let P2 (v, u) denote the set of any path P2 between v and u whose internal vertices belong only to G2 − S2∗ and which does not contain any edge such that one of its endpoints belongs to V (C) while the other endpoint belongs to V (M ). Lemma 48. For an important pair (v, u) of vertices where v ∈ V (C) and u ∈ V (M ), in polynomial time we can compute an index i(v, u) ∈ {1, 2} such that for any path P ∈ Pi (v, u), 2x∗i (V (P )) ≥ 1. Proof. Let (v, u) be an important pair of vertices with v ∈ V (C) and u ∈ V (M ). We start by arguing that such an index exists. Assuming a contradiction, suppose there exists P1 ∈ P1 (v, u) and P2 ∈ P2 (v, u) such that 2x∗1 (V (P1 )) < 1 and 2x∗2 (V (P2 )) < 1. Recall that we have a bad cycle bad cycle Q in G0 − (S1∗ ∪ S2∗ ) with paths segments as P1 and P2 which connects v and u. But this implies that 2x∗ (Q) < 1, contradicting that x∗ was a feasible solution to G0 − (S1∗ ∪ S2∗ ). Therefore, such an index always exists. For any index j ∈ {1, 2}, we use Dijkstra’s algorithm to compute the minimum weight of a b ∗ where the weights are given by 2x∗ . In case the minimum path between v and u in the graph G i i weight is at least 1, we have found the desired index i(v, u). Moreover, we know that for at least one index j ∈ {1, 2}, the minimum weight should be at least 1 (if the minimum weight is at least 1 for both induces, we arbitrarily decide to fix i(v, u) = 1). We say that an important pair (u, v) is separated in Gi , if the index assigned by Lemma 48 assigns i to Pi (u, v). Now, for every important pair (v, u) such that v ∈ V (C), u ∈ V (M ) and {v, u} ∈ / E(G0 ), we perform the following operation. We check if this pair is separated in G1 , and if so, then we initialize T1 (v, u) = ∅. Then for each pair of neighbors of x of v and y of u, we add the pair (x, y) to T1 (u, v). The set T2 (u, v) is similarly defined. At this point, we need to rely on approximate solutions to the Weighted Multicut problem which is given by theorem below (Theorem 5). Theorem 5 ([19]). Given an instance of Weighted Multicut, one can find (in polynomial time) a solution that is at least opt and at most d · log n · fopt for some fixed constant d > 0, along with a set that realizes it. Here, a fractional solution y is a function y : V (G) → [0, ∞) such that for every pair (si , ti ) ∈ T and any path P between si and P ti , it holds that y(V (P )) ≥ 1. An optimal fractional solution minimizes the weight w(y) = v∈V (G) w(v) · y(v). Let fopt denote the weight of an optimal fractional solution. By employing the algorithm given by Lemma 48, we next construct two instances of b ∗ , w∗ , T1 = {T1 (v, u) : v ∈ V (C), u ∈ Weighted Multicut. The first instance is J1 = (G 1 1 b ∗ , w∗ , T2 = V (M ), i(v, u) = 1, and (v, u) is an important pair}) and the second instance is J2 = (G 2 2 {T2 (v, u) : v ∈ V (C), u ∈ V (M ), i(v, u) = 2, and (v, u) is an important pair}). By Lemma 48, 2x∗1 and 2x∗2 are valid solutions to J1 and J2 , respectively. Thus, by calling the algorithm given by Theorem 5 with each instance, we obtain a solution r1 to the first instance, along with a set R1 that realizes it, such that r1 ≤ 2d · log |V (G∗1 )| · w∗ (x∗1 ), and we also obtain a solution r2 to the second instance, along with a set R2 that realizes it, such that r2 ≤ 2d · log |V (G∗2 )| · w∗ (x∗2 ). Now by Observation 43 and Lemma 46, we have obtained a set S ∗ = S1∗ ∪ S2∗ ∪ R1 ∪ R2 for which we have the following observation. 28 Observation 49. S ∗ intersects any chordless cycle in G∗ , and it holds that w∗ (S ∗ ) ≤ s∗1 + s∗2 + r1 + r2 . n δ+1 We start by showing that s∗1 +s∗2 +r1 +r2 +w(h(x)) ≤ ( loglogn+4 ) ·c·log n·log(α(G0 ))·w∗ (x∗ ). Recall that for any i ∈ {1, 2}, ri ≤ 2d · log |V (G∗i )| · w∗ (x∗i ). Thus, by Observation 44 and since for any i ∈ {1, 2}, |V (G∗i )| ≤ n and α(G∗i ) ≤ 34 α(G0 ), we have that w∗ (S ∗ ) ≤ ( 3 log n δ+1 ) · c · log n · log( α(G0 )) · (w∗ (x∗1 ) + w∗ (x∗2 )) + 2d · log n · (w∗ (x∗1 ) + w∗ (x∗2 )). log n + 4 4 By Observation 45, we further deduce that   log n δ+1 3 ∗ ∗ 0 w (S ) ≤ ( ) · c · log( α(G )) + 2d · log n · w∗ (x∗ ). log n + 4 4 n δ+1 n δ+1 · c · log( 34 α(G0 ))+2d ≤ ( loglogn+4 · c · log α(G0 ), Now, it only remains to show that ( loglogn+4 ) ) n δ+1 which is equivalent to 2d ≤ ( loglogn+4 ) · c · log( 43 ). Observe that δ ≤ q · log n − 1 for some fixed constant q. Indeed, it initially holds that α(G) ≤ n, at each recursive call, the number of vertices assigned a non-zero value by x∗ decreases to at most a factor of 3/4 of its previous value, and the execution terminates once this value drops below (log n)/2. Thus, it is sufficient to choose n q·log n n q·log n · c · log( 43 ). As the term ( loglogn+4 the constant c so that 2d ≤ ( loglogn+4 ) ) is lower bounded 4 4q 4q by 1/(e ), it is sufficient that we fix c = 2 · e · d · 1/ log( 3 ). n q·log n n q·log n Note that 2d ≤ ( loglogn+4 ) · c · log( 43 ), where d ≥ 1. Therefore, ( loglogn+4 ) · c ≥ 1. This n δ together with Lemma 38 and 40 implies that w0 (S ∗ ) + w0 (h(x)) ≤ ( loglogn+4 ) · c · log(α(G0 ))w0 (x), which proves Lemma 36. 6.2 General Graphs In this section we handle general instances by developing a d · log2 n-factor approximation algorithm for WDHVD, Gen-DHD-APPROX, thus proving the correctness of Theorem 4. The Recursive Algorithm. We define each call to our algorithm Gen-DHD-APPROX to be of the form (G0 , w0 ), where (G0 , w0 ) is an instance of WDHVD such that G0 is an induced subgraph of G, and we denote n0 = |V (G0 )|. We ensure that after the initialization phase, the graph G0 never contains a DH-obstruction on at most 50 vertices. We call this invariant the O50 -free invariant. In particular, this guarantee ensures that the graph G0 always contains only a small number of maximal bicliques, as stated in the following lemma. Lemma 50 (Lemma 3.5 [26]). Let G be a graph on n vertices with no DH-obstruction on at most 6 vertices. Then G contains at most (n3 + 5n)/6 maximal bicliques, and they can be enumerated in polynomial time. Goal. For each recursive call Gen-DHD-APPROX(G0 , w0 ), we aim to prove the following. Lemma 51. Gen-DHD-APPROX returns a solution that is at least opt and at most d2 ·log3 n0 ·opt. Moreover, it returns a subset U ⊆ V (G0 ) that realizes the solution. Here d is a constant, which will be determined later. At each recursive call, the size of the graph G0 becomes smaller. Thus, when we prove that Lemma 51 is true for the current call, we assume that the approximation factor is bounded by 3 d b · opt for any call where the size n b of the vertex-set of its graph is strictly smaller than n0 . 2 · log n 29 Initialization. We are given (G, w) as input, and first we need to ensure that the O50 -free invariant is satisfied. For this purpose, we update G as follows. First, we let O50 denote the set of all DH-obstruction on at most 50 vertices of G. Clearly, O50 can be computed in polynomial time and it holds that |O50 | ≤ nO(1) . Now, we construct an instance of Weighted 50-Hitting Set, where the universe is V (G), the family of all setsof size at most 50 in O50 , and the weight function is w0 . Since each DH-obstruction must be intersected, therefore, the optimal solution to our Weighted 50-Hitting Set instance is at most opt. By using the standard c0 -approximation algorithm for Weighted c0 -Hitting Set [27], which is suitable for any fixed constant c0 , we obtain a set S ⊆ V (G) that intersects all the DH-obstruction in O50 and whose weight is at most 50 · opt. Having the set S, we remove its vertices from G to obtain the graph G0 , and w0 = w|G0 . Now that the O50 -free invariant is satisfied, we can call Gen-DHD-APPROX on (G0 , w0 ) and to the outputted solution, we add w(S) and S. We note that during the execution of the algorithm, we update G0 only by removing vertices from it, and thus it will always be safe to assume that the O50 -free invariant is satisfied. Now, by Lemma 51, we obtain a solution of weight at most d2 · log3 n · opt + 50 · opt ≤ d · log3 n · opt, then combined with S, it allows us to conclude the correctness of Theorem 4. Termination. Observe that due to Lemma 50, we can test in polynomial time, if our current graph G0 is of the special kind that can be partitioned into a biclique and a distance hereditary graph: we examine each maximal biclique of G0 , and check whether after its removal we obtain a distance hereditary graph. Once G0 becomes such a graph that consists of a biclique and a distance hereditary graph, we solve the instance (G0 , w0 ) by calling algorithm DHD-APPROX. Observe that this returns a solution of value O(log2 n · opt) which is also O(log3 n · opt). Recursive Call. Similar to the case for WCVD, instead computing a balanced separators with a maximal clique and some additional vertices, here we find a balanced separator that comprises of a biclique and some additional, but small number of vertices. Existence of such a separator is guaranteed by Lemma 52. From Lemma 50, it follows that the graph with no DH-obstruction of size at most 50 contains at most O(n3 ) maximal bicliques and they can enumerated in polynomial time. We use the weighted variant of Lemma 3.8 from [26] in Lemma 52. The proof of Lemma 52 remains exactly the same as that in Lemma 3.8 of [26]. Lemma 52 (Lemma 3.8 [26]). Let G0 be a connected graph on n0 vertices not containing any DH-obstruction of size at most 50 and w : V (G) → R be a weight function. Then in polynomial time we can find a balanced vertex separator K ] X such that the following conditions are satisfied. • K is a biclique in G or an empty set; • w(X) ≤ q · log n0 · opt, where q is some fixed constant. Here, opt is the weight of the optimum solution to WDHVD of G. We note that we used the O(log n0 )-factor approximation algorithm by Leighton and Rao √ [28] in Lemma 52 to find the balanced separator, instead of the O( log n0 )-factor approximation algorithm by Feige et al. [12], as the algorithm by Feige et al. is randomized. Let us also remark that if K is a biclique, then there is a bipartition of the vertices in K into A ] B, where both A and B are non-empty, which will be crucially required in later arguments. Next, we apply in Lemma 52 to (G0 , w0 ) to obtain a pair (K, X). Since K ∪ X is a balanced separator for G0 , we can partitionSthe set of connected components of G0 \ (M ∪ S) into two sets, S A1 and A2 , such that for V1 = A∈A1 V (A) and V2 = A∈A2 V (A) it holds that n1 , n2 ≤ 23 n0 where n1 = |V1 | and n2 = |V2 |. We then define two inputs of (the general case) WDHVD: I1 = (G0 [V1 ], wV0 1 ) and I2 = (G0 [V2 ], wV0 2 ). Let opt1 and opt2 denote the optimal solutions to 30 I1 and I2 , respectively. Observe that since V1 ∩ V2 = ∅, it holds that opt1 + opt2 ≤ opt. We solve each of the two sub-instances by recursively calling algorithm Gen-DH-APPROX. By the inductive hypothesis, we obtain two sets, S1 and S2 , such that G0 [V1 ] \ S1 and G0 [V2 ] \ S2 are both distance hereditary graphs, and w0 (S1 ) ≤ d2 · log3 n1 · opt1 and w0 (S2 ) ≤ d2 · log3 n2 · opt2 . Now, if K were an empty set then it is easy to see that X ∪ S1 ∪ S2 is a feasible solution to the instance (G0 , w0 ). Now let us bound the total weight of this subset. w0 (X ∪ S1 ∪ S2 ) ≤ w0 (X) + w0 (S1 ) + w0 (S2 ) ≤ q · log n0 · opt + d2 · (log3 n1 · opt1 + log3 n2 · opt2 ) Recall that n1 , n2 ≤ 23 n0 and opt1 + opt2 ≤ opt. < q · log n0 · opt + < d2 · log3 n0 · opt d 2 · log3 23 n0 · opt The more interesting case is when K is a biclique. Then, we first remove X ∪ S1 ∪ S2 from the graph, and note that the above bound also holds for this subset of vertices. Now observe that the graph G00 = G0 − (X ∪ S1 ∪ S2 ) can be partitioned into a biclique K and a distance hereditary graph H = G[(V1 ∪ V2 ) \ (S1 ∪ S2 )], along with the weight function w00 = wV0 (G00 ) . Thus we have an instance of the Biclique + Distance Hereditary Graph spacial case of WDHVD. Furthermore, note that we retained a fractional feasible solution x to the LP of the initial input G0 , w0 , which upperbounds the value of a fractional feasible solution x00 to the LP of the instance G00 , w00 . We apply the algorithm DHD-APPROX on (G00 , w00 , K, H, x00 ) which outputs a solution S such that w00 (S) = w0 (S) = O(log2 n · opt). Observe that, any obstruction in G0 \ S is either completely contained in G0 [V1 \ S], or completely contained in G0 [V2 \ S] or it contains at least one vertex from K. This observation, b is a distance hereditary graph, implies along with the fact that G0 [(V1 ∪ V2 ∪ K) \ (S1 ∪ S2 ∪ S)] 0 b Thus, it is now sufficient that G \ T is a distance hereditary graph where T = X ∪ S1 ∪ S2 ∪ S. d 0 0 3 to show that w (T ) ≤ 2 · (log n ) · opt. By the discussion above, we have that DHD-APPROX returns a solution of value c log2 n · opt, where c is some constant. w0 (T ) ≤ w0 (S) + w0 (S1 ) + w0 (S2 ) + w0 (Sb1 ) + w0 (Sb2 ) ≤ q · log n0 · opt + d2 · (log3 n1 · opt1 + log3 n2 · opt2 ) + c · log2 n0 · opt. Recall that n1 , n2 ≤ 23 n0 and opt1 + opt2 ≤ opt. Thus, we have that w0 (T ) ≤ q · log n0 · opt + d2 · (log3 23 n0 ) · opt + c · log2 n0 · opt ≤ d2 · log3 n0 · opt + (c − d log 32 ) · log2 n0 · opt. Overall, we conclude that to ensure that w0 (T ) ≤ that c − d log 32 ≤ 0, which can be done by fixing d = 7 d 2 · log3 n0 · opt, it is sufficient to ensure c . log 32 Conclusion In this paper, we designed O(logO(1) n)-approximation algorithms for Weighted Planar F Minor-Free Deletion, Weighted Chordal Vertex Deletion and Weighted Distance Hereditary Vertex Deletion (or Weighted Rankwidth-1 Vertex Deletion). These algorithms are the first ones for these problems whose approximation factors are bounded by O(logO(1) n). Along the way, we also obtained a constant-factor approximation algorithm for Weighted Multicut on chordal graphs. All our algorithms are based on the same recursive scheme. We believe that the scope of applicability of our approach is very wide. We would like to conclude our paper with the following concrete open problems. 31 • Does Weighted Planar F -Minor-Free Deletion admit a constant-factor approximation algorithm? Furthermore, studying families F that do not necessarily contain a planar graph is another direction for further research. • Does Weighted Chordal Vertex Deletion admit a constant-factor approximation algorithm? • Does Weighted Rankwidth-η Vertex Deletion admit a O(logO(1) n)-factor approximation algorithm? • On which other graph classes Weighted Multicut admits a constant-factor approximation? References [1] A. Agrawal, D. Lokshtanov, P. Misra, S. Saurabh, and M. Zehavi, Feedback vertex set inspired kernel for chordal vertex deletion, in Proceedings of the 28th ACM-SIAM Symposium on Discrete Algorithms (SODA), 2017, pp. 1383–1398. [2] V. Bafna, P. Berman, and T. Fujito, A 2-approximation algorithm for the undirected feedback vertex set problem, SIAM Journal on Discrete Mathematics, 12 (1999), pp. 289–297. [3] N. Bansal, D. Reichman, and S. W. Umboh, LP-based robust algorithms for noisy minor-free and bounded treewidth graphs, in Proceedings of the 28th ACM-SIAM Symposium on Discrete Algorithms (SODA), 2017, pp. 1964–1979. [4] N. Bansal and S. W. Umboh, Personal communication., 2017. [5] R. Bar-Yehuda and S. Even, A linear-time approximation algorithm for the weighted vertex cover problem, Journal of Algorithms, 2 (1981), pp. 198–203. [6] R. Bar-Yehuda, D. Geiger, J. Naor, and R. M. Roth, Approximation algorithms for the feedback vertex set problem with applications to constraint satisfaction and Bayesian inference, SIAM Journal on Computing, 27 (1998), pp. 942–959. [7] R. B. Borie, R. G. Parker, and C. A. Tovey, Automatic generation of linear-time algorithms from predicate calculus descriptions of problems on recursively constructed graph families, Algorithmica, 7 (1992), pp. 555–581. [8] 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. [9] B. Courcelle and S. Olariu, Upper bounds to the clique width of graphs, Discrete Applied Mathematics, 101 (2000), pp. 77–114. [10] R. Diestel, Graph Theory, 4th Edition, vol. 173 of Graduate texts in mathematics, Springer, 2012. [11] M. Farber, On diameters and radii of bridged graphs, Discrete Mathematics, 73 (1989), pp. 249–260. [12] U. Feige, M. Hajiaghayi, and J. R. Lee, Improved approximation algorithms for minimum weight vertex separators, SIAM Journal on Computing, 38 (2008), pp. 629–657. 32 [13] S. Fiorini, G. Joret, and U. Pietropaoli, Hitting diamonds and growing cacti, in Proceedings of the 14th Conference on Integer Programming and Combinatorial Optimization (IPCO), vol. 6080, 2010, pp. 191–204. [14] F. V. Fomin, D. Lokshtanov, N. Misra, G. Philip, and S. Saurabh, Hitting forbidden minors: Approximation and kernelization, SIAM Journal on Discrete Mathematics, 30 (2016), pp. 383–410. [15] F. V. Fomin, D. Lokshtanov, N. Misra, and S. Saurabh, Planar f-deletion: Approximation, kernelization and optimal fpt algorithms, in Proceedings of IEEE 53rd Annual Symposium on Foundations of Computer Science (FOCS), 2012, pp. 470–479. [16] F. V. Fomin, D. Lokshtanov, V. Raman, and S. Saurabh, Bidimensionality and EPTAS, in Proceedings of the 22nd ACM-SIAM Symposium on Discrete Algorithms (SODA), 2011, pp. 748–759. [17] F. V. Fomin, D. Lokshtanov, and S. Saurabh, Bidimensionality and geometric graphs, in Proceedings of the 23rd ACM-SIAM Symposium on Discrete Algorithms (SODA), 2012, pp. 1563–1575. [18] F. V. Fomin, D. Lokshtanov, S. Saurabh, and D. M. Thilikos, Bidimensionality and kernels, in Proceedings of the 21st ACM-SIAM Symposium on Discrete Algorithms (SODA), 2010, pp. 503–510. [19] N. Garg, V. V. Vazirani, and M. Yannakakis, Approximate max-flow min-(multi)cut theorems and their applications, SIAM Journal on Computing, 25 (1996), pp. 235–251. [20] D. Golovin, V. Nagarajan, and M. Singh, Approximating the k-multicut problem, in ACM-SIAM Symposium on Discrete Algorithms (SODA), 2006, pp. 621–630. [21] M. C. Golumbic, Algorithmic Graph Theory and Perfect Graphs, Academic Press, New York, 1980. [22] P. L. Hammer and F. Maffray, Completely separable graphs, Discrete applied mathematics, 27 (1990), pp. 85–99. [23] P. Hlinený, S. Oum, D. Seese, and G. Gottlob, Width parameters beyond tree-width and their applications, The Computer Journal, 51 (2008), pp. 326–362. [24] E. Howorka, A characterization of distance-hereditary graphs, The quarterly journal of mathematics, 28 (1977), pp. 417–420. [25] B. M. P. Jansen and M. Pilipczuk, Approximation and kernelization for chordal vertex deletion, in Proceedings of the 28th ACM-SIAM Symposium on Discrete Algorithms (SODA), 2017, pp. 1399–1418. [26] E. J. Kim and O. Kwon, A Polynomial Kernel for Distance-Hereditary Vertex Deletion, ArXiv e-prints, (2016). [27] J. Kleinberg and E. Tardos, Algorithm design, Addison-Wesley, 2005. [28] T. Leighton and S. Rao, Multicommodity max-flow min-cut theorems and their use in designing approximation algorithms, Journal of the ACM, 46 (1999), pp. 787–832. [29] J. M. Lewis and M. Yannakakis, The node-deletion problem for hereditary properties is NP-complete, Journal of Computer and System Sciences, 20 (1980), pp. 219–230. 33 [30] C. Lund and M. Yannakakis, The approximation of maximum subgraph problems, in Proceedings of the 20nd International Colloquium on Automata, Languages and Programming (ICALP), vol. 700, 1993, pp. 40–51. [31] J. W. Moon and L. Moser, On cliques in graphs, Israel journal of Mathematics, 3 (1965), pp. 23–28. [32] G. L. Nemhauser and L. E. Trotter, Jr., Properties of vertex packing and independence system polyhedra, Mathematical Programming, 6 (1974), pp. 48–61. [33] S. Oum, Rank-width and vertex-minors, Journal of Combinatorial Theory, Series B, 95 (2005), pp. 79–100. [34] , Approximating rank-width and clique-width quickly, ACM Transactions on Algorithms, 5 (2008). [35] , Rank-width: Algorithmic and structural results, CoRR, abs/1601.03800 (2016). [36] S. Oum and P. D. Seymour, Approximating clique-width and branch-width, Journal of Combinatorial Theory, Series B, 96 (2006), pp. 514–528. [37] N. Robertson and P. D. Seymour, Graph minors. v. excluding a planar graph, Journal of Combinatorial Theory Series B, 41 (1986), pp. 92–114. [38] N. Robertson and P. D. Seymour, Graph minors .xiii. the disjoint paths problem, Journal of Combinatorial Theory, Series B, 63 (1995), pp. 65–110. [39] , Graph minors. XX. wagner’s conjecture, Journal of Combinatorial Theory, Series B, 92 (2004), pp. 325–357. [40] H. Sachs, On the berge conjecture concerning perfect graphs, Combinatorial Structures and their Applications, 37 (1970), p. 384. [41] S. Tsukiyama, M. Ide, H. Ariyoshi, and I. Shirakawa, A new algorithm for generating all the maximal independent sets, SIAM Journal on Computing, 6 (1977), pp. 505–517. [42] M. Yannakakis, The effect of a connectivity requirement on the complexity of maximum subgraph problems, Journal of the ACM, 26 (1979), pp. 618–630. [43] , Some open problems in approximation, in Proceedings of 2nd Italian Conference on Algorithms and Complexity, Second (CIAC), 1994, pp. 33–39. 34
8cs.DS
Streaming Data from HDD to GPUs for Sustained Peak Performance Lucas Beyer Paolo Bientinesi Aachen Institute for Advanced Study in Computational Engineering Science Financial support from the Deutsche Forschungsgemeinschaft (German Research Foundation) through grant GSC 111 is gratefully acknowledged. Streaming Data from HDD to GPUs for Sustained Peak Performance Lucas Beyer and Paolo Bientinesi RWTH Aachen University, Aachen Institute for advanced study in Computational Engineering Science, Germany {beyer,pauldj}@aices.rwth-aachen.de Abstract. In the context of the genome-wide association studies (GWAS), one has to solve long sequences of generalized least-squares problems; such a task has two limiting factors: execution time –often in the range of days or weeks– and data management –data sets in the order of Terabytes. We present an algorithm that obviates both issues. By pipelining the computation, and thanks to a sophisticated transfer strategy, we stream data from hard disk to main memory to GPUs and achieve sustained peak performance; with respect to a highly-optimized CPU implementation, our algorithm shows a speedup of 2.6x. Moreover, the approach lends itself to multiple GPUs and attains almost perfect scalability. When using 4 GPUs, we observe speedups of 9x over the aforementioned implementation, and 488x over a widespread biology library. Keywords: GWAS, generalized least-squares, computational biology, out-of-core computation, high-performance, multiple GPUs, data transfer, multibuffering, streaming, big data 1 GWAS, their Importance and Current Implementations In a nutshell, the goal of a genome-wide association study (GWAS) is to find an association between genetic variants and a specific trait such as a disease [1]. Since there is a tremendous amount of such genetic variants, the computation involved in GWAS takes a long time, ranging from days to weeks and even months [2]. In this paper, we look at OOC-HP-GWAS, currently the fastest algorithm available, and show how it is possible to speed it up by exploiting the computational power offered by modern graphics accelerators. The solution of GWAS boils down to a sequence of generalized least squares (GLS) problems involving huge amounts of data, in the order of Terabytes. The challenge lies in sustaining GPU’s performance, avoiding idle time due to data transfers from hard disk (HDD) and main memory. Our solution, cuGWAS, combines three ideas: the computation is pipelined through GPU and CPU, the transfers are executed asynchronously, and the data is streamed from HDD to main memory to GPUs by means of a two-level buffering strategy. Combined, these mechanisms allow cuGWAS to attain almost perfect scalability with respect to the number of GPUs; when compared to OOCHP-GWAS and another widespread GWAS library, our code is respectively 9 and 488 times faster. In the first section of this paper, we introduce the reader to GWAS and the computations involved therein. We then give an overview of OOC-HP-GWAS, upon which we build cuGWAS, whose key techniques we explain in Section 3 and which we time in Section 4. We provide some closing remarks in Section 5. 1.1 Biological Introduction to GWAS The segments of the DNA that contain information about protein synthesis are called genes. They encode so-called traits, which are features of physical appearance of the organism –like eye or hair color– as well as internal features of the organism –like blood type or resistances to diseases. The hereditary information of a species consists of all the genes in the DNA, and is called genome; this can be visualized as a book containing instructions for our body. Following this analogy, the letters in this book are called nucleotides, and determining their order is referred to as sequencing the genome. Even though the genome sequence of every individual is different, within one species most of it (99.9% for humans) stays the same. When a single nucleotide of the DNA differs between two individuals of the same species, this difference is called a single-nucleotide polymorphism (SNP, pronounced “snip”) and the two variants of the SNP are referred to as its alleles. Genome-wide association studies compare the DNA of two groups of individuals. All the individuals in the case group have a same trait, for example a specific disease, while all the individuals in the control group do not have this trait. The SNPs of the individuals in these groups are compared; if one variant of a SNP is more frequent in the case group than in the control group, it is said that the SNP is associated with the trait (disease). In contrast with other methods for linking traits to SNPs, such as inheritance studies or genetic association studies, GWAS consider the whole genome [1]. 1.2 The Importance of GWAS We gathered insightful statistics about all published GWAS [3]. Since the first GWAS started to appear in 2005 and 2006, the amount of yearly published studies has constantly increased, reaching more than 2300 studies in 2011. This trend is summarized in the left panel of Fig. 1, showing the median SNP-count of each year’s studies along with error-bars for the first and second quartiles. One can observe that while GWA studies started out relatively small, since 2009 the amount of analyzed SNPs is growing tremendously. Besides the number of SNPs, the other parameter relevant to the implementation of an algorithm is the sample size, that is the total number of individuals of both the case and the control group. What can be seen in Fig. 1b is that while it has grown at first, in the past four years the median sample size seems to have settled around 10 000 individuals. It is apparent that, in contrast to the SNP count, the growth of the sample size is negligible. This data, as well as discussions with biologists, confirm the need for algorithms and software that can compute a GWAS with even more SNPs, and faster than currently possible. 1.3 The Mathematics of GWAS The GWAS can be expressed as a variance component model [4] whose solution ri can be formulated as ri = (XiT M −1 Xi )−1 XiT M −1 y, i = 1..m , (1) where m is in the millions and all variables on the right-hand side are known. This sequence of equations is used to compute in ri the relations between variations in y (the phenotype 1 ) and 1 A phenotype is the observed value of a certain trait of an individual. For example, if the studied trait was the hair color, the phenotype of an individual would be the one of “blonde”, “brown”, “black” or “red”. a) median SNP count b) median sample size 4M 40K 3M 30K 2M 20K 1M 10K 0M 2005 2006 2007 2008 2009 2010 2011 0K 2005 2006 2007 2008 2009 2010 2011 Fig. 1: The median, first and second quartile of a) the SNP-count and b) the sample size of the studies each year. variations in Xi (the genotype). Each equation is responsible for one SNP, meaning that the number m of equations corresponds to the number of SNPs considered in the study. Figure 2 captures the dimensions of the objects involved in one such equation. The height n of the p ri XiT XiT M-1 Xi M-1 y n n Fig. 2: The dimensions of a single instance of (1). matrices Xi and M and of the vector y corresponds to the number of samples, thus each row in the design-matrix Xi ∈ Rn×p corresponds to a piece of each individual’s genetic makeup (i.e. information about one SNP), and each entry in y ∈ Rn corresponds to an individual’s phenotype.2 M ∈ Rn×n models the relations amongst the individuals, e.g. two individuals being in the same family. Finally, an important feature of the matrices Xi is that they can be partitioned as (XL ∣XRi ), where XL contains fixed covariates such as age and sex and thus stays the same for any i, while XRi is a single column vector containing the genotypes of the i-th SNP of all considered individuals. 2 In the example of the body height as a trait, the entries of y would then be the heights of the individuals. Even though (1) has to be computed for every single SNP, only the right part of the designmatrix XRi changes, while XL , M and y stay the same. 1.4 The Amount of Data and Computation Involved We analyze the storage size requirements for the data involved in GWAS. Typical values for p range between 4 and 20, but only one entry varies with m. According to our analysis in Section 1.2, we consider n = 10 000 as the size of a study. As of June 2012, the SNP database dbSNP lists 187 852 828 known SNPs for humans [5], so we consider m = 190 000 000. With these numbers, assuming that all data is stored as double precision floating point numbers.3 Therefore, the size of y and M is about 80 MB and 800 MB, respectively; both fit in main memory and in the GPU memory. The output r reaches 30 GB, coming close to the limit of current high-end systems’ main memory and is too big to fit in a GPU’s 6 GB of memory. Weighting in at 14 TB, X is too big to fit into the memory of any system in the foreseeable future and has to be streamed from disk. In the field of bioinformatics, the ProbABEL [6] library is frequently used for genome-wide association studies. On a Sun Fire X4640 server with an Intel Xeon CPU 5160 (3.00 GHz), the authors report a runtime of almost 4 hours for a problem with p = 4, n = 1500 and m = 220 833, and estimate the runtime with m = 2 500 000 to be roughly 43 hours4 –almost two days. Compared to the current demand, m = 2.5 million is a reasonable amount of SNPs, but a population size of only n = 1500 individuals is clearly much smaller than the present median (Fig. 1). The authors state that the runtime grows more than linearly with n and, in fact, tripling up the sample size from 500 to 1500 increased their runtime by a factor of 14. Coupling this fact with the median sample size of about 10 000 individuals, the computation time is bound to reach weeks or even months. 2 Prior Work: the OOC-HP-GWAS Algorithm Presently, the fastest available algorithm for solving (1) is OOC-HP-GWAS [4]. Since our work builds upon this CPU-only algorithm, we describe its salient features. 2.1 Algorithmic Features OOC-HP-GWAS exploits the the symmetry and the positive definiteness of the matrix M , by decomposing it through a Cholesky factorization LLT = M . Since M does not depend on i, this decomposition can be computed once as a preprocessing step and reused for every instance of (1). Substituting LLT = M into (1) and rearranging, we obtain T T ri = ((L−1 Xi ) L−1 Xi )−1 (L−1 Xi ) L−1 y ´¹¹ ¹ ¹ ¹ ¹ ¹ ¹ ¸¹ ¹ ¹ ¹ ¹ ¹ ¹ ¶ ´¹¹ ¹ ¹ ¸¹ ¹ ¹ ¶ ´¹¹ ¹ ¹ ¹ ¹ ¹ ¹ ¸¹ ¹ ¹ ¹ ¹ ¹ ¹ ¶ ² X̃i X̃i X̃i for i = 1..m , (2) ỹ effectively replacing the inversion and multiplication of M with the solution of a triangular linear system (trsv). 3 4 Which may or may not be the optimal storage type. More discussion with biologists and analysis of the operations is necessary in order to find out whether float is precise enough. If that was the case, the sizes should be halved. We only consider what the authors called the linear model with the --mmscore option as this solves the exact problem we tackle. The second problem-specific piece of knowledge that is exploited by OOC-HP-GWAS is the structure of X = (XL ∣XR ): XL stays constant for any i, while XR varies; plugging Xi = (XL ∣XRi ) into (2) and moving the constant parts out of the loop leads to an algorithm that takes advantage of the structure of the sequence of GLS shown in Listing 1.1. The acronyms correspond to BLAS calls. Listing 1.1: Solution of the GWAS-specific sequence of GLS (1). 1 2 3 4 5 6 L Xl y rt Stl for 7 8 9 10 11 2.2 ← potrf M ← trsm L, Xl ← trsv L, y ← gemv Xl, y ← syrk Xl i in 1..m: Xri ← trsv L, Xri Sbl ← dot Xri, Xl Sbr ← syrk Xri rb ← dot Xri, y r ← posv S, r (LLT = M ) (X̃L = L−1 XL ) (ỹ = L−1 y) (r̃T = X̃LT ỹ) (ST L = X̃LT X̃L ) (X̃Ri = L−1 XRi ) T (SBLi = X̃R X̃L ) i T X̃Ri ) (XBRi = X̃R i T (r̃Bi = X̃Ri ỹ) (ri = Si−1 r̃i ) Implementation Features Two implementation features allow OOC-HP-GWAS to attain near-perfect efficiency. First, by packing multiple vectors XRi into a matrix XRb , the slow BLAS-2 routine to solve a triangular linear system (trsv) at Line 7 can be transformed into a fast BLAS-3 trsm. Then, Listing 1.1 is an in-core algorithm that cannot deal with an XR which does not fit into main memory. This limitation is overcome by turning the algorithm into an out-of-core one, in this case using a doublebuffering technique: While the CPU is busy computing the block b of XR in a primary buffer, the next block b + 1 can already be loaded into a secondary buffer through asynchronous I/O. The full OOC-HP-GWAS algorithm is shown in Listing 1.2. This algorithm attains more than 90% efficiency. Listing 1.2: The full OOC-HP-GWAS algorithm. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 L Xl y rt Stl aio for ← potrf M ← trsm L, Xl ← trsv L, y ← gemv Xl, y ← syrk Xl read Xr[1] b in 1..blockcount: aio read Xr[b+1] aio wait Xr[b] Xrb ← trsm L, Xrb for Xri in Xr[b]: Sbl ← gemm Xri, Xl Sbr ← syrk Xri rb ← gemv Xri, y (LLT = M ) (X̃L = L−1 XL ) (ỹ = L−1 y) (r̃T = X̃LT ỹ) (ST L = X̃LT X̃L ) (X̃b = L−1 Xb ) T (SBLi = X̃R X̃L ) i T (XBRi = X̃R X̃Ri ) i T (r̃Bi = X̃R ỹ) i 15 16 17 18 3 r ← posv S, r aio wait r[b-1] aio write r[b] aio wait r[blockcount] (ri = Si−1 r̃i ) Increasing Performance by Using GPUs While the efficiency of the OOC-HP-GWAS algorithm is satisfactory, the computations can be sped up even more by leveraging multiple GPUs. With the help of a profiler, we determined (confirming the intuition), that the trsm at line 10 in Listing 1.2 is the bottleneck. Since cuBLAS provides a high-performance implementation of BLAS-3 routines, trsm it is the best candidate to be executed on GPUs. In this section, we introduce cuGWAS, an algorithm for a single GPU, and then extend it to an arbitrary number of GPUs. Before the trsm can be executed on a GPU, the algorithm has to transfer the necessary data. Since the size of L is around 800 MB, the matrix can be sent once during the preprocessing step and kept on the GPU throughout the entire computation. Unfortunately, the whole XR matrix weights in at several TB, way more than the 2 GB per buffer limit of a modern GPU. The same holds true for the result X̃Rb of the trsm, which needs to be sent back to main memory. Thus, there is no other choice than to send it in a block-by-block fashion, each block XRb weighting at most 2 GB. When profiled, a naı̈ve implementation of the algorithm displays a pattern (Fig. 3) typical for applications in which GPU-offloading is an after-thought: both GPU (green) and CPU (gray) need to wait for the data transfer (orange); furthermore, the CPU is idle while the GPU is busy and vice-versa. Fig. 3: Profiled timings of the naı̈ve implementation. Our first objective is to make use of the CPU while the GPU computes the trsm. Regrettably, all operations following the trsm (i.e. the for-loop at Lines 11–15 in Listing 1.2, which we will call the S-loop) are dependent on its result and thus cannot be executed in parallel. A way to break out of this dependency is to delay the S-loop by one block, in a pipeline fashion, so that the S-loop relative to the b-th block of XR is delayed and executed on the CPU, while the GPU executes the trsm with the (b+1)-th block. Thanks to this pipeline, we have broken the dependency and introduced more parallelism, completely removing the gray part of Fig. 3. 3.1 Streaming Data from HDD to GPU The second problem with the aforementioned naı̈ve implementation is the time wasted due to data transfers. Modern GPUs are capable of overlapping data transfers with computation. If properly exploited, this feature allows us to eliminate any overhead, and thus attain sustained peak performance on the GPU. The major obstacle is that the data is already being double-buffered from the hard-disk to the main memory. A quick analysis shows that when targeting two layers of double-buffering (one layer for disk ↔ main memory transfers and another layer for main memory ↔ GPU transfers), two buffers on each layer are not sufficient anymore. The idea here is to have two buffers on the GPU and three buffers on the CPU. The double-triple buffering can be illustrated from two perspectives: the tasks executed and the buffers involved. The former is presented in Fig. 4; we refer the reader to [7] for a thorough description. Here we only discuss the technique in terms of buffers. GPU GPU trsm b GPU trsm b+1 Send b+1 CPU HDD Recv b-1 Send b+2 CPU comp b-1 Recv b Read b+2 CPU b t Read b+3 Write b-1 CPU ⇄ GPU transfer GPU computation Data dependencies HDD ⇄ CPU transfer CPU computation Asynchronous dispatch Fig. 4: A task-perspective of the algorithm. Sizes are unrelated to runtime. In this single-GPU scenario, the size of the blocks XRb used in the GPU’s computation is equal to that on the CPU. When using multiple GPUs, this will not be the case anymore, as the CPU loads one large block and distributes portions of it to the GPUs. The GPU’s buffers are used in the same way as the CPU’s buffers in the simple CPU-only algorithm: While one buffer α is used for the computation, the data is transferred to and from the other buffer β. But on the CPU’s level (i.e. in RAM), three buffers are now necessary. For the sake of simplicity, we avoid the explanation of the initial and final iterations and start with iteration b. With reference to Fig. 5a, assume that the (b−1)-th, b-th and (b+1)-th blocks already reside in the GPU buffers β, α, and in the CPU buffer C, respectively. The block b − 1 (i.e. buffer β) contains the solution of the trsm of block b − 1. At this point, the algorithm proceeds by dispatching both the read of the second-next block b + 2 from disk into buffer A and the computation of the trsm on the GPU on buffer α, and by receiving the result from buffer β into buffer B. The first two operations are dispatched, i.e. they are executed asynchronously by the memory system and the GPU, while the last one is executed synchronously because these results are needed immediately in the following step. As soon as the synchronous transfer β → B completes, the transfer of the next block b + 1 from CPU buffer C to GPU buffer β is dispatched, and the S-loop is executed on the CPU for the previous block b − 1 in buffer B on the CPU (see Fig. 5b). trsm trsm GPU b-1 b β α GPUs HDD Data X Results r b+1 b-1 b+2 C B A b-3 b-2 b-1 b β α b+1 b-1 CPU/RAM b-1 b b+1 b+2 b+3 CPU/RAM HDD Data X Results r b-3 b-2 b-1 (a) Retrieve the previous result b − 1 from GPU, and the second-next block b + 2 of data from disk. Computation b+1 b-1 b+2 C B A b-2 b-3 b-1 b b+1 b+2 b+3 b-3 b-2 b-1 (b) Send the next block b + 1 from RAM to the GPU, execute the S-loop on b − 1 on the CPU. trsm GPUs CPU/RAM HDD Data X Results r b+1 b β α GPUs b+1 b-1 b+2 C B A b-3 b-2 b-1 b b+1 b+2 b-3 b-2 b-1 (c) Write the results b − 1 to disk. b+3 CPU/RAM HDD Data X Results r b+1 b β α b+1 b-1 b+2 C B A b-3 b-2 b-1 b b+1 b+2 b+3 b-3 b-2 b-1 (d) Switch buffers at both levels for the next iteration. Fig. 5: The multi-buffering algorithm as seen from a buffer perspective. As soon as the CPU is done computing the S-loop, its results are written to disk (Fig. 5c). Finally, once all transfers are done, buffers are rotated (through pointer or index rotations, not copies) according to Fig. 5d, and the loop continues with b ← b + 1. 3.2 Using Multiple GPUs This multi-buffering technique achieves sustained peak performance on one GPU. Since boards with many GPUs are becoming more and more common in high-performance computing, we explain here how our algorithm is adapted to take advantage of all the available parallelism. The idea is to increase the size of the XRb blocks by a factor as big as the number of available GPUs, and then split the trsm among these GPUs. As long as solving a trsm on the GPU takes longer than loading a large enough block XRb from HDD to CPU, this parallelization strategy holds up to any number of GPUs. Since in our systems loading the data from HDD was an order of magnitude faster than the computation of the trsm, the algorithm scales up to more GPUs than were available. Listing 1.3 shows the final version of cuGWAS.5 5 The conditions for the first and last pair of iterations are provided in parentheses on the right. 4 Results In order to show the speedups obtained with a single GPU, we compare the hybrid CPU-GPU algorithm presented in Listing 1.3 using one GPU with the CPU-only OOC-HP-GWAS. Then, to determine the scalability of cuGWAS, we compare its runtimes when leveraging 1, 2, 3 and 4 GPUs. In all of the timings, the time to initialize the GPU and the preprocessing (Lines 1–7 in Listing 1.3), both in the order of seconds, have not been measured. The GPU usually takes 5 s to fully initialize, and the preprocessing takes a few seconds too, but depends only on n and p. This omission is irrelevant for computations that run for hours. Listing 1.3: cuGWAS. The black bullet is a placeholder for “all GPUs”. 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 4.1 L ← potrf M (LLT = M ) cublas send L → L_gpu● Xl ← trsm L, Xl (X̃L = L−1 XL ) y ← trsv L, y (ỹ = L−1 y) rt ← gemv Xl, y (r̃T = X̃LT ỹ) Stl ← syrk Xl (ST L = X̃LT X̃L ) gpubs ← blocksize/ngpus for b in -1..blockcount+1: cu trsm wait α● (if b in 1..blockcount) cu send wait C● → β● (if b in 2..blockcount+1) (X̃b = L−1 Xb ) α● ← cu trsm async L_gpu● , α● (if b in 1..blockcount) aio read Xr[b+2] → A (if b in -1..blockcount-2) for gpu in 0..ngpus: (if b in 2..blockcount+1) cu recv B[gpu*gpubs..(gpu+1)*gpubs] ← βgpu aio wait Xr[b+1] → C (if b in 0..blockcount-1) for gpu in 0..ngpus: (if b in 0..blockcount-1) cu send async C[gpu*gpubs..(gpu+1)*gpubs] → βgpu for Xri in B: (if b in 2..blockcount+1) T Sbl ← gemm Xri, Xl (SBLi = X̃R X̃L ) i T Sbr ← syrk Xri (XBRi = X̃Ri X̃Ri ) T ỹ) rb ← gemv Xri, y (r̃Bi = X̃R i −1 r ← posv S, r (ri = Si r̃i ) aio wait r[b-2] (if b in 1..blockcount+1) aio write r[b-1] (if b in 1..blockcount+1) swap_buffers Single-GPU Results The experiments with a single-GPU were performed on the Quadro cluster at the RWTH Aachen University; the cluster is equipped with two nVidia Quadro 6000 GPUs and two Intel Xeon X5650 CPUs per node. The GPUs, which are powered by Fermi chips, have 6 GB of RAM and a theoretical double-precision computational power of 515 GFlops each. In total, the cluster has a GPU peak of 1.03 TFlops. The CPUs, which have six cores each, amount to a total of 128 GFlops and are supported by 24 GB of RAM. The cost of the combined GPUs is estimated to about $10 000 while the combined CPUs cost around $2000. Figure 6a shows the runtime of OOC-HP-GWAS along with that of cuGWAS, using one GPU. Thanks to our transfer-overlapping strategy, we can leverage the GPU’s peak performance and achieve a 2.6x speedup over a highly-optimized CPU-only implementation. cuBLAS’ trsm implementation attains about 60 % of the GPU’s peak performance, i.e. about 309 GFlops [8]. The peak performance of the CPU in this system amounts to 128 GFlops; if the whole computation were performed on the GPU at trsm’s rate, the largest speedup possible would be 2.4. We achieve 2.6 because the computation is pipelined: the S-loop is executed on the CPU, in perfect overlap with the GPU. This means that the performance of cuGWAS is perfectly in line with the theoretical peak. In addition, the figure indicates that the algorithm (1) has linear runtime in m and (2) allows us to cope with an arbitrary m. The red vertical line in the figure marks the largest value of m for which two blocks of XR fit into the GPU memory for n = 10 000. Without the presented multibuffering technique, it would not be possible to compute GWAS with more than m = 22 500 SNPs, while cuGWAS allows the solution of GWAS with any given amount of SNPs. 4.2 Scalability with Multiple GPUs To experiment with multiple GPUs, we used the Tesla cluster at the Universitat Jaume I in Spain, since it is equipped with an nVidia Tesla S2050 which contains four Fermi chips (same model as the Quadro system), for a combined GPU compute power of 2.06 TFlops, but with only 3 GB of RAM each. The host CPU is an Intel Xeon E5440 delivering approximately 90 GFlops. In order to evaluate the scalability of cuGWAS, we solved a GWAS with p = 4, n = 10 000, and m = 100 000 on the Tesla cluster, varying the number of GPUs. As it can be seen in Fig. 6b, the scalability of the algorithm with respect to the number of GPUs is almost ideal: Doubling the amount of GPUs reduces the runtime by a factor of 1.9. a) Runtime with respect to SNP count m b) Scalability with respect to GPU count 100 50 ⟵in-core out-of-core⟶ 37,5 Runtime [s] runtime [s] 75 50 25 25 12,5 0 0 0K 22,5K 45K 67,5K 90K m (SNP count) OOC-HP-GWAS cuGWAS 1GPU 1 2 3 4 Number of GPUs cuGWAS Ideal scalability Fig. 6: The runtime of our cuGWAS algorithm a) using 1GPU compared to OOC-HP-GWAS, using 1GPU and b) using a varying amount of GPUs. 5 Conclusion and Future Work We have presented a strategy which makes it possible to sustain peak performance on a GPU not only when the data is too big for the GPU’s memory, but also for main memory. In addition, we have shown how well this strategy lends itself to exploit an arbitrary number of GPUs. As described by the developers of ProbABEL, the solution of a problem of the size described in Section 1.4 by the GWFGLS algorithm took 4 hours. In contrast, with cuGWAS we solved the same problem in 2.88 s. Even accounting for about 6 seconds for the initialization and Moore’s Law (doubling the runtime as ProbABEL’s timings are from 2010), the difference is dramatic. We believe that the contribution of cuGWAS is an important step towards making GWAS practical. Software The code implementing the strategy explained in this paper is freely available at http: //github.com/lucasb-eyer/cuGWAS and http://lucas-b.eyer.be. Acknowledgements Financial support from the Deutsche Forschungsgemeinschaft (German Research Association) through grant GSC 111 is gratefully acknowledged. The authors thank Diego Fabregat-Traver for providing us with the source-code of OOC-HP-GWAS, the Center for Computing and Communication at RWTH Aachen for the resources, Enrique S. Quintana-Ortı́ for granting us access to the Tesla system as well as Yurii S. Aulchenko for intorducing us to the computational challenges of GWAS. References 1. Genome-Wide Association Studies, http://www.genome.gov/20019523 2. Fabregat-Traver, D., Bientinesi P.: Computing Petaflops over Terabytes of Data: The Case of GenomeWide Association Studies. CoRR. abs/1210.7683 (2012) 3. A Catalog of Published Genome-Wide Association Studies, www.genome.gov/ ⤦ Ç gwastudies/ 4. Fabregat-Traver, D., Aulchenko Y.S., Bientinesi P.: Solving Sequences of Generalized Least-Squares Problems on Multi-threaded Architectures. CoRR. abs/1210.7325 (2012) 5. Announcement Corrections: NCBI dbSNP Build 137 for Human, http://www.ncbi.nlm.nih.gov/mailman/pipermail/dbsnp- ⤦ Ç announce/2012q2/000123.html 6. Aulchenko, Y.S., Struchalin, M.V., Van Duijn, C.M.: ProbABEL package for genome-wide association analysis of imputed data. BMC Bioinformatics 11, p.134 (2010) 7. Beyer, L.: Exploiting Graphics Accelerators for Computational Biology. Diploma thesis (2012) 8. Volkov, V., Demmel, J.W.: Benchmarking GPUs to tune dense linear algebra. In: Proceedings of the 2008 ACM/IEEE conference on Supercomputing, pp. 31:1–31:11. IEEE Press, Piscataway (2008) 9. Quintana-Ortı́, G., Igual, F. D., Marqués, M., Quintana-Ortı́, E. S., Van de Geijn, R. A.: A run-time system for programming out-of-core matrix algorithms-by-tiles on multithreaded architectures. In: ACM Transactions on Mathematical Software 38 (4), pp. 25:1–25:25. ACM, New York (2012)
5cs.CE